/* portal.css — portal v2 (R4S-50): the Ready4Service look (website / game /
   emails) on top of style.css, plus the sidebar layout. Loaded by the portal
   pages (dashboard.html, index.html) only -- the admin area keeps style.css.
   Most of style.css follows the colour variables, so swapping them below
   re-colours it; the rest is overridden by name. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin.woff2") format("woff2");   /* OFL, fonts/HankenGrotesk-OFL.txt */
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #faf7f2;
  --bg-panel: #ffffff;
  --bg-panel-alt: #f2ede4;
  --border: #e4ddd1;
  --text: #15131c;
  --text-dim: #8a8497;
  --gold: #15131c;          /* primary buttons, focus */
  --gold-bright: #15131c;   /* headings, emphasis */
  --red: #e5484d;
  --green: #11795d;
  --teal: #0aa4f8;
  --row-hover: #f6f2ff;

  --ink2: #4a4656;
  --night: #191226;
  --blue: #0aa4f8; --violet: #8b5cf6; --coral: #ff6a3d; --sun: #ffb020; --mint: #18c29c;
  --grad: linear-gradient(100deg, #0aa4f8 0%, #8b5cf6 55%, #ff6a3d 100%);
  --shadow: 0 1px 2px rgba(21, 19, 28, .04), 0 12px 32px -14px rgba(21, 19, 28, .18);
  --radius: 22px;
}

body { font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--violet); }
h1, h2, h3 { letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-dim); }
.small { font-size: 12px; }

/* ── buttons / inputs ─────────────────────────────────────────────────── */
button { font-family: inherit; border-radius: 999px; font-weight: 700; }
button:hover { filter: none; opacity: .92; }
.btn-primary { background: var(--text); color: #fff; padding: 11px 20px; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); padding: 10px 18px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-wide { width: 100%; justify-content: center; margin-top: 10px; }
.icon-btn { border-radius: 10px; }
input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }
label { color: var(--ink2); font-weight: 700; }

/* ── layout: sidebar + main ───────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; flex-shrink: 0; background: var(--night); color: #cfc9da; display: flex; flex-direction: column;
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; padding: 4px 10px 24px; }
.brand b { color: var(--blue); }
.venue-card { background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; }
.venue-card .k { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: #8f87a3; }
.venue-card .v { font-weight: 800; color: #fff; font-size: 15px; margin-top: 2px; word-break: break-word; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
  margin-bottom: 3px; color: #cfc9da; text-decoration: none; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.on { background: #fff; color: var(--text); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }
.side-nav a.on .ico { stroke: var(--violet); }
.ico { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; border-radius: 99px; padding: 2px 7px; }
.side-foot { margin-top: auto; font-size: 12px; color: #8f87a3; padding: 16px 10px 0; }

.main-col { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 32px 6px; }
.topbar h1 { margin: 0; font-size: 30px; font-weight: 800; }
.page-sub { color: var(--text-dim); font-weight: 600; font-size: 14px; margin-top: 2px; }
.top-sp { flex: 1; }
.period select { border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 13px; color: var(--ink2); margin: 0; width: auto; }
.me-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; padding: 0; border: 0; flex-shrink: 0; }
.dashboard-main { max-width: none; padding: 18px 32px 56px; margin: 0; }
.sec[hidden] { display: none !important; }

/* ── cards ───────────────────────────────────────────────────────────── */
.panel { background: var(--bg-panel); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.panel h2 { color: var(--text); font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.panel h2.mt { margin-top: 22px; font-size: 15px; }
.panel h3 { color: var(--text); font-weight: 800; }
.panel-subtitle { color: var(--text-dim); font-size: 13px; font-weight: 600; margin: 0 0 14px; }
.panel-head-row { display: flex; align-items: center; gap: 10px; }
.more-link { margin-left: auto; font-size: 13px; color: var(--violet); font-weight: 700; text-decoration: none; }
.more-link.muted { color: var(--text-dim); }
.notice { grid-column: 1 / -1; color: var(--ink2); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-2 > .panel, .grid-2-1 > .panel { margin-bottom: 20px; }
.chart-wrap { position: relative; height: 280px; }
.radar-wrap { height: 300px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.kpi { border-radius: var(--radius); padding: 20px 22px; color: #fff; position: relative; overflow: hidden; min-height: 132px; }
.kpi .k { font-size: 12px; font-weight: 800; letter-spacing: .1em; opacity: .88; }
.kpi .v { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.kpi .s { font-size: 13px; font-weight: 700; opacity: .92; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.k1 { background: var(--grad); } .k2 { background: var(--blue); } .k3 { background: var(--mint); } .k4 { background: var(--coral); }

/* rows, chips, people */
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.panel-subtitle + .row, h2 + .row { border-top: 0; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.chip { border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 800; background: var(--bg-panel-alt); color: var(--ink2); white-space: nowrap; }
.c-red { background: #fde4e2; color: #b4232a; } .c-green { background: #d9f5ec; color: var(--green); } .c-sun { background: #fff1d6; color: #9a6200; }
.person { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.person.big { margin: 6px 0 4px; }
.person.big b { font-size: 18px; }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.person.big .av { width: 52px; height: 52px; font-size: 17px; }
.bar { height: 8px; border-radius: 9px; background: var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.acc { display: inline-flex; align-items: center; gap: 8px; }
.acc .bar { width: 110px; }
.prog { width: 150px; text-align: right; }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background-color: var(--bg-panel-alt); }
.thumb.sprite { background-image: url("img/glasses_32x32.png"); background-repeat: no-repeat; image-rendering: pixelated; }

/* tables */
table { border-collapse: collapse; }
th { color: var(--text-dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
tr.clickable:hover td, tbody tr:hover td { background: var(--row-hover); }
.staff-table td { padding-top: 12px; padding-bottom: 12px; }

/* staff detail drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); margin: 0; border-radius: 22px 0 0 22px; z-index: 60;
  overflow-y: auto; transform: translateX(105%); transition: transform .25s ease; display: block !important; }
body.drawer-open .drawer { transform: none; }
.drawer-close { position: absolute; top: 16px; right: 16px; }
.drawer .drilldown-title { font-size: 22px; padding-right: 40px; color: var(--text); }
.drawer-scrim { position: fixed; inset: 0; background: rgba(25, 18, 38, .45); z-index: 55; }
.gift-cell { display: flex; gap: 8px; margin-bottom: 14px; }
.gift-cell input { margin: 0; }

/* old dashboard bits that stay */
.kpi-badge { display: none !important; }
.plan-full-banner { border-radius: 16px; border: 0; background: #fde4e2; color: #8a1d22; }
.never-played-badge { background: #fff1d6; color: #9a6200; border: 0; border-radius: 99px; }
.test-progress-card { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; }
.recipe-picklist { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.plan-facts .k { color: var(--text-dim); font-weight: 700; }
.plan-facts .v { color: var(--text); font-weight: 800; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.readonly-banner { background: #fff1d6; border-bottom: 1px solid var(--sun); color: #6b4300; }

/* menu (menu.js) */
.drink-card { border-radius: 16px; background: #fff; border-color: var(--border); }
.drink-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.seg { background: var(--bg-panel-alt); border: 0; border-radius: 999px; padding: 4px; }
.seg-btn { border-radius: 999px; }
.seg-btn.active, .seg-btn[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.badge-live, .badge-log-added, .badge-log-restored, .badge-ready { color: var(--green); border-color: #a9dcc9; }
.badge-scheduled, .badge-log-edited, .badge-launching { color: #0a6fae; border-color: #a9d6f3; }
.badge-ended, .badge-leaving { color: #9a6200; border-color: #f1d49a; }
.badge-removed, .badge-log-removed, .badge-log-deleted { color: var(--red); border-color: #f3b6b3; }
.menu-toast { background: #fff; box-shadow: 0 12px 30px -10px rgba(21, 19, 28, .3); border-radius: 14px; }
.menu-toast.success { border-color: #a9dcc9; } .menu-toast.error { border-color: #f3b6b3; color: #8a1d22; }
.launch-banner { border-radius: 16px; background: #f6f2ff; border-color: #d9ccff; }
.launch-banner:not([hidden]) ~ .launches-empty { display: none; }
.lc-dialog { border-radius: 22px; background: #fff; color: var(--text); border: 0; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35); }
.lc-dialog::backdrop { background: rgba(25, 18, 38, .55); }

/* ── login page ──────────────────────────────────────────────────────── */
.login-card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-card h1 { color: var(--text); }
body.login-page .login-wrap { background: var(--bg); }

/* ── phone ───────────────────────────────────────────────────────────── */
.tabbar, .more-sheet { display: none; }
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { display: none; }
  .topbar { padding: 16px 16px 4px; }
  .topbar h1 { font-size: 24px; }
  .top-action { display: none; }
  .period select { padding: 7px 10px; font-size: 12px; }
  .dashboard-main { padding: 12px 16px 100px; }
  .kpi { min-height: 108px; padding: 16px; }
  .kpi .v { font-size: 30px; }
  .panel { padding: 18px; }
  .chart-wrap { height: 220px; }
  .acc .bar { width: 60px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--border);
    padding: 8px 6px calc(12px + env(safe-area-inset-bottom)); justify-content: space-around; box-shadow: 0 -10px 30px -20px rgba(0, 0, 0, .3); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--text-dim); text-decoration: none; }
  .tabbar a.on { color: var(--violet); }
  .tabbar .ico { width: 22px; height: 22px; }
  .more-sheet:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: 70; background: rgba(25, 18, 38, .45); align-items: flex-end; }
  .more-card { background: #fff; width: 100%; border-radius: 22px 22px 0 0; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }
  .more-card a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; font-weight: 800; color: var(--text); text-decoration: none; }
  .more-card a.on { background: #f6f2ff; color: var(--violet); }
  .drawer { width: 100vw; border-radius: 22px 22px 0 0; top: auto; height: 88vh; transform: translateY(105%); }
  body.drawer-open .drawer { transform: none; }
  table { font-size: 13px; }
}

/* tests v2 + team roles */
.recipe-check-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; }
.recipe-check-name { flex: 1; font-weight: 700; }
.recipe-check-category { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--text-dim); background: #fff; border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px; }
.recipe-check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--violet); margin: 0; }
.assign-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 10px; }
.assign-opts select { width: 100%; border-radius: 12px; padding: 10px 12px; }
.people-pick { max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.assign-note { margin-top: 6px; }
.test-meta { color: var(--text-dim); font-size: 12px; font-weight: 700; margin: 2px 0 8px; }
.test-progress-staff-list li { display: flex; align-items: center; gap: 8px; }
.staff-passed .staff-status-icon { color: var(--green); font-weight: 900; }
.staff-failed .staff-status-icon { color: var(--red); font-weight: 900; }
.staff-pending .staff-status-icon { color: var(--text-dim); }
.test-best { margin-left: auto; font-weight: 800; color: var(--ink2); }
.chip.c-violet { background: #ece4ff; color: #5b34c9; }
.you-chip { margin-left: 8px; }
.roster-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 760px) { .assign-opts { grid-template-columns: 1fr; } }

/* ── super admin (admin.html): same sidebar look, no script changes ───── */
body.admin-page { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
body.admin-page .dashboard-header { grid-column: 1; grid-row: 1; background: var(--night); border: 0; margin: 0; padding: 26px 22px 18px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
body.admin-page .brand-h1 { color: #fff; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin: 0; }
body.admin-page .brand-h1 b { color: var(--blue); }
body.admin-page .dashboard-header .venue-label { color: #8f87a3; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
body.admin-page #signout-btn { background: rgba(255, 255, 255, .08); color: #cfc9da; border: 0; }
body.admin-page .tab-nav { grid-column: 1; grid-row: 2; background: var(--night); border: 0; margin: 0; padding: 6px 16px 22px;
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
body.admin-page .tab-nav[hidden] { display: flex !important; visibility: hidden; }
body.admin-page .tab-btn { background: transparent; color: #cfc9da; border: 0; border-radius: 12px; text-align: left; padding: 11px 14px; font-size: 14.5px; font-weight: 700; }
body.admin-page .tab-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
body.admin-page .tab-btn.active { background: #fff; color: var(--text); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }
body.admin-page #admin-app, body.admin-page #mfa { grid-column: 2; grid-row: 1 / 3; padding: 28px 32px 56px; max-width: none; margin: 0; }
body.admin-page .admin-table th { background: transparent; }
body.admin-page .status-badge, body.admin-page .role-badge { border-radius: 99px; }
@media (max-width: 760px) {
  body.admin-page { display: block; }
  body.admin-page .dashboard-header { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px; }
  body.admin-page .tab-nav { flex-direction: row; overflow-x: auto; padding: 0 12px 12px; }
  body.admin-page .tab-btn { white-space: nowrap; }
  body.admin-page #admin-app, body.admin-page #mfa { padding: 16px 16px 48px; }
}

/* team weekly goal + new starters + classics picker */
.goal-wrap { display: flex; align-items: center; gap: 22px; }
.goal-ring-box { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.goal-ring { width: 132px; height: 132px; }
.goal-center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; }
.goal-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.goal-left { display: inline-block; margin-top: 10px; }
.goal-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goal-form input { width: 140px; margin: 0; }
.assign-source { margin-bottom: 10px; }
.classics-pick { max-height: 420px; overflow-y: auto; }
.chapter-row { background: #fff; border-radius: 10px; margin-top: 8px; }
.chapter-row .recipe-check-name { font-weight: 800; }
.classic-row { padding-left: 26px; }
.assign-picked { margin-top: 6px; }
/* style.css's ".panel label { display: block }" (admin forms) beat the checklist rows */
.panel label.recipe-check-row { display: flex; margin: 0; font-size: 14px; color: var(--text); }
.panel .goal-form input[type="number"] { width: 160px; margin: 0; }
