:root {
  --bg: #f4f7fb; --surface: #fff; --text: #172033; --muted: #657087;
  --line: #e2e8f0; --primary: #3157d5; --primary-dark: #2444b4;
  --soft: #edf2ff; --danger: #b42318; --success: #067647;
  --radius: 18px; --shadow: 0 12px 34px rgba(20, 35, 70, .07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
.container { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.site-header { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 1.12rem; font-weight: 800; letter-spacing: -.03em; }
.brand-tag { margin-left: 8px; padding: 4px 7px; background: var(--soft); color: var(--primary); border-radius: 6px; font-size: .65rem; letter-spacing: .08em; vertical-align: middle; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.page { padding-top: 46px; padding-bottom: 64px; }
.hero { margin-bottom: 30px; max-width: 680px; }
h1 { margin: 4px 0 8px; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.13; letter-spacing: -.045em; }
h2 { line-height: 1.25; letter-spacing: -.025em; }
p { margin-top: 0; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: .75rem; font-weight: 800; letter-spacing: .13em; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; transition: .15s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; border-color: var(--line); color: var(--text); }
.btn-danger { background: #fff1f0; color: var(--danger); border-color: #ffd5d2; }
.btn-wide { width: 100%; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: .8rem; }
.exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 20px; align-items: stretch; }
.exam-card, .table-card, .form-card, .auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.exam-card { display: flex; flex-direction: column; padding: 25px; }
.card-topline { display: flex; justify-content: flex-end; }
.pill { display: inline-flex; background: var(--soft); color: var(--primary); border-radius: 999px; padding: 5px 10px; font-size: .78rem; font-weight: 800; }
.exam-card h2 { margin: 13px 0 5px; font-size: 1.45rem; overflow-wrap: anywhere; }
.subtitle { color: var(--muted); margin-bottom: 18px; }
.exam-name { padding: 12px 14px; border-radius: 10px; background: #f7f9fc; font-weight: 750; margin-bottom: 18px; overflow-wrap: anywhere; }
.pointers { margin-bottom: 22px; }
.pointers h3 { margin: 0 0 7px; font-size: .9rem; }
.pointers p { color: #465168; font-size: .92rem; overflow-wrap: anywhere; }
.exam-card .btn { margin-top: auto; }
.empty-state { text-align: center; background: white; border: 1px dashed #cbd5e1; padding: 48px 20px; border-radius: var(--radius); }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0; }
.site-footer { padding: 24px 0; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); background: white; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f9fafc; color: var(--muted); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.status { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: .75rem; font-weight: 800; }
.status.published { background: #e7f8ef; color: #067647; }
.status.draft { background: #f1f3f7; color: #5d6678; }
.actions { display: flex; gap: 6px; align-items: center; }
.inline-form { display: inline; margin: 0; }
.notice { padding: 13px 16px; border-radius: 10px; margin: 18px 0; font-size: .92rem; }
.notice ul { margin-bottom: 0; }
.notice.error { background: #fff1f0; color: #912018; border: 1px solid #ffd5d2; }
.notice.success { background: #e7f8ef; color: #05603a; border: 1px solid #abefc6; }
.form-page { max-width: 860px; }
.form-card { margin-top: 25px; padding: clamp(20px, 4vw, 32px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label { display: block; font-size: .9rem; font-weight: 700; }
label input:not([type=checkbox]), label textarea { display: block; width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid #ccd5e2; border-radius: 9px; background: #fff; color: var(--text); font: inherit; font-weight: 400; outline: none; }
label input:focus, label textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(49,87,213,.12); }
label textarea { resize: vertical; min-height: 120px; }
label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.full { grid-column: 1 / -1; }
.required { color: var(--danger); }
.checkbox-label { display: flex; align-items: center; gap: 10px; margin-top: 24px; font-weight: 600; }
.checkbox-label input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 440px); padding: clamp(24px, 5vw, 38px); }
.auth-card h1 { font-size: 2rem; }
.auth-card form { display: grid; gap: 18px; margin-top: 24px; }
.back-link { display: inline-block; color: var(--muted); font-size: .88rem; margin-bottom: 25px; }
code { background: rgba(0,0,0,.06); padding: 2px 5px; border-radius: 4px; }
@media (max-width: 700px) {
  .page { padding-top: 30px; }
  .header-inner { min-height: 64px; }
  .header-actions { gap: 5px; }
  .hide-small { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  th, td { padding: 12px; }
  .actions { flex-wrap: wrap; min-width: 170px; }
}
