/* ==========================================================
   师训云 · Teacher Training Sign-in & Certificate Platform
   ========================================================== */

:root {
  --ink: #123f38;
  --ink-deep: #0b2f2a;
  --ink-soft: #2d5a51;
  --green: #165e52;
  --green-2: #1b7263;
  --green-soft: #e8f2ed;
  --green-pale: #f1f7f3;
  --gold: #b78a45;
  --gold-deep: #8f672d;
  --gold-soft: #f4ead8;
  --paper: #f4f1e9;
  --paper-2: #efeade;
  --card: #fffdf8;
  --line: #e5ded1;
  --line-strong: #d7cebd;
  --muted: #776f62;
  --muted-2: #9b9284;
  --red: #b42318;
  --red-bg: #fdecea;
  --blue: #2e5f8a;
  --shadow-sm: 0 1px 2px rgba(23, 46, 39, .05);
  --shadow: 0 10px 34px rgba(36, 48, 42, .08);
  --shadow-lg: 0 26px 80px rgba(22, 45, 37, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 244px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: #293630;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::selection, body *::selection { background: #d7e8df; color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.icon { flex: 0 0 auto; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { opacity: .46; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: linear-gradient(145deg, #1b685a, #104a41);
  color: #fff;
  box-shadow: 0 8px 20px rgba(18, 63, 56, .2), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary:hover { background: linear-gradient(145deg, #217362, #115046); box-shadow: 0 12px 26px rgba(18, 63, 56, .26); }
.btn-gold {
  background: linear-gradient(145deg, #c99d56, #a97932);
  color: #fffaf0;
  box-shadow: 0 8px 24px rgba(137, 99, 42, .25);
}
.btn-gold:hover { background: linear-gradient(145deg, #d3aa63, #b38237); }
.btn-ghost { border-color: var(--line-strong); background: rgba(255, 255, 255, .5); color: #4b554f; }
.btn-ghost:hover { border-color: #b9ad99; background: #fffdf8; color: var(--ink); }
.btn-soft { background: var(--green-soft); color: var(--green); border-color: transparent; }
.btn-soft:hover { background: #dbece4; }
.btn-ghost-light { border-color: rgba(255, 255, 255, .24); color: #f7f2e8; background: rgba(255, 255, 255, .05); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-bg); color: var(--red); }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn-tiny { min-height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; gap: 4px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--muted);
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--green-soft); color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 12.5px; font-weight: 600; }
.text-link:hover { color: var(--gold-deep); }
.red-text { color: var(--red) !important; }
.green-text { color: #1b7c54 !important; }
.danger-text { color: var(--red) !important; }
.inline-red { color: var(--red); font-weight: 700; }
.dot-sep { color: #c2b9a9; padding: 0 2px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: #435049; letter-spacing: .01em; }
.field > span i { color: var(--red); font-style: normal; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffefa;
  color: #25332d;
  padding: 11px 13px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field textarea { resize: vertical; line-height: 1.65; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder { color: #b2a999; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #61998b;
  box-shadow: 0 0 0 3px rgba(22, 94, 82, .1);
  background: #fff;
}
.field input[type="date"], .field input[type="time"] { color-scheme: light; }
.field input[type="color"] { width: 100%; height: 46px; padding: 4px; border-radius: 9px; cursor: pointer; }
.hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.55; font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.inline-form { display: inline-flex; margin: 0; }
.form-error {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px; margin: 4px 0 16px;
  border: 1px solid #f2c9c4; border-radius: 10px;
  background: #fdf2f0; color: #982018; font-size: 13px; line-height: 1.5;
}
.form-tip {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 16px; padding: 12px 14px;
  border-radius: 10px; background: var(--green-pale);
  color: #48645b; font-size: 12px; line-height: 1.6;
}
.form-tip .icon { color: var(--green); margin-top: 1px; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 9000; display: grid; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #123f38; color: #f8f4ea;
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(16, 42, 35, .28);
  font-size: 13px; animation: toastIn .3s ease both;
}
.toast-success span { display: inline-flex; color: #b7e5c7; }
.toast-error { background: #7d1e16; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================
   Admin shell
   ========================================================== */
.admin-body { background: #f3f0e8; min-height: 100vh; }
.admin-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column; padding: 24px 17px 18px;
  color: #e9f0ea;
  background:
    radial-gradient(90% 55% at 0% 0%, rgba(147, 193, 170, .16), transparent 58%),
    radial-gradient(70% 48% at 110% 105%, rgba(193, 153, 86, .2), transparent 62%),
    linear-gradient(168deg, #123f38 0%, #0d322d 62%, #0a2b27 100%);
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255, 255, 255, .35) .6px, transparent .6px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 66%);
}
.sidebar-head { position: relative; z-index: 1; padding: 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 12px; background: linear-gradient(145deg, #d6ad66, #ab7c33);
  color: #183c35; font-family: var(--serif); font-weight: 800; font-size: 23px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 18px rgba(0, 0, 0, .18);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text b { font-family: var(--serif); font-size: 21px; letter-spacing: .12em; font-weight: 800; color: #fffaf0; }
.brand-text small { font-size: 9px; letter-spacing: .09em; color: rgba(238, 244, 237, .58); white-space: nowrap; }
.sidebar-caption {
  position: relative; z-index: 1; margin: 34px 10px 8px;
  font-size: 9.5px; letter-spacing: .2em; color: rgba(233, 240, 234, .42);
}
.side-nav { position: relative; z-index: 1; display: grid; gap: 4px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 14px; border-radius: 11px;
  color: rgba(235, 242, 236, .7); font-size: 13.5px; font-weight: 500;
  transition: background .18s, color .18s;
}
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.is-active {
  background: linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), 0 8px 20px rgba(3, 21, 17, .14);
}
.side-link.is-active .icon { color: #ddba79; }
.side-dot { position: absolute; left: 0; top: 50%; width: 3px; height: 22px; margin-top: -11px; border-radius: 0 3px 3px 0; background: #d7b16b; }
.sidebar-bottom { position: relative; z-index: 1; margin-top: auto; }
.sidebar-tip {
  margin: 0 4px 16px; padding: 15px; border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .07);
}
.tip-spark { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; color: #d9b671; background: rgba(215, 177, 107, .12); margin-bottom: 9px; }
.sidebar-tip b { display: block; color: #f1e7d4; font-size: 12.5px; margin-bottom: 5px; }
.sidebar-tip p { color: rgba(232, 239, 232, .52); font-size: 10.5px; line-height: 1.65; }
.side-link-muted { color: rgba(235, 242, 236, .52); }
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 68px; display: flex; align-items: center; gap: 16px;
  padding: 0 32px;
  background: rgba(244, 241, 233, .86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(212, 203, 187, .55);
}
.topbar-context { display: flex; flex-direction: column; gap: 2px; }
.topbar-context span { font-size: 8.5px; letter-spacing: .18em; color: var(--muted-2); }
.topbar-context b { font-size: 12.5px; font-weight: 600; color: #465149; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.topbar-date { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.admin-chip { display: flex; align-items: center; gap: 9px; padding-left: 18px; border-left: 1px solid var(--line-strong); }
.admin-chip > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.admin-chip b { font-size: 12px; color: #37443e; }
.admin-chip small { font-size: 9.5px; color: var(--muted-2); }
.menu-btn { display: none; }
.admin-content { width: min(100%, 1480px); margin: 0 auto; padding: 30px 32px 54px; }
.sidebar-scrim { display: none; }

/* ---------- Avatars / pills ---------- */
.avatar {
  width: 35px; height: 35px; flex: 0 0 auto; display: inline-grid; place-items: center;
  border-radius: 10px; background: linear-gradient(145deg, #e5efe9, #d5e5dc);
  color: var(--green); font-size: 14px; font-weight: 700;
}
.avatar-sm { width: 31px; height: 31px; border-radius: 9px; font-size: 12px; }
.avatar-lg { width: 62px; height: 62px; border-radius: 18px; font-size: 24px; background: rgba(255, 255, 255, .14); color: #f4e3bf; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.pill-active { color: #14704f; background: #e2f2e9; border: 1px solid #c7e5d6; }
.pill-closed { color: #7b7468; background: #f0ede5; border: 1px solid #e3ded2; }
.pill-draft { color: #8b692f; background: #f6ecda; border: 1px solid #ead8b8; }
.pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: #1d9a69; box-shadow: 0 0 0 3px rgba(29, 154, 105, .12); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.cert-pill {
  display: inline-flex; align-items: center; min-height: 23px; padding: 3px 9px;
  border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.cert-issued { color: #146c4b; background: #e4f3eb; border: 1px solid #cce7d9; }
.cert-ready { color: #8b6123; background: #f8edda; border: 1px solid #eddbbd; }
.cert-incomplete { color: var(--red); background: #fdeceb; border: 1px solid #f5d2ce; }
.cert-canceled { color: #8b4b46; background: #f8eae8; border: 1px solid #eed4d0; }
.cert-revoked { color: #7b7468; background: #f0ede5; border: 1px solid #e2ddd2; }
.cert-notIssued { color: #8b6123; background: #f8edda; border: 1px solid #eddbbd; }

/* ---------- Page headings ---------- */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { font-family: var(--serif); font-size: clamp(28px, 2.6vw, 38px); font-weight: 800; letter-spacing: -.02em; color: var(--ink-deep); margin: 5px 0 7px; }
.page-heading p { color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 720px; }
.eyebrow { display: block; font-size: 9px; letter-spacing: .22em; color: var(--gold-deep); font-weight: 700; text-transform: uppercase; }
.setup-alert { display: flex; align-items: center; gap: 13px; padding: 12px 15px; margin: -8px 0 18px; border: 1px solid #ead8b8; border-radius: 12px; background: linear-gradient(100deg, #fbf4e5, #f8efdd); }
.setup-alert-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #f1e3c8; color: var(--gold-deep); }
.setup-alert b { display: block; font-size: 11.5px; color: #604d2e; margin-bottom: 2px; }
.setup-alert p { font-size: 10px; color: #8a7b64; line-height: 1.6; }
.setup-alert .btn { margin-left: auto; flex: 0 0 auto; }
.heading-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.back-link:hover { color: var(--green); }

/* ---------- Panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; }
.panel-head h2 { font-size: 17px; font-weight: 700; color: #253630; letter-spacing: -.01em; }
.panel-kicker { display: block; font-size: 8px; font-weight: 700; letter-spacing: .19em; color: var(--gold-deep); margin-bottom: 5px; }
.head-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; max-width: 670px; }
.panel-body { padding: 4px 24px 24px; }
.panel-note { margin: 6px 20px 20px; padding: 13px 14px; background: var(--green-pale); border: 1px solid #dcebe3; border-radius: 11px; }
.panel-note b { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--green); margin-bottom: 5px; }
.panel-note p { font-size: 10.5px; color: #648076; line-height: 1.65; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); font-size: 11px; font-weight: 700; }

/* ---------- Dashboard ---------- */
.dashboard-heading { margin-bottom: 20px; }
.hero-panel {
  position: relative; overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(80% 130% at 93% 15%, rgba(205, 170, 101, .22), transparent 42%),
    radial-gradient(60% 100% at 8% 0%, rgba(104, 163, 139, .2), transparent 50%),
    linear-gradient(135deg, #174a42 0%, #123d37 55%, #0d332e 100%);
  color: #f6f1e6;
  box-shadow: 0 20px 52px rgba(18, 52, 45, .18);
  margin-bottom: 22px;
}
.hero-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at 80% 40%, #000, transparent 70%);
}
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr .75fr; min-height: 316px; }
.hero-copy { padding: 38px 20px 34px 40px; display: flex; flex-direction: column; justify-content: center; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid rgba(219, 188, 128, .28); background: rgba(219, 188, 128, .09);
  color: #e2c58e; font-size: 9.5px; letter-spacing: .13em; font-weight: 600;
}
.hero-copy h2 { font-family: var(--serif); font-size: clamp(32px, 3.2vw, 46px); line-height: 1.23; font-weight: 800; letter-spacing: .01em; margin: 16px 0 14px; color: #fffaf0; }
.hero-copy h2 em { font-style: normal; color: #e3c48a; position: relative; }
.hero-copy h2 em::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 6px; border-radius: 4px; background: rgba(227, 196, 138, .18); }
.hero-copy > p { font-size: 12.5px; line-height: 1.85; color: rgba(238, 242, 233, .67); max-width: 500px; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-visual { position: relative; display: grid; place-items: center; padding: 24px 34px 24px 0; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(219, 188, 128, .16); }
.orbit-1 { width: 300px; height: 300px; }
.orbit-2 { width: 390px; height: 390px; border-style: dashed; opacity: .55; animation: spin 55s linear infinite; }
.orbit-3 { width: 220px; height: 220px; background: radial-gradient(circle, rgba(219, 188, 128, .09), transparent 68%); border-color: rgba(219, 188, 128, .1); }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-ticket {
  position: relative; width: 212px; padding: 17px 17px 19px;
  background: linear-gradient(155deg, #fffdf6, #f7eedc);
  border-radius: 17px; color: #29433b; transform: rotate(3deg);
  box-shadow: 0 30px 60px rgba(3, 20, 16, .34), inset 0 0 0 1px rgba(183, 138, 69, .22);
}
.hero-ticket::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(183, 138, 69, .22); border-radius: 12px; pointer-events: none; }
.ticket-top { display: flex; justify-content: space-between; font-size: 8.5px; letter-spacing: .13em; color: #9a7a44; font-weight: 700; }
.ticket-no { color: #b0a28d; }
.ticket-qr { display: grid; place-items: center; height: 94px; margin: 13px 0 9px; color: #204b42; }
.hero-ticket > b { display: block; text-align: center; font-size: 11.5px; letter-spacing: .02em; color: #2e4a42; }
.hero-ticket > span { display: block; text-align: center; font-size: 8.5px; color: #9b8e7a; margin-top: 4px; }
.ticket-cut { position: absolute; left: 14px; right: 14px; bottom: 47px; border-top: 1px dashed rgba(183, 138, 69, .3); }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  background: rgba(255, 253, 246, .94); color: #285146;
  font-size: 9.5px; font-weight: 600; box-shadow: 0 10px 24px rgba(5, 26, 21, .24);
  backdrop-filter: blur(6px);
}
.chip-a { left: 15px; top: 62px; transform: rotate(-4deg); color: #16704f; }
.chip-b { right: 12px; bottom: 55px; transform: rotate(4deg); color: #8b6123; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 19px 19px 18px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stat-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--green-soft); color: var(--green); }
.stat-gold .stat-icon { background: var(--gold-soft); color: var(--gold-deep); }
.stat-blue .stat-icon { background: #eaf0f4; color: #3d6580; }
.stat-red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-main { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-family: var(--serif); font-size: 29px; line-height: 1.1; color: var(--ink-deep); letter-spacing: -.02em; }
.stat-sub { font-size: 9.5px; color: var(--muted-2); margin-top: 5px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr); gap: 18px; align-items: start; }
.panel-main .panel-head { padding-bottom: 8px; }
.project-list { padding: 0 12px 12px; }
.project-row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto 26px; align-items: center; gap: 16px;
  padding: 15px 12px; border-radius: 13px; border: 1px solid transparent;
  transition: background .18s, border-color .18s, transform .18s;
}
.project-row:hover { background: #faf7f0; border-color: #ebe4d8; transform: translateX(2px); }
.project-row + .project-row { border-top: 1px solid #f1ece2; border-top-left-radius: 0; border-top-right-radius: 0; }
.project-row-date { width: 55px; height: 55px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #f5efe3; border: 1px solid #eee4d2; }
.project-row-date b { font-size: 12px; font-weight: 700; color: #7e5c27; }
.project-row-date span { font-size: 9px; color: #a08d6c; margin-top: 2px; }
.row-title-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.row-title-line h3 { font-size: 13.5px; font-weight: 700; color: #293a33; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-main p { font-size: 10.5px; color: var(--muted); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-progress { height: 3px; background: #eee8dc; border-radius: 3px; margin-top: 10px; width: 78%; overflow: hidden; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2d7d6b, #b78a45); }
.project-row-stats { display: flex; gap: 18px; }
.project-row-stats span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.project-row-stats b { font-family: var(--serif); font-size: 17px; color: #33483f; }
.project-row-stats small { font-size: 8.5px; color: var(--muted-2); }
.row-arrow { color: #b9b0a0; transition: transform .18s, color .18s; }
.project-row:hover .row-arrow { color: var(--green); transform: translateX(3px); }
.side-panel .panel-head { padding-bottom: 10px; }
.todo-list { padding: 0 14px 4px; display: grid; gap: 7px; }
.todo-item { display: flex; align-items: center; gap: 11px; padding: 11px 10px; border-radius: 11px; background: #fbf8f1; border: 1px solid #f0e9dc; transition: border-color .18s, background .18s; }
.todo-item:hover { background: #f7f2e6; border-color: #e8dcc4; }
.todo-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; background: var(--gold-soft); color: var(--gold-deep); flex: 0 0 auto; }
.todo-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-copy b { font-size: 11.5px; color: #33443c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-copy small { font-size: 9.5px; color: var(--muted); }
.todo-item > .icon:last-child { margin-left: auto; color: #b6ac9b; }
.todo-empty { display: flex; flex-direction: column; align-items: center; padding: 25px 10px 30px; color: var(--muted-2); text-align: center; gap: 6px; }
.todo-empty b { color: #4d5c54; font-size: 12px; }
.todo-empty span { font-size: 10px; }

/* ---------- Projects list ---------- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tabs { display: inline-flex; padding: 4px; border-radius: 11px; background: #ebe6dc; border: 1px solid #e2dbcd; }
.filter-tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; color: #6f6a5e; font-size: 11.5px; font-weight: 600; }
.filter-tabs button span { margin-left: 4px; opacity: .55; font-size: 10px; }
.filter-tabs button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(51, 47, 38, .08); }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 250px; padding: 0 12px; height: 38px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted-2); }
.search-box input { border: 0; outline: none; background: transparent; font-size: 12px; width: 100%; color: #304039; }
.search-box input::placeholder { color: #aaa190; }
.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 17px;
  padding: 20px 20px 0; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.project-card::before { content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .45; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dcd3c3; }
.project-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.project-code { font-size: 8px; letter-spacing: .12em; color: #b2a692; }
.project-theme { font-size: 9.5px; color: var(--gold-deep); font-weight: 600; letter-spacing: .02em; margin-bottom: 5px; }
.project-card h3 { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.45; color: #223730; min-height: 54px; letter-spacing: -.01em; }
.project-meta { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.project-meta span { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.project-meta .icon { color: #a99b84; }
.project-progress-block { margin-top: 18px; padding: 13px 14px; border-radius: 11px; background: #f8f5ee; border: 1px solid #f0eadf; }
.progress-label { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: var(--muted); margin-bottom: 8px; }
.progress-label b { font-size: 12px; color: var(--green); }
.progress-track { height: 5px; border-radius: 5px; background: #e7e0d3; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2b7d6b, #b78a45); }
.project-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 0; margin-top: 4px; }
.project-card-stats span { display: flex; flex-direction: column; align-items: center; gap: 2px; border-left: 1px solid #f0ebe1; }
.project-card-stats span:first-child { border-left: 0; }
.project-card-stats b { font-family: var(--serif); font-size: 22px; color: #2b493f; line-height: 1.1; }
.project-card-stats small { font-size: 9px; color: var(--muted-2); }
.project-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -20px; padding: 12px 20px; border-top: 1px solid #f1ece2; background: #fdfbf6; }
.project-card-foot > span { font-size: 9.5px; color: var(--muted-2); }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--green); }
.card-link:hover { color: var(--gold-deep); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state.compact { padding: 34px 20px; }
.empty-state > span { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 16px; background: var(--green-soft); color: var(--green); margin-bottom: 13px; }
.empty-state b { font-size: 14px; color: #39493f; margin-bottom: 5px; }
.empty-state p { font-size: 11.5px; color: var(--muted-2); line-height: 1.65; max-width: 390px; margin-bottom: 15px; }
.span-all { grid-column: 1 / -1; }
.empty-filter { padding: 36px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- New project form ---------- */
.project-form .form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.form-primary { display: grid; gap: 18px; }
.form-aside { position: sticky; top: 88px; display: grid; gap: 12px; }
.aside-card { padding: 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.aside-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); color: var(--gold-deep); margin-bottom: 12px; }
.aside-card h3 { font-size: 14px; color: #2d4138; margin-bottom: 7px; }
.aside-card p { font-size: 11px; line-height: 1.7; color: var(--muted); margin-bottom: 12px; }
.aside-card-muted { background: #f7f4ec; }
.aside-card-muted .aside-icon { background: var(--green-soft); color: var(--green); }
.rule-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.rule-list li { position: relative; padding-left: 15px; font-size: 10.5px; color: var(--muted); line-height: 1.55; }
.rule-list li::before { content: ""; position: absolute; left: 0; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.session-form-list { display: grid; gap: 10px; }
.session-generator { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; padding: 12px 14px; border-radius: 11px; background: #f5f0e5; border: 1px solid #ebe2d2; flex-wrap: wrap; }
.session-generator > div { display: flex; flex-direction: column; gap: 2px; }
.session-generator b { font-size: 11.5px; color: #4c574e; }
.session-generator span { font-size: 9px; color: var(--muted-2); }
.session-count { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.session-count input { width: 62px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fffefa; padding: 0 8px; font-size: 12px; color: #34473e; }
.session-form-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 30px; gap: 12px; align-items: start; padding: 14px; border-radius: 12px; border: 1px solid #ece5d9; background: #fdfbf6; }
.session-row-index { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 10.5px; font-weight: 700; margin-top: 24px; }
.session-row-fields { display: grid; gap: 10px; }
.session-row-fields .field-row { grid-template-columns: 1.4fr 1fr 1fr; }
.remove-session { margin-top: 22px; color: #b1a795; }
.remove-session:hover { background: var(--red-bg); color: var(--red); }
.edit-warning { display: flex; gap: 9px; align-items: flex-start; padding: 13px 15px; border-radius: 11px; border: 1px solid #eadfc9; background: #fbf6ea; color: #7b6d57; font-size: 10.5px; line-height: 1.65; }
.edit-warning .icon { color: var(--gold-deep); margin-top: 1px; }

/* ---------- Project detail ---------- */
.project-detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted-2); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb b { font-weight: 500; color: #8c8476; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title-line h1 { font-family: var(--serif); font-size: clamp(25px, 2.3vw, 34px); color: var(--ink-deep); letter-spacing: -.02em; line-height: 1.25; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 9px; }
.detail-meta .icon { color: #a59882; }
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 15px; margin-bottom: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.detail-stats > div { display: flex; flex-direction: column; padding: 16px 22px; border-left: 1px solid #f0eade; }
.detail-stats > div:first-child { border-left: 0; }
.detail-stats span { font-size: 10px; color: var(--muted); }
.detail-stats b { font-family: var(--serif); font-size: 26px; color: #26483d; line-height: 1.2; margin: 2px 0; }
.detail-stats b em { font-style: normal; font-size: 13px; color: #aaa190; }
.detail-stats small { font-size: 9px; color: var(--muted-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 22px; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 13px 16px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tabs a::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--green); }
.tabs a.is-active::after { background: var(--green); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-size: 22px; color: #243c33; letter-spacing: -.01em; }
.section-head p { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.session-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 108px; grid-template-rows: auto auto; gap: 12px 14px;
  padding: 17px; border-radius: 15px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s;
}
.session-card:hover { border-color: #d9d0c0; box-shadow: var(--shadow); }
.session-date-block { grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3px; border-right: 1px solid #f0eadf; padding-right: 12px; }
.session-date-block b { font-family: var(--serif); font-size: 23px; line-height: 1; color: #2b4a40; }
.session-date-block span { font-size: 9px; color: var(--gold-deep); margin-top: 4px; }
.session-date-block small { margin-top: 8px; font-size: 8.5px; color: #a49b8b; background: #f4efe4; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.session-info { min-width: 0; }
.session-info h3 { font-size: 14px; font-weight: 700; color: #2b3d35; line-height: 1.45; }
.session-info > p { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 9.5px; color: var(--muted); margin-top: 6px; }
.session-info .icon { color: #aa9c87; }
.session-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-width: 0; }
.signed-count { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #718077; white-space: nowrap; }
.signed-count b { color: var(--green); }
.signed-count .icon { color: var(--green); }
.qr-url { font-family: Consolas, monospace; font-size: 8.5px; color: #aaa08e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-qr-wrap { grid-row: 1 / 3; grid-column: 3; display: flex; flex-direction: column; align-items: center; gap: 4px; align-self: center; }
.session-qr { width: 96px; height: 96px; border-radius: 8px; border: 1px solid #eee6d8; background: #fff; padding: 3px; cursor: zoom-in; }
.session-qr-wrap > span { font-size: 8.5px; color: var(--muted-2); letter-spacing: .03em; }
.session-actions { display: flex; align-items: center; gap: 6px; grid-column: 2; flex-wrap: wrap; }
.add-session-panel { margin-top: 18px; }
.add-session-panel summary { display: flex; align-items: center; gap: 7px; padding: 17px 22px; font-size: 12.5px; font-weight: 600; color: var(--green); cursor: pointer; list-style: none; }
.add-session-panel summary::-webkit-details-marker { display: none; }
.add-session-panel[open] summary { border-bottom: 1px solid #f0eadf; }
.add-session-panel .panel-body { padding-top: 20px; }
.info-banner { display: flex; gap: 11px; margin-top: 18px; padding: 15px 17px; border-radius: 12px; border: 1px solid #e6dfd1; background: #fbf8f1; color: #706859; }
.info-banner .icon { color: var(--gold-deep); margin-top: 1px; }
.info-banner b { display: block; font-size: 11.5px; color: #4d5a50; margin-bottom: 3px; }
.info-banner p { font-size: 10px; line-height: 1.7; }
.info-banner code { background: #f1ebdf; padding: 1px 5px; border-radius: 4px; font-size: 9.5px; color: #6f5c3b; }

/* ---------- Attendance table ---------- */
.attendance-summary { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; padding: 11px 15px; margin-bottom: 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.attendance-summary > span { display: inline-flex; align-items: center; gap: 5px; }
.attendance-summary b { color: #37473f; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.green { background: #2e9a70; box-shadow: 0 0 0 3px rgba(46, 154, 112, .1); }
.legend-dot.red { background: var(--red); box-shadow: 0 0 0 3px rgba(180, 35, 24, .08); }
.summary-divider { width: 1px; height: 12px; background: var(--line-strong); }
.summary-spacer { flex: 1; }
.rule-chip { color: #8b6123; background: var(--gold-soft); padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 600; }
.table-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
.attendance-table, .cert-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.attendance-table th, .cert-table th {
  padding: 10px 11px; text-align: left; background: #f8f5ee;
  border-bottom: 1px solid #e9e2d5; color: #6e766f; font-weight: 600; font-size: 10px; white-space: nowrap;
}
.attendance-table th.session-th { min-width: 88px; text-align: center; }
.session-th span { display: block; font-size: 8px; color: #a69c8a; font-weight: 500; }
.session-th b { display: block; font-size: 10.5px; color: #425248; margin: 2px 0; }
.session-th small { display: block; font-size: 8px; font-weight: 400; color: #9a9181; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num-th { text-align: center !important; min-width: 64px; }
.action-th { text-align: right !important; min-width: 90px; }
.attendance-table td, .cert-table td { padding: 9px 11px; border-bottom: 1px solid #f1ece2; vertical-align: middle; }
.attendance-table tbody tr:last-child td, .cert-table tbody tr:last-child td { border-bottom: 0; }
.attendance-table tbody tr { transition: background .15s; }
.attendance-table tbody tr:hover { background: #fcfaf5; }
.attendance-table .sticky-col { position: sticky; left: 0; z-index: 2; background: var(--card); min-width: 218px; box-shadow: 1px 0 0 #f0eadf; }
.attendance-table th.sticky-col { background: #f8f5ee; z-index: 3; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person-cell > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-cell b { font-size: 11.5px; color: #2f4038; white-space: nowrap; }
.person-cell span { font-size: 9px; color: #9a9183; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-has-missing .sticky-col { box-shadow: inset 3px 0 0 #efb6b0, 1px 0 0 #f0eadf; }
.row-excluded { opacity: .72; }
.check-cell { text-align: center; min-width: 72px; }
.check-cell .check-mark { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; vertical-align: middle; }
.check-cell small { display: block; margin-top: 3px; font-size: 8px; }
.check-cell.present .check-mark { color: #1f815b; background: #e7f4ed; }
.check-cell.present small { color: #79a595; }
.check-cell.missing { background: #fdf4f3; }
.check-cell.missing .check-mark { color: var(--red); background: #fbe4e1; }
.check-cell.missing small { color: var(--red); font-weight: 600; }
.num-cell { text-align: center; white-space: nowrap; }
.num-cell b { display: block; font-size: 12.5px; color: #35483f; }
.num-cell b em { font-style: normal; font-size: 9.5px; color: #a79e8f; }
.num-cell small { display: block; font-size: 8.5px; margin-top: 2px; color: var(--muted-2); }
.status-note { display: block; margin-top: 3px; font-size: 8px; color: var(--red); }
.action-cell { text-align: right; white-space: nowrap; }
.action-cell .btn { margin-left: 3px; }
.table-footnote { display: flex; gap: 8px; align-items: flex-start; padding: 13px 4px 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; }
.table-footnote .icon { color: #a89a80; margin-top: 1px; }
.cert-table th:first-child, .cert-table td:first-child { padding-left: 18px; }
.cert-no { font-size: 10.5px; color: #4d5a52; background: #f7f3ea; padding: 3px 6px; border-radius: 5px; }
.muted-cell { color: var(--muted); font-size: 10px; white-space: nowrap; }
.unit-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 12px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.unit-summary > div { display: flex; flex-direction: column; padding: 13px 18px; background: var(--card); }
.unit-summary span { font-size: 9.5px; color: var(--muted); }
.unit-summary b { font-family: var(--serif); font-size: 24px; line-height: 1.2; color: #2a4a3f; }
.unit-summary small { font-size: 8.5px; color: var(--muted-2); }
.unit-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.unit-table th { padding: 10px 12px; text-align: left; background: #f8f5ee; border-bottom: 1px solid #e9e2d5; color: #6e766f; font-weight: 600; font-size: 9.5px; white-space: nowrap; }
.unit-table td { padding: 11px 12px; border-bottom: 1px solid #f1ece2; vertical-align: middle; }
.unit-table tbody tr:last-child td { border-bottom: 0; }
.unit-table tbody tr:hover { background: #fcfaf5; }
.unit-name { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.unit-mark { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); font-family: var(--serif); font-size: 14px; font-weight: 700; }
.unit-name > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.unit-name b { font-size: 11.5px; color: #33453c; }
.unit-name small { font-size: 8.5px; color: #9a9181; }
.unit-variants { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 330px; }
.unit-variants span { font-size: 8.5px; color: #756b5b; background: #f5f0e6; border: 1px solid #ebe3d5; border-radius: 4px; padding: 2px 5px; }
.unit-variants em { font-style: normal; font-size: 8px; color: var(--gold-deep); }
.unit-variants em.single { color: #aaa08f; }
.unit-rate-th { min-width: 120px; }
.unit-rate-cell { min-width: 120px; white-space: nowrap; }
.unit-rate-cell b { font-size: 10px; color: var(--green); margin-left: 7px; }
.unit-progress { display: inline-block; width: 72px; height: 5px; background: #eee8dc; border-radius: 5px; overflow: hidden; vertical-align: middle; }
.unit-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2b7d6b, #b78a45); }
.notice-card { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 16px; border-radius: 15px; border: 1px solid #eadfc9; background: linear-gradient(120deg, #fbf6ea, #f8f2e4); }
.notice-illustration { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: var(--gold-soft); color: var(--gold-deep); }
.notice-card b { display: block; font-size: 14px; color: #3e4a41; margin-bottom: 4px; }
.notice-card p { font-size: 11px; color: #7b7363; line-height: 1.7; }
.notice-card p strong { color: var(--green); }
.notice-card .btn { margin-left: auto; flex: 0 0 auto; }
.notice-success { background: linear-gradient(120deg, #f1f8f3, #eaf4ee); border-color: #d5e8dc; }
.notice-success .notice-illustration { background: #dcefe4; color: #207a56; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 32, 27, .58); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal-card {
  position: relative; z-index: 1; width: min(100%, 480px); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fffdf8; border-radius: 20px; padding: 30px;
  box-shadow: 0 30px 90px rgba(6, 26, 20, .32);
  animation: modalIn .24s ease both;
}
.modal-card h2 { font-family: var(--serif); font-size: 24px; color: #1f3a31; letter-spacing: -.01em; margin: 4px 0 8px; }
.modal-kicker { font-size: 8px; letter-spacing: .2em; color: var(--gold-deep); font-weight: 700; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; background: #f5f1e8; color: #8f8677; }
.modal-close:hover { background: #eee8dc; color: var(--ink); }
.modal-sub { font-size: 11.5px; color: var(--muted); line-height: 1.65; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal-hint { text-align: center; font-size: 9.5px; color: var(--muted-2); margin-top: 13px; }
.modal-qr { width: min(100%, 430px); text-align: center; padding: 30px 28px 24px; }
.modal-qr h2 { margin-top: 5px; }
.modal-date { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.qr-big-wrap { width: 230px; height: 230px; margin: 18px auto 14px; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid #ece4d5; box-shadow: 0 12px 28px rgba(50, 45, 34, .08); }
.qr-big-wrap img { width: 100%; height: 100%; object-fit: contain; }
.qr-link-row { display: flex; gap: 7px; }
.qr-link-row input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fbf8f1; padding: 0 9px; color: #6d6558; font-size: 9.5px; }
.modal-qr .modal-actions { justify-content: center; }
.issue-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0; background: #ece4d6; border-radius: 12px; overflow: hidden; border: 1px solid #ece4d6; }
.issue-summary > div { display: flex; flex-direction: column; align-items: center; padding: 15px 8px; background: #fbf8f1; }
.issue-summary b { font-family: var(--serif); font-size: 27px; color: var(--green); line-height: 1.15; }
.issue-summary span { font-size: 9px; color: var(--muted); margin-top: 4px; }
.confirm-note { display: flex; gap: 9px; padding: 13px; border-radius: 10px; background: #f7f2e7; color: #766d5d; }
.confirm-note .icon { color: var(--gold-deep); margin-top: 1px; }
.confirm-note p { font-size: 10px; line-height: 1.7; }
.modal-form .form-grid { gap: 13px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Template ---------- */
.template-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 20px; align-items: start; }
.template-form { position: static; max-height: none; overflow: visible; }
.template-form .panel-body { padding-top: 8px; }
.color-row { display: flex; gap: 14px; flex-wrap: wrap; }
.color-row label { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.color-row input[type="color"] { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.seal-upload { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed #d8cdb9; border-radius: 11px; background: #fbf8f1; }
.seal-upload-preview { width: 76px; height: 76px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; border: 1px solid #eadfcd; background: #fffdf8; overflow: hidden; }
.seal-upload-preview img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.seal-upload-preview span { font-size: 8.5px; line-height: 1.5; color: #a99e8b; text-align: center; }
.seal-upload-copy { min-width: 0; flex: 1; }
.seal-upload-copy b { display: block; font-size: 11px; color: #45534b; margin-bottom: 3px; }
.seal-upload-copy p { font-size: 9px; line-height: 1.6; color: var(--muted-2); margin: 0 0 8px; }
.seal-upload-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.seal-upload-actions label.btn { cursor: pointer; }
.layout-hint { display: flex; align-items: flex-start; gap: 5px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #f5efe3; color: #7d715d; font-size: 9px; line-height: 1.55; }
.layout-hint .icon { color: var(--gold-deep); margin-top: 1px; }
.block-settings { margin-top: 10px; padding: 12px 14px; border-radius: 11px; background: #fffdf8; border: 1px solid #e7dfd1; }
.block-settings-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.block-settings-head span { font-size: 9px; color: var(--muted-2); letter-spacing: .06em; }
.block-settings-head b { font-size: 12px; color: #32473d; }
.setting-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 46px; align-items: center; gap: 8px; margin: 7px 0; }
.setting-row > span { font-size: 9.5px; color: var(--muted); }
.setting-row input[type="range"] { width: 100%; accent-color: var(--green); height: 18px; }
.setting-row output { font-size: 9.5px; color: #52645a; text-align: right; font-variant-numeric: tabular-nums; }
.block-settings p { margin: 7px 0 0; font-size: 8.5px; line-height: 1.6; color: #a19888; }
.block-settings.is-nontext #fontSizeField { display: none; }
.preview-badge .icon { vertical-align: -2px; margin-right: 2px; }
.template-vars { padding: 10px 12px; border-radius: 9px; background: var(--green-pale); color: #617b72; font-size: 10px; line-height: 1.6; display: flex; gap: 6px; align-items: center; }
.template-preview-panel { min-width: 0; position: sticky; top: 88px; align-self: start; }
.preview-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.preview-head h2 { font-family: var(--serif); font-size: 22px; color: #293f36; }
.preview-badge { font-size: 9px; padding: 5px 9px; border-radius: 999px; background: #eae4d7; color: #7b7362; }
.cert-preview-frame { padding: 20px; border-radius: 16px; background: #e9e3d7; border: 1px solid #ddd4c3; box-shadow: inset 0 1px 4px rgba(55, 48, 37, .07); }
.preview-note { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted-2); margin-top: 10px; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.settings-main { display: grid; gap: 18px; }
.settings-main .panel-body { display: flex; flex-direction: column; gap: 14px; }
.lan-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 9.5px; color: var(--muted); }
.lan-url { background: #f3eee3; border: 1px solid #e8dfd0; padding: 3px 7px; border-radius: 5px; color: #6e5d42; font-size: 9px; line-height: 1.3; transition: background .18s, border-color .18s; }
.lan-url:hover { background: var(--gold-soft); border-color: #dec9a4; color: #6c4e21; }
.settings-aside { display: grid; gap: 18px; }
.settings-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 20px 20px; background: #eee7da; border-radius: 10px; overflow: hidden; border: 1px solid #eee7da; }
.settings-stats div { padding: 14px; background: #fbf8f1; display: flex; flex-direction: column; }
.settings-stats b { font-family: var(--serif); font-size: 24px; color: var(--green); }
.settings-stats span { font-size: 9px; color: var(--muted); }
.deployment-card { padding: 22px; }
.deployment-card h3 { font-size: 14px; margin-bottom: 10px; color: #35473e; }
.deployment-card .hint { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0eadf; }

/* ==========================================================
   Certificate design
   ========================================================== */
.cert-paper {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  color: #2e2924;
  background: var(--cert-paper, #fffdf6);
  font-family: var(--serif);
  box-shadow: 0 14px 38px rgba(42, 35, 22, .16), 0 2px 5px rgba(42, 35, 22, .08);
}
.cert-paper::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(183, 138, 69, .08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 74%, rgba(183, 138, 69, .07) 0 1px, transparent 1.5px);
  background-size: 11px 11px, 17px 17px;
}
.cert-frame {
  position: absolute; inset: 2.6%;
  border: 2px solid var(--cert-accent, #9f2d20);
  box-shadow: inset 0 0 0 .5cqw var(--cert-paper, #fffdf6), inset 0 0 0 calc(.5cqw + 1px) var(--cert-border, #b78a45);
  pointer-events: none; z-index: 1;
}
.cert-frame::before { content: ""; position: absolute; inset: 1.2%; border: 1px solid var(--cert-border, #b78a45); opacity: .6; pointer-events: none; }
.cert-corner { position: absolute; width: 4.2%; height: 5.6%; border-color: var(--cert-border, #b78a45); border-style: solid; opacity: .65; }
.cert-corner.tl { left: 2.6%; top: 2.6%; border-width: 1px 0 0 1px; }
.cert-corner.tr { right: 2.6%; top: 2.6%; border-width: 1px 1px 0 0; }
.cert-corner.bl { left: 2.6%; bottom: 2.6%; border-width: 0 0 1px 1px; }
.cert-corner.br { right: 2.6%; bottom: 2.6%; border-width: 0 1px 1px 0; }
.cert-canvas { position: absolute; inset: 0; z-index: 2; }
.cert-block { position: absolute; transform: translate(-50%, -50%); text-align: center; line-height: 1.25; box-sizing: border-box; }
.cert-logo-block { aspect-ratio: 1; }
.cert-logo {
  width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%;
  background: var(--cert-accent, #9f2d20); color: #fff8e9; font-size: 2.55cqw; font-weight: 700;
  box-shadow: 0 0 0 .7cqw rgba(159, 45, 32, .06);
}
.cert-org { font-size: 1.3cqw; letter-spacing: .33em; color: #7c6f60; font-weight: 600; padding-left: .33em; }
.cert-kicker { font-family: Georgia, "Times New Roman", serif; font-size: .92cqw; letter-spacing: .4em; color: var(--cert-border, #b78a45); padding-left: .4em; }
.cert-title { font-size: 4.25cqw; line-height: 1.1; letter-spacing: .14em; color: var(--cert-accent, #9f2d20); font-weight: 800; padding-left: .14em; margin: 0; }
.cert-rule { display: flex; align-items: center; gap: 1.1cqw; color: var(--cert-border, #b78a45); }
.cert-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--cert-border, #b78a45)); }
.cert-rule span:last-child { background: linear-gradient(90deg, var(--cert-border, #b78a45), transparent); }
.cert-rule i { font-size: .85cqw; font-style: normal; line-height: 1; }
.cert-intro { font-size: 1.32cqw; letter-spacing: .25em; color: #7c6f60; padding-left: .25em; }
.cert-name {
  font-size: 4.9cqw; line-height: 1.2; color: #2d2923; font-weight: 700; letter-spacing: .25em;
  padding: 0 0 .35cqw; padding-left: .25em;
}
.cert-school { font-size: 1.22cqw; letter-spacing: .08em; color: #7c6f60; }
.cert-body { font-size: 1.48cqw; line-height: 1.75; color: #443d35; letter-spacing: .02em; }
.cert-issuer { font-size: 1.2cqw; color: #4d4438; border-top: 1px solid #c9bba7; padding-top: .55cqw; }
.cert-date { font-size: .82cqw; color: #8b7e6c; }
.cert-no-block { display: flex; flex-direction: column; gap: .3cqw; color: #6f6353; }
.cert-no-block b { font-family: var(--font); font-size: .78em; font-weight: 500; color: #9a8d7b; letter-spacing: .12em; }
.cert-no-block span { font-family: Consolas, monospace; font-size: 1em; overflow-wrap: anywhere; }
.cert-qr-block img, .cert-qr { width: 100%; height: auto; display: block; border-radius: .4cqw; background: #fff; }
.cert-qr-placeholder { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border: 1px dashed rgba(183, 138, 69, .55); border-radius: .4cqw; color: #b78a45; font-family: var(--font); font-size: .72cqw; letter-spacing: .1em; }
.cert-seal-block { pointer-events: none; }
.cert-preview-frame.is-editable .cert-seal-block { pointer-events: auto; }
.cert-seal-img { width: 100%; height: auto; display: block; opacity: .88; mix-blend-mode: multiply; }
.cert-seal {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: .18cqw solid rgba(159, 45, 32, .62); color: rgba(159, 45, 32, .78);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2cqw;
  font-size: .78cqw; line-height: 1.35; letter-spacing: .03em; transform: rotate(-9deg); opacity: .78;
  padding: 1.1cqw; position: relative;
}
.cert-seal::before { content: ""; position: absolute; inset: .48cqw; border: .1cqw solid rgba(159, 45, 32, .48); border-radius: 50%; }
.cert-seal b { font-size: 1.8cqw; line-height: 1; }
.cert-seal small { font-size: .68cqw; letter-spacing: .1em; }

/* template editor: drag blocks */
.cert-preview-frame.is-editable .cert-block {
  cursor: grab; touch-action: none; outline: 1px dashed transparent; outline-offset: 2px;
  transition: outline-color .15s, background .15s;
}
.cert-preview-frame.is-editable .cert-block:hover {
  outline-color: rgba(22, 94, 82, .5); background: rgba(22, 94, 82, .045);
}
.cert-preview-frame.is-editable .cert-block:focus-visible { outline: 2px solid rgba(22, 94, 82, .7); }
.cert-preview-frame.is-editable .cert-block.is-selected {
  outline: 1px dashed rgba(22, 94, 82, .74); outline-offset: 2px;
  background: transparent;
}
.cert-preview-frame.is-editable .cert-block.is-dragging {
  cursor: grabbing; outline: 2px solid rgba(183, 138, 69, .95);
  background: rgba(183, 138, 69, .08); z-index: 20;
}
.cert-preview-frame.is-editable .cert-block::after {
  content: attr(data-cert-label);
  position: absolute; left: 50%; top: -1.9cqw; transform: translateX(-50%);
  font-family: var(--font); font-size: .72cqw; letter-spacing: .04em; color: #fff;
  background: rgba(22, 94, 82, .86); border-radius: .3cqw; padding: .18cqw .55cqw;
  opacity: 0; pointer-events: none; transition: opacity .15s; white-space: nowrap;
}
.cert-preview-frame.is-editable .cert-block:hover::after,
.cert-preview-frame.is-editable .cert-block.is-dragging::after { opacity: 1; }

/* ==========================================================
   Login
   ========================================================== */
.login-body { background: #f3efe5; }
.login-shell { display: grid; grid-template-columns: 1.04fr .96fr; min-height: 100vh; }
.login-art {
  position: relative; overflow: hidden; color: #f5f0e4;
  background:
    radial-gradient(80% 90% at 16% 8%, rgba(121, 173, 149, .22), transparent 54%),
    radial-gradient(70% 80% at 92% 100%, rgba(201, 157, 86, .22), transparent 54%),
    linear-gradient(160deg, #15473f 0%, #0e3731 60%, #0a2b27 100%);
}
.login-art::before {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background-image: radial-gradient(rgba(255, 255, 255, .5) .6px, transparent .6px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 22% 30%, #000, transparent 68%);
}
.login-art::after {
  content: "证"; position: absolute; right: -8%; bottom: -17%; font-family: var(--serif);
  font-size: 62vw; color: rgba(255, 255, 255, .018); line-height: 1; pointer-events: none;
}
.login-art-inner { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; padding: 42px 54px 34px; }
.login-quote { margin: auto 0 0; padding: 46px 0 36px; }
.login-quote h1 { font-family: var(--serif); font-size: clamp(42px, 4.2vw, 64px); line-height: 1.2; font-weight: 800; color: #fffaf0; letter-spacing: -.02em; margin: 20px 0 18px; }
.login-quote h1 em { font-style: normal; color: #e0be7f; }
.login-quote p { font-size: 13px; color: rgba(239, 243, 234, .6); line-height: 2; letter-spacing: .04em; }
.login-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 24px; margin-bottom: auto; }
.login-points > div { display: flex; flex-direction: column; gap: 4px; }
.login-points span { font-family: Georgia, serif; font-size: 11px; color: #d7b16b; letter-spacing: .1em; }
.login-points b { font-size: 11.5px; font-weight: 600; color: #f3ede0; }
.login-points small { font-size: 9px; color: rgba(235, 240, 231, .45); }
.login-art-foot { font-size: 9px; letter-spacing: .12em; color: rgba(235, 240, 231, .32); margin-top: 34px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; background: #f4f0e7; position: relative; }
.login-card { width: min(100%, 390px); }
.login-card h2 { font-family: var(--serif); font-size: 34px; color: #173a32; margin: 7px 0 7px; letter-spacing: -.02em; }
.login-card > p { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 28px; }
.login-card .field { margin-bottom: 18px; }
.password-wrap { position: relative; }
.password-wrap > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #aaa08e; }
.login-card .btn { margin-top: 4px; }
.login-hint { text-align: center; font-size: 10px; color: var(--muted-2); margin-top: 15px; }
.login-hint code { background: #ece5d8; padding: 2px 6px; border-radius: 4px; color: #7b6542; }
.login-copyright { position: absolute; bottom: 26px; font-size: 9px; color: #aaa190; letter-spacing: .06em; }

/* ==========================================================
   Public / teacher mobile
   ========================================================== */
.public-body {
  min-height: 100vh;
  background:
    radial-gradient(70% 34% at 10% 0%, rgba(183, 138, 69, .09), transparent 60%),
    radial-gradient(60% 38% at 94% 8%, rgba(22, 94, 82, .07), transparent 62%),
    #f4f1e9;
}
.public-shell { width: min(100%, 690px); min-height: 100vh; margin: 0 auto; padding: 0 18px 30px; display: flex; flex-direction: column; }
.public-top { display: flex; align-items: center; justify-content: space-between; padding: 21px 3px 18px; }
.public-brand { display: inline-flex; align-items: center; gap: 9px; }
.public-brand .brand-mark { width: 35px; height: 35px; border-radius: 10px; font-size: 19px; }
.public-brand > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.public-brand b { font-family: var(--serif); font-size: 17px; letter-spacing: .1em; color: #173f37; font-weight: 800; }
.public-brand small { font-size: 8px; color: #9b9282; letter-spacing: .04em; }
.secure-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: #7c8b82; background: rgba(255, 255, 255, .5); border: 1px solid #e2dccf; border-radius: 999px; padding: 5px 9px; }
.public-main { flex: 1; }
.public-footer { display: flex; justify-content: space-between; gap: 12px; padding: 22px 2px 4px; font-size: 8.5px; color: #a99f8f; }
.signin-page .public-shell { width: min(100%, 610px); }
.training-banner {
  position: relative; overflow: hidden; border-radius: 24px; padding: 25px 25px 28px; color: #f5f0e4;
  background:
    radial-gradient(100% 110% at 100% 0%, rgba(214, 174, 102, .3), transparent 56%),
    linear-gradient(145deg, #1a5349 0%, #113d36 58%, #0c2f2a 100%);
  box-shadow: 0 18px 42px rgba(18, 51, 43, .22);
}
.training-banner::after {
  content: ""; position: absolute; right: -48px; top: -48px; width: 180px; height: 180px; border-radius: 50%;
  border: 1px solid rgba(221, 188, 126, .24); box-shadow: 0 0 0 28px rgba(221, 188, 126, .04), 0 0 0 58px rgba(221, 188, 126, .025);
}
.training-banner-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signin-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 8.5px; letter-spacing: .1em; color: #e2c68f; border: 1px solid rgba(226, 198, 143, .3); background: rgba(226, 198, 143, .08); }
.signin-index { font-family: Georgia, serif; font-size: 10px; color: rgba(241, 236, 223, .52); letter-spacing: .1em; }
.training-theme { position: relative; z-index: 1; display: block; font-size: 9.5px; letter-spacing: .1em; color: #d9b97e; margin: 23px 0 6px; }
.training-banner h1 { position: relative; z-index: 1; font-family: var(--serif); font-size: clamp(23px, 4.4vw, 30px); line-height: 1.4; letter-spacing: .01em; color: #fffaf0; }
.training-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 15px; }
.training-meta span { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: rgba(240, 243, 234, .66); }
.training-meta .icon { color: rgba(226, 198, 143, .72); }
.session-chip {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 12px;
  background: #fffdf8; border: 1px solid #ebe3d5; border-radius: 15px;
  margin: -15px 16px 0; padding: 13px 15px; box-shadow: 0 12px 28px rgba(45, 40, 28, .09);
}
.session-chip-no { font-family: Georgia, serif; font-size: 22px; line-height: 1; color: var(--gold); border-right: 1px solid #ece4d6; padding-right: 12px; }
.session-chip > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session-chip small { font-size: 8px; color: #a19684; letter-spacing: .04em; }
.session-chip b { font-size: 12px; color: #35483f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-credit { margin-left: auto; font-size: 9px; color: #8b6123; background: var(--gold-soft); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.signin-panel { margin-top: 15px; background: #fffdf8; border: 1px solid #eae2d4; border-radius: 20px; padding: 24px; box-shadow: 0 12px 34px rgba(50, 45, 34, .06); }
.signin-form-head { margin-bottom: 19px; }
.step-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: #207352; background: #e7f3ec; padding: 4px 8px; border-radius: 999px; margin-bottom: 8px; }
.signin-form-head h2 { font-family: var(--serif); font-size: 23px; color: #213b32; letter-spacing: -.01em; }
.signin-form-head p { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.lookup-status { font-size: 10px; line-height: 1.55; padding: 7px 9px; border-radius: 7px; margin-top: 1px; }
.lookup-status.loading { color: #7c6b4d; background: #f7f1e5; }
.lookup-status.success { color: #176b4d; background: #e8f4ed; border: 1px solid #d3e9dc; }
.lookup-status.muted { color: #928875; background: #f7f4ed; }
.signin-form { display: grid; gap: 13px; }
.signin-form .field-row { grid-template-columns: 1.25fr .75fr; }
.privacy-check { display: flex; align-items: flex-start; gap: 7px; font-size: 9.5px; color: #8d8475; line-height: 1.6; cursor: pointer; }
.privacy-check input { margin-top: 2px; accent-color: var(--green); width: 14px; height: 14px; }
.fine-print { display: flex; align-items: center; justify-content: center; gap: 4px; text-align: center; font-size: 9px; color: #a69c8c; }
.signin-state { text-align: center; padding: 7px 0 2px; }
.state-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; }
.state-success { background: #e5f4ec; color: #1e7c55; box-shadow: 0 0 0 9px rgba(30, 124, 85, .05); }
.state-muted { background: #f0ece2; color: #918777; }
.state-kicker { font-size: 8px; letter-spacing: .2em; color: #2a8c63; font-weight: 700; }
.signin-state h2 { font-family: var(--serif); font-size: 29px; color: #1f3b31; margin: 5px 0 5px; }
.signin-state > p { font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.success-receipt { text-align: left; border-radius: 13px; background: #f9f6ee; border: 1px solid #ede5d7; padding: 4px 15px; margin-bottom: 16px; }
.success-receipt > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #e9e0d1; }
.success-receipt > div:last-child { border-bottom: 0; }
.success-receipt span { font-size: 9.5px; color: #9a9181; flex: 0 0 auto; }
.success-receipt b { font-size: 10.5px; color: #415047; text-align: right; }
.success-progress { text-align: left; margin: 0 2px 18px; }
.signin-state .btn-block { margin-top: 2px; }
.signin-state .fine-print { margin-top: 10px; }

/* ---------- My training ---------- */
.me-page .public-shell { width: min(100%, 720px); }
.me-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px;
  color: #f7f2e7;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(210, 171, 100, .26), transparent 52%),
    linear-gradient(145deg, #1a4f46, #123e37 62%, #0c302b);
  box-shadow: 0 18px 42px rgba(17, 49, 41, .2);
}
.me-hero::after { content: "师"; position: absolute; right: -9px; bottom: -38px; font-family: var(--serif); font-size: 148px; color: rgba(255, 255, 255, .035); pointer-events: none; }
.me-hero-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.me-logout { font-size: 9px; color: rgba(243, 238, 227, .53); border-bottom: 1px solid rgba(243, 238, 227, .2); padding-bottom: 2px; }
.me-person { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin: 20px 0 22px; }
.me-person h1 { font-family: var(--serif); font-size: 25px; color: #fffaf0; letter-spacing: .01em; }
.me-person p { font-size: 10px; color: rgba(240, 243, 234, .66); margin: 4px 0 4px; }
.me-person > div > span { font-size: 9px; color: rgba(240, 243, 234, .4); letter-spacing: .03em; }
.me-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; overflow: hidden; }
.me-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px; background: rgba(8, 34, 29, .25); }
.me-stats b { font-family: var(--serif); font-size: 21px; color: #e7cb95; line-height: 1.2; }
.me-stats span { font-size: 8.5px; color: rgba(240, 243, 234, .46); }
.me-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 23px 3px 10px; }
.me-section-head h2 { font-family: var(--serif); font-size: 19px; color: #243b33; }
.me-section-head span { font-size: 9px; color: #a59c8b; }
.my-certs { display: grid; gap: 9px; }
.my-cert-card {
  position: relative; display: flex; align-items: center; gap: 13px; padding: 16px;
  border-radius: 16px; border: 1px solid #e8d6b3;
  background: linear-gradient(125deg, #fffdf6 0%, #fbf2df 58%, #f5e7c8 100%);
  box-shadow: 0 10px 26px rgba(130, 98, 44, .09);
  overflow: hidden;
}
.my-cert-card::after { content: ""; position: absolute; right: -22px; top: -30px; width: 100px; height: 100px; border: 1px solid rgba(183, 138, 69, .18); border-radius: 50%; box-shadow: 0 0 0 18px rgba(183, 138, 69, .035); }
.my-cert-seal { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-deep); }
.my-cert-copy { min-width: 0; flex: 1; }
.my-cert-copy > span { font-size: 7.5px; letter-spacing: .12em; color: #a57a36; font-weight: 600; text-transform: uppercase; }
.my-cert-copy h3 { font-family: var(--serif); font-size: 15px; line-height: 1.45; color: #3e3729; margin: 2px 0 2px; }
.my-cert-copy p { font-size: 9px; color: #887a62; }
.my-cert-copy small { display: block; font-size: 8px; color: #ab9f8a; margin-top: 5px; font-family: Consolas, monospace; }
.my-cert-action { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #fffdf7; color: #99712f; box-shadow: 0 3px 10px rgba(90, 66, 24, .12); }
.my-projects { display: grid; gap: 9px; }
.my-project-card { background: #fffdf8; border: 1px solid #eae2d4; border-radius: 16px; padding: 17px; box-shadow: 0 4px 14px rgba(52, 46, 34, .04); }
.my-project-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.project-theme { font-size: 8px; color: var(--gold-deep); font-weight: 600; }
.my-project-head h3 { font-family: var(--serif); font-size: 16px; line-height: 1.45; color: #2a3e35; margin: 3px 0 3px; }
.my-project-head p { font-size: 9px; color: #998f7f; }
.my-project-head .cert-pill { margin-top: 2px; }
.session-checklist { margin-top: 13px; border-top: 1px solid #f1ebe0; padding-top: 4px; }
.session-checklist > div { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.check-dot { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; border: 1px solid #ded6c7; color: #fff; background: #f8f5ee; }
.session-checklist .checked .check-dot { background: #2b8864; border-color: #2b8864; }
.session-checklist > div > div { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.session-checklist b { font-size: 9.5px; font-weight: 500; color: #4e5a51; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-checklist small { font-size: 8px; color: #a39a8a; }
.session-checklist em { font-style: normal; font-size: 8.5px; color: #a49b8b; }
.session-checklist .checked em { color: #2b8864; }
.my-project-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1ebe0; }
.my-project-foot > span { font-size: 9px; color: #8d8474; }
.my-project-foot > span b { color: #3f5348; }
.pending-cert { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: #a0927c; }
.me-note { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 8.5px; color: #a59b8b; padding: 22px 0 2px; }

/* ---------- Cert view ---------- */
.cert-view-page .public-shell { width: min(100%, 1240px); padding-bottom: 40px; }
.cert-toolbar { display: flex; align-items: center; gap: 14px; padding: 18px 2px 16px; }
.cert-toolbar-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cert-toolbar-title span { font-size: 8px; letter-spacing: .14em; color: var(--gold-deep); font-weight: 700; }
.cert-toolbar-title b { font-size: 12.5px; color: #33473e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-toolbar .btn-primary { margin-left: auto; }
.cert-viewport { padding: 22px; background: #e9e3d6; border: 1px solid #ddd3c2; border-radius: 18px; }
.cert-download-note { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 9px; color: #9a9181; margin-top: 12px; }

/* ---------- Verify ---------- */
.verify-page .public-shell { width: min(100%, 720px); }
.verify-card { margin-top: 18px; background: #fffdf8; border: 1px solid #eae2d4; border-radius: 22px; padding: 28px; box-shadow: 0 16px 44px rgba(52, 45, 31, .08); }
.verify-head { display: flex; gap: 14px; align-items: flex-start; }
.verify-seal { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: var(--green-soft); color: var(--green); }
.verify-head h1 { font-family: var(--serif); font-size: 28px; color: #1f3b31; margin: 4px 0 4px; }
.verify-head p { font-size: 10.5px; color: var(--muted); }
.verify-form { display: flex; gap: 8px; margin: 22px 0; }
.verify-form input { flex: 1; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 13px; background: #fffefa; font-size: 12px; outline: none; }
.verify-form input:focus { border-color: #6c9c8e; box-shadow: 0 0 0 3px rgba(22, 94, 82, .1); }
.verify-result { text-align: center; padding: 22px 0 4px; border-top: 1px solid #f0eadf; }
.verify-result-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 50%; }
.verify-result.success .verify-result-icon { background: #e4f3eb; color: #1f7a55; }
.verify-result.fail .verify-result-icon { background: var(--red-bg); color: var(--red); }
.verify-result h2 { font-family: var(--serif); font-size: 22px; color: #2b4037; margin-bottom: 16px; }
.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #eee7da; border: 1px solid #eee7da; border-radius: 11px; overflow: hidden; text-align: left; }
.verify-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; background: #fbf8f1; }
.verify-grid span { font-size: 8.5px; color: #a19888; }
.verify-grid b { font-size: 10.5px; color: #415248; font-weight: 600; }
.verify-grid code { font-size: 9.5px; }
.verify-note { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 8.5px; color: #a49b8a; margin-top: 14px; }
.verify-result.fail p { font-size: 11px; color: var(--muted); }
.verify-foot { text-align: center; font-size: 8.5px; color: #b1a797; margin-top: 22px; }

/* ---------- Landing ---------- */
.landing-page .public-shell { width: min(100%, 940px); }
.landing-hero { padding: 8vh 0 0; }
.landing-hero h1 { font-family: var(--serif); font-size: clamp(38px, 6vw, 66px); line-height: 1.22; color: #153d34; letter-spacing: -.02em; margin: 18px 0 18px; }
.landing-hero h1 em { font-style: normal; color: var(--gold-deep); }
.landing-hero > p { font-size: 13px; line-height: 1.9; color: var(--muted); }
.landing-actions { display: flex; align-items: center; gap: 13px; margin: 26px 0 38px; flex-wrap: wrap; }
.landing-scan { display: inline-flex; align-items: center; gap: 7px; height: 50px; padding: 0 20px; border-radius: 13px; background: var(--green); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 10px 24px rgba(18, 63, 56, .2); }
.landing-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.landing-cards > div { padding: 20px; border-radius: 15px; background: rgba(255, 253, 248, .7); border: 1px solid var(--line); }
.landing-cards span { font-family: Georgia, serif; font-size: 10px; color: var(--gold); letter-spacing: .1em; }
.landing-cards b { display: block; font-size: 13px; color: #30473c; margin: 7px 0 4px; }
.landing-cards small { font-size: 9.5px; color: #978e7e; line-height: 1.6; }
.landing-admin { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.landing-admin a { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: #aaa08f; }
.landing-admin a:hover { color: var(--green); }

/* ---------- Error ---------- */
.error-page .public-shell { width: min(100%, 640px); }
.error-card { margin-top: 12vh; text-align: center; background: #fffdf8; border: 1px solid #eae2d4; border-radius: 22px; padding: 42px 30px; box-shadow: var(--shadow); }
.error-code { font-family: Georgia, serif; font-size: 42px; color: var(--gold); letter-spacing: .08em; }
.error-card h1 { font-family: var(--serif); font-size: 28px; color: #243c33; margin: 6px 0 9px; }
.error-card p { font-size: 11.5px; color: var(--muted); line-height: 1.8; max-width: 390px; margin: 0 auto 20px; }

/* ==========================================================
   QR print
   ========================================================== */
.qr-print-body { background: #e8e3d7; padding: 18px; }
.print-toolbar { max-width: 190mm; margin: 0 auto 12px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: #fffdf8; border-radius: 10px; box-shadow: 0 3px 12px rgba(0, 0, 0, .06); }
.print-toolbar > div { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.print-toolbar b { font-size: 12px; color: #33473e; }
.print-toolbar span { font-size: 9px; color: var(--muted); }
.print-grid { max-width: 190mm; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.print-card { position: relative; aspect-ratio: 1 / 1.28; padding: 6mm; background: #fffdf8; border: 1px dashed #d2c7b3; border-radius: 3mm; display: flex; flex-direction: column; overflow: hidden; }
.print-brand { display: flex; align-items: center; justify-content: space-between; }
.print-brand .public-brand .brand-mark { width: 26px; height: 26px; font-size: 15px; }
.print-brand .public-brand b { font-size: 13px; }
.print-brand .public-brand small { display: none; }
.print-brand > span { font-size: 8px; color: #a59a87; letter-spacing: .08em; }
.print-session { text-align: center; margin: 4mm 0 3mm; }
.print-session > span { font-size: 8px; color: #9d8c6e; letter-spacing: .08em; }
.print-session h2 { font-family: var(--serif); font-size: 15px; line-height: 1.4; color: #263c33; margin: 2mm 0 1mm; }
.print-session p { font-size: 7.5px; color: #8d8474; }
.print-qr { width: 70%; margin: 0 auto; padding: 2.5mm; border: 1px solid #ece4d6; border-radius: 2mm; }
.print-qr img { width: 100%; }
.print-instruction { text-align: center; margin-top: 3mm; }
.print-instruction b { display: block; font-size: 8.5px; color: #1f5e50; }
.print-instruction span { display: block; font-size: 6.8px; color: #a39a8a; margin-top: 1mm; }
.print-project { margin-top: auto; padding-top: 2mm; border-top: 1px dashed #e7dece; text-align: center; font-size: 6.8px; color: #a49a89; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1180px) {
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .session-cards { grid-template-columns: 1fr; }
  .template-layout { grid-template-columns: 370px minmax(0, 1fr); }
  .hero-grid { grid-template-columns: 1.35fr .65fr; }
  .hero-visual { transform: scale(.93); }
}
@media (max-width: 1040px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .admin-main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(13, 32, 27, .42); backdrop-filter: blur(3px); }
  .sidebar-scrim.is-open { display: block; }
  .topbar { padding: 0 24px; }
  .admin-content { padding: 26px 24px 50px; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr !important; }
  .form-aside { position: static; grid-template-columns: 1fr 1fr; }
  .form-aside .btn { grid-column: span 2; }
  .template-layout { grid-template-columns: 1fr; }
  .template-form { position: static; max-height: none; }
  .template-preview-panel { position: static; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; }
}
@media (max-width: 820px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 32px 28px 30px; }
  .hero-visual { display: none; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .detail-stats > div:nth-child(3) { border-left: 0; border-top: 1px solid #f0eade; }
  .detail-stats > div:nth-child(4) { border-top: 1px solid #f0eade; }
  .project-detail-head { flex-direction: column; align-items: flex-start; }
  .attendance-summary { gap: 10px; }
  .summary-spacer { display: none; }
  .rule-chip { margin-left: auto; }
  .notice-card { flex-wrap: wrap; }
  .notice-card .btn { margin-left: 76px; }
  .section-head { align-items: flex-start; }
  .session-card { grid-template-columns: 56px minmax(0, 1fr) 94px; }
  .session-qr { width: 84px; height: 84px; }
  .project-row { grid-template-columns: 52px minmax(0, 1fr) 22px; }
  .project-row-stats { display: none; }
  .topbar-date { display: none; }
}
@media (max-width: 640px) {
  .admin-content { padding: 20px 14px 44px; }
  .topbar { height: 60px; padding: 0 13px; gap: 9px; }
  .topbar-context { display: none; }
  .topbar-right { margin-left: auto; gap: 10px; }
  .admin-chip { border-left: 0; padding-left: 0; }
  .admin-chip > span:last-child { display: none; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 28px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .setup-alert { flex-wrap: wrap; align-items: flex-start; margin-top: -4px; }
  .setup-alert .btn { width: 100%; margin-left: 49px; }
  .hero-copy { padding: 27px 22px; }
  .hero-copy h2 { font-size: 33px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px 12px; gap: 9px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-value { font-size: 23px; }
  .stat-sub { display: none; }
  .project-row { grid-template-columns: 46px minmax(0, 1fr) 18px; gap: 10px; padding: 12px 8px; }
  .project-row-date { width: 46px; height: 46px; }
  .row-title-line { flex-wrap: wrap; gap: 5px; }
  .row-title-line h3 { white-space: normal; font-size: 12.5px; }
  .mini-progress { width: 100%; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card h3 { min-height: 0; }
  .project-card-stats { padding: 13px 0; }
  .list-toolbar { gap: 10px; }
  .search-box { width: 100%; min-width: 0; }
  .filter-tabs { width: 100%; }
  .filter-tabs button { flex: 1; padding: 8px 5px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .field-row, .session-row-fields .field-row { grid-template-columns: 1fr 1fr; }
  .session-form-row { grid-template-columns: 28px minmax(0, 1fr); }
  .remove-session { position: absolute; right: 22px; }
  .session-form-row { position: relative; padding-right: 34px; }
  .session-row-index { margin-top: 22px; }
  .form-aside { grid-template-columns: 1fr; }
  .form-aside .btn { grid-column: auto; }
  .tabs { overflow-x: auto; }
  .tabs a { padding: 12px 11px; white-space: nowrap; }
  .detail-stats > div { padding: 13px 15px; }
  .detail-stats b { font-size: 22px; }
  .session-cards { gap: 10px; }
  .session-card { grid-template-columns: 1fr; grid-template-rows: auto; padding: 15px; }
  .session-date-block { grid-row: auto; flex-direction: row; gap: 7px; align-items: center; border-right: 0; border-bottom: 1px solid #f0eadf; padding: 0 0 9px; }
  .session-date-block b { font-size: 18px; }
  .session-date-block small { margin: 0 0 0 auto; }
  .session-qr-wrap { grid-row: auto; grid-column: auto; flex-direction: row; justify-content: flex-start; gap: 9px; }
  .session-qr { width: 78px; height: 78px; }
  .session-actions { grid-column: auto; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1; }
  .attendance-summary .rule-chip { margin-left: 0; }
  .unit-summary { grid-template-columns: 1fr 1fr; }
  .unit-summary > div { padding: 11px 13px; }
  .unit-name { min-width: 140px; }
  .unit-variants { max-width: 220px; }
  .notice-card .btn { margin-left: 0; width: 100%; }
  .modal-card { padding: 24px 19px; border-radius: 17px; }
  .modal-qr { padding: 25px 18px 20px; }
  .qr-big-wrap { width: 200px; height: 200px; }
  .template-layout { gap: 14px; }
  .cert-preview-frame { padding: 8px; }
  .settings-stats { margin: 0 16px 16px; }
  .login-panel { padding: 28px 22px; }
  .login-card h2 { font-size: 30px; }
  .public-shell { padding: 0 13px 24px; }
  .public-top { padding: 15px 2px 13px; }
  .secure-chip { display: none; }
  .training-banner { border-radius: 20px; padding: 21px 19px 25px; }
  .training-banner h1 { font-size: 24px; }
  .training-meta { gap: 6px 11px; }
  .session-chip { margin: -14px 10px 0; padding: 11px 12px; }
  .session-credit { display: none; }
  .signin-panel { padding: 19px 16px; border-radius: 17px; }
  .signin-form .field-row { grid-template-columns: 1fr; gap: 13px; }
  .me-hero { border-radius: 20px; padding: 18px; }
  .me-person h1 { font-size: 22px; }
  .avatar-lg { width: 54px; height: 54px; font-size: 21px; }
  .my-project-head { flex-direction: column; }
  .my-project-head .cert-pill { align-self: flex-start; }
  .my-project-foot { flex-wrap: wrap; }
  .cert-toolbar { flex-wrap: wrap; padding-top: 13px; }
  .cert-toolbar-title { flex: 1; }
  .cert-toolbar .btn-primary { width: 100%; margin-left: 0; }
  .cert-viewport { padding: 8px; border-radius: 12px; }
  .cert-download-note { text-align: center; }
  .verify-card { padding: 20px 16px; border-radius: 18px; }
  .verify-form { flex-direction: column; }
  .verify-grid { grid-template-columns: 1fr; }
  .verify-head h1 { font-size: 24px; }
  .landing-hero { padding-top: 5vh; }
  .landing-cards { grid-template-columns: 1fr; }
  .landing-actions { align-items: stretch; }
  .landing-actions .btn, .landing-scan { width: 100%; justify-content: center; }
  .public-footer { flex-direction: column; gap: 4px; }
  .print-grid { gap: 4mm; }
  .print-toolbar { flex-wrap: wrap; }
  .print-toolbar > div { order: 3; width: 100%; margin: 0; }
}

/* ==========================================================
   Print
   ========================================================== */
@media print {
  body { background: #fff !important; }
  .public-top, .public-footer, .cert-toolbar, .cert-download-note, .print-toolbar, .toast-stack { display: none !important; }
  .public-shell { width: 100% !important; max-width: none !important; padding: 0 !important; }
  .cert-viewport { padding: 0; border: 0; background: #fff; }
  .cert-paper { box-shadow: none; width: 100%; }
  .cert-view-page { background: #fff; }
  .print-grid { max-width: none; gap: 4mm; }
  .print-card { break-inside: avoid; }
  .print-toolbar { display: none; }
}

/* ==========================================================
   Year filter, certificate policy, project delete
   ========================================================== */
.year-filter { display: flex; align-items: center; gap: 6px; }
.year-filter label {
  display: flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fffdf8; color: var(--muted);
}
.year-filter select { border: 0; background: transparent; color: #405248; font-family: var(--font); font-size: 10px; outline: none; cursor: pointer; }
.year-filter .btn { flex: 0 0 auto; }
.project-back { margin-bottom: 9px; }
.cert-status-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.override-chip {
  display: inline-flex; align-items: center; height: 17px; padding: 0 5px;
  border-radius: 4px; background: #fff1d6; color: #9b681f;
  font-size: 8px; font-weight: 600; letter-spacing: .02em;
}
.policy-toggle {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  border: 1px solid #e5dccd; border-radius: 7px; background: #f8f4eb;
}
.policy-btn {
  display: inline-flex; align-items: center; gap: 3px;
  border: 0; border-radius: 5px; background: transparent;
  padding: 5px 7px; color: #8f8575; font-family: var(--font);
  font-size: 9px; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.policy-btn .icon { width: 11px; height: 11px; }
.policy-btn:hover:not(:disabled) { background: #fffdf8; color: #5b6a60; }
.policy-btn.allow.is-on { background: #e2f1e6; color: #1d6b45; font-weight: 700; box-shadow: inset 0 0 0 1px #9cc4aa; }
.policy-btn.deny.is-on { background: #fae4df; color: #a23e30; font-weight: 700; box-shadow: inset 0 0 0 1px #dda79d; }
.policy-btn:disabled { opacity: .5; cursor: not-allowed; }
.policy-th, .policy-cell { min-width: 150px; }
.danger-kicker { color: var(--red) !important; }
.delete-warning {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; margin: 15px 0 12px;
  border: 1px solid #eccbc4; border-radius: 10px;
  background: #fdf3f0; color: #8f372b;
}
.delete-warning > .icon { flex: 0 0 auto; margin-top: 2px; color: #b54d3e; }
.delete-warning b { display: block; font-size: 12px; line-height: 1.5; margin-bottom: 4px; }
.delete-warning p { font-size: 9.5px; line-height: 1.7; color: #99645a; }
.delete-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  overflow: hidden; border: 1px solid #eee2d4; border-radius: 9px;
  background: #eee2d4; margin-bottom: 16px;
}
.delete-stats > div { background: #fbf8f1; padding: 10px 8px; text-align: center; }
.delete-stats b { display: block; font-family: var(--serif); font-size: 21px; color: #5c3c34; line-height: 1.2; }
.delete-stats span { display: block; font-size: 8.5px; color: #9b8877; margin-top: 3px; }
.delete-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.modal-delete { max-width: 520px; }
.btn-danger:disabled { opacity: .42; cursor: not-allowed; }

@media (max-width: 760px) {
  .year-filter { width: 100%; }
  .year-filter label { flex: 1; }
  .policy-th, .policy-cell { min-width: 138px; }
  .delete-stats { grid-template-columns: repeat(2, 1fr); }
  .delete-actions { justify-content: stretch; }
  .delete-actions .btn { flex: 1; }
}

