/* =========================================================================
   班务通 · 设计系统
   1. 变量与主题   2. 基础重置   3. 排版工具   4. 表单与按钮
   5. 布局骨架     6. 组件       7. 响应式     8. 动效与无障碍
   ========================================================================= */

/* ---------- 1. 变量与主题 ---------- */
:root {
  --brand-500: #4b5cf5;
  --brand-600: #3d4be0;
  --brand-400: #6d7cff;
  --brand-soft: rgba(75, 92, 245, 0.1);
  --brand-soft-2: rgba(75, 92, 245, 0.16);
  --accent: #7c5cff;

  --success: #0f9d63;
  --success-soft: rgba(15, 157, 99, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.13);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --info: #0b7fd4;
  --info-soft: rgba(11, 127, 212, 0.12);

  --bg: #f4f6fb;
  --bg-grad: radial-gradient(1200px 600px at 12% -10%, #e8ecff 0%, transparent 60%),
             radial-gradient(900px 500px at 100% 0%, #eef1ff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --surface-3: #eef1f8;
  --border: #e6e9f2;
  --border-strong: #d6dbe9;
  --text: #0f1729;
  --text-2: #59627a;
  --text-3: #8a93a8;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 28px -8px rgba(16, 24, 40, 0.16);
  --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, 0.24);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --sidebar-w: 264px;
  --topbar-h: 68px;
  --gap: clamp(14px, 1.4vw, 22px);
  --pad: clamp(16px, 1.8vw, 30px);
  --max-w: 1560px;
  --ring: 0 0 0 3px rgba(75, 92, 245, 0.28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[data-theme="dark"] {
  --brand-soft: rgba(109, 124, 255, 0.16);
  --brand-soft-2: rgba(109, 124, 255, 0.26);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.15);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.15);

  --bg: #080b16;
  --bg-grad: radial-gradient(1000px 520px at 8% -8%, rgba(75, 92, 245, 0.22) 0%, transparent 58%),
             radial-gradient(900px 480px at 100% 0%, rgba(124, 92, 255, 0.16) 0%, transparent 55%);
  --surface: #101521;
  --surface-2: #151b2a;
  --surface-3: #1c2436;
  --border: #232c40;
  --border-strong: #2f3a52;
  --text: #e9edf7;
  --text-2: #9aa5bd;
  --text-3: #6d7891;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 32px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 28px 70px -24px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px rgba(109, 124, 255, 0.35);
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(13.5px, 0.35vw + 12.6px, 15px);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--brand-500); text-decoration: none; }
img, svg { display: block; max-width: 100%; }
input, select, textarea, button { font-family: inherit; }
::selection { background: var(--brand-soft-2); }

[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ---------- 3. 排版与工具 ---------- */
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 0.86em; }
.tiny { font-size: 0.78em; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-brand { color: var(--brand-500); }
.hide-sm { display: initial; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 4. 表单与按钮 ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600; font-size: 0.93em; letter-spacing: 0.01em;
  cursor: pointer; white-space: nowrap;
  transition: background .16s, border-color .16s, transform .12s, box-shadow .16s, color .16s;
  box-shadow: var(--shadow-xs);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-loading { opacity: .62; pointer-events: none; }

.btn-primary {
  --btn-bg: linear-gradient(180deg, var(--brand-400), var(--brand-500) 42%, var(--brand-600));
  --btn-fg: #fff; --btn-bd: transparent;
  box-shadow: 0 6px 16px -6px rgba(75, 92, 245, .7), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-primary:hover { --btn-bg: linear-gradient(180deg, #7c88ff, var(--brand-500) 46%, var(--brand-600)); }
.btn-danger { --btn-fg: var(--danger); --btn-bd: rgba(229,72,77,.4); --btn-bg: var(--danger-soft); }
.btn-danger:hover { --btn-bg: rgba(229,72,77,.2); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-sm { height: 32px; padding: 0 11px; font-size: .87em; border-radius: var(--radius-xs); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 1em; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  cursor: pointer; transition: background .16s, color .16s, border-color .16s;
  flex: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block; margin-bottom: 7px;
  font-size: .84em; font-weight: 600; color: var(--text-2); letter-spacing: .02em;
}
.field-input {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.field-input > svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.field-input:focus-within { border-color: var(--brand-500); box-shadow: var(--ring); }
.field-input input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent; color: var(--text); font-size: .98em;
}
.field-input input::placeholder { color: var(--text-3); }
.input-suffix {
  border: 0; background: transparent; padding: 4px; margin-right: -4px;
  color: var(--text-3); cursor: pointer; border-radius: 6px;
}
.input-suffix:hover { color: var(--text); background: var(--surface-2); }
.input-suffix svg { width: 17px; height: 17px; }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95em; outline: none;
  transition: border-color .16s, box-shadow .16s;
  appearance: none;
}
.textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-500); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .93em; width: fit-content; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand-500); cursor: pointer; }

/* ---------- 5. 布局骨架 ---------- */
.boot {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--bg); background-image: var(--bg-grad);
  transition: opacity .3s ease, visibility .3s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-mark {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brand-400), var(--brand-600));
  color: #fff; box-shadow: 0 16px 40px -14px rgba(75, 92, 245, .8);
  animation: floaty 2.4s ease-in-out infinite;
}
.boot-mark svg { width: 28px; height: 28px; }
.boot-bar { width: 132px; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--brand-500); animation: slide 1.1s ease-in-out infinite; }

/* --- 登录页 --- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.auth-visual {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2b34b8 0%, #4b5cf5 42%, #7c5cff 100%);
  color: #fff; padding: clamp(28px, 4vw, 64px);
  display: flex; align-items: center;
}
.auth-visual::before, .auth-visual::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px);
}
.auth-visual::before {
  width: 520px; height: 520px; right: -180px; top: -160px;
  background: radial-gradient(circle, rgba(255,255,255,.24), transparent 62%);
}
.auth-visual::after {
  width: 420px; height: 420px; left: -140px; bottom: -180px;
  background: radial-gradient(circle, rgba(124, 92, 255, .55), transparent 65%);
}
.auth-visual-inner { position: relative; z-index: 1; width: 100%; max-width: 520px; margin-inline: auto; }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(28px, 5vh, 56px); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; backdrop-filter: blur(6px);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-size: 1.14em; font-weight: 700; letter-spacing: .06em; }
.auth-headline {
  font-size: clamp(26px, 3vw, 42px); line-height: 1.22; font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 16px;
}
.auth-sub { font-size: clamp(13.5px, 1vw, 15.5px); line-height: 1.75; color: rgba(255,255,255,.82); max-width: 44ch; }
.auth-features { list-style: none; margin: clamp(26px, 4vh, 44px) 0 0; padding: 0; display: grid; gap: 16px; }
.auth-features li { display: flex; gap: 13px; align-items: flex-start; }
.auth-features .fi {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
}
.auth-features .fi svg { width: 17px; height: 17px; }
.auth-features b { display: block; font-size: .96em; font-weight: 650; }
.auth-features i { display: block; font-style: normal; font-size: .87em; color: rgba(255,255,255,.72); margin-top: 2px; }
.auth-foot { margin-top: clamp(28px, 5vh, 56px); font-size: .82em; color: rgba(255,255,255,.55); }

.auth-panel {
  display: flex; flex-direction: column;
  padding: clamp(20px, 3vw, 44px);
  position: relative;
}
.auth-panel-top { display: flex; justify-content: flex-end; }
.auth-card {
  margin: auto; width: 100%; max-width: 396px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-md);
}
.auth-card-head { margin-bottom: 26px; }
.auth-card-head h2 { font-size: clamp(20px, 1.7vw, 25px); font-weight: 700; letter-spacing: -.01em; }
.auth-card-head p { margin-top: 6px; color: var(--text-2); font-size: .92em; }
.auth-panel-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding-top: 20px; font-size: .78em; color: var(--text-3);
}
.auth-panel-foot .dot { opacity: .6; }
.auth-hint {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 20px; font-size: .82em; color: var(--text-3); line-height: 1.6;
}
.auth-hint svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* --- 应用骨架 --- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 60;
}
.sidebar-head {
  display: flex; align-items: center; gap: 11px;
  height: var(--topbar-h); padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.sidebar-head .brand-mark {
  background: linear-gradient(150deg, var(--brand-400), var(--brand-600));
  border: 0; box-shadow: 0 8px 20px -8px rgba(75,92,245,.85);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 1em; font-weight: 700; letter-spacing: .04em; }
.brand-text i {
  font-style: normal; font-size: .74em; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { padding: 14px 10px 6px; font-size: .72em; font-weight: 700; letter-spacing: .09em; color: var(--text-3); text-transform: uppercase; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .93em; font-weight: 550;
  cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand-500); font-weight: 650; }
.nav-item.is-active svg { opacity: 1; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand-500);
}
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: .72em; font-weight: 700; display: grid; place-items: center;
}
.nav-item.is-active .nav-badge { background: var(--danger); }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; flex: none; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.user-card .avatar { width: 32px; height: 32px; font-size: .82em; }
.user-card .u-meta { min-width: 0; }
.user-card .u-name { font-weight: 650; font-size: .9em; }
.user-card .u-role { font-size: .75em; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.topbar-menu { display: none; }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: clamp(16px, 1.3vw, 19px); font-weight: 700; letter-spacing: -.01em; }
.topbar-title p { font-size: .78em; color: var(--text-3); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-cta { display: inline-flex; }

.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; border-radius: 99px;
  background: var(--success-soft); color: var(--success);
  font-size: .78em; font-weight: 650; border: 1px solid transparent;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
.live-pill.is-off { background: var(--warn-soft); color: var(--warn); }
.live-pill.is-off .live-dot { animation: none; }

.content { flex: 1; padding: var(--pad); padding-bottom: calc(var(--pad) + 8px); max-width: var(--max-w); width: 100%; margin-inline: auto; }

.bottom-nav { display: none; }
.sidebar-backdrop { display: none; }
.topbar-menu { }
html .i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: block; }

/* ---------- 6. 组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: clamp(16px, 1.4vw, 22px); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px clamp(16px, 1.4vw, 22px); border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: .98em; font-weight: 650; }
.card-head .card-sub { font-size: .78em; color: var(--text-3); margin-top: 1px; }
.card-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.section-title h2 { font-size: 1.05em; font-weight: 700; }
.section-title span { font-size: .8em; color: var(--text-3); }

.grid { display: grid; gap: var(--gap); }
/* 栅格子项默认 min-width:auto，长文本会把卡片撑出屏幕，这里统一收紧 */
.grid > * { min-width: 0; }
.stack > * { min-width: 0; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 216px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); }
.stack { display: grid; gap: var(--gap); }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: clamp(16px, 1.3vw, 20px); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-500); flex: none;
}
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-label { font-size: .82em; color: var(--text-2); font-weight: 600; }
.kpi-value {
  margin-top: 12px; font-size: clamp(24px, 2.1vw, 32px); font-weight: 700;
  letter-spacing: -.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: .44em; font-weight: 650; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: .8em; color: var(--text-3); }
.kpi-spark { position: absolute; right: -6px; bottom: -4px; width: 96px; height: 46px; opacity: .5; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: .78em; font-weight: 650; background: var(--surface-3); color: var(--text-2);
}
.chip svg { width: 12px; height: 12px; }
.chip.up { background: var(--success-soft); color: var(--success); }
.chip.down { background: var(--danger-soft); color: var(--danger); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.brand { background: var(--brand-soft); color: var(--brand-500); }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px; border-radius: 7px;
  font-size: .76em; font-weight: 650; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before { display: none; }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: var(--success-soft); color: var(--success); }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.badge.revoked { background: var(--surface-3); color: var(--text-3); }
.badge.add { background: var(--success-soft); color: var(--success); }
.badge.deduct { background: var(--danger-soft); color: var(--danger); }
.badge.role-teacher { background: var(--brand-soft); color: var(--brand-500); }

/* 头像 */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: .84em; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, var(--brand-400), var(--brand-600));
  letter-spacing: .02em; user-select: none;
}
.avatar.sq { border-radius: 10px; }
.avatar.sm { width: 28px; height: 28px; font-size: .74em; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.05em; }
.avatar.gray { background: linear-gradient(145deg, #a3adc2, #7d879c); }
.avatar.green { background: linear-gradient(145deg, #34d399, #0f9d63); }
.avatar.red { background: linear-gradient(145deg, #fb7185, #e5484d); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92em; }
.table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 650; font-size: .8em; color: var(--text-3);
  letter-spacing: .04em; text-transform: none;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .13s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .thumb {
  width: 40px; height: 40px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-3); cursor: zoom-in;
}
.table .thumb-ph {
  width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3); border: 1px dashed var(--border-strong);
}
.table .thumb-ph svg { width: 16px; height: 16px; }
.thumb-ph svg { width: 18px; height: 18px; flex: none; }

.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.pos { color: var(--success); }
.score.neg { color: var(--danger); }
.score.zero { color: var(--text-3); }

/* 右侧抽屉 */
.drawer-mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(9, 13, 24, .46); backdrop-filter: blur(2px);
  animation: fade .2s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 121;
  width: min(520px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideIn .26s cubic-bezier(.22,.8,.3,1);
}
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 1.02em; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 18px; align-content: start; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* 模态 */
.modal-mask {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(9, 13, 24, .5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px;
  animation: fade .18s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .22s cubic-bezier(.22,.9,.3,1);
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.02em; font-weight: 700; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

/* 提示条 */
.alert {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: .87em; line-height: 1.55; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(229,72,77,.24); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(217,119,6,.24); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: rgba(11,127,212,.22); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(15,157,99,.22); }

/* Toast */
.toast-root {
  position: fixed; z-index: 200; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none; max-width: min(92vw, 420px);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: .9em; pointer-events: auto;
  animation: toastIn .24s cubic-bezier(.22,.9,.3,1);
}
.toast.is-out { animation: toastOut .2s ease forwards; }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--success); }
.toast.err svg { color: var(--danger); }
.toast.warn svg { color: var(--warn); }
.toast.info svg { color: var(--info); }
.toast b { display: block; font-weight: 650; margin-bottom: 1px; }
.toast span { color: var(--text-2); font-size: .92em; }

/* 空态 */
.empty { display: grid; place-items: center; gap: 12px; padding: clamp(32px, 6vh, 64px) 20px; text-align: center; }
.empty-ico {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-3);
}
.empty-ico svg { width: 24px; height: 24px; }
.empty h4 { font-size: .98em; font-weight: 650; }
.empty p { font-size: .87em; color: var(--text-3); max-width: 42ch; line-height: 1.7; }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-card { height: 108px; border-radius: var(--radius-lg); }

/* 分段控件 */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.segmented button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); font-size: .85em; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface); color: var(--brand-500); box-shadow: var(--shadow-xs); }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
  position: relative; height: 40px; padding: 0 14px; border: 0; background: transparent;
  color: var(--text-2); font-size: .92em; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.is-active { color: var(--brand-500); }
.tabs button.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--brand-500); border-radius: 2px 2px 0 0;
}
.tabs .count { margin-left: 6px; font-size: .82em; padding: 1px 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }

/* 上传区 */
.dropzone {
  position: relative; display: grid; place-items: center; gap: 8px;
  min-height: 168px; padding: 22px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-2);
  transition: border-color .16s, background .16s, color .16s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand-500); background: var(--brand-soft); color: var(--brand-500); }
.dropzone svg { width: 26px; height: 26px; }
.dropzone b { font-size: .93em; font-weight: 650; color: var(--text); }
.dropzone small { font-size: .8em; color: var(--text-3); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.preview {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
}
.preview img { width: 100%; max-height: 320px; object-fit: contain; background: #00000008; }
.preview-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(transparent, rgba(8,11,22,.72)); color: #fff; font-size: .78em;
}
.preview-bar .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 规则选择卡 */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.rule-chip {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: left;
  font-size: .86em; transition: all .14s;
}
.rule-chip:hover { border-color: var(--brand-400); background: var(--brand-soft); }
.rule-chip.is-active { border-color: var(--brand-500); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-500); }
.rule-chip .rc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-chip .rc-val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .94em; }

/* 趋势图（正负分轴，纯 CSS 实现） */
.chart-bars { display: flex; align-items: stretch; gap: clamp(3px, .5vw, 9px); height: 168px; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chart-up, .chart-down { flex: 1; display: flex; width: 100%; justify-content: center; }
.chart-up { align-items: flex-end; }
.chart-down { align-items: flex-start; border-top: 1px dashed var(--border-strong); }
.chart-bar { display: block; width: 100%; max-width: 26px; transition: height .45s cubic-bezier(.2,.8,.3,1); }
.chart-bar.pos { background: linear-gradient(180deg, #7d8bff, var(--brand-500)); border-radius: 4px 4px 0 0; }
.chart-bar.neg { background: linear-gradient(180deg, #f2606b, #e5484d); border-radius: 0 0 4px 4px; opacity: .92; }
.chart-col:hover .chart-bar { filter: brightness(1.1); }
.chart-x { font-size: .68em; color: var(--text-3); white-space: nowrap; text-align: center; margin-top: 6px; }
.chart-empty { display: grid; place-items: center; gap: 8px; height: 168px; color: var(--text-3); font-size: .86em; }
.chart-empty svg { width: 22px; height: 22px; opacity: .7; }
.chart-legend { display: flex; gap: 14px; font-size: .78em; color: var(--text-3); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* 排行 */
.rank-list { display: grid; gap: 2px; }
.rank-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .14s;
}
.rank-row:hover { background: var(--surface-2); }
.rank-no {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font-size: .76em; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex: none;
  font-variant-numeric: tabular-nums;
}
.rank-no.top1 { background: linear-gradient(145deg, #ffd66b, #f0a30a); color: #6b3f00; }
.rank-no.top2 { background: linear-gradient(145deg, #e2e8f5, #b8c2d8); color: #37415a; }
.rank-no.top3 { background: linear-gradient(145deg, #f3c8a4, #d99a63); color: #5a3417; }

/* 时间线 */
.timeline { display: grid; gap: 2px; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 8px 0; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 14px; bottom: -10px; width: 2px; background: var(--border); }
.tl-item:last-child .tl-rail::before { display: none; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; z-index: 1;
  background: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-soft);
}
.tl-dot.pos { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.tl-dot.neg { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.tl-body { padding-bottom: 8px; }
.tl-title { font-size: .92em; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-meta { font-size: .78em; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.tl-note { font-size: .85em; color: var(--text-2); margin-top: 5px; line-height: 1.6; }

/* 详情键值 */
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; font-size: .9em; }
.kv dt { color: var(--text-3); font-size: .92em; }
.kv dd { margin: 0; color: var(--text); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--border); font-size: .85em; color: var(--text-3); }

/* 上传缩略图网格 */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.thumb-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }

/* 数据条（学生分项） */
.bar-row { display: grid; grid-template-columns: minmax(72px, 1fr) 2.2fr 54px; gap: 10px; align-items: center; font-size: .86em; }
.bar-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand-500); transition: width .4s ease; }
.bar-fill.pos { background: linear-gradient(90deg, #34d399, var(--success)); }
.bar-fill.neg { background: linear-gradient(90deg, #fb7185, var(--danger)); }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--gap); }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-width: 200px; flex: 0 1 280px;
}
.search svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); width: 100%; font-size: .92em; }
.search:focus-within { border-color: var(--brand-500); box-shadow: var(--ring); }

/* 图片灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 220; background: rgba(6,9,18,.9);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out;
  animation: fade .2s ease;
}
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* 移动端底部导航 */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  display: none;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 10px; color: var(--text-3); font-size: .68em; font-weight: 600;
  position: relative;
}
.bottom-nav a svg { width: 20px; height: 20px; }
.bottom-nav a.is-active { color: var(--brand-500); background: var(--brand-soft); }
.bottom-nav .nav-badge { position: absolute; top: 3px; right: 50%; transform: translateX(150%); margin: 0; }

/* ---------- 7. 响应式 ---------- */
@media (max-width: 1180px) {
  :root { --sidebar-w: 232px; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  :root { --sidebar-w: 76px; }
  .sidebar-head { justify-content: center; padding: 0; }
  .brand-text, .nav-item span:not(.nav-badge), .nav-group, .sidebar-foot .btn span { display: none; }
  .nav { padding: 12px 10px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.is-active::before { display: none; }
  .nav-badge { position: absolute; top: 4px; right: 6px; margin: 0; }
  .user-card { justify-content: center; padding: 8px 4px; }
  .sidebar-foot .btn { padding: 0; }
  .sidebar-foot .btn svg { margin: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; background: var(--surface); }
  .auth-panel::before {
    content: "班务通"; display: block; font-size: 1.1em; font-weight: 700;
    letter-spacing: .06em; color: var(--brand-500); text-align: center; margin-top: 18px;
  }
  .topbar-menu { display: inline-flex; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 60px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, 292px);
    transform: translateX(-102%); transition: transform .26s cubic-bezier(.22,.8,.3,1);
    box-shadow: var(--shadow-lg); height: 100dvh;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-head { justify-content: flex-start; padding: 0 16px; }
  .brand-text, .nav-item span, .nav-group { display: flex; }
  .nav-item { justify-content: flex-start; padding: 0 11px; }
  .nav-item.is-active::before { display: block; }
  .nav-badge { position: static; margin-left: auto; }
  .user-card { justify-content: flex-start; padding: 9px 10px; }
  .sidebar-foot .btn span { display: inline; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(9,13,24,.44); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s;
  }
  .sidebar-backdrop.is-open { opacity: 1; visibility: visible; }
  .bottom-nav { display: flex; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar-cta span { display: none; }
  .topbar-cta { width: 38px; padding: 0; }
  .topbar-title p { display: none; }
  .live-pill .live-text { display: none; }
  .live-pill { padding: 0 9px; }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px; }
  .kpi-value { font-size: 22px; margin-top: 8px; }
  .kpi-ico { width: 28px; height: 28px; border-radius: 8px; }
  .kpi-label { font-size: .76em; }
  .kpi-spark { display: none; }
  .toast-root { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: stretch; max-width: none; }
  .drawer { width: 100vw; }
  .drawer-head, .drawer-body { padding: 16px; }

  /* 移动端图表标签抽稀，避免重叠 */
  .chart-col:nth-child(even) .chart-x { visibility: hidden; }

  /* 表格转卡片 */
  .table.card-mode thead { display: none; }
  .table.card-mode, .table.card-mode tbody, .table.card-mode tr, .table.card-mode td { display: block; width: 100%; }
  .table.card-mode tr {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); margin-bottom: 10px; padding: 6px 0; overflow: hidden;
  }
  .table.card-mode tbody tr:hover { background: var(--surface); }
  .table.card-mode td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 8px 14px; border: 0; font-size: .9em;
  }
  .table.card-mode td::before {
    content: attr(data-label); font-size: .8em; color: var(--text-3); font-weight: 600; flex: none;
  }
  .table.card-mode td[data-label=""]::before { display: none; }
  .table.card-mode td.actions { justify-content: flex-end; border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 10px; }
  .pager { justify-content: space-between; }
  .modal { border-radius: var(--radius-lg); }
  .modal-body { padding: 16px; }
}

@media (max-width: 420px) {
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 20px; }
  .btn { padding: 0 12px; }
}

/* 大屏优化：超宽分辨率下增加留白与密度 */
@media (min-width: 1700px) {
  :root { --sidebar-w: 288px; --pad: 34px; --max-w: 1680px; }
  .kpi-value { font-size: 34px; }
}
@media (min-width: 2200px) {
  :root { --max-w: 1840px; --pad: 44px; }
  body { font-size: 15.5px; }
}

/* 触屏设备去掉悬浮效果 */
@media (hover: none) {
  .table tbody tr:hover { background: transparent; }
  .btn:hover { background: var(--btn-bg); }
}

/* ---------- 8. 动效与无障碍 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } 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) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15,157,99,.5); } 70% { box-shadow: 0 0 0 6px rgba(15,157,99,0); } 100% { box-shadow: 0 0 0 0 rgba(15,157,99,0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.btn .spinner { margin-left: 2px; }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .toolbar, .actions { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}
