:root {
  --bg: #f7fbfe;
  --surface: #ffffff;
  --surface-soft: #eef7fd;
  --text: #111820;
  --muted: #5f6b78;
  --line: #d5e5f2;
  --accent: #0874c9;
  --accent-dark: #06256b;
  --accent-soft: #e4f3fc;
  --action: #ffa817;
  --action-hover: #f29400;
  --danger: #b23838;
  --danger-soft: #fff0ee;
  --shadow: 0 24px 70px rgba(6, 37, 107, .10);
  --radius: 20px;
  --radius-small: 10px;
  --content: 1180px;
  color-scheme: light;
  font-family: Montserrat, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(8, 116, 201, .28); outline-offset: 3px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; color: var(--accent); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 780; line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: 12px; color: var(--accent-dark); font-size: 1.35rem; line-height: 1.2; }

.public-page { display: grid; grid-template-rows: auto 1fr auto; }
.site-header { border-top: 2px solid #111; border-bottom: 1px solid rgba(6, 37, 107, .08); background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); }
.site-header__inner, .site-footer__inner { width: min(calc(100% - 40px), var(--content)); margin: 0 auto; }
.site-header__inner { min-height: 106px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-header__service { color: var(--muted); font-size: .9rem; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); font-size: 1.08rem; font-weight: 750; text-decoration: none; }
.brand__logo { width: 62px; height: 62px; flex: 0 0 auto; object-fit: contain; }
.brand__copy { display: grid; gap: 3px; }
.brand__university { max-width: 320px; color: var(--accent); font-size: .88rem; font-weight: 720; line-height: 1.15; text-transform: uppercase; }
.brand__project { color: var(--accent-dark); font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.brand--compact .brand__logo { width: 47px; height: 47px; }
.brand--compact .brand__university { color: #b9ddfa; font-size: .66rem; }
.brand--compact .brand__project { color: white; font-size: 1rem; }
.public-main { width: min(calc(100% - 32px), 860px); margin: 0 auto; padding: 68px 0; display: grid; place-items: center; }
.public-card { width: 100%; padding: clamp(30px, 6vw, 66px); border: 1px solid #cfe4f4; border-radius: var(--radius); background: linear-gradient(135deg, #fff 0%, #f0f8fe 100%); box-shadow: var(--shadow); }
.public-card--narrow { max-width: 610px; }
.public-card--center { text-align: center; }
.site-footer { color: rgba(255,255,255,.82); background: var(--accent-dark); font-size: .9rem; }
.site-footer__inner { min-height: 150px; padding: 36px 0; display: flex; align-items: center; justify-content: space-between; gap: 36px; }
.site-footer__brand, .site-footer__meta { display: grid; gap: 7px; }
.site-footer__title { color: white; font-size: 1.05rem; font-weight: 750; text-transform: uppercase; }
.site-footer__meta { text-align: right; }

.eyebrow { margin-bottom: 12px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lead { margin-bottom: 32px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 20px; }
.stack--large { gap: 30px; }
.field { display: grid; gap: 8px; }
.field--grow { flex: 1; }
.field__label { font-size: .9rem; font-weight: 720; }
.field__hint { color: var(--muted); font-size: .78rem; }
.input { width: 100%; min-height: 48px; padding: 11px 14px; color: var(--text); border: 1px solid #b8d2e6; border-radius: var(--radius-small); background: white; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #77afd8; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(8, 116, 201, .11); outline: 0; }
.input--large { min-height: 60px; padding: 14px 18px; font-size: 1.14rem; }
.textarea { resize: vertical; line-height: 1.5; }
.button { min-height: 46px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 750; text-decoration: none; transition: transform .12s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #18202a; background: var(--action); }
.button--primary:hover { background: var(--action-hover); }
.button--secondary { color: var(--accent-dark); border-color: #86bce2; background: white; }
.button--secondary:hover { background: var(--surface-soft); }
.button--ghost { color: var(--muted); background: transparent; }
.button--ghost:hover { color: var(--text); background: var(--surface-soft); }
.button--large { min-height: 58px; font-size: 1.02rem; }
.button--small { min-height: 36px; padding: 7px 12px; font-size: .84rem; }
.alert { padding: 14px 16px; border: 1px solid #a8d1ed; border-radius: 12px; color: var(--accent-dark); background: var(--accent-soft); line-height: 1.45; }
.alert--error { color: #7f2d28; border-color: #e8c0bc; background: var(--danger-soft); }
.status-icon { width: 64px; height: 64px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-soft); font-size: 1.8rem; font-weight: 800; }
.status-icon--success { color: var(--accent); background: var(--accent-soft); }

.poll-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.poll-fieldset legend { width: 100%; margin-bottom: 22px; font-size: 1.35rem; font-weight: 750; line-height: 1.4; }
.poll-options { display: grid; gap: 12px; }
.poll-option { position: relative; min-height: 64px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s, transform .15s; }
.poll-option:hover { border-color: #7bb2db; background: var(--surface-soft); transform: translateY(-1px); }
.poll-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.poll-option input { width: 20px; height: 20px; accent-color: var(--accent); }

.admin-page { background: #f5faff; }
.admin-header { min-height: 78px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: white; background: var(--accent-dark); }
.admin-header .brand { color: white; }
.admin-header__account { display: flex; align-items: center; gap: 16px; color: #dcefff; }
.admin-header .button--ghost { color: white; }
.admin-shell { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.admin-shell--single { grid-template-columns: minmax(0, 1fr); }
.admin-shell--single .admin-main { width: 100%; max-width: none; padding: 0; }
.admin-nav { padding: 28px 16px; display: flex; flex-direction: column; gap: 5px; border-right: 1px solid var(--line); background: white; }
.admin-nav__link { padding: 11px 13px; border-radius: 10px; color: #4f6172; font-weight: 680; text-decoration: none; }
.admin-nav__link:hover, .admin-nav__link.is-active { color: var(--accent-dark); background: var(--accent-soft); }
.admin-main { width: min(100%, 1220px); padding: 42px clamp(24px, 4vw, 56px) 80px; }
.admin-main h1 { font-size: clamp(2rem, 3vw, 2.7rem); }
.login-card { width: min(calc(100% - 32px), 500px); margin: 72px auto; padding: 42px; border: 1px solid #cfe4f4; border-radius: var(--radius); background: linear-gradient(145deg, #fff, #f0f8fe); box-shadow: var(--shadow); }
.page-heading { margin-bottom: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.page-heading h1 { margin-bottom: 0; }
.panel { margin-bottom: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 35px rgba(6, 37, 107, .05); }
.panel--flush { padding: 0; overflow: hidden; }
.panel__heading { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.panel__heading h2 { margin: 8px 0 0; }
.panel__heading--padded { margin: 0; padding: 22px 24px; }
.stats-grid { margin-bottom: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.panel .stats-grid { margin-bottom: 0; }
.stat { padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.stat__label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 2rem; letter-spacing: -.04em; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #4f6172; background: #eaf3f9; font-size: .75rem; font-weight: 750; }
.badge--success { color: var(--accent-dark); background: var(--accent-soft); }
.simple-list { border-top: 1px solid var(--line); }
.simple-list__item { padding: 14px 3px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.simple-list__item:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f3f8fc; font-size: .75rem; letter-spacing: .045em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { text-align: right; }
.empty-state { padding: 70px 28px; border: 1px dashed #9fc8e5; border-radius: 18px; text-align: center; background: rgba(255,255,255,.7); }
.empty-state p { color: var(--muted); }
.option-editor { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
.option-editor legend { padding: 0 8px; font-weight: 750; }
.option-row { margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.danger-zone h2 { margin-bottom: 4px; }
.danger-zone form { display: grid; justify-items: start; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; line-height: 1.4; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.inline-form { display: flex; gap: 14px; align-items: end; }
.upload-box { padding: 18px; display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; align-items: center; gap: 20px; border: 1px dashed #8ab9dc; border-radius: 14px; background: var(--surface-soft); }
.upload-box p { margin: 5px 0 0; }
.results-list { display: grid; gap: 18px; }
.result-row__label { margin-bottom: 7px; display: flex; justify-content: space-between; gap: 20px; }
.progress { height: 10px; overflow: hidden; border-radius: 999px; background: #dfebf4; }
.progress span { height: 100%; display: block; border-radius: inherit; background: var(--action); }

@media (max-width: 850px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { padding: 10px 16px; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav__link { white-space: nowrap; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-box { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header__inner { min-height: 88px; }
  .site-header__service { display: none; }
  .brand__logo { width: 50px; height: 50px; }
  .brand__university { max-width: 230px; font-size: .68rem; }
  .brand__project { font-size: 1.05rem; }
  .public-main { padding: 30px 0; }
  .public-card { padding: 28px 22px; border-radius: 18px; }
  .site-footer__inner { min-height: 170px; align-items: flex-start; flex-direction: column; gap: 22px; }
  .site-footer__meta { text-align: left; }
  .admin-header { padding: 0 14px; }
  .admin-header .brand__university { display: none; }
  .admin-header__account > span { display: none; }
  .admin-main { padding: 28px 16px 60px; }
  .page-heading, .danger-zone { align-items: stretch; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .stat strong { font-size: 1.55rem; }
  .option-row { grid-template-columns: 1fr; }
}
