/* Painel Tudo Tem — dois temas: claro (bordô da marca, base em style.css) e escuro (azul-marinho, classe .tt-dark). */

/* ===== Tema claro (bordô) ===== */
body:has(.tt:not(.tt-dark):not([hidden])){background:#F7F4F5}
.tt{
  --color-bg:#FFFFFF;--color-fg:#22181C;--color-fg-muted:#6E6266;--color-panel:#FFFFFF;--color-border-line:#E8E1E4;
  --color-ok:#1F8A4C;--color-bad:#C0392B;--color-warn:#C27A12;
  --cds-chart-grid:#EFE9EB;--cds-chart-axis:#CFC6CA;--cds-chart-reference:#9C9195;--cds-text-secondary:#6E6266;
  --cds-surface-popover:#FFFFFF;--cds-border:#E0D8DB;--cds-shadow-popover:0 8px 24px rgba(60,20,35,.14);
  --tt-line:#DCD3D7;--tt-hover:#F6EEF1;
  --tt-c-real:var(--tt-bar-2);--tt-c-max:#7D1343;--tt-c-min:#C27A12;--tt-c-hoje:rgba(125,19,67,.22);--tt-c-prev:var(--tt-bar-3);
  --tt-c-area:rgba(125,19,67,.10);--tt-c-line:#7D1343;--tt-c-ly:#8C8387;--tt-c-peak:#C27A12;
  --tt-s1:#7D1343;--tt-s2:#C27A12;--tt-s3:#2E6F9E;--tt-s4:#3E8E5E;--tt-s5:#8A5BA8;--tt-s6:#D0643A;--tt-s7:#1E9AA0;--tt-s8:#6B7F2A;
  background:#F7F4F5;padding:16px 16px 40px;min-height:100vh;
}

/* Barra do topo fixa ao rolar (logo, abas, atualização, tema e sair), nos dois temas */
.tt .tt-top{position:sticky;top:0;z-index:50;box-shadow:0 6px 18px rgba(0,0,0,.18)}
.tt.tt-dark .tt-top{top:0;box-shadow:0 6px 18px rgba(0,0,0,.45)}

/* Botão de tema (aparece no topo de todas as páginas) */
.tt-tema{appearance:none;font:inherit;font-size:12px;font-weight:600;cursor:pointer;padding:5px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.55);background:rgba(255,255,255,.12);color:#fff;white-space:nowrap}
.tt-tema:hover{background:rgba(255,255,255,.22)}
.tt-tema .t-esc{display:inline} .tt-tema .t-cla{display:none}
.tt.tt-dark .tt-tema .t-esc{display:none} .tt.tt-dark .tt-tema .t-cla{display:inline}

/* Componentes comuns aos dois temas */
.tt .dash-select,.tt .tt-input{background:var(--color-bg);color:var(--color-fg);border:1px solid var(--tt-line);border-radius:8px;padding:6px 10px;font:inherit;font-size:13px;min-width:200px}
.tt .dash-select:focus,.tt .tt-input:focus,.tt .tt-ms-b:focus-visible{outline:none;border-color:var(--tt-brand)}
.tt .tt-ms{position:relative;display:flex;flex-direction:column;gap:4px;font-size:var(--cds-font-size-caption);color:var(--color-fg-muted)}
.tt .tt-ms-b{font:inherit;font-size:13px;color:var(--color-fg);text-align:left;padding:6px 30px 6px 10px;min-width:220px;max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border:1px solid var(--tt-line);border-radius:8px;background:var(--color-bg);cursor:pointer;position:relative}
.tt .tt-ms-b::after{content:'▾';position:absolute;right:11px;top:50%;transform:translateY(-50%);color:var(--tt-brand)}
.tt .tt-ms-b[aria-expanded="true"]{border-color:var(--tt-brand)}
.tt .tt-ms-pop{position:absolute;z-index:60;top:100%;left:0;margin-top:6px;width:280px;padding:10px;display:flex;flex-direction:column;gap:8px;color:var(--color-fg);background:var(--cds-surface-popover);border:1px solid var(--tt-line);border-radius:10px;box-shadow:var(--cds-shadow-popover)}
.tt .tt-ms-pop[hidden]{display:none}
.tt .tt-ms-list{max-height:300px;overflow:auto;display:flex;flex-direction:column;gap:1px}
.tt .tt-filters .tt-ms-list label,.tt .tt-ms-list label{display:flex !important;flex-direction:row !important;align-items:center;justify-content:flex-start;gap:10px;font-size:13px;color:var(--color-fg);padding:5px 6px;border-radius:6px;cursor:pointer;line-height:1.2;font-variant-numeric:tabular-nums}
.tt .tt-ms-list label:hover{background:var(--tt-hover)}
.tt .tt-ms-list label.off{opacity:.4;cursor:default}
.tt .tt-ms-list input{flex:none;width:16px;height:16px;margin:0;accent-color:var(--tt-brand);cursor:inherit}
.tt .tt-ms-list .sub{color:var(--tt-brand);font-size:12px;margin-left:auto}
.tt .tt-ms-acts{display:flex;flex-wrap:wrap;gap:6px}
.tt .tt-ms-acts button,.tt .tt-ms-foot button{font:inherit;font-size:12px;padding:4px 10px;border:1px solid var(--tt-line);border-radius:999px;background:transparent;color:var(--color-fg);cursor:pointer}
.tt .tt-ms-acts button:hover{border-color:var(--tt-brand);color:var(--tt-brand)}
.tt .tt-ms-foot{display:flex;justify-content:flex-end}
.tt .tt-ms-foot button.ok{background:var(--tt-brand);border-color:var(--tt-brand);color:#fff;font-weight:700;padding:5px 16px}
.tt .tt-resumo{font-size:13px;color:var(--color-fg-muted);align-self:flex-end;padding-bottom:8px}
.tt .tt-t.clicavel tbody tr{cursor:pointer}
.tt .tt-t.clicavel tbody tr:hover td{background:var(--tt-hover)}
.tt .tt-sw.sw-hoje{background:var(--tt-c-hoje);border:2px solid var(--tt-brand);box-sizing:border-box}
.tt .tt-sw.sw-off{background:var(--tt-c-real);opacity:.25}
.tt .tt-sw.sw-linha{height:3px;border-radius:2px;background:var(--tt-c-line)}
.tt .tt-sw.cor{border-radius:50%}
.tt .sw-ly{background:var(--tt-c-ly)}

/* ===== Tema escuro (azul-marinho) ===== */
body:has(.tt.tt-dark){background:#0A1120}
.tt.tt-dark{
  --c-cyan:#22D3EE;--c-blue:#5B8DEF;--c-lav:#A5B4FC;--c-pink:#F472B6;--c-yellow:#FACC15;--c-green:#4ADE80;--c-red:#F87171;--c-orange:#FB923C;
  --color-bg:#0B1424;--color-fg:#F1F5F9;--color-fg-muted:#93A3BC;
  --color-panel:#0E1729;--color-border-line:#1E2B42;
  --color-ok:var(--c-green);--color-bad:var(--c-red);--color-warn:var(--c-yellow);
  --cds-chart-grid:rgba(147,163,188,.14);--cds-chart-axis:#2A3A55;--cds-chart-reference:#93A3BC;
  --cds-text-secondary:#93A3BC;--cds-surface-popover:#111C31;--cds-border:#2A3A55;--cds-shadow-popover:0 8px 24px rgba(0,0,0,.45);
  --tt-brand:var(--c-cyan);--tt-bar:var(--c-blue);--tt-bar-2:var(--c-blue);--tt-bar-3:rgba(91,141,239,.18);--tt-min:var(--c-pink);
  --tt-desp:var(--c-orange);--tt-desp-2:rgba(251,146,60,.35);
  --tt-line:#2A3A55;--tt-hover:#18264A;
  --tt-c-real:#5B8DEF;--tt-c-max:#22D3EE;--tt-c-min:#F472B6;--tt-c-hoje:rgba(91,141,239,.30);--tt-c-prev:rgba(91,141,239,.16);
  --tt-c-area:rgba(34,211,238,.08);--tt-c-line:#22D3EE;--tt-c-ly:#F472B6;--tt-c-peak:#FACC15;
  --tt-s1:#22D3EE;--tt-s2:#5B8DEF;--tt-s3:#FACC15;--tt-s4:#4ADE80;--tt-s5:#F472B6;--tt-s6:#A5B4FC;--tt-s7:#FB923C;--tt-s8:#F87171;
  color:var(--color-fg);background:#0A1120;
}
.tt.tt-dark .tt-top{background:#0B1424;border:1px solid var(--color-border-line);border-bottom:2px solid var(--c-cyan);border-radius:10px;position:sticky;top:8px;z-index:40}
.tt.tt-dark .tt-tab{color:#B6C2D6;border:1px solid transparent}
.tt.tt-dark .tt-tab:hover{background:#13203A;color:#fff}
.tt.tt-dark .tt-tab.is-on{background:rgba(34,211,238,.12);color:var(--c-cyan);border-color:rgba(34,211,238,.5);font-weight:600}
.tt.tt-dark .tt-upd{color:var(--c-cyan)}
.tt.tt-dark .tt-upd b{color:#fff;font-weight:600}
.tt.tt-dark .tt-tema{border-color:rgba(34,211,238,.5);background:transparent;color:var(--c-cyan)}
.tt.tt-dark .tt-tema:hover{background:rgba(34,211,238,.12)}
.tt.tt-dark .tt-h1{font-family:var(--font-anthropic-sans);font-weight:700;font-size:26px;letter-spacing:-.01em;color:#fff}
.tt.tt-dark .tt-h2{font-weight:700;color:#fff}
.tt.tt-dark .tt-lead b{color:#fff;font-weight:700}
.tt.tt-dark .tt-card,.tt.tt-dark .tt-kpi,.tt.tt-dark .tt-navc{background:var(--color-panel);border:1px solid var(--color-border-line);border-radius:12px;box-shadow:none}
.tt.tt-dark .tt-kpis .tt-kpi:first-child{border-top:3px solid var(--c-cyan)}
.tt.tt-dark .tt-kpis .tt-kpi:first-child .tt-kpi-v{color:var(--c-cyan)}
.tt.tt-dark .tt-kpi-l{color:#B6C2D6}
.tt.tt-dark .tt-kpi-v{font-family:var(--font-anthropic-sans);font-weight:700;font-size:26px;letter-spacing:-.01em;color:#fff}
.tt.tt-dark .tt-kpi-v.tt-down{color:var(--c-red)}
.tt.tt-dark .tt-up{color:var(--c-green);font-weight:600}
.tt.tt-dark .tt-down{color:var(--c-red);font-weight:600}
.tt.tt-dark .tt-hero{background:#0B1424;border:1px solid var(--color-border-line);border-bottom:2px solid var(--c-cyan);border-radius:12px}
.tt.tt-dark .tt-hero h1{font-family:var(--font-anthropic-sans);font-weight:700;font-size:30px;color:#fff}
.tt.tt-dark .tt-hero p{color:#B6C2D6}
.tt.tt-dark .tt-hero b{color:var(--c-cyan)}
.tt.tt-dark .tt-navc:hover{border-color:var(--c-cyan)}
.tt.tt-dark .tt-navc strong{color:var(--c-cyan);font-weight:700}
.tt.tt-dark .tt-hl .tt-card .tt-h2{color:var(--c-cyan)}
.tt.tt-dark .tt-bar-t{background:#16223A;height:12px;border-radius:6px}
.tt.tt-dark .tt-bar-f{background:var(--c-blue);border-radius:6px}
.tt.tt-dark .tt-bar-f.f1{background:var(--c-orange);border-radius:0}
.tt.tt-dark .tt-bar-f.f2{background:rgba(251,146,60,.35);border-radius:0}
.tt.tt-dark .tt-bar-f.f3{background:var(--c-red);border-radius:0}
.tt.tt-dark .tt-tip b{color:#fff}
.tt.tt-dark .sw-real,.tt.tt-dark .sw-real2{background:var(--c-blue)}
.tt.tt-dark .sw-max{background:var(--c-cyan)}
.tt.tt-dark .sw-min{background:var(--c-pink)}
.tt.tt-dark .sw-prev{background:rgba(91,141,239,.16);border:1px dashed var(--c-blue)}
.tt.tt-dark .sw-saldo{background:var(--c-pink)}
.tt.tt-dark .sw-desp{background:var(--c-orange)} .tt.tt-dark .sw-desp2{background:rgba(251,146,60,.35)} .tt.tt-dark .sw-venc{background:var(--c-red)}
.tt.tt-dark .tt-t th{background:#0E1729;color:#B6C2D6;border-bottom:1px solid #2A3A55}
.tt.tt-dark .tt-t td{border-bottom:1px solid #18243A}
.tt.tt-dark .tt-t tbody tr:hover td{background:#13203A}
.tt.tt-dark .tt-t tr.cur td{background:rgba(34,211,238,.07)}
.tt.tt-dark .tt-pill.A{color:var(--c-cyan)} .tt.tt-dark .tt-pill.B{color:var(--c-yellow)} .tt.tt-dark .tt-pill.C{color:var(--c-pink)}
.tt.tt-dark .tt-pill.Baixado{color:var(--c-green)} .tt.tt-dark .tt-pill.Vencido{color:var(--c-red)} .tt.tt-dark .tt-pill.Aberto{color:#B6C2D6}
.tt.tt-dark .tt-heat td.h{border-right:1px solid #0A1120;border-bottom:1px solid #0A1120}
.tt.tt-dark .tt-alert{background:rgba(250,204,21,.08);border-left-color:var(--c-yellow);color:#FDE68A}
.tt.tt-dark .tt-filters label{color:#B6C2D6}
.tt.tt-dark .dash-select,.tt.tt-dark .tt-input,.tt.tt-dark .tt-ms-b{border-radius:999px;padding-left:14px}
.tt.tt-dark select option{background:#0E1729;color:#F1F5F9}
.tt.tt-dark .tt-input::placeholder{color:#6B7C97}
.tt.tt-dark .tt-ms-foot button.ok{color:#0A1120}
