:root {
  --navy-950: #041c31;
  --navy-900: #082b4c;
  --navy-800: #0b3a62;
  --blue-700: #0b4b79;
  --blue-600: #12649b;
  --teal-600: #006b63;
  --teal-500: #00756b;
  --teal-100: #dff6f2;
  --sky-100: #eaf4fa;
  --ink: #142d43;
  --muted: #63788a;
  --line: #dce6ec;
  --line-strong: #c8d7e0;
  --surface: #ffffff;
  --canvas: #f3f7f9;
  --danger: #b8323d;
  --danger-bg: #fff0f1;
  --warning: #9b6412;
  --warning-bg: #fff7df;
  --success: #15724f;
  --success-bg: #e9f7f0;
  --info: #1f6392;
  --info-bg: #eaf4fb;
  --shadow-sm: 0 2px 10px rgba(5, 35, 59, 0.07);
  --shadow-md: 0 16px 42px rgba(5, 35, 59, 0.12);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --sidebar-width: 268px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; }
a { color: var(--blue-700); text-underline-offset: 2px; }
a:hover { color: var(--teal-600); }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em; }
h2 { margin-bottom: 8px; font-size: 1.3rem; letter-spacing: -.015em; }
h3 { margin-bottom: 7px; font-size: 1.04rem; }
p { margin-bottom: 14px; }

.skip-link { position: fixed; z-index: 9999; left: 16px; top: -80px; padding: 10px 16px; border-radius: 0 0 8px 8px; background: #fff; color: var(--navy-900); font-weight: 800; }
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid rgba(0, 117, 107, .42); outline-offset: 2px; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(circle at 50% 20%, #fff 0, var(--canvas) 42%, #e7f1f5 100%); color: var(--muted); }
.logo-panel { display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid rgba(202, 218, 227, .9); border-radius: 16px; box-shadow: 0 7px 20px rgba(4, 28, 49, .08); overflow: hidden; }
.logo-panel img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-panel--boot { width: min(290px, calc(100vw - 48px)); height: 132px; padding: 22px 28px; }
.logo-panel--auth { width: min(290px, 100%); height: 118px; justify-content: flex-start; padding: 8px 0; margin-bottom: 26px; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
.logo-panel--auth img { width: min(260px, 100%); }
.logo-panel--sidebar { width: 214px; height: 88px; padding: 13px 19px; border-color: rgba(255,255,255,.25); box-shadow: 0 8px 22px rgba(0,0,0,.18); border-radius: 14px; }
.logo-panel--compact { width: 170px; height: 78px; padding: 12px 16px; }
.spinner { width: 28px; height: 28px; border: 3px solid #d7e5eb; border-top-color: var(--teal-500); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 43%) 1fr; }
.auth-main { display: grid; place-items: center; padding: 40px 30px; background: var(--surface); }
.auth-card { width: min(510px, 100%); }
.auth-card__heading { margin-bottom: 28px; }
.auth-card__heading p { color: var(--muted); }
.auth-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(42px, 6vw, 86px); overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--navy-950) 5%, var(--navy-800) 58%, #076c75 135%); }
.auth-hero::before { content: ""; position: absolute; width: 580px; height: 580px; right: -230px; top: -240px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 72px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.025); }
.auth-hero::after { content: ""; position: absolute; inset: auto auto -230px -190px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(0,117,107,.28), transparent 68%); }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; color: #89e3da; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: .77rem; }
.auth-hero h2 { max-width: 720px; margin-bottom: 20px; font-size: clamp(2.1rem, 4.4vw, 4.3rem); line-height: 1.02; letter-spacing: -.045em; }
.auth-hero p { max-width: 620px; color: #d4e4ed; font-size: 1.08rem; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.feature-pill { padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.07); color: #eef9fb; font-size: .83rem; }
.auth-hero__footer { color: #b8d0dd; font-size: .82rem; }
.auth-switch { margin-top: 22px; color: var(--muted); text-align: center; }
.legal-copy { color: var(--muted); font-size: .79rem; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 80; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 22px 18px 18px; color: #dcebf2; background: linear-gradient(180deg, var(--navy-950), var(--navy-900) 66%, #07354b); box-shadow: 8px 0 30px rgba(4,28,49,.12); overflow-y: auto; }
.sidebar-brand { display: flex; justify-content: center; margin-bottom: 23px; }
.event-context { margin: 0 3px 18px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.055); }
.event-context label { display: block; margin-bottom: 5px; color: #9fbdcc; font-size: .69rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.event-context select { width: 100%; border: 0; background: transparent; color: #fff; font-size: .9rem; font-weight: 700; }
.event-context option { color: var(--ink); background: #fff; }
.sidebar-nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 11px; border: 0; border-radius: 10px; background: transparent; color: #bfd2dc; text-decoration: none; font-size: .87rem; font-weight: 650; text-align: left; transition: background .15s, color .15s, transform .15s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.075); transform: translateX(2px); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(0,117,107,.34), rgba(0,117,107,.13)); box-shadow: inset 3px 0 #3cd2c4; }
.nav-icon { width: 21px; height: 21px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { margin-top: auto; padding-top: 20px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 11px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, var(--teal-500), #78ddd3); color: #052d39; font-size: .78rem; font-weight: 900; }
.user-chip strong, .user-chip small { display: block; max-width: 146px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: #fff; font-size: .82rem; }
.user-chip small { color: #9fbdcc; font-size: .72rem; }
.logout-btn { width: 100%; margin-top: 6px; padding: 8px; border: 0; background: transparent; color: #a9c4d1; font-size: .78rem; }
.logout-btn:hover { color: #fff; }

.main-wrap { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 60; top: 0; min-height: 68px; display: flex; align-items: center; gap: 16px; padding: 12px clamp(18px, 3vw, 38px); border-bottom: 1px solid rgba(214,227,234,.82); background: rgba(255,255,255,.91); backdrop-filter: blur(14px); }
.menu-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy-900); }
.topbar__context { min-width: 0; }
.topbar__context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__context span { color: var(--muted); font-size: .76rem; }
.topbar__actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.environment-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--warning-bg); color: var(--warning); font-size: .72rem; font-weight: 800; }
.environment-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e4a027; box-shadow: 0 0 0 3px rgba(228,160,39,.15); }
.content { width: min(1560px, 100%); margin: 0 auto; padding: clamp(22px, 3.5vw, 42px); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.page-header p { max-width: 760px; margin-bottom: 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-aside { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); }
.card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: linear-gradient(145deg, #fff, #f7fbfc); }
.card--accent { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--navy-900), var(--navy-800) 60%, #08757b); }
.card--accent p { color: #c9dce6; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; }
.metric { position: relative; min-height: 136px; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -24px; bottom: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--sky-100); }
.metric__label { color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .02em; }
.metric__value { display: block; margin: 9px 0 3px; color: var(--navy-900); font-size: 2rem; font-weight: 850; letter-spacing: -.04em; }
.metric__note { color: var(--muted); font-size: .76rem; }
.metric__icon { position: absolute; z-index: 1; right: 18px; bottom: 16px; color: var(--teal-600); opacity: .85; }

.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-size: .84rem; font-weight: 800; line-height: 1.1; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue-700), #087081); box-shadow: 0 7px 16px rgba(9,75,121,.18); }
.btn-primary:hover { color: #fff; box-shadow: 0 9px 20px rgba(9,75,121,.26); }
.btn-secondary { border-color: var(--line-strong); background: #fff; color: var(--navy-900); }
.btn-secondary:hover { color: var(--navy-900); background: #f7fafb; }
.btn-teal { color: #fff; background: var(--teal-600); }
.btn-danger { color: var(--danger); border-color: #ecc6ca; background: #fff; }
.btn-danger:hover { color: #fff; background: var(--danger); }
.btn-ghost { color: var(--blue-700); background: transparent; }
.btn-small { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: .75rem; }
.btn-icon { width: 40px; padding: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--blue-700); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }

.field { display: grid; gap: 6px; margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label { color: #324c60; font-size: .79rem; font-weight: 800; }
.field input, .field select, .field textarea, .input { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 105px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 0; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(0,117,107,.12); }
.field small, .help-text { color: var(--muted); font-size: .74rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checkbox { display: flex; align-items: flex-start; gap: 9px; margin: 8px 0; color: #344f63; font-size: .83rem; }
.checkbox input { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--teal-600); }
.color-input { display: grid; grid-template-columns: 44px 1fr; gap: 8px; }
.color-input input[type="color"] { width: 44px; padding: 3px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.required::after { content: " *"; color: var(--danger); }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1 1 250px; }
.search input { padding-left: 38px; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 8px; color: var(--muted); font-size: 1.2rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #536c7e; background: #f7fafb; font-size: .7rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
tbody tr:hover { background: #fbfdfe; }
tbody tr:last-child td { border-bottom: 0; }
.table-title { display: block; color: var(--ink); font-weight: 800; }
.table-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: .73rem; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: #edf2f5; color: #536979; font-size: .69rem; font-weight: 850; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-navy { color: var(--navy-800); background: #e8eff4; }
.badge-teal { color: #08776f; background: var(--teal-100); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #4f6879; font-size: .7rem; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: .82rem; }
.alert strong { display: block; margin-bottom: 2px; }
.alert-info { color: #235f87; border-color: #cce2ef; background: var(--info-bg); }
.alert-warning { color: #805312; border-color: #ecd9a2; background: var(--warning-bg); }
.alert-danger { color: #93323a; border-color: #ecc6ca; background: var(--danger-bg); }
.alert-success { color: #176646; border-color: #c4e6d5; background: var(--success-bg); }
.payment-issues { border-color: #e5aeb4; box-shadow: 0 8px 26px rgba(184,50,61,.1); }
.payment-issues__alert { margin: 16px; }
.payment-reference { display: inline-block; max-width: 210px; overflow-wrap: anywhere; }
.empty { min-height: 210px; display: grid; place-content: center; justify-items: center; padding: 36px; text-align: center; color: var(--muted); }
.empty__icon { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 50%; background: var(--sky-100); color: var(--blue-700); font-size: 1.4rem; }
.empty h3 { color: var(--ink); }
.empty p { max-width: 470px; }
.skeleton { min-height: 16px; border-radius: 7px; background: linear-gradient(90deg,#e9eff2 25%,#f7fafb 50%,#e9eff2 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.progress-list { display: grid; gap: 14px; }
.progress-item { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; align-items: center; gap: 12px; font-size: .78rem; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8eef2; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-500), #43c5b8); }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 18px 25px; }
.timeline-item::before { content: ""; position: absolute; left: 6px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 4px var(--teal-100); }
.timeline-item::after { content: ""; position: absolute; left: 9px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::after { display: none; }
.timeline-item time { display: block; color: var(--muted); font-size: .69rem; }
.timeline-item p { margin: 2px 0 0; font-size: .8rem; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 11px; background: #eaf0f3; overflow-x: auto; }
.tab { flex: 0 0 auto; padding: 8px 13px; border: 0; border-radius: 8px; background: transparent; color: #526b7c; font-size: .78rem; font-weight: 800; }
.tab.active { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-sm); }
.template-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.template-option { position: relative; display: block; min-height: 128px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.template-option:has(input:checked) { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(0,117,107,.1); }
.template-option input { position: absolute; opacity: 0; }
.template-preview { height: 62px; margin-bottom: 9px; border-radius: 7px; background: linear-gradient(145deg,var(--navy-800) 0 42%,#edf4f6 42%); }
.template-preview--bold { background: linear-gradient(135deg,#073e68 0 60%,#12a697 60%); }
.template-preview--minimal { background: linear-gradient(180deg,#fff 0 25%,#dbe8ed 25% 30%,#f5f8f9 30%); border: 1px solid var(--line); }
.template-option strong { font-size: .8rem; }
.section-toggle-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.section-toggle { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-size: .79rem; }

.author-row, .rubric-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1.2fr auto auto; gap: 9px; margin-bottom: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfc; }
.rubric-row { grid-template-columns: 1.7fr 2fr .7fr auto; }
.author-row input, .rubric-row input, .rubric-row textarea { min-width: 0; }
.score-box { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfc; }
.score-box + .score-box { margin-top: 10px; }
.score-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.score-control { display: grid; grid-template-columns: 1fr 64px; gap: 11px; align-items: center; }
.score-control input[type="range"] { width: 100%; accent-color: var(--teal-600); }
.score-value { padding: 6px; border-radius: 8px; background: #fff; text-align: center; font-weight: 850; }

.modal-backdrop { position: fixed; z-index: 500; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3,20,35,.62); backdrop-filter: blur(4px); animation: fade .15s ease-out; }
.modal { width: min(700px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 17px; background: #fff; box-shadow: 0 30px 90px rgba(2,20,34,.35); animation: rise .18s ease-out; }
.modal--wide { width: min(1050px, 100%); }
.modal__header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal__header h2 { margin: 0; }
.modal__body { padding: 22px; }
.modal__footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); background: #fff; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #edf2f5; color: var(--ink); font-size: 1.2rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.99); } }

.toast-stack { position: fixed; z-index: 800; right: 18px; top: 18px; display: grid; gap: 9px; width: min(380px, calc(100vw - 36px)); }
.toast { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 13px 14px; border: 1px solid var(--line); border-left: 4px solid var(--teal-500); border-radius: 11px; background: #fff; box-shadow: var(--shadow-md); animation: slide .2s ease-out; font-size: .81rem; }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: #e1a02b; }
.toast button { border: 0; background: none; color: var(--muted); }
@keyframes slide { from { opacity: 0; transform: translateX(15px); } }

.mobile-overlay { display: none; }
.only-mobile { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .76rem; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.separator { height: 1px; margin: 20px 0; background: var(--line); }
.code { padding: 3px 6px; border-radius: 6px; background: #eef3f5; font-family: ui-monospace, monospace; font-size: .75rem; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-main-aside { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-main { min-height: 100vh; padding: 30px 22px; }
  .auth-hero { display: none; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay { position: fixed; z-index: 70; inset: 0; display: none; background: rgba(3,20,35,.5); }
  .mobile-overlay.open { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .only-mobile { display: block; }
  .topbar { padding: 10px 17px; }
  .environment-pill { display: none; }
  .content { padding: 25px 18px; }
  .author-row, .rubric-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  h1 { font-size: 1.65rem; }
  .page-header { display: block; }
  .page-actions { justify-content: flex-start; margin-top: 16px; }
  .grid-2, .grid-3, .grid-4, .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .metric { min-height: 118px; }
  .template-grid { grid-template-columns: 1fr; }
  .section-toggle-grid { grid-template-columns: 1fr; }
  .author-row, .rubric-row { grid-template-columns: 1fr; }
  .progress-item { grid-template-columns: 1fr auto; }
  .progress-item .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .topbar__context span { display: none; }
  .btn-mobile-label { display: none; }
  th, td { padding: 10px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .page-actions, .btn, .toast-stack { display: none !important; }
  .main-wrap { margin: 0; }
  .content { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}
