/* Gestão de Frotas e Terceiros - Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #f59e0b; /* Âmbar Industrial / Amarelo Maquinário */
  --primary-dark: #d97706;
  --secondary: #1e293b;
  --dark-surface: #0f172a;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.font-mono-code {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Status Badges */
.badge-available {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge-rented {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-maintenance {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-alert {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

@page {
  margin: 0;
}

/* Print styles for Medições */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
    margin: 0 !important;
    padding: 10mm !important;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .print-break-inside {
    break-inside: avoid;
  }
  .print-page-break {
    page-break-after: always;
  }
  .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl {
    box-shadow: none !important;
  }
  .bg-slate-900, .bg-slate-800 {
    background-color: #1e293b !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Mobile Simulator Container (Responsivo em Celulares e Telas Menores) */
.mobile-device-frame {
  width: 100%;
  max-width: 390px;
  height: 780px;
  max-height: calc(100vh - 120px);
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 10px #1e293b, 0 0 0 12px #334155;
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .mobile-device-frame {
    max-width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  }
}

.mobile-device-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 25px;
  background-color: #1e293b;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 50;
}

@media (max-width: 640px) {
  .mobile-device-notch {
    display: none; /* No celular real, o próprio aparelho já possui notch/câmera */
  }
}

/* ==========================================================================
   SELETORES DE PALETAS DE CORES (Cores Fixas Protegidas no Cabeçalho)
   ========================================================================== */
#theme-btn-default i { color: #f59e0b !important; }
#theme-btn-purple i { color: #9333ea !important; }
#theme-btn-blue i { color: #0284c7 !important; }
#theme-btn-ocean i { color: #0d9488 !important; }

body.theme-purple-light #theme-btn-default i,
body.theme-blue-light #theme-btn-default i,
body.theme-ocean-light #theme-btn-default i {
  color: #f59e0b !important;
}

body.theme-purple-light #theme-btn-purple i,
body.theme-blue-light #theme-btn-purple i,
body.theme-ocean-light #theme-btn-purple i {
  color: #9333ea !important;
}

body.theme-purple-light #theme-btn-blue i,
body.theme-blue-light #theme-btn-blue i,
body.theme-ocean-light #theme-btn-blue i {
  color: #0284c7 !important;
}

body.theme-purple-light #theme-btn-ocean i,
body.theme-blue-light #theme-btn-ocean i,
body.theme-ocean-light #theme-btn-ocean i {
  color: #0d9488 !important;
}

/* ==========================================================================
   TEMAS CLAROS: ESTRUTURA COMUM (White & Gray Base)
   ========================================================================== */
body.theme-purple-light,
body.theme-blue-light,
body.theme-ocean-light {
  background-color: #f8fafc !important;
  color: #334155 !important;
}

/* Sidebar Clara nos Temas Alternativos */
body.theme-purple-light aside,
body.theme-blue-light aside,
body.theme-ocean-light aside {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03) !important;
}

body.theme-purple-light aside > div:first-child > div:first-child,
body.theme-blue-light aside > div:first-child > div:first-child,
body.theme-ocean-light aside > div:first-child > div:first-child {
  background-color: #ffffff !important;
  border-color: #f1f5f9 !important;
}

body.theme-purple-light aside .text-slate-500,
body.theme-blue-light aside .text-slate-500,
body.theme-ocean-light aside .text-slate-500 {
  color: #94a3b8 !important;
}

/* Links de Navegação da Sidebar */
body.theme-purple-light .nav-link,
body.theme-blue-light .nav-link,
body.theme-ocean-light .nav-link {
  color: #475569 !important;
}

body.theme-purple-light .nav-link i,
body.theme-blue-light .nav-link i,
body.theme-ocean-light .nav-link i {
  color: #64748b !important;
}

/* Rodapé da Sidebar */
body.theme-purple-light aside > div:last-child,
body.theme-blue-light aside > div:last-child,
body.theme-ocean-light aside > div:last-child {
  background-color: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
}

body.theme-purple-light aside > div:last-child button,
body.theme-purple-light aside > div:last-child label,
body.theme-blue-light aside > div:last-child button,
body.theme-blue-light aside > div:last-child label,
body.theme-ocean-light aside > div:last-child button,
body.theme-ocean-light aside > div:last-child label {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.theme-purple-light aside > div:last-child button:hover,
body.theme-purple-light aside > div:last-child label:hover,
body.theme-blue-light aside > div:last-child button:hover,
body.theme-blue-light aside > div:last-child label:hover,
body.theme-ocean-light aside > div:last-child button:hover,
body.theme-ocean-light aside > div:last-child label:hover {
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
}

/* Header */
body.theme-purple-light header,
body.theme-blue-light header,
body.theme-ocean-light header {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Main Content Wrapper */
body.theme-purple-light #main-content,
body.theme-blue-light #main-content,
body.theme-ocean-light #main-content {
  background-color: #f8fafc !important;
}

/* Tabelas: Cabeçalhos em Cinza Claro Limpo */
body.theme-purple-light thead.bg-slate-900,
body.theme-purple-light table thead.bg-slate-900,
body.theme-blue-light thead.bg-slate-900,
body.theme-blue-light table thead.bg-slate-900,
body.theme-ocean-light thead.bg-slate-900,
body.theme-ocean-light table thead.bg-slate-900 {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

body.theme-purple-light thead.bg-slate-900 th,
body.theme-purple-light table thead.bg-slate-900 th,
body.theme-blue-light thead.bg-slate-900 th,
body.theme-blue-light table thead.bg-slate-900 th,
body.theme-ocean-light thead.bg-slate-900 th,
body.theme-ocean-light table thead.bg-slate-900 th {
  color: #334155 !important;
  font-weight: 700 !important;
}

/* Tela de Login no Tema Claro */
body.theme-purple-light #login-container > div,
body.theme-blue-light #login-container > div,
body.theme-ocean-light #login-container > div {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

body.theme-purple-light #login-container .max-w-md,
body.theme-blue-light #login-container .max-w-md,
body.theme-ocean-light #login-container .max-w-md {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08) !important;
}

body.theme-purple-light #login-container label,
body.theme-blue-light #login-container label,
body.theme-ocean-light #login-container label {
  color: #475569 !important;
}

body.theme-purple-light #login-container input,
body.theme-blue-light #login-container input,
body.theme-ocean-light #login-container input {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}


/* ==========================================================================
   1. PALETA ROXA CLARA (theme-purple-light)
   ========================================================================== */
body.theme-purple-light ::selection {
  background-color: #ddd6fe !important;
  color: #4c1d95 !important;
}

body.theme-purple-light aside .text-amber-400 { color: #7c3aed !important; }
body.theme-purple-light aside .bg-amber-400 { background-color: #7c3aed !important; }

body.theme-purple-light .nav-link:hover:not(.bg-amber-500) {
  background-color: #faf5ff !important;
  color: #6d28d9 !important;
}
body.theme-purple-light .nav-link:hover:not(.bg-amber-500) i { color: #7c3aed !important; }

body.theme-purple-light .nav-link.bg-amber-500 {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}
body.theme-purple-light .nav-link.bg-amber-500 i { color: #ffffff !important; }

body.theme-purple-light #nav-proprietario-section .text-amber-300:not(.bg-amber-500) { color: #6d28d9 !important; }
body.theme-purple-light #nav-proprietario-section .text-amber-400 { color: #7c3aed !important; }
body.theme-purple-light #nav-proprietario-section .nav-link.bg-amber-500,
body.theme-purple-light #nav-proprietario-section .nav-link.bg-amber-500 *,
body.theme-purple-light #nav-proprietario-section .nav-link.bg-amber-500 i {
  color: #ffffff !important;
}
body.theme-purple-light #nav-proprietario-section a.nav-link {
  background-color: #f5f3ff !important;
  border-color: #ddd6fe !important;
  color: #6d28d9 !important;
}
body.theme-purple-light #nav-proprietario-section a.nav-link:hover { background-color: #ede9fe !important; }

body.theme-purple-light aside > div:last-child button i.text-amber-400 { color: #7c3aed !important; }

body.theme-purple-light #header-user-avatar { background-color: #7c3aed !important; color: #ffffff !important; }
body.theme-purple-light #header-user-role { color: #6d28d9 !important; }
body.theme-purple-light #header-tenant-selector-container i { color: #7c3aed !important; }

body.theme-purple-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 50%, #7c3aed 100%) !important;
  border-color: #6d28d9 !important;
  box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.25) !important;
}
body.theme-purple-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .bg-amber-500 {
  background-color: #ffffff !important;
  color: #6d28d9 !important;
}
body.theme-purple-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .bg-amber-500:hover {
  background-color: #f5f3ff !important;
  color: #5b21b6 !important;
}
body.theme-purple-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .text-amber-400 {
  color: #e9d5ff !important;
}

body.theme-purple-light .bg-amber-500 { background-color: #7c3aed !important; color: #ffffff !important; }
body.theme-purple-light .hover\:bg-amber-400:hover,
body.theme-purple-light .bg-amber-500:hover { background-color: #6d28d9 !important; color: #ffffff !important; }
body.theme-purple-light .bg-amber-500 i,
body.theme-purple-light .hover\:bg-amber-400:hover i { color: #ffffff !important; }

body.theme-purple-light .bg-amber-600 { background-color: #6d28d9 !important; color: #ffffff !important; }
body.theme-purple-light .hover\:bg-amber-500:hover,
body.theme-purple-light .bg-amber-600:hover { background-color: #5b21b6 !important; color: #ffffff !important; }

body.theme-purple-light .bg-amber-50 { background-color: #faf5ff !important; }
body.theme-purple-light .bg-amber-100 { background-color: #f3e8ff !important; }
body.theme-purple-light .bg-amber-500\/10 { background-color: rgba(124, 58, 237, 0.1) !important; }
body.theme-purple-light .hover\:bg-amber-500\/20:hover { background-color: rgba(124, 58, 237, 0.18) !important; }
body.theme-purple-light .bg-amber-500\/20 { background-color: rgba(124, 58, 237, 0.18) !important; }

body.theme-purple-light .text-amber-300 { color: #a78bfa !important; }
body.theme-purple-light .text-amber-400 { color: #9333ea !important; }
body.theme-purple-light .text-amber-500,
body.theme-purple-light .text-amber-600 { color: #7c3aed !important; }
body.theme-purple-light .text-amber-700,
body.theme-purple-light .text-amber-800,
body.theme-purple-light .text-amber-900 { color: #6d28d9 !important; }

body.theme-purple-light .border-amber-200 { border-color: #e9d5ff !important; }
body.theme-purple-light .border-amber-300 { border-color: #d8b4fe !important; }
body.theme-purple-light .border-amber-400,
body.theme-purple-light .border-amber-500 { border-color: #7c3aed !important; }
body.theme-purple-light .border-amber-500\/20,
body.theme-purple-light .border-amber-500\/30 { border-color: rgba(124, 58, 237, 0.25) !important; }

body.theme-purple-light input:focus,
body.theme-purple-light select:focus,
body.theme-purple-light textarea:focus { border-color: #7c3aed !important; outline-color: #7c3aed !important; }
body.theme-purple-light .focus\:ring-amber-500:focus { --tw-ring-color: rgba(124, 58, 237, 0.35) !important; }

body.theme-purple-light [class*="to-amber-950"] {
  background: linear-gradient(135deg, #312e81 0%, #4c1d95 50%, #6d28d9 100%) !important;
  border-color: #7c3aed !important;
}


/* ==========================================================================
   2. PALETA AZULADA CLARA / CINZA AZULADO (theme-blue-light)
   ========================================================================== */
body.theme-blue-light ::selection {
  background-color: #bae6fd !important;
  color: #0369a1 !important;
}

body.theme-blue-light aside .text-amber-400 { color: #0284c7 !important; }
body.theme-blue-light aside .bg-amber-400 { background-color: #0284c7 !important; }

body.theme-blue-light .nav-link:hover:not(.bg-amber-500) {
  background-color: #f0f9ff !important;
  color: #0284c7 !important;
}
body.theme-blue-light .nav-link:hover:not(.bg-amber-500) i { color: #0284c7 !important; }

body.theme-blue-light .nav-link.bg-amber-500 {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3) !important;
}
body.theme-blue-light .nav-link.bg-amber-500 i { color: #ffffff !important; }

body.theme-blue-light #nav-proprietario-section .text-amber-300:not(.bg-amber-500) { color: #0369a1 !important; }
body.theme-blue-light #nav-proprietario-section .text-amber-400 { color: #0284c7 !important; }
body.theme-blue-light #nav-proprietario-section .nav-link.bg-amber-500,
body.theme-blue-light #nav-proprietario-section .nav-link.bg-amber-500 *,
body.theme-blue-light #nav-proprietario-section .nav-link.bg-amber-500 i {
  color: #ffffff !important;
}
body.theme-blue-light #nav-proprietario-section a.nav-link {
  background-color: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
}
body.theme-blue-light #nav-proprietario-section a.nav-link:hover { background-color: #e0f2fe !important; }

body.theme-blue-light aside > div:last-child button i.text-amber-400 { color: #0284c7 !important; }

body.theme-blue-light #header-user-avatar { background-color: #0284c7 !important; color: #ffffff !important; }
body.theme-blue-light #header-user-role { color: #0369a1 !important; }
body.theme-blue-light #header-tenant-selector-container i { color: #0284c7 !important; }

body.theme-blue-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 40%, #0369a1 100%) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.25) !important;
}
body.theme-blue-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .bg-amber-500 {
  background-color: #ffffff !important;
  color: #0369a1 !important;
}
body.theme-blue-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .bg-amber-500:hover {
  background-color: #f0f9ff !important;
  color: #075985 !important;
}
body.theme-blue-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .text-amber-400 {
  color: #bae6fd !important;
}

body.theme-blue-light .bg-amber-500 { background-color: #0284c7 !important; color: #ffffff !important; }
body.theme-blue-light .hover\:bg-amber-400:hover,
body.theme-blue-light .bg-amber-500:hover { background-color: #0369a1 !important; color: #ffffff !important; }
body.theme-blue-light .bg-amber-500 i,
body.theme-blue-light .hover\:bg-amber-400:hover i { color: #ffffff !important; }

body.theme-blue-light .bg-amber-600 { background-color: #0369a1 !important; color: #ffffff !important; }
body.theme-blue-light .hover\:bg-amber-500:hover,
body.theme-blue-light .bg-amber-600:hover { background-color: #075985 !important; color: #ffffff !important; }

body.theme-blue-light .bg-amber-50 { background-color: #f0f9ff !important; }
body.theme-blue-light .bg-amber-100 { background-color: #e0f2fe !important; }
body.theme-blue-light .bg-amber-500\/10 { background-color: rgba(2, 132, 199, 0.1) !important; }
body.theme-blue-light .hover\:bg-amber-500\/20:hover { background-color: rgba(2, 132, 199, 0.18) !important; }
body.theme-blue-light .bg-amber-500\/20 { background-color: rgba(2, 132, 199, 0.18) !important; }

body.theme-blue-light .text-amber-300 { color: #7dd3fc !important; }
body.theme-blue-light .text-amber-400 { color: #38bdf8 !important; }
body.theme-blue-light .text-amber-500,
body.theme-blue-light .text-amber-600 { color: #0284c7 !important; }
body.theme-blue-light .text-amber-700,
body.theme-blue-light .text-amber-800,
body.theme-blue-light .text-amber-900 { color: #0369a1 !important; }

body.theme-blue-light .border-amber-200 { border-color: #bae6fd !important; }
body.theme-blue-light .border-amber-300 { border-color: #7dd3fc !important; }
body.theme-blue-light .border-amber-400,
body.theme-blue-light .border-amber-500 { border-color: #0284c7 !important; }
body.theme-blue-light .border-amber-500\/20,
body.theme-blue-light .border-amber-500\/30 { border-color: rgba(2, 132, 199, 0.25) !important; }

body.theme-blue-light input:focus,
body.theme-blue-light select:focus,
body.theme-blue-light textarea:focus { border-color: #0284c7 !important; outline-color: #0284c7 !important; }
body.theme-blue-light .focus\:ring-amber-500:focus { --tw-ring-color: rgba(2, 132, 199, 0.35) !important; }

body.theme-blue-light [class*="to-amber-950"] {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0369a1 100%) !important;
  border-color: #0284c7 !important;
}


/* ==========================================================================
   3. PALETA VERDE OCEANO (theme-ocean-light)
   ========================================================================== */
body.theme-ocean-light ::selection {
  background-color: #99f6e4 !important;
  color: #134e4a !important;
}

body.theme-ocean-light aside .text-amber-400 { color: #0d9488 !important; }
body.theme-ocean-light aside .bg-amber-400 { background-color: #0d9488 !important; }

body.theme-ocean-light .nav-link:hover:not(.bg-amber-500) {
  background-color: #f0fdfa !important;
  color: #0d9488 !important;
}
body.theme-ocean-light .nav-link:hover:not(.bg-amber-500) i { color: #0d9488 !important; }

body.theme-ocean-light .nav-link.bg-amber-500 {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3) !important;
}
body.theme-ocean-light .nav-link.bg-amber-500 i { color: #ffffff !important; }

body.theme-ocean-light #nav-proprietario-section .text-amber-300:not(.bg-amber-500) { color: #0f766e !important; }
body.theme-ocean-light #nav-proprietario-section .text-amber-400 { color: #0d9488 !important; }
body.theme-ocean-light #nav-proprietario-section .nav-link.bg-amber-500,
body.theme-ocean-light #nav-proprietario-section .nav-link.bg-amber-500 *,
body.theme-ocean-light #nav-proprietario-section .nav-link.bg-amber-500 i {
  color: #ffffff !important;
}
body.theme-ocean-light #nav-proprietario-section a.nav-link {
  background-color: #f0fdfa !important;
  border-color: #99f6e4 !important;
  color: #0f766e !important;
}
body.theme-ocean-light #nav-proprietario-section a.nav-link:hover { background-color: #ccfbf1 !important; }

body.theme-ocean-light aside > div:last-child button i.text-amber-400 { color: #0d9488 !important; }

body.theme-ocean-light #header-user-avatar { background-color: #0d9488 !important; color: #ffffff !important; }
body.theme-ocean-light #header-user-role { color: #0f766e !important; }
body.theme-ocean-light #header-tenant-selector-container i { color: #0d9488 !important; }

body.theme-ocean-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 {
  background: linear-gradient(135deg, #042f2e 0%, #115e59 40%, #0d9488 100%) !important;
  border-color: #0d9488 !important;
  box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.25) !important;
}
body.theme-ocean-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .bg-amber-500 {
  background-color: #ffffff !important;
  color: #0f766e !important;
}
body.theme-ocean-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .bg-amber-500:hover {
  background-color: #f0fdfa !important;
  color: #115e59 !important;
}
body.theme-ocean-light .bg-gradient-to-r.from-slate-900.via-slate-800.to-amber-950 .text-amber-400 {
  color: #99f6e4 !important;
}

body.theme-ocean-light .bg-amber-500 { background-color: #0d9488 !important; color: #ffffff !important; }
body.theme-ocean-light .hover\:bg-amber-400:hover,
body.theme-ocean-light .bg-amber-500:hover { background-color: #0f766e !important; color: #ffffff !important; }
body.theme-ocean-light .bg-amber-500 i,
body.theme-ocean-light .hover\:bg-amber-400:hover i { color: #ffffff !important; }

body.theme-ocean-light .bg-amber-600 { background-color: #0f766e !important; color: #ffffff !important; }
body.theme-ocean-light .hover\:bg-amber-500:hover,
body.theme-ocean-light .bg-amber-600:hover { background-color: #115e59 !important; color: #ffffff !important; }

body.theme-ocean-light .bg-amber-50 { background-color: #f0fdfa !important; }
body.theme-ocean-light .bg-amber-100 { background-color: #ccfbf1 !important; }
body.theme-ocean-light .bg-amber-500\/10 { background-color: rgba(13, 148, 136, 0.1) !important; }
body.theme-ocean-light .hover\:bg-amber-500\/20:hover { background-color: rgba(13, 148, 136, 0.18) !important; }
body.theme-ocean-light .bg-amber-500\/20 { background-color: rgba(13, 148, 136, 0.18) !important; }

body.theme-ocean-light .text-amber-300 { color: #5eead4 !important; }
body.theme-ocean-light .text-amber-400 { color: #2dd4bf !important; }
body.theme-ocean-light .text-amber-500,
body.theme-ocean-light .text-amber-600 { color: #0d9488 !important; }
body.theme-ocean-light .text-amber-700,
body.theme-ocean-light .text-amber-800,
body.theme-ocean-light .text-amber-900 { color: #0f766e !important; }

body.theme-ocean-light .border-amber-200 { border-color: #99f6e4 !important; }
body.theme-ocean-light .border-amber-300 { border-color: #5eead4 !important; }
body.theme-ocean-light .border-amber-400,
body.theme-ocean-light .border-amber-500 { border-color: #0d9488 !important; }
body.theme-ocean-light .border-amber-500\/20,
body.theme-ocean-light .border-amber-500\/30 { border-color: rgba(13, 148, 136, 0.25) !important; }

body.theme-ocean-light input:focus,
body.theme-ocean-light select:focus,
body.theme-ocean-light textarea:focus { border-color: #0d9488 !important; outline-color: #0d9488 !important; }
body.theme-ocean-light .focus\:ring-amber-500:focus { --tw-ring-color: rgba(13, 148, 136, 0.35) !important; }

body.theme-ocean-light [class*="to-amber-950"] {
  background: linear-gradient(135deg, #042f2e 0%, #115e59 50%, #0d9488 100%) !important;
  border-color: #0d9488 !important;
}

/* Garante rolagem instantânea para o topo na navegação entre rotas e páginas */
#main-content {
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Melhorias de Responsividade para Telas Pequenas / Mobile */
@media (max-width: 768px) {
  /* Garante que tabelas com muitos dados tenham rolagem horizontal suave */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  /* Ajuste de tipografia em títulos e modais no mobile */
  h1.text-2xl {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
  }

/* Modais ocupam tela cheia ou quase cheia no mobile com rolagem própria */
  #modal-container > div {
    padding: 0.75rem !important;
  }
}

/* ==========================================================================
   MENU GAVETA LATERAL MOBILE (Garante abertura 100% confiável independente de JIT)
   ========================================================================== */
@media (max-width: 1023px) {
  #app-wrapper {
    position: relative !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }

  #sidebar-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 99990 !important;
    display: none !important;
    opacity: 0;
    transition: opacity 0.25s ease-in-out !important;
  }

  #sidebar-backdrop.mobile-open {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #app-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 290px !important;
    max-width: 85vw !important;
    height: 100% !important;
    height: 100dvh !important;
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px)) !important;
    padding-left: max(0rem, env(safe-area-inset-left, 0px)) !important;
    box-sizing: border-box !important;
    z-index: 99999 !important;
    transform: translateX(-110%) !important;
    -webkit-transform: translateX(-110%) !important;
    box-shadow: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease, visibility 0.28s !important;
    -webkit-transition: -webkit-transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease, visibility 0.28s !important;
    display: flex !important;
    flex-direction: column !important;
    will-change: transform;
  }

  #app-sidebar.mobile-open {
    transform: translateX(0) !important;
    -webkit-transform: translateX(0) !important;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.7) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}

@media (min-width: 1024px) {
  #app-sidebar {
    position: static !important;
    transform: none !important;
    -webkit-transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   iOS / iPhone Safe Area & Dynamic Island Inset Protection
   ========================================================================== */
header {
  padding-top: max(0.625rem, calc(env(safe-area-inset-top, 0px) + 0.35rem)) !important;
  padding-left: max(0.75rem, calc(env(safe-area-inset-left, 0px) + 0.5rem)) !important;
  padding-right: max(0.75rem, calc(env(safe-area-inset-right, 0px) + 0.5rem)) !important;
  padding-bottom: 0.625rem !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100vw !important;
}

@supports (-webkit-touch-callout: none) {
  /* Regras exclusivas para WebKit / iOS Safari & PWA */
  header {
    padding-top: max(0.625rem, calc(env(safe-area-inset-top, 0px) + 0.35rem)) !important;
  }
}


/* ==========================================================================
   TRAVAMENTO DA BARRA SUPERIOR & BLOQUEIO DE ZOOM / OVERFLOW MOBILE
   ========================================================================== */
html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: pan-y manipulation !important;
  -webkit-text-size-adjust: 100% !important;
}

body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  position: relative !important;
  touch-action: pan-y manipulation !important;
  overscroll-behavior-y: none !important; /* Impede repuxo elástico que destrava a barra no iOS */
}

#app-wrapper {
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Header rigidamente travado no topo */
header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 40 !important;
  flex-shrink: 0 !important;
  background-color: #ffffff !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100vw !important;
}

#main-content {
  flex: 1 1 0% !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
}

/* Proteção estrita para o seletor de empresa/tenant no topo */
#header-tenant-selector-container {
  min-width: 0 !important;
  max-width: calc(100vw - 180px) !important;
  flex-shrink: 1 !important;
  overflow: hidden !important;
}

@media (min-width: 640px) {
  #header-tenant-selector-container {
    max-width: 320px !important;
  }
}

#header-tenant-select {
  max-width: 100% !important;
  min-width: 0 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}
