:root {
  --admin-bg: #090d16;
  --admin-surface: #101722;
  --admin-surface-2: #151f2d;
  --admin-surface-3: #1b2736;
  --admin-line: #263344;
  --admin-line-soft: #1e2a39;
  --admin-text: #edf3fa;
  --admin-muted: #8d9caf;
  --admin-faint: #5e6c7d;
  --admin-primary: #5b7cfa;
  --admin-primary-strong: #7893ff;
  --admin-cyan: #42d5c5;
  --admin-amber: #f4b85f;
  --admin-coral: #f17a80;
  --admin-green: #6fda9d;
  --admin-sidebar: 248px;
  --admin-radius: 7px;
  color-scheme: dark;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; background: var(--admin-bg); }

body {
  color: var(--admin-text);
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--admin-cyan);
  outline-offset: 2px;
}

.boot-screen {
  align-items: center;
  color: var(--admin-muted);
  display: flex;
  gap: 12px;
  height: 100vh;
  justify-content: center;
}

.brand-mark {
  align-items: center;
  background: var(--admin-primary);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  letter-spacing: .06em;
  width: 28px;
}

.login-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

.login-page::before {
  border: 1px solid rgba(91, 124, 250, .18);
  border-radius: 50%;
  content: "";
  height: 520px;
  left: calc(50% - 260px);
  pointer-events: none;
  position: absolute;
  top: calc(50% - 260px);
  width: 520px;
}

.login-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  max-width: 420px;
  padding: 38px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.login-brand { align-items: center; display: flex; gap: 12px; margin-bottom: 34px; }
.login-brand .brand-mark { height: 38px; width: 38px; }
.login-brand strong { display: block; font-size: 17px; letter-spacing: .02em; }
.login-brand small { color: var(--admin-muted); display: block; font-size: 12px; margin-top: 2px; }
.login-panel h1 { font-size: 26px; letter-spacing: 0; margin: 0 0 8px; }
.login-panel .subhead { color: var(--admin-muted); margin: 0 0 28px; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { color: var(--admin-muted); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea, .search-input {
  background: #0c131e;
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  color: var(--admin-text);
  min-height: 40px;
  padding: 9px 11px;
  transition: border-color .16s ease, background .16s ease;
  width: 100%;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--admin-faint); }
.field input:hover, .field select:hover, .field textarea:hover, .search-input:hover { border-color: #3a4c63; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { background: #0f1825; border-color: var(--admin-primary); outline: 0; }
.field-error { color: var(--admin-coral); font-size: 12px; margin: -4px 0 14px; }

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 650;
  gap: 7px;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--admin-primary); color: #fff; }
.btn-primary:hover { background: var(--admin-primary-strong); }
.btn-quiet { background: transparent; border-color: var(--admin-line); color: var(--admin-muted); }
.btn-quiet:hover { background: var(--admin-surface-3); border-color: #3a4c63; color: var(--admin-text); }
.btn-danger { background: rgba(241, 122, 128, .12); border-color: rgba(241, 122, 128, .35); color: #ff9da2; }
.btn-danger:hover { background: rgba(241, 122, 128, .2); }
.btn-success { background: rgba(111, 218, 157, .12); border-color: rgba(111, 218, 157, .32); color: var(--admin-green); }
.btn-small { min-height: 30px; padding: 5px 9px; }
.btn-block { width: 100%; }
.btn-icon { padding-left: 9px; padding-right: 9px; }

.icon { display: inline-flex; flex: 0 0 auto; height: 16px; width: 16px; }
.icon svg { display: block; height: 100%; width: 100%; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  background: #0b111b;
  border-right: 1px solid var(--admin-line-soft);
  display: flex;
  flex: 0 0 var(--admin-sidebar);
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 14px 16px;
  position: fixed;
  width: var(--admin-sidebar);
  z-index: 10;
}
.sidebar-brand { align-items: center; display: flex; gap: 11px; padding: 0 10px 27px; }
.sidebar-brand .brand-mark { height: 32px; width: 32px; }
.sidebar-brand strong { display: block; font-size: 14px; }
.sidebar-brand small { color: var(--admin-muted); display: block; font-size: 11px; margin-top: 1px; }
.nav-label { color: var(--admin-faint); font-size: 10px; font-weight: 750; letter-spacing: .1em; padding: 0 11px 9px; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--admin-muted);
  display: flex;
  font-size: 13px;
  gap: 11px;
  min-height: 42px;
  padding: 0 11px;
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: rgba(255, 255, 255, .035); color: var(--admin-text); }
.nav-item.active { background: rgba(91, 124, 250, .16); border-color: rgba(91, 124, 250, .27); color: #fff; }
.nav-item.active .icon { color: var(--admin-primary-strong); }
.nav-count { background: var(--admin-coral); border-radius: 10px; color: #180e12; font-size: 10px; font-weight: 800; line-height: 18px; margin-left: auto; min-width: 18px; padding: 0 5px; text-align: center; }
.sidebar-spacer { flex: 1; }
.sidebar-status { border-top: 1px solid var(--admin-line-soft); color: var(--admin-faint); font-size: 11px; line-height: 1.6; padding: 17px 10px 13px; }
.sidebar-user { align-items: center; display: flex; gap: 9px; padding: 7px 9px; }
.avatar { align-items: center; background: #20304b; border: 1px solid #3c5680; border-radius: 50%; color: #cbd8ff; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 800; height: 28px; justify-content: center; width: 28px; }
.sidebar-user strong { display: block; font-size: 12px; }
.sidebar-user small { color: var(--admin-muted); display: block; font-size: 10px; }
.sidebar-user .btn { margin-left: auto; min-height: 28px; padding: 4px 7px; }

.workspace { margin-left: var(--admin-sidebar); min-width: 0; width: calc(100% - var(--admin-sidebar)); }
.topbar { align-items: center; background: rgba(9, 13, 22, .94); border-bottom: 1px solid var(--admin-line-soft); display: flex; gap: 20px; height: 66px; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; z-index: 8; }
.breadcrumb { align-items: center; display: flex; gap: 9px; min-width: 0; }
.breadcrumb .eyebrow { color: var(--admin-faint); font-size: 11px; }
.breadcrumb .current { font-size: 15px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { align-items: center; display: flex; gap: 10px; }
.sync-state { align-items: center; color: var(--admin-muted); display: flex; font-size: 11px; gap: 6px; }
.sync-dot { background: var(--admin-green); border-radius: 50%; box-shadow: 0 0 0 3px rgba(111, 218, 157, .1); height: 6px; width: 6px; }
.mobile-menu { display: none; }

.main-content { max-width: 1500px; padding: 34px; }
.view-header { align-items: flex-end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 25px; }
.view-header h1 { font-size: 25px; letter-spacing: 0; line-height: 1.15; margin: 0; }
.view-header p { color: var(--admin-muted); font-size: 13px; margin: 7px 0 0; }
.view-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { color: var(--admin-primary-strong); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.metric-grid { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
.metric-card { background: var(--admin-surface); border: 1px solid var(--admin-line-soft); border-radius: var(--admin-radius); min-height: 125px; padding: 18px; position: relative; }
.metric-card::after { background: var(--metric-color, var(--admin-primary)); content: ""; height: 2px; left: 18px; position: absolute; right: 18px; top: 0; }
.metric-card .metric-label { color: var(--admin-muted); font-size: 12px; }
.metric-card .metric-value { font-size: 30px; font-weight: 730; letter-spacing: 0; line-height: 1.1; margin-top: 15px; }
.metric-card .metric-foot { color: var(--admin-faint); font-size: 11px; margin-top: 8px; }
.metric-card .metric-icon { color: var(--metric-color, var(--admin-primary)); position: absolute; right: 16px; top: 17px; }

.dashboard-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr); margin-bottom: 14px; }
.panel { background: var(--admin-surface); border: 1px solid var(--admin-line-soft); border-radius: var(--admin-radius); min-width: 0; }
.panel-head { align-items: center; border-bottom: 1px solid var(--admin-line-soft); display: flex; gap: 15px; justify-content: space-between; min-height: 58px; padding: 0 18px; }
.panel-head h2 { font-size: 14px; margin: 0; }
.panel-head small { color: var(--admin-muted); font-size: 11px; }
.panel-body { padding: 18px; }
.trend-panel { min-height: 286px; }
.trend-chart { align-items: stretch; display: flex; gap: 12px; height: 185px; padding: 20px 5px 0; }
.trend-column { align-items: center; display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.trend-track { align-items: flex-end; background: #0c131e; border-radius: 3px 3px 0 0; display: flex; height: 140px; justify-content: center; overflow: hidden; width: 100%; }
.trend-bar { background: var(--admin-primary); border-radius: 3px 3px 0 0; min-height: 4px; width: min(34px, 72%); }
.trend-column:nth-child(3n) .trend-bar { background: var(--admin-cyan); }
.trend-column:nth-child(4n) .trend-bar { background: var(--admin-amber); }
.trend-value { color: var(--admin-text); font-size: 10px; font-weight: 700; }
.trend-date { color: var(--admin-faint); font-size: 10px; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-empty { align-items: center; color: var(--admin-faint); display: flex; height: 180px; justify-content: center; }

.queue-list, .activity-list { display: grid; gap: 0; min-width: 0; }
.queue-item, .activity-item { align-items: center; border-bottom: 1px solid var(--admin-line-soft); display: flex; gap: 12px; min-height: 56px; min-width: 0; padding: 9px 0; width: 100%; }
.queue-item:last-child, .activity-item:last-child { border-bottom: 0; }
.queue-marker { background: var(--admin-amber); border-radius: 2px; flex: 0 0 auto; height: 28px; width: 3px; }
.queue-main, .activity-main { min-width: 0; }
.queue-main strong, .activity-main strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-main small, .activity-main small { color: var(--admin-muted); display: block; font-size: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .btn { margin-left: auto; }
.activity-time { color: var(--admin-faint); flex: 0 0 auto; font-size: 10px; margin-left: auto; white-space: nowrap; }
.period-grid { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.period-cell { background: #0d151f; border: 1px solid var(--admin-line-soft); border-radius: 5px; min-height: 112px; padding: 13px; }
.period-cell small { color: var(--admin-muted); display: block; font-size: 11px; }
.period-cell strong { display: block; font-size: 24px; line-height: 1.15; margin-top: 12px; }
.period-cell span { color: var(--admin-faint); display: block; font-size: 10px; margin-top: 6px; }
.dimension-list { display: grid; gap: 14px; padding: 5px 0; }
.dimension-row { align-items: center; display: grid; gap: 9px; grid-template-columns: 48px minmax(0, 1fr) 28px; }
.dimension-row > span { color: var(--admin-muted); font-size: 11px; }
.dimension-row > strong { color: var(--admin-text); font-size: 11px; text-align: right; }
.dimension-track { background: #0c131e; border-radius: 3px; height: 7px; overflow: hidden; }
.dimension-track i { background: var(--admin-cyan); border-radius: inherit; display: block; height: 100%; }
.dimension-comment { color: var(--admin-faint); font-size: 10px; grid-column: 1 / -1; line-height: 1.45; margin-top: -3px; }

.table-panel { overflow: hidden; }
.toolbar { align-items: center; border-bottom: 1px solid var(--admin-line-soft); display: flex; flex-wrap: wrap; gap: 9px; justify-content: space-between; padding: 14px 16px; }
.toolbar-left, .toolbar-right { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.search-wrap { min-width: 210px; position: relative; }
.search-wrap .icon { color: var(--admin-faint); left: 10px; position: absolute; top: 11px; }
.search-wrap .search-input { padding-left: 33px; }
.select-compact { background: #0c131e; border: 1px solid var(--admin-line); border-radius: 5px; color: var(--admin-muted); min-height: 36px; padding: 0 10px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; min-width: 680px; width: 100%; }
th { color: var(--admin-faint); font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 12px 16px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { border-top: 1px solid var(--admin-line-soft); color: var(--admin-muted); font-size: 12px; padding: 13px 16px; vertical-align: middle; }
td strong { color: var(--admin-text); font-size: 12px; font-weight: 650; }
td .sub { color: var(--admin-faint); display: block; font-size: 10px; margin-top: 3px; }
.check-cell { box-sizing: border-box; padding-left: 16px; padding-right: 4px; width: 42px; }
.check-cell input { accent-color: var(--admin-primary); display: block; height: 14px; margin: 0; width: 14px; }
.classification-active { color: var(--admin-green) !important; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table-empty { color: var(--admin-faint); padding: 44px 16px; text-align: center; }
.pager { align-items: center; border-top: 1px solid var(--admin-line-soft); color: var(--admin-muted); display: flex; font-size: 11px; gap: 8px; justify-content: flex-end; padding: 11px 16px; }
.pager .btn { min-height: 28px; }

.badge { align-items: center; border: 1px solid transparent; border-radius: 10px; display: inline-flex; font-size: 10px; font-weight: 700; line-height: 18px; padding: 0 8px; white-space: nowrap; }
.badge-blue { background: rgba(91, 124, 250, .13); border-color: rgba(91, 124, 250, .26); color: #a9b9ff; }
.badge-green { background: rgba(111, 218, 157, .11); border-color: rgba(111, 218, 157, .25); color: var(--admin-green); }
.badge-amber { background: rgba(244, 184, 95, .11); border-color: rgba(244, 184, 95, .25); color: var(--admin-amber); }
.badge-red { background: rgba(241, 122, 128, .11); border-color: rgba(241, 122, 128, .25); color: #ff9da2; }
.badge-gray { background: rgba(141, 156, 175, .1); border-color: rgba(141, 156, 175, .2); color: var(--admin-muted); }

.section-grid { display: grid; gap: 14px; grid-template-columns: minmax(240px, .8fr) minmax(0, 2.2fr); }
.section-list { padding: 8px; }
.section-list-item { align-items: center; background: transparent; border: 1px solid transparent; border-radius: 5px; color: var(--admin-muted); display: flex; gap: 10px; justify-content: space-between; margin-bottom: 3px; min-height: 42px; padding: 0 10px; text-align: left; width: 100%; }
.section-list-item:hover { background: rgba(255,255,255,.03); color: var(--admin-text); }
.section-list-item.active { background: rgba(91,124,250,.14); border-color: rgba(91,124,250,.24); color: var(--admin-text); }
.section-list-item small { color: var(--admin-faint); font-size: 10px; }
.tabs { align-items: center; border-bottom: 1px solid var(--admin-line-soft); display: flex; gap: 3px; overflow-x: auto; padding: 0 16px; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--admin-muted); font-size: 12px; min-height: 48px; padding: 0 13px; white-space: nowrap; }
.tab:hover { color: var(--admin-text); }
.tab.active { border-bottom-color: var(--admin-primary); color: #fff; }
.content-context { align-items: center; display: flex; gap: 9px; padding: 14px 16px 0; }
.content-context strong { font-size: 14px; }
.content-context small { color: var(--admin-muted); }

.detail-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(320px, .65fr); }
.user-summary { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px; }
.summary-cell { background: #0d151f; border: 1px solid var(--admin-line-soft); border-radius: 5px; padding: 12px; }
.summary-cell small { color: var(--admin-faint); display: block; font-size: 10px; }
.summary-cell strong { display: block; font-size: 18px; margin-top: 6px; }
.profile-head { align-items: center; display: flex; gap: 12px; padding: 18px; }
.profile-head .avatar { height: 42px; width: 42px; }
.profile-head h2 { font-size: 16px; margin: 0; }
.profile-head p { color: var(--admin-muted); font-size: 11px; margin: 3px 0 0; }
.profile-actions { border-top: 1px solid var(--admin-line-soft); display: flex; gap: 8px; padding: 14px 18px; }
.user-dimensions { border-bottom: 1px solid var(--admin-line-soft); padding: 0 18px 18px; }
.user-dimensions .panel-head { padding: 14px 0 10px; }
.user-dimensions .dimension-list { padding: 0; }

.modal-backdrop { align-items: center; background: rgba(3, 6, 11, .76); display: flex; inset: 0; justify-content: center; padding: 22px; position: fixed; z-index: 30; }
.modal { background: var(--admin-surface); border: 1px solid #35445a; border-radius: 8px; box-shadow: 0 25px 90px rgba(0,0,0,.55); max-height: min(760px, calc(100vh - 44px)); max-width: 560px; overflow: auto; width: 100%; }
.modal-wide { max-width: 760px; }
.modal-head { align-items: flex-start; border-bottom: 1px solid var(--admin-line-soft); display: flex; gap: 15px; justify-content: space-between; padding: 19px 21px; }
.modal-head h2 { font-size: 16px; margin: 0; }
.modal-head p { color: var(--admin-muted); font-size: 11px; margin: 4px 0 0; }
.modal-close { background: transparent; border: 0; color: var(--admin-muted); padding: 3px; }
.modal-close:hover { color: var(--admin-text); }
.modal-body { padding: 20px 21px; }
.modal-foot { border-top: 1px solid var(--admin-line-soft); display: flex; gap: 8px; justify-content: flex-end; padding: 14px 21px; }
.form-grid { display: grid; gap: 0 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .field-full { grid-column: 1 / -1; }
[data-activation-mode][hidden] { display: none; }
.notice { background: rgba(66, 213, 197, .08); border: 1px solid rgba(66, 213, 197, .2); border-radius: 5px; color: #98e8df; font-size: 11px; margin-bottom: 15px; padding: 10px 12px; }
.upload-file-cell { min-width: 220px; max-width: 340px; }
.upload-title { background: transparent; border: 0; color: var(--admin-text); cursor: pointer; font: inherit; font-weight: 700; margin: 0; padding: 0; text-align: left; }
.upload-title:hover { color: var(--admin-primary-strong); text-decoration: underline; }
.upload-title:focus-visible, .upload-document__body:focus-visible { outline: 2px solid var(--admin-primary); outline-offset: 3px; }
.upload-excerpt { color: var(--admin-muted); display: -webkit-box; font-size: 12px; line-height: 1.6; margin-top: 6px; max-width: 340px; overflow: hidden; overflow-wrap: anywhere; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.upload-document { margin-bottom: 20px; }
.upload-document__head { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 10px; }
.upload-document__head h3 { color: var(--admin-text); font-size: 14px; margin: 0; }
.upload-document__body { background: #0d151f; border: 1px solid var(--admin-line-soft); border-radius: 5px; color: var(--admin-text); font-size: 14px; line-height: 1.8; max-height: min(44vh, 440px); overflow: auto; overflow-wrap: anywhere; padding: 14px 16px; white-space: pre-wrap; }
.record-overview { align-items: stretch; border-bottom: 1px solid var(--admin-line-soft); display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.record-score { align-items: center; background: rgba(91,124,250,.08); border-right: 1px solid var(--admin-line-soft); display: flex; flex-direction: column; justify-content: center; min-height: 124px; padding: 15px; }
.record-score strong { color: #fff; font-size: 40px; line-height: 1; }
.record-score span { color: var(--admin-muted); font-size: 10px; margin-top: 8px; }
.record-meta { align-content: center; display: grid; gap: 16px 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 21px; }
.record-meta small, .insight-columns small, .next-challenge small, .record-prompt small, .record-transcript small { color: var(--admin-faint); display: block; font-size: 10px; margin-bottom: 4px; }
.record-meta strong { color: var(--admin-text); font-size: 12px; font-weight: 600; }
.record-section { border-bottom: 1px solid var(--admin-line-soft); padding: 18px 21px; }
.record-section:last-of-type { border-bottom: 0; }
.record-section-head { align-items: baseline; display: flex; gap: 9px; justify-content: space-between; margin-bottom: 12px; }
.record-section-head h3 { font-size: 13px; margin: 0; }
.record-dimensions { gap: 13px; }
.record-copy, .record-prompt, .record-transcript { color: var(--admin-muted); font-size: 12px; line-height: 1.65; margin: 0; white-space: pre-wrap; }
.insight-columns { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.insight-list { color: var(--admin-muted); font-size: 11px; line-height: 1.6; margin: 0; padding-left: 16px; }
.insight-list li + li { margin-top: 5px; }
.next-challenge { background: rgba(245,181,73,.08); border-left: 2px solid var(--admin-amber); margin-top: 14px; padding: 10px 12px; }
.next-challenge p { color: var(--admin-text); font-size: 11px; line-height: 1.5; margin: 0; }
.record-prompt + .record-transcript { border-top: 1px solid var(--admin-line-soft); margin-top: 13px; padding-top: 13px; }

.drawer-backdrop { background: rgba(3, 6, 11, .58); inset: 0; position: fixed; z-index: 25; }
.drawer { background: var(--admin-surface); border-left: 1px solid #35445a; height: 100%; max-width: 600px; overflow-y: auto; padding-bottom: 20px; position: absolute; right: 0; top: 0; width: min(92vw, 600px); }
.drawer .modal-head { position: sticky; top: 0; z-index: 1; }

.toast-stack { bottom: 22px; display: grid; gap: 8px; pointer-events: none; position: fixed; right: 22px; width: min(360px, calc(100vw - 44px)); z-index: 50; }
.toast { align-items: flex-start; background: #172332; border: 1px solid #344963; border-left: 3px solid var(--admin-primary); border-radius: 5px; box-shadow: 0 10px 30px rgba(0,0,0,.3); color: var(--admin-text); display: flex; font-size: 12px; gap: 9px; padding: 11px 12px; pointer-events: auto; }
.toast.success { border-left-color: var(--admin-green); }
.toast.error { border-left-color: var(--admin-coral); }

.loading-line { animation: pulse 1.2s ease-in-out infinite; background: var(--admin-surface-2); border-radius: 3px; height: 14px; width: 100%; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.empty-state { color: var(--admin-faint); padding: 42px 20px; text-align: center; }
.empty-state strong { color: var(--admin-muted); display: block; font-size: 13px; margin-bottom: 5px; }
.empty-state p { font-size: 11px; margin: 0; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  :root { --admin-sidebar: 220px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; width: 100%; }
  .mobile-menu { align-items: center; background: transparent; border: 0; color: var(--admin-muted); display: inline-flex; padding: 4px; }
  .topbar { gap: 12px; padding: 0 20px; }
  .main-content { padding: 26px 20px; }
  .section-grid, .detail-grid { grid-template-columns: 1fr; }
  .section-list { display: flex; gap: 5px; overflow-x: auto; padding: 9px; }
  .section-list-item { flex: 0 0 auto; margin: 0; width: auto; }
}

@media (max-width: 640px) {
  .topbar { height: 58px; }
  .sync-state { display: none; }
  .main-content { padding: 22px 14px; }
  .view-header { align-items: flex-start; flex-direction: column; gap: 15px; }
  .view-header h1 { font-size: 22px; }
  .view-actions { width: 100%; }
  .view-actions .btn { flex: 1; }
  .metric-grid { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card::after { left: 14px; right: 14px; }
  .metric-card .metric-value { font-size: 25px; margin-top: 13px; }
  .panel-head, .panel-body { padding-left: 14px; padding-right: 14px; }
  .activity-time { font-size: 9px; }
  .toolbar { align-items: stretch; flex-direction: column; padding: 11px 12px; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-wrap { flex: 1; min-width: 0; }
  .toolbar-right .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field-full { grid-column: auto; }
  .user-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .user-dimensions { padding-left: 14px; padding-right: 14px; }
  .period-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding-left: 16px; padding-right: 16px; }
  .record-overview { grid-template-columns: 112px minmax(0, 1fr); }
  .record-score { min-height: 104px; padding: 12px; }
  .record-score strong { font-size: 32px; }
  .record-meta { gap: 12px; padding: 14px 16px; }
  .record-section { padding-left: 16px; padding-right: 16px; }
  .insight-columns { grid-template-columns: 1fr; }
  .toast-stack { bottom: 12px; right: 12px; width: calc(100vw - 24px); }
}

.plain-fieldset { border: 0; margin: 0; min-width: 0; padding: 0; }
.record-copy, .upload-document__body { overflow-wrap: anywhere; }
[data-expiry-date][hidden] { display: none; }

.ledger-link { background: transparent; border: 0; color: var(--admin-primary); cursor: pointer; font: inherit; font-weight: 600; max-width: 100%; padding: 0; text-align: left; overflow-wrap: anywhere; }
.ledger-link:hover { color: var(--admin-primary-strong); text-decoration: underline; }
.ledger-link:focus-visible { outline: 2px solid var(--admin-primary); outline-offset: 4px; }
.ledger-grid { display: grid; gap: 17px 24px; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 16px 0; }
.ledger-field { min-width: 0; }
.ledger-field dt { color: var(--admin-faint); font-size: 11px; line-height: 1.5; margin-bottom: 5px; }
.ledger-field dd { color: var(--admin-text); font-size: 13px; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
.ledger-section { border-top: 1px solid var(--admin-line-soft); margin-top: 20px; padding-top: 18px; }
.ledger-section-head { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 14px; }
.ledger-section-head h3 { font-size: 14px; margin: 0; }
.ledger-section-head p { line-height: 1.6; margin-bottom: 0; }
.ledger-identity { margin-top: 12px; }
.ledger-identity .sub, .ledger-section > .sub { line-height: 1.7; }
.ledger-card-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; padding: 12px 0; }
.ledger-card-row + .ledger-card-row { border-top: 1px solid var(--admin-line-soft); }
.ledger-amount { color: var(--admin-text); font-size: 24px; white-space: nowrap; }
.ledger-empty, .ledger-loading { color: var(--admin-muted); font-size: 12px; line-height: 1.7; padding: 18px 0; }
.ledger-empty .btn, .ledger-load-error .btn { margin-top: 12px; }
.user-ledger { border-top: 1px solid var(--admin-line-soft); padding: 0 21px 20px; }
.ledger-history td { font-size: 11px; }
.ledger-history .mono { overflow-wrap: anywhere; white-space: normal; }
.ledger-toolbar .toolbar-left { flex-wrap: wrap; }
.ledger-toolbar .search-input { min-width: 230px; }
.ledger-scope-input { width: 170px; }
.refund-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.refund-detail .notice, .refund-warning { line-height: 1.8; }
.refund-warning { background: rgba(245, 158, 11, .09); border: 1px solid rgba(245, 158, 11, .4); border-radius: 6px; color: var(--admin-amber, #f8c46b); font-size: 13px; margin: 12px 0; padding: 12px 14px; }
@media (max-width: 640px) {
  .user-ledger { padding-left: 14px; padding-right: 14px; }
  .ledger-grid { gap: 15px; grid-template-columns: 1fr; }
  .ledger-card-row { grid-template-columns: 1fr; }
  .ledger-section-head { flex-wrap: wrap; }
  .ledger-toolbar .search-input, .ledger-scope-input { min-width: 0; width: 100%; }
}
