:root {
    --blue-950: #10224f;
    --blue-800: #1f4bbd;
    --blue-700: #2d61d4;
    --blue-100: #eaf0ff;
    --gold-500: #f2c94c;
    --gold-300: #ffe08a;
    --red-500: #d73b40;
    --slate-900: #182033;
    --slate-700: #4d5c7a;
    --slate-400: #9ba7c0;
    --white: #ffffff;
    --surface: rgba(255, 255, 255, 0.92);
    --shadow: 0 20px 45px rgba(15, 30, 78, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --container: 1180px;
    --header-offset: 96px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-offset) + 1rem);
}

body {
    margin: 0;
    min-height: 100vh;
    padding-top: var(--header-offset);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    color: var(--slate-900);
    background:
        radial-gradient(circle at top left, rgba(255, 224, 138, 0.45), transparent 24%),
        radial-gradient(circle at top right, rgba(45, 97, 212, 0.24), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef3ff 55%, #fef7e9 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    position: relative;
    overflow-x: hidden;
}

.page-shell::before,
.page-shell::after {
    content: "";
    position: absolute;
    inset: auto;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    filter: blur(20px);
    opacity: 0.22;
    z-index: -1;
}

.page-shell::before {
    top: 4rem;
    right: -6rem;
    background: var(--gold-500);
}

.page-shell::after {
    bottom: 8rem;
    left: -5rem;
    background: var(--blue-700);
}

.container {
    width: min(var(--container), calc(100% - 2rem));
    margin: 0 auto;
}

.narrow-container {
    width: min(920px, calc(100% - 2rem));
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 30;
    padding-top: env(safe-area-inset-top, 0px);
    backdrop-filter: blur(18px);
    background: rgba(16, 34, 79, 0.84);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 36px rgba(16, 34, 79, 0.14);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--white);
}

.brand-logo {
    width: 58px;
    height: 58px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.brand-copy strong {
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.brand-copy span {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.75);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
}

.site-nav > a {
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    transition: 0.2s ease;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-weight: 700;
    transition: 0.2s ease;
}

.theme-switch:hover {
    background: rgba(255, 255, 255, 0.14);
}

.theme-switch-text {
    font-size: 0.86rem;
    line-height: 1;
}

.theme-switch-track {
    position: relative;
    width: 50px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.theme-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gold-300);
    box-shadow: 0 6px 16px rgba(16, 34, 79, 0.25);
    transition: transform 0.2s ease, background 0.2s ease;
}

.theme-switch[aria-checked="true"] .theme-switch-track {
    background: rgba(125, 167, 255, 0.28);
}

.theme-switch[aria-checked="true"] .theme-switch-thumb {
    transform: translateX(22px);
    background: #7da7ff;
}

.site-nav > a:hover,
.site-nav > a.active {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.nav-user {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav-toggle {
    display: none;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    border-radius: 999px;
    background: var(--white);
}

.site-main {
    padding: 1.5rem 0 4rem;
}

.site-footer {
    background: var(--blue-950);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 3rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.8rem 0 2.2rem;
}

.footer-inner p {
    margin: 0.45rem 0 0;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.68);
}

.footer-badge {
    display: grid;
    gap: 0.45rem;
    align-content: center;
    font-size: 0.92rem;
    text-align: right;
}

.hero-section,
.section-block {
    padding-top: 1.25rem;
}

.hero-grid,
.detail-grid,
.auth-shell {
    display: grid;
    grid-template-columns: 1.35fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy,
.panel,
.detail-hero,
.class-card,
.student-card,
.stat-card,
.logo-panel,
.hero-note,
.empty-state {
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid rgba(16, 34, 79, 0.08);
}

.hero-copy {
    padding: 2.2rem;
    background:
        linear-gradient(135deg, rgba(31, 75, 189, 0.96), rgba(16, 34, 79, 0.97)),
        var(--surface);
    color: var(--white);
}

.hero-copy p {
    margin: 0;
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}

.hero-copy h1,
.section-head h1,
.section-head h2,
.detail-hero h1,
.auth-copy h1,
.empty-state h1 {
    margin: 0.4rem 0 0.85rem;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.12;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--gold-300);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-actions,
.form-actions,
.toolbar,
.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-actions {
    margin-top: 1.5rem;
}

.stats-grid,
.student-grid,
.class-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.7rem;
}

.admin-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    padding: 1.1rem 1.2rem;
}

.stat-label {
    display: block;
    color: var(--slate-700);
    font-size: 0.88rem;
}

.stat-number {
    display: block;
    margin-top: 0.45rem;
    color: var(--blue-950);
    font-size: 1.55rem;
    font-weight: 700;
}

.hero-visual {
    display: grid;
    gap: 1rem;
}

.logo-panel,
.hero-note,
.panel,
.detail-hero,
.empty-state {
    padding: 1.5rem;
}

.logo-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(234, 240, 255, 0.95));
}

.logo-panel img {
    width: min(240px, 100%);
}

.logo-panel-copy {
    text-align: center;
}

.logo-panel-copy strong {
    display: block;
    font-size: 1.15rem;
}

.logo-panel-copy span,
.muted-text {
    color: var(--slate-700);
}

.hero-note {
    background: linear-gradient(180deg, rgba(242, 201, 76, 0.16), rgba(255, 255, 255, 0.94));
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h1,
.section-head h2 {
    font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.panel {
    padding: 1.35rem;
}

.panel h2,
.student-card h3,
.class-card h3 {
    margin: 0 0 0.75rem;
    font-family: Georgia, "Times New Roman", serif;
}

.panel-accent {
    background:
        linear-gradient(135deg, rgba(215, 59, 64, 0.95), rgba(31, 75, 189, 0.95));
    color: var(--white);
}

.auth-panel {
    align-self: center;
}

.auth-note {
    margin-top: 1.4rem;
    display: grid;
    gap: 0.3rem;
    font-size: 0.94rem;
}

.filter-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.filter-grid {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.input-group {
    display: grid;
    gap: 0.42rem;
}

.grow {
    flex: 1 1 250px;
}

.input-group label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--slate-900);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.88rem 0.95rem;
    border: 1px solid rgba(16, 34, 79, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--slate-900);
    transition: 0.2s ease;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(77, 92, 122, 0.7);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(45, 97, 212, 0.14);
}

.checkbox-group {
    align-content: end;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.9rem;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.full-span {
    grid-column: 1 / -1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.82rem 1.15rem;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.62rem 0.95rem;
    font-size: 0.92rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-500), #ffdb6d);
    color: var(--blue-950);
    box-shadow: 0 14px 28px rgba(242, 201, 76, 0.28);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    border: 1px solid rgba(16, 34, 79, 0.14);
}

.btn-ghost {
    background: rgba(16, 34, 79, 0.08);
    color: var(--blue-950);
}

.site-nav .btn-ghost,
.site-nav .btn-outline,
.site-nav .btn-primary {
    color: var(--blue-950);
}

.site-nav .btn-ghost {
    background: rgba(255, 255, 255, 0.88);
}

.badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(31, 75, 189, 0.12);
    color: var(--blue-800);
    font-size: 0.84rem;
    font-weight: 700;
}

.flash {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    font-weight: 700;
}

.flash-success {
    background: rgba(51, 167, 101, 0.12);
    color: #19653e;
    border: 1px solid rgba(51, 167, 101, 0.2);
}

.flash-error,
.box-error {
    background: rgba(215, 59, 64, 0.1);
    color: #8e1b23;
    border: 1px solid rgba(215, 59, 64, 0.16);
}

.field-error {
    color: #a11f28;
    font-size: 0.85rem;
}

.box-error {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.class-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.class-card {
    padding: 1.2rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(234, 240, 255, 0.94));
}

.class-card h3 {
    margin-top: 0.85rem;
}

.class-card p {
    margin: 0 0 0.85rem;
    color: var(--slate-700);
}

.student-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
}

.student-card {
    padding: 1.2rem;
    display: grid;
    gap: 1rem;
}

.student-card-head,
.detail-hero-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-card-head h3,
.detail-hero-head h1 {
    margin-bottom: 0.15rem;
}

.student-card-head p,
.student-activity,
.detail-hero p {
    margin: 0;
    color: var(--slate-700);
}

.student-activity {
    min-height: 3rem;
    line-height: 1.6;
}

.student-photo {
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 28px rgba(16, 34, 79, 0.14);
    background: #dfe8ff;
}

.student-photo-sm {
    width: 54px;
    height: 54px;
}

.student-photo-table {
    width: 46px;
    height: 46px;
}

.student-photo-hero {
    width: 96px;
    height: 96px;
}

.student-photo-xl {
    width: 120px;
    height: 120px;
}

.avatar-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-700), var(--red-500));
    color: var(--white);
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.avatar-large {
    width: 84px;
    height: 84px;
    font-size: 1.55rem;
}

.avatar-table {
    width: 46px;
    height: 46px;
    font-size: 0.95rem;
}

.avatar-photo-preview {
    width: 120px;
    height: 120px;
    font-size: 1.9rem;
}

.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-grid {
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid > .panel:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.info-grid span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--slate-700);
    font-size: 0.88rem;
}

.info-grid strong {
    font-size: 1rem;
    line-height: 1.65;
    word-break: break-word;
}

.table-student {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 180px;
}

.table-student strong {
    display: block;
    line-height: 1.45;
}

.photo-upload-panel {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px dashed rgba(16, 34, 79, 0.16);
    border-radius: 22px;
    background: rgba(16, 34, 79, 0.03);
}

.photo-upload-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-upload-copy {
    display: grid;
    gap: 0.55rem;
}

.photo-upload-copy input[type="file"] {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(16, 34, 79, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
}

.field-hint {
    color: var(--slate-700);
    font-size: 0.86rem;
    line-height: 1.6;
}

.photo-remove-toggle {
    margin-top: 0.1rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table tbody tr {
    transition: background 0.18s ease;
}

.data-table tbody tr:hover {
    background: rgba(31, 75, 189, 0.04);
}

.data-table th,
.data-table td {
    padding: 0.95rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid rgba(16, 34, 79, 0.08);
    vertical-align: top;
}

.data-table th {
    color: var(--slate-700);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.actions-cell {
    white-space: nowrap;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue-800);
    font-weight: 700;
    margin-right: 0.7rem;
}

.danger-link {
    color: var(--red-500);
}

.inline-form {
    display: inline-flex;
}

.filter-actions {
    justify-content: flex-end;
    align-self: end;
}

.admin-workspace {
    padding-top: 1rem;
}

.admin-hub {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.35rem;
    padding: 1.3rem;
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(16, 34, 79, 0.98), rgba(31, 75, 189, 0.95));
    box-shadow: 0 24px 48px rgba(16, 34, 79, 0.22);
    color: var(--white);
    overflow: hidden;
    position: relative;
}

.admin-hub::before {
    content: "";
    position: absolute;
    inset: auto auto -4.5rem -4rem;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: rgba(242, 201, 76, 0.2);
    filter: blur(6px);
}

.admin-hub::after {
    content: "";
    position: absolute;
    top: -3.5rem;
    right: -2rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.admin-hub-copy,
.admin-nav-grid {
    position: relative;
    z-index: 1;
}

.admin-hub-copy {
    display: grid;
    align-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.25rem;
}

.admin-hub-eyebrow {
    background: rgba(255, 255, 255, 0.12);
    color: var(--gold-300);
}

.admin-hub h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.12;
}

.admin-hub p {
    margin: 0;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.72;
}

.admin-hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.admin-hub .btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.admin-hub-current {
    display: inline-flex;
    align-items: center;
    padding: 0.68rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.92rem;
    font-weight: 700;
}

.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.admin-nav-card {
    display: grid;
    gap: 0.38rem;
    min-height: 132px;
    padding: 1rem 1.05rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.admin-nav-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

.admin-nav-card.active {
    background:
        linear-gradient(135deg, rgba(242, 201, 76, 0.95), rgba(255, 224, 138, 0.94));
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--blue-950);
}

.admin-nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.72;
}

.admin-nav-card strong {
    font-size: 1.2rem;
    font-family: Georgia, "Times New Roman", serif;
}

.admin-nav-card small {
    color: inherit;
    line-height: 1.6;
    opacity: 0.86;
}

.admin-page-head {
    margin-bottom: 1.15rem;
}

.admin-page-head > div:first-child {
    max-width: 42rem;
}

.admin-section-note {
    margin: 0.2rem 0 0;
    color: var(--slate-700);
    line-height: 1.7;
}

.admin-panel {
    border-radius: 26px;
    padding: 1.3rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 249, 255, 0.96));
}

.admin-toolbar-panel {
    margin-bottom: 1rem;
}

.admin-table-panel .table-wrap {
    padding: 0.25rem;
    border-radius: 20px;
    background: rgba(16, 34, 79, 0.02);
}

.admin-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-panel-head h2 {
    margin-bottom: 0.25rem;
}

.admin-panel-head p {
    margin: 0;
    color: var(--slate-700);
    line-height: 1.65;
}

.admin-stats .stat-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(237, 243, 255, 0.96));
}

.admin-stats .stat-card::after {
    content: "";
    position: absolute;
    inset: auto -1.2rem -2.4rem auto;
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 50%;
    background: rgba(45, 97, 212, 0.08);
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-state p {
    max-width: 32rem;
    margin: 0 auto 1rem;
    color: var(--slate-700);
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .hero-grid,
    .detail-grid,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .class-grid,
    .student-grid,
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-hub {
        grid-template-columns: 1fr;
    }

    .photo-upload-panel {
        grid-template-columns: 1fr;
        justify-items: flex-start;
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-block;
    }

    .site-nav {
        position: absolute;
        left: 1rem;
        right: 1rem;
        top: calc(100% + 0.75rem);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-radius: 24px;
        background: rgba(16, 34, 79, 0.96);
        box-shadow: var(--shadow);
        display: none;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav > a,
    .site-nav .inline-form,
    .site-nav .btn,
    .site-nav .theme-switch {
        width: 100%;
    }

    .site-nav .inline-form button {
        width: 100%;
    }

    .site-nav .nav-user {
        padding: 0.25rem 0.2rem 0.6rem;
    }

    .stats-grid,
    .class-grid,
    .student-grid,
    .compact-grid,
    .form-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .detail-hero,
    .section-head,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-badge {
        text-align: left;
    }

    .admin-nav-grid {
        grid-template-columns: 1fr;
    }

    .admin-panel-head {
        flex-direction: column;
    }

    .table-student {
        min-width: 150px;
    }
}

@media (max-width: 560px) {
    .hero-copy,
    .panel,
    .detail-hero,
    .logo-panel,
    .hero-note,
    .empty-state {
        padding: 1.15rem;
        border-radius: 22px;
    }

    .header-inner {
        padding: 0.8rem 0;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }

    .hero-copy h1 {
        font-size: 2rem;
    }

    .btn,
    .btn-sm {
        width: 100%;
    }

    .hero-actions,
    .form-actions,
    .toolbar,
    .filter-actions {
        width: 100%;
    }

    .toolbar .btn,
    .filter-actions .btn {
        flex: 1 1 100%;
    }

    .detail-hero-head,
    .student-card-head {
        align-items: flex-start;
    }

    .admin-hub,
    .admin-panel {
        padding: 1.05rem;
        border-radius: 22px;
    }

    .admin-hub-actions,
    .admin-nav-card {
        width: 100%;
    }

    .student-photo-hero {
        width: 82px;
        height: 82px;
    }

    .student-photo-xl,
    .avatar-photo-preview {
        width: 102px;
        height: 102px;
    }
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    color: #e6ecff;
    background:
        radial-gradient(circle at top left, rgba(242, 201, 76, 0.14), transparent 26%),
        radial-gradient(circle at top right, rgba(77, 122, 255, 0.18), transparent 30%),
        linear-gradient(180deg, #071120 0%, #0d1830 55%, #111d35 100%);
}

html[data-theme="dark"] .page-shell::before {
    background: rgba(242, 201, 76, 0.55);
    opacity: 0.14;
}

html[data-theme="dark"] .page-shell::after {
    background: rgba(45, 97, 212, 0.78);
    opacity: 0.18;
}

html[data-theme="dark"] .site-header {
    background: rgba(6, 12, 27, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .site-footer {
    background: #060d1c;
}

html[data-theme="dark"] .footer-inner p,
html[data-theme="dark"] .footer-badge,
html[data-theme="dark"] .nav-user,
html[data-theme="dark"] .logo-panel-copy span,
html[data-theme="dark"] .muted-text,
html[data-theme="dark"] .class-card p,
html[data-theme="dark"] .student-card-head p,
html[data-theme="dark"] .student-activity,
html[data-theme="dark"] .detail-hero p,
html[data-theme="dark"] .info-grid span,
html[data-theme="dark"] .empty-state p,
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .data-table th {
    color: #aebad7;
}

html[data-theme="dark"] .hero-copy,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .detail-hero,
html[data-theme="dark"] .class-card,
html[data-theme="dark"] .student-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .logo-panel,
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-hub {
    background: rgba(9, 18, 41, 0.84);
    border: 1px solid rgba(133, 161, 255, 0.14);
    box-shadow: 0 24px 45px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .hero-copy {
    background:
        linear-gradient(135deg, rgba(20, 44, 100, 0.97), rgba(8, 16, 34, 0.98)),
        rgba(9, 18, 41, 0.84);
}

html[data-theme="dark"] .panel-accent {
    background:
        linear-gradient(135deg, rgba(145, 32, 47, 0.95), rgba(18, 54, 128, 0.95));
}

html[data-theme="dark"] .admin-hub {
    background:
        linear-gradient(135deg, rgba(8, 16, 34, 0.98), rgba(18, 54, 128, 0.95));
}

html[data-theme="dark"] .admin-hub::before {
    background: rgba(242, 201, 76, 0.18);
}

html[data-theme="dark"] .admin-hub::after {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .logo-panel {
    background:
        linear-gradient(180deg, rgba(15, 29, 62, 0.96), rgba(8, 16, 34, 0.96));
}

html[data-theme="dark"] .hero-note {
    background:
        linear-gradient(180deg, rgba(242, 201, 76, 0.12), rgba(9, 18, 41, 0.96));
}

html[data-theme="dark"] .class-card {
    background:
        linear-gradient(180deg, rgba(15, 29, 62, 0.96), rgba(8, 16, 34, 0.96));
}

html[data-theme="dark"] .stat-number,
html[data-theme="dark"] .info-grid strong,
html[data-theme="dark"] .input-group label,
html[data-theme="dark"] .empty-state h1,
html[data-theme="dark"] .section-head h1,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .student-card h3,
html[data-theme="dark"] .class-card h3,
html[data-theme="dark"] .detail-hero h1,
html[data-theme="dark"] .admin-hub h2,
html[data-theme="dark"] .admin-nav-card strong {
    color: #f4f7ff;
}

html[data-theme="dark"] .badge {
    background: rgba(124, 155, 255, 0.16);
    color: #d7e3ff;
}

html[data-theme="dark"] .btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(133, 161, 255, 0.24);
}

html[data-theme="dark"] .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #edf2ff;
}

html[data-theme="dark"] .site-nav .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

html[data-theme="dark"] .theme-switch {
    border-color: rgba(133, 161, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .theme-switch:hover {
    background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .theme-switch-track {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(133, 161, 255, 0.14);
}

html[data-theme="dark"] .theme-switch-thumb {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .theme-switch[aria-checked="true"] .theme-switch-track {
    background: rgba(125, 167, 255, 0.3);
}

html[data-theme="dark"] .student-photo {
    border-color: rgba(133, 161, 255, 0.22);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .admin-hub p,
html[data-theme="dark"] .admin-panel-head p,
html[data-theme="dark"] .admin-section-note {
    color: #aebad7;
}

html[data-theme="dark"] .admin-hub-current {
    background: rgba(255, 255, 255, 0.08);
    color: #e6ecff;
}

html[data-theme="dark"] .admin-hub .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

html[data-theme="dark"] .admin-nav-card {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(133, 161, 255, 0.16);
}

html[data-theme="dark"] .admin-nav-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .admin-nav-card.active {
    background:
        linear-gradient(135deg, rgba(242, 201, 76, 0.95), rgba(255, 224, 138, 0.94));
    color: var(--blue-950);
}

html[data-theme="dark"] .admin-nav-card.active strong,
html[data-theme="dark"] .admin-nav-card.active small,
html[data-theme="dark"] .admin-nav-card.active .admin-nav-label {
    color: var(--blue-950);
}

html[data-theme="dark"] .admin-table-panel .table-wrap {
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .photo-upload-panel {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(133, 161, 255, 0.16);
}

html[data-theme="dark"] .photo-upload-copy input[type="file"] {
    background: rgba(7, 13, 29, 0.92);
    color: #eef3ff;
    border-color: rgba(133, 161, 255, 0.16);
}

html[data-theme="dark"] .field-hint {
    color: #aebad7;
}

html[data-theme="dark"] .input-group input,
html[data-theme="dark"] .input-group select,
html[data-theme="dark"] .input-group textarea {
    background: rgba(7, 13, 29, 0.92);
    color: #eef3ff;
    border-color: rgba(133, 161, 255, 0.16);
}

html[data-theme="dark"] .input-group input::placeholder,
html[data-theme="dark"] .input-group textarea::placeholder {
    color: rgba(174, 186, 215, 0.68);
}

html[data-theme="dark"] .input-group input:focus,
html[data-theme="dark"] .input-group select:focus,
html[data-theme="dark"] .input-group textarea:focus {
    border-color: #7da7ff;
    box-shadow: 0 0 0 3px rgba(125, 167, 255, 0.18);
}

html[data-theme="dark"] .flash-success {
    background: rgba(56, 173, 109, 0.14);
    color: #9be0b8;
    border-color: rgba(56, 173, 109, 0.24);
}

html[data-theme="dark"] .flash-error,
html[data-theme="dark"] .box-error {
    background: rgba(215, 59, 64, 0.14);
    color: #ffb0b3;
    border-color: rgba(215, 59, 64, 0.24);
}

html[data-theme="dark"] .field-error {
    color: #ff9ba0;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table td {
    border-bottom-color: rgba(133, 161, 255, 0.14);
}

html[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(124, 155, 255, 0.08);
}

html[data-theme="dark"] .btn-link {
    color: #98b6ff;
}

html[data-theme="dark"] .danger-link {
    color: #ff9aa1;
}

html[data-theme="dark"] .site-nav {
    color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .site-nav > a:hover,
html[data-theme="dark"] .site-nav > a.active {
    background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .site-nav {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 820px) {
    .theme-switch {
        justify-content: center;
    }

    html[data-theme="dark"] .site-nav {
        background: rgba(6, 12, 27, 0.98);
    }
}
