:root {
  --cetem-red: #ed1c24;
  --cetem-red-bright: #ff2b36;
  --cetem-red-dark: #9d000b;
  --cetem-red-deep: #4b0005;
  --cetem-red-soft: #fff1f2;
  --cetem-black: #090909;
  --cetem-graphite: #17191d;
  --cetem-steel: #4b5563;
  --cetem-muted: #737780;
  --cetem-line: #d9dde3;
  --cetem-soft-line: #ebeef2;
  --cetem-surface: #ffffff;
  --cetem-surface-2: #f6f7f9;
  --cetem-shell: #eef0f3;
  --cetem-success: #16734a;
  --cetem-warning: #b05a00;
  --cetem-danger: #c40012;
  --motion-smooth: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(90deg, rgba(237, 28, 36, 0.045) 0 1px, transparent 1px 92px),
    linear-gradient(180deg, #fbfbfc 0%, var(--cetem-shell) 100%);
  color: var(--cetem-graphite);
  transition: background 0.28s var(--motion-smooth), color 0.28s var(--motion-smooth);
}

/* ============ Tema Escuro ============ */
[data-theme="dark"] body { background: #0f172a; color: #ffffff; font-weight: 700; }

/* Todas as fontes brancas no modo escuro */
[data-theme="dark"] *:not(svg):not(path):not(line):not(polyline):not(circle):not(rect):not(polygon) {
  color: #ffffff !important;
}

/* Exceções: elementos que precisam manter cor funcional */
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select { background: #0f172a; color: #ffffff !important; border-color: #475569; color-scheme: dark; }
[data-theme="dark"] input[readonly], [data-theme="dark"] input:disabled, [data-theme="dark"] select:disabled { background: #1e293b !important; color: #94a3b8 !important; }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #64748b !important; }

/* Fundos de cards e containers */
[data-theme="dark"] .card { background: #1e293b; border: 1px solid #334155; box-shadow: 0 10px 28px rgba(0,0,0,0.4); }
[data-theme="dark"] table { color: #ffffff; }
[data-theme="dark"] p, [data-theme="dark"] span, [data-theme="dark"] td, [data-theme="dark"] label,
[data-theme="dark"] small, [data-theme="dark"] a, [data-theme="dark"] li,
[data-theme="dark"] legend, [data-theme="dark"] div { font-weight: 700; }
[data-theme="dark"] th { background: #334155; color: #f1f5f9; }
[data-theme="dark"] td { border-bottom-color: #334155; }
[data-theme="dark"] .table-wrap { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .summary { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .summary span { color: #cbd5e1; }
[data-theme="dark"] .empty { background: #1e293b; color: #94a3b8; border-color: #475569; }
[data-theme="dark"] fieldset { border-color: #475569 !important; }
[data-theme="dark"] legend { color: #cbd5e1 !important; }
[data-theme="dark"] small { color: #94a3b8; }
[data-theme="dark"] p { color: #cbd5e1; }
[data-theme="dark"] .btn-secondary { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .btn-secondary:hover { background: #475569; }
[data-theme="dark"] .btn-success { background: #14532d; color: #bbf7d0; }
[data-theme="dark"] .btn-warning { background: #78350f; color: #fde68a; }
[data-theme="dark"] .btn-danger { background: #7f1d1d; color: #fecaca; }
[data-theme="dark"] .alert { background: #3b1a1a; color: #fecaca; border-color: #7f1d1d; }
[data-theme="dark"] .alert.ok { background: #0f3a1f; color: #bbf7d0; border-color: #14532d; }
[data-theme="dark"] .status.em-andamento, [data-theme="dark"] .status.andamento { background: #78350f; color: #fde68a; border-color: #b45309; }
[data-theme="dark"] .status.concluido { background: #14532d; color: #bbf7d0; border-color: #15803d; }
[data-theme="dark"] .status.atrasado { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
[data-theme="dark"] .tap-status-aguardando { background: #334155; color: #cbd5e1; border-color: #475569; }
[data-theme="dark"] .tap-status-fechado { background: #14532d; color: #bbf7d0; border-color: #15803d; }
[data-theme="dark"] .tap-status-perdido { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
[data-theme="dark"] .tap-status-concluido { background: #24262b; color: #f8fafc; border-color: #4b5563; }
[data-theme="dark"] .tap-table tfoot td { background: #334155; }
[data-theme="dark"] #calcPanel { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] #calcDisplay { background: #0f172a; color: #e2e8f0; border-color: #475569; }
[data-theme="dark"] .calc-btn { background: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .calc-btn:hover { background: #334155; }
[data-theme="dark"] .calc-op { background: #4b0005; color: #ffe4e6; }
[data-theme="dark"] .calc-close { color: #94a3b8; }
[data-theme="dark"] .gantt-view-switch { border-color: #475569; }
[data-theme="dark"] .gantt-view-switch button { background: #1e293b; color: #cbd5e1; border-right-color: #475569; }
[data-theme="dark"] .gantt-view-switch button:hover { background: #334155; }

/* Botão flutuante de tema */
#themeFab {
  position: fixed; right: 20px; bottom: 88px; z-index: 2000;
  width: 44px; height: 44px; border-radius: 50%;
  background: #475569; color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,23,42,0.25);
  display: flex; align-items: center; justify-content: center;
}
#themeFab svg { width: 20px; height: 20px; }
#themeFab:hover { background: #64748b; }
[data-theme="dark"] #themeFab { background: #f59e0b; color: #0f172a; }
[data-theme="dark"] #themeFab:hover { background: #fbbf24; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.banner { position: relative; background: linear-gradient(135deg, #ed1c24 0%, #090909 100%); color: #fff; border-radius: 20px; padding: 24px; margin-bottom: 20px; }
.banner::after { content: "Developed by CETEM Tecnologia"; position: absolute; top: 10px; right: 16px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; color: rgba(255,255,255,0.85); pointer-events: none; }
@media print { .banner::after { display: none; } }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 24px; }
.card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08); width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
label { display: block; font-size: 13px; font-weight: bold; margin-bottom: 6px; text-transform: uppercase; color: #334155; }
input, textarea, select { width: 100%; border: 1px solid #d1d5db; border-radius: 12px; padding: 12px; font-size: 14px; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
button, .btn { border: none; border-radius: 12px; padding: 12px 18px; font-size: 14px; font-weight: bold; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon { flex-direction: column; gap: 2px; padding: 8px 10px; min-width: 64px; }
.btn-icon svg { width: 22px; height: 22px; display: block; }
.btn-icon .btn-label { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.icon-nav { gap: 8px; }
.btn-icon-inline { display: inline-flex; align-items: center; gap: 4px; }
.btn-icon-inline svg { width: 14px; height: 14px; display: inline-block; }
.btn-primary { background: #ed1c24; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #111827; }
.btn-success { background: #dcfce7; color: #166534; }
.btn-warning { background: #fef3c7; color: #92400e; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.summary { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.alert { padding: 12px; border-radius: 12px; margin-bottom: 16px; border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; }
.alert.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.table-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; max-width: 100%; width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 1280px; }
th, td { padding: 12px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; font-size: 14px; }
.rda-table { min-width: 0; table-layout: fixed; }
.rda-table th, .rda-table td { padding: 8px 6px; font-size: 12px; word-wrap: break-word; overflow-wrap: anywhere; }
.rda-table th { text-align: center; vertical-align: middle; line-height: 1.25; }
.tap-list-table { min-width: 1620px; table-layout: fixed; width: 100%; }
.tap-list-table th, .tap-list-table td { padding: 9px 8px; font-size: 12px; word-wrap: break-word; overflow-wrap: anywhere; vertical-align: middle; }
.tap-list-table th { text-align: center; line-height: 1.25; }
.tap-list-table td { text-align: center; }
.tap-list-table .status { padding: 3px 6px; font-size: 10px; }
.tap-list-table .tap-actions-heading,
.tap-list-table .tap-actions-cell { min-width: 230px; width: 230px; white-space: normal; overflow: visible; }
.tap-row-actions { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; width: 100%; min-width: 200px; }
.tap-row-actions form { margin: 0; width: auto; }
.tap-row-actions .btn { min-width: 92px; justify-content: center; gap: 4px; white-space: nowrap; padding: 7px 10px !important; line-height: 1.1; }
.tap-row-actions .btn svg { flex: 0 0 auto; }
.users-table { min-width: 0; table-layout: fixed; width: 100%; }
.users-table th, .users-table td { padding: 8px 6px; font-size: 12px; word-wrap: break-word; overflow-wrap: anywhere; vertical-align: middle; }
.users-table th { text-align: center; line-height: 1.25; }
.users-table td { text-align: center; }
.users-table td.break-all { text-align: left; word-break: break-all; }
.users-table input, .users-table select { padding: 6px 8px; font-size: 12px; border-radius: 8px; min-width: 0; }
.users-table .actions-inline { display: flex; gap: 4px; flex-wrap: nowrap; align-items: stretch; }
.users-table .actions-inline input, .users-table .actions-inline select { flex: 1 1 auto; width: auto; min-width: 0; }
.users-table .btn-sm { flex: 0 0 auto; }
.perf-table { min-width: 0; table-layout: fixed; width: 100%; }
.perf-table th, .perf-table td { padding: 8px 6px; font-size: 12px; text-align: center; vertical-align: middle; word-wrap: break-word; }
.perf-table th { line-height: 1.25; }
.prod-table { min-width: 0; table-layout: fixed; width: 100%; }
.prod-table th, .prod-table td { padding: 8px 6px; font-size: 12px; text-align: center; vertical-align: middle; word-wrap: break-word; }
.prod-table th { line-height: 1.25; background: #f8fafc; }

/* Gantt (Frappe) */
.gantt-wrap { overflow-x: auto; max-width: 100%; }
.gantt .bar-concluido .bar { fill: #d9dde3; }
.gantt .bar-concluido .bar-progress { fill: #4b5563; }
.gantt .bar-concluido-atrasado .bar { fill: #ffd6da; }
.gantt .bar-concluido-atrasado .bar-progress { fill: #ed1c24; }
.gantt .bar-atrasado .bar { fill: #ffd6da; }
.gantt .bar-atrasado .bar-progress { fill: #ed1c24; }
.gantt .bar-andamento .bar { fill: #ffe4e6; }
.gantt .bar-andamento .bar-progress { fill: #9d000b; }
.gantt-view-switch { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.gantt-view-switch button { background: #fff; border: none; padding: 6px 12px; font-size: 12px; cursor: pointer; color: #334155; border-right: 1px solid #cbd5e1; font-weight: 600; }
.gantt-view-switch button:last-child { border-right: none; }
.gantt-view-switch button:hover { background: #f1f5f9; }
.gantt-view-switch button.active { background: #ed1c24; color: #fff; }
.gantt-legend { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
.gantt-chip { display: inline-block; width: 20px; height: 10px; border-radius: 3px; }
.gantt-chip.gantt-andamento { background: #9d000b; }
.gantt-chip.gantt-concluido { background: #4b5563; }
.gantt-chip.gantt-concluido_atrasado { background: #ed1c24; }
.gantt-chip.gantt-atrasado { background: #ed1c24; }
.rda-table td:nth-child(2),
.rda-table td:nth-child(3),
.rda-table td:nth-child(4),
.rda-table td:nth-child(5),
.rda-table td:nth-child(6),
.rda-table td:nth-child(7),
.rda-table td:nth-child(8),
.rda-table td:nth-child(9),
.rda-table td:nth-child(10),
.rda-table td:nth-child(11) { text-align: center; }
.rda-table .status { padding: 4px 8px; font-size: 10px; }
.actions-compact { display: flex; flex-direction: column; gap: 4px; }
.actions-compact .btn { padding: 4px 8px; font-size: 11px; border-radius: 8px; }
.btn-sm { padding: 4px 8px !important; font-size: 11px !important; border-radius: 8px !important; }
th { background: #f8fafc; }
.multiline { white-space: pre-wrap; }
.empty { text-align: center; padding: 32px; color: #6b7280; border: 1px dashed #cbd5e1; border-radius: 16px; background: #f8fafc; }
.status { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: bold; text-transform: uppercase; }
.em-andamento, .andamento { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.concluido { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.atrasado { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

.status-card { border-radius: 16px; padding: 18px; color: #fff; display: flex; flex-direction: column; gap: 6px; }
.status-card .label { text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; opacity: 0.95; }
.status-card .count { font-size: 36px; font-weight: 700; line-height: 1; }
.status-card .hint { font-size: 12px; opacity: 0.9; }
.status-card.verde { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); }
.status-card.amarelo { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.status-card.vermelho { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); }

.status-radios { display: flex; gap: 10px; flex-wrap: wrap; }
.status-radio { display: inline-flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; text-transform: none; }
.status-radio input { width: auto; }

.tap-status-aguardando { background: #e5e7eb; color: #374151; border: 1px solid #d1d5db; }
.tap-status-fechado { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.tap-status-perdido { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.tap-status-concluido { background: #f2f4f5; color: #17191d; border: 1px solid #c7ccd2; }

.tap-table { min-width: 0; table-layout: fixed; width: 100%; }
.tap-table th, .tap-table td { vertical-align: middle; padding: 8px 6px; font-size: 13px; text-align: center; }
.tap-table th { line-height: 1.25; }
.tap-table td:nth-child(2) { text-align: left; }
.tap-table input[type="number"],
.tap-table input[type="text"] { padding: 6px 6px; width: 100%; min-width: 0; text-align: center; font-size: 13px; }
.tap-table input[type="date"] { padding: 6px 6px; width: 100%; min-width: 0; font-size: 12px; }
.tap-table col.c-id { width: 32px; }
.tap-table col.c-entregavel { width: auto; }
.tap-table col.c-qtd { width: 55px; }
.tap-table col.c-tempo { width: 55px; }
.tap-table col.c-valor { width: 125px; }
.tap-table col.c-pct { width: 55px; }
.tap-table col.c-corrig { width: 125px; }
.tap-table td.valor-total,
.tap-table td.valor-corrigido { white-space: nowrap; }
.tap-table tfoot td { background: #f8fafc; }
.tap-table tfoot .total-sem,
.tap-table tfoot .total-com { font-size: 15px; font-weight: 700; white-space: nowrap; }
.tap-table .table-wrap, .tap-table-wrap { overflow-x: visible; }
.inp-no-spin::-webkit-outer-spin-button,
.inp-no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inp-no-spin { -moz-appearance: textfield; appearance: textfield; }
.btn-calc-fim { flex: 0 0 24px; width: 24px; height: 28px; padding: 0; border: 1px solid #ed1c24; background: #fff1f2; color: #9d000b; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 700; line-height: 1; }
.btn-calc-fim:hover { background: #ffd6da; }
[data-theme="dark"] .btn-calc-fim { background: #4b0005; color: #ffe4e6; border-color: #9d000b; }
[data-theme="dark"] .btn-calc-fim:hover { background: #9d000b; }
.login-box { max-width: 520px; margin: 60px auto; }
@media (max-width: 960px) {
  .layout, .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .container { padding: 16px; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; color: #000; }
  .container { max-width: none; padding: 0; }
  .banner, .actions, .btn, button, #calcFab, #calcPanel, .icon-nav { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; padding: 8px; border-radius: 0; page-break-inside: auto; }
  .tap-table { font-size: 9px !important; page-break-inside: auto; }
  .tap-table th, .tap-table td { padding: 3px 4px !important; font-size: 9px !important; }
  .tap-table thead { display: table-header-group; }
  .tap-table tr { page-break-inside: avoid; }
  .tap-table input,
  .tap-table select { border: none !important; background: transparent !important; padding: 0 !important; text-align: center !important; font-size: 9px !important; color: #000 !important; }
  .tap-table input[type="date"] { font-size: 8px !important; }
  .tap-table input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
  .tap-table col.c-id { width: 22px; }
  .tap-table col.c-entregavel { width: auto; }
  .tap-table col.c-qtd,
  .tap-table col.c-tempo,
  .tap-table col.c-pct { width: 38px; }
  .tap-table col.c-valor,
  .tap-table col.c-corrig { width: 80px; }
  .tap-table tfoot .total-sem,
  .tap-table tfoot .total-com { font-size: 10px !important; }
  h1, h2, h3 { page-break-after: avoid; color: #000; }
  a { color: #000; text-decoration: none; }
  p { page-break-inside: avoid; }
}

/* ==========================================================================
   Dark mode — overrides para caixas/blocos com background claro inline.
   Mantém contraste legível sem precisar editar templates individualmente.
   ========================================================================== */
[data-theme="dark"] [style*="background:#f8fbff"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background:#f0f9ff"],
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background:#eef3ff"],
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background:#fee2e2"],
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background:#f0fdf4"][style*="border-left:4px solid #16a34a"] { background: #14532d !important; color: #bbf7d0 !important; }
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background:#f1f5f9"] {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

/* Barras de progresso cinza-claro viram cinza-escuro */
[data-theme="dark"] [style*="background:#e5e7eb"] {
  background: #334155 !important;
}

/* Inputs readonly que usam #f1f5f9 inline */
[data-theme="dark"] input[readonly][style*="background:#f1f5f9"] {
  background: #0f172a !important;
  color: #94a3b8 !important;
}

/* Cabeçalhos coloridos de card (ok/alerta/risco) em dark */
[data-theme="dark"] [style*="#fee2e2"] strong,
[data-theme="dark"] [style*="#fef3c7"] strong,
[data-theme="dark"] [style*="#dcfce7"] strong { color: #f1f5f9 !important; }

/* Linhas zebradas claras em tabelas */
[data-theme="dark"] tr[style*="background:#eff6ff"],
[data-theme="dark"] tr[style*="background:#f8fafc"] {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

/* Badge "Developed by" no banner — mantém legibilidade */
[data-theme="dark"] .banner::after { color: rgba(255,255,255,0.75); }

/* Formulário "card" de filtros claro dentro do dashboard */
[data-theme="dark"] form.card { background: #1e293b !important; }

/* Textos escuros fixos em blocos que agora são escuros */
[data-theme="dark"] [style*="color:#b45309"],
[data-theme="dark"] [style*="color:#92400e"],
[data-theme="dark"] [style*="color:#b91c1c"] { color: #fde68a !important; }

/* Status da Proposta (radios) em dark mode */
[data-theme="dark"] .status-radio {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}
[data-theme="dark"] .status-radio:hover { background: #1e293b; border-color: #64748b; }
[data-theme="dark"] .status-radio span { color: #e2e8f0; }
[data-theme="dark"] .status-radio input[type="radio"]:checked ~ span,
[data-theme="dark"] .status-radio:has(input[type="radio"]:checked) {
  background: #4b0005;
  border-color: #ed1c24;
  color: #ffe4e6;
}
[data-theme="dark"] .status-radio:has(input[type="radio"]:checked) span { color: #ffe4e6; }

/* Nota explicativa abaixo dos radios */
[data-theme="dark"] .status-radios + p,
[data-theme="dark"] p[style*="color:#6b7a99"] { color: #cbd5e1 !important; }
[data-theme="dark"] .status-radios + p strong,
[data-theme="dark"] p[style*="color:#6b7a99"] strong { color: #f1f5f9 !important; }

/* Gantt — legenda em dark */
[data-theme="dark"] .gantt-legenda-wrap { color: #e2e8f0; }
[data-theme="dark"] .gantt-legenda-wrap strong { color: #f1f5f9; }
[data-theme="dark"] .gantt-legend { color: #cbd5e1; }

/* PDI — tabela de Colaboradores em dark */
[data-theme="dark"] .prod-table th { background: #334155 !important; color: #f1f5f9 !important; border-bottom-color: #475569; }
[data-theme="dark"] .prod-table td { color: #e2e8f0; border-bottom-color: #334155; }
/* Linha "Média da equipe" — azul claro legível sobre fundo escuro */
[data-theme="dark"] .prod-table tr[style*="background:#eff6ff"] { background: #1e293b !important; }
[data-theme="dark"] .prod-table tr[style*="background:#eff6ff"] td,
[data-theme="dark"] .prod-table tr[style*="background:#eff6ff"] td[style*="color:#1e40af"],
[data-theme="dark"] .prod-table tr[style*="background:#eff6ff"] strong[style*="color:#1e40af"] {
  color: #ffb2b8 !important;
}
[data-theme="dark"] .prod-table tr[style*="background:#eff6ff"] td[style*="color:#64748b"] { color: #94a3b8 !important; }

/* Legenda explicativa abaixo da tabela (dots azul escuro) */
[data-theme="dark"] .prod-table + *,
[data-theme="dark"] [style*="color:#1e40af"] { color: #ffb2b8 !important; }

/* ==========================================================================
   Responsividade Mobile (Fase 1)
   - Tablets: <= 960px
   - Celulares: <= 640px
   ========================================================================== */
@media (max-width: 960px) {
  .container { padding: 14px; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .banner { padding: 16px; border-radius: 14px; }
  .banner h1 { font-size: 20px; }
  .banner p { font-size: 12px; }
  .icon-nav { gap: 6px !important; flex-wrap: wrap; }
  .btn-icon .btn-label { display: none; }
  .btn-icon { padding: 8px 10px !important; min-width: 44px; min-height: 44px; }
  .topbar { align-items: flex-start; }
}

@media (max-width: 640px) {
  .container { padding: 10px; }
  .card { padding: 14px; border-radius: 12px; margin-bottom: 14px; }
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 10px; }
  .banner { padding: 14px; margin-bottom: 14px; }
  .banner h1 { font-size: 18px; }
  .banner::after { font-size: 9px !important; top: 6px !important; right: 8px !important; }
  .topbar { flex-direction: column; gap: 10px; }

  /* Navegação em barra rolável horizontal no celular */
  .icon-nav {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .icon-nav .btn-icon { flex: 0 0 auto; }

  /* Inputs mais altos para toque confortável */
  input, select, textarea, button {
    font-size: 15px !important;
    min-height: 42px;
  }
  input[type="date"], input[type="time"] { min-height: 42px; }
  textarea { min-height: 80px; }

  /* Botões de ação ocupam largura total */
  .actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .actions .btn, .actions button { width: 100%; justify-content: center; }
  .actions-compact { flex-direction: row; }
  .actions-compact .btn { width: auto; }

  /* Tabelas com scroll horizontal suave */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  .table-wrap table { min-width: 640px; }
  .rda-table, .tap-table, .perf-table, .prod-table { font-size: 11px; }
  .rda-table th, .rda-table td,
  .tap-table th, .tap-table td,
  .perf-table th, .perf-table td,
  .prod-table th, .prod-table td { padding: 6px 4px; }

  /* Summaries uma embaixo da outra */
  .summary { padding: 10px 12px; }
  .summary strong { font-size: 22px !important; }

  /* Status cards do dashboard */
  .status-card { padding: 12px; }
  .status-card .count { font-size: 28px; }

  /* FAB calc e tema: menores e mais próximos do canto */
  #calcFab, #themeFab { width: 48px; height: 48px; right: 12px; }
  #calcFab { bottom: 12px; }
  #calcPanel { right: 8px; left: 8px; width: auto; bottom: 72px; }

  /* Formulários em coluna única */
  fieldset { padding: 10px !important; }
  legend { font-size: 13px; }
  label { font-size: 12px; }

  /* Status badges menores */
  .status { font-size: 10px; padding: 2px 8px; }

  h1 { font-size: 18px; }
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }
}


.proposal-upload-form input[type="file"] { max-width: 520px; background: #fff; }
.proposal-upload-form .actions { align-items: center; }

/* ==========================================================================
   Identidade CETEM Tecnologia + motion system
   ========================================================================== */
::selection { background: rgba(237, 28, 36, 0.22); color: var(--cetem-black); }

body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 5px;
  height: 100vh;
  background: linear-gradient(180deg, var(--cetem-red), var(--cetem-red-dark), var(--cetem-black));
  box-shadow: 0 0 26px rgba(237, 28, 36, 0.35);
  pointer-events: none;
  z-index: 3000;
}

[data-theme="dark"] body {
  background:
    linear-gradient(90deg, rgba(237, 28, 36, 0.08) 0 1px, transparent 1px 96px),
    linear-gradient(180deg, #080808 0%, #14161a 100%) !important;
  color: #f7f7f8;
}

.cetem-shell-brand {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin: 0 0 12px;
  color: var(--cetem-graphite);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cetem-shell-brand img {
  width: 116px;
  height: auto;
  display: block;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(9, 9, 9, 0.08);
  box-shadow: 0 12px 28px rgba(9, 9, 9, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.cetem-shell-brand span {
  padding: 8px 10px;
  border-left: 2px solid var(--cetem-red);
}

#sidebar {
  background:
    linear-gradient(180deg, rgba(237, 28, 36, 0.22), transparent 24%),
    linear-gradient(180deg, #151515 0%, #070707 100%) !important;
  box-shadow: 4px 0 28px rgba(9, 9, 9, 0.34), inset -1px 0 0 rgba(237, 28, 36, 0.24) !important;
}

#sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--cetem-red), transparent);
  animation: cetem-sidebar-scan 5.4s var(--motion-smooth) infinite;
  opacity: 0.76;
}

#sidebar .sb-logo {
  position: relative;
  min-height: 68px !important;
  padding: 12px 9px !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

#sidebar .sb-logo .sb-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 5px;
  border-radius: 12px;
  background: #fff;
  opacity: 1 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(237, 28, 36, 0.18);
  transition: transform 0.28s var(--motion-smooth), box-shadow 0.28s var(--motion-smooth);
}

#sidebar:hover .sb-logo .sb-logo-mark {
  transform: translateX(2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(237, 28, 36, 0.28);
}

#sidebar .sb-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#sidebar .sb-logo > span:not(.sb-logo-mark) {
  color: #fff !important;
  letter-spacing: 0.02em;
}

#sidebar .sb-item {
  position: relative;
  z-index: 0;
  border-left: 2px solid transparent !important;
  transition: background 0.24s var(--motion-smooth), color 0.24s var(--motion-smooth), border-color 0.24s var(--motion-smooth), transform 0.24s var(--motion-smooth) !important;
}

#sidebar .sb-item::before {
  content: "";
  position: absolute;
  inset: 7px 8px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(237, 28, 36, 0.18), rgba(255, 255, 255, 0.06));
  opacity: 0;
  transform: translateX(-10px) scaleX(0.92);
  transition: opacity 0.24s var(--motion-smooth), transform 0.24s var(--motion-smooth);
  z-index: -1;
}

#sidebar .sb-item:hover {
  background: transparent !important;
  border-left-color: var(--cetem-red) !important;
  color: #fff !important;
  transform: translateX(2px);
}

#sidebar .sb-item:hover::before {
  opacity: 1;
  transform: translateX(0) scaleX(1);
}

#sidebar .sb-rda,
#sidebar .sb-tap,
#sidebar .sb-perf,
#sidebar .sb-gantt,
#sidebar .sb-pred,
#sidebar .sb-pdi,
#sidebar .sb-perfil,
#sidebar .sb-admin,
#sidebar .sb-theme { color: rgba(255, 255, 255, 0.78) !important; }
#sidebar .sb-danger,
#sidebar .sb-logout { color: #ffb2b8 !important; }

.container {
  animation: cetem-page-in 0.58s var(--motion-smooth) both;
}

.banner {
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(120deg, rgba(237, 28, 36, 0.92) 0%, rgba(157, 0, 11, 0.96) 28%, rgba(9, 9, 9, 0.98) 78%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px !important;
  box-shadow: 0 24px 56px rgba(9, 9, 9, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.16) 42%, transparent 58%),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.035) 23px 24px);
  transform: translateX(-120%);
  animation: cetem-banner-sheen 7.5s var(--motion-smooth) infinite;
  pointer-events: none;
  z-index: -1;
}

.banner::after {
  content: "";
  top: auto !important;
  right: 0 !important;
  bottom: 0;
  width: 42%;
  height: 3px;
  border-radius: 999px 0 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), var(--cetem-red-bright));
  box-shadow: 0 0 22px rgba(237, 28, 36, 0.44);
}

.banner h1,
.banner h2,
.banner p,
.banner strong { color: #fff !important; }

.card,
.table-wrap,
.summary,
.empty,
.status-radio {
  border-color: rgba(9, 9, 9, 0.08) !important;
}

.card {
  position: relative;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(9, 9, 9, 0.08);
  border-radius: 16px !important;
  box-shadow: 0 16px 42px rgba(9, 9, 9, 0.09), 0 1px 0 rgba(255, 255, 255, 0.9) inset !important;
  transition: transform 0.32s var(--motion-smooth), box-shadow 0.32s var(--motion-smooth), border-color 0.32s var(--motion-smooth);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cetem-red), var(--cetem-black), transparent);
  opacity: 0.36;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(237, 28, 36, 0.24) !important;
  box-shadow: 0 22px 54px rgba(9, 9, 9, 0.13), 0 0 0 1px rgba(237, 28, 36, 0.07) inset !important;
}

.summary {
  background: linear-gradient(180deg, #fff, #f7f7f8) !important;
  border: 1px solid rgba(9, 9, 9, 0.08) !important;
  box-shadow: inset 4px 0 0 rgba(237, 28, 36, 0.72);
  transition: transform 0.28s var(--motion-smooth), box-shadow 0.28s var(--motion-smooth);
}

.summary:hover {
  transform: translateY(-2px);
  box-shadow: inset 4px 0 0 var(--cetem-red), 0 12px 28px rgba(9, 9, 9, 0.08);
}

label,
[style*="color:#334155"],
[style*="color:#1f2937"],
[style*="color:#475569"],
[style*="color:#52627a"],
[style*="color:#6b7a99"],
[style*="color:#64748b"] {
  color: var(--cetem-steel) !important;
}

[style*="color:#0f4c81"],
[style*="color:#1e40af"],
[style*="color:#3e63dd"],
[style*="color:#0369a1"] {
  color: var(--cetem-red) !important;
}

[style*="color:#16a34a"] {
  color: var(--cetem-graphite) !important;
}

[style*="color:#d97706"],
[style*="color:#f59e0b"],
[style*="color:#92400e"],
[style*="color:#78350f"] {
  color: var(--cetem-red) !important;
}

[style*="background:#0f4c81"],
[style*="background:#1f6fb2"],
[style*="background:#3e63dd"],
[style*="background:#06b6d4"],
[style*="background-color: #0f4c81"],
[style*="background:#d97706"],
[style*="background:#f59e0b"] {
  background: var(--cetem-red) !important;
}

[style*="background:#f8fbff"],
[style*="background:#f0f9ff"],
[style*="background:#eff6ff"],
[style*="background:#eef3ff"],
[style*="background:#e0f2fe"],
[style*="background:#dbeafe"],
[style*="background:#bae6fd"],
[style*="background:#fffbeb"],
[style*="background:#fef3c7"] {
  background: linear-gradient(180deg, #fff7f8, #f5f5f6) !important;
}

[style*="background:#dcfce7"],
[style*="background:#f0fdf4"],
[style*="background:#16a34a"] {
  background: linear-gradient(180deg, #ffffff, #eef0f3) !important;
}

[style*="border-left:4px solid #0f4c81"],
[style*="border-left:4px solid #3e63dd"],
[style*="border-left:4px solid #d97706"] {
  border-left-color: var(--cetem-red) !important;
}

[style*="border-left:4px solid #16a34a"] {
  border-left-color: var(--cetem-steel) !important;
}

[style*="border:1px solid #d9e1f2"] { border-color: rgba(237, 28, 36, 0.24) !important; }
[style*="color:#1f2d5a"] { color: var(--cetem-red-dark) !important; }

input,
textarea,
select {
  border-color: var(--cetem-line) !important;
  border-radius: 10px !important;
  transition: border-color 0.22s var(--motion-smooth), box-shadow 0.22s var(--motion-smooth), background 0.22s var(--motion-smooth);
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(237, 28, 36, 0.36) !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cetem-red) !important;
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.13);
}

button,
.btn {
  position: relative;
  overflow: hidden;
  border-radius: 10px !important;
  transition: transform 0.22s var(--motion-smooth), box-shadow 0.22s var(--motion-smooth), background 0.22s var(--motion-smooth), color 0.22s var(--motion-smooth);
}

button::after,
.btn::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -60%;
  width: 42%;
  height: 340%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transform: rotate(24deg);
  transition: left 0.48s var(--motion-smooth);
  pointer-events: none;
}

button:hover::after,
.btn:hover::after { left: 118%; }

button:hover,
.btn:hover {
  transform: translateY(-2px);
}

.btn-primary,
#calcFab,
.calc-eq,
.gantt-view-switch button.active,
.btn-calc-fim {
  background: linear-gradient(180deg, var(--cetem-red), var(--cetem-red-dark)) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(157, 0, 11, 0.22);
}

.btn-primary:hover,
#calcFab:hover,
.calc-eq:hover,
.gantt-view-switch button.active:hover,
.btn-calc-fim:hover {
  background: linear-gradient(180deg, var(--cetem-red-bright), var(--cetem-red-dark)) !important;
}

.btn-secondary,
.calc-btn,
.gantt-view-switch button {
  background: linear-gradient(180deg, #ffffff, #eceef1) !important;
  color: var(--cetem-graphite) !important;
  border: 1px solid rgba(9, 9, 9, 0.08) !important;
}

.btn-secondary:hover,
.calc-btn:hover,
.gantt-view-switch button:hover {
  background: linear-gradient(180deg, #fff, #f8e9ea) !important;
  color: var(--cetem-red-dark) !important;
}

.btn-success {
  background: linear-gradient(180deg, #ffffff, #eef0f3) !important;
  color: var(--cetem-graphite) !important;
  border: 1px solid rgba(22, 115, 74, 0.22) !important;
}

.btn-warning {
  background: linear-gradient(180deg, #fff7ed, #f3e6d6) !important;
  color: #7c3a00 !important;
}

.btn-danger {
  background: linear-gradient(180deg, #fff1f2, #ffd6da) !important;
  color: var(--cetem-danger) !important;
}

.table-wrap {
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 12px 34px rgba(9, 9, 9, 0.08);
}

th,
.prod-table th,
.tap-table tfoot td {
  background: linear-gradient(180deg, #f4f5f6, #e9ecef) !important;
  color: var(--cetem-graphite) !important;
}

tbody tr {
  transition: transform 0.2s var(--motion-smooth), background 0.2s var(--motion-smooth), box-shadow 0.2s var(--motion-smooth);
}

tbody tr:hover {
  background: rgba(237, 28, 36, 0.035);
}

.status {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.em-andamento,
.andamento {
  background: #fff2df !important;
  color: #9a4a00 !important;
  border-color: #f5b46b !important;
}

.concluido,
.tap-status-fechado,
.tap-status-concluido {
  background: #f2f4f5 !important;
  color: var(--cetem-graphite) !important;
  border-color: #c7ccd2 !important;
}

.atrasado,
.tap-status-perdido {
  background: #fff1f2 !important;
  color: var(--cetem-danger) !important;
  border-color: #ff9aa3 !important;
}

.tap-status-aguardando {
  background: #f4f5f6 !important;
  color: var(--cetem-steel) !important;
  border-color: #d2d6dc !important;
}

.status-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px !important;
  box-shadow: 0 18px 40px rgba(9, 9, 9, 0.18);
}

.status-card::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: rotate(19deg);
  animation: cetem-card-sheen 5.2s var(--motion-smooth) infinite;
}

.status-card.verde { background: linear-gradient(135deg, #121212 0%, #4a4f57 100%) !important; }
.status-card.amarelo { background: linear-gradient(135deg, #6b0007 0%, var(--cetem-red) 100%) !important; }
.status-card.vermelho { background: linear-gradient(135deg, #2b0003 0%, #b0000d 54%, var(--cetem-red) 100%) !important; }

.empty {
  background: linear-gradient(180deg, #fff, #f5f5f6) !important;
  border-color: rgba(237, 28, 36, 0.22) !important;
  color: var(--cetem-muted) !important;
}

#themeFab {
  background: linear-gradient(180deg, #1f2126, #090909) !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(9, 9, 9, 0.22) !important;
}

#themeFab:hover { background: linear-gradient(180deg, #30333a, #111) !important; }

#calcPanel {
  border-color: rgba(237, 28, 36, 0.18) !important;
  box-shadow: 0 20px 48px rgba(9, 9, 9, 0.2) !important;
  animation: cetem-pop 0.24s var(--motion-smooth);
}

.calc-op {
  background: #fff1f2 !important;
  color: var(--cetem-red-dark) !important;
}

.motion-reveal { transition: opacity 0.56s var(--motion-smooth), transform 0.56s var(--motion-smooth), filter 0.56s var(--motion-smooth); }
body.is-motion-ready .motion-reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: saturate(0.8);
}
body.is-motion-ready .motion-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: saturate(1);
}

body.is-motion-ready .motion-reveal:nth-of-type(2) { transition-delay: 0.05s; }
body.is-motion-ready .motion-reveal:nth-of-type(3) { transition-delay: 0.1s; }
body.is-motion-ready .motion-reveal:nth-of-type(4) { transition-delay: 0.15s; }

[data-theme="dark"] .cetem-shell-brand {
  color: #f8fafc !important;
}

[data-theme="dark"] .cetem-shell-brand img,
[data-theme="dark"] .banner::after {
  background-color: rgba(255, 255, 255, 0.96) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] #calcPanel {
  background: rgba(24, 25, 28, 0.94) !important;
  border-color: rgba(237, 28, 36, 0.2) !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .summary,
[data-theme="dark"] .empty,
[data-theme="dark"] .status-radio,
[data-theme="dark"] th,
[data-theme="dark"] .prod-table th,
[data-theme="dark"] .tap-table tfoot td {
  background: linear-gradient(180deg, #202226, #15171a) !important;
  border-color: rgba(237, 28, 36, 0.2) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] #calcDisplay {
  background: #101114 !important;
  border-color: #3b3d42 !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .calc-btn,
[data-theme="dark"] .gantt-view-switch button {
  background: linear-gradient(180deg, #24262b, #15171a) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-danger {
  border-color: rgba(237, 28, 36, 0.22) !important;
}

[data-theme="dark"] tbody tr:hover { background: rgba(237, 28, 36, 0.1) !important; }

@keyframes cetem-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cetem-banner-sheen {
  0%, 35% { transform: translateX(-120%); }
  65%, 100% { transform: translateX(120%); }
}

@keyframes cetem-sidebar-scan {
  0% { transform: translateY(-100%); }
  58%, 100% { transform: translateY(100%); }
}

@keyframes cetem-card-sheen {
  0%, 44% { transform: translateX(-30%) rotate(19deg); opacity: 0; }
  55% { opacity: 1; }
  76%, 100% { transform: translateX(340%) rotate(19deg); opacity: 0; }
}

@keyframes cetem-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 960px) {
  .banner { padding-right: 16px !important; }
  .banner::after { display: none; }
  .cetem-shell-brand {
    justify-content: flex-start;
    margin-bottom: 10px;
  }
  .cetem-shell-brand img { width: 104px; }
}

@media (max-width: 640px) {
  body::after { width: 3px; }
  .cetem-shell-brand {
    min-height: 40px;
    font-size: 10px;
  }
  .cetem-shell-brand span { padding: 6px 8px; }
}

@media print {
  body::after,
  .cetem-shell-brand,
  .banner::before,
  .banner::after { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  body.is-motion-ready .motion-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ==========================================================================
   Ajustes solicitados: vermelho escuro, menu superior e status sem excesso
   ========================================================================== */
:root {
  --cetem-red: #7f0d13;
  --cetem-red-bright: #9e161d;
  --cetem-red-dark: #56070b;
  --cetem-red-deep: #2a0305;
  --cetem-red-soft: #f5e6e8;
  --cetem-black: #090909;
  --cetem-graphite: #202328;
  --cetem-steel: #59616b;
  --cetem-muted: #737982;
  --cetem-line: #cfd4da;
  --cetem-soft-line: #e6e9ed;
  --cetem-surface: #ffffff;
  --cetem-surface-2: #f4f6f8;
  --cetem-shell: #555b63;
  --cetem-success: #1f7a4d;
  --cetem-success-soft: #e6f3ec;
  --cetem-warning: #a76512;
  --cetem-warning-soft: #fff3df;
  --cetem-danger: #a30f19;
  --cetem-danger-soft: #fae6e8;
}

body {
  background:
    linear-gradient(135deg, #30343a 0%, #474d55 42%, #737982 72%, #d5d8dc 100%) !important;
  color: var(--cetem-graphite);
}

body::after { display: none !important; }

#sidebar {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  min-height: 74px !important;
  width: auto !important;
  padding: 10px 22px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  background: #fff !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
}

#sidebar::after,
#sidebar .sb-item::before {
  display: none !important;
}

#sidebar:hover { width: auto !important; }

#sidebar .sb-logo {
  min-height: 52px !important;
  padding: 4px 18px 4px 0 !important;
  border-right: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-bottom: 0 !important;
  overflow: visible !important;
}

#sidebar .sb-logo .sb-logo-mark {
  width: 126px !important;
  height: 48px !important;
  padding: 5px 10px !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  transform: none !important;
}

#sidebar .sb-logo img {
  max-width: 100% !important;
  max-height: 100% !important;
}

#sidebar .sb-logo > span:not(.sb-logo-mark) {
  color: var(--cetem-graphite) !important;
  opacity: 1 !important;
}

#sidebar .sb-item,
#sidebar .sb-rda,
#sidebar .sb-tap,
#sidebar .sb-perf,
#sidebar .sb-gantt,
#sidebar .sb-pred,
#sidebar .sb-pdi,
#sidebar .sb-perfil,
#sidebar .sb-danger,
#sidebar .sb-admin,
#sidebar .sb-logout {
  width: auto !important;
  flex: 0 0 auto !important;
  padding: 10px 12px !important;
  gap: 8px !important;
  color: #30343a !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  transform: none !important;
}

#sidebar .sb-item span {
  opacity: 1 !important;
}

#sidebar .sb-item svg {
  width: 19px !important;
  height: 19px !important;
}

#sidebar .sb-item:hover {
  color: var(--cetem-red) !important;
  background: #f2f4f6 !important;
  border-color: #d9dde3 !important;
  transform: none !important;
}

.banner {
  background:
    linear-gradient(120deg, #2b2f35 0%, #444b53 55%, #656b73 100%) !important;
  border-left: 5px solid var(--cetem-red) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22) !important;
}

.banner::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.9)) !important;
  box-shadow: none !important;
}

.banner .btn,
.banner button,
.banner .btn-primary,
.banner .btn-secondary,
.banner .btn-success,
.banner .btn-warning,
.banner .btn-danger {
  background: #fff !important;
  color: #202328 !important;
  border: 1px solid rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

.banner .btn *,
.banner button * {
  color: inherit !important;
}

.banner .btn:hover,
.banner button:hover {
  background: #eef1f4 !important;
  color: var(--cetem-red) !important;
}

.card {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}

.card::before {
  background: linear-gradient(90deg, transparent, #aeb5bd, #707781, transparent) !important;
  opacity: 0.45 !important;
}

.card::after {
  display: none !important;
}

.card:hover {
  border-color: rgba(15, 23, 42, 0.18) !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(255, 255, 255, 0.85) inset !important;
}

.summary {
  box-shadow: inset 4px 0 0 #707781 !important;
}

.summary:hover {
  box-shadow: inset 4px 0 0 #59616b, 0 12px 28px rgba(15, 23, 42, 0.10) !important;
}

.btn-primary,
#calcFab,
.calc-eq,
.gantt-view-switch button.active,
.btn-calc-fim {
  background: linear-gradient(180deg, var(--cetem-red-bright), var(--cetem-red-dark)) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(86, 7, 11, 0.22) !important;
}

.btn-primary:hover,
#calcFab:hover,
.calc-eq:hover,
.gantt-view-switch button.active:hover,
.btn-calc-fim:hover {
  background: linear-gradient(180deg, #b21d26, var(--cetem-red-dark)) !important;
}

.btn-secondary,
.calc-btn,
.gantt-view-switch button {
  background: linear-gradient(180deg, #fff, #eceff2) !important;
  color: var(--cetem-graphite) !important;
}

.btn-success {
  background: var(--cetem-success-soft) !important;
  color: var(--cetem-success) !important;
  border-color: #a7d9bd !important;
}

.btn-warning {
  background: var(--cetem-warning-soft) !important;
  color: var(--cetem-warning) !important;
  border-color: #ecc37d !important;
}

.btn-danger {
  background: var(--cetem-danger-soft) !important;
  color: var(--cetem-danger) !important;
  border-color: #e4a2a8 !important;
}

.em-andamento,
.andamento {
  background: var(--cetem-warning-soft) !important;
  color: #8a520c !important;
  border-color: #e9bd72 !important;
}

.concluido,
.tap-status-fechado,
.tap-status-concluido {
  background: var(--cetem-success-soft) !important;
  color: var(--cetem-success) !important;
  border-color: #a7d9bd !important;
}

.atrasado,
.tap-status-perdido {
  background: var(--cetem-danger-soft) !important;
  color: var(--cetem-danger) !important;
  border-color: #e4a2a8 !important;
}

.tap-status-aguardando {
  background: #eef1f4 !important;
  color: var(--cetem-steel) !important;
  border-color: #cfd4da !important;
}

.status-card.amarelo {
  background: linear-gradient(135deg, #92600f 0%, #c58b28 100%) !important;
}

.status-card.verde {
  background: linear-gradient(135deg, #1f6b49 0%, #2e8b5f 100%) !important;
}

.status-card.vermelho {
  background: linear-gradient(135deg, var(--cetem-red-deep) 0%, var(--cetem-red) 100%) !important;
}

.gantt .bar-andamento .bar { fill: #ffe8bd !important; }
.gantt .bar-andamento .bar-progress { fill: var(--cetem-warning) !important; }
.gantt .bar-concluido .bar { fill: #cfe9da !important; }
.gantt .bar-concluido .bar-progress { fill: var(--cetem-success) !important; }
.gantt .bar-concluido-atrasado .bar,
.gantt .bar-atrasado .bar { fill: #efd0d3 !important; }
.gantt .bar-concluido-atrasado .bar-progress,
.gantt .bar-atrasado .bar-progress { fill: var(--cetem-danger) !important; }
.gantt-chip.gantt-andamento { background: var(--cetem-warning) !important; }
.gantt-chip.gantt-concluido { background: var(--cetem-success) !important; }
.gantt-chip.gantt-concluido_atrasado,
.gantt-chip.gantt-atrasado { background: var(--cetem-danger) !important; }

[style*="color:#dc2626"],
[style*="color:#b91c1c"] {
  color: var(--cetem-danger) !important;
}

[style*="color:#16a34a"],
[style*="color:#22c55e"],
[style*="color:#166534"] {
  color: var(--cetem-success) !important;
}

[style*="color:#d97706"],
[style*="color:#f59e0b"],
[style*="color:#92400e"],
[style*="color:#78350f"] {
  color: var(--cetem-warning) !important;
}

[style*="background:#dc2626"],
[style*="background:#ef4444"] {
  background: var(--cetem-danger) !important;
}

[style*="background:#16a34a"],
[style*="background:#22c55e"] {
  background: var(--cetem-success) !important;
}

[style*="background:#d97706"],
[style*="background:#f59e0b"] {
  background: var(--cetem-warning) !important;
}

[style*="background:#fee2e2"],
[style*="background:#fef2f2"] {
  background: var(--cetem-danger-soft) !important;
}

[style*="background:#dcfce7"],
[style*="background:#f0fdf4"] {
  background: var(--cetem-success-soft) !important;
}

[style*="background:#fef3c7"],
[style*="background:#fffbeb"] {
  background: var(--cetem-warning-soft) !important;
}

[style*="border-left:4px solid #dc2626"] {
  border-left-color: var(--cetem-danger) !important;
}

[style*="border-left:4px solid #16a34a"] {
  border-left-color: var(--cetem-success) !important;
}

[style*="border-left:4px solid #d97706"],
[style*="border-left:4px solid #f59e0b"] {
  border-left-color: var(--cetem-warning) !important;
}

@media (max-width: 960px) {
  #sidebar { padding: 8px 12px !important; }
  #sidebar .sb-logo { padding-right: 10px !important; }
  #sidebar .sb-logo > span:not(.sb-logo-mark) { display: none !important; }
  #sidebar .sb-logo .sb-logo-mark { width: 112px !important; }
}

@media (max-width: 640px) {
  #sidebar { min-height: 68px !important; }
  #sidebar .sb-item { padding: 9px 10px !important; }
}

/* ==========================================================================
   Ajustes finais solicitados: banners vermelhos e cinza #191919
   ========================================================================== */
:root {
  --cetem-shell: #191919;
  --cetem-graphite: #191919;
  --cetem-steel: #191919;
}

body {
  background:
    radial-gradient(circle at top left, rgba(127, 13, 19, 0.10), transparent 34%),
    linear-gradient(135deg, #d6d9dd 0%, #b8bec5 45%, #8f979f 100%) !important;
}

.banner {
  background:
    linear-gradient(120deg, #2a0305 0%, #56070b 42%, #7f0d13 100%) !important;
  border-left-color: #a30f19 !important;
  border-top-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 18px 44px rgba(25, 25, 25, 0.34) !important;
}

.banner::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.74)) !important;
}

#sidebar .sb-logo .sb-logo-mark {
  width: 154px !important;
  height: 58px !important;
  flex-basis: 154px !important;
  box-shadow: none !important;
}

#sidebar .sb-logo > span:not(.sb-logo-mark) {
  color: #191919 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

#sidebar .sb-item,
#sidebar .sb-rda,
#sidebar .sb-tap,
#sidebar .sb-perf,
#sidebar .sb-gantt,
#sidebar .sb-pred,
#sidebar .sb-pdi,
#sidebar .sb-perfil,
#sidebar .sb-danger,
#sidebar .sb-admin,
#sidebar .sb-logout {
  color: #191919 !important;
}

#sidebar .sb-item svg,
#sidebar .sb-item svg * {
  color: currentColor !important;
  stroke: currentColor !important;
}

#sidebar .sb-item:hover,
#sidebar .sb-rda:hover,
#sidebar .sb-tap:hover,
#sidebar .sb-perf:hover,
#sidebar .sb-gantt:hover,
#sidebar .sb-pred:hover,
#sidebar .sb-pdi:hover,
#sidebar .sb-perfil:hover,
#sidebar .sb-danger:hover,
#sidebar .sb-admin:hover,
#sidebar .sb-logout:hover {
  color: #7f0d13 !important;
  background: rgba(127, 13, 19, 0.10) !important;
  border-color: rgba(127, 13, 19, 0.18) !important;
}

#sidebar .sb-item:hover svg,
#sidebar .sb-item:hover svg * {
  color: #7f0d13 !important;
  stroke: #7f0d13 !important;
}

#sidebar {
  padding-left: 8px !important;
  padding-right: 12px !important;
  gap: 3px !important;
  overflow-x: hidden !important;
}

#sidebar .sb-logo {
  gap: 6px !important;
  padding-left: 0 !important;
  padding-right: 12px !important;
}

#sidebar .sb-logo .sb-logo-mark {
  width: 108px !important;
  height: 58px !important;
  flex-basis: 108px !important;
  justify-content: flex-start !important;
  overflow: visible !important;
}

#sidebar .sb-logo .sb-logo-mark img {
  width: 124% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: left center !important;
  transform: translateX(-6px) scale(1.08);
  transform-origin: left center;
}

#sidebar .sb-logo-text {
  color: #191919 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

#sidebar .sb-logo-tech {
  color: #7f0d13 !important;
  font-size: inherit !important;
  font-weight: 900 !important;
}

#sidebar .sb-item {
  padding-left: 8px !important;
  padding-right: 8px !important;
  gap: 6px !important;
  font-size: 12px !important;
}

#sidebar .sb-spacer {
  flex: 1 1 4px !important;
  min-width: 4px !important;
}

@media (max-width: 960px) {
  #sidebar .sb-logo .sb-logo-mark {
    width: 96px !important;
    flex-basis: 96px !important;
  }
}

/* Mantem a barra vermelha apenas como cabecalho informativo; a navegacao fica no menu superior. */
.banner .actions,
.banner .icon-nav,
.banner .btn,
.banner button {
  display: none !important;
}

/* ==========================================================================
   Tema escuro Cetem - esquema proprio, sem inversao automatica de cores
   ========================================================================== */
#sidebar .logo-dark {
  display: none !important;
}

#themeFab {
  position: fixed !important;
  right: 20px !important;
  bottom: 88px !important;
  z-index: 2000 !important;
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(180deg, var(--cetem-red-bright), var(--cetem-red-dark)) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(86, 7, 11, 0.22) !important;
  transition: transform 0.22s var(--motion-smooth), box-shadow 0.22s var(--motion-smooth), background 0.22s var(--motion-smooth) !important;
}

#themeFab:hover {
  background: linear-gradient(180deg, #b21d26, var(--cetem-red-dark)) !important;
  box-shadow: 0 18px 34px rgba(86, 7, 11, 0.30) !important;
  transform: translateY(-2px) scale(1.03) !important;
}

#themeFab:active {
  transform: translateY(0) scale(0.98) !important;
}

#themeFab .theme-icon {
  width: 28px !important;
  height: 28px !important;
  color: #fff !important;
  stroke: currentColor !important;
}

#themeFab .theme-icon-sun {
  display: none !important;
}

html[data-theme="dark"] #themeFab .theme-icon-moon {
  display: none !important;
}

html[data-theme="dark"] #themeFab .theme-icon-sun {
  display: block !important;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #000 !important;
  color: #f4f5f7 !important;
}

html[data-theme="dark"] .container {
  color: #f4f5f7 !important;
}

html[data-theme="dark"] #sidebar {
  background: #000 !important;
  border-bottom-color: #151515 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.58) !important;
}

html[data-theme="dark"] #sidebar .logo-light {
  display: none !important;
}

html[data-theme="dark"] #sidebar .logo-dark {
  display: block !important;
}

html[data-theme="dark"] #sidebar .sb-logo {
  border-right-color: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] #sidebar .sb-logo .sb-logo-mark {
  background: #000 !important;
}

html[data-theme="dark"] #sidebar .sb-logo-text {
  color: #fff !important;
}

html[data-theme="dark"] #sidebar .sb-logo-tech {
  color: #ed1c24 !important;
}

html[data-theme="dark"] #sidebar .sb-item,
html[data-theme="dark"] #sidebar .sb-rda,
html[data-theme="dark"] #sidebar .sb-tap,
html[data-theme="dark"] #sidebar .sb-perf,
html[data-theme="dark"] #sidebar .sb-gantt,
html[data-theme="dark"] #sidebar .sb-pred,
html[data-theme="dark"] #sidebar .sb-pdi,
html[data-theme="dark"] #sidebar .sb-perfil,
html[data-theme="dark"] #sidebar .sb-danger,
html[data-theme="dark"] #sidebar .sb-admin,
html[data-theme="dark"] #sidebar .sb-logout {
  color: #fff !important;
}

html[data-theme="dark"] #sidebar .sb-item svg,
html[data-theme="dark"] #sidebar .sb-item svg * {
  color: currentColor !important;
  stroke: currentColor !important;
}

html[data-theme="dark"] #sidebar .sb-item:hover,
html[data-theme="dark"] #sidebar .sb-rda:hover,
html[data-theme="dark"] #sidebar .sb-tap:hover,
html[data-theme="dark"] #sidebar .sb-perf:hover,
html[data-theme="dark"] #sidebar .sb-gantt:hover,
html[data-theme="dark"] #sidebar .sb-pred:hover,
html[data-theme="dark"] #sidebar .sb-pdi:hover,
html[data-theme="dark"] #sidebar .sb-perfil:hover,
html[data-theme="dark"] #sidebar .sb-danger:hover,
html[data-theme="dark"] #sidebar .sb-admin:hover,
html[data-theme="dark"] #sidebar .sb-logout:hover {
  color: #ed1c24 !important;
  background: rgba(237, 28, 36, 0.12) !important;
  border-color: rgba(237, 28, 36, 0.34) !important;
}

html[data-theme="dark"] .banner {
  background: linear-gradient(120deg, #210002 0%, #56070b 42%, #8d0f18 100%) !important;
  border-left-color: #ed1c24 !important;
  border-top-color: rgba(255, 255, 255, 0.13) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.58) !important;
}

html[data-theme="dark"] .banner h1,
html[data-theme="dark"] .banner h2,
html[data-theme="dark"] .banner h3,
html[data-theme="dark"] .banner p,
html[data-theme="dark"] .banner span,
html[data-theme="dark"] .banner strong {
  color: #fff !important;
}

html[data-theme="dark"] .banner::after {
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.78) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] form.card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .summary,
html[data-theme="dark"] .empty,
html[data-theme="dark"] fieldset,
html[data-theme="dark"] #calcPanel,
html[data-theme="dark"] .gantt-view-switch {
  background: #121315 !important;
  border-color: #292b30 !important;
  color: #f4f5f7 !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .card::before {
  background: linear-gradient(90deg, transparent, rgba(237, 28, 36, 0.7), #3d3f45, transparent) !important;
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .summary:hover,
html[data-theme="dark"] .table-wrap:hover {
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] th,
html[data-theme="dark"] .prod-table th,
html[data-theme="dark"] .tap-table tfoot td,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .status-radio {
  background: #18191c !important;
  border-color: #303238 !important;
}

html[data-theme="dark"] table,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] label,
html[data-theme="dark"] legend,
html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] li,
html[data-theme="dark"] .summary,
html[data-theme="dark"] .summary span {
  color: #e8eaee !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong {
  color: #fff !important;
}

html[data-theme="dark"] td {
  border-bottom-color: #292b30 !important;
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(237, 28, 36, 0.08) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] #calcDisplay {
  background: #08090a !important;
  border-color: #34363c !important;
  color: #f4f5f7 !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #888d98 !important;
}

html[data-theme="dark"] input[readonly],
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled {
  background: #17181b !important;
  color: #a7abb4 !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .calc-btn,
html[data-theme="dark"] .gantt-view-switch button {
  background: linear-gradient(180deg, #222429, #141518) !important;
  color: #fff !important;
  border-color: #34363c !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .calc-btn:hover,
html[data-theme="dark"] .gantt-view-switch button:hover {
  background: linear-gradient(180deg, #30333a, #1b1d21) !important;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] #calcFab,
html[data-theme="dark"] #themeFab,
html[data-theme="dark"] .calc-eq,
html[data-theme="dark"] .gantt-view-switch button.active,
html[data-theme="dark"] .btn-calc-fim {
  background: linear-gradient(180deg, var(--cetem-red-bright), var(--cetem-red-dark)) !important;
  color: #fff !important;
}

html[data-theme="dark"] .calc-op {
  background: #320004 !important;
  color: #ffd7dc !important;
}

html[data-theme="dark"] .alert {
  background: #2b070a !important;
  color: #ffd7dc !important;
  border-color: #7f0d13 !important;
}

html[data-theme="dark"] .alert.ok {
  background: #082217 !important;
  color: #c7f6da !important;
  border-color: #1f6b49 !important;
}

html[data-theme="dark"] [style*="background:#f8fbff"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background:#eef1f4"],
html[data-theme="dark"] [style*="background:#f0f9ff"],
html[data-theme="dark"] [style*="background:#eff6ff"],
html[data-theme="dark"] [style*="background:#eef3ff"],
html[data-theme="dark"] [style*="background:#fffbeb"],
html[data-theme="dark"] [style*="background:#fef2f2"],
html[data-theme="dark"] [style*="background:#fef3c7"],
html[data-theme="dark"] [style*="background:#fee2e2"],
html[data-theme="dark"] [style*="background:#dcfce7"],
html[data-theme="dark"] [style*="background:#f0fdf4"] {
  background: #121315 !important;
  border-color: #292b30 !important;
  color: #e8eaee !important;
}

html[data-theme="dark"] .em-andamento,
html[data-theme="dark"] .andamento,
html[data-theme="dark"] .status.em-andamento,
html[data-theme="dark"] .status.andamento {
  background: var(--cetem-warning-soft) !important;
  color: #8a520c !important;
  border-color: #d7a24d !important;
}

html[data-theme="dark"] .concluido,
html[data-theme="dark"] .status.concluido,
html[data-theme="dark"] .tap-status-fechado,
html[data-theme="dark"] .tap-status-concluido {
  background: var(--cetem-success-soft) !important;
  color: #14633f !important;
  border-color: #8cc9a7 !important;
}

html[data-theme="dark"] .atrasado,
html[data-theme="dark"] .status.atrasado,
html[data-theme="dark"] .tap-status-perdido {
  background: var(--cetem-danger-soft) !important;
  color: var(--cetem-danger) !important;
  border-color: #e4a2a8 !important;
}

html[data-theme="dark"] .tap-status-aguardando {
  background: #26282d !important;
  color: #d8dbe1 !important;
  border-color: #464a52 !important;
}

html[data-theme="dark"] .status-card.amarelo {
  background: linear-gradient(135deg, #92600f 0%, #c58b28 100%) !important;
}

html[data-theme="dark"] .status-card.verde {
  background: linear-gradient(135deg, #1f6b49 0%, #2e8b5f 100%) !important;
}

html[data-theme="dark"] .status-card.vermelho {
  background: linear-gradient(135deg, var(--cetem-red-deep) 0%, var(--cetem-red) 100%) !important;
}

html[data-theme="dark"] .status-card,
html[data-theme="dark"] .status-card .label,
html[data-theme="dark"] .status-card .count,
html[data-theme="dark"] .status-card .hint {
  color: #fff !important;
}

html[data-theme="dark"] .gantt-chip.gantt-andamento { background: var(--cetem-warning) !important; color: #fff !important; }
html[data-theme="dark"] .gantt-chip.gantt-concluido { background: var(--cetem-success) !important; color: #fff !important; }
html[data-theme="dark"] .gantt-chip.gantt-concluido_atrasado,
html[data-theme="dark"] .gantt-chip.gantt-atrasado { background: var(--cetem-danger) !important; color: #fff !important; }

@media (max-width: 640px) {
  #themeFab {
    width: 48px !important;
    height: 48px !important;
    right: 12px !important;
    bottom: 68px !important;
  }

  #themeFab .theme-icon {
    width: 24px !important;
    height: 24px !important;
  }
}

@media print {
  #themeFab {
    display: none !important;
  }
}

/* ==========================================================================
   Legibilidade no tema escuro - botoes, blocos inline e textos semanticos
   ========================================================================== */
html[data-theme="dark"] .btn-success {
  background: linear-gradient(180deg, #1f6b49, #123827) !important;
  color: #fff !important;
  border-color: #2e8b5f !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32) !important;
}

html[data-theme="dark"] .btn-warning {
  background: linear-gradient(180deg, #92600f, #4f3309) !important;
  color: #fff !important;
  border-color: #c58b28 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32) !important;
}

html[data-theme="dark"] .btn-danger {
  background: linear-gradient(180deg, #9d000b, #4b0005) !important;
  color: #fff !important;
  border-color: #ed1c24 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .btn-success:hover {
  background: linear-gradient(180deg, #2e8b5f, #174b34) !important;
}

html[data-theme="dark"] .btn-warning:hover {
  background: linear-gradient(180deg, #b77d20, #60400d) !important;
}

html[data-theme="dark"] .btn-danger:hover {
  background: linear-gradient(180deg, #c40012, #650007) !important;
}

html[data-theme="dark"] .btn svg,
html[data-theme="dark"] .btn svg *,
html[data-theme="dark"] button svg,
html[data-theme="dark"] button svg * {
  color: currentColor !important;
  stroke: currentColor !important;
}

html[data-theme="dark"] .btn span,
html[data-theme="dark"] .btn strong,
html[data-theme="dark"] button span,
html[data-theme="dark"] button strong {
  color: currentColor !important;
}

html[data-theme="dark"] div[style*="padding:12px 16px"][style*="#dcfce7"] {
  background: linear-gradient(180deg, #163d2b, #101c16) !important;
  border-color: #2e8b5f !important;
}

html[data-theme="dark"] div[style*="padding:12px 16px"][style*="#fef3c7"] {
  background: linear-gradient(180deg, #4a310d, #1d160b) !important;
  border-color: #c58b28 !important;
}

html[data-theme="dark"] div[style*="padding:12px 16px"][style*="#fee2e2"] {
  background: linear-gradient(180deg, #4b0005, #190305) !important;
  border-color: #ed1c24 !important;
}

html[data-theme="dark"] div[style*="padding:12px 16px"],
html[data-theme="dark"] div[style*="padding:12px 16px"] > div {
  color: #f5f7fa !important;
}

html[data-theme="dark"] div[style*="padding:12px 16px"] [style*="color:#64748b"],
html[data-theme="dark"] div[style*="padding:12px 16px"] [style*="color:#334155"] {
  color: #c8cdd5 !important;
}

html[data-theme="dark"] [style*="color:#16a34a"],
html[data-theme="dark"] [style*="color: #16a34a"],
html[data-theme="dark"] [style*="color:#166534"],
html[data-theme="dark"] [style*="color:#22c55e"] {
  color: #6ee7a8 !important;
}

html[data-theme="dark"] [style*="color:#dc2626"],
html[data-theme="dark"] [style*="color: #dc2626"],
html[data-theme="dark"] [style*="color:#b91c1c"],
html[data-theme="dark"] [style*="color:#9d000b"],
html[data-theme="dark"] [style*="color:#7f0d13"] {
  color: #ff8a95 !important;
}

html[data-theme="dark"] [style*="color:#d97706"],
html[data-theme="dark"] [style*="color: #d97706"],
html[data-theme="dark"] [style*="color:#b45309"],
html[data-theme="dark"] [style*="color:#92400e"],
html[data-theme="dark"] [style*="color:#a76512"] {
  color: #f7c66a !important;
}

html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color:#59616b"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color:#6b7a99"],
html[data-theme="dark"] [style*="color:#94a3b8"],
html[data-theme="dark"] [style*="color:#1f2937"] {
  color: #b8c0cc !important;
}

html[data-theme="dark"] [style*="background:#e5e7eb"],
html[data-theme="dark"] [style*="background: #e5e7eb"] {
  background: #2f3b4d !important;
}

html[data-theme="dark"] [style*="background:#eef1f4"],
html[data-theme="dark"] [style*="background: #eef1f4"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f8fbff"],
html[data-theme="dark"] [style*="background: #f8fbff"] {
  background: #15171a !important;
  border-color: #32353b !important;
}

html[data-theme="dark"] [style*="line-height:20px"][style*="color:#1f2937"],
html[data-theme="dark"] [style*="line-height:16px"][style*="color:#1f2937"] {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62) !important;
}

html[data-theme="dark"] .tap-list-table tbody tr,
html[data-theme="dark"] .rda-table tbody tr,
html[data-theme="dark"] .perf-table tbody tr,
html[data-theme="dark"] .prod-table tbody tr {
  background: #121315 !important;
}

html[data-theme="dark"] .tap-list-table tbody tr:nth-child(even),
html[data-theme="dark"] .rda-table tbody tr:nth-child(even),
html[data-theme="dark"] .perf-table tbody tr:nth-child(even),
html[data-theme="dark"] .prod-table tbody tr:nth-child(even) {
  background: #15171a !important;
}

html[data-theme="dark"] .tap-list-table tbody tr:hover,
html[data-theme="dark"] .rda-table tbody tr:hover,
html[data-theme="dark"] .perf-table tbody tr:hover,
html[data-theme="dark"] .prod-table tbody tr:hover {
  background: rgba(237, 28, 36, 0.12) !important;
}

html[data-theme="dark"] .tap-list-table th,
html[data-theme="dark"] .rda-table th,
html[data-theme="dark"] .perf-table th,
html[data-theme="dark"] .prod-table th {
  background: #1a1c20 !important;
  color: #fff !important;
}

html[data-theme="dark"] .tap-list-table td,
html[data-theme="dark"] .rda-table td,
html[data-theme="dark"] .perf-table td,
html[data-theme="dark"] .prod-table td {
  color: #f0f2f5 !important;
}

html[data-theme="dark"] canvas {
  filter: brightness(1.08) contrast(1.08);
}

.pdi-summary .pdi-below-target {
  color: #d00014 !important;
}

html[data-theme="dark"] .pdi-summary .pdi-below-target {
  color: #ff2535 !important;
  text-shadow: 0 0 16px rgba(255, 37, 53, 0.18) !important;
}

.pdi-summary .dashboard-neutral-label,
.pdi-summary .dashboard-blue-result {
  color: #59616b !important;
}

.pdi-summary .dashboard-blue-divider {
  background: #cbd5e1 !important;
}

html[data-theme="dark"] .pdi-summary .dashboard-neutral-label,
html[data-theme="dark"] .pdi-summary .dashboard-blue-result {
  color: #b8c0cc !important;
}

html[data-theme="dark"] .pdi-summary .dashboard-blue-divider {
  background: #2f3b4d !important;
}
