:root {
  --navy: #0b1220;
  --navy-2: #111c31;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6ebf3;
  --bg: #f4f7fb;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --teal: #0f9f8f;
  --amber: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --green: #16a34a;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #08101f;
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 64px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.55), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(15, 159, 143, 0.45), transparent 32%),
    linear-gradient(145deg, #08101f 0%, #0d1b36 55%, #0b2a4a 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  right: -120px; bottom: -160px;
  box-shadow: 0 0 0 40px rgba(255,255,255,.03), 0 0 0 90px rgba(255,255,255,.02);
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 800; letter-spacing: .5px; font-size: 18px;
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb 60%, #0f9f8f);
  box-shadow: 0 10px 24px rgba(37,99,235,.35);
  font-size: 20px;
}
.login-brand h1 {
  margin: 96px 0 20px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: -1.5px;
}
.login-brand h1 span { color: #7dd3fc; }
.login-brand p {
  max-width: 520px; color: #b9c6dc; line-height: 1.9; font-size: 15px;
}
.login-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.login-points span {
  padding: 9px 14px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05); border-radius: 999px;
  font-size: 13px; color: #dbe7ff;
}
.login-side {
  display: grid; place-items: center; padding: 40px;
  background: #f6f8fc;
}
.login-card {
  width: min(420px, 100%);
  background: #fff; border-radius: 24px; padding: 38px;
  box-shadow: 0 24px 60px rgba(15,23,42,.12);
  border: 1px solid #eef2f8;
}
.login-card h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.5px; }
.login-card .sub { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; font-size: 13px; color: #475569; margin: 0 0 8px; font-weight: 600; }
.login-card input {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid #dbe3ef;
  padding: 0 14px; outline: none; background: #fbfdff; margin-bottom: 18px;
  transition: .2s;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); background: #fff; }
.login-error { min-height: 20px; color: var(--red); font-size: 13px; margin: -6px 0 10px; }
.login-demo { margin-top: 24px; padding-top: 20px; border-top: 1px dashed #e2e8f0; }
.login-demo p { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-chips button {
  border: 1px solid #dbe3ef; background: #fff; color: #334155;
  border-radius: 999px; padding: 7px 12px; font-size: 12px;
}
.demo-chips button:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 238px; flex: 0 0 238px; background: var(--navy); color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { padding: 22px 20px 18px; display: flex; align-items: center; gap: 11px; }
.side-brand .brand-logo { width: 36px; height: 36px; border-radius: 11px; font-size: 19px; }
.side-brand strong { color: #fff; font-size: 16px; letter-spacing: .3px; }
.side-brand small { display: block; color: #64748b; font-size: 10px; margin-top: 2px; letter-spacing: 1px; }
.side-nav { padding: 4px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none; }
.side-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.side-nav a, .nav-group-head {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: 10px; color: #9fb0c7; font-size: 14px; transition: .18s;
  width: 100%; border: 0; background: transparent; text-align: left;
}
.side-nav a .ico, .nav-group-head .ico { width: 24px; text-align: center; font-size: 16px; }
.side-nav a:hover, .nav-group-head:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.active {
  background: linear-gradient(90deg, rgba(37,99,235,.32), rgba(37,99,235,.08));
  color: #fff; box-shadow: inset 3px 0 0 #60a5fa;
}
.nav-group { border-radius: 10px; }
.nav-group-head { cursor: pointer; }
.nav-group-head .group-name { flex: 1; }
.nav-group-head .chev { color: #64748b; font-size: 12px; transition: transform .2s; }
.nav-group.open .nav-group-head { color: #dbeafe; }
.nav-group.open .nav-group-head .chev { transform: rotate(180deg); }
.nav-sub { max-height: 0; overflow: hidden; transition: max-height .24s ease; }
.nav-group.open .nav-sub { max-height: 420px; }
.nav-sub-item { padding: 9px 12px 9px 22px !important; font-size: 13px !important; color: #8ea1ba !important; }
.nav-sub-item .sub-ico { width: 22px; text-align: center; font-size: 13px; color: #64748b; }
.nav-sub-item.active { color: #fff !important; background: rgba(37,99,235,.14); box-shadow: inset 2px 0 0 #60a5fa; }
.nav-sub-item.active .sub-ico { color: #93c5fd; }
.side-bottom { margin-top: auto; padding: 14px 18px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg,#60a5fa,#2563eb); color: #fff; font-size: 13px; font-weight: 700;
  flex: 0 0 auto;
}
.side-user .meta { min-width: 0; }
.side-user b { display: block; color: #e2e8f0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: #64748b; font-size: 11px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 76px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.75); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.topbar .date { margin-top: 3px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 30px 48px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- UI ---------- */
.btn {
  border: 1px solid transparent; border-radius: 10px; height: 38px; padding: 0 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 600; transition: .18s; white-space: nowrap; background: #fff;
}
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.2); }
.btn.primary:hover { background: var(--primary-2); transform: translateY(-1px); }
.btn.ghost { border-color: #dbe3ef; color: #334155; }
.btn.ghost:hover { border-color: #b9c6d8; background: #f8fafc; }
.btn.danger { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: #fee2e2; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-link { border: 0; background: none; color: var(--primary); font-size: 13px; font-weight: 600; padding: 4px 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }

.input, .select, .textarea {
  width: 100%; border: 1px solid #dbe3ef; border-radius: 10px; background: #fff;
  padding: 10px 12px; outline: none; color: var(--ink); transition: .18s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.input::placeholder, .textarea::placeholder { color: #9aa8bd; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.field .hint { margin-top: 5px; font-size: 11px; color: #94a3b8; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.search { display: flex; gap: 8px; align-items: center; }
.search .input { width: 240px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.card-body { padding: 0 20px 18px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 16px 16px 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -18px; top: -22px; width: 74px; height: 74px; border-radius: 50%; background: var(--tint, #eff6ff); opacity: .7; }
.stat .label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -1px; margin-top: 10px; }
.stat .foot { color: #94a3b8; font-size: 11px; margin-top: 5px; }
.stat .ico { font-size: 15px; }

.grid-2 { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; color: #7b8aa1; font-weight: 600; font-size: 11px; letter-spacing: .3px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfcfe; white-space: nowrap;
}
table.data td { padding: 12px; border-bottom: 1px solid #f0f4fa; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcff; }
table.data .strong { font-weight: 700; }
table.data .muted { color: var(--muted); font-size: 12px; }
table.data .num { font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 9px; }
.cell-main .avatar { width: 30px; height: 30px; font-size: 11px; }
.cell-main b { display: block; font-size: 13px; }
.cell-main small { color: var(--muted); font-size: 11px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: #ecfdf5; color: #15803d; }
.badge.orange { background: #fff7ed; color: #c2410c; }
.badge.red { background: #fef2f2; color: #b91c1c; }
.badge.blue { background: #eff6ff; color: #1d4ed8; }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.purple { background: #f5f3ff; color: #6d28d9; }
.badge.teal { background: #ecfdf5; color: #0f766e; }

.empty { padding: 34px 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.empty .big { font-size: 28px; display: block; margin-bottom: 8px; opacity: .8; }
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #dbeafe; border-top-color: var(--primary);
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -5px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick {
  display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line);
  border-radius: 12px; background: #fbfdff; text-align: left; transition: .18s;
}
.quick:hover { border-color: #bfdbfe; background: #f5f9ff; transform: translateY(-1px); }
.quick .q-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #eff6ff; font-size: 16px; }
.quick b { display: block; font-size: 12px; }
.quick small { color: var(--muted); font-size: 10px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 6px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; max-width: 26px; height: 100%; background: #f1f5f9; border-radius: 8px; position: relative; overflow: hidden; }
.bar-fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px; background: linear-gradient(180deg,#60a5fa,#2563eb); min-height: 3px; }
.bar-col small { color: var(--muted); font-size: 10px; }
.bar-col b { font-size: 11px; color: #334155; }

.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.notice-item .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notice-item b { font-size: 13px; }
.notice-item p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.notice-item small { color: #94a3b8; font-size: 10px; white-space: nowrap; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.mini-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.mini-card .top { display: flex; gap: 10px; align-items: center; }
.mini-card .avatar { width: 40px; height: 40px; border-radius: 12px; }
.mini-card h4 { margin: 0; font-size: 14px; }
.mini-card .sub { color: var(--muted); font-size: 11px; margin-top: 3px; }
.mini-card .rows { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-card .rows div { background: #f8fafc; border-radius: 9px; padding: 8px 10px; }
.mini-card .rows small { display: block; color: #94a3b8; font-size: 10px; margin-bottom: 3px; }
.mini-card .rows b { font-size: 13px; }
.mini-card .actions { display: flex; gap: 6px; margin-top: 13px; }

.session-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: #fff; }
.session-card + .session-card { margin-top: 10px; }
.session-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.session-card .time { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.session-card .time small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.session-card .title { font-size: 13px; font-weight: 700; margin-top: 3px; }
.session-card .meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.session-card .roster { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 11px; background: #f8fafc; color: #475569; border: 1px solid #eef2f7; }
.pill.green { background: #ecfdf5; color: #15803d; border-color: #d1fae5; }
.pill.orange { background: #fff7ed; color: #c2410c; border-color: #ffedd5; }
.pill.blue { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.pill.red { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.pill.gray { background: #f1f5f9; color: #64748b; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { background: #f8fafc; border-radius: 10px; padding: 11px 13px; }
.detail-item small { display: block; color: #94a3b8; font-size: 10px; margin-bottom: 4px; }
.detail-item b { font-size: 14px; }
.detail-item.full { grid-column: 1 / -1; }
.refund-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 15px; }
.refund-box .line { display: flex; justify-content: space-between; font-size: 12px; color: #475569; padding: 4px 0; }
.refund-box .line.total { border-top: 1px solid #e2e8f0; margin-top: 8px; padding-top: 10px; font-weight: 800; color: var(--ink); font-size: 15px; }
.refund-box .line.total span:last-child { color: var(--red); }

/* ---------- modal / toast ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8,16,31,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; padding: 22px;
}
.modal {
  width: min(560px, 100%); max-height: 90vh; background: #fff;
  border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25);
  animation: pop .18s ease-out;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal.wide { width: min(900px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-close { border: 0; background: #f1f5f9; width: 30px; height: 30px; border-radius: 9px; font-size: 17px; color: #64748b; }
.modal-body { padding: 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 9px; flex-shrink: 0; border-top: 1px solid #f1f5f9; }
.toast-root { position: fixed; top: 18px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; padding: 11px 15px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 12px 30px rgba(15,23,42,.25); animation: toastIn .2s ease-out;
}
.toast.error { background: #b91c1c; }
.toast.success { background: #0f766e; }
@keyframes toastIn { from { transform: translateX(10px); opacity: 0; } }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.section-title h3 { margin: 0; font-size: 15px; }
.section-title span { color: var(--muted); font-size: 12px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
  .sidebar { width: 76px; flex-basis: 76px; }
  .side-brand { justify-content: center; padding: 18px 8px; }
  .side-brand div:not(.brand-logo) { display: none; }
  .side-nav a { justify-content: center; padding: 11px 6px; }
  .side-nav a .ico { font-size: 19px; }
  .side-nav a span:last-child { display: none; }
  .nav-group-head { justify-content: center; padding: 11px 6px; }
  .nav-group-head .group-name, .nav-group-head .chev { display: none; }
  .nav-sub { display: none; }
  .nav-group.open .nav-sub { display: block; }
  .nav-sub-item { justify-content: center; padding: 9px 4px !important; }
  .nav-sub-item .sub-ico { font-size: 14px; }
  .nav-sub-item span:last-child { display: none; }
  .side-user .meta, .side-user .logout-text { display: none; }
  .side-bottom { padding: 12px 8px; display: flex; justify-content: center; }
  .topbar { padding: 0 20px; }
  .content { padding: 20px; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .search .input { width: 150px; }
  .topbar h1 { font-size: 17px; }
  .page-head h2 { font-size: 19px; }
}

/* ---------- clickable labels & charts ---------- */
.link-text { color: #2563eb; cursor: pointer; font-weight: 600; }
.link-text:hover { text-decoration: underline; }
.pill.clickable { cursor: pointer; }
.pill.clickable:hover { filter: brightness(.96); }
.chart-total { font-size: 20px; font-weight: 800; color: #0f766e; letter-spacing: -.5px; }
.chart-wrap { width: 100%; }
.line-chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid-line { stroke: #eef2f8; stroke-width: 1; }
.chart-axis-label { fill: #94a3b8; font-size: 10px; font-family: inherit; }
.chart-empty { padding: 52px 10px; text-align: center; color: #94a3b8; font-size: 13px; }

.hbar-list { display: flex; flex-direction: column; gap: 15px; padding: 5px 0 3px; }
.hbar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #64748b; margin-bottom: 6px; }
.hbar-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-head b { color: #1e293b; white-space: nowrap; font-size: 11px; }
.hbar-track { height: 10px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; min-width: 3px; transition: width .4s ease; }

.donut-layout { display: flex; align-items: center; gap: 22px; padding: 8px 0 4px; }
.donut { width: 148px; height: 148px; border-radius: 50%; position: relative; flex: 0 0 148px; }
.donut::after { content: ""; position: absolute; inset: 26px; background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 1px #eef2f8; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; }
.donut-center b { font-size: 28px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.donut-center small { color: #94a3b8; font-size: 10px; margin-top: 3px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64748b; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-name { flex: 1; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row b { color: #0f172a; }
.legend-row small { width: 34px; text-align: right; color: #94a3b8; }

.course-desc { margin-top: 16px; background: #f8fafc; border: 1px solid #eef2f8; border-radius: 12px; padding: 13px 15px; color: #475569; font-size: 12px; line-height: 1.8; }

@media (max-width: 720px) {
  .donut-layout { flex-direction: column; align-items: flex-start; }
  .donut { align-self: center; }
  .donut-legend { width: 100%; }
}

.insight-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 12px; color: #64748b; }
.insight-row:last-child { border-bottom: 0; }
.insight-row b { margin-left: auto; color: #0f172a; font-size: 12px; }
.insight-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.insight-dot.orange { background: #f59e0b; }
.insight-dot.red { background: #ef4444; }
.insight-dot.teal { background: #0f9f8f; }
.insight-dot.blue { background: #2563eb; }

/* ---------- calendar ---------- */
.calendar-nav { display: flex; gap: 8px; }
.calendar-card { overflow: hidden; }
.calendar-week { display: grid; grid-template-columns: repeat(7, 1fr); background: #f8fafc; border-bottom: 1px solid var(--line); }
.calendar-week div { padding: 12px 10px; text-align: center; color: #94a3b8; font-size: 11px; font-weight: 600; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 116px; padding: 8px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; background: #fff; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.blank { background: #fbfcfe; }
.cal-cell.today { background: #f5f9ff; box-shadow: inset 0 0 0 2px #bfdbfe; }
.cal-day { display: flex; align-items: center; justify-content: space-between; color: #64748b; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.cal-cell.today .cal-day { color: #1d4ed8; }
.cal-day span { font-size: 9px; background: #2563eb; color: #fff; padding: 2px 5px; border-radius: 999px; font-weight: 600; }
.cal-events { display: flex; flex-direction: column; gap: 4px; }
.cal-event { padding: 4px 6px 4px 8px; border-left: 3px solid var(--event-color, #2563eb); border-radius: 4px; background: #f8fafc; cursor: pointer; overflow: hidden; }
.cal-event:hover { background: #eff6ff; }
.cal-event b { display: block; color: var(--event-color, #2563eb); font-size: 10px; }
.cal-event span { display: block; color: #334155; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event em { display: block; color: #94a3b8; font-size: 9px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { color: #2563eb; font-size: 9px; cursor: pointer; padding-left: 4px; }
.calendar-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: #94a3b8; font-size: 11px; }
.calendar-legend span { display: flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- feedback ---------- */
.feedback-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feedback-admin-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: .18s; }
.feedback-admin-card:hover { border-color: #bfdbfe; transform: translateY(-1px); }
.fb-admin-title { margin-left: 10px; }
.fb-admin-title b { display: block; font-size: 13px; color: #1e293b; }
.fb-admin-title small { display: block; color: #94a3b8; font-size: 10px; margin-top: 2px; }
.fb-admin-content { margin: 12px 0; color: #475569; font-size: 12px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.fb-admin-foot { border-top: 1px solid #f1f5f9; padding-top: 10px; color: #64748b; font-size: 11px; }
.feedback-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.feedback-images img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; cursor: zoom-in; }
.feedback-images.small-images img { width: 38px; height: 38px; }
.feedback-images.large-images img { width: 116px; height: 116px; border-radius: 12px; }
.fb-detail-content { margin-top: 16px; padding: 16px; border-radius: 12px; background: #f8fafc; color: #334155; font-size: 13px; line-height: 1.9; white-space: pre-wrap; }

/* ---------- permissions ---------- */
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.role-card-top { display: flex; gap: 12px; align-items: flex-start; }
.role-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: #eff6ff; color: #2563eb; flex-shrink: 0; }
.role-icon.teacher { background: #f5f3ff; color: #7c3aed; }
.role-icon.parent { background: #ecfdf5; color: #0f766e; }
.role-card h4 { margin: 0; font-size: 14px; }
.role-card p { margin: 5px 0 0; color: #94a3b8; font-size: 11px; line-height: 1.6; }
.role-stats { display: flex; gap: 18px; margin-top: 16px; color: #94a3b8; font-size: 11px; }
.role-stats b { color: #1e293b; font-size: 14px; margin-left: 4px; }
.role-actions { margin-top: 14px; }
.permission-toolbar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }
.permission-groups { display: flex; flex-direction: column; gap: 14px; }
.permission-group { border: 1px solid #eef2f8; border-radius: 12px; overflow: hidden; }
.permission-group-title { padding: 10px 14px; background: #f8fafc; color: #475569; font-size: 12px; font-weight: 700; }
.permission-items { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 6px 12px 12px; }
.perm-item { display: flex; gap: 9px; align-items: flex-start; padding: 9px 4px; font-size: 12px; color: #334155; cursor: pointer; }
.perm-item input { margin-top: 2px; accent-color: #2563eb; }
.perm-item b { display: block; font-size: 12px; }
.perm-item small { display: block; color: #94a3b8; font-size: 10px; margin-top: 3px; line-height: 1.5; }
.audit-detail { background: #0f172a; color: #dbeafe; border-radius: 12px; padding: 14px; font-size: 11px; line-height: 1.7; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin-top: 16px; }

@media (max-width: 1100px) {
  .feedback-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .calendar-grid { min-width: 760px; }
  .calendar-card { overflow-x: auto; }
  .permission-items { grid-template-columns: 1fr; }
  .calendar-legend { flex-direction: column; }
}

.role-icon { font-weight: 800; font-size: 16px; letter-spacing: 0; }

/* ---------- order traceability ---------- */
.order-head-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; margin-bottom: 16px;
  border: 1px solid #dbeafe; border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f8fbff 70%);
}
.order-no-label { color: #64748b; font-size: 11px; margin-bottom: 4px; }
.order-no-value { color: #1e3a8a; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 20px; font-weight: 800; letter-spacing: .4px; }
.order-no-value .btn-link { font-family: inherit; font-size: 12px; margin-left: 6px; vertical-align: 2px; }

/* ---------- finance center ---------- */
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-bar {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.filter-bar label { display: flex; flex-direction: column; gap: 6px; color: #94a3b8; font-size: 10px; }
.filter-bar label .input, .filter-bar label .select { width: 150px; height: 36px; }
.filter-bar .filter-grow { flex: 1; min-width: 220px; }
.filter-bar .filter-grow .input { width: 100%; }
.money-pos { color: #15803d; font-weight: 700; }
.money-neg { color: #dc2626; font-weight: 700; }
@media (max-width: 1100px) {
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- learning plans / report cards ---------- */
.plan-progress { height: 7px; background: #eef2f8; border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.plan-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#60a5fa,#2563eb); }
.notice-item.clickable { cursor: pointer; transition: .18s; }
.notice-item.clickable:hover { background: #f8fbff; border-radius: 10px; }
.score-value { font-size: 16px; color: #1e293b; }
.report-score-hero {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 20px; margin-bottom: 16px;
  border-radius: 14px; border: 1px solid #dbeafe;
  background: linear-gradient(135deg,#eff6ff,#f8fbff 70%);
}
.report-score-hero small { color: #64748b; font-size: 11px; display: block; }
.report-score-hero b { font-size: 32px; letter-spacing: -1px; color: #1e3a8a; }
.report-score-hero span { color: #94a3b8; font-size: 13px; }
.report-grade { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #dbeafe; color: #1d4ed8; font-size: 20px; font-weight: 800; }
.report-rank { margin-left: auto; color: #64748b; font-size: 12px; }

/* ---------- attendance policy ---------- */
.policy-fixed {
  height: 40px; display: flex; align-items: center; padding: 0 12px;
  border-radius: 10px; background: #f8fafc; border: 1px solid #eef2f8;
  color: #334155; font-size: 13px;
}
.policy-note {
  margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: #fff7ed; color: #9a3412; font-size: 12px; line-height: 1.7;
}
.policy-preview { margin-top: 4px; }
.policy-preview td, .policy-preview th { padding-top: 12px; padding-bottom: 12px; }

/* Keep person names on one line; long course/plan text may still wrap */
table.data td.name-cell { white-space: nowrap; }
table.data .name-grade { white-space: nowrap; margin-left: 2px; }
.person-name { white-space: nowrap; }

/* ---------- sidebar line icons ---------- */
.side-nav .ico, .side-nav .sub-ico { display: flex; align-items: center; justify-content: center; }
.nav-svg { width: 16px; height: 16px; display: block; opacity: .92; }
.nav-sub-item .nav-svg { width: 14px; height: 14px; opacity: .8; }
.nav-item.active .nav-svg, .nav-sub-item.active .nav-svg { opacity: 1; }

/* ---------- activity / filters / student profile ---------- */
.tabs { display: flex; gap: 8px; margin: 18px 0; border-bottom: 1px solid #e2e8f0; }
.tab { background: none; border: 0; padding: 10px 4px; margin-right: 18px; color: #64748b; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: #ea580c; border-bottom-color: #ea580c; }
.page-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 16px 22px; align-items: end; }
.filter-field label { display: block; margin-bottom: 6px; color: #64748b; font-size: 13px; }
.filter-field .range { display: flex; align-items: center; gap: 8px; color: #94a3b8; }
.filter-field .range .input { min-width: 0; }
.filter-actions { display: flex; gap: 8px; justify-content: flex-end; }
.inline-field { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 13px; }
.small-input { width: 76px; height: 34px; text-align: center; }
.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-item.full { grid-column: 1 / -1; }
.nowrap { white-space: nowrap; }
@media (max-width: 900px) { .filter-grid { grid-template-columns: 1fr; } }

@media print {
  .sidebar, .topbar, .page-head .actions, .card .actions, .tabs, .filter-card, .modal-foot, .modal-close { display: none !important; }
  .layout, .main { display: block !important; }
  .content { padding: 0 !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
  body { background: #fff !important; }
}

.modal-head .modal-export { margin-left: auto; margin-right: 10px; }

/* ---------- query filter layout refinement ---------- */
.filter-card .card-body { padding: 22px 24px 20px; }
.filter-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px 34px;
  align-items: end;
}
.filter-field label { margin-bottom: 8px; font-size: 13px; }
.filter-field .range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
}
.filter-field .range .input { width: 100%; min-width: 0; height: 40px; }
.filter-field > .select, .filter-field > .input { height: 40px; }
.filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}
.filter-actions .btn { min-width: 88px; height: 38px; }
@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: 1fr; gap: 16px; }
}
