/* ═══════════════════════════════════════════════════════════════════
   MAULE GPS CHOFER — Shell Layout (4 zonas, cero superposiciones)
═══════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; padding: 0; }
body {
  background: #060912;
  color: #fff;
  font-family: 'Rajdhani', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "topbar"
    "content"
    "actionbar"
    "bottomnav";
  height: 100dvh;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 212, 255, 0.08), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(0, 99, 188, 0.06), transparent 50%),
    #060912;
  overflow: hidden;
}

/* ─── Top Bar (zona 1) ─── */
.app-topbar {
  grid-area: topbar;
  padding: env(safe-area-inset-top, 0px) 0 0 0;
  background: rgba(8, 12, 22, 0.6);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 5;
}

/* ─── Content (zona 2) ─── */
.app-content {
  grid-area: content;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 14px 16px;
  position: relative;
  min-height: 0;
}
.app-content::-webkit-scrollbar { display: none; }
.app-content.fullbleed {
  padding: 0;
}

/* ─── Action Bar (zona 3, opcional) ─── */
.app-actionbar {
  grid-area: actionbar;
  padding: 10px 14px 10px;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 22, 0.95) 30%);
  position: relative;
  z-index: 6;
}

/* ─── Bottom Nav (zona 4, siempre) ─── */
.app-bottomnav {
  grid-area: bottomnav;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(8, 12, 22, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0, 212, 255, 0.12);
  z-index: 7;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

/* ─── Bottom Nav internals (5 tabs) ─── */
.mgps-bn {
  height: 76px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
}
.mgps-bn-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 4px;
  position: relative;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.mgps-bn-tab:active { transform: scale(0.94); }
.mgps-bn-tab.active { color: #00d4ff; }
.mgps-bn-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: #00d4ff;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.7);
}
.mgps-bn-icon-wrap { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.mgps-bn-icon-wrap svg { width: 24px; height: 24px; }
.mgps-bn-tab.active .mgps-bn-icon-wrap svg { filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6)); }
.mgps-bn-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── TopBar contenido común ─── */
.tb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 64px;
}
.tb-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 99, 188, 0.15));
  border: 2px solid rgba(0, 212, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #00d4ff;
  flex-shrink: 0;
}
.tb-grow { flex: 1; min-width: 0; }
.tb-line {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.3px;
}
.tb-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.tb-icon-btn svg { width: 18px; height: 18px; }
.tb-icon-btn:active { transform: scale(0.92); }
.tb-icon-btn.danger {
  background: rgba(255, 51, 85, 0.1);
  border-color: rgba(255, 51, 85, 0.4);
  color: #ff5577;
}
.tb-icon-btn.muted {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
}

/* ─── ActionBar primary CTA ─── */
.ab-cta {
  width: 100%;
  height: 60px;
  border-radius: 14px;
  border: none;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 14px;
}
.ab-cta:active { transform: scale(0.98); }
.ab-cta.primary {
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  color: #060912;
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.45);
}
.ab-cta.success {
  background: linear-gradient(135deg, #00ff88, #00cc6a);
  color: #060912;
  box-shadow: 0 8px 24px rgba(0, 255, 136, 0.5);
  animation: ab-pulse 2.4s ease-in-out infinite;
}
.ab-cta.danger {
  background: rgba(255, 51, 85, 0.14);
  border: 1.5px solid rgba(255, 51, 85, 0.5);
  color: #ff5577;
}
@keyframes ab-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 255, 136, 0.5); }
  50%      { box-shadow: 0 8px 32px rgba(0, 255, 136, 0.75); }
}
