/* ==========================================
   MODO ESCURO (Azul-marinho / Slate)
   ========================================== */
[data-theme="escuro"] {
  --bg: #050b16 !important;
  --card: #0f172a !important;
  --text: #f8fafc !important;
  --muted: #94a3b8 !important;
  --border: rgba(148, 163, 184, 0.22) !important;
  --primary-soft: rgba(124, 58, 237, 0.18) !important;
}

[data-theme="escuro"] body {
  background: radial-gradient(circle at top, #0d1b35 0%, #050b16 100%) !important;
  background-attachment: fixed !important;
  color: #f8fafc !important;
}

[data-theme="escuro"] .card,
[data-theme="escuro"] .cautela-card,
[data-theme="escuro"] .estoque-item-card,
[data-theme="escuro"] .login-card,
[data-theme="escuro"] .modal-content {
  background-color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #f8fafc !important;
}

[data-theme="escuro"] .box-add,
[data-theme="escuro"] .inv-container,
[data-theme="escuro"] .meta-box,
[data-theme="escuro"] .inv-item,
[data-theme="escuro"] .cart-item,
[data-theme="escuro"] .media-item,
[data-theme="escuro"] .kit-row,
[data-theme="escuro"] .box-cad-base {
  background-color: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #f8fafc !important;
}

/* ==========================================
   MODO MUITO ESCURO (Preto Absoluto / AMOLED)
   ========================================== */
[data-theme="muito-escuro"] {
  --bg: #000000 !important;
  --card: #0a0a0a !important;
  --text: #f4f4f5 !important;
  --muted: #71717a !important;
  --border: #27272a !important;
  --primary-soft: rgba(124, 58, 237, 0.15) !important;
}

[data-theme="muito-escuro"] body {
  background: #000000 !important;
  color: #f4f4f5 !important;
}

[data-theme="muito-escuro"] .card,
[data-theme="muito-escuro"] .cautela-card,
[data-theme="muito-escuro"] .estoque-item-card,
[data-theme="muito-escuro"] .login-card,
[data-theme="muito-escuro"] .modal-content {
  background-color: #0a0a0a !important;
  border-color: #27272a !important;
  color: #f4f4f5 !important;
}

[data-theme="muito-escuro"] .box-add,
[data-theme="muito-escuro"] .inv-container,
[data-theme="muito-escuro"] .meta-box,
[data-theme="muito-escuro"] .inv-item,
[data-theme="muito-escuro"] .cart-item,
[data-theme="muito-escuro"] .media-item,
[data-theme="muito-escuro"] .kit-row,
[data-theme="muito-escuro"] .box-cad-base {
  background-color: #121212 !important;
  border-color: #27272a !important;
  color: #f4f4f5 !important;
}

/* ==========================================
   REGRAS COMPARTILHADAS (ESCURO + AMOLED)
   ========================================== */
[data-theme="escuro"] .box-motivo-exclusao,
[data-theme="muito-escuro"] .box-motivo-exclusao {
  background-color: rgba(220, 38, 38, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #fca5a5 !important;
}

[data-theme="escuro"] .box-item-pendente,
[data-theme="muito-escuro"] .box-item-pendente {
  background-color: rgba(217, 119, 6, 0.15) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fde68a !important;
}

[data-theme="escuro"] .box-item-concluido,
[data-theme="muito-escuro"] .box-item-concluido {
  background-color: rgba(22, 163, 74, 0.15) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
  color: #bbf7d0 !important;
}

[data-theme="escuro"] .alerta-estoque-banner,
[data-theme="muito-escuro"] .alerta-estoque-banner {
  background-color: rgba(220, 38, 38, 0.16) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  color: #fca5a5 !important;
}

[data-theme="escuro"] .cart-card,
[data-theme="muito-escuro"] .cart-card {
  background-color: rgba(217, 119, 6, 0.14) !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

[data-theme="escuro"] .cart-motivo,
[data-theme="muito-escuro"] .cart-motivo {
  background-color: rgba(0, 0, 0, 0.5) !important;
  color: #fde68a !important;
}

[data-theme="escuro"] label,
[data-theme="escuro"] .item-info,
[data-theme="escuro"] .tecnico-name,
[data-theme="escuro"] .page-title,
[data-theme="escuro"] .card-title,
[data-theme="escuro"] .modal-title,
[data-theme="muito-escuro"] label,
[data-theme="muito-escuro"] .item-info,
[data-theme="muito-escuro"] .tecnico-name,
[data-theme="muito-escuro"] .page-title,
[data-theme="muito-escuro"] .card-title,
[data-theme="muito-escuro"] .modal-title {
  color: #f8fafc !important;
}

[data-theme="escuro"] input,
[data-theme="escuro"] select,
[data-theme="escuro"] textarea {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  color-scheme: dark;
}

[data-theme="muito-escuro"] input,
[data-theme="muito-escuro"] select,
[data-theme="muito-escuro"] textarea {
  background-color: #141414 !important;
  color: #f4f4f5 !important;
  border-color: #27272a !important;
  color-scheme: dark;
}

[data-theme="escuro"] input::placeholder,
[data-theme="escuro"] textarea::placeholder,
[data-theme="muito-escuro"] input::placeholder,
[data-theme="muito-escuro"] textarea::placeholder {
  color: #71717a !important;
}

[data-theme="escuro"] .tab-btn,
[data-theme="muito-escuro"] .tab-btn {
  color: #94a3b8 !important;
}

[data-theme="escuro"] .tab-btn.active,
[data-theme="muito-escuro"] .tab-btn.active {
  background-color: var(--card) !important;
  color: #60a5fa !important;
  border-bottom-color: #60a5fa !important;
}

[data-theme="escuro"] .btn-back,
[data-theme="escuro"] .btn-add-cat,
[data-theme="escuro"] .btn-cancel,
[data-theme="escuro"] .copy-btn,
[data-theme="escuro"] .chip-btn,
[data-theme="escuro"] .btn-tema-header,
[data-theme="muito-escuro"] .btn-back,
[data-theme="muito-escuro"] .btn-add-cat,
[data-theme="muito-escuro"] .btn-cancel,
[data-theme="muito-escuro"] .copy-btn,
[data-theme="muito-escuro"] .chip-btn,
[data-theme="muito-escuro"] .btn-tema-header {
  background-color: #18181b !important;
  color: #e4e4e7 !important;
  border-color: #27272a !important;
}

[data-theme="escuro"] .btn-add-photo,
[data-theme="muito-escuro"] .btn-add-photo {
  background-color: rgba(59, 130, 246, 0.12) !important;
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
}

[data-theme="escuro"] .cat-tag,
[data-theme="muito-escuro"] .cat-tag {
  background-color: #27272a !important;
  color: #e4e4e7 !important;
}

[data-theme="escuro"] #loadingSystem,
[data-theme="muito-escuro"] #loadingSystem {
  background: rgba(0, 0, 0, 0.94) !important;
}

[data-theme="escuro"] #signatureModal,
[data-theme="muito-escuro"] #signatureModal {
  background: #000000 !important;
}

/* Assinatura digital sempre legível */
[data-theme="escuro"] .canvas-wrapper,
[data-theme="muito-escuro"] .canvas-wrapper,
[data-theme="escuro"] .img-assinatura,
[data-theme="muito-escuro"] .img-assinatura {
  background: #ffffff !important;
  border-radius: 6px;
  padding: 4px;
}