/* myCAS — app styles */
:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Times New Roman", Times, "Liberation Serif", serif;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e6ec;
  --border-strong: #cfd6df;
  --text: #121821;
  --text-2: #475467;
  --muted: #7a8595;
  --brand: #1f5fbf;
  --brand-hover: #184f9f;
  --brand-soft: #e8f0fc;
  --series: #2a78d6;
  --good: #16794a;
  --good-soft: #e3f4ea;
  --warn: #a15c07;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --side: #0e1c30;
  --side-2: #16294a;
  --side-text: #b9c6d8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
  --side-w: 256px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .6em; }
code { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 8px 0; }
.spacer { flex: 1; }
.icon { flex: none; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); color: var(--side-text); padding: 18px 12px 28px; scrollbar-width: thin; scrollbar-color: #2b3f5f transparent; }
.brand { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 4px 10px 18px; color: #fff; text-decoration: none !important; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1f5fbf); color: #fff; font-weight: 700; font-size: 14px; margin-right: 6px; }
.brand-mark.big { width: 56px; height: 56px; font-size: 22px; border-radius: 16px; margin: 0 auto 14px; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: .5px; }
.brand small { flex-basis: 100%; color: #7f93b0; font-size: 11.5px; margin-top: 2px; padding-left: 40px; }
.nav-group { margin-bottom: 12px; }
.nav-heading { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #6f83a1; padding: 8px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--side-text); font-size: 13.5px; text-decoration: none !important; }
.nav-link:hover { background: var(--side-2); color: #fff; }
.nav-link.active { background: #1f3a63; color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; color: #8ea3c2; font-variant-numeric: tabular-nums; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 28px; background: rgba(243, 245, 248, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-user { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.menu-btn { display: none !important; }
.main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 28px 72px; }
.scrim { display: none; }
.wizard-mode { grid-template-columns: minmax(0, 1fr); }
.wizard-mode .sidebar, .wizard-mode .menu-btn { display: none !important; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 276px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 15, 28, .45); }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 8px 16px; }
  .main { padding: 18px 16px 56px; }
  .sync-label { display: none; }
}

/* ---------------------------------------------------------------- sync */
.sync { display: flex; align-items: center; gap: 8px; flex: none; }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); text-decoration: none !important; white-space: nowrap; }
.sync-saved { color: var(--good); background: var(--good-soft); border-color: #bfe3cd; }
.sync-saving, .sync-pending, .sync-syncing { color: var(--brand); background: var(--brand-soft); border-color: #c8dbf6; }
.sync-needs-auth { color: var(--warn); background: var(--warn-soft); border-color: #f3d9a8; }
.sync-error { color: var(--bad); background: var(--bad-soft); border-color: #f5c2bd; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: #b9c2ce; }
.btn:focus-visible, .link-btn:focus-visible, .nav-link:focus-visible, .att-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #912018; border-color: #912018; }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-soft); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(16, 24, 40, .06); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.side-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 10px; }

/* ---------------------------------------------------------------- page layout */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.page-sub { color: var(--text-2); margin: 4px 0 0; max-width: 720px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card-flush { padding: 4px 0; }
.card-flush > .empty { margin: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head-actions { display: flex; align-items: center; gap: 8px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.card-head .card-title { margin: 0; }
.card-danger { border-color: #f3c7c2; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card { margin-bottom: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.callout { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid #cfe0f7; color: #173b6c; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.callout-error { background: var(--bad-soft); border-color: #f5c2bd; color: var(--bad); }
.callout-error pre { white-space: pre-wrap; font-size: 12px; }
.danger-row { display: flex; justify-content: flex-end; }
.loading { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 80px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }

/* ---------------------------------------------------------------- empty */
.empty { text-align: center; padding: 34px 16px; }
.empty-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.empty h3 { font-size: 15.5px; margin-bottom: 4px; }
.empty p { color: var(--text-2); max-width: 460px; margin: 0 auto 14px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfd; }
.data-table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table.compact td { padding: 5px 8px; }
.data-table.compact input, .data-table.compact select { width: 100%; }
.data-table tr.clickable { cursor: pointer; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

/* ---------------------------------------------------------------- list items */
.item-group + .item-group { border-top: 1px solid var(--border); }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 14px 20px 6px; }
.count { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.item { display: flex; gap: 16px; padding: 12px 20px; border-top: 1px solid #eef1f5; }
.group-title + .item { border-top: 0; }
.item:hover { background: #fafbfd; }
.item-main { flex: 1; min-width: 0; }
.item-cite { margin: 0; overflow-wrap: anywhere; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tag-blue { background: var(--brand-soft); border-color: #cfe0f7; color: #1d4d93; }
.tag-green { background: var(--good-soft); border-color: #c3e6d1; color: #12603b; }
.search-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 10px; color: var(--muted); flex: 1; max-width: 420px; }
.search-wrap input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; background: transparent; }
@media (max-width: 640px) { .item { flex-direction: column; gap: 6px; padding: 12px 16px; } .row-actions { justify-content: flex-start; } }

/* ---------------------------------------------------------------- forms */
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; min-width: 0; font: 14px/1.4 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 95, 191, .15); }
textarea { resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; max-width: 460px; }
.field.inline .field-label { white-space: nowrap; }
.card > .field, .resume-controls .field { margin-top: 12px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.req { color: var(--bad); font-weight: 600; }
.field-help { color: var(--muted); font-size: 12px; }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .att-drop { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.check.is-empty span { color: var(--muted); }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.year-select { width: auto; min-width: 130px; font-weight: 600; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .field.inline { flex-direction: column; align-items: stretch; } }

/* attachments */
.att-field { display: flex; flex-direction: column; gap: 8px; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-list:empty { display: none; }
.att-list-col { flex-direction: column; }
.att-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px 6px 3px 4px; }
.att-chip .btn-icon { width: 26px; height: 26px; }
.att-edit-modal-form { display: flex; flex-direction: column; gap: 12px; }
.att-open { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text); padding: 2px 6px 2px 2px; min-width: 0; text-align: left; }
.att-open:hover .att-name { color: var(--brand); text-decoration: underline; }
.att-thumb { width: 34px; height: 34px; border-radius: 6px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.att-size { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.att-where { color: var(--brand); display: inline-flex; }
.att-drop { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 14px; color: var(--text-2); background: var(--surface-2); font-size: 13px; text-align: center; }
.att-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.att-field.busy .att-drop { opacity: .6; pointer-events: none; }
.att-status { color: var(--brand); }
.att-badge { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 8px; border-radius: 999px; border: 1px solid #cfe0f7; background: var(--brand-soft); color: #1d4d93; font: 600 12px/1 var(--font); cursor: pointer; margin-right: 4px; }
.att-badge:hover { background: #d9e7fa; }

/* photo */
.photo-picker { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.photo-preview { width: 96px; height: 118px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; flex: none; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions .btn-row { margin-top: 0; }
.photo-actions .field-help { margin: 8px 0 0; max-width: 340px; }

/* ---------------------------------------------------------------- modal & toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10, 18, 32, .5); display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .16s ease; }
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.confirm-text { margin: 0; color: var(--text-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 8px; background: #111a28; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .16s ease; transition: opacity .3s, transform .3s; }
.toast-success .icon { color: #6ee7a8; }
.toast-error { background: #7a1b12; }
.toast.leaving { opacity: 0; transform: translateY(6px); }

/* ---------------------------------------------------------------- dashboard */
.hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; }
.avatar { width: 84px; height: 100px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); flex: none; }
.avatar-initials { display: grid; place-items: center; background: linear-gradient(135deg, #dbe8fb, #b9d0f3); color: #1d4d93; font-size: 28px; font-weight: 700; }
.hero-text { flex: 1; min-width: 220px; }
.hero-text h1 { font-size: 23px; font-weight: 650; margin-bottom: 4px; }
.hero-sub { margin: 0; color: var(--text-2); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: border-color .12s, transform .12s; }
.stat:hover { border-color: #b9cdea; transform: translateY(-1px); }
.stat-icon { color: var(--brand); margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-value-sm { font-size: 15px; padding: 5px 0 4px; }
.stat-label { font-size: 12.5px; color: var(--text-2); }
.score-hero { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.hero-number { font-size: 48px; font-weight: 650; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-of { font-size: 18px; color: var(--muted); }
.grade-chip { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good); border: 1px solid #c3e6d1; }
.grade-chip.small { font-size: 11.5px; padding: 1px 8px; }
.score-pill { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: #1d4d93; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-list, .checklist, .recent { list-style: none; margin: 0; padding: 0; }
.kv-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.kv-list li:last-child { border-bottom: 0; }
.kv-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.checklist { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.checklist li.ok .check-dot { background: var(--good); border-color: var(--good); color: #fff; }
.checklist li.ok span:last-child { color: var(--text-2); }
.recent li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.recent li:last-child { border-bottom: 0; }
.recent a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.recent small { color: var(--muted); white-space: nowrap; }
.recent-icon { color: var(--muted); display: inline-flex; }
@media (max-width: 520px) { .checklist { grid-template-columns: minmax(0, 1fr); } .hero-number { font-size: 40px; } }

/* meters */
.meters { display: flex; flex-direction: column; gap: 10px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.meter-label { color: var(--text-2); min-width: 0; }
.meter-letter { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; margin-right: 6px; color: var(--text); }
.meter-val { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.meter-val b { color: var(--text); }
.meter-track { height: 8px; border-radius: 999px; background: #e9eef5; overflow: hidden; }
.meter-track.big { height: 10px; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--series); }

/* chart */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid { stroke: #edf0f4; stroke-width: 1; }
.chart .axis { stroke: #c5cdd8; stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .xlab { fill: var(--text-2); font-size: 12px; }
.chart .val { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart .bar { fill: var(--series); }
.chart .hit { fill: transparent; }
.chart .hit.clickable { cursor: pointer; }
.chart .hit:hover { fill: rgba(42, 120, 214, .06); }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: #111a28; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; pointer-events: none; display: flex; flex-direction: column; align-items: center; white-space: nowrap; box-shadow: var(--shadow-lg); }
.chart-tip small { color: #b9c6d8; }

/* ---------------------------------------------------------------- 360 feedback */
.summary-card { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 28px; align-items: center; }
.summary-score p { margin: 0 0 4px; }
@media (max-width: 760px) { .summary-card { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.part-card { padding-bottom: 12px; }
.part-card .card-head { margin-bottom: 10px; }
.part-title { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 600; }
.part-title small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.part-letter { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.part-card .table-wrap { margin: 0 -20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.part-card .data-table th:first-child, .part-card .data-table td:first-child { padding-left: 20px; }
.part-empty { color: var(--muted); margin: 0; padding: 10px 0; border-top: 1px dashed var(--border); }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* ---------------------------------------------------------------- settings */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.sticky-save { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-top: 8px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.sticky-save .muted { margin-right: auto; }
.guide { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 14px; }
.guide summary { cursor: pointer; font-weight: 600; }
.guide ol { margin: 10px 0 4px; padding-left: 20px; }
.guide li { margin-bottom: 6px; }
.list-editor .btn { margin-top: 8px; }
.block-list { list-style: none; margin: 0; padding: 0; }
.block-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.block-list input[type=text] { flex: 1; }

/* ---------------------------------------------------------------- wizard */
.wizard { max-width: 920px; margin: 0 auto; }
.stepper { list-style: none; display: flex; gap: 4px; margin: 4px 0 18px; padding: 0; overflow-x: auto; }
.stepper li { display: flex; align-items: center; gap: 8px; flex: 1; min-width: max-content; font-size: 12.5px; color: var(--muted); padding: 6px 4px; }
.stepper li + li::before { content: ""; width: 18px; height: 1px; background: var(--border-strong); }
.step-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-weight: 600; font-size: 12px; background: var(--surface); flex: none; }
.stepper li.current { color: var(--text); font-weight: 600; }
.stepper li.current .step-dot { border-color: var(--brand); color: var(--brand); }
.stepper li.done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 720px) { .step-label { display: none; } .stepper li.current .step-label { display: inline; } }
.wizard-card { padding: 26px 28px; }
.wizard-body > h2 { font-size: 20px; margin-bottom: 4px; }
.wizard-body > h3 { font-size: 15px; margin: 22px 0 10px; }
.wizard-body .card { margin-top: 12px; box-shadow: none; }
.wizard-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.wizard-row + .card + .wizard-row { margin-top: 24px; }
.wizard-row h2 { font-size: 18px; margin-bottom: 2px; }
.wizard-row p { margin: 0; }
.wizard-hero { text-align: center; max-width: 640px; margin: 8px auto 26px; }
.wizard-hero h1 { font-size: 28px; font-weight: 650; margin-bottom: 8px; }
.wizard-hero p { color: var(--text-2); font-size: 15px; }
.done-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--good); color: #fff; margin: 0 auto 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); font: inherit; color: inherit; text-align: left; }
.choice h3 { font-size: 15px; }
.choice p { color: var(--text-2); margin: 0 0 4px; font-size: 13.5px; flex: 1; }
.choice-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.choice-link { cursor: pointer; transition: border-color .12s, transform .12s; }
.choice-link:hover { border-color: #9dbbe6; transform: translateY(-1px); }
.wizard-foot { display: flex; align-items: center; gap: 8px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 640px) { .wizard-card { padding: 18px 16px; } }

/* ---------------------------------------------------------------- paper (resume & report) */
.paper-host { overflow-x: auto; padding-bottom: 8px; }
.paper { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #000; box-shadow: 0 2px 14px rgba(16, 24, 40, .12); border: 1px solid var(--border); padding: 16mm 17mm; font-family: var(--serif); font-size: 12pt; line-height: 1.45; }
.paper a { color: #0b3fbf; }
.paper p { margin: 0 0 3pt; }
@media (max-width: 860px) { .paper { width: 100%; min-height: 0; padding: 20px 18px; font-size: 11pt; } }

.resume-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.resume-controls { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }
.check-list .check { font-size: 13px; align-items: flex-start; }
.check-list .check input { margin-top: 3px; }
@media (max-width: 1100px) { .resume-layout { grid-template-columns: minmax(0, 1fr); } .resume-controls { position: static; max-height: none; } }

.rs-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 3px double #000; outline: 1px solid #000; outline-offset: 3px; padding: 14px 22px; margin: 4px 4px 16pt; min-height: 150px; }
.rs-id p { margin: 0; line-height: 1.35; }
.rs-name { font-weight: 700; }
.rs-photo { width: 122px; height: 150px; border: 1px solid #000; padding: 3px; flex: none; }
.rs-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-section { margin-bottom: 10pt; }
.rs-h { font-size: 12pt; font-weight: 700; margin: 10pt 0 6pt; break-after: avoid; page-break-after: avoid; }
.rs-sub { font-size: 12pt; font-weight: 700; margin: 6pt 0 4pt; break-after: avoid; }
.rs-kv p { margin: 0 0 4pt; }
.rs-line { margin: 4pt 0; text-align: justify; }
.rs-table { width: 100%; border-collapse: collapse; margin: 4pt 0 6pt; font-size: 11.5pt; }
.rs-table th, .rs-table td { border: 1px solid #000; padding: 2pt 5pt; vertical-align: top; text-align: left; }
.rs-table th { font-weight: 400; }
.rs-table .c { text-align: center; }
.rs-team { white-space: pre-line; }
.rs-list { margin: 0 0 4pt; padding-left: 26pt; }
.rs-list li { margin-bottom: 3pt; text-align: justify; padding-left: 2pt; overflow-wrap: anywhere; }
.rs-bullets { margin: 0 0 4pt; padding-left: 26pt; }
.rs-bullets li { margin-bottom: 3pt; }
.rs-counts li span:first-child { display: inline-block; min-width: 290px; }
.rs-sign { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 26pt; break-inside: avoid; }
.rs-sign-name { text-align: center; }
.sign-space { height: 36pt; }

.report-toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; box-shadow: var(--shadow); position: sticky; top: 64px; z-index: 5; }
.report .rp-head { text-align: center; margin-bottom: 12pt; }
.rp-inst { font-weight: 700; font-size: 13pt; margin: 0; }
.rp-campus { margin: 0; }
.report h1 { font-size: 17pt; font-weight: 400; margin: 8pt 0 2pt; }
.rp-sub { color: #333; }
.report h2 { font-size: 13.5pt; font-weight: 700; margin: 16pt 0 6pt; border-bottom: 1px solid #000; padding-bottom: 2pt; break-after: avoid; }
.report h3 { font-size: 12.5pt; font-weight: 400; margin: 12pt 0 4pt; break-after: avoid; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin: 4pt 0 6pt; }
.rp-table th, .rp-table td { border: 1px solid #000; padding: 2pt 5pt; vertical-align: top; text-align: left; }
.rp-table thead th { text-align: center; font-weight: 700; }
.rp-table tfoot th { font-weight: 700; }
.rp-table .c { text-align: center; }
.rp-table .r { text-align: right; }
.rp-summary { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18pt; align-items: center; }
.rp-meters { font-family: var(--font); }
.rp-meters .meter-top { font-size: 9.5pt; }
.rp-meters .meter-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-meters .meter-track { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media (max-width: 700px) { .rp-summary { grid-template-columns: minmax(0, 1fr); } }
.rp-none { color: #555; font-style: italic; }
.rp-remarks { white-space: pre-line; text-align: justify; }
.rp-list { padding-left: 22pt; margin: 2pt 0 6pt; font-size: 11pt; }
.rp-list li { margin-bottom: 3pt; text-align: justify; overflow-wrap: anywhere; }
.rp-enc { font-weight: 700; }
.rp-appendix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12pt; }
.rp-appendix figure { margin: 0; border: 1px solid #000; padding: 6pt; break-inside: avoid; text-align: center; }
.rp-appendix img { max-height: 110mm; object-fit: contain; }
.rp-appendix figcaption { font-size: 9.5pt; margin-top: 4pt; }
.rp-sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18pt; margin-top: 40pt; text-align: center; break-inside: avoid; font-size: 11pt; }
.rp-sign span { display: block; }
.sign-line { border-top: 1px solid #000; margin-bottom: 4pt; }
.rp-date { margin-top: 16pt !important; font-size: 9pt; color: #555; text-align: right; }

/* ---------------------------------------------------------------- diary */
.diary-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.diary-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.diary-stat-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.diary-stat-val { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
@media (max-width: 768px) { .diary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.diary-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; background: var(--surface); padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.diary-search { flex: 2; min-width: 220px; max-width: none; }
.diary-filter-selects { display: flex; align-items: center; gap: 8px; flex: 3; flex-wrap: wrap; }
.diary-filter-selects select { width: auto; flex: 1; min-width: 140px; font-size: 13px; padding: 6px 10px; }
@media (max-width: 768px) { .diary-filter-selects { width: 100%; flex: 1 1 100%; } }

.diary-filter-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 2px 14px; font-size: 12.5px; }
.diary-count-pill { font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }

.diary-date-group { margin-bottom: 22px; }
.diary-group-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding: 0 4px; flex-wrap: wrap; }
.diary-group-titles { display: flex; align-items: baseline; gap: 8px; }
.diary-group-date { font-size: 15px; font-weight: 700; color: var(--text); }
.diary-group-sub { font-size: 12.5px; color: var(--muted); }
.diary-group-count { font-size: 11.5px; color: var(--muted); margin-left: auto; }

.badge-today { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good); border: 1px solid #bfe3cd; }

.diary-entries-list { display: flex; flex-direction: column; gap: 10px; }
.diary-card { padding: 14px 18px; margin-bottom: 0; transition: border-color .15s, box-shadow .15s; border-radius: 10px; }
.diary-card:hover { border-color: #bcc8d8; box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.diary-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.diary-card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.diary-cat-pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; }
.cat-teaching { background: #e0edff; color: #164e96; border-color: #bfd9fe; }
.cat-lab { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.cat-mentor { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.cat-dept { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.cat-inst { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.cat-research { background: #fae8ff; color: #86198f; border-color: #f5d0fe; }
.cat-fdp { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.cat-exam { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.cat-student { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.cat-other { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }

.diary-time-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.diary-course-pill { font-size: 11.5px; font-weight: 600; color: #1e3a5f; background: #eef4fc; border: 1px solid #d4e3f8; padding: 2px 8px; border-radius: 6px; }

.diary-card-title { font-size: 14.5px; font-weight: 650; color: var(--text); margin: 0 0 6px; line-height: 1.35; }
.diary-card-desc { font-size: 13.5px; color: var(--text-2); white-space: pre-line; line-height: 1.5; margin-bottom: 6px; overflow-wrap: anywhere; }
.diary-card-remarks { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border: 1px solid #f9dfad; border-radius: 6px; padding: 4px 10px; margin-top: 6px; }

/* ---------------------------------------------------------------- print */
.only-print { display: none; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .toasts, .modal-backdrop, .page-head, .tabs, .scrim, .diary-stats, .diary-toolbar, .diary-filter-summary, .diary-group-count, .row-actions { display: none !important; }
  .shell, .content { display: block; }
  .main { padding: 0; max-width: none; }
  .paper-host { overflow: visible; padding: 0; }
  .resume-layout { display: block; }
  .paper { width: auto; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .paper a { color: #000; text-decoration: none; }
  .rp-table tr, .rs-table tr, .diary-print-table tr { break-inside: avoid; }
  .page-break { break-before: page; }
  .link-btn { color: #000; }
  .only-print { display: block !important; }
  #main { display: none !important; }
  .diary-print-sheet { color: #000; font-family: var(--font); }
  .diary-print-head { text-align: center; margin-bottom: 14pt; border-bottom: 1.5pt solid #000; padding-bottom: 8pt; }
  .diary-print-head h1 { font-size: 16pt; margin: 0 0 4pt; }
  .diary-print-sub { font-size: 11pt; margin: 0 0 4pt; font-weight: 600; }
  .diary-print-meta { font-size: 9.5pt; color: #444; margin: 0; }
  .diary-print-table { width: 100%; border-collapse: collapse; font-size: 10pt; margin-top: 8pt; }
  .diary-print-table th, .diary-print-table td { border: 1px solid #333; padding: 5pt 7pt; text-align: left; vertical-align: top; }
  .diary-print-table thead th { background: #f0f0f0; font-weight: 700; text-align: center; }
  .diary-print-desc { font-size: 9pt; color: #333; margin-top: 3pt; white-space: pre-line; }
  .diary-print-remarks { font-size: 8.5pt; color: #555; margin-top: 2pt; font-style: italic; }
}
