:root {
    --ink: #0d1f19;
    --muted: #667871;
    --paper: #f4f7f5;
    --white: #fff;
    --forest: #071611;
    --forest-2: #0b281e;
    --lime: #d2ff35;
    --mint: #45d6b0;
    --orange: #ff9f43;
    --red: #e55252;
    --line: #dce5e0;
    --shadow: 0 24px 70px rgba(2, 22, 15, .12);
    --radius-lg: 28px;
    --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Manrope", system-ui, sans-serif; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.public-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(rgba(241, 247, 251, .94), rgba(241, 247, 251, .97)),
        url('/assets/images/backgrounds/warriors-values.jpg') center top / cover fixed,
        #eef5fa;
}
.ambient { position: fixed; border-radius: 999px; filter: blur(1px); pointer-events: none; opacity: .5; }
.ambient-one { width: 240px; height: 240px; right: -110px; top: 38%; border: 1px solid rgba(0,151,218,.4); box-shadow: 0 0 90px rgba(0,151,218,.12); }
.ambient-two { width: 420px; height: 420px; left: -320px; top: 50%; border: 1px solid rgba(4,45,78,.18); }
.public-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 36px 0 30px; position: relative; }
.public-header { position: relative; min-height: 620px; border-radius: var(--radius-lg); padding: 30px 34px 76px; color: #fff; overflow: hidden; background: linear-gradient(90deg, rgba(2,18,33,.97) 0%, rgba(3,31,54,.88) 48%, rgba(4,37,64,.45) 100%), url('/assets/images/backgrounds/warriors-huddle.jpg') center 42% / cover no-repeat; box-shadow: 0 30px 85px rgba(2,30,52,.24); }
.public-header::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(1,20,36,.12), transparent 38%, rgba(1,17,30,.68)); pointer-events: none; }
.public-header::after { content: ""; position: absolute; width: 330px; height: 120px; right: -58px; top: 126px; opacity: .16; transform: rotate(-8deg); background: repeating-linear-gradient(135deg, transparent 0 22px, #fff 22px 38px, transparent 38px 60px); clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); pointer-events: none; }
.logo-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.logo-card { display: grid; place-items: center; width: 148px; height: 92px; padding: 4px; border-radius: 18px; border: 1px solid rgba(127,211,255,.28); background: rgba(0,28,49,.48); box-shadow: inset 0 1px rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.logo-card img { width: 100%; height: 100%; object-fit: contain; }
.language-switch { position: absolute; z-index: 2; right: 34px; top: 31px; display: flex; padding: 4px; border-radius: 999px; background: rgba(0,28,49,.5); border: 1px solid rgba(127,211,255,.25); backdrop-filter: blur(10px); }
.language-switch button { border: 0; border-radius: 999px; padding: 9px 13px; color: #b8d7e8; background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.language-switch button.is-active { color: #fff; background: #008fd0; box-shadow: 0 6px 18px rgba(0,143,208,.35); }
.title-block { position: relative; z-index: 1; max-width: 850px; margin-top: 88px; }
.title-kicker, .eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: 11px; font-weight: 800; }
.title-kicker { color: #70ceff; }
.title-kicker i { margin-right: 7px; }
.title-block h1 { margin: 15px 0 18px; max-width: 820px; font-size: clamp(40px, 6.6vw, 82px); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
.title-block p { margin: 0; max-width: 590px; color: #c5dfec; font-size: 16px; line-height: 1.7; }
.score-card { position: relative; z-index: 3; width: calc(100% - 52px); margin: -42px auto 0; background: #fff; border: 1px solid rgba(15,87,129,.09); border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(2,38,63,.16); overflow: hidden; }
.score-card::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #003f68, #00a4e4, #8ed8f8); }
.score-card-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 29px 32px 24px; border-bottom: 1px solid var(--line); }
.score-card-head .eyebrow { color: #087db5; }
.score-card-head h2 { margin: 7px 0 0; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.035em; }
.updated { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.updated i { color: #008fd0; }
.public-notice { margin: 20px 32px 0; padding: 13px 16px; border-radius: 12px; color: #7b3c00; background: #fff1dc; }
.table-scroll { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.score-table th { padding: 14px 25px; color: #698396; background: #f3f8fb; border-bottom: 1px solid #dce8ef; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; text-align: left; }
.score-table td { padding: 12px 25px; height: 65px; border-bottom: 1px solid #e8f0f4; }
.score-table tbody tr:last-child td { border-bottom: 0; }
.score-table tbody tr:not(.empty-row):hover { background: #f3faff; }
.number-column, .row-number { width: 90px; text-align: center !important; }
.row-number { color: #91a098; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-column, .score-value { width: 180px; text-align: right !important; }
.score-value { color: #006da4; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.student-cell { display: flex; align-items: center; gap: 14px; }
.student-avatar { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 12px; color: #09241b; background: linear-gradient(135deg, var(--lime), #94ed82); font-size: 11px; font-weight: 800; }
.student-cell strong { font-size: 14px; }
.empty-row td { height: 57px; color: #c6d0cb; }
.empty-line { display: block; width: min(180px, 40%); border-bottom: 1px dashed #dce4e0; }
.public-footer { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; min-height: 260px; aspect-ratio: 1336 / 412; margin-top: 24px; padding: 88px 30px 24px; overflow: hidden; border-radius: 24px; color: #d4e7f1; background: #02182a url('/assets/images/backgrounds/warriors-team-footer.jpg') center / cover no-repeat; box-shadow: 0 18px 55px rgba(2,38,63,.16); font-size: 12px; }
.public-footer::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,23,40,.02) 0%, rgba(2,23,40,.08) 48%, rgba(2,23,40,.78) 100%); pointer-events: none; }
.public-footer > * { position: relative; z-index: 1; }
.public-footer p { margin: 0; color: #fff; font-weight: 700; }

/* Administration */
.admin-body { min-height: 100vh; background: #eef3f0; }
.admin-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 18px; color: #dce9e3; background: linear-gradient(180deg, #071611, #0a241b); }
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; color: var(--forest); background: var(--lime); font-weight: 900; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { color: #fff; font-size: 13px; }
.admin-brand small { margin-top: 3px; color: #829c90; font-size: 10px; }
.admin-nav { display: grid; gap: 7px; margin-top: 25px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 12px; color: #a8bbb2; font-size: 13px; font-weight: 700; }
.admin-nav a i { width: 18px; text-align: center; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.admin-nav a.active i { color: var(--lime); }
.admin-sidebar-footer { position: absolute; inset: auto 18px 24px; }
.admin-sidebar-footer a { display: flex; align-items: center; gap: 10px; color: #9aafa5; font-size: 12px; }
.admin-main { min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; min-height: 90px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.84); backdrop-filter: blur(12px); }
.admin-heading small { display: block; margin-bottom: 4px; color: #74867e; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.admin-heading h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.admin-user { display: flex; align-items: center; gap: 11px; }
.admin-user-text { text-align: right; }
.admin-user strong, .admin-user small { display: block; }
.admin-user strong { font-size: 12px; }
.admin-user small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.admin-avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: #09241b; background: var(--lime); font-size: 11px; font-weight: 900; }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 20px; }
.admin-content { padding: 28px 32px 60px; }
.flash { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 13px 16px; border-radius: 13px; font-size: 13px; font-weight: 700; }
.flash-success { color: #0b6148; background: #dff7ed; }
.flash-error { color: #872d2d; background: #fde4e4; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.metric { padding: 22px; border: 1px solid #e2e9e5; border-radius: var(--radius-md); background: #fff; }
.metric span, .metric small { color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin: 8px 0 3px; font-size: 30px; letter-spacing: -.04em; }
.panel { margin-bottom: 20px; border: 1px solid #e0e8e3; border-radius: var(--radius-md); background: #fff; box-shadow: 0 8px 30px rgba(20,50,38,.04); overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid #e7edea; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 11px; color: #11251d; background: var(--lime); cursor: pointer; font-size: 12px; font-weight: 800; }
.button:hover { filter: brightness(.97); transform: translateY(-1px); }
.button-secondary { border-color: var(--line); background: #fff; }
.button-dark { color: #fff; background: var(--forest-2); }
.button-danger { color: #a33333; border-color: #f0caca; background: #fff4f4; }
.button-small { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 11px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.admin-table th { padding: 12px 18px; color: #77887f; background: #f7f9f8; border-bottom: 1px solid #e4ebe7; text-align: left; text-transform: uppercase; letter-spacing: .09em; font-size: 9px; }
.admin-table td { padding: 13px 18px; border-bottom: 1px solid #edf1ef; font-size: 12px; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfdfc; }
.admin-table .points { color: #0c684e; font-size: 16px; font-weight: 900; }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.change-positive { color: #13815f; font-weight: 800; }
.change-negative { color: #d14a4a; font-weight: 800; }
.reason-cell { max-width: 340px; line-height: 1.45; }
.empty-state { padding: 44px 25px; color: var(--muted); text-align: center; }
.rubric { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 22px; }
.rubric-card { padding: 18px; border-radius: 15px; background: #f7faf8; }
.rubric-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; }
.rubric-card ul { display: grid; gap: 10px; margin: 0; padding-left: 20px; }
.rubric-card li { padding-left: 3px; color: #43564d; font-size: 11px; line-height: 1.55; }
.rubric-minus h3 { color: #b74444; }
.rubric-plus h3 { color: #137b5d; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 22px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label { color: #405249; font-size: 11px; font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #ccd8d2; border-radius: 11px; outline: 0; background: #fff; font-size: 13px; }
.field textarea { min-height: 105px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #49a98d; box-shadow: 0 0 0 3px rgba(69,214,176,.14); }
.field .admin-checkbox { display: flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; }
.field .admin-checkbox input { width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: #0f4567; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; padding-top: 5px; }
.hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.modal { position: fixed; z-index: 50; inset: 0; display: none; place-items: center; padding: 20px; background: rgba(2,16,11,.62); backdrop-filter: blur(6px); }
.modal.is-open { display: grid; }
.modal-dialog { width: min(570px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 22px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 21px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modal-close { width: 35px; height: 35px; border: 0; border-radius: 10px; cursor: pointer; background: #f0f4f2; }
.modal .form-grid { grid-template-columns: 1fr; }
.modal .field-wide, .modal .form-actions { grid-column: auto; }
.score-preview { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: #f0f6f3; color: var(--muted); font-size: 11px; }
.score-preview strong { color: var(--ink); font-size: 18px; }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 25px; background: radial-gradient(circle at top right, #164332, #071611 55%); }
.login-card { width: min(440px, 100%); padding: 32px; border: 1px solid rgba(255,255,255,.08); border-radius: 25px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 27px; }
.login-brand h1 { margin: 0; font-size: 20px; }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.login-form { display: grid; gap: 15px; }
.login-form .button { width: 100%; margin-top: 4px; }
.login-footer { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 10px; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .25s ease; }
    .admin-sidebar.is-open { transform: translateX(0); }
    .menu-toggle { display: block; }
    .admin-topbar { padding: 16px 20px; }
    .admin-heading { margin-right: auto; margin-left: 13px; }
    .admin-content { padding: 22px 20px 50px; }
    .metrics { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .public-shell { width: min(100% - 20px, 1180px); padding-top: 10px; }
    .public-header { min-height: 560px; padding: 20px 19px 62px; border-radius: 22px; background-position: 57% 42%; }
    .logo-row { gap: 7px; padding-right: 92px; }
    .logo-card { width: 72px; height: 49px; border-radius: 11px; }
    .language-switch { right: 18px; top: 20px; }
    .title-block { margin-top: 74px; }
    .title-block h1 { font-size: clamp(38px, 13vw, 59px); }
    .score-card { width: calc(100% - 10px); border-radius: 20px; }
    .score-card-head { align-items: start; padding: 21px 19px 18px; }
    .updated { display: none; }
    .score-table th, .score-table td { padding-left: 15px; padding-right: 15px; }
    .public-footer { min-height: 230px; aspect-ratio: auto; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: 72px 18px 20px; background-position: center; }
    .rubric, .form-grid { grid-template-columns: 1fr; }
    .field-wide, .form-actions { grid-column: auto; }
    .panel-heading { align-items: flex-start; }
    .admin-user-text { display: none; }
}
