:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a;
  --text: #e7e3d8; --muted: #9a9688; --gold: #d4a537; --gold2: #f0c75e;
  --ok: #3fb37f; --warn: #e0a030; --bad: #e05252; --off: #6b6f7a;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

header.top { border-bottom: 1px solid var(--line); background: #12141a; position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { font-family: "Cinzel", Georgia, serif; font-weight: 700; color: var(--gold); letter-spacing: .5px; font-size: 18px; }
.brand small { color: var(--muted); font-family: inherit; font-weight: 400; letter-spacing: 0; margin-left: 6px; font-size: 13px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
nav a:hover, nav a.on { color: var(--text); background: var(--panel2); text-decoration: none; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 12px; text-align: center; margin-left: 4px; }

h1 { font-family: "Cinzel", Georgia, serif; color: var(--gold); font-size: 24px; margin: 28px 0 4px; }
h2 { font-size: 16px; margin: 32px 0 12px; color: var(--text); text-transform: uppercase; letter-spacing: 1px; }
.sub { color: var(--muted); margin: 0 0 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .v.gold { color: var(--gold2); }
.kpi .h { color: var(--muted); font-size: 13px; margin-top: 2px; }
.bar { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: var(--panel2); }
td.n, th.n { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1b1f27; }
td.wrap-ok { white-space: normal; min-width: 180px; }

.st { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.st-em-dia { background: rgba(63,179,127,.15); color: var(--ok); }
.st-pendente { background: rgba(224,160,48,.15); color: var(--warn); }
.st-atrasado { background: rgba(224,82,82,.15); color: var(--bad); }
.st-inativo { background: rgba(107,111,122,.2); color: var(--off); }
.st-confirmado { background: rgba(63,179,127,.15); color: var(--ok); }
.st-recusado { background: rgba(224,82,82,.15); color: var(--bad); }
.voc { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.toolbar .grow { flex: 1; }
input, select, button, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
button, .btn { cursor: pointer; background: var(--gold); color: #1a1407; border: 0; font-weight: 600; padding: 8px 14px;
  border-radius: 8px; display: inline-block; }
button:hover, .btn:hover { background: var(--gold2); text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.ghost:hover { border-color: var(--gold); }
button.danger { background: transparent; color: var(--bad); border: 1px solid rgba(224,82,82,.4); padding: 4px 10px; }
form.inline { display: inline; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 16px; align-items: end; }
.grid-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }

.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed .t { color: var(--muted); font-size: 12px; }
.ev-entrou { color: var(--ok); } .ev-saiu { color: var(--bad); } .ev-level { color: var(--gold2); }
.ev-rank, .ev-voltou, .ev-renomeado { color: #7fb2ff; }
.muted { color: var(--muted); }
.notice { background: rgba(212,165,55,.1); border: 1px solid rgba(212,165,55,.35); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }

.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login .panel { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin-top: 0; }
.error { color: var(--bad); }
.spark { width: 100%; height: 60px; }
