/* Paleta idêntica à usada em /dashboard/ (claro) e /quadro/ (escuro), já
   calibrada pra 4.5:1 mínimo (WCAG AA) — mesmos tokens do relatório de
   turnos publicado anteriormente. */
:root {
  --bg: #f4f1ea;
  --surface: #fffefa;
  --surface-2: #f8f5ee;
  --surface-3: #eee7d9;
  --line: rgba(22, 58, 66, .14);
  --line-strong: rgba(22, 58, 66, .28);
  --ink: #173a43;
  --muted: #5d7274;
  --faint: #8d9b9a;
  --brand-blue: #0e3a45;
  --brand-blue-2: #123f4b;
  --emphasis: #0e3a45;
  --accent: #776e51;
  --accent-strong: #665d43;
  --accent-ink: #ffffff;
  --good: #257b59;
  --good-bg: rgba(47, 157, 114, .12);
  --good-border: rgba(47, 157, 114, .30);
  --bom: #1e6f91;
  --bom-bg: rgba(30, 111, 145, .12);
  --warn: #95621b;
  --warn-bg: rgba(200, 132, 36, .13);
  --warn-border: rgba(200, 132, 36, .32);
  --bad: #bd3f39;
  --bad-bg: rgba(200, 79, 73, .12);
  --bad-border: rgba(200, 79, 73, .32);
  --shadow: 0 14px 34px rgba(14, 58, 69, .10);
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081d23; --surface: #10303b; --surface-2: #193e4c; --surface-3: #1f4e60;
    --line: rgba(240, 237, 229, .12); --line-strong: rgba(240, 237, 229, .22);
    --ink: #f0ede5; --muted: #8fb3b0; --faint: #5d827f;
    --emphasis: #f0ede5;
    --accent: #a29c7e; --accent-strong: #c3bd9e; --accent-ink: #081d23;
    --good: #3aab82; --good-bg: rgba(58, 171, 130, .16); --good-border: rgba(58, 171, 130, .38);
    --bom: #5b9fd6; --bom-bg: rgba(58, 127, 193, .16);
    --warn: #dba13f; --warn-bg: rgba(212, 149, 42, .16); --warn-border: rgba(212, 149, 42, .38);
    --bad: #dd7a74; --bad-bg: rgba(200, 72, 72, .18); --bad-border: rgba(200, 72, 72, .40);
    --shadow: 0 10px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 16%, transparent), transparent 34rem), var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: inherit; text-wrap: balance; margin: 0; color: var(--ink); font-weight: 800; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-2));
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 12px 32px rgba(14, 58, 69, .18);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.topbar .mark {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26);
  color: #f3ead3; font-weight: 800; font-size: 14px;
}
.topbar .brandtext { color: rgba(255, 255, 255, .92); font-size: 13.5px; font-weight: 700; }
.topbar .brandtext small { display: block; color: rgba(255, 255, 255, .58); font-size: 11px; font-weight: 500; }

.page { padding-bottom: 60px; }
.view-header { padding: 36px 0 6px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent);
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 8px;
}
.eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--accent); }
.view-header h1 { font-size: clamp(24px, 4vw, 34px); letter-spacing: -.01em; max-width: 22ch; }
.view-header .hint { margin-top: 12px; max-width: 68ch; color: var(--muted); font-size: 15px; }

.filtro-card {
  margin-top: 26px; display: flex; flex-wrap: wrap; align-items: end; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.control { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.control select, .control input {
  font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); min-width: 190px;
}
.button {
  font: inherit; font-weight: 800; font-size: 13.5px; border-radius: 999px; border: 1px solid transparent;
  padding: 10px 20px; cursor: pointer;
}
.button.primary { background: var(--brand-blue); color: #f6efdd; }
.button.primary:hover { background: var(--brand-blue-2); }
.button.primary:disabled { opacity: .6; cursor: default; }

.empty-state, .error-state {
  margin-top: 26px; padding: 30px; text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); font-size: 14px;
}
.error-state { color: var(--bad); border-color: var(--bad-border); background: var(--bad-bg); }

section.rx { padding: 30px 0; border-bottom: 1px solid var(--line); }
section.rx:last-child { border-bottom: none; }
.rx-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.rx-title { font-size: 19px; font-weight: 800; }
.rx-note { font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 68ch; }
.rx-tag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); margin-left: 8px; vertical-align: middle; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.kpi .n { color: var(--emphasis); font-size: 24px; line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; }
.kpi .n small { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .l { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.35; }

.painel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h4 { font-size: 13.5px; font-weight: 800; margin-bottom: 10px; }

.statusgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.statuscell { border-radius: 14px; padding: 14px 16px; border: 1px solid transparent; }
.statuscell .pct { font-size: 22px; font-weight: 850; }
.statuscell .lbl { font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.statuscell.abaixo { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad); }
.statuscell.conforme { background: var(--bom-bg); border-color: var(--bom); color: var(--bom); }
.statuscell.acima { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
@media (max-width: 640px) { .statusgrid { grid-template-columns: 1fr; } }

.rowlist { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rowitem { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rowitem:last-child { border-bottom: none; }
.rowitem .k { color: var(--muted); }
.rowitem .v { font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11.5px; font-weight: 700; background: var(--bad-bg); color: var(--bad); padding: 3px 10px; border-radius: 999px; }
.tag.setor-salao { background: var(--bom-bg); color: var(--bom); }
.tag.setor-cozinha { background: var(--warn-bg); color: var(--warn); }
.tag.setor-inforno { background: var(--surface-3); color: var(--muted); }
.tag.freela { border: 1px dashed currentColor; }

.quote { font-size: 13.5px; margin-top: 12px; line-height: 1.5; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.quote .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 4px; font-weight: 800; }

.escalados-setor { margin-top: 14px; }
.escalados-setor h5 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.escalados-setor ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.escalados-setor li { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

.tblwrap { overflow-x: auto; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 480px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }

details.rx-collapse { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
details.rx-collapse summary { cursor: pointer; padding: 14px 18px; font-weight: 800; font-size: 13.5px; list-style: none; }
details.rx-collapse summary::-webkit-details-marker { display: none; }
details.rx-collapse summary::before { content: "▸ "; color: var(--accent); }
details.rx-collapse[open] summary::before { content: "▾ "; }
details.rx-collapse .inner { padding: 0 18px 18px; }

.callout { margin-top: 16px; padding: 14px 18px; border-radius: 14px; font-size: 13px; border: 1px solid var(--line); border-left: 4px solid var(--muted); background: var(--surface); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout .t { font-weight: 800; margin-bottom: 4px; }

footer { padding: 30px 0 50px; }
footer p { color: var(--faint); font-size: 11.5px; max-width: 70ch; line-height: 1.6; }

.skeleton { margin-top: 26px; padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }
