/* =========================================================
   PWA Petrogas — BLOQUE ÚNICO (sin duplicados)
   Incluye: bridge de variables, layout, cards, botones, navbar, header
   ========================================================= */

/* ---------- Bridge de variables (usar paleta institucional) ---------- */
:root{
  --pg-primary: var(--color-primary);
  --pg-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* ---------- Layout base ---------- */
.pg-container { flex: 1; padding: 16px; }

/* Grid del dashboard (solo dashboard) */
.dashboard-grid{
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ---------- Cards (dashboard y genéricas) ---------- */
.card, .pg-card{
  background: #fff;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.card:hover, .pg-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
}

/* Métricas (tipos, tamaños e info secundaria) */
.pg-metric i{ font-size: 22px; color: var(--color-primary); margin-bottom: 6px; }
.pg-metric h3{ margin-bottom: 6px; font-size: 1rem; color: var(--color-primary); font-weight: 700; }
.pg-metric span{ display: block; font-size: 1.25rem; font-weight: 800; color: var(--color-text); }
.pg-metric small{ font-size: .8rem; color: var(--color-text-muted); }

/* Deja espacio para el navbar fijo (una sola vez) */
body.pg-body { padding-bottom: 64px; }

.pg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;       /* no ocupa todo el ancho */
  margin: 16px auto;
  padding: 0 10px;
}

.pg-btncard--list {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 8px 12px;
  min-height: 44px;       /* accesible en mobile */
  border: 1px solid var(--color-primary);
  border-radius: 8px;

  background: #fff;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;

  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: background .2s, color .2s, box-shadow .2s;
}

.pg-btncard--list:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.pg-btncard--list i {
  font-size: 1rem;
}

.pg-btncard-text {
  flex: 1;
  margin-left: 6px;
}

.pg-btncard--list .pg-chev {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ---------- Navbar inferior fijo ---------- */
nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;

  display: flex;              /* siempre fila */
  flex-direction: row !important;
  justify-content: space-around;
  align-items: center;

  background: var(--color-secondary);
  color: #fff;
  padding: 6px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,.15);
}

nav a,
nav #pg-offline-pill {
  flex: 1 1 0;
  text-align: center;
  text-decoration: none;
  color: #bfc6d4;

  display: flex;
  flex-direction: column;     /* ícono arriba, texto abajo */
  align-items: center;
  gap: 2px;

  font-size: 12px;
  padding: 4px 0;
  transition: color .15s ease;
}

nav a i,
nav #pg-offline-pill i {
  font-size: 18px;
  margin-bottom: 2px;
}

nav a:hover,
nav a.active {
  color: var(--color-primary-light);
}

#pg-offline-pill {
  opacity: .7;
  pointer-events: none;
}

.pg-hidden {
  display: none !important;
}

/* espacio para que el navbar no tape contenido */
body.pg-body {
  padding-bottom: 64px;
}

/* ===== FIX tamaño de títulos en headers ===== */
.pg-header h1{
  margin: 0;
  font-size: 1.05rem;   /* antes heredaba 2em del navegador */
  line-height: 1.2;
  font-weight: 700;
  color: inherit;
}

/* Variante centrada institucional (Seguridad/Taller/Vehículos) */
.pg-header--center{
  background: #fff;
  color: var(--color-primary);
  text-align: center;
  border-bottom: 2px solid var(--color-primary);
  box-shadow: none;
}
.pg-header--center h1{
  margin: 8px 0 10px;
  font-size: 1.05rem !important;  /* compacto y consistente */
  font-weight: 800;
  letter-spacing: .2px;
}

/* opcional: título de sección dentro del contenido */
.pg-title{
  margin: 8px 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
}

/* ===== Logo dentro de headers (mapa / marca) ===== */
.pg-brand {
  height: 22px;              /* tamaño fijo, más compacto */
  max-height: 24px;
  width: auto;
  vertical-align: middle;    /* alinea con el texto */
  margin-right: 6px;
}

.pg-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 auto;
  font-weight: 500;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.pg-alert--success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.pg-alert--error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.pg-alert--warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.pg-alert--info {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px solid #0ea5e9;
}

.pg-user-info {
  font-size: 0.9rem;
  color: #21409A;
  margin-top: 4px;
  text-align: center;
  font-weight: 500;
}


#overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
#overlay .spinner {
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #21409A;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}