/* ═══════════════════════════════════════════
   Design Tokens
═══════════════════════════════════════════ */
:root {
  --c-bg:           #f3f4f6;
  --c-surface:      #ffffff;
  --c-border:       #e5e7eb;
  --c-border-light: #f3f4f6;
  --c-text-1:       #111827;
  --c-text-2:       #6b7280;
  --c-text-3:       #9ca3af;
  --c-accent:       #2563eb;
  --r-card:         14px;
  --shadow-xs:      0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px -1px rgba(0,0,0,.04);
  --shadow-md:      0 4px 20px rgba(0,0,0,.09), 0 1px 6px rgba(0,0,0,.04);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.1),  0 2px 8px  rgba(0,0,0,.05);
}

/* ═══════════════════════════════════════════
   Base
═══════════════════════════════════════════ */
[x-cloak] { display: none !important; }

/* Badge de categoria no modal — opacidade maior no dark mode */
html.dark .categoria-badge {
  background: color-mix(in srgb, var(--cat-cor) 60%, transparent) !important;
  color: #ffffff !important;
  filter: brightness(1.1);
}

/* Badge de status no modal — cores dark mode via variáveis CSS */
html.dark .status-badge-modal {
  background: var(--dk-bg) !important;
  color: var(--dk-color) !important;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input:focus, select:focus, textarea:focus { outline: none; }

/* ═══════════════════════════════════════════
   Scrollbar
═══════════════════════════════════════════ */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: #e2e8f0; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: #cbd5e1; }

.kanban-board::-webkit-scrollbar        { height: 8px; }
.kanban-board::-webkit-scrollbar-track  { background: #f1f5f9; border-radius: 99px; }
.kanban-board::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 99px; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══════════════════════════════════════════
   Sidebar
═══════════════════════════════════════════ */
.sidebar-text-transition {
  transition: max-width .3s ease, opacity .3s ease;
  overflow: hidden;
  white-space: nowrap;
}
#tc-sidebar a.group.justify-center        { gap: 0 !important; }
.tc-sb-c #tc-sb-logo .sidebar-text-transition { margin-left: 0 !important; }

/* Nav states — light sidebar */
a.tc-nav-active {
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-weight: 600;
}
a.tc-nav-active i { color: #2563eb !important; }

a.tc-nav-inactive { color: #4b5563; }
a.tc-nav-inactive:hover {
  background: #f9fafb;
  color: #111827 !important;
}

/* ═══════════════════════════════════════════
   Cards
═══════════════════════════════════════════ */
.tc-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-hover { transition: box-shadow .18s ease, transform .18s ease; }
.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Stat card w/ colored background */
.tc-stat-card {
  border-radius: var(--r-card);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
}

/* Per-status background + text colours */
.tc-s-aguardando         { background: #FEF3C7; }
.tc-s-aguardando .tc-stat-num   { color: #78350F; }
.tc-s-aguardando .tc-stat-label { color: #92400E; }

.tc-s-em_teste           { background: #DBEAFE; }
.tc-s-em_teste   .tc-stat-num   { color: #1e3a5f; }
.tc-s-em_teste   .tc-stat-label { color: #1d4ed8; }

.tc-s-testado_ok         { background: #D1FAE5; }
.tc-s-testado_ok .tc-stat-num   { color: #022C22; }
.tc-s-testado_ok .tc-stat-label { color: #065F46; }

.tc-s-testado_problema   { background: #FFE4E6; }
.tc-s-testado_problema .tc-stat-num   { color: #4C0519; }
.tc-s-testado_problema .tc-stat-label { color: #9F1239; }

.tc-s-limpo              { background: #CCFBF1; }
.tc-s-limpo      .tc-stat-num   { color: #134E4A; }
.tc-s-limpo      .tc-stat-label { color: #0F766E; }

.tc-s-devolvido          { background: #F1F5F9; }
.tc-s-devolvido  .tc-stat-num   { color: #1E293B; }
.tc-s-devolvido  .tc-stat-label { color: #475569; }

.tc-s-manutencao         { background: #FFEDD5; }
.tc-s-manutencao .tc-stat-num   { color: #7C2D12; }
.tc-s-manutencao .tc-stat-label { color: #9A3412; }

.tc-s-sinistro           { background: #F5F3FF; }
.tc-s-sinistro   .tc-stat-num   { color: #2E1065; }
.tc-s-sinistro   .tc-stat-label { color: #4C1D95; }

/* ═══════════════════════════════════════════
   Table
═══════════════════════════════════════════ */
.tc-table { width: 100%; border-collapse: collapse; }

.tc-table thead th {
  background: #f9fafb;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 16px;
  white-space: nowrap;
}

.tc-table tbody tr            { border-bottom: 1px solid var(--c-border-light); transition: background .1s; }
.tc-table tbody tr:last-child { border-bottom: none; }
.tc-table tbody tr:hover      { background: #f9fafb; }
.tc-table tbody td            { padding: 12px 16px; }

/* ═══════════════════════════════════════════
   Badges
═══════════════════════════════════════════ */
.tc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tc-badge i { font-size: 9px; }

.tc-badge-green  { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.tc-badge-red    { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.tc-badge-yellow { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.tc-badge-gray   { background: #f9fafb; color: #6b7280; border-color: #e5e7eb; }
.tc-badge-blue   { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.tc-badge-cyan   { background: #ecfeff; color: #0891b2; border-color: #a5f3fc; }
.tc-badge-amber  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tc-badge-purple { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }

/* ═══════════════════════════════════════════
   Filter toolbar (inside tc-card)
═══════════════════════════════════════════ */
.tc-filter-bar {
  padding: 12px 20px;
  background: #fafafa;
  border-bottom: 1px solid var(--c-border);
}

/* ═══════════════════════════════════════════
   Kanban columns + cards
═══════════════════════════════════════════ */
.kanban-col {
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow .15s ease;
}
.kanban-col:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.kanban-cards::-webkit-scrollbar        { width: 4px; }
.kanban-cards::-webkit-scrollbar-track  { background: transparent; }
.kanban-cards::-webkit-scrollbar-thumb  { background: #e2e8f0; border-radius: 99px; }
.kanban-cards::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.kanban-card {
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

/* Drag states */
.sortable-ghost {
  opacity: .3;
  background: #eff6ff !important;
  border-radius: .75rem;
  transform: none !important;
}
.sortable-drag {
  opacity: .95;
  transform: rotate(1.5deg) scale(1.02);
  cursor: grabbing !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.12) !important;
}

/* ═══════════════════════════════════════════
   Animation delays
═══════════════════════════════════════════ */
.anim-delay-1 { animation-delay:  50ms; }
.anim-delay-2 { animation-delay: 100ms; }
.anim-delay-3 { animation-delay: 150ms; }
.anim-delay-4 { animation-delay: 200ms; }
.anim-delay-5 { animation-delay: 250ms; }
.anim-delay-6 { animation-delay: 300ms; }
.anim-delay-7 { animation-delay: 350ms; }
.anim-delay-8 { animation-delay: 400ms; }

/* ═══════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════ */
/* ── Tailwind utility overrides ── */
html.dark .text-slate-900 { color: #f1f5f9 !important; }
html.dark .text-slate-800 { color: #e2e8f0 !important; }
html.dark .text-slate-700 { color: #d4d4d4 !important; }
html.dark .text-slate-600 { color: #a3a3a3 !important; }
html.dark .text-slate-500 { color: #737373 !important; }

html.dark .bg-white       { background: #1f1f1f !important; }
html.dark .bg-slate-50    { background: #161616 !important; }
html.dark .bg-slate-100   { background: #2a2a2a !important; }
html.dark .bg-slate-200   { background: #363636 !important; }

html.dark .border-slate-50  { border-color: #1f1f1f !important; }
html.dark .border-slate-100 { border-color: #2e2e2e !important; }
html.dark .border-slate-200 { border-color: #2e2e2e !important; }
html.dark .border-slate-300 { border-color: #404040 !important; }

/* Icon boxes in stat cards */
html.dark .bg-amber-50   { background: rgba(120,53,15,.25)  !important; }
html.dark .bg-blue-50    { background: rgba(30,58,138,.25)  !important; }
html.dark .bg-emerald-50 { background: rgba(6,78,59,.25)    !important; }
html.dark .bg-red-50     { background: rgba(127,29,29,.25)  !important; }
html.dark .bg-rose-50    { background: rgba(127,29,29,.25)  !important; }
html.dark .bg-violet-50  { background: rgba(46,16,101,.25)  !important; }
html.dark .bg-teal-50    { background: rgba(19,78,74,.25)   !important; }
html.dark .bg-cyan-50    { background: rgba(8,51,68,.25)    !important; }
html.dark .bg-orange-50  { background: rgba(154,52,18,.25)  !important; }

/* Status badge text — brighten -700 → ~-400 in dark mode */
html.dark .text-amber-700   { color: #fbbf24 !important; }
html.dark .text-blue-700    { color: #60a5fa !important; }
html.dark .text-emerald-700 { color: #34d399 !important; }
html.dark .text-teal-700    { color: #2dd4bf !important; }
html.dark .text-cyan-700    { color: #22d3ee !important; }
html.dark .text-orange-700  { color: #fb923c !important; }
html.dark .text-red-700     { color: #f87171 !important; }

/* Status badge borders — mute -300 in dark mode */
html.dark .border-amber-300   { border-color: #92400e !important; }
html.dark .border-blue-300    { border-color: #1d4ed8 !important; }
html.dark .border-emerald-300 { border-color: #065f46 !important; }
html.dark .border-teal-300    { border-color: #0f766e !important; }
html.dark .border-cyan-300    { border-color: #0e7490 !important; }
html.dark .border-orange-300  { border-color: #9a3412 !important; }
html.dark .border-red-300     { border-color: #991b1b !important; }

html.dark .bg-blue-100   { background: rgba(30,58,138,.3) !important; }

/* Activity / table row dividers */
html.dark .divide-slate-100 > * + * { border-color: #2e2e2e !important; }
html.dark .divide-y > * + *         { border-color: #2e2e2e !important; }

/* Ring / focus */
html.dark .ring-slate-100 { --tw-ring-color: #2e2e2e; }

/* ── Hover state overrides ── */
html.dark .hover\:bg-slate-50:hover  { background: #252525 !important; }
html.dark .hover\:bg-slate-100:hover { background: #2a2a2a !important; }
html.dark .hover\:bg-slate-200:hover { background: #363636 !important; }
html.dark .hover\:bg-gray-50:hover   { background: #252525 !important; }
html.dark .hover\:bg-gray-100:hover  { background: #2a2a2a !important; }
/* Tailwind opacity variants */
html.dark .hover\:bg-slate-50\/60:hover { background: rgba(37,37,37,.8) !important; }
html.dark .hover\:bg-slate-50\/50:hover { background: #252525 !important; }
/* Amber hover (edit buttons) */
html.dark .hover\:bg-amber-50:hover     { background: #2a2a2a !important; }
html.dark .hover\:border-amber-200:hover { border-color: #404040 !important; }
/* Divider between rows */
html.dark .divide-slate-50 > * + *   { border-color: #2e2e2e !important; }
/* Table row hover */
html.dark .tc-table tbody tr:hover   { background: #252525 !important; }
html.dark {
  color-scheme: dark;
  /* CSS variable overrides */
  --c-bg:           #111111;
  --c-surface:      #1f1f1f;
  --c-border:       #2e2e2e;
  --c-border-light: #2e2e2e;
  --c-text-1:       #f5f5f5;
  --c-text-2:       #a3a3a3;
  --c-text-3:       #737373;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,.6), 0 1px 6px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.5);
}

/* Body */
html.dark body { background: #111111; color: #f5f5f5; }

/* text-slate-400 is used as muted — lift it in dark */
html.dark .text-slate-400 { color: #a3a3a3 !important; }

/* Sidebar */
html.dark #tc-sidebar {
  background: #111111 !important;
  border-right-color: #222222 !important;
  box-shadow: 2px 0 16px rgba(0,0,0,.5) !important;
}
html.dark #tc-sidebar .border-b,
html.dark #tc-sidebar .border-t { border-color: #222222 !important; }
html.dark #tc-sidebar p.font-extrabold      { color: #f5f5f5 !important; }
html.dark #tc-sidebar .text-slate-400       { color: #525252 !important; }
html.dark #tc-sidebar .text-slate-900       { color: #f5f5f5 !important; }
html.dark #tc-sidebar .text-slate-500       { color: #a3a3a3 !important; }
html.dark #tc-sidebar .bg-slate-100         { background: #1f1f1f !important; }
html.dark a.tc-nav-active                   { background: #1f2937; color: #60a5fa !important; }
html.dark a.tc-nav-active i                 { color: #3b82f6 !important; }
html.dark a.tc-nav-inactive                 { color: #a3a3a3; }
html.dark a.tc-nav-inactive:hover           { background: #1f1f1f; color: #f5f5f5 !important; }

/* Header */
html.dark header {
  background: #1a1a1a !important;
  border-bottom-color: #2e2e2e !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.4) !important;
}
html.dark header button:hover { background: #2a2a2a !important; }
html.dark header .hover\:bg-slate-100:hover { background: #2a2a2a !important; }

/* Cards */
html.dark .tc-card              { background: #1f1f1f; border-color: #2e2e2e; }
html.dark .tc-filter-bar        { background: #181818; border-bottom-color: #2e2e2e; }
html.dark .card-hover:hover     { box-shadow: var(--shadow-md); }

/* Table */
html.dark .tc-table thead th          { background: #181818; border-bottom-color: #2e2e2e; color: #737373; }
html.dark .tc-table tbody tr          { border-bottom-color: #2e2e2e; }
html.dark .tc-table tbody tr:last-child { border-bottom: none; }
html.dark .tc-table tbody tr:hover    { background: #181818; }

/* Badges */
html.dark .tc-badge-green  { background: #052e16; color: #4ade80; border-color: #166534; }
html.dark .tc-badge-red    { background: #450a0a; color: #f87171; border-color: #991b1b; }
html.dark .tc-badge-yellow { background: #422006; color: #fcd34d; border-color: #92400e; }
html.dark .tc-badge-gray   { background: #262626; color: #a3a3a3; border-color: #404040; }
html.dark .tc-badge-blue   { background: #172554; color: #93c5fd; border-color: #1d4ed8; }
html.dark .tc-badge-cyan   { background: #083344; color: #67e8f9; border-color: #0e7490; }
html.dark .tc-badge-amber  { background: #422006; color: #fcd34d; border-color: #92400e; }
html.dark .tc-badge-purple { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }

/* Kanban columns */
html.dark .kanban-col               { background: #181818 !important; border-right-color: #2e2e2e !important; border-bottom-color: #2e2e2e !important; border-left-color: #2e2e2e !important; }
html.dark .kanban-col > .h-\[3px\]  { opacity: 1 !important; }
html.dark .kanban-col .border-b,
html.dark .kanban-col .border-slate-100 { border-color: #2e2e2e !important; }
html.dark .kanban-col .text-slate-700 { color: #d4d4d4 !important; }
html.dark .kanban-col .text-slate-500 { color: #737373 !important; }
html.dark .kanban-col .bg-slate-100   { background: #2a2a2a !important; color: #a3a3a3 !important; }
html.dark .kanban-col a.hover\:bg-slate-100:hover { background: #2a2a2a !important; }
html.dark .kanban-empty               { border-color: #2e2e2e !important; }

/* Kanban cards */
html.dark .kanban-card              { background: #1f1f1f !important; border-color: #2e2e2e !important; }
html.dark .kanban-card:hover        { border-color: #404040 !important; box-shadow: 0 4px 16px rgba(0,0,0,.4) !important; }
html.dark .kanban-card .border-t    { border-color: #2e2e2e !important; }
html.dark .kanban-card .bg-slate-100  { background: #2a2a2a !important; }
html.dark .kanban-card .bg-blue-50    { background: rgba(30,58,138,.25) !important; }
html.dark .kanban-card .hover\:bg-slate-200:hover { background: #363636 !important; }
html.dark .kanban-card .hover\:bg-blue-100:hover  { background: rgba(30,58,138,.35) !important; }
html.dark .kanban-card .bg-blue-100   { background: rgba(30,58,138,.3) !important; }

/* Checklist config page */
html.dark .checklist-card         { background: #1f1f1f; border-color: #2e2e2e; }
html.dark .checklist-empty        { background: #1f1f1f; border-color: #2e2e2e; }
html.dark .checklist-card-header  { background: #181818; border-bottom-color: #2e2e2e; }
html.dark .checklist-items        { border-color: #2e2e2e; }
html.dark .checklist-item:hover   { background: #181818; }
html.dark .checklist-item         { border-bottom-color: #2e2e2e; }
html.dark .checklist-cat-name     { color: #e5e5e5; }
html.dark .checklist-cat-count    { color: #737373; }
html.dark .checklist-toggle-btn   { color: #737373; }
html.dark .checklist-toggle-btn:hover { color: #e5e5e5; background: #2a2a2a; }
html.dark .checklist-item-text    { color: #d4d4d4; }
html.dark .checklist-no-items     { color: #525252; }
html.dark .checklist-add-bar      { background: #181818; border-top-color: #2e2e2e; }
html.dark .checklist-new-input    { background: #1f1f1f; border-color: #3a3a3a; color: #e5e5e5; }
html.dark .checklist-new-input::placeholder { color: #525252; }
html.dark .checklist-new-input:focus { border-color: #3b82f6; }
html.dark .checklist-edit-input   { background: #1f1f1f; border-color: #3b82f6; color: #e5e5e5; }
html.dark .checklist-action-btn   { color: #525252; }
html.dark .checklist-action-btn:hover { background: #2a2a2a; }

/* Retornar button (estoque principal) */
html.dark .btn-retornar               { background: #2563eb !important; border: none !important; color: #ffffff !important; }
html.dark .btn-retornar:hover         { background: #1d4ed8 !important; }

/* Campos obrigatórios hint card (form equipamentos) */
html.dark .form-hint-card             { background: rgba(30,58,138,.2) !important; border-color: #1d4ed8 !important; }
html.dark .form-hint-card .text-blue-600 { color: #93c5fd !important; }
html.dark .form-hint-card .text-blue-500 { color: #7ab8f5 !important; }

/* Escolher imagem button (form equipamentos) */
html.dark .hover\:bg-blue-50\/50:hover  { background: rgba(30,58,138,.25) !important; }
html.dark .hover\:border-blue-400:hover { border-color: #3b82f6 !important; }
html.dark .hover\:text-blue-600:hover   { color: #93c5fd !important; }

/* Delete modal SVG animations */
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-x-line  { to { stroke-dashoffset: 0; } }

/* Delete confirmation modal */
html.dark .eq-delete-modal                        { background: #1a1a1a !important; border-color: #2e2e2e !important; }
html.dark .eq-delete-modal h3                     { color: #f1f5f9 !important; }
html.dark .eq-delete-modal p                      { color: #a3a3a3 !important; }
html.dark .eq-delete-modal .bg-slate-50           { background: #262626 !important; border-color: #3a3a3a !important; }
html.dark .eq-delete-modal .text-slate-800        { color: #e2e8f0 !important; }
html.dark .eq-delete-modal .text-slate-400        { color: #525252 !important; }
html.dark .eq-delete-modal .bg-red-50             { background: rgba(127,29,29,.35) !important; border-color: #7f1d1d !important; }
html.dark .eq-delete-modal .text-red-700          { color: #fca5a5 !important; }
html.dark .eq-delete-modal .text-red-500          { color: #f87171 !important; }
html.dark .eq-delete-modal .bg-white              { background: #262626 !important; border-color: #3a3a3a !important; }
html.dark .eq-delete-modal .hover\:bg-slate-50:hover { background: #2e2e2e !important; }
html.dark .eq-delete-modal .text-slate-700        { color: #d4d4d4 !important; }
html.dark .eq-delete-modal circle             { fill: #3b0a0a !important; stroke: #991b1b !important; }

/* Flash messages */
html.dark .bg-emerald-50  { background: rgba(6,78,59,.3) !important; }
html.dark .bg-red-50      { background: rgba(127,29,29,.3) !important; }
html.dark .bg-amber-50    { background: rgba(120,53,15,.3) !important; }
html.dark .bg-blue-50     { background: rgba(30,58,138,.3) !important; }

/* Forms: inputs, selects */
html.dark input:not([type=checkbox]):not([type=radio]),
html.dark select,
html.dark textarea {
  background: #1f1f1f;
  border-color: #2e2e2e;
  color: #f5f5f5;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #525252; }

/* Scrollbars */
html.dark ::-webkit-scrollbar-thumb        { background: #2e2e2e; }
html.dark ::-webkit-scrollbar-thumb:hover  { background: #404040; }
html.dark .kanban-board::-webkit-scrollbar-track { background: #161616; }
html.dark .kanban-board::-webkit-scrollbar-thumb { background: #2e2e2e; }
