@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --ink: #121214;
  --muted: #67656c;
  --paper: #f4f0e9;
  --white: #fff;
  --red: #ec3024;
  --red-dark: #c51f18;
  --gold: #f4c64d;
  --green: #188a64;
  --line: #ded9d1;
  --shadow: 0 20px 60px rgba(24, 20, 15, .1);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.55 "DM Sans", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
main { min-height: calc(100vh - 150px); }

.site-header { min-height: 82px; padding: 14px clamp(22px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(244, 240, 233, .94); border-bottom: 1px solid rgba(18,18,20,.08); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 47px; height: 47px; border-radius: 14px; color: #fff; background: var(--red); display: grid; place-items: center; transform: rotate(-3deg); box-shadow: 5px 5px 0 var(--ink); }
.brand-mark span { font: 800 16px/1 "Manrope", sans-serif; letter-spacing: -.5px; transform: rotate(3deg); }
.brand strong { display: block; font: 800 16px/1.2 "Manrope", sans-serif; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.header-note { color: var(--muted); font-size: 13px; text-align: right; }
.site-footer { min-height: 68px; padding: 20px clamp(22px, 5vw, 76px); display: flex; justify-content: space-between; align-items: center; gap: 24px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.site-footer a { color: var(--ink); font-weight: 700; }

.hero { min-height: 580px; padding: clamp(70px, 10vw, 130px) clamp(22px, 7vw, 110px) 70px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .6fr); gap: clamp(40px, 8vw, 130px); align-items: center; background: var(--ink); color: white; position: relative; overflow: hidden; }
.hero::before { content: ""; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); position: absolute; right: -130px; top: -210px; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02); }
.hero::after { content: ""; width: 180px; height: 14px; background: var(--red); position: absolute; left: clamp(22px, 7vw, 110px); bottom: 0; }
.hero-copy, .hero-aside { position: relative; z-index: 1; }
.eyebrow { display: inline-block; color: var(--red); text-transform: uppercase; letter-spacing: .16em; font: 800 11px/1.3 "Manrope", sans-serif; }
.hero .eyebrow { color: var(--gold); }
.hero h1, .login-art h1 { max-width: 830px; margin: 18px 0 22px; font: 800 clamp(45px, 6.2vw, 84px)/.98 "Manrope", sans-serif; letter-spacing: -.055em; }
.hero h1 em, .login-art h1 em { color: var(--gold); font-style: normal; }
.hero-copy > p { max-width: 660px; color: #c9c7c5; font-size: clamp(16px, 1.7vw, 20px); }
.year-ribbon { display: inline-flex; align-items: stretch; margin-top: 28px; transform: rotate(-2deg); box-shadow: 7px 7px 0 rgba(255,255,255,.16); }
.year-ribbon span { padding: 13px 17px; color: var(--ink); background: var(--white); font-weight: 700; }
.year-ribbon strong { min-width: 100px; padding: 11px 17px; color: white; background: var(--red); font: 800 22px/1.3 "Manrope", sans-serif; text-align: center; }
.year-ribbon.closed strong { background: #5b5a60; }
.hero-aside { border-top: 1px solid rgba(255,255,255,.22); }
.hero-aside div { display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: center; padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,.14); color: #d8d5d1; }
.hero-aside b { color: var(--red); font: 800 24px/1 "Manrope", sans-serif; }

.registration-form { max-width: 1180px; margin: -1px auto 0; padding: 70px 22px 90px; }
.form-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 60px; padding: 50px 0; border-bottom: 1px solid var(--line); }
.form-section > header { display: flex; align-items: flex-start; gap: 14px; }
.form-section > header > span { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--white); font-weight: 800; }
.form-section h2, .panel h2 { margin: 1px 0 3px; font: 800 23px/1.2 "Manrope", sans-serif; letter-spacing: -.03em; }
.form-section header p { margin: 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span, .leaderboard-filters label > span, .compact-select span { color: #3b393d; font-weight: 700; font-size: 13px; }
.field > span b, .upload-card strong b { color: var(--red); }
.field input, .field select, .field textarea, .leaderboard-filters input, .leaderboard-filters select, .compact-select select { width: 100%; border: 1px solid #d2cdc4; border-radius: 12px; padding: 13px 14px; color: var(--ink); background: rgba(255,255,255,.72); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .leaderboard-filters input:focus, .leaderboard-filters select:focus { border-color: var(--ink); background: var(--white); box-shadow: 0 0 0 4px rgba(18,18,20,.08); }
.field small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.field-error { margin: 0; color: var(--red-dark); font-size: 12px; font-weight: 700; }
.upload-card { min-height: 190px; border: 1px dashed #aaa49a; border-radius: 18px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: rgba(255,255,255,.45); cursor: pointer; transition: .2s; position: relative; }
.upload-card:hover { border-color: var(--ink); background: var(--white); transform: translateY(-2px); }
.upload-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-weight: 900; margin-bottom: 14px; }
.upload-card small { color: var(--muted); }
.upload-card input { position: absolute; width: 1px; height: 1px; inset: auto; overflow: hidden; opacity: 0; pointer-events: none; }
.file-name { margin-top: 12px; color: var(--red); font-weight: 800; font-size: 12px; }
.consent-row { padding: 38px 0 0 320px; display: flex; justify-content: space-between; align-items: center; gap: 36px; }
.consent-row p { max-width: 600px; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button, .small-button { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 20px; font-weight: 800; border-radius: 12px; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-button { min-height: 50px; padding: 13px 18px; color: white; background: var(--red); box-shadow: 5px 5px 0 var(--ink); }
.primary-button:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--ink); background: var(--red-dark); }
.primary-button b { font-size: 21px; }
.secondary-button { min-height: 43px; padding: 10px 15px; border: 1px solid var(--ink); background: transparent; }
.secondary-button:hover { background: var(--ink); color: white; }
.small-button { min-height: 38px; padding: 9px 14px; color: white; background: var(--ink); }
.form-alert, .toast { max-width: 1180px; margin: 24px auto 0; padding: 14px 18px; border-radius: 12px; font-weight: 700; }
.form-alert, .toast.error { background: #ffe2df; color: #8d1b15; border: 1px solid #f7b5af; }
.toast.success { background: #daf5e9; color: #116247; border: 1px solid #a6dfc9; }
.honeypot { position: absolute; left: -9999px; }
.closed-panel, .empty-state { max-width: 800px; margin: 80px auto; padding: 70px 40px; text-align: center; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.closed-panel > span, .empty-state > span { color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.closed-panel h2, .empty-state h1 { font: 800 clamp(30px, 5vw, 52px)/1.04 "Manrope", sans-serif; letter-spacing: -.05em; }

.success-page { max-width: 780px; margin: 70px auto; padding: 70px; background: var(--white); border-radius: 30px; box-shadow: var(--shadow); text-align: center; position: relative; overflow: hidden; }
.success-page::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 9px; background: linear-gradient(90deg, var(--red) 0 42%, var(--gold) 42% 70%, var(--ink) 70%); }
.success-symbol { width: 68px; height: 68px; margin: 0 auto 26px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font: 900 32px/1 "Manrope", sans-serif; box-shadow: 0 0 0 10px #e6f6f0; }
.success-page h1 { margin: 14px 0; font: 800 46px/1.05 "Manrope", sans-serif; letter-spacing: -.05em; }
.success-page > p { color: var(--muted); }
.registration-number { margin: 30px auto; padding: 20px; color: white; background: var(--ink); border-radius: 16px; }
.registration-number span { display: block; color: #aaa8ad; font-size: 12px; }
.registration-number strong { display: block; color: var(--gold); font: 800 26px/1.3 "Manrope", sans-serif; letter-spacing: .08em; }
.receipt-summary { margin: 0 0 30px; text-align: left; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.receipt-summary div { padding: 16px 4px; border-bottom: 1px solid var(--line); }
.receipt-summary dt { color: var(--muted); font-size: 12px; }
.receipt-summary dd { margin: 3px 0 0; font-weight: 700; }

/* Admin */
.admin-shell { background: #f2f1ed; }
.admin-nav { display: flex; align-items: center; gap: 8px; }
.admin-nav a, .nav-button { border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-weight: 700; cursor: pointer; }
.admin-nav a:hover, .admin-nav a.active { color: var(--ink); background: white; }
.nav-button:hover { color: var(--red); }
.admin-page { max-width: 1440px; margin: 0 auto; padding: 52px clamp(18px, 4vw, 58px) 80px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 32px; }
.page-heading h1 { margin: 8px 0 6px; font: 800 clamp(34px, 4vw, 56px)/1 "Manrope", sans-serif; letter-spacing: -.055em; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; align-items: flex-end; gap: 12px; }
.compact-select { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.status-strip { margin-bottom: 22px; border-radius: 15px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: white; border: 1px solid var(--line); }
.status-strip > div { display: grid; grid-template-columns: 14px auto; column-gap: 10px; align-items: center; }
.status-strip small { grid-column: 2; color: var(--muted); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(24,138,100,.13); }
.status-strip.closed .pulse { background: #96939a; box-shadow: 0 0 0 5px rgba(120,120,125,.12); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.metric { min-height: 158px; padding: 22px; border-radius: 18px; background: white; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.metric.primary { color: white; background: var(--ink); border-color: var(--ink); }
.metric > span { color: var(--muted); font-weight: 700; }
.metric.primary > span, .metric.primary small { color: #aaa8ad; }
.metric strong { font: 800 42px/1 "Manrope", sans-serif; letter-spacing: -.05em; }
.metric small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 16px; margin-bottom: 16px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.panel > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.panel > header a { color: var(--red); font-weight: 800; font-size: 13px; }
.standard-bars { display: flex; flex-direction: column; gap: 9px; }
.standard-bars a { display: grid; grid-template-columns: minmax(135px, 230px) 1fr 36px; gap: 12px; align-items: center; padding: 5px 0; }
.standard-bars a > span { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standard-bars i { display: block; height: 9px; border-radius: 20px; background: #ece9e3; overflow: hidden; }
.standard-bars i b { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.standard-bars strong { text-align: right; }
.year-control > p { color: var(--muted); }
.year-control form { display: flex; flex-direction: column; gap: 15px; margin: 22px 0; }
.export-links { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; }
.export-links a { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-weight: 700; font-size: 13px; }
.export-links span { width: 40px; color: var(--red); font-size: 11px; letter-spacing: .1em; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > header { padding: 24px 24px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: var(--muted); background: #f8f6f2; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 16px 18px; border-top: 1px solid #eeeae4; vertical-align: middle; }
td strong { display: block; }
.table-link { color: var(--red); font-weight: 800; }
.table-empty, .panel-empty { padding: 35px; color: var(--muted); text-align: center; }
.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 30px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status.pending { color: #815f05; background: #fff3cc; }
.status.verified { color: #116247; background: #daf5e9; }
.status.rejected { color: #8d1b15; background: #ffe2df; }
.status.large { padding: 9px 14px; font-size: 12px; }

.leaderboard-filters { display: grid; grid-template-columns: 130px 190px minmax(230px, 1fr) auto; gap: 12px; align-items: end; padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); background: white; border-radius: 16px; }
.leaderboard-filters label { display: flex; flex-direction: column; gap: 5px; }
.standard-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.standard-tabs a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: white; border: 1px solid var(--line); font-weight: 800; }
.standard-tabs a.wide { width: auto; padding: 0 13px; }
.standard-tabs a.active { color: white; background: var(--red); border-color: var(--red); }
.leaderboard-panel { padding: 0; overflow: hidden; }
.leaderboard-head, .leader-row { display: grid; grid-template-columns: 70px minmax(250px, 1.5fr) minmax(110px, .7fr) minmax(110px, .6fr) 110px 84px; gap: 15px; align-items: center; }
.leaderboard-head { padding: 12px 20px; color: var(--muted); background: #f8f6f2; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.leader-row { min-height: 86px; padding: 14px 20px; border-top: 1px solid #eeeae4; }
.leader-row.verified-row { background: linear-gradient(90deg, rgba(24,138,100,.045), transparent 30%); }
.rank { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #eeeae4; font-weight: 800; }
.rank.top { color: white; background: var(--ink); box-shadow: 3px 3px 0 var(--gold); }
.student-cell a { display: block; font: 800 16px/1.3 "Manrope", sans-serif; }
.student-cell small, .leader-row > div > small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.leader-row .score strong { color: var(--green); font-size: 17px; }
.row-action { color: var(--red); font-weight: 800; font-size: 12px; text-align: right; }

.back-link { display: inline-block; margin-bottom: 25px; color: var(--muted); font-weight: 700; }
.registration-heading { align-items: center; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; margin-bottom: 16px; }
.evidence-panel { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(260px, 1fr); gap: 28px; align-items: center; }
.student-photo { height: 360px; border-radius: 14px; overflow: hidden; background: #ede9e2; }
.student-photo img { width: 100%; height: 100%; object-fit: cover; }
.evidence-copy h2 { margin: 10px 0; font-size: 42px; }
.evidence-copy p { color: var(--muted); margin-bottom: 25px; }
.verification-form { display: flex; flex-direction: column; gap: 15px; }
.verification-form > p { margin: -7px 0 4px; color: var(--muted); }
.details-panel > header { display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); }
.detail-grid div { padding: 17px 10px 17px 0; border-bottom: 1px solid var(--line); }
.detail-grid div.full { grid-column: 1 / -1; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 4px 0 0; font-weight: 700; overflow-wrap: anywhere; }

.login-page { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.15fr .85fr; }
.login-art { padding: clamp(60px, 9vw, 130px); color: white; background: var(--ink); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 250px; height: 250px; border: 70px solid var(--red); border-radius: 50%; right: -150px; top: -80px; opacity: .75; }
.login-art p { max-width: 600px; color: #bcb9bd; font-size: 18px; }
.login-card { padding: clamp(40px, 7vw, 100px); display: flex; flex-direction: column; justify-content: center; gap: 20px; background: white; }
.login-card header { margin-bottom: 8px; }
.login-card header > span { color: var(--red); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.login-card h2 { margin: 10px 0 4px; font: 800 38px/1 "Manrope", sans-serif; letter-spacing: -.04em; }
.login-card p { margin: 0; color: var(--muted); }
.text-link { color: var(--muted); font-weight: 700; text-align: center; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-aside { max-width: 620px; }
  .form-section { grid-template-columns: 1fr; gap: 28px; }
  .consent-row { padding-left: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .review-grid { grid-template-columns: 1fr; }
  .leaderboard-panel { overflow-x: auto; }
  .leaderboard-head, .leader-row { min-width: 920px; }
  .login-page { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .site-header { position: static; padding: 12px 18px; }
  .header-note { display: none; }
  .admin-nav a { display: none; }
  .admin-nav a.active { display: block; }
  .hero { padding: 70px 22px 60px; }
  .hero h1, .login-art h1 { font-size: 44px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .consent-row { flex-direction: column; align-items: stretch; }
  .primary-button { width: 100%; }
  .success-page { margin: 22px; padding: 50px 22px; }
  .success-page h1 { font-size: 35px; }
  .receipt-summary { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 135px; }
  .metric strong { font-size: 34px; }
  .leaderboard-filters { grid-template-columns: 1fr 1fr; }
  .filter-search { grid-column: 1 / -1; }
  .evidence-panel { grid-template-columns: 1fr; }
  .student-photo { height: 340px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid div.full { grid-column: auto; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 70px 24px; }
  .login-card { padding: 55px 24px; }
}

@media (max-width: 440px) {
  .metric-grid, .leaderboard-filters { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .standard-bars a { grid-template-columns: 115px 1fr 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
