﻿/* ===========================
   DASHBOARD - CSS
   =========================== */

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

:root {
  /* === Paleta DARK premium (Linear / Vercel / fintech) === */
  --bg-main:        #020817;
  --bg-card:        rgba(30, 41, 59, 0.78);
  --bg-card-solid:  #1e293b;
  --bg-elevated:    rgba(30, 41, 59, 0.92);
  --bg-glass:       rgba(30, 41, 59, 0.55);
  --bg-hover:       rgba(96, 165, 250, 0.08);

  --primary:        #2563eb;
  --primary-hover:  #3b82f6;
  --primary-glow:   rgba(37, 99, 235, 0.45);
  --accent-cyan:    #22d3ee;

  --text-main:      #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;
  --text-subtle:    #64748b;

  --border:         rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.16);
  --border-hover:   rgba(96, 165, 250, 0.40);

  --blur:           14px;
  --radius:         12px;
  --radius-lg:      16px;

  --shadow:         0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-elevated:0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow:    0 0 0 1px var(--border), 0 16px 40px rgba(2, 6, 23, 0.55);
  --shadow-primary: 0 8px 24px rgba(37, 99, 235, 0.35);

  --transition:     0.25s ease;

  /* === Aliases legacy (mantêm contratos do CSS existente) === */
  --navy:      #0b1220;
  --navy-mid:  #0f172a;
  --blue:      var(--primary);
  --blue-light:#60a5fa;
  --cyan:      var(--accent-cyan);
  --accent:    #34d399;

  --white:     #f8fafc;
  --grey-50:   rgba(255, 255, 255, 0.03);
  --grey-100:  rgba(255, 255, 255, 0.06);
  --grey-200:  rgba(255, 255, 255, 0.10);
  --grey-300:  rgba(255, 255, 255, 0.16);
  --grey-400:  #94a3b8;
  --grey-500:  #64748b;
  --grey-600:  #cbd5e1;
  --grey-800:  #f1f5f9;

  --red:   #f87171;
  --green: #34d399;
}

/* =====================================================================
   =====  TEMA: MARSH LIGHT (moderno, premium, vibe Vercel/Linear) =====
   ===================================================================== */
:root[data-theme="light"] {
  --bg-main:        #f5f5f7;
  --bg-card:        rgba(255, 255, 255, 0.78);
  --bg-card-solid:  #ffffff;
  --bg-elevated:    rgba(255, 255, 255, 0.94);
  --bg-glass:       rgba(255, 255, 255, 0.6);
  --bg-hover:       rgba(37, 99, 235, 0.06);

  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-glow:   rgba(37, 99, 235, 0.22);
  --accent-cyan:    #0891b2;

  --text-main:      #0a0a0a;
  --text-secondary: #1f2937;
  --text-muted:     #525252;
  --text-subtle:    #737373;

  --border:         rgba(15, 23, 42, 0.10);
  --border-strong:  rgba(15, 23, 42, 0.18);
  --border-hover:   rgba(37, 99, 235, 0.45);

  --shadow:         0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-elevated:0 12px 32px rgba(15, 23, 42, 0.14);
  --shadow-primary: 0 8px 24px rgba(37, 99, 235, 0.22);

  /* legacy aliases */
  --navy:      #0a0a0a;
  --navy-mid:  #1f2937;
  --white:     #ffffff;
  --grey-50:   #f8fafc;
  --grey-100:  #f1f5f9;
  --grey-200:  #e2e8f0;
  --grey-300:  #cbd5e1;
  --grey-400:  #94a3b8;
  --grey-500:  #64748b;
  --grey-600:  #475569;
  --grey-800:  #1e293b;
  --red: #ef4444;
  --green: #10b981;
}

/* Light: overlay claro sobre o bg image — passa quase imperceptível, mantém glass */
:root[data-theme="light"] body {
  background-image:
    linear-gradient(180deg, rgba(245, 245, 247, 0.86) 0%, rgba(245, 245, 247, 0.94) 60%, rgba(245, 245, 247, 0.98) 100%),
    url('background-1.png');
  color-scheme: light;
}
@supports (background-image: image-set(url(x.webp) type("image/webp"))) {
  :root[data-theme="light"] body {
    background-image:
      linear-gradient(180deg, rgba(245, 245, 247, 0.86) 0%, rgba(245, 245, 247, 0.94) 60%, rgba(245, 245, 247, 0.98) 100%),
      image-set(url('background-1.webp') type('image/webp'), url('background-1.png') type('image/png'));
  }
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(700px circle at 12% 18%, rgba(37, 99, 235, 0.05), transparent 60%),
    radial-gradient(700px circle at 88% 82%, rgba(8, 145, 178, 0.04), transparent 60%);
}

/* Light: sidebar permanece dark (contraste premium estilo Linear) */
:root[data-theme="light"] .sidebar {
  background: rgba(10, 10, 10, 0.92);
}
:root[data-theme="light"] .nav-link { color: rgba(245, 245, 247, 0.72); }
:root[data-theme="light"] .nav-link:hover { color: #fff; }
:root[data-theme="light"] .sidebar-header h2,
:root[data-theme="light"] .sidebar-footer { color: rgba(245, 245, 247, 0.55); }

/* Light: header glass claro */
:root[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 0 rgba(15,23,42,0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .user-info {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
}

/* Light: gradients de texto perdem força (fica preto) */
:root[data-theme="light"] .header h1,
:root[data-theme="light"] .page-header h2,
:root[data-theme="light"] .modal-header h3 { color: var(--text-main); }

/* Light: stat-card */
:root[data-theme="light"] .stat-card {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
:root[data-theme="light"] .stat-card::before { opacity: 0.3; }
:root[data-theme="light"] .stat-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(8, 145, 178, 0.06));
  color: var(--primary);
}

/* Light: tabelas */
:root[data-theme="light"] thead {
  background: rgba(15, 23, 42, 0.04);
}
:root[data-theme="light"] tbody tr:hover { background: var(--bg-hover); }
:root[data-theme="light"] td { color: var(--text-secondary); }

/* Light: badges com bg tonalizado */
:root[data-theme="light"] .badge-aberto    { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
:root[data-theme="light"] .badge-resolvido { background: rgba(16, 185, 129, 0.12); color: #047857; }
:root[data-theme="light"] .badge-alta      { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

/* Light: skeleton */
:root[data-theme="light"] .skeleton-bar {
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.05) 0%,
    rgba(15, 23, 42, 0.12) 50%,
    rgba(15, 23, 42, 0.05) 100%
  );
  background-size: 200% 100%;
}

/* Light: botões secundários */
:root[data-theme="light"] .btn-secondary {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
}
:root[data-theme="light"] .btn-secondary:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: var(--border-strong);
}

/* Light: file selector */
:root[data-theme="light"] .form-group input[type="file"]::file-selector-button {
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.25);
}

/* Light: scrollbar */
:root[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.30);
  background-clip: padding-box;
}

/* =====================================================================
   =====  TEMA: MARSH ENTERPRISE (sério, corporativo, SAP Fiori) =====
   ===================================================================== */
:root[data-theme="enterprise"] {
  --bg-main:        #f5f6f7;
  --bg-card:        #ffffff;
  --bg-card-solid:  #ffffff;
  --bg-elevated:    #ffffff;
  --bg-glass:       #ffffff;
  --bg-hover:       #eaecee;

  --primary:        #0070f2;
  --primary-hover:  #0040b0;
  --primary-glow:   rgba(0, 112, 242, 0.15);
  --accent-cyan:    #0070f2;

  --text-main:      #1d2d3e;
  --text-secondary: #475e75;
  --text-muted:     #6a6d70;
  --text-subtle:    #89919a;

  --border:         #d5dadc;
  --border-strong:  #b9c0c4;
  --border-hover:   #0070f2;

  --blur:           0px;
  --radius:         12px;
  --radius-lg:      12px;

  --shadow:         0 1px 2px rgba(29, 45, 62, 0.06);
  --shadow-elevated:0 4px 12px rgba(29, 45, 62, 0.10);
  --shadow-primary: 0 2px 6px rgba(0, 112, 242, 0.18);

  /* legacy aliases */
  --navy:      #1d2d3e;
  --navy-mid:  #354a5f;
  --white:     #ffffff;
  --grey-50:   #f5f6f7;
  --grey-100:  #eaecee;
  --grey-200:  #d5dadc;
  --grey-300:  #b9c0c4;
  --grey-400:  #89919a;
  --grey-500:  #6a6d70;
  --grey-600:  #475e75;
  --grey-800:  #1d2d3e;
  --red: #bb0000;
  --green: #107e3e;
}

/* Enterprise: sem bg image — superfície chapada, séria */
:root[data-theme="enterprise"] body {
  background-image: none;
  background-color: var(--bg-main);
  color-scheme: light;
}
:root[data-theme="enterprise"] body::before { display: none; }

/* Enterprise: sidebar branca com texto escuro (estilo SAP shell) */
:root[data-theme="enterprise"] .sidebar {
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-right: 1px solid var(--border);
  box-shadow: none;
}
:root[data-theme="enterprise"] .sidebar-header { border-bottom-color: var(--border); }
:root[data-theme="enterprise"] .sidebar-header h2 {
  color: var(--text-main);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}
:root[data-theme="enterprise"] .sidebar-footer {
  color: var(--text-muted);
  border-top-color: var(--border);
}
:root[data-theme="enterprise"] .logo-box {
  background: var(--primary);
  box-shadow: none;
}
:root[data-theme="enterprise"] .nav-link {
  color: var(--text-secondary);
  border-radius: 4px;
}
:root[data-theme="enterprise"] .nav-link::before { display: none; }
:root[data-theme="enterprise"] .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  box-shadow: none;
}
:root[data-theme="enterprise"] .nav-link.active {
  background: rgba(0, 112, 242, 0.10);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}
:root[data-theme="enterprise"] .nav-link .icon { filter: none; }

/* Enterprise: header chapado */
:root[data-theme="enterprise"] .header {
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
:root[data-theme="enterprise"] .header h1 {
  color: var(--text-main);
}
:root[data-theme="enterprise"] .user-info {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-color: var(--border);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Enterprise: cards chapados, sem glass nem highlight */
:root[data-theme="enterprise"] .stat-card,
:root[data-theme="enterprise"] .table-container,
:root[data-theme="enterprise"] .totais-card,
:root[data-theme="enterprise"] .modal-content {
  background: var(--bg-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
:root[data-theme="enterprise"] .stat-card::before { display: none; }
:root[data-theme="enterprise"] .stat-card:hover {
  transform: none;
  border-color: var(--border-hover);
  box-shadow: var(--shadow-elevated);
}
:root[data-theme="enterprise"] .stat-icon {
  background: rgba(0, 112, 242, 0.08);
  border-color: var(--border);
  color: var(--primary);
}
:root[data-theme="enterprise"] .stat-content h3 { color: var(--text-muted); }
:root[data-theme="enterprise"] .stat-number    { color: var(--text-main); }

/* Enterprise: tabela */
:root[data-theme="enterprise"] thead {
  background: var(--bg-hover);
}
:root[data-theme="enterprise"] th { color: var(--text-muted); }
:root[data-theme="enterprise"] td { color: var(--text-secondary); border-bottom-color: var(--border); }
:root[data-theme="enterprise"] tbody tr:hover {
  background: var(--bg-hover);
  box-shadow: inset 3px 0 0 var(--primary);
}
:root[data-theme="enterprise"] tbody td strong { color: var(--text-main); }

/* Enterprise: badges (cores SAP) */
:root[data-theme="enterprise"] .badge { font-weight: 500; }
:root[data-theme="enterprise"] .badge-aberto    { background: #e8f3ff; color: #0040b0; }
:root[data-theme="enterprise"] .badge-resolvido { background: #ebf5eb; color: #107e3e; }
:root[data-theme="enterprise"] .badge-alta      { background: #fbe6e6; color: #bb0000; }

/* Enterprise: botões séries (SAP Fiori style) */
:root[data-theme="enterprise"] .btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary-hover);
  box-shadow: none;
}
:root[data-theme="enterprise"] .btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 4px rgba(0, 112, 242, 0.30);
  transform: none;
  filter: none;
}
:root[data-theme="enterprise"] .btn-secondary {
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
:root[data-theme="enterprise"] .btn-secondary:hover {
  background: rgba(0, 112, 242, 0.06);
  border-color: var(--primary-hover);
}
:root[data-theme="enterprise"] .btn-danger {
  background: #bb0000;
  border-color: #8b0000;
  box-shadow: none;
}
:root[data-theme="enterprise"] .btn-danger:hover {
  background: #8b0000;
  box-shadow: 0 2px 4px rgba(187, 0, 0, 0.25);
  filter: none;
}
:root[data-theme="enterprise"] .btn-edit {
  background: rgba(0, 112, 242, 0.08);
  color: var(--primary);
  border-color: rgba(0, 112, 242, 0.25);
}
:root[data-theme="enterprise"] .btn-edit:hover { background: rgba(0, 112, 242, 0.16); color: var(--primary-hover); }

/* Enterprise: ícones de ação */
:root[data-theme="enterprise"] .btn-icon {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
:root[data-theme="enterprise"] .btn-icon.btn-edit {
  background: rgba(0, 112, 242, 0.08);
  border-color: rgba(0, 112, 242, 0.25);
  color: var(--primary);
}
:root[data-theme="enterprise"] .btn-icon.btn-edit:hover:not(:disabled) {
  background: rgba(0, 112, 242, 0.16);
  border-color: var(--primary);
  box-shadow: none;
}
:root[data-theme="enterprise"] .btn-icon.btn-danger {
  background: #fbe6e6;
  border-color: #f4c4c4;
  color: #bb0000;
}
:root[data-theme="enterprise"] .btn-icon.btn-danger:hover:not(:disabled) {
  background: #f6cccc;
  border-color: #bb0000;
  box-shadow: none;
}

/* Enterprise: forms (input claro SAP) */
:root[data-theme="enterprise"] .form-group input,
:root[data-theme="enterprise"] .form-group select,
:root[data-theme="enterprise"] .form-group textarea,
:root[data-theme="enterprise"] .filtro-select {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
:root[data-theme="enterprise"] .form-group input:focus,
:root[data-theme="enterprise"] .form-group select:focus,
:root[data-theme="enterprise"] .form-group textarea:focus,
:root[data-theme="enterprise"] .filtro-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 112, 242, 0.22);
  background: #ffffff;
}
:root[data-theme="enterprise"] .form-group select option { background: #ffffff; color: var(--text-main); }
:root[data-theme="enterprise"] .filtros-contador {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text-muted);
}
:root[data-theme="enterprise"] .form-section-title { color: var(--primary); border-bottom-color: var(--border); }

/* Enterprise: totalizadores */
:root[data-theme="enterprise"] .totais-card {
  box-shadow: var(--shadow);
}
:root[data-theme="enterprise"] .totais-entrada .totais-valor { color: #107e3e; }
:root[data-theme="enterprise"] .totais-saida   .totais-valor { color: #bb0000; }
:root[data-theme="enterprise"] .totais-caixa   .totais-valor { color: var(--primary); }

/* Enterprise: skeleton */
:root[data-theme="enterprise"] .skeleton-bar {
  background: linear-gradient(
    90deg,
    #eaecee 0%,
    #f5f6f7 50%,
    #eaecee 100%
  );
  background-size: 200% 100%;
}

/* Enterprise: scrollbar */
:root[data-theme="enterprise"] *::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  background-clip: padding-box;
}
:root[data-theme="enterprise"] *::-webkit-scrollbar-thumb:hover {
  background: #89919a;
  background-clip: padding-box;
}

/* Enterprise: modal */
:root[data-theme="enterprise"] .modal {
  background: rgba(29, 45, 62, 0.45);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
:root[data-theme="enterprise"] .modal-content {
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--border);
}
:root[data-theme="enterprise"] .modal-header { border-bottom-color: var(--border); }
:root[data-theme="enterprise"] .btn-close { color: var(--text-muted); }
:root[data-theme="enterprise"] .btn-close:hover { color: var(--text-main); }

/* Enterprise: dropzone */
:root[data-theme="enterprise"] .dropzone-dash {
  background: var(--bg-hover);
  border: 1.5px dashed var(--border-strong);
}
:root[data-theme="enterprise"] .dropzone-prompt-dash strong { color: var(--primary); }
:root[data-theme="enterprise"] .arquivos-pendentes-dash li {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-secondary);
}
:root[data-theme="enterprise"] .thumb-card-dash {
  background: #ffffff;
  border-color: var(--border);
}

/* Enterprise: timeline */
:root[data-theme="enterprise"] .timeline-content {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text-main);
}
:root[data-theme="enterprise"] .timeline-item:not(:last-child)::before { background: var(--border); }
:root[data-theme="enterprise"] .timeline-badge {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--border);
}

/* Enterprise: filtros - file input */
:root[data-theme="enterprise"] .form-group input[type="file"]::file-selector-button {
  background: rgba(0, 112, 242, 0.08);
  color: var(--primary);
  border-color: rgba(0, 112, 242, 0.25);
}

/* Enterprise: text selection */
:root[data-theme="enterprise"] ::selection {
  background: rgba(0, 112, 242, 0.30);
  color: var(--text-main);
}

/* Enterprise: bottom nav (mobile) */
:root[data-theme="enterprise"] .bottom-nav {
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-top: 1px solid var(--border);
}
:root[data-theme="enterprise"] .bottom-nav-item { color: var(--text-muted); }
:root[data-theme="enterprise"] .bottom-nav-item.active { color: var(--primary); }

/* Enterprise: tabela mobile (cards) */
@media (max-width: 768px) {
  :root[data-theme="enterprise"] .table-container tbody tr {
    background: #ffffff;
    border-color: var(--border);
  }
  :root[data-theme="enterprise"] .modal-header { background: #ffffff; }
}

/* ==== Transição suave entre temas ==== */
html { transition: background-color 0.25s ease; }
.sidebar, .header, .stat-card, .table-container, .modal-content,
.totais-card, .form-group input, .form-group select, .form-group textarea,
.filtro-select, .btn-secondary, .btn-icon, .user-info, .nav-link, td, th {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* =====================================================================
   ===========  PÁGINA CONFIGURAÇÕES + THEME PICKER  ===================
   ===================================================================== */

.config-secao {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 20px 22px;
  margin-bottom: 18px;
}
:root[data-theme="enterprise"] .config-secao {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: var(--shadow);
}

.config-secao-header {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.config-secao-header h3 {
  font-size: 16px;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.config-secao-header p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.theme-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
}
.theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-elevated);
}
.theme-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow);
}
.theme-card-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.theme-card.is-active .theme-card-check { display: inline-flex; }

.theme-preview {
  height: 84px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  display: flex;
}
.theme-preview-sidebar {
  width: 28%;
  height: 100%;
}
.theme-preview-main {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.theme-preview-bar {
  height: 10px;
  border-radius: 3px;
}
.theme-preview-bar.short { width: 50%; }
.theme-preview-bar.long  { width: 80%; }
.theme-preview-card {
  flex: 1;
  border-radius: 4px;
  border: 1px solid;
  margin-top: 2px;
}

.theme-card-info { display: flex; flex-direction: column; gap: 2px; }
.theme-card-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.theme-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.theme-card-swatches {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

html {
  scroll-behavior: smooth;
  background: var(--bg-main);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  color: var(--text-main);
  line-height: 1.6;
  background-color: var(--bg-main);
  background-image:
    linear-gradient(180deg, rgba(2, 8, 23, 0.78) 0%, rgba(2, 8, 23, 0.92) 60%, rgba(2, 8, 23, 0.96) 100%),
    url('background-1.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

/* WebP onde suportado (Chrome, Edge, Safari 14+, Firefox 65+) */
@supports (background-image: -webkit-image-set(url(x.webp) type("image/webp"))) or
          (background-image: image-set(url(x.webp) type("image/webp"))) {
  body {
    background-image:
      linear-gradient(180deg, rgba(2, 8, 23, 0.78) 0%, rgba(2, 8, 23, 0.92) 60%, rgba(2, 8, 23, 0.96) 100%),
      image-set(
        url('background-1.webp') type('image/webp'),
        url('background-1.png') type('image/png')
      );
  }
}

/* Iluminação ambiente sutil (glow neon discreto) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(800px circle at 12% 18%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(700px circle at 88% 82%, rgba(34, 211, 238, 0.07), transparent 60%);
}

/* Garante que o conteúdo fique acima do overlay */
.sidebar, .main-content, .modal, .bottom-nav, .lightbox-dash {
  position: relative;
  z-index: 1;
}
.modal, .lightbox-dash { z-index: 2000; }

/* ===== LAYOUT ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  z-index: 1000;
  border-right: 1px solid rgba(0, 201, 255, 0.1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 18px;
  border-bottom: 1px solid rgba(0, 201, 255, 0.1);
}

.logo-box {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all var(--transition);
  font-size: 13.5px;
}

.nav-link:hover {
  background: rgba(0, 201, 255, 0.1);
  color: var(--white);
}

.nav-link.active {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: var(--white);
  font-weight: 500;
}

.nav-link .icon {
  font-size: 16px;
}

.sidebar-footer {
  padding: 0 16px 12px;
  border-top: 1px solid rgba(0, 201, 255, 0.1);
  padding-top: 12px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.main-content {
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  background: var(--white);
  padding: 12px 22px;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 20px;
  color: var(--navy);
}

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

.user-info {
  font-size: 12.5px;
  color: var(--grey-600);
  padding: 5px 12px;
  background: var(--grey-100);
  border-radius: 16px;
}

/* ===== CONTAINER ===== */
.container {
  flex: 1;
  padding: 18px 22px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===== PAGES ===== */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

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

.stat-card {
  background: var(--white);
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(13, 27, 42, 0.10);
}

.stat-card-full {
  grid-column: 1 / -1;
  max-width: 100%;
}

.stat-icon {
  font-size: 22px;
  min-width: 42px;
  height: 42px;
  background: var(--grey-100);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-content {
  min-width: 0;
  flex: 1;
}

.stat-content h3 {
  font-size: 11.5px;
  color: var(--grey-600);
  font-weight: 500;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-number {
  font-size: clamp(15px, 1.8vw, 19px);
  font-weight: 700;
  color: var(--navy);
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.15;
}

.stat-saldo {
  font-size: 22px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 18px;
  color: var(--navy);
}

/* ===== BUTTONS ===== */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(13, 110, 253, 0.3);
}

.btn-secondary {
  background: var(--grey-200);
  color: var(--grey-800);
}

.btn-secondary:hover {
  background: var(--grey-300);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 6px;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-edit {
  background: var(--blue);
  color: var(--white);
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 6px;
}

.btn-edit:hover {
  background: #0b5cdb;
}

/* ===== TABLES ===== */
.table-container {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--grey-100);
  border-bottom: 1px solid var(--grey-200);
}

th {
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--grey-800);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--grey-200);
  font-size: 13px;
}

tbody tr:hover {
  background: var(--grey-50);
}

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

.text-center {
  text-align: center;
  color: var(--grey-600);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
}

/* Linha de auditoria nas listagens (criado/editado por X em DD/MM) */
.audit-meta {
  font-size: 10.5px;
  color: var(--grey-400);
  margin-top: 2px;
  line-height: 1.35;
  font-weight: 400;
  cursor: help;
}

/* Linha de chamado com novidades não lidas */
.row-novidade {
  background: linear-gradient(90deg, rgba(13,110,253,0.05), transparent);
}
.row-novidade strong {
  color: var(--blue);
}

.badge-novo-dash {
  display: inline-block;
  background: var(--blue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ===== DROPZONE de anexos no modal do dashboard ===== */
.dropzone-dash {
  border: 1.5px dashed var(--grey-200);
  border-radius: 8px;
  background: var(--grey-50);
  transition: 0.15s;
}
.dropzone-dash.dragover {
  border-color: var(--blue);
  background: rgba(13,110,253,0.06);
}
.dropzone-prompt-dash {
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--grey-600);
  cursor: pointer;
}
.dropzone-prompt-dash strong { color: var(--blue); }

.arquivos-pendentes-dash {
  list-style: none;
  padding: 0 10px 10px;
}
.arquivos-pendentes-dash li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: 5px;
  margin-bottom: 5px;
  font-size: 12px;
}
.arquivos-pendentes-dash li .nome {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arquivos-pendentes-dash li .tamanho {
  font-size: 10px;
  color: var(--grey-400);
}
.arquivos-pendentes-dash li .remover {
  background: transparent;
  border: none;
  color: var(--grey-400);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.arquivos-pendentes-dash li .remover:hover { color: var(--red); }

/* ===== THUMBNAILS DE IMAGEM (dashboard) ===== */
.thumbs-grid-dash {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.thumb-card-dash {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: 7px;
  overflow: hidden;
  transition: 0.18s;
}
.thumb-card-dash:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(13,110,253,0.10);
}
.thumb-img-dash {
  width: 100%;
  height: 80px;
  background-size: cover;
  background-position: center;
  background-color: var(--grey-100);
  cursor: pointer;
}
.thumb-info-dash {
  padding: 5px 7px;
  font-size: 11.5px;
}
.thumb-info-dash > span {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.thumb-actions-dash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.thumb-actions-dash small {
  font-size: 10px;
  color: var(--grey-400);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb-actions-dash .btn {
  padding: 2px 7px;
  font-size: 11px;
}

/* Lightbox do dashboard */
.lightbox-dash {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 30px;
  flex-direction: column;
  gap: 12px;
}
.lightbox-dash.show { display: flex; }
.lightbox-dash-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-dash-legenda {
  color: white;
  font-size: 13px;
  text-align: center;
  max-width: 90%;
}
.lightbox-dash-fechar {
  position: absolute;
  top: 18px;
  right: 22px;
  background: transparent;
  color: white;
  border: none;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.lightbox-dash-fechar:hover { color: var(--cyan); }

.badge-entrada {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.badge-saida {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--white);
  border-radius: 10px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--grey-200);
}

.modal-header h3 {
  font-size: 15px;
  color: var(--navy);
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--grey-400);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: var(--grey-800);
}

/* ===== FORMS ===== */
.form {
  padding: 16px 18px;
}

.form-group {
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--grey-800);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: border var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-200);
}

/* ===== MODAL LARGE ===== */
.modal-lg {
  max-width: 720px !important;
  max-height: 92vh;
  overflow-y: auto;
}

/* ===== FORM SECTION TITLE ===== */
.form-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  padding: 8px 0 4px;
  margin-top: 4px;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 10px;
}

/* ===== FILTROS ===== */
.filtros-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filtros-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--grey-600, #475569);
  white-space: nowrap;
}

.filtros-label .filtro-select { min-width: 140px; }

.filtros-contador {
  font-size: 12px;
  color: var(--grey-500, #64748b);
  margin-left: auto;
  padding: 4px 8px;
  background: var(--grey-50, #f8fafc);
  border-radius: 6px;
  border: 1px solid var(--grey-200);
}

.filtro-select {
  padding: 6px 10px;
  border: 1px solid var(--grey-200);
  border-radius: 7px;
  font-size: 12.5px;
  font-family: inherit;
  background: white;
  cursor: pointer;
  min-width: 160px;
}

.filtro-select[type="date"] { min-width: 140px; }
.filtro-select[type="text"] { cursor: text; }

.filtro-select:focus {
  outline: none;
  border-color: var(--blue);
}

/* ===== TOTALIZADORES FINANCEIROS ===== */
.totais-finance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.totais-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(13,27,42,0.04);
}

.totais-entrada { border-left-color: #10b981; }
.totais-saida   { border-left-color: #ef4444; }
.totais-saldo   { border-left-color: #0d6efd; }
.totais-caixa   { border-left-color: #0891b2; }

.totais-label {
  font-size: 11.5px;
  color: var(--grey-500, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.totais-valor {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy, #1e293b);
}

.totais-entrada .totais-valor { color: #10b981; }
.totais-saida   .totais-valor { color: #ef4444; }
.totais-caixa   .totais-valor { color: #0891b2; }

.totais-qtd {
  font-size: 11.5px;
  color: var(--grey-500, #94a3b8);
}

/* ===== BOTOES DE ACAO (icones com tooltip) ===== */
.td-acoes {
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
  margin-right: 4px;
  border: 1px solid var(--grey-200, #e2e8f0);
  background: #f8fafc;
  color: var(--grey-800, #1e293b);
  transition: transform 0.12s, background-color 0.12s, box-shadow 0.12s, border-color 0.12s;
}

/* sobrescreve cores solidas herdadas de .btn-edit / .btn-danger */
.btn-icon.btn-edit {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.btn-icon.btn-edit:hover:not(:disabled) {
  background: #dbeafe;
  border-color: var(--blue, #0d6efd);
}

.btn-icon.btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
}
.btn-icon.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: var(--red, #ef4444);
}

.btn-icon:last-child { margin-right: 0; }

.btn-icon:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(13,27,42,0.10);
}

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

/* ===== TIMELINE DE ATENDIMENTOS ===== */
.timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: -16px;
  width: 2px;
  background: var(--grey-200);
}

.timeline-badge {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--grey-200);
}

.badge-tipo-comentario { background: #64748b; }
.badge-tipo-contato_cliente { background: #0d6efd; }
.badge-tipo-escalamento { background: #f59e0b; }
.badge-tipo-solucao { background: #10b981; }

.timeline-content {
  flex: 1;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 10px 14px;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-meta {
  font-size: 0.78rem;
  color: var(--grey-400);
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--grey-800);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ===== STATS GRID: 3 colunas no desktop ===== */
.stats-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

.stat-card-full {
  grid-column: 1 / -1 !important;
}

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 80px;
  }

  .header {
    padding: 14px 16px;
  }

  .header h1 {
    font-size: 18px;
  }

  .header-right {
    gap: 8px;
  }

  .user-info {
    font-size: 12.5px;
    padding: 5px 10px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .container {
    padding: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .stat-card-full {
    grid-column: 1 / -1 !important;
  }

  .stat-card {
    padding: 12px;
    gap: 10px;
  }

  .stat-icon {
    font-size: 20px;
    min-width: 38px;
    height: 38px;
  }

  .stat-number {
    font-size: 18px;
  }

  .stat-content h3 {
    font-size: 10.5px;
  }

  .page-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .page-header .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* ===== FILTROS no mobile ===== */
  .filtros-bar {
    gap: 8px;
  }
  .filtro-select {
    min-width: 0 !important;
    flex: 1 1 calc(50% - 5px) !important;
    padding: 10px 12px;
    font-size: 13.5px;
  }
  input.filtro-select[type="text"] {
    flex-basis: 100% !important;
  }
  .filtros-label {
    flex: 1 1 calc(50% - 5px) !important;
    font-size: 11.5px;
  }
  .filtros-label .filtro-select {
    flex: 1 !important;
    min-width: 0 !important;
  }
  .filtros-contador {
    flex-basis: 100% !important;
    margin-left: 0;
    text-align: center;
  }

  /* ===== TOTAIS no mobile: 1 coluna ===== */
  .totais-finance {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .totais-valor { font-size: 1.15rem; }

  /* ===== BOTOES ICONE no mobile: maiores p/ tocar ===== */
  .btn-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  /* ===== MODAIS no mobile: drawer subindo de baixo ===== */
  .modal {
    align-items: flex-end;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
    overflow-y: auto;
  }
  .modal-lg {
    max-width: 100% !important;
    max-height: 95vh;
  }
  .modal-header {
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
    padding: 14px 16px;
  }
  .modal-header h3 {
    font-size: 14.5px;
  }
  .form {
    padding: 14px 16px;
  }
  .form-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .form-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  /* ===== TABELAS → CARDS no mobile ===== */
  .table-container {
    overflow: visible;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .table-container table,
  .table-container thead,
  .table-container tbody,
  .table-container tr,
  .table-container td {
    display: block;
    width: 100%;
  }
  .table-container thead { display: none; }
  .table-container tbody tr {
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    border-bottom: none;
    cursor: default;
  }
  .table-container tbody tr.row-novidade {
    border-left: 3px solid var(--blue);
  }
  .table-container td {
    padding: 7px 0;
    border-bottom: 1px solid var(--grey-100);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    max-width: none !important;
    text-align: right;
  }
  .table-container td:last-child {
    border-bottom: none;
  }
  .table-container td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--grey-600);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    text-align: left;
  }
  .table-container td[data-label=""]::before,
  .table-container td:not([data-label])::before {
    display: none;
  }
  /* Colunas que devem permitir quebra de linha em vez de ellipsis */
  .table-container td.td-titulo .td-titulo-inner {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: right;
    flex: 1;
    min-width: 0;
  }

  /* ===== Coluna de ações: rodapé do card, full width ===== */
  .table-container td[data-label="Ações"] {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 6px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--grey-200);
    text-align: center;
  }
  .table-container td[data-label="Ações"]::before {
    display: none;
  }
  .table-container td[data-label="Ações"] .btn {
    padding: 10px 12px;
    font-size: 13px;
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    border-radius: 8px;
  }
  .table-container td[data-label="Ações"] .btn:only-child {
    flex: 1 1 100%;
  }

  /* Linha de auditoria fica pequena demais junto com data-label — joga pra coluna inteira */
  .table-container td .audit-meta {
    width: 100%;
    text-align: right;
  }

  /* Paginação */
  #chamados-paginacao {
    flex-wrap: wrap;
    justify-content: space-between !important;
  }
  #chamados-paginacao .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
  #chamados-paginacao span {
    width: 100%;
    text-align: center;
    order: -1;
  }

  /* Detalhe do chamado */
  #detalhe-chamado-info {
    padding: 0.85rem !important;
    font-size: 0.85rem !important;
  }
  #detalhe-chamado-info > div[style*="grid"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--navy);
    border-top: 1px solid rgba(0, 201, 255, 0.15);
    z-index: 1000;
    justify-content: flex-start;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    font-weight: 500;
    border-radius: 10px;
    transition: all var(--transition);
    background: none;
    border: none;
    font-family: inherit;
    text-decoration: none;
    flex: 1 0 auto;
    min-width: 64px;
    scroll-snap-align: center;
  }

  .bottom-nav-item .bn-icon {
    font-size: 20px;
  }

  .bottom-nav-item.active {
    color: var(--cyan);
  }
  .bottom-nav-item:active {
    background: rgba(0, 201, 255, 0.08);
  }
}

/* ===== Mobile pequeno (<= 380px): ajustes finos ===== */
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .filtro-select {
    flex-basis: 100% !important;
  }
  .table-container td[data-label="Ações"] .btn:not(.btn-icon) {
    flex-basis: 100%;
  }
  .table-container td[data-label="Ações"] .btn-icon {
    flex-basis: auto;
  }
}

/* =====================================================================
   ===========  MODERNIZAÇÃO DARK / GLASSMORPHISM (premium)  ===========
   Carrega ao final para sobrescrever apenas as superfícies visuais.
   Funcionalidades, layouts e responsividade ficam intactos.
   ===================================================================== */

/* ===== SIDEBAR (glass) ===== */
.sidebar {
  background: rgba(2, 8, 23, 0.78);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.35), inset -1px 0 0 var(--border);
}
.sidebar-header {
  border-bottom: 1px solid var(--border);
}
.sidebar-header h2 {
  background: linear-gradient(90deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}
.logo-box {
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  box-shadow: 0 6px 18px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.nav-link {
  color: var(--text-secondary);
  position: relative;
}
.nav-link::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 0;
  background: linear-gradient(180deg, var(--primary), var(--accent-cyan));
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height 0.22s ease;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
}
.nav-link:hover::before { height: 22px; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.28), rgba(34, 211, 238, 0.18));
  color: var(--text-main);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35), 0 4px 16px var(--primary-glow);
}
.nav-link.active::before { height: 22px; }
.nav-link .icon {
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.35));
}
.sidebar-footer {
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
}

/* ===== HEADER (glass) ===== */
.header {
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(0, 0, 0, 0.18);
}
.header h1 {
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.user-info {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

/* ===== TIPOGRAFIA ===== */
.page-header h2 {
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal-header h3 {
  color: var(--text-main);
  font-weight: 600;
}
.form-group label {
  color: var(--text-secondary);
}
.form-section-title {
  color: var(--accent-cyan);
  border-bottom-color: var(--border);
}
.text-center { color: var(--text-muted); }

/* ===== STAT CARDS (glass) ===== */
.stat-card {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(96,165,250,0.25), transparent 40%, rgba(34,211,238,0.18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-elevated), 0 0 0 1px var(--border-hover), 0 0 24px rgba(37, 99, 235, 0.18);
}
.stat-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(34, 211, 238, 0.12));
  border: 1px solid var(--border);
  color: var(--text-main);
}
.stat-content h3 {
  color: var(--text-muted);
  font-weight: 500;
}
.stat-number {
  color: var(--text-main);
  font-weight: 700;
}

/* ===== TABELAS (glass) ===== */
.table-container {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
thead {
  background: rgba(2, 8, 23, 0.55);
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 600;
}
td {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
tbody tr:hover {
  background: var(--bg-hover);
  box-shadow: inset 3px 0 0 var(--primary);
}
tbody td strong {
  color: var(--text-main);
  font-weight: 600;
}
.audit-meta { color: var(--text-subtle); }

/* ===== BADGES (mantém cor, melhora contraste no dark) ===== */
.badge { font-weight: 600; }
.badge-aberto    { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }
.badge-resolvido { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.badge-alta      { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }
.row-novidade {
  background: linear-gradient(90deg, rgba(37,99,235,0.10), transparent);
}
.row-novidade strong { color: var(--primary-hover); }

/* ===== BOTÕES ===== */
.btn {
  font-weight: 500;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  filter: brightness(1.05);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--border-strong);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.4);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.btn-danger:hover {
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.4);
  filter: brightness(1.05);
}
.btn-edit {
  background: rgba(37, 99, 235, 0.16);
  color: var(--primary-hover);
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.btn-edit:hover {
  background: rgba(37, 99, 235, 0.28);
  border-color: var(--primary-hover);
  color: #fff;
}

/* ===== BOTÕES ÍCONE (substitui o estilo claro anterior) ===== */
.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-icon.btn-edit {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(96, 165, 250, 0.28);
  color: var(--primary-hover);
}
.btn-icon.btn-edit:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.26);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
}
.btn-icon.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}
.btn-icon.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: #f87171;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
  color: #fff;
}

/* ===== FORMS (inputs no glass dark) ===== */
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(2, 8, 23, 0.55);
  color: var(--text-main);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-subtle); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 0 18px rgba(37, 99, 235, 0.12);
  background: rgba(2, 8, 23, 0.75);
}
.form-group select option { background: var(--bg-card-solid); color: var(--text-main); }
.form-actions { border-top-color: var(--border); }

/* ===== FILTROS (mesma linguagem) ===== */
.filtro-select {
  background: rgba(2, 8, 23, 0.55);
  color: var(--text-main);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.filtro-select::placeholder { color: var(--text-subtle); }
.filtro-select:focus {
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.filtro-select option { background: var(--bg-card-solid); color: var(--text-main); }
.filtros-contador {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.filtros-label { color: var(--text-muted); }

/* Date / file pickers: cores nativas em dark mode
   - color-scheme: dark já invertia a maioria dos UI nativos no Firefox/Chromium
     (foi aplicado no body); aqui só reforçamos ícone do calendário no Chromium */
.filtro-select[type="date"],
.form-group input[type="date"],
.form-group input[type="file"] {
  color-scheme: dark;
}
.filtro-select[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.65);
  cursor: pointer;
}
/* Firefox: estiliza o botão "Browse" do file input */
.form-group input[type="file"]::file-selector-button {
  background: rgba(37, 99, 235, 0.16);
  color: var(--primary-hover);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  margin-right: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
}
.form-group input[type="file"]::file-selector-button:hover {
  background: rgba(37, 99, 235, 0.28);
  border-color: var(--primary-hover);
  color: #fff;
}

/* ===== TOTALIZADORES FINANCEIROS (glass) ===== */
.totais-card {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--border);
  border-left-width: 3px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.totais-entrada { border-left-color: #34d399; box-shadow: var(--shadow), inset 6px 0 24px -12px rgba(52,211,153,0.35); }
.totais-saida   { border-left-color: #f87171; box-shadow: var(--shadow), inset 6px 0 24px -12px rgba(248,113,113,0.35); }
.totais-saldo   { border-left-color: var(--primary-hover); box-shadow: var(--shadow), inset 6px 0 24px -12px var(--primary-glow); }
.totais-caixa   { border-left-color: var(--accent-cyan); box-shadow: var(--shadow), inset 6px 0 24px -12px rgba(34,211,238,0.35); }
.totais-label { color: var(--text-muted); }
.totais-valor { color: var(--text-main); }
.totais-entrada .totais-valor { color: #6ee7b7; }
.totais-saida   .totais-valor { color: #fca5a5; }
.totais-caixa   .totais-valor { color: var(--accent-cyan); }
.totais-qtd     { color: var(--text-subtle); }

/* ===== MODAIS (glass elevado) ===== */
.modal {
  background: rgba(2, 8, 23, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal-content {
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-elevated), 0 0 0 1px var(--border);
  color: var(--text-main);
}
.modal-header { border-bottom: 1px solid var(--border); }
.btn-close { color: var(--text-muted); }
.btn-close:hover { color: var(--text-main); }

/* ===== TIMELINE (atendimentos) ===== */
.timeline-content {
  background: rgba(2, 8, 23, 0.55);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.timeline-item:not(:last-child)::before { background: var(--border-strong); }
.timeline-badge {
  border-color: var(--bg-card-solid);
  box-shadow: 0 0 0 2px var(--border-strong), 0 0 12px rgba(37, 99, 235, 0.3);
}
.timeline-meta { color: var(--text-muted); }
.timeline-desc { color: var(--text-secondary); }

/* ===== DETALHE DO CHAMADO (modal) ===== */
.detalhe-chamado-info {
  padding: 1rem 1.25rem;
  background: rgba(2, 8, 23, 0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-main);
}
:root[data-theme="light"] .detalhe-chamado-info,
:root[data-theme="enterprise"] .detalhe-chamado-info {
  background: var(--bg-card);
}
.detalhe-chamado-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.detalhe-chamado-grid > div { color: var(--text-secondary); }
.detalhe-chamado-grid strong { color: var(--text-main); }
.detalhe-chamado-stars { color: #f59e0b; }
.detalhe-chamado-descricao {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}
.detalhe-chamado-descricao strong { color: var(--text-main); }
.detalhe-chamado-comentario {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.10);
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  color: var(--text-secondary);
}
.detalhe-chamado-comentario strong { color: var(--text-main); }
.detalhe-chamado-section-title {
  margin-bottom: 1rem;
  color: var(--accent-cyan);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.detalhe-chamado-section-title--soft {
  color: var(--text-main);
  margin-bottom: 0.75rem;
}
.detalhe-chamado-form-wrap {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

/* Anexos no detalhe do chamado */
.anexos-dash-title {
  margin-bottom: 0.5rem;
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 600;
}
.anexos-dash-list {
  list-style: none;
  padding: 0;
  margin-bottom: 8px;
}
.anexos-dash-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.anexos-dash-list li:last-child { border-bottom: none; }
.anexos-dash-list .anexo-nome {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
}
.anexos-dash-list .anexo-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.anexos-dash-vazio {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.anexos-dash-upload {
  display: inline-block;
  background: transparent;
  color: var(--primary-hover);
  border: 1px dashed var(--primary-hover);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.anexos-dash-upload:hover {
  background: rgba(37, 99, 235, 0.10);
  border-color: var(--primary);
}
.anexos-dash-hint {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== DROPZONE + thumbnails (dashboard) ===== */
.dropzone-dash {
  background: rgba(2, 8, 23, 0.45);
  border: 1.5px dashed var(--border-strong);
}
.dropzone-dash.dragover {
  border-color: var(--primary-hover);
  background: rgba(37, 99, 235, 0.10);
}
.dropzone-prompt-dash { color: var(--text-muted); }
.dropzone-prompt-dash strong { color: var(--primary-hover); }
.arquivos-pendentes-dash li {
  background: rgba(2, 8, 23, 0.55);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.arquivos-pendentes-dash li .tamanho { color: var(--text-subtle); }
.arquivos-pendentes-dash li .remover { color: var(--text-muted); }
.thumb-card-dash {
  background: rgba(2, 8, 23, 0.55);
  border: 1px solid var(--border);
}
.thumb-card-dash:hover {
  border-color: var(--primary-hover);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.2);
}
.thumb-img-dash { background-color: rgba(255, 255, 255, 0.04); }
.thumb-info-dash { color: var(--text-secondary); }
.thumb-actions-dash small { color: var(--text-subtle); }

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  background: rgba(2, 8, 23, 0.85);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border-top: 1px solid var(--border);
}
.bottom-nav-item { color: var(--text-muted); }
.bottom-nav-item.active { color: var(--accent-cyan); }
.bottom-nav-item:active { background: rgba(34, 211, 238, 0.10); }

/* ===== MOBILE: tabelas viram cards no dark ===== */
@media (max-width: 768px) {
  .table-container tbody tr {
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
    backdrop-filter: blur(var(--blur)) saturate(140%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .table-container td { border-bottom-color: var(--border); }
  .table-container td::before { color: var(--text-muted); }
  .table-container td[data-label="Ações"] { border-top-color: var(--border); }
  .modal-header { background: var(--bg-elevated); }
}

/* ===== SCROLLBAR DARK ===== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.35) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.25);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(96, 165, 250, 0.5); background-clip: padding-box; }

/* ===== MICRO-INTERAÇÕES ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page.active { animation: fadeInUp 0.32s ease-out; }
.stat-card, .totais-card, .table-container, .modal-content {
  animation: fadeInUp 0.4s ease-out both;
}

/* ===== SELEÇÃO DE TEXTO ===== */
::selection { background: rgba(37, 99, 235, 0.5); color: #fff; }

/* ===== FOCUS RING ACESSÍVEL ===== */
:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 2px;
}

/* ===== SKELETON LOADERS (linha de tabela carregando) ===== */
@keyframes skeletonShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton-row td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
.skeleton-bar {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s linear infinite;
}
.skeleton-bar.sk-sm  { width: 35%; height: 10px; }
.skeleton-bar.sk-md  { width: 60%; }
.skeleton-bar.sk-lg  { width: 85%; }
.skeleton-bar.sk-pill { width: 60px; height: 18px; border-radius: 999px; }

/* No mobile (cards), o skeleton vira bloco */
@media (max-width: 768px) {
  .skeleton-row td { display: block; padding: 6px 0; border: none; }
  .skeleton-row { display: block; padding: 12px 14px; }
}

/* ===== RIPPLE EFFECT (botões primários) ===== */
.btn-primary,
.btn-edit:not(.btn-icon),
.btn-danger:not(.btn-icon),
.btn-login {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after,
.btn-edit:not(.btn-icon)::after,
.btn-danger:not(.btn-icon)::after,
.btn-login::after {
  content: "";
  position: absolute;
  left: var(--ripple-x, 50%);
  top: var(--ripple-y, 50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}
.btn-primary.is-rippling::after,
.btn-edit:not(.btn-icon).is-rippling::after,
.btn-danger:not(.btn-icon).is-rippling::after,
.btn-login.is-rippling::after {
  animation: ripple 0.55s ease-out;
}
@keyframes ripple {
  0%   { width: 0;     height: 0;     opacity: 0.55; }
  100% { width: 380px; height: 380px; opacity: 0; }
}

/* ===== STAT NUMBER: contador animado tem easing suave ===== */
.stat-number.is-counting {
  font-variant-numeric: tabular-nums;
}

/* ===== Respeita usuários que preferem menos movimento ===== */
@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; }
  .btn-primary::after,
  .btn-edit::after,
  .btn-danger::after,
  .btn-login::after { animation: none !important; }
  .page.active,
  .stat-card,
  .totais-card,
  .table-container,
  .modal-content { animation: none !important; }
}

/* === Tecnologias liberadas no form-cliente — grid de checkboxes === */
.tec-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg-glass, rgba(30,41,59,0.55));
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  border-radius: 10px;
}
.tec-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-card-solid, #1e293b);
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.tec-checkbox-item:hover {
  border-color: var(--border-hover, rgba(96,165,250,0.40));
  background: var(--bg-hover, rgba(96,165,250,0.08));
}
.tec-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #2563eb);
  cursor: pointer;
  margin: 0;
}
.tec-checkbox-item.is-active {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.10);
}
.tec-checkbox-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
  color: var(--text-main, #f8fafc);
}
.tec-checkbox-label small {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}
.tec-empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  padding: 0.5rem;
}

/* Estilos do assistente de voz foram movidos para public/assistente-voz.css */
