:root {
    /* Dominant green palette — green is the primary visual identity */
    --forest: #006600;
    --forest-deep: #0a3d16;
    --forest-bright: #2f8f3f;
    --forest-light: #d4edda;
    --forest-soft: rgba(0, 102, 0, 0.12);
    --forest-ghost: rgba(0, 102, 0, 0.04);
    --bg: #e8f5e9;
    --bg-deep: #c8e6c9;
    --panel: #ffffff;
    --border: rgba(0, 102, 0, 0.18);
    --text: #0a2e0f;
    --muted: #3d6b42;
    --accent: #006600;
    --accent-soft: rgba(0, 102, 0, 0.10);
    --shadow: 0 20px 50px rgba(0, 60, 0, 0.14);
}
* { box-sizing: border-box; }
body {
    position: relative;
    isolation: isolate;
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.16), transparent 35%),
        radial-gradient(circle at 90% 100%, rgba(0, 51, 0, 0.18), transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 60%),
        linear-gradient(135deg, #eafaea 0%, #a8d9ad 30%, #4caf50 60%, #1f7a2e 85%, #0a3d16 100%);
    overflow-x: hidden;
}
body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}
body::before {
    background-image:
        linear-gradient(rgba(0, 102, 0, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 0, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 85%);
    opacity: 0.6;
}
body::after {
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 102, 0, 0.10), transparent 0 22%, transparent 23%),
        radial-gradient(circle at 80% 15%, rgba(0, 102, 0, 0.08), transparent 0 18%, transparent 19%),
        radial-gradient(circle at 50% 80%, rgba(0, 102, 0, 0.06), transparent 0 30%, transparent 31%);
    filter: blur(12px);
}
.wrap { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 26px 0 40px; }
.hero, .panel, .card {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow);
}
.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    padding: 34px;
    margin-bottom: 18px;
    border-top: 4px solid var(--forest);
    border-left: 4px solid var(--forest-bright);
}
.hero::before {
    content: '';
    position: absolute;
    inset: -150px auto auto -150px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 102, 0, 0.14), transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    inset: auto -120px -150px auto;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 102, 0, 0.12), transparent 72%);
    pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }

/* Brand lockup ---------------------------------------------------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 8px 18px 8px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--forest);
    box-shadow: 0 4px 16px rgba(0, 102, 0, 0.10);
}
.seal-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: var(--bg);
    border: 2px solid var(--forest);
    box-shadow:
        0 0 0 2px var(--panel),
        0 0 0 4px var(--forest-bright),
        0 10px 24px rgba(0, 102, 0, 0.18);
}
.brand-logo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; }
.brand-text { display: grid; gap: 2px; }
.brand-title { font-family: 'Fraunces', serif; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; color: var(--forest-deep); }
.brand-subtitle { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.02em; }

.seal-motto {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 500;
    font-size: 0.86rem;
    letter-spacing: 0.05em;
    color: var(--forest);
}
.seal-motto::before,
.seal-motto::after { content: ''; height: 2px; width: 40px; }
.seal-motto::before { background: linear-gradient(90deg, transparent, var(--forest-bright)); }
.seal-motto::after { background: linear-gradient(90deg, var(--forest-bright), transparent); }

.hero-kicker { display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-bottom: 10px; padding: 8px 14px; border-radius: 999px; background: var(--forest); color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(0, 102, 0, 0.20); }
.eyebrow, .badge { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 14px; background: var(--forest); color: #fff; font-size: 0.84rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(0, 102, 0, 0.18); }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: 'Fraunces', serif; color: var(--forest-deep); }
h1 { margin-bottom: 12px; font-size: clamp(1.9rem, 3.6vw, 3.4rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
h2 {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
h2::after { content: ''; flex: 1; height: 2px; min-width: 24px; background: linear-gradient(90deg, var(--forest-bright), transparent); align-self: center; }
.helper, .muted { color: var(--muted); line-height: 1.65; }
.hero-summary { max-width: 62ch; font-size: 1.02rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0; }
.card {
    padding: 20px;
    border-top: 3px solid var(--forest);
    background: linear-gradient(135deg, #ffffff 0%, #f1f8f2 100%);
}
.card strong { display: block; font-family: 'Fraunces', serif; font-size: 2.1rem; font-weight: 700; margin-bottom: 6px; color: var(--forest); }
.panel { padding: 26px; margin-top: 18px; border-left: 3px solid var(--forest-bright); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px dashed var(--border); }
.form-section:last-of-type { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--forest);
}
.form-section-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--forest-bright);
    flex-shrink: 0;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.full { grid-column: 1 / -1; }
label { font-size: 0.86rem; font-weight: 700; letter-spacing: 0.02em; color: var(--forest-deep); }
input, select, textarea {
    width: 100%;
    border-radius: 10px;
    border: 2px solid rgba(0, 102, 0, 0.25);
    background: #ffffff;
    padding: 13px 14px;
    font: inherit;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 4px var(--accent-soft); }
input.field-invalid { border-color: #b42318; }
input.field-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14); }
.error { color: #b42318; font-size: 0.85rem; margin: 0; }
.required-mark { color: #b42318; font-weight: 700; }
.alert { padding: 14px 16px; border-radius: 10px; margin: 0 0 16px; font-weight: 600; border-left: 4px solid; }
.alert.success { background: rgba(0, 102, 0, 0.10); color: #0a3d16; border-color: var(--forest); }
.alert.error { background: #b42318; color: #fff; border-color: #7f190f; box-shadow: 0 10px 24px rgba(180, 35, 24, 0.25); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 13px 24px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.button.primary { color: #fff; background: var(--forest); box-shadow: 0 14px 28px rgba(0, 102, 0, 0.25); }
.button.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(0, 102, 0, 0.32); background: var(--forest-deep); }
.button.secondary { color: var(--forest); background: #fff; border: 2px solid var(--forest); }
.button.secondary:hover { background: var(--forest); color: #fff; box-shadow: 0 8px 20px rgba(0, 102, 0, 0.20); }
.button.danger { color: #fff; background: #b42318; box-shadow: 0 12px 24px rgba(180, 35, 24, 0.22); }
.button.danger:hover { background: #8f1c13; transform: translateY(-2px); box-shadow: 0 16px 30px rgba(180, 35, 24, 0.28); }
.button.small { padding: 8px 12px; font-size: 0.78rem; border-radius: 8px; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 46, 15, 0.45);
}
.modal-overlay[hidden] { display: none; }
.modal {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: grid;
    gap: 14px;
    padding: 26px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow);
}
.modal h3 { font-family: 'Fraunces', serif; color: var(--forest-deep); margin: 0; font-size: 1.2rem; }
.list-header { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 2px solid var(--border); background: #ffffff; box-shadow: 0 4px 16px rgba(0, 102, 0, 0.06); }
table { width: 100%; border-collapse: collapse; min-width: 1180px; }
th, td { padding: 16px 14px; border-bottom: 1px solid rgba(0, 102, 0, 0.10); text-align: left; vertical-align: middle; }
th { color: #fff; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; font-weight: 700; background: var(--forest); white-space: nowrap; }
thead tr:first-child th:first-child { border-top-left-radius: 12px; }
thead tr:first-child th:last-child { border-top-right-radius: 12px; }
tbody tr:nth-child(even) { background: rgba(0, 102, 0, 0.03); }
tbody tr:hover { background: rgba(0, 102, 0, 0.06); }
tbody tr.row-done { background: var(--forest-light) !important; }
tbody tr.row-done:hover { background: #c3e6cb !important; }
.button.row-done-toggle { color: var(--forest); background: #fff; border: 2px solid var(--forest-soft); }
.button.row-done-toggle:hover { background: var(--forest-soft); border-color: var(--forest-bright); }
.button.row-done-toggle.is-done { color: #fff; background: var(--forest); border-color: var(--forest); box-shadow: 0 6px 14px rgba(0, 102, 0, 0.22); }
.button.row-done-toggle.is-done:hover { background: var(--forest-deep); }
.department-card { margin-top: 18px; padding: 18px; border-radius: 12px; border: 2px solid var(--border); background: #ffffff; }
.year-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.year-card { padding: 14px; border-radius: 10px; border: 2px solid var(--border); background: linear-gradient(135deg, #e8f5e9, #f1f8f2); }
.student-stack { display: grid; gap: 10px; }
.student-item { padding: 12px 14px; border-radius: 10px; background: linear-gradient(135deg, rgba(0, 102, 0, 0.06), #ffffff); border: 1px solid var(--border); }
.student-item strong { display: block; margin-bottom: 6px; color: var(--forest-deep); }
.student-item .meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; }
.empty { padding: 30px 18px; border-radius: 10px; border: 2px dashed var(--forest-soft); color: var(--muted); text-align: center; background: rgba(0, 102, 0, 0.02); }
.wrap-narrow { max-width: 520px; }
.registration-note { max-width: 46ch; margin: 0 0 4px; }
.login-panel .field { margin-bottom: 16px; }
.login-panel .actions { margin-top: 8px; }
.success-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 34px 20px 10px; }
.success-state[hidden] { display: none; }
.success-check { display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 50%; margin-bottom: 6px; color: #fff; background: var(--forest); box-shadow: 0 14px 28px rgba(0, 102, 0, 0.28); }
.success-check svg circle { stroke: rgba(255, 255, 255, 0.35); }
.success-check svg path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw-check 0.5s ease 0.15s forwards; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.success-title { color: var(--forest-deep); }
.search-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-field { max-width: 320px; flex: 1; min-width: 220px; margin-bottom: 0; }
.filter-dropdown { position: relative; }
.filter-toggle { position: relative; gap: 8px; padding: 12px 18px; }
.filter-toggle svg { flex-shrink: 0; }
.filter-toggle[aria-expanded="true"] { background: var(--forest); color: #fff; }
.filter-toggle.chip-active { background: var(--forest); color: #fff; border-color: var(--forest); box-shadow: 0 4px 12px rgba(0, 102, 0, 0.20); }
.filter-toggle.chip-active .filter-count { background: #fff; color: var(--forest); }
.filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--forest); color: #fff; font-size: 0.72rem; font-weight: 800; }
.filter-toggle[aria-expanded="true"] .filter-count { background: #fff; color: var(--forest); }
.filter-panel {
    position: absolute;
    z-index: 5;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow);
}
.filter-panel[hidden] { display: none; }
.filter-actions { margin-top: 2px; justify-content: flex-end; }
.filter-actions .button { padding: 10px 18px; }
@media (max-width: 640px) {
    .search-row { flex-direction: column; align-items: stretch; }
    .search-field { max-width: none; }
    .filter-panel { right: auto; left: 0; width: 100%; }
}
.admin-footer-link { text-align: center; margin-top: 20px; }
.admin-footer-link a { color: var(--forest); font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 6px; transition: background 0.15s ease; }
.admin-footer-link a:hover { text-decoration: underline; background: var(--forest-soft); }
.chip {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 16px;
    background: #fff;
    color: var(--forest);
    border: 2px solid var(--forest-soft);
    font-size: 0.84rem;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.chip:hover { background: var(--forest-soft); border-color: var(--forest-bright); }
.chip.chip-active { background: var(--forest); color: #fff; border-color: var(--forest); box-shadow: 0 4px 12px rgba(0, 102, 0, 0.20); }
@media (max-width: 900px) {
    .hero, .grid, .form-grid, .year-grid { grid-template-columns: 1fr; }
    body::before { background-size: 40px 40px; }
}
@media (max-width: 640px) {
    .wrap { width: min(100% - 16px, 1180px); padding-top: 16px; }
    .hero, .panel, .card { padding: 18px; }
    .brand { width: 100%; }
    body::before { background-size: 32px 32px; }
    .form-section { margin-bottom: 20px; padding-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; }
}