/* Reshapers brand tokens (Design/tokens.json), adapted for a desktop admin site. */
:root {
  --ink: #12151A;
  --ink-raised: #262A32;
  --ink-border: #3A3F49;
  --volt: #D4FF3A;
  --chalk: #F4F3EE;
  --surface: #FFFFFF;
  --slate: #5B6270;
  --on-ink-muted: #C9CBD1;
  --line: #DAD8CF;
  --divider: #ECEAE3;
  --ember: #C2410C;
  --ember-text: #A8380A;
  --ember-bg: #FDE8DC;
  --dashed: #9A9EA6;
  --ok-bg: #DDF3E3;
  --ok-fg: #1E6B3A;
  --grey-bg: #ECEBE6;
  --grey-fg: #4A505C;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 500 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; }
h1 { font-size: 26px; letter-spacing: -0.6px; }
h2 { font-size: 22px; }
.muted { color: var(--slate); margin: 4px 0 0; }
.caption { font-size: 12px; color: var(--slate); }
.overline { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--slate); }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.wordmark { font: 700 20px var(--display); letter-spacing: -0.5px; }
.brand-light .wordmark { color: #fff; }
.admin-chip {
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px; background: var(--ink-raised); color: var(--volt);
}
.brand-dark .admin-chip { background: var(--ink); }

/* ---------- Buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid transparent;
  font: 600 15px var(--body); cursor: pointer; white-space: nowrap;
}
.btn:focus-visible, .icon-btn:focus-visible, .segmented button:focus-visible, input:focus-visible, tbody tr:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.btn-primary { background: var(--ink); color: #fff; height: 56px; font-size: 16px; }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--surface); }
.btn-highlight { background: var(--volt); color: var(--ink); }
.btn-ink-outline { background: transparent; border-color: var(--ink-border); color: #fff; }
.btn-ink-outline:hover { background: var(--ink-raised); }
.btn-small { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-tiny { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer;
}

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font: 500 15px var(--body); color: var(--ink);
}

.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin: 0 0 16px; }
.banner-error { background: var(--ember-bg); color: var(--ember-text); }

/* ---------- Sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--chalk); border-radius: 22px; padding: 28px; }
.login-card form { margin-top: 28px; }
.login-card h1 { font-size: 22px; letter-spacing: 0; }
.login-card .muted { margin-bottom: 20px; font-size: 14px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--on-ink-muted); text-decoration: none; font-weight: 600; font-size: 15px;
}
.nav-item:hover:not(.disabled) { background: var(--ink-raised); color: #fff; }
.nav-item.active { background: var(--volt); color: var(--ink); }
.nav-item.disabled { opacity: .55; cursor: default; }
.soon { margin-left: auto; font-size: 11px; font-weight: 700; border: 1px solid var(--ink-border); border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.admin-email { font-size: 13px; color: var(--on-ink-muted); word-break: break-all; }
.stage {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--ink); background: var(--volt); border-radius: 999px; padding: 2px 8px;
}
.stage.prod { background: var(--ember-bg); color: var(--ember-text); }

.main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat strong { font: 700 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat-hero { background: var(--ink); color: #fff; border-radius: 22px; }
.stat-hero .overline { color: var(--on-ink-muted); }
.stat-hero strong { color: var(--volt); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--slate);
}
.search input { border: 0; outline: 0; flex: 1; font: 500 15px var(--body); color: var(--ink); background: transparent; min-width: 0; }
.segmented { display: inline-flex; background: var(--surface); border-radius: 12px; padding: 4px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; height: 40px; padding: 0 16px; border-radius: 9px;
  font: 600 14px var(--body); color: var(--ink); cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--ink); color: #fff; }

/* ---------- Table ---------- */
.card { background: var(--surface); border-radius: 18px; }
.table-card { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; min-width: 900px; }
.users th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--slate); padding: 14px 12px; border-bottom: 1px solid var(--divider); white-space: nowrap;
}
.users td { padding: 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; font-size: 14px; }
.users tbody tr { cursor: pointer; }
.users tbody tr:hover { background: #FAFAF7; }
.users tbody tr:last-child td { border-bottom: 0; }
.users .num { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--volt); font: 700 15px var(--display);
}
.avatar.pending { background: var(--chalk); color: var(--slate); border: 1.5px dashed var(--dashed); }
.who-name { font-weight: 600; }
.who-sub { font-size: 12px; color: var(--slate); }
.mono { font-family: var(--display); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.dash { color: var(--dashed); }
.low { color: var(--ember-text); font-weight: 700; }

.chip { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-active { background: var(--ok-bg); color: var(--ok-fg); }
.chip-pending { background: var(--volt); color: var(--ink); }
.chip-grey { background: var(--grey-bg); color: var(--grey-fg); }
.chip-ember { background: var(--ember-bg); color: var(--ember-text); }
.chip-ink { background: var(--ink); color: #fff; }

.otp-meta { font-size: 12px; color: var(--slate); white-space: nowrap; }
.otp-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.otp-code {
  font: 700 22px/1 var(--display); letter-spacing: 4px; background: var(--ink); color: var(--volt);
  border-radius: 10px; padding: 6px 10px 6px 14px;
}

.empty {
  margin: 16px; padding: 28px; border: 1.5px dashed var(--dashed); border-radius: 16px;
  text-align: center; color: var(--slate); font-weight: 600;
}

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(18, 21, 26, .55); z-index: 10; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--chalk);
  z-index: 11; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(18, 21, 26, .25);
}
.drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 22px 22px 16px; border-bottom: 1px solid var(--divider); }
.drawer-head h2 { margin-top: 8px; }
.drawer-body { padding: 18px 22px 32px; overflow-y: auto; }
.section { background: var(--surface); border-radius: 16px; padding: 6px 16px; margin-bottom: 14px; }
.section .overline { display: block; padding: 12px 0 4px; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); font-size: 14px; }
.kv:first-of-type { border-top: 0; }
.kv dt { color: var(--slate); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }
.otp-panel { background: var(--ink); color: #fff; border-radius: 22px; padding: 18px; margin-bottom: 14px; }
.otp-panel .overline { color: var(--on-ink-muted); }
.otp-panel .chip-ink { background: var(--ink-raised); color: var(--volt); }
.otp-panel p { margin: 6px 0 14px; color: var(--on-ink-muted); font-size: 14px; }
.otp-panel .big { font: 700 40px/1 var(--display); letter-spacing: 8px; color: var(--volt); margin: 10px 0 8px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; }
  .sidebar .admin-chip, .nav-item.disabled, .admin-email, .stage { display: none; }
  .nav { flex-direction: row; }
  .nav-item { padding: 8px 12px; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .main { padding: 20px 16px 40px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .head-actions .caption { width: 100%; }
}

/* ---------- Admins page ---------- */
.banner-ok { background: var(--ok-bg); color: var(--ok-fg); }
.help { padding: 16px 18px; margin-bottom: 16px; font-size: 14px; }
.help ul { margin: 8px 0 10px; padding-left: 20px; }
.help li { margin: 4px 0; }
table.admins { min-width: 720px; }
.users .actions-col { text-align: right; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.admins tbody tr { cursor: default; }
.you { margin-left: 8px; font-size: 12px; color: var(--slate); font-weight: 600; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px)); background: var(--chalk); border-radius: 22px; padding: 24px;
  box-shadow: 0 8px 24px rgba(18, 21, 26, .25);
}
#modal-scrim { z-index: 20; }
.modal h2 { font-size: 20px; }
.modal-body { margin: 10px 0 20px; font-size: 15px; color: var(--ink); }
.modal-body p { margin: 0 0 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.temp-pw {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink);
  border-radius: 16px; padding: 14px 16px; margin: 12px 0;
}
.temp-pw code { font: 700 22px/1.2 var(--display); color: var(--volt); letter-spacing: 1.5px; word-break: break-all; }
