/* ============================================
   THEME.CSS — Shared light theme overrides
   Applied via html[data-theme="light"]
   ============================================ */

/* ── LIGHT THEME VARIABLES ─────────────────── */
html[data-theme="light"] {
  --clr-bg:          #f0f4f8;
  --clr-surface:     #ffffff;
  --clr-surface-2:   #e8edf5;
  --clr-accent:      #1e40af;
  --clr-accent-lt:   #2563eb;
  --clr-accent-glow: rgba(30,64,175,0.15);
  --clr-gold:        #d97706;
  --clr-success:     #059669;
  --clr-warning:     #d97706;
  --clr-danger:      #dc2626;
  --clr-glass:       rgba(0,0,0,0.03);
  --clr-border:      rgba(0,0,0,0.10);
  --clr-text:        #1e293b;
  --clr-muted:       #64748b;
  --clr-muted-lt:    #475569;
}

/* ── HEADER (light) ─────────────────────────── */
html[data-theme="light"] .header {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 1px 12px rgba(0,0,0,0.07);
}

/* ── SIDEBAR (light) ────────────────────────── */
html[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(0,0,0,0.09);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .nav-item.active {
  background: rgba(30,64,175,0.08);
  color: #1e40af;
}
html[data-theme="light"] .nav-label {
  color: #94a3b8;
}

/* ── CARDS & SURFACES (light) ───────────────── */
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .search-card,
html[data-theme="light"] .insp-card,
html[data-theme="light"] .nc-group-card,
html[data-theme="light"] .nc-item {
  background: #ffffff;
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ── SCROLLBAR (light) ──────────────────────── */
html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}

/* ── INPUTS (light) ─────────────────────────── */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.15);
  color: #1e293b;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus {
  border-color: #2563eb;
}

/* ── TABLE (light) ──────────────────────────── */
html[data-theme="light"] table th {
  background: #f1f5f9;
  color: #475569;
}
html[data-theme="light"] table tr:hover td {
  background: #f8fafc;
}
html[data-theme="light"] table td {
  border-bottom-color: rgba(0,0,0,0.06);
}

/* ── NAV BADGE (light) ──────────────────────── */
html[data-theme="light"] .nav-badge {
  background: rgba(30,64,175,0.12);
  color: #1e40af;
}
html[data-theme="light"] .nav-badge.warn {
  background: rgba(220,38,38,0.10);
  color: #dc2626;
}

/* ── SECTION HEADER (light) ─────────────────── */
html[data-theme="light"] .section-header h1 {
  color: #0f172a;
}
html[data-theme="light"] .section-header p {
  color: #64748b;
}

/* ── USER CHIP (light) ──────────────────────── */
html[data-theme="light"] .user-chip {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.10);
}

/* ── THEME TOGGLE — Fixed floating button (bottom-right) ───── */
.btn-theme {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 400;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--clr-border, rgba(255,255,255,0.12));
  background: var(--clr-surface, #0e1629);
  color: var(--clr-muted-lt, #94a3b8);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-theme:hover {
  background: var(--clr-surface-2, #1a2540);
  color: var(--clr-text, #e2e8f0);
  transform: scale(1.08);
}
.btn-theme svg { width: 20px; height: 20px; }

html[data-theme="light"] .btn-theme {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
  color: #475569;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
html[data-theme="light"] .btn-theme:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ── LOGO IN HEADER ─────────────────────────── */
.header-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}
/* Show correct logo version */
.logo-dark  { display: block; }
.logo-light { display: none; }
html[data-theme="light"] .logo-dark  { display: none; }
html[data-theme="light"] .logo-light { display: block; }

/* ── LOGIN CARD (light) ─────────────────────── */
html[data-theme="light"] .login-card,
html[data-theme="light"] .card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
}
html[data-theme="light"] .card-header {
  background: transparent;
  border-bottom-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] body {
  background: var(--clr-bg);
}

/* ── TEXTO BRANCO FIXO → dark text no tema claro ───────────── */
/* Placa/TAG nas inspeções concluídas e NCs */
html[data-theme="light"] .nc-placa,
html[data-theme="light"] .insp-hist-placa,
html[data-theme="light"] .result-placa,
html[data-theme="light"] .stat-value,
html[data-theme="light"] .dim-box-highlight .dim-val {
  color: #0f172a !important;
}

/* NC cards (dashboard) */
html[data-theme="light"] .nc-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
html[data-theme="light"] .nc-card-header {
  background: rgba(220,38,38,0.04);
  border-bottom-color: rgba(0,0,0,0.07);
}
html[data-theme="light"] .nc-card.resolvida .nc-card-header {
  background: rgba(5,150,105,0.04);
}
html[data-theme="light"] .nc-resolve-obs {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.12);
  color: #1e293b;
}

/* Inspection history cards */
html[data-theme="light"] .insp-hist-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
html[data-theme="light"] .insp-hist-card:hover {
  border-color: rgba(30,64,175,0.25);
}

/* Andaime result card */
html[data-theme="light"] .result-card {
  background: #ffffff;
  border-color: rgba(30,64,175,0.18);
}
html[data-theme="light"] .result-hero {
  background: linear-gradient(135deg, rgba(30,64,175,0.07), rgba(30,64,175,0.02));
  border-bottom-color: rgba(30,64,175,0.10);
}
html[data-theme="light"] .meta-chip {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: #475569;
}
html[data-theme="light"] .meta-chip strong { color: #1e293b; }
html[data-theme="light"] .dim-box {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.10);
}
html[data-theme="light"] .dim-val { color: #1e40af; }

/* Stat cards */
html[data-theme="light"] .stat-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
html[data-theme="light"] .stat-label { color: #64748b; }

/* Search card inputs */
html[data-theme="light"] .placa-input-wrap input {
  background: #ffffff;
  border-color: rgba(0,0,0,0.15);
  color: #1e293b;
}
html[data-theme="light"] .btn-qr {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: #1e293b;
}
