:root {
  --ink: #141413; --ink-2: #3d3d3a; --muted: #75736d; --line: #e4ddd0;
  --bg: #faf7f2; --card: #ffffff; --sand: #efe8dc; --clay: #b8492a; --clay-2: #e0714b;
  --ok: #2f7d4f; --ok-bg: #e5f2ea; --bad: #b3261e; --bad-bg: #fbe9e7; --warn-bg: #fdf3dc;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,20,19,.06), 0 4px 16px rgba(20,20,19,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3efe7; --ink-2: #d6d1c6; --muted: #9c978c; --line: #34322d;
    --bg: #171715; --card: #1f1f1c; --sand: #2a2925; --clay: #e0714b; --clay-2: #f08a64;
    --ok: #7fcf9c; --ok-bg: #1d3326; --bad: #f2877e; --bad-bg: #3a1f1c; --warn-bg: #3a3120;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--clay); }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/panel/fonts/poppins-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/panel/fonts/poppins-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/panel/fonts/poppins-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/panel/fonts/poppins-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/panel/fonts/poppins-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/panel/fonts/poppins-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* auth screens (login, 2FA, password) — fixed light palette */
html { overscroll-behavior: none; }
body.is-auth { background: #F4F4F4; color-scheme: light; }
.auth { --a-navy: #0F2A4F; --a-text: #1D2939; --a-muted: #667085; --a-line: #D0D5DD; --a-teal: #1AA39F;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: 56px 16px 0; background: #F4F4F4; color: var(--a-text); position: relative;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; }
.auth-lang { position: absolute; top: 14px; right: 16px; }
.auth-lang select { width: auto; padding: 4px 8px; font: inherit; font-size: 13px; background: #fff; color: var(--a-text);
  border: 1px solid var(--a-line); border-radius: 6px; }
.auth-card { width: 100%; max-width: 560px; background: #fff; border: 0; border-radius: 10px; padding: 36px 30px 30px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-logo img { width: 104px; height: auto; border-radius: 10px; display: block; }
.auth-sub { text-align: center; font-weight: 600; font-size: 16px; color: #475467; margin: 0 0 30px; }
.auth .muted { color: var(--a-muted); }
.center { text-align: center; }
.auth input:not([type=checkbox]), .auth select:not(.auth-lang select) { background: #fff; color: var(--a-text);
  border: 1px solid var(--a-line); border-radius: 6px; padding: 9px 14px; font: inherit; font-size: 15px; }
.auth input::placeholder { color: #98A2B3; }
.auth input:focus { outline: 2px solid rgba(15, 42, 79, .25); outline-offset: 0; border-color: var(--a-navy); }
.auth-card form > input { margin-top: 30px; }
.auth-card form > input:first-child { margin-top: 0; }
.auth label { color: var(--a-text); }
.auth .check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 16px; margin: 38px 0 0; cursor: pointer; }
.auth .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--a-teal); border-radius: 4px; }
.auth .btn.block { margin-top: 38px; padding: 10px; font-size: 16px; font-weight: 500; border-radius: 6px;
  background: var(--a-navy); border-color: var(--a-navy); color: #fff; }
.auth .btn.block:hover { background: #0B2140; }
.auth .error { margin-top: 16px; }
.auth-card .qr { display: block; margin: 12px auto; width: 200px; height: 200px; border-radius: 8px; background: #fff; }
.auth details code { color: var(--a-text); }
.auth-foot { width: 100%; max-width: 1050px; margin-top: auto; padding: 22px 16px 26px; text-align: center; color: var(--a-text);
  font-size: 15px; border-top: 1px solid #E4E7EC; }
.auth-card { margin-bottom: 48px; }
.auth-foot p { margin: 0 0 6px; }
.auth-foot a { color: var(--a-navy); font-size: 14px; }
.auth-foot .site { text-decoration: none; font-size: 15px; color: var(--a-text); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.brand img { width: 32px; height: 32px; }
.side .foot select { width: auto; }

/* forms */
label { display: block; font-weight: 550; margin: 12px 0 4px; font-size: 13px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit; }
textarea { min-height: 140px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--clay-2); outline-offset: 0; border-color: transparent; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.accent { background: var(--clay); color: #fff; border-color: var(--clay); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; justify-content: center; margin-top: 18px; padding: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.error { color: var(--bad); background: var(--bad-bg); padding: 8px 10px; border-radius: 8px; margin-top: 12px; }
.notice { background: var(--warn-bg); padding: 10px 12px; border-radius: 8px; margin: 10px 0; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; display: flex;
  flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .brand { padding: 0 8px; margin-bottom: 14px; }
.side .org { padding: 6px 10px; margin: 0 0 10px; background: var(--sand); border-radius: 8px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .sect { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 12px 10px 4px; }
.nav { display: block; padding: 7px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; }
.nav:hover { background: var(--sand); }
.nav.active { background: var(--ink); color: var(--bg); }
.side .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.main { padding: 28px 32px 60px; min-width: 0; max-width: 1200px; }
.head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.content { min-width: 0; }
.topbar { display: none; }

/* cards & tables */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 12.5px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden; }
.panel > .ph { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel > .ph h2 { margin: 0; }
.panel > .pb { padding: 16px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--sand); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; align-items: center; }
.kv .k { color: var(--muted); }
.secret { display: inline-flex; gap: 8px; align-items: center; }
.search { max-width: 260px; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(20,20,19,.45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal-box { background: var(--card); border-radius: 14px; padding: 22px; width: 100%; max-width: 460px;
  max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--line); }
.modal-box .qr { display: block; width: 220px; height: 220px; margin: 12px auto; background: #fff; border-radius: 8px; }
.modal-box .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.copyfield { display: flex; gap: 6px; margin-top: 6px; }
.copyfield input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: 30; box-shadow: var(--shadow); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 10; transform: translateX(-102%); transition: transform .15s; }
  .side.open { transform: none; }
  .main { padding: 16px; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
    background: var(--card); position: sticky; top: 0; z-index: 5; }
  .topbar img { width: 24px; height: 24px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv .k { margin-top: 8px; }
  th, td { padding: 8px 10px; }
}

/* enrollment landing page */
body.landing { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
body.landing .card { max-width: 440px; width: 100%; text-align: center; }
body.landing .org { font-weight: 700; color: var(--clay); margin-bottom: 6px; }
body.landing .en { color: var(--muted); font-size: 12.5px; }
body.landing .user { font-weight: 600; margin-top: 8px; }
body.landing .qr { width: 240px; height: 240px; background: #fff; border-radius: 8px; margin: 10px auto; display: block; }
body.landing ol { text-align: left; padding-left: 20px; }
body.landing li { margin-bottom: 8px; }
body.landing .link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; margin: 6px 0 12px; }
body.landing .brandlogo { width: 84px; border-radius: 10px; display: block; margin: 0 auto 12px; }
@media (max-height: 800px) {
  .auth { padding-top: 28px; }
  .auth-card { padding: 26px 30px 24px; margin-bottom: 24px; }
  .auth-logo { margin-bottom: 12px; }
  .auth-logo img { width: 80px; }
  .auth-sub { margin-bottom: 20px; }
  .auth-card form > input { margin-top: 16px; }
  .auth .check { margin-top: 20px; }
  .auth .btn.block { margin-top: 22px; }
  .auth-foot { padding: 14px 16px 16px; font-size: 14px; }
}

/* OTP screen */
.otp-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 26px; }
.auth-sub.left { text-align: left; margin: 0 0 2px; }
.auth .small { font-size: 13.5px; margin: 0; line-height: 1.45; }
.ring-wrap { position: relative; width: 52px; height: 52px; flex: none; }
.ring { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #E4E7EC; stroke-width: 3; }
.ring-fg { fill: none; stroke: #1AA39F; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.ring-wrap.low .ring-fg { stroke: #E8913A; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #0F2A4F;
  font-variant-numeric: tabular-nums; }
.otp { display: flex; justify-content: center; align-items: center; gap: 10px; }
.auth input.otp-box { width: 52px; height: 60px; padding: 0; text-align: center; font-size: 26px; font-weight: 600;
  border: 1.5px solid var(--a-line); border-radius: 10px; caret-color: #0F2A4F; font-variant-numeric: tabular-nums; }
.auth input.otp-box.filled { border-color: #0F2A4F; background: #F8FAFC; }
.auth input.otp-box:focus { outline: 3px solid rgba(26, 163, 159, .25); border-color: #1AA39F; }
.otp-sep { width: 12px; height: 2px; background: #D0D5DD; border-radius: 2px; }
.otp.shake { animation: shake .35s; }
.otp.shake .otp-box { border-color: #D92D20; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .otp.shake { animation: none; } .ring-fg { transition: none; } }
.otp-form .btn.block { margin-top: 30px; }
.auth-alt { margin: 18px 0 0; font-size: 14px; }
.auth-alt a { color: #0F2A4F; }
.auth .steps { margin: 0 0 8px; padding-left: 20px; color: #475467; font-size: 14px; }
.auth .steps li { margin-bottom: 4px; }
.secret-code { display: inline-block; margin-top: 6px; letter-spacing: .06em; }
@media (max-width: 420px) {
  .otp { gap: 6px; }
  .auth input.otp-box { width: 42px; height: 52px; font-size: 22px; }
  .otp-sep { width: 6px; }
}
@media (max-height: 800px) { .otp-head { margin-bottom: 18px; } .otp-form .btn.block { margin-top: 20px; } }
