/* ==========================================================================
   MinhaLinha SP - Design System & Estilização Moderna
   Otimizado para Mobile (9:16 / 1080x1920) e adaptativo para Desktop
   ========================================================================== */

:root {
  /* Cores Canônicas dos Trilhos SP */
  --line-l01: #00539F; /* Linha 1 - Azul */
  --line-l02: #008060; /* Linha 2 - Verde */
  --line-l03: #EE3E32; /* Linha 3 - Vermelha */
  --line-l04: #FED304; /* Linha 4 - Amarela */
  --line-l05: #773F8B; /* Linha 5 - Lilás */
  --line-l15: #8F9A9E; /* Linha 15 - Prata */
  --line-l07: #CA016B; /* Linha 7 - Rubi */
  --line-l08: #97999B; /* Linha 8 - Diamante */
  --line-l09: #009B77; /* Linha 9 - Esmeralda */
  --line-l10: #00829B; /* Linha 10 - Turquesa */
  --line-l11: #F04E23; /* Linha 11 - Coral */
  --line-l12: #1C2D6C; /* Linha 12 - Safira */
  --line-l13: #00A859; /* Linha 13 - Jade */

  /* Estados Funcionais */
  --status-ok: #10B981;
  --status-warning: #F59E0B;
  --status-danger: #EF4444;
  --status-neutral: #64748B;

  /* Tema Escuro Padrão */
  --bg-body: #070B14;
  --bg-surface: #0E1626;
  --bg-surface-elevated: #162238;
  --bg-card: rgba(18, 27, 46, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38BDF8;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --map-bg: #0B111E;
}

[data-theme="light"] {
  --bg-body: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-subtle: #E2E8F0;
  --border-focus: #0284C7;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --shadow-card: 0 4px 15px -2px rgba(15, 23, 42, 0.07);
  --map-bg: #E2E8F0;
}

/* Reset e Configuração Básica */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.45;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Contêiner Móvel 9:16 (Centralizado em telas largas, nativo em celulares) */
.mobile-app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Banner de Alerta Offline */
.offline-banner {
  background: #B91C1C;
  color: #FFF;
  text-align: center;
  font-size: 0.8rem;
  padding: 6px 12px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Header Principal */
.app-header {
  padding: 14px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #00539F, #EE3E32);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 83, 159, 0.4);
}

.app-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-sp {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--border-subtle);
  transform: translateY(-1px);
}

.spin-anim svg {
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Banner de Resumo Global */
.global-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.banner-ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10B981;
}

.banner-alert {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #F59E0B;
}

.banner-text {
  display: flex;
  flex-direction: column;
}

.banner-text span {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ticker-row {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SEÇÃO DO MAPA ESQUEMÁTICO (SPLIT VIEW)
   ========================================================================== */

.map-section {
  background-color: var(--map-bg);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  height: 520px; /* Mapa mais alto conforme solicitado */
  max-height: 65vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.map-wrapper {
  position: relative;
  min-width: 1100px; /* Espaço suficiente para todas as paradas metropolitanas */
  width: 100%;
}

.schematic-svg {
  width: 100%;
  height: auto;
  min-height: 510px;
  display: block;
}

.map-line-path {
  cursor: pointer;
  transition: stroke-width 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.map-line-path:hover {
  stroke-width: 11px !important;
}

.line-highlighted {
  stroke-width: 12px !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.line-dimmed {
  opacity: 0.15 !important;
}

/* Rótulos das Estações inclinados a ~50 graus como no mapa oficial do Metrô SP */
.station-text-50 {
  font-size: 8.5px;
  font-weight: 600;
  fill: var(--text-primary);
  text-anchor: start;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 3px rgba(0, 0, 0, 0.7);
  user-select: none;
}

.station-major-50 {
  font-size: 10px;
  font-weight: 800;
  fill: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 1), 0 0 6px rgba(0, 0, 0, 0.9);
}

.station-tick {
  stroke-linecap: round;
  pointer-events: none;
}

.station-node-dot {
  cursor: pointer;
  transition: r 0.2s ease, fill 0.2s ease;
}

.station-node-dot:hover {
  r: 6px;
  fill: #38BDF8;
}

/* Sinalizador Pulsante de Alerta no Mapa */
.alert-beacon {
  cursor: pointer;
  transform-origin: center;
}

.pulse-ring {
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  transform-origin: 0 0;
}

.pulse-ring-2 {
  animation-delay: 0.6s;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.pulse-core {
  animation: pulse-core 1s ease-in-out infinite alternate;
}

@keyframes pulse-core {
  from { transform: scale(0.9); }
  to { transform: scale(1.15); }
}

.map-controls {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.map-btn {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.map-legend-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ==========================================================================
   PAINEL DE CARDS / DRAWER
   ========================================================================== */

.drawer-section {
  flex: 1;
  padding: 14px 16px 80px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-bar-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}

/* Lista de Cards */
.lines-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.line-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.line-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-selected-pulse {
  animation: card-pulse 1.2s ease-in-out;
}

@keyframes card-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { transform: scale(1); }
}

.card-left-bar {
  width: 6px;
  flex-shrink: 0;
}

.card-main {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.line-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-roundel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.line-title-group {
  display: flex;
  flex-direction: column;
}

.line-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.line-operator {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Pílula de Informação sobre Integração Tarifada / Gratuita */
.integracao-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 0.69rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  width: fit-content;
  line-height: 1.25;
}

.integracao-gratis {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.integracao-paga {
  background: rgba(245, 158, 11, 0.14);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.integracao-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.integracao-gratis .integracao-dot {
  background: #10B981;
}

.integracao-paga .integracao-dot {
  background: #F59E0B;
}

/* Badges de Status */
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}
.badge-normal .status-dot {
  background: #10B981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #F59E0B;
}
.badge-warning .status-dot {
  background: #F59E0B;
  animation: pulse-dot 1.2s infinite;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}
.badge-danger .status-dot {
  background: #EF4444;
  animation: pulse-dot 0.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.6; }
}

/* ==========================================================================
   ACORDEÃO DOS CARDS (SANFONA)
   ========================================================================== */
.card-header-clickable {
  cursor: pointer;
  user-select: none;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-chevron {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.line-card.card-expanded .accordion-chevron {
  transform: rotate(180deg);
  color: var(--text-primary);
  background: var(--border-subtle);
}

.card-accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin 0.22s ease;
  opacity: 0;
  overflow: hidden;
  margin: 0;
}

.line-card.card-expanded .card-accordion-content {
  grid-template-rows: 1fr;
  opacity: 1;
  margin: 6px 0 8px 0;
}

.card-accordion-inner {
  min-height: 0;
  overflow: hidden;
}

.expand-toggle-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

/* Caixa Dual-Status: Empresa (Capacete) vs Passageiros (Pessoa) */
.source-dual-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.source-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.77rem;
  line-height: 1.35;
  transition: all 0.2s;
}

/* Linha da Empresa (👷 Capacete) */
.source-row-helmet {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Linha dos Passageiros (👤 Pessoa) */
.source-row-passenger {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.source-row-alert {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.source-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  text-transform: uppercase;
}

.badge-pill-helmet {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-pill-passenger {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-pill-alert {
  background: rgba(239, 68, 68, 0.25);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

/* Linha de Obras e Intervenções Programadas (🚧 Obras / Fim de Semana) */
.source-row-obras {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.28);
}

.badge-pill-obras {
  background: rgba(168, 85, 247, 0.2);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.source-obras-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.source-obras-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #C084FC;
  font-weight: 700;
  font-size: 0.71rem;
}

.source-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.source-text {
  color: var(--text-primary);
  font-size: 0.76rem;
}

.source-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.source-tag-redes {
  color: #38BDF8;
  font-weight: 600;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 2px;
}

.card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-card-map, .btn-card-report {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-card-map:hover, .btn-card-report:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-card-report {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-card-report:hover {
  background: #EF4444;
  color: #FFF;
}

/* ==========================================================================
   BOTÃO FLUTUANTE DE REPORTE (FAB)
   ========================================================================== */

.fab-report {
  position: fixed;
  bottom: 20px;
  right: max(16px, calc(50vw - 220px));
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFF;
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab-report:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

/* ==========================================================================
   MODAL DIALOG NATIVO (HTML5 <dialog>)
   ========================================================================== */

dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 440px;
  width: 90%;
  margin: auto;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.dialog-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.dialog-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-dialog {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.btn-close-dialog:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

.dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-select, .form-textarea {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
}

.problem-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.problem-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.problem-chip.chip-active {
  background: rgba(239, 68, 68, 0.15);
  border-color: #EF4444;
  color: #EF4444;
}

.direction-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dir-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.dir-btn.dir-active {
  border-color: var(--border-focus);
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.1);
}

.cooldown-alert {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #F59E0B;
  color: #F59E0B;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  display: none;
}

.dialog-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary-report {
  background: #EF4444;
  border: none;
  color: #FFF;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary-report:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   SISTEMA DE TOAST FLOATING
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast-pill {
  padding: 10px 16px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-fadeout {
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}

.toast-success {
  background: #065F46;
  color: #A7F3D0;
}
.toast-success .toast-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34D399;
}

.toast-warning {
  background: #78350F;
  color: #FDE68A;
}
.toast-warning .toast-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #FBBF24;
}

.toast-info {
  background: #1E293B;
  color: #F8FAFC;
}
.toast-info .toast-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #38BDF8;
}

/* ==========================================================================
   ESTILOS DOS 8 PLUGINS MINHALINHA
   ========================================================================== */

/* 1. Barra de Acesso Rápido Superior & Clima */
.quick-nav-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px 4px;
  scrollbar-width: none;
}
.quick-nav-bar::-webkit-scrollbar { display: none; }

.quick-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.quick-nav-btn:active { transform: scale(0.96); }

.weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  color: #38BDF8;
  font-size: 0.72rem;
  font-weight: 700;
}
.weather-city-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 2. Banner Noturno do Último Trem */
.night-mode-banner {
  background: linear-gradient(90deg, #1E1B4B 0%, #312E81 100%);
  border: 1px solid #4338CA;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: banner-glow 3s infinite alternate;
}
.night-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #E0E7FF;
}
.night-icon { font-size: 1.1rem; }
@keyframes banner-glow {
  from { box-shadow: 0 0 5px rgba(67, 56, 202, 0.2); }
  to { box-shadow: 0 0 15px rgba(67, 56, 202, 0.5); }
}

/* 3. Planejador de Rotas Inteligente */
.planner-section {
  padding: 0 12px;
  margin-bottom: 10px;
}
.planner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--bg-surface);
  transition: background 0.2s;
}
.planner-header:hover { background: var(--bg-surface-elevated); }
.planner-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.planner-icon { font-size: 1.4rem; }
.planner-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.planner-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.planner-collapse-arrow {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.planner-header.is-open .planner-collapse-arrow {
  transform: rotate(180deg);
}

.planner-body {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
}
.route-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.route-inputs-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.input-field-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.input-field-group label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.input-field-group input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 0.8rem;
  box-sizing: border-box;
}
.btn-swap {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-calc-route {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-calc-route:active { transform: scale(0.98); }

/* Resultado da Rota */
.route-result {
  margin-top: 14px;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 12px;
}
.planner-loading {
  text-align: center;
  padding: 16px 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.route-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.total-min-number {
  font-size: 2rem;
  font-weight: 900;
  color: #10B981;
  line-height: 1;
}
.total-min-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}
.dest-weather-pill {
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  text-align: right;
}
.transfers-count {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
  text-align: right;
}

.escape-route-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid #EF4444;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  font-size: 0.76rem;
  color: #FCA5A5;
}
.escape-icon { font-size: 1.3rem; }

.steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.step-card {
  display: flex;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
}
.step-badge-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: #fff;
}
.transfer-circle { background: #6B7280; }
.step-content { flex: 1; }
.step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.step-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.step-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Plugin: Tô com Pressa (Vagões & Portas) */
.platform-guide-box {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3B82F6;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 6px;
}
.tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tip-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}
.door-badge {
  font-size: 0.68rem;
  color: var(--text-primary);
}
.train-cars-visual {
  display: flex;
  gap: 4px;
  margin: 6px 0;
}
.train-car {
  flex: 1;
  height: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
}
.train-car.car-highlight {
  background: #059669;
  border-color: #10B981;
  color: #fff;
}
.train-car.car-highlight .car-indicator {
  position: absolute;
  top: -12px;
  font-size: 0.52rem;
  background: #10B981;
  color: #fff;
  padding: 0 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.tip-reason {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Plugin: Mobilidade / Smart Escape */
.escape-actions-card {
  background: var(--bg-surface-elevated);
  border: 1px solid #EF4444;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
}
.escape-actions-card h4 {
  font-size: 0.8rem;
  margin: 0 0 4px;
  color: #F87171;
}
.car-price-est {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin: 0 0 8px;
}
.escape-buttons-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.btn-escape-uber, .btn-escape-99 {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
}
.btn-escape-uber { background: #000; color: #fff; }
.btn-escape-99 { background: #FFC000; color: #000; }
.bus-corridor-tip {
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 6px;
}

/* 4. Subbadges dos Cards de Linha */
.line-subbadges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.last-train-badge {
  font-size: 0.66rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.badge-normal {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}
.badge-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid #EF4444;
  animation: pulse-urgent 1.5s infinite;
}
@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.badge-closed {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}
.crowd-pill {
  font-size: 0.66rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.pill-ok { background: rgba(16, 185, 129, 0.12); color: #34D399; }
.pill-alert { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }

/* 5. TermoMETRÔ (1-Toque no Acordeão) */
.quick-crowd-section {
  padding: 10px 0 4px;
  border-top: 1px dashed var(--border-subtle);
  margin-top: 8px;
}
.quick-crowd-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.quick-crowd-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.btn-quick-crowd {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.btn-quick-crowd:active {
  transform: scale(0.96);
  background: rgba(59, 130, 246, 0.2);
}

/* 6. MinhaEstação (AMOLED Black Overlay & Despertador) */
.wake-alarm-overlay {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.amoled-sleep-screen {
  text-align: center;
  color: #fff;
  max-width: 340px;
}
.sleep-pulse-icon {
  font-size: 3.5rem;
  animation: pulse-moon 2.5s infinite ease-in-out;
}
@keyframes pulse-moon {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}
.sleep-station-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #fff;
}
.sleep-message {
  font-size: 0.85rem;
  color: #A1A1AA;
  line-height: 1.4;
}
.sleep-telemetry {
  margin: 20px 0;
  font-size: 0.78rem;
  color: #38BDF8;
  font-family: monospace;
}
.btn-cancel-sleep {
  background: #18181B;
  border: 1px solid #3F3F46;
  color: #A1A1AA;
  font-size: 0.84rem;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
}

.alarm-triggered-screen {
  position: fixed;
  inset: 0;
  background: #DC2626;
  color: #fff;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  animation: flash-alarm 0.6s infinite alternate;
}
@keyframes flash-alarm {
  from { background: #DC2626; }
  to { background: #991B1B; }
}
.alarm-bell-anim {
  font-size: 4rem;
  animation: shake-bell 0.3s infinite;
}
@keyframes shake-bell {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}
.alarm-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 12px 0 6px;
}
.alarm-sub {
  font-size: 0.9rem;
}
.btn-dismiss-alarm {
  background: #fff;
  color: #000;
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.alarm-setup-dialog .dialog-box { max-width: 380px; }
.alarm-intro-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}
.alarm-radius-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-primary);
  cursor: pointer;
}
.btn-primary-alarm {
  background: #2563EB;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

/* 7. Hub de Saldo & Recarga */
.recharge-dialog .dialog-box { max-width: 440px; }
.recharge-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.recharge-tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: var(--bg-surface-elevated);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.recharge-tab-btn.active {
  background: #2563EB;
  color: #fff;
}
.recharge-tab-content { display: none; }
.recharge-tab-content.active { display: block; }
.card-hero-banner {
  padding: 14px;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-brand { font-size: 1.1rem; font-weight: 800; }
.card-scope { font-size: 0.72rem; opacity: 0.9; }
.top-gradient { background: linear-gradient(135deg, #1E3A8A, #3B82F6); }
.bu-gradient { background: linear-gradient(135deg, #991B1B, #EF4444); }
.recharge-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.provider-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.provider-btn-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
}
.provider-btn-action:hover {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.08);
}
.provider-info strong {
  display: block;
  font-size: 0.8rem;
}
.provider-info small {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.provider-arrow { font-size: 1rem; color: var(--text-muted); }
.recharge-tips-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #F59E0B;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
