/* ============================================================
   Textbook Management — design system
   Light, airy, international: cool blue + mint on soft white
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --bg: #f3f7fe;
  --panel: #ffffff;
  --panel-2: #f5f9fe;
  --panel-3: #eef4fd;
  --ink: #0f1f3d;
  --ink-2: #2b3d5c;
  --muted: #5f7392;
  --muted-2: #8ea0bb;
  --line: #e2eaf7;
  --line-2: #eef3fb;
  --line-strong: #d3e0f2;

  --brand: #2f6bed;
  --brand-2: #1c55d6;
  --brand-3: #6ea8ff;
  --brand-soft: #e9f1ff;
  --brand-ring: rgba(47, 107, 237, .18);
  --brand-grad: linear-gradient(135deg, #4385ff 0%, #2f6bed 58%, #1c55d6 100%);

  --mint: #0fbfa4;
  --mint-2: #0a9f8b;
  --mint-soft: #e2faf5;
  --sky: #2fb3f7;
  --sky-soft: #e5f6ff;

  --green: #0e9f6e;
  --green-soft: #e2f7ef;
  --amber: #d97706;
  --amber-soft: #fdf1e0;
  --red: #e11d48;
  --red-soft: #fdeaef;
  --violet: #7c3aed;
  --violet-soft: #f0e9ff;
  --blue-soft: #e9f1ff;

  /* aliases kept so older rules stay on-palette */
  --navy: #2f6bed;
  --navy-2: #1c55d6;
  --accent: #2f6bed;
  --accent-2: #1c55d6;
  --accent-soft: #e9f1ff;
  --gold: #0fbfa4;
  --gold-2: #0fbfa4;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 84, .05);
  --shadow: 0 1px 2px rgba(16, 42, 84, .04), 0 16px 34px -24px rgba(16, 42, 84, .45);
  --shadow-lg: 0 30px 70px -26px rgba(16, 42, 84, .32), 0 2px 8px rgba(16, 42, 84, .06);

  --sidebar-w: 264px;
  --topbar-h: 60px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: var(--font);
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background:
    radial-gradient(1100px 560px at 8% -12%, #e9f2ff 0%, rgba(233, 242, 255, 0) 62%),
    radial-gradient(900px 520px at 102% -8%, #e4fbf6 0%, rgba(228, 251, 246, 0) 58%),
    var(--bg);
  background-attachment: fixed;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(47, 107, 237, .16); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfdcf0; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c8e4; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
#app { min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); position: fixed; inset: 0 auto 0 0; z-index: 50;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px) saturate(140%);
  color: var(--ink-2); display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 30px -26px rgba(16, 42, 84, .55);
  overflow: hidden;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line-2);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--brand-grad); color: #fff;
  border: 0; display: grid; place-items: center;
  box-shadow: 0 8px 18px -8px rgba(47, 107, 237, .8);
}
.brand-name { font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; line-height: 1.25; }
.brand-sub { font-size: 9px; color: var(--muted-2); margin-top: 4px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.5; }
.nav { overflow-y: auto; padding: 14px 14px 26px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(95, 115, 146, .22) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(95, 115, 146, .22); border: 0; border-radius: 99px; }
.nav-group { margin: 20px 10px 8px; color: var(--muted-2); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; position: relative;
  transition: background .16s ease, color .16s ease; text-decoration: none; user-select: none;
}
.nav-item:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav-item.active {
  background: var(--brand-soft); color: var(--brand-2); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(47, 107, 237, .1);
}
.nav-item.active::before { content: none; }
.nav-item .ico { color: var(--muted-2); opacity: 1; flex: none; }
.nav-item:hover .ico { color: var(--muted); }
.nav-item.active .ico { color: var(--brand); opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
  padding: 0 6px; border-radius: 999px; line-height: 17px; font-variant-numeric: tabular-nums;
}
.nav-badge.red { background: var(--red); }
.nav-badge.blue { background: var(--brand); }
.nav-badge.amber { background: var(--amber); }
.sidebar-foot {
  border-top: 1px solid var(--line-2); padding: 14px 22px;
  color: var(--muted-2); font-size: 10px; display: flex; align-items: center; gap: 8px;
  letter-spacing: .08em; text-transform: uppercase;
}
.sidebar-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(14, 159, 110, .14); }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  background: rgba(255, 255, 255, .84); backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 0 26px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; overflow: hidden; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }
.menu-btn { display: none; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { color: var(--muted-2); }
.school-chip, .year-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 11.5px;
  color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.school-chip .ico { color: var(--mint); }
.year-chip { color: var(--muted); font-weight: 500; background: var(--panel-2); border-color: var(--line-2); }
.top-search {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  color: var(--muted); font-size: 12px; cursor: pointer; min-width: 210px;
  transition: border-color .15s, background .15s;
}
.top-search:hover { background: #fff; border-color: var(--line-strong); }
.top-search kbd {
  margin-left: auto; font-family: var(--font); font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; background: #fff;
}
.icon-btn {
  width: 34px; height: 34px; border: 1px solid transparent; background: transparent;
  border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer;
  position: relative; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
.icon-btn.menu-btn { display: none; }
.icon-btn .ping {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px #fff;
}
.lang-switch { display: flex; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-switch button {
  border: 0; background: transparent; border-radius: 999px; padding: 3px 9px; font-size: 10.5px;
  font-weight: 600; color: var(--muted); cursor: pointer; letter-spacing: .06em;
}
.lang-switch button.on { background: var(--brand); color: #fff; box-shadow: 0 3px 8px -4px rgba(47, 107, 237, .9); }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 3px 8px 3px 3px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
}
.user-chip:hover { background: var(--panel-2); border-color: var(--line-2); }
.user-chip .avatar { border-radius: 50%; font-size: 11px; }
.user-meta { line-height: 1.25; }
.user-meta b { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.user-meta span { font-size: 10px; color: var(--muted-2); letter-spacing: .04em; }
.view { padding: 28px 32px 72px; width: 100%; max-width: 1600px; margin: 0 auto; flex: 1; }
.view:focus { outline: none; }

/* ---------- page ---------- */
.page { animation: fadeUp .22s ease both; }
.page-head {
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding-bottom: 4px; margin-bottom: 22px;
}
.page-head .ph-main { flex: 1; min-width: 240px; }
.page-eyebrow {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand); font-weight: 700; margin-bottom: 8px;
}
.page-title { margin: 0; font-family: var(--font); font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.page-sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding-top: 3px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 30px 0 12px; }
.section-title { margin: 0; font-family: var(--font); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.section-sub { font-size: 11.5px; color: var(--muted); }
.section-head .spacer { flex: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 0; }
.card-head .ch-main { flex: 1; min-width: 0; }
.card-title { font-family: var(--font); font-size: 14.5px; font-weight: 700; margin: 0; letter-spacing: -.005em; color: var(--ink); }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.card-body { padding: 16px 24px 22px; }
.card-body.flush { padding: 12px 0 0; }
.grid { display: grid; gap: 18px; }
.grid > *, .vstack > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden; min-height: 122px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow);
}
.stat::after { content: none; }
.stat-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.stat-icon {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); border: 0;
}
.stat.green .stat-icon { background: var(--green-soft); color: var(--green); border: 0; }
.stat.amber .stat-icon { background: var(--amber-soft); color: var(--amber); border: 0; }
.stat.red .stat-icon { background: var(--red-soft); color: var(--red); border: 0; }
.stat.violet .stat-icon { background: var(--violet-soft); color: var(--violet); border: 0; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.stat-value { position: relative; z-index: 1; font-family: var(--font); font-size: 31px; font-weight: 700; letter-spacing: -.03em; margin-top: 14px; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-value small { font-family: var(--font); font-size: 11.5px; color: var(--muted); font-weight: 500; margin-left: 5px; letter-spacing: 0; }
.stat-foot { position: relative; z-index: 1; font-size: 11px; color: var(--muted); margin-top: 7px; display: flex; align-items: center; gap: 5px; }
.stat-foot.up { color: var(--green); }
.stat-foot.down { color: var(--red); }

/* ---------- booklist cards ---------- */
.bl-card { display: flex; flex-direction: column; cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.bl-card:hover { border-color: var(--brand-3); transform: translateY(-2px); box-shadow: 0 20px 38px -26px rgba(16, 42, 84, .55); }
.bl-name { font-size: 14.5px; font-weight: 700; line-height: 1.4; letter-spacing: -.005em; }
.bl-progress { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
  letter-spacing: 0; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--brand-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand-grad); border-color: transparent; color: #fff;
  box-shadow: 0 10px 22px -12px rgba(47, 107, 237, .9);
}
.btn-primary:hover { background: linear-gradient(135deg, #3579ff 0%, #245cd8 58%, #164abd 100%); border-color: transparent; color: #fff; }
.btn-danger { background: #fff; border-color: #f3c9d4; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f0a9ba; color: var(--red); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-2); box-shadow: none; }
.btn-soft:hover { background: #dfeaff; border-color: transparent; color: var(--brand-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 9px; gap: 5px; }
.btn-xs { height: 27px; padding: 0 9px; font-size: 11px; border-radius: 8px; gap: 4px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-2); font-size: inherit; cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.action-row { display: flex; gap: 2px; align-items: center; }

/* ---------- filters / forms ---------- */
.filters {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.filters .field { min-width: 128px; }
.filters .grow { flex: 1 1 220px; min-width: 190px; }
.filters .spacer { display: none; }
.filters > .hstack { margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field .hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 0 12px; font-size: 13px; background: #fff; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f7392' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.textarea { height: auto; min-height: 78px; padding: 9px 12px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input::placeholder, .textarea::placeholder { color: #a9b7cc; }
.input-sm { height: 34px; font-size: 12.5px; border-radius: 9px; }
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.search-box .input { padding-left: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-sep { grid-column: 1 / -1; border-top: 1px solid var(--line-2); margin: 4px 0 0; padding-top: 14px; font-size: 10.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .14em; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check-row input[type="checkbox"], .check-row input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 21px; border-radius: 999px; background: #d7e1f1; transition: background .15s; position: relative; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(16, 42, 84, .25); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }
.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.radio-card { border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 12px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; background: #fff; }
.radio-card:hover { border-color: var(--brand-3); background: var(--panel-2); }
.radio-card input { display: none; }
.radio-card .rc-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.radio-card .rc-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #b9c7dc; flex: none; position: relative; background: #fff; }
.radio-card .rc-sub { font-size: 11px; color: var(--muted); margin-top: 3px; padding-left: 22px; }
.radio-card input:checked ~ .rc-top .rc-dot { border-color: var(--brand); }
.radio-card input:checked ~ .rc-top .rc-dot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--brand); }
.radio-card input:checked ~ .rc-top { color: var(--brand-2); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 30px; height: 32px; border: 0; background: var(--panel-2); color: var(--ink-2); font-size: 15px; cursor: pointer; }
.stepper button:hover { background: var(--brand-soft); color: var(--brand-2); }
.stepper input { width: 42px; height: 32px; border: 0; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; outline: none; }
.stepper .max { color: var(--muted-2); font-size: 11px; padding-right: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.card .table-wrap { border: 0; border-radius: 0; }
.table-wrap.scroll-y { max-height: 520px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data th {
  position: sticky; top: 0; z-index: 2; background: #f7faff; text-align: left; font-weight: 700;
  color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: #f8fbff; }
.data tbody tr.clickable { cursor: pointer; }
.data tbody tr.muted-row { background: var(--panel-2); color: var(--muted); }
.data tbody tr.frozen-row { background: #fffaf0; }
.data td.num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data td.center, .data th.center { text-align: center; }
.data .cell-strong { font-weight: 600; color: var(--ink); }
.data .cell-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.data .cell-title { font-weight: 600; line-height: 1.4; color: var(--ink); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); background: var(--panel-2); flex-wrap: wrap; }
.table-foot .pager { display: flex; gap: 5px; }
.table-foot .pager button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 11px; cursor: pointer; color: var(--muted); font-variant-numeric: tabular-nums; }
.table-foot .pager button:hover { border-color: var(--brand-3); color: var(--brand-2); }
.table-foot .pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.table-foot .pager button[disabled] { opacity: .4; cursor: default; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.num-cell { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; line-height: 1.65; white-space: nowrap;
  background: var(--panel-3); color: var(--muted); border: 1px solid transparent;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.b-blue { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.b-green { background: var(--green-soft); color: #0a7f59; border-color: transparent; }
.b-amber { background: var(--amber-soft); color: #a85c04; border-color: transparent; }
.b-red { background: var(--red-soft); color: #c01237; border-color: transparent; }
.b-violet { background: var(--violet-soft); color: #6d28d9; border-color: transparent; }
.b-gray { background: var(--panel-3); color: var(--muted); border-color: transparent; }
.b-teal { background: var(--mint-soft); color: var(--mint-2); border-color: transparent; }
.b-navy { background: #e8eefb; color: #1e3a8a; border-color: transparent; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; background: var(--panel-2); color: var(--ink-2); font-size: 11px; font-weight: 500;
  border: 1px solid var(--line); white-space: nowrap;
}
.chip.blue { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.chip.green { background: var(--green-soft); color: #0a7f59; border-color: transparent; }
.chip.amber { background: var(--amber-soft); color: #a85c04; border-color: transparent; }
.chip.red { background: var(--red-soft); color: #c01237; border-color: transparent; }
.chip.outline { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.chip .ico { opacity: .8; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); border: 1px solid transparent; color: var(--muted); font-weight: 600; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(14, 159, 110, .14); }
.status-dot.off::before { background: #9aa8bd; box-shadow: 0 0 0 3px rgba(154, 168, 189, .16); }
.status-dot.warn::before { background: var(--amber); box-shadow: 0 0 0 3px rgba(217, 119, 6, .14); }
.status-dot.bad::before { background: var(--red); box-shadow: 0 0 0 3px rgba(225, 29, 72, .14); }

/* ---------- misc ---------- */
.progress { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.progress-track { flex: 1; height: 7px; border-radius: 999px; background: #e8effb; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-3), var(--brand)); transition: width .3s ease; }
.progress-fill.green { background: linear-gradient(90deg, #34d3a6, var(--green)); }
.progress-fill.amber { background: linear-gradient(90deg, #fbbf24, var(--amber)); }
.progress-fill.red { background: linear-gradient(90deg, #fb7185, var(--red)); }
.progress-label { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4f8bff, #1c55d6);
  flex: none; letter-spacing: .02em;
}
.avatar.green { background: linear-gradient(135deg, #2fd4a4, #0a9f6e); }
.avatar.amber { background: linear-gradient(135deg, #fbbf5b, #d97706); }
.avatar.violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.avatar.gray { background: linear-gradient(135deg, #a9b7cc, #7d8ba3); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .pm { min-width: 0; line-height: 1.35; }
.person .pm b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.person .pm span { font-size: 11px; color: var(--muted); }
.book-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cover {
  width: 32px; height: 42px; border-radius: 3px 6px 6px 3px; flex: none;
  background: var(--cover, linear-gradient(150deg, #4f8bff, #1c55d6)); position: relative; color: #fff;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  box-shadow: inset 2px 0 0 rgba(0, 0, 0, .18), 0 3px 8px -3px rgba(16, 42, 84, .5); overflow: hidden;
}
.cover::after { content: none; }
.cover::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,0) 48%, rgba(0,0,0,.22));
}
.cover-band { position: absolute; left: 0; right: 0; top: 26%; height: 1px; background: rgba(255,255,255,.42); z-index: 1; }
.cover span { position: relative; z-index: 1; opacity: .94; }
.cover.lg { width: 88px; height: 118px; border-radius: 6px 12px 12px 6px; }
.cover.lg span { font-family: var(--font); font-size: 24px; font-weight: 700; letter-spacing: .08em; }
.cover-code {
  display: none; position: absolute; left: 0; right: 0; bottom: 7px; z-index: 1;
  font-style: normal; font-size: 6px; letter-spacing: .1em; text-align: center; opacity: .72;
}
.cover.lg .cover-code { display: block; }
.cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
  object-fit: cover; object-position: center top; background: #fff;
  box-shadow: inset 2px 0 0 rgba(0, 0, 0, .14);
}
.book-meta { min-width: 0; line-height: 1.4; }
.book-meta b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; color: var(--ink); }
.book-meta span { font-size: 11px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 9px 14px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); word-break: break-word; }
.kv.tight { gap: 7px 12px; font-size: 12px; }
.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: 12px;
  font-size: 12.5px; border: 1px solid; margin-bottom: 14px;
}
.banner .ico { flex: none; margin-top: 1px; }
.banner b { font-weight: 700; }
.banner.info { background: var(--brand-soft); border-color: #d5e4ff; color: #1e46ad; }
.banner.success { background: var(--green-soft); border-color: #c6eede; color: #087154; }
.banner.warn { background: var(--amber-soft); border-color: #f7e1bd; color: #8a4d05; }
.banner.danger { background: var(--red-soft); border-color: #f8ccd8; color: #a80f31; }
.banner .b-main { flex: 1; min-width: 0; }
.banner .b-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 46px 18px; text-align: center; color: var(--muted); }
.empty .e-ico { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand-3); }
.empty b { display: block; color: var(--ink-2); font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.empty span { font-size: 12px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.dot-sep { color: var(--muted-2); margin: 0 5px; }
.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vstack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.text-right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiny { font-size: 10.5px; }
.help-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.85; }
.help-list li::marker { color: var(--brand); }
.note { font-size: 11.5px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 11px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-2); border-bottom-color: var(--brand); font-weight: 700; }
.tab .count { font-size: 10px; background: var(--panel-3); border: 1px solid transparent; border-radius: 999px; padding: 0 6px; margin-left: 5px; color: var(--muted); }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--panel-3); border: 1px solid transparent; }
.segmented button { border: 1px solid transparent; background: transparent; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button.on { background: #fff; color: var(--brand-2); border-color: var(--line); box-shadow: var(--shadow-sm); }

/* ---------- modal / drawer ---------- */
#overlays { position: relative; z-index: 100; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 31, 61, .42); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .16s ease;
}
.modal-overlay.in { opacity: 1; }
.modal {
  width: 640px; max-width: 100%; max-height: calc(100vh - 48px); background: #fff;
  border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateY(10px) scale(.99); transition: transform .18s ease;
}
.modal-overlay.in .modal { transform: none; }
.modal.sm { width: 440px; }
.modal.lg { width: 840px; }
.modal.xl { width: 1060px; }
.modal-head { padding: 22px 26px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; }
.modal-head .mh-main { flex: 1; min-width: 0; }
.modal-title { margin: 0; font-family: var(--font); font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -.015em; color: var(--ink); }
.modal-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 20px 26px; overflow: auto; }
.modal-foot { padding: 15px 26px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 9px; background: #fbfdff; border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15, 31, 61, .36); backdrop-filter: blur(2px); z-index: 95;
  display: flex; justify-content: flex-end; opacity: 0; transition: opacity .18s ease;
}
.drawer-overlay.in { opacity: 1; }
.drawer {
  width: 620px; max-width: 100%; height: 100%; background: #fff; display: flex; flex-direction: column;
  box-shadow: -30px 0 70px -30px rgba(16, 42, 84, .5); transform: translateX(28px); transition: transform .2s ease;
}
.drawer-overlay.in .drawer { transform: none; }
.drawer.wide { width: 780px; }
.drawer-head { padding: 22px 26px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head .dh-main { flex: 1; min-width: 0; }
.drawer-title { margin: 0; font-family: var(--font); font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -.015em; color: var(--ink); }
.drawer-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.drawer-body { padding: 22px 26px 30px; overflow: auto; flex: 1; }
.drawer-foot { padding: 15px 26px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end; background: #fbfdff; flex-wrap: wrap; }
.close-x { width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: var(--panel-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.close-x:hover { background: var(--brand-soft); color: var(--brand-2); }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 9px; align-items: flex-start; background: #fff;
  border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 12px;
  padding: 12px 15px; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px;
  font-size: 12.5px; color: var(--ink-2); animation: toastIn .22s ease both;
}
.toast.green { border-left-color: var(--green); }
.toast.amber { border-left-color: var(--amber); }
.toast.red { border-left-color: var(--red); }
.toast .t-ico { flex: none; margin-top: 1px; }
.toast.green .t-ico { color: var(--green); }
.toast.amber .t-ico { color: var(--amber); }
.toast.red .t-ico { color: var(--red); }
.toast.info .t-ico { color: var(--brand); }
.toast.out { animation: toastOut .18s ease both; }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60;
  overflow: hidden; animation: pop .16s ease both;
}
.dropdown-head { padding: 13px 15px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; }
.dropdown-head b { font-size: 12.5px; }
.dropdown-list { max-height: 380px; overflow: auto; }
.dropdown-item { display: flex; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line-2); cursor: pointer; text-decoration: none; color: inherit; }
.dropdown-item:last-child { border-bottom: 0; }
.dropdown-item:hover { background: var(--panel-2); text-decoration: none; }
.dropdown-item .di-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); border: 1px solid transparent; color: var(--brand); flex: none; }
.dropdown-item .di-main { flex: 1; min-width: 0; }
.dropdown-item b { display: block; font-size: 12px; font-weight: 600; }
.dropdown-item span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.dropdown-foot { padding: 10px 15px; border-top: 1px solid var(--line-2); text-align: center; font-size: 11px; background: var(--panel-2); }

/* ---------- charts ---------- */
.chart { width: 100%; }
.bar-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 52px; gap: 12px; align-items: center; margin: 10px 0; }
.bar-label { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; border-radius: 999px; background: #e8effb; overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand-3), var(--brand)); border-radius: 999px 0 0 999px; transition: width .4s ease; }
.bar-fill.green { background: linear-gradient(90deg, #34d3a6, var(--green)); }
.bar-fill.amber { background: linear-gradient(90deg, #fbbf24, var(--amber)); }
.bar-fill.red { background: linear-gradient(90deg, #fb7185, var(--red)); }
.bar-fill.gray { background: #c3d2e8; }
.bar-fill + .bar-fill { border-radius: 0; }
.bar-fill:last-child { border-radius: 0 999px 999px 0; }
.bar-val { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; flex: none; }
.donut-num { font-family: var(--font); font-size: 21px; font-weight: 700; fill: var(--ink); }
.donut-lbl { font-size: 10px; fill: var(--muted); letter-spacing: .06em; }
.legend { display: flex; flex-direction: column; gap: 8px; min-width: 150px; flex: 1; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-row .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-row b { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-row span { color: var(--muted); }
.cols { display: flex; align-items: flex-end; gap: 16px; height: 170px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.col-group { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.col-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; width: 100%; }
.col-bar { width: 12px; min-height: 2px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--brand-3), var(--brand)); transition: height .4s ease; }
.col-bar.green { background: linear-gradient(180deg, #34d3a6, var(--green)); }
.col-bar.amber { background: linear-gradient(180deg, #fbbf24, #e08b0d); }
.col-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.col-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 11px; color: var(--muted); }
.col-legend span { display: inline-flex; align-items: center; gap: 5px; }
.col-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.spark { width: 100%; height: 180px; display: block; }
.grid-line { stroke: #e6eefb; stroke-width: 1; }
.axis-text { font-size: 9px; fill: #8ea0bb; }

/* ---------- special blocks ---------- */
.hero {
  background: linear-gradient(120deg, #eaf2ff 0%, #f3f9ff 42%, #e6fbf6 100%);
  color: var(--ink); border: 1px solid #dde9fb; border-radius: 22px;
  padding: 28px 30px; position: relative; overflow: hidden;
  margin-bottom: 20px; box-shadow: 0 24px 50px -40px rgba(16, 42, 84, .75);
}
.hero::after {
  content: ""; position: absolute; right: 120px; bottom: -190px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(15, 191, 164, .26), rgba(15, 191, 164, 0) 62%);
  pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; right: -100px; top: -170px; width: 380px; height: 380px;
  border-radius: 50%; background: radial-gradient(circle, rgba(47, 107, 237, .2), rgba(47, 107, 237, 0) 64%);
  pointer-events: none;
}
.hero-main { position: relative; z-index: 1; display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.hero-eyebrow { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.hero h2 { margin: 0; font-family: var(--font); font-size: 28px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); }
.hero p { margin: 8px 0 0; font-size: 13px; color: var(--muted); max-width: 700px; }
.hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .hero-meta {
  display: flex; gap: 26px; margin-top: 26px; padding-top: 20px;
  border-top: 1px solid rgba(47, 107, 237, .14); flex-wrap: wrap; position: relative; z-index: 1;
}
.hero .hm { display: flex; flex-direction: column; gap: 3px; }
.hero .hm + .hm { padding-left: 26px; border-left: 1px solid rgba(47, 107, 237, .14); }
.hero .hm b { font-family: var(--font); font-size: 23px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hero .hm b.warn { color: var(--red); }
.hero .hm span { font-size: 10px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.hero .btn { background: rgba(255, 255, 255, .86); border-color: #d6e4fa; color: var(--ink-2); }
.hero .btn:hover { background: #fff; border-color: var(--brand-3); color: var(--ink); }
.hero .btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; }
.hero .btn-primary:hover { background: linear-gradient(135deg, #3579ff 0%, #245cd8 58%, #164abd 100%); border-color: transparent; color: #fff; }

.stat-strip { display: flex; gap: 0; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stat-strip .ss { flex: 1; padding: 15px 18px; border-right: 1px solid var(--line-2); min-width: 0; }
.stat-strip .ss:last-child { border-right: 0; }
.stat-strip .ss b { display: block; font-family: var(--font); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); }
.stat-strip .ss span { font-size: 10.5px; color: var(--muted); letter-spacing: .03em; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 2px; border-radius: 99px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line-strong);
}
.tl-item.done::before { border-color: var(--green); background: var(--green); }
.tl-item.now::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.tl-title { font-size: 12.5px; font-weight: 600; }
.tl-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.checklist { display: flex; flex-direction: column; gap: 2px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.check-item:last-child { border-bottom: 0; }
.check-dot { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.check-dot.pending { background: var(--amber-soft); color: var(--amber); }
.check-item .ci-main { flex: 1; min-width: 0; }
.check-item .ci-main b { font-weight: 600; font-size: 12.5px; display: block; }
.check-item .ci-main span { font-size: 11px; color: var(--muted); }
.check-item .ci-act { font-size: 11.5px; }

.scan-box {
  border: 1px dashed var(--brand-3); background: linear-gradient(180deg, #f2f8ff, #eefbf8);
  border-radius: 16px; padding: 26px; text-align: center; margin-bottom: 14px;
}
.scan-box .scan-icon {
  width: 48px; height: 48px; border-radius: 14px; background: #fff; color: var(--brand);
  border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 10px;
  box-shadow: var(--shadow-sm);
}
.scan-box .scan-title { font-family: var(--font); font-size: 16px; font-weight: 700; }
.scan-box .scan-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.scan-box .scan-input { max-width: 480px; margin: 15px auto 0; position: relative; }
.scan-box .scan-input .input { height: 46px; padding-left: 40px; font-size: 13.5px; border-color: var(--line-strong); box-shadow: none; border-radius: 12px; }
.scan-box .scan-input .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--brand); }

.student-card {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.student-card .avatar { width: 48px; height: 48px; font-size: 15px; border-radius: 50%; }
.student-card .sc-main { flex: 1; min-width: 0; }
.student-card .sc-name { font-family: var(--font); font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.student-card .sc-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.student-card .sc-progress { min-width: 170px; }
.student-card .sc-progress .progress { margin-top: 6px; }

.summary-card { position: sticky; top: calc(var(--topbar-h) + 18px); align-self: start; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 6px 0; }
.summary-line span { color: var(--muted); }
.summary-line b { font-variant-numeric: tabular-nums; font-weight: 600; }
.summary-total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.summary-total span { font-size: 12px; color: var(--muted); }
.summary-total b { font-family: var(--font); font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.receipt { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; }
.receipt-head { display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line-2); padding-bottom: 12px; margin-bottom: 12px; }
.receipt-head h4 { margin: 0; font-family: var(--font); font-size: 15px; font-weight: 700; }
.receipt-head p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.receipt-sign { display: flex; gap: 30px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 11px; color: var(--muted); }
.receipt-sign div { flex: 1; border-bottom: 1px solid var(--line-strong); padding-bottom: 20px; }

.matrix-table td, .matrix-table th { text-align: center; }
.matrix-table td:first-child, .matrix-table th:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
.matrix-table th:first-child { background: #f7faff; z-index: 3; }
.matrix-cell-ok { color: var(--green); font-weight: 700; }
.matrix-cell-pending { color: var(--amber); font-weight: 700; }
.matrix-cell-none { color: var(--muted-2); }

.perm-matrix td { text-align: center; }
.perm-matrix td:first-child { text-align: left; font-weight: 500; }
.perm-matrix th { text-align: center; }
.perm-matrix th:first-child { text-align: left; }
.perm-matrix input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

.api-doc pre {
  background: #101d3a; color: #c6d7f5; border-radius: 12px; padding: 15px 17px; overflow: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7; margin: 10px 0 0;
}
.endpoint-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.endpoint-row:last-child { border-bottom: 0; }
.method { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; font-family: var(--mono); }
.method.get { background: var(--mint-soft); color: var(--mint-2); }
.method.post { background: var(--brand-soft); color: var(--brand-2); }
.path { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.settings-nav { display: flex; flex-direction: column; gap: 3px; }
.settings-nav button { display: flex; align-items: center; gap: 9px; text-align: left; padding: 10px 12px; border: 1px solid transparent; background: transparent; border-radius: 10px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.settings-nav button:hover { background: var(--panel-2); border-color: transparent; color: var(--ink); }
.settings-nav button.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-2); font-weight: 600; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-layout > * { min-width: 0; }
.settings-main { min-width: 0; }
.settings-side { position: sticky; top: calc(var(--topbar-h) + 18px); }

.upload-zone {
  border: 1px dashed var(--brand-3); border-radius: 16px; padding: 28px; text-align: center;
  background: linear-gradient(180deg, #f4f9ff, #f0fbf8); cursor: pointer;
}
.upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone .uz-icon { width: 48px; height: 48px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--brand); display: grid; place-items: center; margin: 0 auto 9px; box-shadow: var(--shadow-sm); }
.upload-zone b { display: block; font-size: 13px; font-weight: 700; }
.upload-zone span { font-size: 11.5px; color: var(--muted); }

.preview-stat { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.preview-stat div { flex: 1; padding: 11px 13px; border-right: 1px solid var(--line-2); }
.preview-stat div:last-child { border-right: 0; }
.preview-stat b { display: block; font-family: var(--font); font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.preview-stat span { font-size: 10.5px; color: var(--muted); }

/* ---------- cover editor & book lookup ---------- */
.cover-editor { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); background: var(--panel-2); padding: 15px; border-radius: 14px; }
.cover-editor-preview { width: 88px; height: 118px; flex: none; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-2); }
.cover-editor-preview.has-image { border-color: var(--line-strong); }
.cover-editor-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-photo-empty { display: grid; place-items: center; color: var(--muted-2); }
.cover-editor-actions { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cover-editor-actions .hint { max-width: 460px; }

.lookup-bar { display: flex; gap: 8px; align-items: center; }
.lookup-bar .search-box { flex: 1; }
.lookup-status { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lookup-status.ok { color: var(--green); }
.lookup-status.warn { color: var(--amber); }
.lookup-status.err { color: var(--red); }
.lookup-spinner { width: 12px; height: 12px; border: 1.5px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.tr-status { margin-top: 6px; min-height: 0; }
.tr-status:empty { display: none; }

.lookup-results { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden auto; background: #fff; max-height: 268px; }
.lookup-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; cursor: pointer; font-family: inherit; }
.lookup-item:last-child { border-bottom: 0; }
.lookup-item:hover { background: var(--panel-2); }
.lookup-thumb { width: 34px; height: 46px; flex: none; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; color: var(--muted-2); }
.lookup-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lookup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lookup-main b { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lookup-main span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lookup-main .lookup-isbn { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.lookup-main em { font-style: normal; color: var(--amber); }
.lookup-use { flex: none; font-size: 11.5px; color: var(--brand-2); border: 1px solid var(--line-strong); padding: 3px 9px; border-radius: 999px; }
.lookup-item:hover .lookup-use { border-color: var(--brand); background: var(--brand); color: #fff; }

@media (max-width: 640px) {
  .cover-editor { flex-direction: column; }
  .cover-editor-preview { width: 76px; height: 102px; }
  .lookup-bar { flex-direction: column; align-items: stretch; }
  .lookup-use { display: none; }
}

/* ---------- print ---------- */
#print-root { display: none; }
.print-page { padding: 28px 32px; color: #111; font-size: 12px; }
.print-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.print-head h1 { margin: 0; font-family: var(--font); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.print-head p { margin: 4px 0 0; font-size: 11px; color: #555; }
.print-meta { font-size: 11px; color: #444; text-align: right; line-height: 1.6; }
.print-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.print-table th, .print-table td { border: 1px solid #999; padding: 7px 8px; font-size: 11px; text-align: left; }
.print-table th { background: #f0f0f0; }
.print-foot { display: flex; justify-content: space-between; margin-top: 30px; font-size: 11px; color: #333; }
.print-sign { margin-top: 34px; display: flex; gap: 40px; font-size: 11px; }
.print-sign div { flex: 1; border-top: 1px solid #999; padding-top: 6px; }
@media print {
  body { background: #fff; }
  .app-shell, #overlays, #toasts, #mobile-backdrop { display: none !important; }
  #print-root { display: block !important; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .school-chip { display: none; }
  .year-chip { border-left: 0; padding-left: 11px; }
}
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}
@media (max-width: 1080px) {
  :root { --sidebar-w: 236px; }
  .brand { padding: 20px 16px 16px; gap: 10px; }
  .brand-sub { font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { position: static; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
  .top-search { min-width: 0; width: 150px; }
  .user-meta { display: none; }
  .view { padding: 26px 26px 64px; }
  .topbar { padding: 0 24px; }
  .hero .hero-meta { gap: 20px; }
  .hero .hm + .hm { padding-left: 20px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 30px 0 70px -30px rgba(16, 42, 84, .6); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .icon-btn.menu-btn { display: grid; }
  .mobile-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 31, 61, .38); backdrop-filter: blur(2px); z-index: 45; }
  .mobile-backdrop.show { display: block; }
  .view { padding: 20px 18px 52px; }
  .topbar { padding: 0 14px; height: 58px; }
  .year-chip, .top-search { display: none; }
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .radio-cards { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions { margin-left: 0; width: 100%; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 24px); border-radius: 18px 18px 0 0; }
  .drawer { width: 100%; }
  .bar-row { grid-template-columns: 86px minmax(0, 1fr) 42px; }
  .page-title { font-size: 23px; }
  .hero { padding: 22px 20px; border-radius: 18px; }
  .hero h2 { font-size: 23px; }
  .hero .hm + .hm { padding-left: 0; border-left: 0; }
  .hero .hero-meta { gap: 18px 26px; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .school-chip, .year-chip { display: none; }
  .stat-strip { flex-wrap: wrap; }
  .stat-strip .ss { flex: 1 1 45%; border-bottom: 1px solid var(--line-2); }
  .filters .field { flex: 1 1 100%; }
  .filters .grow { flex: 1 1 100%; }
}

/* ---------- signature capture & display ---------- */
.sig-pad { position: relative; border: 1px dashed var(--line-strong); border-radius: 12px; background:
  repeating-linear-gradient(180deg, #fff 0 27px, var(--line-2) 27px 28px); overflow: hidden; }
.sig-canvas { display: block; width: 100%; height: 148px; touch-action: none; cursor: crosshair; }
.sig-empty { position: absolute; inset: 0 0 34px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px; pointer-events: none; }
.sig-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px;
  border-top: 1px solid var(--line); background: var(--panel-2); }
.sig-state { font-size: 12px; color: var(--muted); }
.sig-state.on { color: var(--green); font-weight: 600; }
.sig-person { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); margin-bottom: 10px; }
.sig-person b { display: block; font-size: 13px; }
.sig-person span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.sig-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.sig-block { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sig-block img { height: 62px; max-width: 220px; object-fit: contain; background: #fff; border-radius: 6px; }
.sig-block.empty { border-style: dashed; background: var(--panel-2); color: var(--muted); }
.sig-block.clickable { cursor: zoom-in; }
.sig-block.clickable:hover { border-color: var(--brand-3); }
.sig-meta b { display: block; font-size: 13px; color: var(--ink); }
.sig-meta span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sig-meta .sig-zoom { color: var(--brand-2); }
.sig-field { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.sig-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sig-field-head label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sig-full { text-align: center; background: repeating-linear-gradient(180deg, #fff 0 31px, var(--line-2) 31px 32px); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.sig-full img { max-width: 100%; max-height: 320px; }
.sig-on { color: var(--green); display: inline-flex; align-items: center; gap: 3px; }
.tl-sig { margin-top: 6px; }
.tl-sig img { height: 38px; max-width: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 2px 6px; cursor: zoom-in; }
.print-sig { display: block; height: 52px; max-width: 200px; object-fit: contain; margin: 0 auto 4px; }
.print-sign .sig-line { min-height: 64px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }

/* ---------- on-screen print preview state ---------- */
body.printing { background: #fff; }
body.printing .app-shell,
body.printing #overlays,
body.printing #toasts,
body.printing #mobile-backdrop { display: none !important; }
body.printing #print-root { display: block !important; }
.print-page { max-width: 980px; margin: 0 auto; padding: 28px 32px; background: #fff; }
@media screen {
  body.printing #print-root { padding: 24px 12px; }
}

/* ---------- authentication (legacy card layout) ---------- */
body.auth-mode { background: var(--bg); }
body.auth-mode #app { display: none; }
.auth-boot {
  position: fixed; inset: 0; z-index: 121; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg); color: var(--muted); font-size: 13px; letter-spacing: .04em;
}
.auth-spinner {
  width: 15px; height: 15px; flex: none; display: inline-block; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; opacity: .8;
  animation: spin .8s linear infinite;
}
.auth-spinner.on-light { color: #fff; opacity: .9; }
.auth-screen {
  position: fixed; inset: 0; z-index: 120; overflow: auto;
  display: flex; flex-direction: column; background: var(--bg);
}
.auth-page { min-height: 100%; display: flex; flex-direction: column; }
.auth-masthead {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 74px; padding: 0 34px; background: #fff; border-bottom: 1px solid var(--line);
}
.auth-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.auth-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; border: 0; border-radius: 12px;
  box-shadow: 0 8px 18px -8px rgba(47, 107, 237, .8);
}
.auth-identity-text { min-width: 0; }
.auth-school { font-size: 13.5px; font-weight: 700; letter-spacing: -.005em; color: var(--ink); line-height: 1.25; }
.auth-system { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.auth-system-en { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.auth-masthead-right { display: flex; align-items: center; gap: 18px; flex: none; }
.auth-internal { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.auth-main {
  flex: 1; width: 100%; max-width: 920px; margin: 0 auto;
  padding: 40px 24px; display: flex; flex-direction: column; justify-content: center;
}
.auth-card {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.auth-rail {
  display: flex; flex-direction: column; padding: 40px 32px 28px;
  background: linear-gradient(180deg, #f2f7ff, #edfbf8); border-right: 1px solid var(--line-2);
  border-radius: 13px 0 0 13px;
}
.auth-rail-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.auth-year { margin-top: 10px; font-family: var(--font); font-size: 26px; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.auth-term { margin-top: 5px; font-size: 12px; color: var(--muted); }
.auth-meta-list { margin: 28px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 13px; }
.auth-meta-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-meta-list dt { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.auth-meta-list dd { margin: 0; font-size: 11.5px; color: var(--ink-2); text-align: right; }
.auth-status { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 24px; font-size: 10.5px; letter-spacing: .03em; color: var(--muted); }
.auth-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(14, 159, 110, .16); }
.auth-form-col { display: flex; flex-direction: column; justify-content: center; padding: 44px 56px 36px; }
.auth-form-head .auth-eyebrow { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.auth-form-head h2 { margin: 8px 0 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.auth-form-head p { margin: 7px 0 22px; font-size: 12.5px; color: var(--muted); }
.auth-banner { margin: 0 0 14px; font-size: 12.5px; }
.auth-error {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 11px 13px;
  border: 1px solid #f8ccd8; border-radius: 12px; background: var(--red-soft);
  color: var(--red); font-size: 12px; line-height: 1.55;
}
.auth-form { display: grid; gap: 16px; width: 100%; max-width: 396px; }
.auth-form .field label { font-size: 11.5px; letter-spacing: .01em; }
.auth-form .input { height: 44px; border-radius: 12px; border-color: var(--line-strong); }
.auth-form .input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input .input { padding-right: 42px; }
.auth-eye {
  position: absolute; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.auth-eye:hover { color: var(--brand-2); background: var(--brand-soft); }
.auth-submit { height: 46px; margin-top: 6px; font-size: 13px; letter-spacing: .02em; }
.auth-foot { width: 100%; max-width: 396px; margin: 22px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted-2); }
.auth-copyright { margin: 22px 0 0; text-align: center; font-size: 10.5px; letter-spacing: .03em; color: var(--muted-2); }
@media (max-width: 880px) {
  .auth-masthead { height: auto; min-height: 64px; padding: 14px 16px; gap: 12px; }
  .auth-internal { display: none; }
  .auth-main { padding: 26px 12px 22px; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-rail {
    flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
    padding: 18px 22px; border-right: 0; border-bottom: 1px solid var(--line-2); border-radius: 13px 13px 0 0;
  }
  .auth-rail-label { display: none; }
  .auth-year { margin: 0; font-size: 19px; }
  .auth-term { margin: 0; }
  .auth-meta-list, .auth-status { display: none; }
  .auth-form-col { padding: 26px 22px 30px; }
  .auth-form-head p { margin-bottom: 18px; }
}

/* ---------- authentication: split sign-in ---------- */
body.auth-mode, .auth-screen { background: var(--bg); }
body.auth-mode .auth-screen { background: #fff; }
.auth-page { min-height: 100%; display: block; }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) minmax(0, 1fr); }
.auth-brand {
  background:
    radial-gradient(760px 460px at 108% -12%, rgba(88, 196, 255, .5) 0%, rgba(88, 196, 255, 0) 62%),
    radial-gradient(620px 520px at -16% 112%, rgba(30, 226, 190, .46) 0%, rgba(30, 226, 190, 0) 62%),
    linear-gradient(152deg, #1c3fa6 0%, #2f6bed 52%, #0fb5a0 100%);
  color: #fff; display: flex; flex-direction: column;
  padding: 44px 52px; position: relative; overflow: hidden;
}
.auth-brand-top { display: flex; align-items: center; gap: 14px; }
.auth-mark {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 12px; box-shadow: none; backdrop-filter: blur(6px);
}
.auth-wordmark { font-family: var(--font); font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.01em; line-height: 1.25; }
.auth-wordmark-en { margin-top: 5px; font-size: 7.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .66); line-height: 1.5; }
.auth-brand-main { margin: auto 0; padding: 40px 0; }
.auth-display-eyebrow { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .78); font-weight: 700; }
.auth-display { margin: 16px 0 0; font-family: var(--font); font-size: 44px; line-height: 1.12; font-weight: 700; color: #fff; letter-spacing: -.03em; }
.auth-lede { margin: 18px 0 0; max-width: 430px; font-size: 13px; line-height: 1.85; color: rgba(255, 255, 255, .8); }
.auth-brand-foot {
  display: flex; justify-content: space-between; gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, .22); padding-top: 20px;
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7);
}
.auth-panel { background: #fff; display: flex; flex-direction: column; }
.auth-panel-top { display: flex; justify-content: flex-end; padding: 30px 40px 0; }
.auth-panel-main { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 424px; margin: 0 auto; padding: 32px 24px 56px; }
.auth-eyebrow { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.auth-form-head h2 { margin: 12px 0 0; font-family: var(--font); font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.auth-form-head p { margin: 9px 0 28px; font-size: 12.5px; color: var(--muted); }
.auth-banner { margin: 0 0 16px; font-size: 12px; }
.auth-error { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; padding: 11px 13px; border: 1px solid #f8ccd8; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 12px; line-height: 1.55; }
.auth-form { display: grid; gap: 18px; width: 100%; max-width: none; }
.auth-form .field label { font-size: 11.5px; letter-spacing: .01em; color: var(--ink-2); font-weight: 600; }
.auth-form .input { height: 46px; border-radius: 12px; border-color: var(--line-strong); }
.auth-form .input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.auth-submit { height: 48px; border-radius: 12px; margin-top: 4px; font-size: 13px; letter-spacing: .02em; }
.auth-school-picker { width: 100%; }
.auth-school-list { display: grid; gap: 10px; margin-bottom: 16px; }
.auth-school-option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
  text-align: left; cursor: pointer; font: inherit;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.auth-school-option:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.auth-school-option:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.auth-school-option:disabled { opacity: .55; cursor: default; }
.auth-school-option.busy { border-color: var(--brand); background: var(--brand-soft); opacity: 1; }
.auth-school-logo {
  width: 38px; height: 38px; flex: none; overflow: hidden; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center;
}
.auth-school-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-school-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auth-school-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-school-alt { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-school-go { margin-left: auto; display: grid; place-items: center; color: var(--muted-2); }
.auth-foot { margin: 24px 0 0; font-size: 10.5px; line-height: 1.9; color: var(--muted-2); }
.auth-copyright { margin: 36px 0 0; font-size: 9.5px; letter-spacing: .04em; color: var(--muted-2); }

@media (max-width: 900px) {
  .sidebar { box-shadow: 30px 0 70px -30px rgba(16, 42, 84, .6); }
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 26px 24px 24px; }
  .auth-brand-main { margin: 24px 0 0; padding: 0; }
  .auth-display { font-size: 30px; margin-top: 10px; }
  .auth-lede, .auth-brand-foot { display: none; }
  .auth-panel-top { padding: 18px 20px 0; }
  .auth-panel-main { padding: 20px 24px 44px; max-width: 460px; }
  .auth-form-head h2 { font-size: 26px; }
}
@media (max-width: 640px) {
  .hero .hero-meta { gap: 16px 20px; }
}
@media (max-width: 560px) {
  .school-chip, .year-chip { display: none; }
}

/* ---------------- multi-tenant branding ---------------- */
.brand-mark-logo,
.auth-mark-logo {
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 16px -10px rgba(15, 31, 61, .45);
  overflow: hidden;
}
.auth-mark-logo { background: rgba(255, 255, 255, .95); border-color: rgba(255, 255, 255, .7); }
.brand-mark-logo img,
.auth-mark-logo img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 4px; }

.imp-banner {
  position: sticky; top: 0; z-index: 45;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 26px;
  background: linear-gradient(90deg, #2f6bed 0%, #0fbfa4 100%);
  color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(15, 31, 61, .08);
}
.imp-banner span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-banner .imp-exit {
  color: #fff; text-decoration: none; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px;
  padding: 3px 12px; flex: none;
}
.imp-banner .imp-exit:hover { background: rgba(255, 255, 255, .18); }
body.impersonating .topbar { top: 38px; }
@media (max-width: 900px) {
  .imp-banner { padding: 0 16px; font-size: 12px; }
}

/* ---------------- spreadsheet import ---------------- */
.import-file { border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--panel-2); padding: 14px 16px; }
.import-file-name { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.import-file-name .ico, .import-file-meta .ico { flex: none; }
.import-file-meta { display: flex; align-items: center; gap: 6px; margin: 16px 0 10px; font-size: 12px; color: var(--muted); }
.import-result:not(:empty) { margin-top: 16px; }
.import-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.import-summary .ss { flex: 1 1 120px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; background: #fff; }
.import-summary .ss b { display: block; font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.import-summary .ss span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.import-summary .ss b.pos { color: var(--green); }
.import-summary .ss b.neg { color: var(--red); }
.import-table { max-height: 380px; }
.import-table td { vertical-align: top; }
.import-table tr.import-row-bad td { background: var(--red-soft); }
.import-issues { display: flex; flex-wrap: wrap; gap: 5px; }
.import-issues span { display: inline-block; font-size: 11px; line-height: 1.5; padding: 2px 7px; border-radius: 7px; border: 1px solid transparent; }
.import-issues.err span { background: var(--red-soft); border-color: #f8ccd8; color: var(--red); }
.import-issues.warn span { background: var(--amber-soft); border-color: #f7e1bd; color: #8a4d05; }
.import-subtitle { margin: 16px 0 8px; font-size: 13px; }
@media (max-width: 900px) {
  .import-summary .ss { flex: 1 1 45%; }
  .import-table { max-height: 300px; }
}
