/* =========================================================
   WBF BACKOFFICE — Design System
   Herdado do portal WBF Connect: Switzer · Geist · Space Mono,
   #141414 / #f4f4f4 / #8c8c8c + Ouro WBF #c9a24a. Sem cantos
   arredondados, linhas finas, etiquetas mono em maiúsculas.
   ========================================================= */
:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --ink: #141414;
  --ink-2: #5c5c5c;
  --mute: #8c8c8c;
  --line: rgba(20, 20, 20, .1);
  --line-2: rgba(20, 20, 20, .16);
  --dark: #141414;
  --dark-2: #1c1c1c;
  --cream: #f5f3ee;
  --cream-72: rgba(245, 243, 238, .72);
  --cream-50: rgba(245, 243, 238, .5);
  --cream-12: rgba(245, 243, 238, .12);
  --cream-06: rgba(245, 243, 238, .06);
  --gold: #c9a24a;
  --gold-light: #ecd593;
  --gold-deep: #76581a;
  --gold-08: rgba(201, 162, 74, .08);
  --gold-grad: linear-gradient(100deg, #8a6a24 0%, #d8b962 22%, #f3e4b4 48%, #c9a24a 70%, #8a6a24 100%);
  --live: #e5484d;
  --ok: #2f8a4c;
  --warn: #b7791f;

  --f-display: "Switzer", "Geist", system-ui, -apple-system, sans-serif;
  --f-body: "Geist", system-ui, -apple-system, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;

  --side: 256px;
  --top: 64px;
  --pad: 32px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--gold); color: var(--ink); }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Tipografia ---------- */
.label {
  font-family: var(--f-mono); font-size: 11px; line-height: 1.4; letter-spacing: .06em;
  text-transform: uppercase; color: var(--mute); display: inline-flex; align-items: center; gap: 8px;
}
.label--gold { color: var(--gold); }
.label--ink { color: var(--ink); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot--gold { background: var(--gold); }
.dot--live { background: var(--live); animation: pulse 1.8s infinite; }
.dot--ok { background: var(--ok); }
.dot--pulse-gold { background: var(--gold); animation: pulseGold 2s infinite; }
@keyframes pulseGold { 0% { box-shadow: 0 0 0 0 rgba(201, 162, 74, .6); } 70% { box-shadow: 0 0 0 9px rgba(201, 162, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(201, 162, 74, 0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
.h1, .h2, .h3, .h4 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
.h1 { font-size: clamp(34px, 3.6vw, 52px); line-height: 1.02; }
.h2 { font-size: clamp(26px, 2.4vw, 36px); line-height: 1.05; }
.h3 { font-size: 24px; letter-spacing: -0.035em; line-height: 1.1; }
.h4 { font-size: 18px; letter-spacing: -0.03em; line-height: 1.2; }
.g { color: var(--mute); }
.small { font-size: 13px; color: var(--ink-2); }
.mute { color: var(--mute); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; }
.gold { color: var(--gold); }
.gold-text { background: var(--gold-grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: goldShift 6s linear infinite; }
@keyframes goldShift { to { background-position: 200% 0; } }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Botões ---------- */
.btn {
  --b-bg: var(--ink); --b-fg: #fff; --b-bd: var(--ink);
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 38px; padding: 0 16px; background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; isolation: isolate;
  transition: color .5s var(--ease), border-color .5s var(--ease), transform .16s ease-out;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--gold); transform: translateY(101%); transition: transform .6s var(--ease); }
@media (hover: hover) { .btn:hover::before { transform: translateY(0); } .btn:hover { color: var(--ink); border-color: var(--gold); } }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .arr { display: inline-block; transition: transform .5s var(--ease); }
.btn:hover .arr { transform: translate(2px, -2px); }
.btn--outline { --b-bg: transparent; --b-fg: var(--ink); --b-bd: var(--line-2); }
.btn--gold { --b-bg: var(--gold); --b-fg: var(--ink); --b-bd: var(--gold); }
.btn--gold::before { background: var(--ink); }
@media (hover: hover) { .btn--gold:hover { color: var(--gold-light); border-color: var(--ink); } }
.btn--danger { --b-bg: transparent; --b-fg: var(--live); --b-bd: rgba(229, 72, 77, .4); }
.btn--danger::before { background: var(--live); }
@media (hover: hover) { .btn--danger:hover { color: #fff; border-color: var(--live); } }
.btn--light { --b-bg: var(--cream); --b-fg: var(--ink); --b-bd: var(--cream); }
.btn--ghost-light { --b-bg: transparent; --b-fg: var(--cream); --b-bd: var(--cream-12); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 10px; gap: 6px; }
.btn--lg { height: 48px; padding: 0 22px; }
.btn--block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid transparent; color: var(--ink-2); transition: border-color .3s, color .3s, background .3s; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.link { border-bottom: 1px solid var(--line-2); transition: border-color .3s, color .3s; }
.link:hover { border-color: var(--gold); color: var(--gold-deep); }

/* ---------- Chips & estados ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border: 1px solid var(--line-2);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
  transition: color .3s, background .3s, border-color .3s;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip--gold { border-color: rgba(201, 162, 74, .5); color: var(--gold-deep); background: var(--gold-08); }
.chip--ok { border-color: rgba(47, 138, 76, .35); color: var(--ok); background: rgba(47, 138, 76, .06); }
.chip--warn { border-color: rgba(183, 121, 31, .4); color: var(--warn); background: rgba(183, 121, 31, .07); }
.chip--bad { border-color: rgba(229, 72, 77, .4); color: var(--live); background: rgba(229, 72, 77, .06); }
.chip--dark { background: var(--ink); color: var(--gold-light); border-color: var(--ink); }
.chip--mute { color: var(--mute); }
.swatch { width: 10px; height: 10px; display: inline-block; flex: none; }

/* ---------- Formulários ---------- */
.input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--surface); outline: none; width: 100%;
  font-size: 14px; transition: border-color .3s, box-shadow .3s; border-radius: 0;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-08); }
textarea.input { height: auto; padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input--sm { height: 32px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .label { color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--mute); }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__ui { width: 34px; height: 20px; background: var(--line-2); position: relative; transition: background .3s; flex: none; }
.toggle__ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: #fff; transition: transform .35s var(--ease); }
.toggle input:checked + .toggle__ui { background: var(--ink); }
.toggle input:checked + .toggle__ui::after { transform: translateX(14px); background: var(--gold); }
.toggle input:focus-visible + .toggle__ui { outline: 2px solid var(--gold); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--ink); width: 15px; height: 15px; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; }
.multi label { position: relative; }
.multi input { position: absolute; opacity: 0; }
.multi span { display: inline-flex; height: 28px; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; transition: all .25s; }
.multi input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.multi input:focus-visible + span { outline: 2px solid var(--gold); }

/* ---------- Estrutura da app ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--dark); color: var(--cream-72);
  display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--cream-12) transparent; z-index: 40;
}
.side__brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; border-bottom: 1px solid var(--cream-06); }
.side__brand img { height: 20px; width: auto; }
.side__brand span { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--cream-50); padding-left: 12px; border-left: 1px solid var(--cream-12); line-height: 1.2; }
.side__nav { padding: 12px 12px 24px; flex: 1; }
.side__group { margin-top: 18px; }
.side__group > .label { color: var(--cream-50); padding: 0 10px 8px; font-size: 10px; }
.side__link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px;
  font-family: var(--f-display); font-weight: 500; font-size: 13.5px; letter-spacing: -0.01em; color: var(--cream-72);
  transition: color .3s, background .3s;
}
.side__link svg { width: 16px; height: 16px; opacity: .7; flex: none; }
.side__link:hover { color: var(--cream); background: var(--cream-06); }
.side__link.is-active { color: var(--cream); background: var(--cream-06); }
.side__link.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--gold); }
.side__link.is-active svg { opacity: 1; color: var(--gold); }
.side__count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-family: var(--f-mono); font-size: 10px; }
.side__foot { padding: 16px 22px 22px; border-top: 1px solid var(--cream-06); }
.side__portal { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-50); }
.side__portal:hover { color: var(--gold-light); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 var(--pad);
  background: rgba(244, 244, 244, .86); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--line-2); }
.top__search { position: relative; width: min(320px, 32vw); }
.top__search .input { height: 36px; padding-left: 34px; background: var(--surface); }
.top__search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--mute); }
.top__search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 10px; color: var(--mute); border: 1px solid var(--line-2); padding: 1px 5px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 1px solid transparent; transition: border-color .3s; }
.me:hover { border-color: var(--line-2); }
.me__txt { line-height: 1.2; text-align: left; }
.me__txt b { display: block; font-weight: 500; font-size: 13px; }
.menu-btn { display: none; }

.page { padding: 32px var(--pad) 80px; max-width: 1480px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .label { margin-bottom: 12px; }
.page-head p.small { margin-top: 10px; max-width: 64ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Superfícies ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel__body { padding: 20px; }
.panel__body--flush { padding: 0; }
.panel + .panel, .stack > * + * { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* KPIs (mesma linguagem do portal) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.kpi { padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; min-height: 124px; position: relative; transition: background .3s; }
a.kpi:hover { background: #fbfaf7; }
a.kpi:hover .kpi__arr { color: var(--gold); transform: translate(2px, -2px); }
.kpi__arr { position: absolute; right: 16px; top: 16px; color: var(--mute); transition: transform .4s var(--ease), color .3s; font-size: 13px; }
.kpi__num { font-family: var(--f-display); font-weight: 500; font-size: 40px; letter-spacing: -0.05em; line-height: .95; margin-top: auto; font-variant-numeric: tabular-nums; }
.kpi__num small { font-size: 16px; color: var(--mute); letter-spacing: -0.02em; margin-left: 4px; }
.kpi--alert .kpi__num { color: var(--gold-deep); }

/* barra de progresso */
.bar { height: 4px; background: var(--line); position: relative; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); transform-origin: left; transition: transform .9s var(--ease); }
.bar--gold > i { background: var(--gold); }

/* ---------- Tabelas ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input { height: 34px; font-size: 13px; }
.toolbar__search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar__search .input { padding-left: 32px; }
.toolbar__search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--mute); }
.toolbar select.input { width: auto; min-width: 140px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-family: var(--f-mono); font-weight: 400; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); white-space: nowrap; background: #fbfbfb; position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th .sort { opacity: .6; margin-left: 4px; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: #fbfaf7; }
.table tbody tr.is-click { cursor: pointer; }
.table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table .t-title { font-weight: 500; color: var(--ink); }
.table .t-sub { font-size: 12px; color: var(--mute); margin-top: 2px; }
.table--compact th, .table--compact td { padding: 9px 12px; }
.table input[type=checkbox] { accent-color: var(--ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.empty { padding: 48px 24px; text-align: center; color: var(--mute); }
.empty .h4 { color: var(--ink); margin-bottom: 8px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--ink); color: var(--cream); }
.bulkbar .label { color: var(--gold-light); }

.avatar { --s: 32px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--dark); color: var(--gold-light); font-family: var(--f-display); font-weight: 500; font-size: calc(var(--s) * .38); letter-spacing: -0.02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sq { border-radius: 0; }
.avatar--lg { --s: 56px; }
.thumb { width: 56px; height: 40px; object-fit: cover; background: var(--line); flex: none; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; transition: color .3s; }
.tab:hover, .tab.is-active { color: var(--ink); }
.tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); }
.tab .n { font-size: 10px; color: var(--mute); }

/* ---------- Painel lateral (drawer) & modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 20, 20, .38); z-index: 80; opacity: 0; transition: opacity .3s ease; }
.scrim.is-open { opacity: 1; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(640px, 100vw); background: var(--bg); z-index: 90;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .45s var(--ease);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .35);
}
.drawer.is-open { transform: none; }
.drawer--wide { width: min(880px, 100vw); }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer__foot { display: flex; justify-content: space-between; gap: 8px; padding: 14px 28px; border-top: 1px solid var(--line); background: var(--surface); }
.modal { position: fixed; left: 50%; top: 50%; z-index: 95; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); transform: translate(-50%, -48%) scale(.97); opacity: 0; transition: transform .3s var(--ease), opacity .2s ease; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .45); }
.modal.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.modal--wide { width: min(860px, calc(100vw - 32px)); }
.modal__body { padding: 28px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 28px; border-top: 1px solid var(--line); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: var(--cream); padding: 12px 16px; min-width: 260px; max-width: 380px; display: flex; gap: 12px; align-items: flex-start; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); border-left: 2px solid var(--gold); animation: toastIn .4s var(--ease); }
.toast--bad { border-left-color: var(--live); }
.toast b { display: block; font-weight: 500; }
.toast span { font-size: 13px; color: var(--cream-72); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login__media { position: relative; background: var(--dark) center / cover no-repeat; color: var(--cream); display: flex; flex-direction: column; justify-content: space-between; padding: 36px; overflow: hidden; }
.login__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 20, 20, .5) 0%, rgba(20, 20, 20, .3) 40%, rgba(20, 20, 20, .9) 100%); }
.login__media > * { position: relative; z-index: 1; }
.login__media img.logo { height: 26px; width: auto; align-self: flex-start; }
.login__media .h1 { max-width: 13ch; }
.login__media .h1 .g { color: rgba(245, 243, 238, .5); }
.login__form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); max-width: 620px; }
.login__form form { display: grid; gap: 16px; margin-top: 32px; }
.login__err { color: var(--live); font-size: 13px; min-height: 20px; }

/* ---------- Eventos ---------- */
.ev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ev-card { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; transition: border-color .4s; }
.ev-card:hover { border-color: var(--line-2); }
.ev-card:hover .ev-card__img img { transform: scale(1.04); }
.ev-card__img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--dark); position: relative; }
.ev-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.ev-card__img .chip { position: absolute; left: 12px; top: 12px; background: rgba(20, 20, 20, .7); color: var(--cream); border-color: transparent; backdrop-filter: blur(6px); }
.ev-card__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ev-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: auto; }
.ev-card__stats div { padding: 12px 18px; border-right: 1px solid var(--line); }
.ev-card__stats div:last-child { border-right: 0; }
.ev-card__stats b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 20px; letter-spacing: -0.03em; }
.ev-hero { position: relative; min-height: 220px; background: var(--dark) center / cover; color: var(--cream); padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 24px; overflow: hidden; }
.ev-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 20, 20, .88) 0%, rgba(20, 20, 20, .5) 60%, rgba(20, 20, 20, .42) 100%); }
.ev-hero > * { position: relative; z-index: 1; }
.ev-hero .h1 .g { color: rgba(245, 243, 238, .5); }

/* matriz de acessos */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix td { padding: 8px; }
.cell-toggle { width: 26px; height: 26px; border: 1px solid var(--line-2); display: inline-grid; place-items: center; transition: background .2s, border-color .2s; }
.cell-toggle svg { width: 13px; height: 13px; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); }
.cell-toggle.is-on { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.cell-toggle.is-on svg { opacity: 1; transform: none; }
.cell-toggle:hover { border-color: var(--ink); }
.cell-toggle[disabled] { cursor: default; opacity: .5; }
.matrix .group-row td { background: #fbfbfb; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); text-align: left; }

/* timeline do programa */
.timeline { display: flex; flex-direction: column; }
.tl-day { padding: 14px 20px; background: #fbfbfb; border-bottom: 1px solid var(--line); }
.tl-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: center; transition: background .2s; }
.tl-item:hover { background: #fbfaf7; }

/* ---------- Passe / crachá ---------- */
.pass {
  width: 100%; max-width: 360px; aspect-ratio: 380 / 600; background: var(--dark); color: var(--cream); position: relative; overflow: hidden;
  padding: 26px; display: flex; flex-direction: column; border: 1px solid rgba(201, 162, 74, .35); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5);
}
.pass::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(236, 213, 147, .18) 45%, rgba(255, 255, 255, .06) 50%, transparent 62%); pointer-events: none; }
.pass::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent, var(--gold)); }
.pass--vip { border-color: var(--gold); box-shadow: 0 40px 80px -30px rgba(201, 162, 74, .45); }
.pass__logo { height: 22px; width: auto; align-self: flex-start; }
.pass__event { margin-top: 22px; }
.pass__event .h3 { margin-top: 8px; color: var(--cream); }
.pass__event .small { color: var(--cream-72); margin-top: 6px; font-size: 12px; }
.pass__qr { margin-top: auto; background: #fff; padding: 12px; align-self: center; width: 58%; aspect-ratio: 1; display: grid; place-items: center; }
.pass__qr svg, .pass__qr img { width: 100% !important; height: auto !important; }
.pass__foot { margin-top: 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-top: 1px dashed var(--cream-12); padding-top: 12px; }
.pass__foot .label { color: var(--cream-50); }
.pass__foot .small { color: var(--cream-72); font-size: 12px; }
.pass__name { font-family: var(--f-display); font-weight: 500; font-size: 18px; letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; }
.pass__tier { color: var(--gold-light) !important; }
.pass .mono { color: var(--cream-72); font-size: 11px; margin-top: 4px; }
.pass-access li { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pass-page { background: var(--bg); }
.pass-page__wrap { min-height: 100vh; display: grid; grid-template-columns: auto minmax(0, 420px); gap: 48px; align-items: center; justify-content: center; padding: 40px 20px; }
.pass-page__info { max-width: 420px; }
.pass-page__actions { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }

/* crachás para impressão */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.badge-card { aspect-ratio: 86 / 120; background: var(--dark); color: var(--cream); padding: 18px; display: flex; flex-direction: column; position: relative; overflow: hidden; border-top: 6px solid var(--accent, var(--gold)); break-inside: avoid; }
.badge-card img.logo { height: 16px; width: auto; align-self: flex-start; }
.badge-card .cat { margin-top: 14px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-light); }
.badge-card .nm { font-family: var(--f-display); font-weight: 500; font-size: 22px; letter-spacing: -0.035em; line-height: 1.05; margin-top: 6px; }
.badge-card .org { font-size: 12px; color: var(--cream-72); margin-top: 4px; }
.badge-card .qr { margin-top: auto; background: #fff; padding: 8px; width: 46%; aspect-ratio: 1; align-self: flex-start; }
.badge-card .qr svg { width: 100%; height: auto; }
.badge-card .foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; font-family: var(--f-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-50); }

/* ---------- Check-in ---------- */
.ci { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 20px; }
.ci__scan { background: var(--dark); color: var(--cream); position: relative; overflow: hidden; }
.ci__video { position: relative; aspect-ratio: 4 / 3; background: #000; overflow: hidden; }
.ci__video video { width: 100%; height: 100%; object-fit: cover; }
.ci__frame { position: absolute; inset: 14%; border: 1px solid rgba(201, 162, 74, .7); pointer-events: none; }
.ci__frame::before, .ci__frame::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--gold); top: 0; box-shadow: 0 0 12px var(--gold); animation: scanline 2.4s ease-in-out infinite alternate; }
.ci__frame::after { display: none; }
@keyframes scanline { to { transform: translateY(calc(var(--h, 300px))); } }
.ci__idle { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--cream-72); }
.ci__controls { padding: 16px; display: grid; gap: 10px; border-top: 1px solid var(--cream-06); }
.ci__controls .input { background: var(--cream-06); border-color: var(--cream-12); color: var(--cream); }
.ci__controls .input::placeholder { color: var(--cream-50); }
.ci__controls select.input option { color: var(--ink); }
.ci-result { padding: 24px; min-height: 220px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); background: var(--surface); transition: background .3s, border-color .3s; }
.ci-result--ok { background: #eef7f0; border-color: rgba(47, 138, 76, .4); }
.ci-result--denied, .ci-result--invalid { background: #fdf0f0; border-color: rgba(229, 72, 77, .4); }
.ci-result--duplicate { background: #fbf4e8; border-color: rgba(183, 121, 31, .45); }
.ci-result__big { font-family: var(--f-display); font-weight: 500; font-size: 34px; letter-spacing: -0.045em; line-height: 1; }
.ci-result--ok .ci-result__big { color: var(--ok); }
.ci-result--denied .ci-result__big, .ci-result--invalid .ci-result__big { color: var(--live); }
.ci-result--duplicate .ci-result__big { color: var(--warn); }
.ci-result.flash { animation: flash .5s var(--ease); }
@keyframes flash { from { transform: scale(.98); } }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg button { height: 34px; padding: 0 14px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); transition: background .25s, color .25s; }
.seg button.is-active { background: var(--ink); color: #fff; }
.ci__scan .seg { border-color: var(--cream-12); }
.ci__scan .seg button { color: var(--cream-72); }
.ci__scan .seg button.is-active { background: var(--gold); color: var(--ink); }
.feed li { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; font-size: 13px; }

/* gráficos simples */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 64px; gap: 12px; align-items: center; font-size: 13px; }
.hbar .bar { height: 8px; }
.hbar b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbar__track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.vbar i { width: 100%; height: 100%; background: var(--ink); transform-origin: bottom; transform: scaleY(var(--v, 0)); transition: transform .9s var(--ease); }
.vbar i.alt { background: var(--gold); }
.vbar span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }

/* queue list */
.qlist li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); transition: background .2s; }
.qlist li:last-child a { border-bottom: 0; }
.qlist li a:hover { background: #fbfaf7; }
.qlist li a:hover .arr { color: var(--gold); transform: translate(2px, -2px); }
.qlist .arr { transition: transform .4s var(--ease), color .3s; color: var(--mute); }
.qlist .n { font-family: var(--f-display); font-weight: 500; font-size: 20px; letter-spacing: -0.03em; min-width: 32px; text-align: right; }
.qlist .n.zero { color: var(--line-2); }

.notice { padding: 14px 16px; border: 1px solid rgba(201, 162, 74, .45); background: var(--gold-08); font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.notice b { color: var(--ink); font-weight: 500; }
.code-block { background: var(--dark); color: var(--gold-light); font-family: var(--f-mono); font-size: 12px; padding: 14px 16px; overflow-x: auto; white-space: pre; line-height: 1.6; }

.skeleton { background: linear-gradient(90deg, #ececec 0%, #f7f7f7 50%, #ececec 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

.cmdk { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); background: var(--surface); z-index: 110; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); }
.cmdk .input { height: 52px; border: 0; border-bottom: 1px solid var(--line); font-size: 16px; box-shadow: none; }
.cmdk ul { max-height: 50vh; overflow-y: auto; }
.cmdk li a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.cmdk li a.is-sel, .cmdk li a:hover { background: #fbfaf7; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .ev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --pad: 16px; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .4s var(--ease); }
  .side.is-open { transform: none; box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .5); }
  .menu-btn { display: inline-grid; }
  .top__search { display: none; }
  .me__txt { display: none; }
  .grid-main, .grid-2, .grid-3, .ci { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login__media { min-height: 260px; }
  .pass-page__wrap { grid-template-columns: 1fr; justify-items: center; }
  .page { padding-top: 22px; }
}
@media (max-width: 640px) {
  .ev-grid, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi__num { font-size: 32px; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .hbar { grid-template-columns: 1fr 64px; }
  .hbar .bar { grid-column: 1 / -1; order: 3; }
  .drawer__head, .drawer__body, .drawer__foot { padding-left: 18px; padding-right: 18px; }
  .page-head { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Impressão ---------- */
@media print {
  body { background: #fff; }
  .side, .top, .page-head .page-actions, .no-print, .toolbar, .pager, .tabs { display: none !important; }
  .app { display: block; }
  .page { padding: 0; }
  .badges { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .badge-card, .pass { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none; }
  .pass-page__wrap { display: block; }
  .pass-page__actions { display: none; }
}

/* ícones em linha */
.btn svg, .label svg, .chip svg, .side__portal svg, .seg svg { width: 14px; height: 14px; flex: none; }
.btn--sm svg { width: 12px; height: 12px; }
.notice > svg { width: 18px; height: 18px; flex: none; color: var(--gold-deep); margin-top: 1px; }
.ci__idle svg { width: 40px; height: 40px; margin: 0 auto; color: var(--gold); }
.matrix td:first-child { min-width: 220px; }
.matrix th { white-space: nowrap; }
