/* Estilos Customizados - Sistema de Gestão de Frotas */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: #090d16;
  color: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}

/* Some navegadores/celulares em "modo escuro forçado" só respeitam isso quando bate com a classe
   que já controla nosso tema (ver meta color-scheme no index.html e js/theme.js). */
html.dark { color-scheme: dark; }
html.light { color-scheme: light; }

code, kbd, samp, pre, .font-mono {
  font-family: var(--font-mono);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Animações e Transições */
.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Hover e seleção suave */
tr {
  transition: background-color 0.15s ease;
}

/* Inputs e Selects Focus */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Indicador de Calendário nos inputs de data e hora (Cinza Claro) */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) brightness(1.0);
  cursor: pointer;
  opacity: 0.85;
  padding: 2px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  filter: invert(0.85) brightness(1.15);
  background-color: rgba(255, 255, 255, 0.08);
}

html.light input[type="date"],
html.light input[type="datetime-local"],
html.light input[type="time"] {
  color-scheme: light;
}

html.light input[type="date"]::-webkit-calendar-picker-indicator,
html.light input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.light input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none;
}

/* Efeito Glassmorphism */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

/* =========================================================
   MODO CLARO (LIGHT THEME - DESIGN SYSTEM COMPLETO)
   ========================================================= */
html.light body {
  background-color: #f8fafc;
  color: #0f172a;
}

/* O cabeçalho é SEMPRE Azul Escuro Industrial (#0a1128) com borda Teal (#0e7c86) em qualquer tema */
html.light header,
html.dark header,
html.light header.app-topbar,
html.dark header.app-topbar,
header.app-topbar,
.app-topbar,
.app-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 50 !important;
  background-color: #0a1128 !important; /* 100% Solido sem transparencia */
  border-bottom: 2.5px solid #0e7c86 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#modal-container {
  position: relative;
  z-index: 100;
}

html.light header #header-view-title,
html.dark header #header-view-title,
header.app-topbar #header-view-title {
  color: #ffffff !important;
}

header.app-topbar h1,
header.app-topbar h2,
header.app-topbar span.text-white {
  color: #ffffff !important;
}

header.app-topbar .text-slate-400,
header.app-topbar .text-slate-300 {
  color: #94a3b8 !important;
}

header.app-topbar button,
header.app-topbar [class*="bg-slate-800"] {
  background-color: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
  color: #f59e0b !important;
}

header.app-topbar button:hover {
  background-color: rgba(30, 41, 59, 0.9) !important;
}

html.light #app-sidebar {
  background-color: rgba(255, 255, 255, 0.98) !important;
  border-color: #e2e8f0 !important;
}

html.light #app-sidebar h1 {
  color: #0f172a !important;
}

/* Regra Padrão Industrial: Módulos Pais Ativos SEMPRE em Azul Escuro (#0a1128) com texto Âmbar */
html.light .modulo-pai-ativo,
html.dark .modulo-pai-ativo,
.modulo-pai-ativo,
.item-modulo-ativo {
  background-color: #0a1128 !important;
  border: 1px solid #1e293b !important;
  color: #f59e0b !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html.light .modulo-pai-ativo *:not(.badge-contador),
html.dark .modulo-pai-ativo *:not(.badge-contador),
.modulo-pai-ativo i,
.modulo-pai-ativo svg,
.modulo-pai-ativo span:not(.badge-contador),
.item-modulo-ativo i,
.item-modulo-ativo svg,
.item-modulo-ativo span:not(.badge-contador) {
  color: #f59e0b !important;
}

/* Badges e Contadores de Notificação: Texto SEMPRE preto de alto contraste no fundo laranja */
.badge-contador,
.modulo-pai-ativo .badge-contador,
html.light .modulo-pai-ativo .badge-contador,
html.dark .modulo-pai-ativo .badge-contador,
.subitem-ativo .badge-contador,
html.light .subitem-ativo .badge-contador,
html.dark .subitem-ativo .badge-contador {
  background-color: #f59e0b !important;
  color: #020617 !important; /* Preto grafite de alto contraste */
  font-weight: 900 !important;
}

/* Subpágina Ativa e Itens Simples Ativos SEMPRE em Laranja/Âmbar (#f59e0b) com texto Preto */
html.light .subitem-ativo,
html.dark .subitem-ativo,
html.light .item-menu-ativo,
html.dark .item-menu-ativo,
.subitem-ativo,
.item-menu-ativo {
  background-color: #f59e0b !important;
  color: #020617 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3) !important;
}

html.light .subitem-ativo *,
html.dark .subitem-ativo *,
html.light .item-menu-ativo *,
html.dark .item-menu-ativo *,
.subitem-ativo i,
.subitem-ativo svg,
.subitem-ativo span,
.item-menu-ativo i,
.item-menu-ativo svg,
.item-menu-ativo span {
  color: #020617 !important;
}

/* Cabeçalhos de Módulos (Adaptáveis: Branco no Claro, Escuro no Dark) */
html.light .cabecalho-modulo {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}
html.light .cabecalho-modulo h1,
html.light .cabecalho-modulo h2 {
  color: #0f172a !important;
}
html.light .cabecalho-modulo p {
  color: #64748b !important;
}

html.dark .cabecalho-modulo {
  background-color: rgba(15, 23, 42, 0.8) !important;
  border-color: #1e293b !important;
}
html.dark .cabecalho-modulo h1,
html.dark .cabecalho-modulo h2 {
  color: #ffffff !important;
}
html.dark .cabecalho-modulo p {
  color: #94a3b8 !important;
}

/* Banners Operacionais em Azul Escuro Industrial (#0a1128) */
.banner-operacional,
.cockpit-header {
  background-color: #0a1128 !important;
  border: 1px solid #1e293b !important;
  color: #ffffff !important;
}

.banner-operacional h1,
.banner-operacional h2,
.banner-operacional span,
.cockpit-header h1,
.cockpit-header h2,
.cockpit-header span {
  color: #ffffff !important;
}

.banner-operacional p,
.cockpit-header p {
  color: #94a3b8 !important;
}

/* =========================================================
   FUNDO PADRÃO DA PÁGINA LEVEMENTE CINZA NO MODO CLARO
   (Inspirado no Controle Financeiro: Destaca Cards e Blocos Brancos)
   ========================================================= */
html.light,
html.light body,
html.light #app-main-wrapper,
html.light #main-content {
  background-color: #f1f5f9 !important; /* Cinza Suave Industrial (Slate-100) */
  color: #0f172a !important;
}

/* Painéis, Cartões e Estruturas Principais (Isolando cabeçalhos e módulos escuros) */
html.light [class*="bg-slate-950"]:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light [class*="bg-slate-900"]:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light .bg-slate-900:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light .bg-slate-950:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo) {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

/* Quadros Internos, Grids e Sub-cartões (Obras, Manutenção, Detalhes) */
html.light [class*="bg-slate-950/"]:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light [class*="bg-slate-900/"]:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light [class*="bg-slate-800/"]:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light [class*="bg-slate-800"]:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo),
html.light .bg-slate-800:not(body):not(#app-main-wrapper):not(#main-content):not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]):not(.modulo-pai-ativo):not(.app-topbar):not(.app-header):not(.cabecalho-modulo):not(.banner-operacional):not(.cockpit-header):not(.subitem-ativo):not(.item-menu-ativo) {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Cabeçalhos de Tabelas */
html.light thead,
html.light [class*="thead"],
html.light thead.bg-slate-800\/60,
html.light thead.bg-slate-800\/70 {
  background-color: #f1f5f9 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

html.light thead th {
  color: #334155 !important;
  font-weight: 700 !important;
  background-color: #f1f5f9 !important;
}

html.light tbody tr {
  border-color: #e2e8f0 !important;
}

html.light tbody tr:hover,
html.light tr.hover\:bg-slate-800\/40:hover {
  background-color: #f1f5f9 !important;
}

html.light tbody td {
  color: #1e293b !important;
}

/* =========================================================
   CARDS DE CHAMADOS & MANUTENÇÃO COM CORES DE FUNDO POR STATUS
   ========================================================= */
.card-chamado-pendente {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05) !important;
}
html.dark .card-chamado-pendente {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3) !important;
}

.card-chamado-visualizado {
  background-color: #eff6ff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.18) !important;
}
html.dark .card-chamado-visualizado {
  background-color: rgba(30, 58, 138, 0.35) !important;
  border-color: #2563eb !important;
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.25) !important;
}

.card-chamado-atendimento {
  background-color: #fffbeb !important;
  border-color: #f59e0b !important;
  box-shadow: 0 4px 14px -2px rgba(245, 158, 11, 0.20) !important;
}
html.dark .card-chamado-atendimento {
  background-color: rgba(120, 53, 15, 0.35) !important;
  border-color: #d97706 !important;
  box-shadow: 0 4px 14px -2px rgba(217, 119, 6, 0.25) !important;
}

.card-chamado-manutencao {
  background-color: #fff1f2 !important;
  border-color: #f43f5e !important;
  box-shadow: 0 4px 14px -2px rgba(244, 63, 94, 0.20) !important;
}
html.dark .card-chamado-manutencao {
  background-color: rgba(136, 19, 55, 0.35) !important;
  border-color: #e11d48 !important;
  box-shadow: 0 4px 14px -2px rgba(225, 29, 72, 0.25) !important;
}

.card-chamado-liberado {
  background-color: #f0fdf4 !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.20) !important;
}
html.dark .card-chamado-liberado {
  background-color: rgba(6, 78, 59, 0.35) !important;
  border-color: #059669 !important;
  box-shadow: 0 4px 14px -2px rgba(5, 150, 105, 0.25) !important;
}

/* Painéis e caixas internas dentro de cards coloridos */
html.light .card-inner-panel {
  background-color: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
}
html.dark .card-inner-panel {
  background-color: rgba(2, 6, 23, 0.6) !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
}

/* Cartões Coloridos & Filtros da Manutenção */
html.light [class*="bg-emerald-950"],
html.light [class*="bg-emerald-900"] {
  background-color: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

html.light [class*="bg-rose-950"],
html.light [class*="bg-rose-900"] {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

html.light [class*="bg-amber-950"],
html.light [class*="bg-amber-900"] {
  background-color: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  color: #c2410c !important;
}

html.light [class*="bg-blue-950"],
html.light [class*="bg-blue-900"],
html.light [class*="bg-sky-950"] {
  background-color: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
}

html.light [class*="bg-purple-950"],
html.light [class*="bg-purple-900"] {
  background-color: #faf5ff !important;
  border-color: #e9d5ff !important;
  color: #7e22ce !important;
}

html.light [class*="bg-indigo-950"],
html.light [class*="bg-indigo-900"] {
  background-color: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #4338ca !important;
}

/* Badges e Tags com Fundo Suave (Voltado ao Laranja Industrial, Discreto) */
html.light [class*="bg-amber-400/"],
html.light [class*="bg-amber-500/"] {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #c2410c !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

html.light [class*="bg-orange-400/"],
html.light [class*="bg-orange-500/"],
html.light [class*="bg-orange-600/"] {
  background-color: #ffedd5 !important;
  color: #9a3412 !important;
  border-color: #fdba74 !important;
}

html.light [class*="bg-emerald-400/"],
html.light [class*="bg-emerald-500/"],
html.light [class*="bg-emerald-600/"] {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

html.light [class*="bg-rose-400/"],
html.light [class*="bg-rose-500/"],
html.light [class*="bg-rose-600/"] {
  background-color: #ffe4e6 !important;
  color: #9f1239 !important;
  border-color: #fecdd3 !important;
}

html.light [class*="bg-blue-400/"],
html.light [class*="bg-blue-500/"],
html.light [class*="bg-sky-400/"],
html.light [class*="bg-sky-500/"] {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #bae6fd !important;
}

html.light [class*="bg-purple-400/"],
html.light [class*="bg-purple-500/"] {
  background-color: #f3e8ff !important;
  color: #6b21a8 !important;
  border-color: #e9d5ff !important;
}

html.light [class*="bg-cyan-400/"],
html.light [class*="bg-cyan-500/"] {
  background-color: #cffafe !important;
  color: #155e75 !important;
  border-color: #a5f3fc !important;
}

html.light [class*="bg-indigo-400/"],
html.light [class*="bg-indigo-500/"],
html.light [class*="bg-indigo-600/"] {
  background-color: #e0e7ff !important;
  color: #3730a3 !important;
  border-color: #c7d2fe !important;
}

/* Tipografia de Alto Contraste */
html.light .text-white:not(header.app-topbar *):not(.app-topbar *):not(.modulo-pai-ativo *):not(.subitem-ativo *),
html.light .text-slate-100:not(header.app-topbar *):not(.app-topbar *),
html.light .text-slate-200:not(header.app-topbar *):not(.app-topbar *),
html.light .text-slate-300:not(header.app-topbar *):not(.app-topbar *) {
  color: #1e293b !important;
}

html.light .text-slate-400:not(header.app-topbar *):not(.app-topbar *) {
  color: #475569 !important;
}

html.light .text-slate-500 {
  color: #64748b !important;
}

/* Aviso de notificações do rodapé: é sempre escuro (fica fora das regras de fundo do tema claro),
   então o texto precisa continuar claro também no tema claro. */
html.light #notif-permission-banner .text-white,
html.light #notif-permission-banner .hover\:text-white:hover {
  color: #ffffff !important;
}

html.light #notif-permission-banner .text-slate-300 {
  color: #cbd5e1 !important;
}

html.light #notif-permission-banner .text-slate-400 {
  color: #94a3b8 !important;
}

html.light #notif-permission-banner .text-amber-400 {
  color: #fbbf24 !important;
}

/* ==========================================================================
   DROPDOWNS MULTISSELEÇÃO (Empresas, Classificação, Espécies)
   ========================================================================== */

/* 1. Modo Escuro (Dark / Padrão) */
[id*="dropdown-multi"] {
  background-color: #0f172a !important; /* Slate-900 */
  border-color: #334155 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
}

[id*="dropdown-multi"] .dropdown-multi-header {
  border-bottom-color: #1e293b !important;
}

[id*="dropdown-multi"] .dropdown-multi-title {
  color: #94a3b8 !important;
  font-weight: 700 !important;
}

[id*="dropdown-multi"] .btn-select-all,
[id*="dropdown-multi"] button[id*="btn-select-all"] {
  color: #fbbf24 !important; /* Âmbar */
  font-weight: 700 !important;
}

[id*="dropdown-multi"] .btn-select-all:hover,
[id*="dropdown-multi"] button[id*="btn-select-all"]:hover {
  color: #fde047 !important;
  text-decoration: underline !important;
}

[id*="dropdown-multi"] .dropdown-multi-header span {
  color: #64748b !important;
}

[id*="dropdown-multi"] .btn-clear,
[id*="dropdown-multi"] button[id*="btn-clear"] {
  color: #cbd5e1 !important; /* Slate-300 */
  font-weight: 600 !important;
}

[id*="dropdown-multi"] .btn-clear:hover,
[id*="dropdown-multi"] button[id*="btn-clear"]:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

[id*="dropdown-multi"] input[type="text"] {
  background-color: #020617 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

[id*="dropdown-multi"] input[type="text"]::placeholder {
  color: #64748b !important;
}

[id*="dropdown-multi"] label,
[id*="dropdown-multi"] label span {
  color: #f1f5f9 !important; /* Texto claro no tema escuro */
}

[id*="dropdown-multi"] label:hover {
  background-color: #1e293b !important;
}

/* 2. Modo Claro (Light) - Alto Contraste */
html.light [id*="dropdown-multi"] {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

html.light [id*="dropdown-multi"] .dropdown-multi-header {
  border-bottom-color: #e2e8f0 !important;
}

html.light [id*="dropdown-multi"] .dropdown-multi-title {
  color: #475569 !important; /* Slate-600 */
  font-weight: 700 !important;
}

html.light [id*="dropdown-multi"] .btn-select-all,
html.light [id*="dropdown-multi"] button[id*="btn-select-all"] {
  color: #d97706 !important; /* Âmbar vibrante escuro */
  font-weight: 700 !important;
}

html.light [id*="dropdown-multi"] .btn-select-all:hover,
html.light [id*="dropdown-multi"] button[id*="btn-select-all"]:hover {
  color: #b45309 !important;
  text-decoration: underline !important;
}

html.light [id*="dropdown-multi"] .dropdown-multi-header span {
  color: #cbd5e1 !important;
}

html.light [id*="dropdown-multi"] .btn-clear,
html.light [id*="dropdown-multi"] button[id*="btn-clear"] {
  color: #475569 !important; /* Slate-600 bem legível */
  font-weight: 600 !important;
}

html.light [id*="dropdown-multi"] .btn-clear:hover,
html.light [id*="dropdown-multi"] button[id*="btn-clear"]:hover {
  color: #0f172a !important;
  text-decoration: underline !important;
}

html.light [id*="dropdown-multi"] input[type="text"] {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html.light [id*="dropdown-multi"] input[type="text"]::placeholder {
  color: #94a3b8 !important;
}

html.light [id*="dropdown-multi"] label,
html.light [id*="dropdown-multi"] label span {
  color: #1e293b !important; /* Texto escuro perfeitamente legível sobre fundo branco */
  font-weight: 500 !important;
}

html.light [id*="dropdown-multi"] label:hover {
  background-color: #f1f5f9 !important; /* Slate-100 */
  color: #0f172a !important;
}

html.light .text-amber-400,
html.light .text-amber-300 {
  color: #d97706 !important;
}

html.light .text-orange-400,
html.light .text-orange-300,
html.light .text-orange-200 {
  color: #c2410c !important;
}

html.light .text-emerald-400,
html.light .text-emerald-300,
html.light .text-emerald-200 {
  color: #047857 !important;
}

html.light .text-rose-400,
html.light .text-rose-300 {
  color: #be123c !important;
}

html.light .text-blue-400,
html.light .text-blue-300,
html.light .text-sky-400,
html.light .text-sky-300 {
  color: #0369a1 !important;
}

html.light .text-cyan-400,
html.light .text-cyan-300 {
  color: #0e7490 !important;
}

html.light .text-purple-400,
html.light .text-purple-300 {
  color: #7e22ce !important;
}

html.light .text-indigo-400,
html.light .text-indigo-300 {
  color: #4338ca !important;
}

/* =========================================================
   BARRA SUPERIOR (TOPBAR) INDUSTRIAL - #0a1128
   Imutável em qualquer tema (Light ou Dark)
   ========================================================= */
header.app-topbar,
html.light header.app-topbar,
html.dark header.app-topbar,
.app-topbar,
html.light .app-topbar,
html.dark .app-topbar {
  background-color: #0a1128 !important;
  border-bottom: 2.5px solid #0e7c86 !important;
  color: #ffffff !important;
}

header.app-topbar h1,
header.app-topbar h2,
html.light header.app-topbar h1,
html.light header.app-topbar h2 {
  color: #ffffff !important;
}

header.app-topbar p,
html.light header.app-topbar p {
  color: #94a3b8 !important;
}

/* Containers de Seletores e Pills no Topo */
header.app-topbar [class*="bg-slate-800"],
header.app-topbar [class*="bg-slate-900"],
html.light header.app-topbar [class*="bg-slate-800"],
html.light header.app-topbar [class*="bg-slate-900"],
html.dark header.app-topbar [class*="bg-slate-800"],
html.dark header.app-topbar [class*="bg-slate-900"] {
  background-color: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(51, 65, 85, 0.9) !important;
}

/* Seletor de Obra no Topo */
header.app-topbar #header-obra-switcher,
header.app-topbar #header-obra-switcher-mob,
html.light header.app-topbar #header-obra-switcher,
html.light header.app-topbar #header-obra-switcher-mob,
html.dark header.app-topbar #header-obra-switcher,
html.dark header.app-topbar #header-obra-switcher-mob {
  background-color: transparent !important;
  border: none !important;
  color: #38bdf8 !important; /* Sky 400 - bem visível e nítido */
  font-weight: 700 !important;
  box-shadow: none !important;
}

/* Seletor de Perfil / Usuário no Topo */
header.app-topbar #owner-user-switcher,
header.app-topbar #owner-user-switcher-mob,
html.light header.app-topbar #owner-user-switcher,
html.light header.app-topbar #owner-user-switcher-mob,
html.dark header.app-topbar #owner-user-switcher,
html.dark header.app-topbar #owner-user-switcher-mob {
  background-color: transparent !important;
  border: none !important;
  color: #fbbf24 !important; /* Amber 400 - bem visível e nítido */
  font-weight: 700 !important;
  box-shadow: none !important;
}

/* Opções dos Selects no Topo */
header.app-topbar select option,
html.light header.app-topbar select option,
.app-topbar select option,
html.light .app-topbar select option {
  background-color: #ffffff !important;
  color: #334155 !important; /* Cinza escuro perfeitamente legível no menu branco do Windows */
}

html.dark header.app-topbar select option,
html.dark .app-topbar select option {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

/* Detalhes do Usuário Conectado na Topbar */
header.app-topbar #user-switcher-container .text-white,
header.app-topbar #user-switcher-container span.text-white,
html.light header.app-topbar #user-switcher-container .text-white,
html.light header.app-topbar #user-switcher-container span.text-white {
  color: #ffffff !important;
}

header.app-topbar #user-switcher-container .text-slate-400,
header.app-topbar #user-switcher-container .text-slate-300,
html.light header.app-topbar #user-switcher-container .text-slate-400,
html.light header.app-topbar #user-switcher-container .text-slate-300 {
  color: #cbd5e1 !important; /* Cinza claro perfeitamente legível sobre o azul escuro */
}

/* Botão Sair no Topo */
header.app-topbar .btn-topbar-logout,
header.app-topbar button[onclick*="logout"],
html.light header.app-topbar .btn-topbar-logout,
html.light header.app-topbar button[onclick*="logout"],
html.dark header.app-topbar .btn-topbar-logout,
html.dark header.app-topbar button[onclick*="logout"] {
  background-color: rgba(244, 63, 94, 0.15) !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
}

header.app-topbar .btn-topbar-logout span,
header.app-topbar button[onclick*="logout"] span,
html.light header.app-topbar .btn-topbar-logout span,
html.light header.app-topbar button[onclick*="logout"] span,
html.dark header.app-topbar .btn-topbar-logout span,
html.dark header.app-topbar button[onclick*="logout"] span {
  color: #fda4af !important; /* Rosa claro vibrante perfeitamente legível */
  font-weight: 700 !important;
}

header.app-topbar .btn-topbar-logout i,
header.app-topbar button[onclick*="logout"] i,
html.light header.app-topbar .btn-topbar-logout i,
html.light header.app-topbar button[onclick*="logout"] i,
html.dark header.app-topbar .btn-topbar-logout i,
html.dark header.app-topbar button[onclick*="logout"] i {
  color: #fb7185 !important;
}

header.app-topbar .btn-topbar-logout:hover,
header.app-topbar button[onclick*="logout"]:hover,
html.light header.app-topbar .btn-topbar-logout:hover,
html.light header.app-topbar button[onclick*="logout"]:hover {
  background-color: rgba(244, 63, 94, 0.3) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
}

/* Botões de Notificação e Tema no Topo */
header.app-topbar #notif-toggle-btn,
header.app-topbar #theme-toggle-btn,
header.app-topbar #notif-toggle-btn-mob,
header.app-topbar #theme-toggle-btn-mob,
html.light header.app-topbar #notif-toggle-btn,
html.light header.app-topbar #theme-toggle-btn,
html.light header.app-topbar #notif-toggle-btn-mob,
html.light header.app-topbar #theme-toggle-btn-mob {
  background-color: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(51, 65, 85, 0.9) !important;
  color: #f59e0b !important;
}

header.app-topbar #notif-toggle-btn i,
header.app-topbar #theme-toggle-btn i,
header.app-topbar #notif-toggle-btn-mob i,
header.app-topbar #theme-toggle-btn-mob i,
html.light header.app-topbar #notif-toggle-btn i,
html.light header.app-topbar #theme-toggle-btn i,
html.light header.app-topbar #notif-toggle-btn-mob i,
html.light header.app-topbar #theme-toggle-btn-mob i {
  color: #f59e0b !important;
}

/* Bordas Gerais */
html.light [class*="border-slate-800"],
html.light [class*="border-slate-700"],
html.light .border-slate-800,
html.light .border-slate-700,
html.light .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
html.light [class*="divide-slate-800"] > :not([hidden]) ~ :not([hidden]) {
  border-color: #e2e8f0 !important;
}

html.light [class*="border-white/70"] {
  border-color: #94a3b8 !important;
}

/* Inputs, Selects e Textareas */
html.light input:not([type="checkbox"]):not([type="radio"]):not(header.app-topbar *):not(.app-topbar *),
html.light select:not(header.app-topbar *):not(.app-topbar *),
html.light textarea:not(header.app-topbar *):not(.app-topbar *) {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #94a3b8 !important;
}

html.light input:focus,
html.light select:focus:not(header.app-topbar *):not(.app-topbar *),
html.light textarea:focus {
  border-color: #f59e0b !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
}

/* Botões Secundários */
html.light button[class*="bg-slate-800"]:not(header.app-topbar *):not(.app-topbar *),
html.light button.bg-slate-800:not(header.app-topbar *):not(.app-topbar *) {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

html.light button[class*="bg-slate-800"]:hover:not(header.app-topbar *):not(.app-topbar *),
html.light button.bg-slate-800:hover:not(header.app-topbar *):not(.app-topbar *),
html.light [class*="hover:bg-slate-700"]:hover:not(header.app-topbar *):not(.app-topbar *) {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Modais e Diálogos */
html.light #modal-container [class*="bg-slate-900"],
html.light [id*="modal"] [class*="bg-slate-900"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

html.light #modal-container [class*="bg-slate-800/40"],
html.light [id*="modal"] [class*="bg-slate-800/40"] {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.light #modal-container [class*="bg-slate-950"]:not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]),
html.light [id*="modal"] [class*="bg-slate-950"]:not(.fixed):not([id*="backdrop"]):not([class*="backdrop"]) {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Backdrops e Overlays de Modais (Fundo Translúcido Esmaecido em Qualquer Tema) */
#modal-container > div.fixed,
#modal-container div.fixed.inset-0,
#modal-backdrop,
.modal-backdrop,
#sidebar-overlay,
html.light #modal-container > div.fixed,
html.light #modal-container div.fixed.inset-0,
html.light #modal-backdrop,
html.light .modal-backdrop,
html.light #sidebar-overlay {
  background-color: rgba(15, 23, 42, 0.60) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

html.dark #modal-container > div.fixed,
html.dark #modal-container div.fixed.inset-0,
html.dark #modal-backdrop,
html.dark .modal-backdrop,
html.dark #sidebar-overlay {
  background-color: rgba(2, 6, 23, 0.75) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Scrollbars */
html.light ::-webkit-scrollbar-track {
  background: #f1f5f9;
}

html.light ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

html.light ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* PWA Safe Area Insets (iPhone Notch & Dynamic Island) e Offset Dinâmico da Topbar Fixa */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --app-topbar-height: calc(108px + max(12px, env(safe-area-inset-top, 0px)));
}

@media (min-width: 1280px) {
  :root {
    --app-topbar-height: 64px;
  }
}

@media (max-width: 1279px) {
  header.app-topbar,
  .app-topbar {
    padding-top: max(12px, env(safe-area-inset-top, 0px)) !important;
    box-sizing: border-box !important;
  }
}

#app-main-wrapper {
  padding-top: var(--app-topbar-height);
  box-sizing: border-box !important;
}

#app-sidebar {
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top, 0px) !important;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  box-sizing: border-box !important;
}

body {
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Bloqueio de Zoom In / Zoom Out e estabilização de layout em Tablets e Mobile */
html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  touch-action: pan-y manipulation;
  -webkit-text-size-adjust: 100%;
}

#app-main-wrapper,
#main-content {
  overflow-x: hidden !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* Garante que tabelas e elementos scrolláveis internos funcionem perfeitamente */
.overflow-x-auto {
  touch-action: pan-x pan-y !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100% !important;
}

/* Previne zoom automático do iOS/Safari ao focar campos de texto sem afetar date inputs */
@media (max-width: 1024px) {
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Compacta inputs de data no mobile para nunca vazarem do container */
  input[type="date"],
  input[type="datetime-local"] {
    font-size: 11px !important;
    max-width: 100% !important;
  }
}

/* Oculta seta nativa duplicada de datalist no Chrome para manter consistência industrial */
input[list]::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none;
}

/* Padrão de Cabeçalho Industrial Antigravity (inspirado em Fornecimento Industrial) */
.app-topbar,
.app-header {
  background-color: #0a1128 !important;
  border-bottom: 2.5px solid #0e7c86 !important;
}

/* Pílulas do topo (obra ativa, alternar obra/perfil): ficam SEMPRE escuras, como o próprio topo, em qualquer tema.
   Não usar classes bg-slate-* nelas: as regras do tema claro clareiam o fundo e o texto claro some (contraste ~1:1). */
.topbar-pilula { background-color: rgba(15, 23, 42, 0.9); }
.topbar-pilula:hover { background-color: #1e293b; }

/* SSEs: contador (bolinha) da aba selecionada — azul forte com número branco nos dois temas.
   Não usa bg-blue-800/text-white: no tema claro o texto branco vira escuro e o fundo continua escuro. */
.sse-aba-contador-ativo {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  border: 1px solid #1e40af !important;
}
