/* =====================================================================
   BC2C Help Desk · linguagem visual
   Cores: grafite com um único destaque verde-limão (#d1fe17).
   Tipografia da marca BC2C: Questrial (títulos) e Mulish (texto).
   Cantos chanfrados, herdados das letras da marca, na placa da logo e nos botões principais.
   Tema escuro (marinho) é o padrão; o claro usa os mesmos tokens.
   ===================================================================== */

:root,
:root[data-theme="dark"] {
  --bg: #0f1113;
  --surface: #17191c;
  --surface-2: #1f2226;
  --surface-3: #282b30;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #f4f4f5;
  --muted: #8b9099;
  --faint: #5c6168;
  --brand: #d1fe17;
  --brand-red: #d1fe17;
  --accent: #d1fe17;
  --accent-ink: #141600;
  --accent-soft: rgba(209, 254, 23, .1);
  --accent-text: #d1fe17;
  --link: #d1fe17;
  --nav-text: rgba(255, 255, 255, .55);
  --ok: #4ade80;   --ok-bg: rgba(74, 222, 128, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --bad: #f87171;  --bad-bg: rgba(248, 113, 113, .13);
  --info: #7cb4ff; --info-bg: rgba(124, 180, 255, .12);
  --idle: #a1a1aa; --idle-bg: rgba(255, 255, 255, .06);
  --p1: #f87171; --p2: #fb923c; --p3: #fbbf24; --p4: #8b9099;
  --chart-a: #4b5059;
  --star: #fbbf24;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
  --backdrop: rgba(5, 6, 8, .7);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --surface-3: #e7e7e3;
  --border: rgba(17, 18, 20, .08);
  --border-strong: rgba(17, 18, 20, .16);
  --text: #111214;
  --muted: #5f636b;
  --faint: #9a9da3;
  --brand: #3d5a00;
  --brand-red: #3d5a00;
  --accent: #d1fe17;
  --accent-ink: #141600;
  --accent-soft: rgba(150, 190, 0, .14);
  --accent-text: #3d5a00;
  --link: #3d5a00;
  --nav-text: #5f636b;
  --ok: #15803d;   --ok-bg: #e3f5e9;
  --warn: #a16207; --warn-bg: #fdf3d7;
  --bad: #c0262d;  --bad-bg: #fde7e7;
  --info: #1d5fd1; --info-bg: #e5eefe;
  --idle: #52555c; --idle-bg: #ececea;
  --p1: #c0262d; --p2: #c2410c; --p3: #a16207; --p4: #6b6f76;
  --chart-a: #c9cbc6;
  --star: #d97706;
  --shadow: 0 1px 2px rgba(17, 18, 20, .05), 0 4px 16px rgba(17, 18, 20, .05);
  --backdrop: rgba(17, 18, 20, .45);
  color-scheme: light;
}

:root {
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Mulish", "Century Gothic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Questrial", "Century Gothic", "Mulish", ui-sans-serif, system-ui, sans-serif;
  --chamfer: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  --nav-w: 236px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }

h1 { font-family: var(--display); font-size: 26px; line-height: 1.15; margin: 0 0 6px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
h2 { font-family: var(--display); font-size: 17px; margin: 0 0 12px; font-weight: 400; letter-spacing: .01em; }
h3 { font-size: 11px; margin: 0 0 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.nowrap { white-space: nowrap; }
.icon { display: inline-block; vertical-align: -3px; flex: none; }

/* ---------------------------------------------------------------------
   Estrutura: menu lateral fixo + coluna de conteúdo (barra superior + página)
   --------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.appnav { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.02em; text-transform: uppercase; line-height: 1; }
.brand-name small { display: block; font-family: var(--font); font-size: 11px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted); margin-top: 3px; }
.nav-group { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--nav-text); font-weight: 500; position: relative; }
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.active { color: var(--accent-text); background: var(--accent-soft); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-red); }
.nav-link .pill { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; }
.nav-foot { margin-top: auto; padding-top: 16px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; max-width: 460px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; background: var(--surface); border-color: var(--border); height: 38px; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn { position: relative; background: none; border: 0; color: var(--muted); width: 38px; height: 38px; border-radius: var(--radius-sm); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; margin-left: 4px; border-radius: 999px; font-size: 13px; }
.user-chip .who { line-height: 1.15; }
.user-chip .who small { display: block; color: var(--muted); font-size: 11px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--text); font-family: var(--display); }
.menu-btn { display: none; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); flex: 1; }
.shell.no-side { grid-template-columns: minmax(0, 1fr); }
.main { padding: 28px 28px 56px; min-width: 0; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p.muted { max-width: 72ch; }

/* Painel de pastas da fila (secundário) */
.sidebar { background: transparent; border-right: 1px solid var(--border); padding: 20px 10px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.sidebar h4 { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 16px 10px 6px; }
.sidebar h4:first-child { margin-top: 0; }
.sidebar a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--nav-text); }
.sidebar a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sidebar .count { font-size: 11px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.sidebar .count.bad { color: var(--bad); }
.sidebar .count.warn { color: var(--warn); }

/* ---------------------------------------------------------------------
   Cartões, grades e indicadores
   --------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }

.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.counter { display: flex; flex-direction: column; justify-content: space-between; min-height: 104px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; color: var(--text); transition: border-color .15s, transform .15s; }
.counter:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.counter .lbl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.counter .val { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.counter .val small { font-family: var(--font); font-size: 13px; color: var(--faint); font-weight: 500; letter-spacing: 0; }
.counter.bad .lbl::before, .counter.warn .lbl::before, .counter.info .lbl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.counter.bad { --c: var(--bad); } .counter.warn { --c: var(--warn); } .counter.info { --c: var(--info); }
.counter.bad.hot { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.counter.bad.hot .val { color: var(--bad); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { margin: 0; padding: 14px 16px; }
.kpi-value { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi.bad .kpi-value { color: var(--bad); }
.kpi.warn .kpi-value { color: var(--warn); }

.effort { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.effort .val { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Tabelas
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; background: transparent; margin: 0 -18px -18px; }
.card .table-wrap table th:first-child, .card .table-wrap table td:first-child { padding-left: 18px; }
.card .table-wrap table th:last-child, .card .table-wrap table td:last-child { padding-right: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.check-col { width: 36px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------------------------------------------------------------------
   Selos, prioridade, alertas
   --------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--idle-bg); color: var(--idle); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.prio { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.prio-1 { color: var(--p1); } .prio-2 { color: var(--p2); } .prio-3 { color: var(--p3); } .prio-4 { color: var(--p4); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; display: flex; gap: 10px; align-items: center; border: 1px solid transparent; }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* ---------------------------------------------------------------------
   Formulários e botões
   --------------------------------------------------------------------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
label.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.field .hint { font-weight: 400; color: var(--faint); font-size: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; transition: border-color .15s, background .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-text); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239fb3d1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.btn { font: inherit; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 160px; background: var(--surface); border-color: var(--border); }

/* Abas: pílulas */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; padding: 4px; background: var(--surface-2); border-radius: 12px; width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 7px 14px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-radius: 9px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); font-weight: 600; }
.card > .tabs { margin-top: -2px; }

/* ---------------------------------------------------------------------
   Conversa e linha do tempo
   --------------------------------------------------------------------- */
.timeline { display: grid; gap: 10px; }
.msg { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.msg.internal { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.msg.system { background: transparent; border-style: dashed; }
.msg.requester { border-left: 3px solid var(--info); }
.msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg-head strong { color: var(--text); }

.tl { display: grid; gap: 10px; position: relative; }
.tl::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; position: relative; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); display: grid; place-items: center; z-index: 1; }
.tl-event { padding: 6px 2px; }
.tl-event .msg-head { margin: 0; }
.tl-event .pre { font-size: 13px; color: var(--muted); }
.tl-alert .tl-dot { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.tl-alert .msg-head strong, .tl-alert .msg-head span { color: var(--bad); }
.tl-forward .tl-dot { border-color: var(--info); color: var(--info); }
.tl-time .tl-dot { border-color: var(--ok); color: var(--ok); }
.tl-comment .tl-dot, .tl-trigger .tl-dot { border-color: var(--accent-text); color: var(--accent-text); }
.tl-note .tl-dot { border-color: var(--warn); color: var(--warn); }

.props { display: grid; grid-template-columns: 112px 1fr; gap: 10px 12px; font-size: 13px; align-items: center; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; min-width: 0; }

.sla-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.sla-box + .sla-box { margin-top: 8px; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 8px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); } .bar.idle > i { background: var(--idle); }

/* ---------------------------------------------------------------------
   Gráficos simples
   --------------------------------------------------------------------- */
.chart-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; height: 170px; padding-top: 10px; }
.chart-bars .day { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; }
.chart-bars .pair { display: flex; gap: 3px; align-items: end; justify-content: center; }
.chart-bars .pair i { width: 14px; border-radius: 4px 4px 1px 1px; min-height: 3px; }
.chart-bars .lbl { font-size: 11px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
.vbars { min-width: 120px; display: grid; gap: 3px; }
.vbar { height: 6px; border-radius: 3px; min-width: 2px; }
.vbar.opened { background: var(--chart-a); }
.vbar.resolved { background: var(--accent); }
.legend.opened, .legend.resolved { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.legend.opened { background: var(--chart-a); }
.legend.resolved { background: var(--accent); }

table.matrix th, table.matrix td { padding: 7px 7px; font-size: 12px; white-space: nowrap; }
table.matrix .off { background: var(--surface-2); color: var(--faint); }
table.matrix td.below { color: var(--bad); font-weight: 600; }
table.matrix .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; }

/* ---------------------------------------------------------------------
   Portal, base de conhecimento, login
   --------------------------------------------------------------------- */
.kb-results { display: grid; gap: 10px; }
.kb-item { display: block; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.kb-item:hover { border-color: var(--border-strong); text-decoration: none; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent-text); text-decoration: none; transform: translateY(-2px); }
.tile strong { font-family: var(--display); font-size: 16px; letter-spacing: -.01em; }
.hero { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px; margin-bottom: 20px; }
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none; }
.hero h1 { font-size: 34px; max-width: 18ch; }
.hero input { margin-top: 16px; font-size: 15px; padding: 14px 16px; max-width: 560px; position: relative; z-index: 1; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.login-art { position: relative; overflow: hidden; background: #0f1113; color: #f4f4f5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; inset: auto -20% -40% -10%; height: 80%; background: radial-gradient(closest-side, rgba(209, 254, 23, .16), transparent 70%); }
.login-art .claim { position: relative; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -.03em; font-size: clamp(36px, 5vw, 64px); line-height: .95; max-width: 11ch; }
.login-art .claim em { font-style: normal; color: #d1fe17; }
.login-art .sub { position: relative; color: #9fb3d1; max-width: 42ch; margin-top: 18px; }
.login-art .brand { padding: 0; color: #eef3fb; }
.login-side { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.login { width: 100%; max-width: 380px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.login h1 { font-size: 22px; }
.form > .btn { justify-content: center; padding-top: 10px; padding-bottom: 10px; }

/* ---------------------------------------------------------------------
   Avisos, diálogos
   --------------------------------------------------------------------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--surface-3); color: var(--text); padding: 12px 16px 12px 14px; border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  max-width: 380px; border-left: 3px solid var(--accent); font-weight: 500; animation: toast-in .2s ease-out; }
.toast.error { border-left-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.dialog-backdrop { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; border-radius: 18px; padding: 22px; border-color: var(--border-strong); }
.dialog h2 { font-size: 18px; text-transform: uppercase; letter-spacing: -.01em; }

/* ---------------------------------------------------------------------
   Componentes de recursos (anexos, fila, pesquisa, calendário)
   --------------------------------------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-picker { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-picker label.btn { cursor: pointer; }
.file-picker label.btn:focus-within { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; color: var(--text); background: var(--surface); }
.attachment:hover { border-color: var(--accent-text); text-decoration: none; }

.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); }
.bulk-bar .btn { background: rgba(0, 0, 0, .1); border-color: transparent; color: var(--accent-ink); }
.bulk-bar .btn:hover { background: rgba(0, 0, 0, .18); }
.column-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }

.stars { display: flex; gap: 6px; }
.stars button { font-size: 30px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--surface-3); padding: 2px; transition: color .1s, transform .1s; }
.stars button:hover { transform: scale(1.1); }
.stars button.on { color: var(--star); }
.stars-view { color: var(--star); }
.survey-page { max-width: 480px; margin: 56px auto; padding: 0 16px; }

.cal-item { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); margin-top: 8px; cursor: pointer; background: var(--surface-2); }
.cal-item:hover { border-color: var(--border-strong); border-left-color: var(--accent); }
.cal-item.conflict { border-left-color: var(--bad); }
.cal-time { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Responsivo
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .detail-grid, .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art { padding: 24px; gap: 18px; }
  .login-art .claim { font-size: clamp(28px, 6vw, 40px); max-width: 16ch; }
  .login-art .sub { margin-top: 10px; }
  .login-art > .sub.small { display: none; }
  .login-side { place-items: start center; padding-top: 28px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .appnav { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .app.nav-open .appnav { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: var(--backdrop); z-index: 30; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  .user-chip .who { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 16px; }
  .sidebar h4 { width: 100%; margin: 6px 4px 0; }
  .main { padding: 20px 16px 40px; }
  h1 { font-size: 22px; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .search { display: none; }
  .counter .val { font-size: 28px; }
  .cal-item { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Fila de chamados: densa, título com espaço para respirar */
table.queue td { font-size: 13px; padding: 9px 10px; }
table.queue th { padding: 10px 10px; }
table.queue td.col-title { min-width: 240px; font-weight: 500; }
table.queue td:first-child, table.queue th:first-child { padding-left: 14px; }

/* ---------------------------------------------------------------------
   Agilidade: paleta, chips, cronômetro, ditado
   --------------------------------------------------------------------- */
.dialog.dialog-wide { max-width: 680px; }
.palette-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); text-transform: uppercase; letter-spacing: -.01em; }
.palette-head .kbd, .palette-head .badge { margin-left: auto; }
.palette-head .icon { color: var(--accent-text); }
.palette-input { font-size: 17px; padding: 14px 16px; background: var(--surface-2); }
.with-mic { position: relative; }
.with-mic input, .with-mic textarea { padding-right: 46px; }
.mic-btn { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.mic-btn:hover { color: var(--text); }
.mic-btn.on { background: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; max-width: 100%; text-align: left; }
.chip:hover { border-color: var(--accent-text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.on .muted { color: inherit; opacity: .7; }
.kbd { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font-family: var(--font); }
.btn .kbd { background: rgba(0, 0, 0, .12); border-color: transparent; color: inherit; }
.timer-chip { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px; }
.timer-chip a { color: var(--text); font-weight: 600; }
.timer-chip .time { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); min-width: 66px; }
.timer-chip .icon-btn { width: 30px; height: 30px; }
.timer-chip .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s infinite; }
.timer-running { border-color: var(--accent-text) !important; }

/* ---------------------------------------------------------------------
   Gamificação: pódio, conquistas, placar
   --------------------------------------------------------------------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.podium .place { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.podium .place.p1 { order: 2; border-color: var(--accent-text); padding-top: 28px; background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.podium .place.p2 { order: 1; } .podium .place.p3 { order: 3; }
.podium .pos { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--muted); }
.podium .p1 .pos { color: var(--accent-text); }
.podium .who { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 8px 0 2px; }
.podium .pts { font-family: var(--display); font-weight: 700; font-size: 36px; letter-spacing: -.03em; line-height: 1; }
.podium .p1 .pts { color: var(--accent-text); font-size: 44px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-ach { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--faint); border: 1px dashed var(--border-strong); }
.badge-ach.earned { background: var(--accent-soft); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent-text) 35%, transparent); }
.score-me { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.score-me .val { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.mini-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.mini-bar > i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 700px) { .podium { grid-template-columns: 1fr; } .podium .place { order: 0 !important; } }

/* ---------------------------------------------------------------------
   Marca BC2C: logo na versão para fundo escuro; no tema claro, sobre placa marinho chanfrada
   --------------------------------------------------------------------- */
.brand-plate { background: transparent; display: grid; place-items: center; flex: none; }
:root[data-theme="light"] .appnav .brand-plate, :root[data-theme="light"] .survey-page .brand-plate { background: #0f1113; clip-path: var(--chamfer); }
.brand-plate img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand .brand-plate { width: 78px; height: 54px; padding: 4px 5px; }
.login-art .brand .brand-plate { width: 150px; height: 96px; padding: 0; }
.survey-page .brand-plate { width: 124px; height: 84px; padding: 6px 8px; margin-bottom: 16px; }
.brand-name { font-weight: 400; letter-spacing: .06em; font-size: 16px; }
.btn.primary { clip-path: var(--chamfer); border-radius: 0; }
.btn.primary.small { --chamfer: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.counter .val, .kpi-value, .effort .val, .podium .pts, .score-me .val { font-weight: 400; letter-spacing: 0; }
.dot, .nav-link .pill { background: var(--accent); color: var(--accent-ink); }
.palette-head, .dialog h2 { letter-spacing: .04em; }
/* Questrial só tem peso 400: sem negrito sintético nos textos de destaque */
.login-art .claim, .brand-name, .counter .val, .podium .who, .tile strong, .cal-time, .timer-chip .time, .avatar { font-weight: 400; }
.login-art .claim { letter-spacing: .01em; }

/* Impressão da fatura (Imprimir / PDF): só o conteúdo, fundo claro. */
.print-only { display: none; }
.print-head { align-items: center; gap: 20px; margin-bottom: 16px; }
.print-head h1 { margin: 0; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #111 !important; }
  .topbar, .sidebar, .no-print, .toast-host { display: none !important; }
  .app, .shell, .layout { display: block !important; }
  .main { padding: 0 !important; max-width: none !important; }
  .print-only { display: flex !important; }
  .print-head img { height: 48px; background: #0f1113; padding: 8px 12px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; background: #fff !important; break-inside: avoid; clip-path: none !important; }
  .card, .card * { color: #111 !important; }
  a { color: #111 !important; text-decoration: none !important; }
}
