/* ==========================================================================
   PROGRAMA DE DIÁRIAS - DESIGN SYSTEM & ESTILOS PRINCIPAIS
   Paleta moderna com suporte a glassmorphism, microinterações e modo responsivo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Cores Primárias e Acentos */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Cores de Fundo e Superfícies */
  --bg-main: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  
  /* Textos */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Status Colors */
  --status-pending-bg: #fef3c7;
  --status-pending-text: #b45309;
  --status-approved-bg: #dcfce7;
  --status-approved-text: #15803d;
  --status-paid-bg: #e0f2fe;
  --status-paid-text: #0369a1;
  --status-rejected-bg: #fee2e2;
  --status-rejected-text: #b91c1c;

  /* Bordas e Sombras */
  --border-color: #e2e8f0;
  --border-focus: #6366f1;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Dimensões e Raios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-width: 240px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

#app-container {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 28px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-500), #8b5cf6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-light);
  display: block;
}

.nav-menu {
  list-style: none;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.925rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.2s;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
  color: #ffffff;
  border: 1px solid rgba(129, 140, 248, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active svg {
  stroke: var(--primary-400);
  transform: scale(1.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.system-status-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a7f3d0;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

/* CONTEÚDO PRINCIPAL */
.main-wrapper {
  margin-left: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8fafc;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* TOPBAR */
.topbar {
  min-height: 58px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-sizing: border-box;
  width: 100%;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

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

/* CONTENT CONTAINER */
.content-area {
  padding: 16px 18px;
  flex: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  min-width: 0;
}

/* ==========================================================================
   COMPONENTES UI & ESTILOS GERAIS
   ========================================================================== */

.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 260px;
}

.card-icon {
  width: 38px;
  height: 38px;
  background-color: var(--primary-50);
  color: var(--primary-600);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 20px;
  height: 20px;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-500);
}

.stat-card.approved::before { background: #10b981; }
.stat-card.pending::before { background: #f59e0b; }
.stat-card.total::before { background: #6366f1; }
.stat-card.trips::before { background: #0ea5e9; }

.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.stat-helper {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-top: 4px;
}

.stat-badge-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card.approved .stat-badge-icon { background: #dcfce7; color: #15803d; }
.stat-card.pending .stat-badge-icon { background: #fef3c7; color: #b45309; }
.stat-card.total .stat-badge-icon { background: #e0e7ff; color: #4338ca; }
.stat-card.trips .stat-badge-icon { background: #e0f2fe; color: #0284c7; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: normal;
  text-align: center;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-subtle);
  border-color: #cbd5e1;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fca5a5;
  color: #991b1b;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* FORMS & INPUTS */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group label span.required {
  color: #ef4444;
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  transition: all 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control:disabled, .form-control[readonly] {
  background-color: #f1f5f9;
  cursor: not-allowed;
  color: #64748b;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* BADGES ESPECÍFICOS DE ROTAS DA TRANSPORTADORA */
.badge-mista {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  color: #9a3412;
  border: 1px solid #fdba74;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-capital {
  display: inline-flex;
  align-items: center;
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-interior {
  display: inline-flex;
  align-items: center;
  background-color: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
}

/* CARDS DE SELEÇÃO DE TIPO DE ROTA */
.route-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.route-option-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.route-option-card:hover {
  border-color: var(--primary-400);
  background-color: var(--primary-50);
}

.route-option-card input[type="radio"] {
  display: none;
}

.route-option-card:has(input[type="radio"]:checked) {
  border-color: var(--primary-600);
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.route-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.route-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* BANNER DE AVISO OBRIGATÓRIO DE DIÁRIAS */
.alert-banner-obrigatorio {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-left: 6px solid #d97706;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.alert-banner-obrigatorio .alert-icon-box {
  width: 44px;
  height: 44px;
  background: #d97706;
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.alert-banner-obrigatorio .alert-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #92400e;
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.alert-banner-obrigatorio .alert-desc {
  font-size: 0.88rem;
  color: #b45309;
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
}

.alert-banner-obrigatorio .alert-sub {
  font-size: 0.78rem;
  color: #92400e;
  margin-top: 4px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .alert-banner-obrigatorio {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* BANNER DE INFORMAÇÃO DO DIA 22 */
.info-banner-dia22 {
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.info-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.info-banner-icon {
  width: 42px;
  height: 42px;
  background: #3b82f6;
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
}

.info-banner-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
}

.info-banner-text p {
  font-size: 0.82rem;
  color: #3b82f6;
}

/* REAL-TIME PREVIEW BOX IN FORM */
.calc-preview-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.calc-preview-title {
  font-weight: 700;
  color: #166534;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 14px;
  border-radius: var(--radius-md);
}

.calc-item {
  display: flex;
  flex-direction: column;
}

.calc-item span.label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}

.calc-item span.val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.calc-total-item {
  grid-column: 1 / -1;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-total-item span.total-label {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.calc-total-item span.total-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-700);
  font-family: 'Outfit', sans-serif;
}

/* DATA TABLES */
.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* STATUS BADGES */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.pendente {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.status-badge.aprovada {
  background-color: var(--status-approved-bg);
  color: var(--status-approved-text);
}

.status-badge.paga {
  background-color: var(--status-paid-bg);
  color: var(--status-paid-text);
}

.status-badge.rejeitada {
  background-color: var(--status-rejected-bg);
  color: var(--status-rejected-text);
}

/* TABLE SEARCH & FILTER BAR */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 400px;
}

.search-box input {
  padding-left: 38px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

.modal-box.modal-lg {
  max-width: 850px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.success { background: #065f46; border-left: 4px solid #34d399; }
.toast.error { background: #991b1b; border-left: 4px solid #f87171; }
.toast.info { background: #1e3a8a; border-left: 4px solid #60a5fa; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* RECEIPT / PRINTABLE DOCUMENT STYLES */
.printable-receipt {
  background: #ffffff;
  padding: 30px;
  color: #000000;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.4;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.receipt-header h2 {
  font-size: 1.25rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.receipt-header p {
  font-size: 0.85rem;
  color: #333;
}

.receipt-num {
  font-weight: 700;
  margin-top: 6px;
  display: inline-block;
  background: #eee;
  padding: 3px 12px;
  border-radius: 4px;
}

.receipt-section {
  margin-bottom: 18px;
}

.receipt-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #f1f5f9;
  padding: 4px 8px;
  border-left: 4px solid #0f172a;
  margin-bottom: 8px;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  font-size: 0.85rem;
}

.receipt-field {
  display: flex;
  flex-direction: column;
}

.receipt-field span.f-label {
  font-size: 0.75rem;
  color: #555;
  font-weight: 600;
}

.receipt-field span.f-val {
  font-weight: 600;
  color: #000;
}

.receipt-signatures {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  text-align: center;
}

.signature-line {
  border-top: 1px solid #000;
  padding-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   PRINT MEDIA QUERY (Para salvar direto em PDF com perfeição)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .sidebar, .topbar, .modal-footer, .filter-bar, .btn, #toast-container, .nav-menu {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .content-area {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .modal-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-box {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .modal-header {
    display: none !important;
  }

  .printable-receipt {
    padding: 0 !important;
  }
}

/* RESPONSIVIDADE */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .col-8, .col-6, .col-4, .col-3 {
    grid-column: span 12;
  }
}

/* ==========================================================================
   ESTILOS ESPECÍFICOS: CIDADES & ESTADOS DO NORDESTE
   ========================================================================== */

/* BADGES DE ESTADO (UF) */
.badge-uf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  letter-spacing: 0.5px;
}

/* ABAS / PILLS DE ESTADOS DO NORDESTE */
.state-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.state-pill-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.state-pill-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.state-pill-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.state-pill-btn .pill-count {
  font-size: 0.72rem;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.state-pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* CARDS DE RESUMO DE ESTADOS */
.states-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.state-stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.state-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.state-stat-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

/* PAGINAÇÃO DE CIDADES */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-main);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-700);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

