:root {
  --black: #000000;
  --canopy: #3aa52a;
  --moss: #0c3a08;
  --paper: #ffffff;
  --sprout: #8fe36b;
  --fern: #3f7d34;
  --amber: #f2c14e;
  --coral: #ff8a6b;
  --over: #e8590c;
  --ink: rgba(255, 255, 255, 0.96);
  --ink-2: rgba(255, 255, 255, 0.66);
  --ink-3: rgba(255, 255, 255, 0.44);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --r-pill: 999px;
  --r-panel: 28px;
  --r-inner: 18px;
  --font: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--black);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(118deg, transparent 22%, rgba(255, 255, 255, 0.07) 30%, transparent 38%),
    linear-gradient(118deg, transparent 40%, rgba(255, 255, 255, 0.04) 46%, transparent 52%),
    radial-gradient(130% 70% at 25% -18%, #4cc436 0%, #1f8a17 18%, #0a4a07 36%, #031a03 52%, #000 68%);
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sprout); outline-offset: 2px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  flex-wrap: wrap;
}
.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.mark svg { width: 40px; height: 40px; }
.topbar .spacer { flex: 1; }

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--paper); color: #000; }

.glass-btn, .white-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-pill);
  padding: 10px 18px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  white-space: nowrap;
}
.glass-btn:hover { background: var(--glass-2); }
.white-btn { background: var(--paper); color: #000; border-color: var(--paper); }
.white-btn:hover { background: #e9f7e3; }
.glass-btn svg, .white-btn svg { width: 18px; height: 18px; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  background: linear-gradient(160deg, #6fd14a, #1d5c14);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.sync { color: var(--ink-3); font-size: 13px; }

.hero { padding: 28px 0 8px; display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.hero h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0;
  max-width: 18ch;
}
.hero .sub { color: var(--ink-2); margin: 10px 0 0; font-size: 16px; }
.hero .side { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.tabs { margin: 28px 0 24px; }

.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 24px;
}
.panel + .panel, .grid-2 + .panel, .panel + .grid-2 { margin-top: 16px; }
.panel h2 { font-size: 20px; letter-spacing: -0.01em; font-weight: 600; margin: 0 0 4px; }
.panel .hint { color: var(--ink-2); margin: 0 0 18px; font-size: 14px; max-width: 72ch; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

.answer { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.answer .n { font-size: clamp(64px, 9vw, 112px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.9; }
.answer .what { font-size: 20px; color: var(--ink-2); max-width: 26ch; line-height: 1.3; }
.answer .what strong { color: var(--ink); font-weight: 600; }

.seat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13px, 1fr));
  gap: 4px;
  margin: 4px 0 16px;
}
.slot {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: transparent;
  padding: 0;
}
.slot.pago { background: var(--paper); border-color: var(--paper); }
.slot.ajuste { background: var(--fern); border-color: var(--fern); }
.slot.call { background: var(--sprout); border-color: var(--sprout); }
.slot.excesso { background: var(--over); border-color: var(--over); }
.slot.agendada { border: 1.5px dashed var(--sprout); }
.seat.animate .slot { animation: fill 420ms cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 3ms); }
@keyframes fill { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-2); }

.figures { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 22px; border-top: 1px solid var(--line); }
.figures div { padding: 16px 16px 0 0; }
.figures div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.figures dt { color: var(--ink-2); font-size: 13px; }
.figures dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.date-chip {
  min-width: 52px;
  text-align: center;
  border-radius: 14px;
  background: var(--glass-2);
  padding: 6px 8px;
  line-height: 1.1;
}
.date-chip b { display: block; font-size: 18px; }
.date-chip small { color: var(--ink-2); font-size: 12px; }
.list .who { flex: 1; min-width: 0; }
.list .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .who small { color: var(--ink-2); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line-2);
  background: transparent;
  border-radius: var(--r-pill);
  padding: 7px 14px;
  color: var(--ink-2);
  font-size: 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip[aria-pressed='true'] { background: var(--paper); color: #000; border-color: var(--paper); }
.chip[aria-pressed='true'] b { color: #000; }
.field {
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  min-width: 0;
}
select.field { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='white' stroke-opacity='.6' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
select.field option { background: #0f1f0c; }
input.field::placeholder { color: var(--ink-3); }
.toolbar .grow { flex: 1; min-width: 180px; }

.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-2);
  padding: 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-2);
}
th.num, td.num { text-align: right; }
th button { background: none; border: 0; padding: 0; color: inherit; font-weight: inherit; }
th button[data-dir]::after { content: attr(data-dir); margin-left: 4px; color: var(--ink); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr.go { cursor: pointer; }
tbody tr.go:hover td { background: rgba(255, 255, 255, 0.04); }
td .name { font-weight: 600; }
td small { color: var(--ink-2); display: block; }
.neg { color: var(--amber); }
.muted { color: var(--ink-3); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-pill);
  padding: 4px 11px 4px 9px;
  font-size: 13px;
  font-weight: 500;
  background: var(--glass-2);
  white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #b7f39b; }
.pill.warn { color: var(--amber); }
.pill.bad { color: var(--coral); }
.pill.off { color: var(--ink-2); }

.diff { font-weight: 600; }
.diff.zero { color: var(--ink-3); font-weight: 400; }

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-inner);
  padding: 14px 16px;
  background: rgba(242, 193, 78, 0.1);
  border: 1px solid rgba(242, 193, 78, 0.28);
  color: #f7dc9a;
  font-size: 14px;
  margin-bottom: 18px;
}
.note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }

.cap { display: grid; grid-template-columns: minmax(150px, 1fr) 2.4fr 150px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.cap:first-child { border-top: 0; }
.track { position: relative; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; display: flex; gap: 2px; }
.track span { height: 100%; border-radius: 4px; }
.track .used { background: var(--sprout); }
.track .booked { background: repeating-linear-gradient(135deg, var(--sprout) 0 3px, transparent 3px 6px); }
.track .over { background: var(--over); }
.cap small { color: var(--ink-2); }

.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--sprout); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: #c3f7aa; }
.chart text { fill: var(--ink-2); font-size: 12px; font-family: var(--font); }
.chart .grid { stroke: rgba(255, 255, 255, 0.08); }

.more { margin: 16px auto 0; display: flex; }

#tip {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  background: rgba(10, 22, 8, 0.92);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  max-width: 280px;
  opacity: 0;
  transition: opacity 120ms;
  backdrop-filter: blur(12px);
}
#tip.on { opacity: 1; }
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--paper);
  color: #000;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-weight: 500;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  z-index: 60;
  max-width: calc(100vw - 32px);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}
.login .box { width: min(420px, 100%); }
.login .icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 40px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.login .icon svg { width: 64px; height: 64px; }
.login p.kicker { color: var(--ink-2); margin: 0 0 8px; font-size: 18px; }
.login h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 40px; font-weight: 600; }
.login .white-btn, .login .glass-btn { width: 100%; justify-content: center; padding: 15px; font-size: 16px; }
.login .glass-btn { margin-top: 12px; }
.login small { display: block; margin-top: 24px; color: var(--ink-3); }

.loading { min-height: 60vh; display: grid; place-items: center; color: var(--ink-2); }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figures div + div { border-left: 0; padding-left: 0; }
  .figures div { padding-right: 12px; }
  .cap { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .panel { padding: 18px; border-radius: 22px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .seg { overflow-x: auto; max-width: 100%; }
  .topbar .sync { display: none; }
  .seat { grid-template-columns: repeat(auto-fill, minmax(10px, 1fr)); gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .seat.animate .slot { animation: none; }
  #toast, #tip { transition: none; }
}
.grid-2 > .panel { margin-top: 0; align-self: start; }
td.wrap-cell { white-space: normal; min-width: 260px; }
td.wrap-cell .pill { margin: 2px 0; }
.grid-2 > div > .panel + .panel { margin-top: 16px; }
.datef { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.datef input { background: transparent; border: 0; color: var(--ink); font: inherit; color-scheme: dark; }
.grid-2 > * { min-width: 0; }
.list li .pill { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .list li .pill { display: none; }
  .hero .side { margin-left: 0; }
}
.login form { display: grid; gap: 12px; }
.login .glass-btn { margin-top: 0; }
.login-field {
  width: 100%;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.06);
  padding: 15px 22px;
  font-size: 17px;
  text-align: center;
}
.login-field[name='code'] { font-size: 26px; letter-spacing: 0.4em; font-weight: 600; }
.login .sent { color: var(--ink-2); margin: 0 0 4px; }
.login .sent b { color: var(--ink); font-weight: 600; }
.login .erro { color: var(--coral); margin: 4px 0 0; font-size: 14px; }
