:root {
    --navy: #1e3a8a;
    --navy-hover: #172554;
    --teal: #2563eb;
    --teal-soft: #dbeafe;
    --ink: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --surface: #f8fafc;
    --surface-strong: #f1f5f9;
    --white: #ffffff;
    --danger: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.5);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface);
    font-synthesis: none;
}

.week-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.weekly-grid-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 1rem; background: var(--white); }
.weekly-grid { display: grid; grid-template-columns: 88px repeat(7, minmax(150px, 1fr)); min-width: 1138px; }
.weekly-grid > * { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .75rem; }
.weekly-corner, .weekly-day-heading, .weekly-period { background: var(--surface-strong); font-weight: 700; }
.weekly-day-heading { display: grid; gap: .2rem; text-align: center; }
.weekly-day-heading span { color: var(--muted); font-size: .85rem; }
.weekly-period { display: grid; place-items: center; }
.weekly-cell { min-height: 140px; }
.schedule-card { display: grid; gap: .3rem; padding: .75rem; border-radius: .75rem; background: color-mix(in srgb, var(--teal) 12%, var(--white)); border-left: 4px solid var(--teal); }
.schedule-card span, .schedule-card small { color: var(--muted); }
.result-components { display: grid; gap: .3rem; min-width: 160px; }
.curriculum-progress { display: grid; gap: 1rem; }
.progress-total { padding: .65rem 1rem; border-radius: 999px; background: var(--surface-strong); white-space: nowrap; }
.curriculum-semester { border: 1px solid var(--border); border-radius: 1rem; background: var(--white); overflow: hidden; }
.curriculum-semester > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; font-weight: 700; min-height: 48px; }
.curriculum-group { padding: 0 1.25rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
    .curriculum-semester, .schedule-card { transition: none; }
}

[data-theme='dark'] {
    --navy: #93c5fd;
    --navy-hover: #bfdbfe;
    --teal: #60a5fa;
    --teal-soft: #1e3a8a;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --surface: #0f172a;
    --surface-strong: #1e293b;
    --white: #1e293b;
    --danger: #f87171;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .glass-card,
[data-theme='dark'] .feature-card,
[data-theme='dark'] .auth-card {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--surface);
}

body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.55;
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme='dark'] body {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e293b 100%);
    background-attachment: fixed;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a,
button {
    transition: none;
}

:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.34);
    outline-offset: 3px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    color: var(--navy);
    letter-spacing: -0.035em;
    line-height: 1.12;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 4.6rem);
}

h2 {
    font-size: 1.5rem;
}

.app-loading {
    width: min(32rem, calc(100% - 2rem));
    margin: 30vh auto 0;
    color: var(--muted);
    text-align: center;
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--teal);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.primary-button,
.secondary-button {
    min-height: 2.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    padding: 0.72rem 1rem;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
}

.primary-button {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
    transition: all 0.3s ease;
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--navy-hover) 0%, #0c615a 100%);
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.inline-button {
    width: auto;
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--navy);
}

.secondary-button:hover {
    border-color: #9aabb9;
    background: var(--surface-strong);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* Web Home Shell */
.home-web-shell {
    display: grid;
    gap: 6rem;
    padding-bottom: 4rem;
    min-height: 100vh;
}

/* Hero Section */
.home-web-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.brand-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--teal-soft);
    color: var(--teal);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.home-web-hero h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.home-web-hero h1 .highlight {
    color: var(--teal);
}

.hero-description {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.web-button {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
}

/* Hero Visual & Mockup */
.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.1);
}

.main-card {
    width: 100%;
    max-width: 380px;
    height: 280px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.mockup-header {
    height: 12px;
    width: 40px;
    background: var(--border);
    border-radius: 6px;
    margin-bottom: 2rem;
}

.mockup-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mockup-line {
    height: 16px;
    background: var(--surface-strong);
    border-radius: 4px;
}

.mockup-line.w-100 { width: 100%; }
.mockup-line.w-80 { width: 80%; }
.mockup-line.w-70 { width: 70%; }
.mockup-line.w-60 { width: 60%; }
.mockup-line.w-50 { width: 50%; }

.floating-card-1, .floating-card-2 {
    position: absolute;
    width: 180px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    z-index: 3;
    animation: float 6s ease-in-out infinite;
}

.floating-card-1 {
    top: 10%;
    left: -5%;
}

.floating-card-2 {
    bottom: 15%;
    right: -10%;
    animation-delay: 2s;
}

.icon-placeholder {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--teal-soft);
    border-radius: 50%;
    flex-shrink: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Features */
.web-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(30, 58, 138, 0.12);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    color: var(--navy);
}

.feature-card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Dashboard Styles (Logged in) */
.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.dashboard-welcome {
    padding-bottom: 1.5rem;
}

.dashboard-welcome h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-welcome p {
    color: var(--muted);
    margin: 0;
    font-size: 1.05rem;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: clamp(3rem, 8vw, 7rem);
    align-items: center;
    min-height: calc(100vh - 13.5rem);
}

.auth-intro h1 {
    max-width: 720px;
    margin-bottom: 1.4rem;
}

.intro-copy {
    max-width: 600px;
    color: var(--muted);
    font-size: 1.05rem;
}

.system-note {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--teal);
}

.auth-card,
.profile-card,
.empty-state {
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--white);
    box-shadow: 0 16px 50px rgba(18, 48, 74, 0.07);
}

.auth-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 2.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.15);
}

.card-heading {
    margin-bottom: 1.8rem;
}

.card-heading h2 {
    margin-bottom: 0.45rem;
}

.card-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.field-group {
    margin-bottom: 1.25rem;
}

.field-group label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 750;
}

.text-input {
    width: 100%;
    min-height: 3rem;
    border: 1px solid #b9c5cf;
    border-radius: 0.5rem;
    padding: 0.65rem 0.8rem;
    background: var(--white);
    color: var(--ink);
}

.text-input:focus {
    border-color: var(--teal);
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap .text-input {
    padding-right: 4.5rem;
}

.user-password-input {
    min-width: 0;
}

.user-password-input .field-input {
    width: 100%;
    padding-right: 4.5rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    min-width: 3.25rem;
    min-height: 2.2rem;
    translate: 0 -50%;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--teal-soft);
}

.invalid {
    border-color: var(--danger);
}

.validation-message,
.form-error {
    color: var(--danger);
    font-size: 0.84rem;
}

.validation-message {
    display: block;
    margin-top: 0.35rem;
}

.form-error {
    margin: 0 0 1rem;
    padding: 0.75rem;
    border-left: 3px solid var(--danger);
    background: #fff4f4;
}

.profile-shell {
    max-width: 860px;
    margin: 0 auto;
}

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

.page-heading h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 1.25rem;
    padding: clamp(1.4rem, 4vw, 2.25rem);
}

.identity-mark {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    border-radius: 0.8rem;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 1.15rem;
    font-weight: 850;
}

.identity-copy {
    align-self: center;
}

.identity-copy h2,
.identity-copy p {
    margin-bottom: 0.25rem;
}

.identity-copy p,
.loading-message {
    color: var(--muted);
}

.profile-details {
    grid-column: 1 / -1;
    margin: 1rem 0 0;
    border-top: 1px solid var(--border);
}

.profile-details > div {
    display: grid;
    grid-template-columns: minmax(120px, 0.3fr) 1fr;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.profile-details dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.profile-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.role-badge {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 750;
}

.empty-state {
    padding: 2rem;
}

.data-error,
.data-section {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.dashboard-panel {
    margin-bottom: 2rem;
}

.dashboard-panel h2,
.data-section h2 {
    margin-bottom: 1rem;
}

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

.dashboard-details div {
    border-left: 3px solid var(--teal);
    padding-left: 0.8rem;
}

.dashboard-details dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.dashboard-details dd {
    margin: 0.25rem 0 0;
    color: var(--navy);
    font-size: 1.1rem;
    font-weight: 750;
}

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

.data-error {
    color: var(--danger);
}

.data-error .secondary-button {
    color: var(--danger);
}

.data-section + .data-section {
    margin-top: 2.5rem;
}

.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    background: var(--white);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.data-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0.9rem;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--navy);
    background: var(--surface-strong);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compact-button {
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
}

.danger-button {
    border: 1px solid #b42318;
    border-radius: 0.45rem;
    padding: 0.55rem 0.8rem;
    background: #fff5f4;
    color: #b42318;
    font-weight: 750;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.field-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--navy);
    font-weight: 750;
}

.field-input {
    width: min(100%, 42rem);
    min-height: 2.75rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    padding: 0.55rem 0.7rem;
    background: var(--white);
    color: var(--navy);
}

.compact-input {
    min-width: 15rem;
}

.decision-box {
    display: grid;
    gap: 0.55rem;
}

.status-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    background: #e8f5f3;
    color: #086d66;
    font-size: 0.8rem;
    font-weight: 750;
}

.status-pill.status-deleted {
    background: #f3f4f6;
    color: #59636e;
}

.status-pill.status-face-pending {
    background: #fff7df;
    color: #9a6700;
}

.status-pill.status-face-approved {
    background: #e8f5f3;
    color: #086d66;
}

.status-pill.status-face-rejected {
    background: #fff1f0;
    color: #b42318;
}

.status-pill.status-face-missing {
    background: var(--surface-strong);
    color: var(--muted);
}

.soft-deleted-row td {
    background: #fafbfc;
    color: #59636e;
}

.user-operation-error {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #f0b4ae;
    border-radius: 0.55rem;
    background: #fff7f6;
}

.user-table {
    min-width: 1080px;
}

.user-assignment-id {
    display: inline-block;
    max-width: 5.5rem;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-row-actions {
    min-width: 9.5rem;
}

.restore-button {
    color: var(--teal);
    border-color: #91c9c3;
}

.user-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(12, 39, 60, 0.48);
}

.user-dialog {
    width: min(100%, 34rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.5rem;
    background: var(--white);
    box-shadow: 0 1.5rem 4rem rgba(12, 39, 60, 0.24);
}

.user-dialog h2 {
    margin: 0.25rem 0 1rem;
    color: var(--navy);
}

.dialog-fields {
    display: grid;
    gap: 0.45rem;
}

.dialog-fields .field-label:not(:first-child) {
    margin-top: 0.55rem;
}

.dialog-error {
    margin: 1rem 0 0;
}

.user-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.danger-eyebrow {
    color: var(--danger);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) 10rem auto;
    gap: 0.75rem;
    align-items: end;
    margin-top: 1rem;
}

.user-create-form {
    grid-template-columns: repeat(4, minmax(10rem, 1fr)) auto;
    margin-bottom: 1.5rem;
}

.number-input,
.score-input {
    max-width: 10rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-list {
    display: grid;
    gap: 0.75rem;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 1rem;
    background: var(--white);
}

.notification-item.unread {
    border-left: 4px solid var(--teal);
    background: #f3fbfa;
}

.notification-item h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.notification-item p {
    margin: 0 0 0.35rem;
}

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

.management-form {
    display: grid;
    align-content: start;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.25rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-width: 46rem;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.1);
}

.management-form h2 {
    margin: 0 0 0.25rem;
}

.form-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.map-picker-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.classroom-map {
    width: 100%;
    height: 22rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-strong);
}

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

.coordinate-readout {
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: var(--surface);
}

.coordinate-readout span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.coordinate-readout output {
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    font-weight: 750;
}

.map-error {
    margin: 0;
}

.success-message {
    color: #08735f;
    font-weight: 700;
}

.text-link {
    color: var(--teal);
    font-weight: 700;
}

#blazor-error-ui {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    display: none;
    max-width: 40rem;
    margin: auto;
    border: 1px solid #e2b4b4;
    border-radius: 0.5rem;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    background: #fff4f4;
    color: var(--danger);
}

#blazor-error-ui a {
    color: inherit;
    font-weight: 750;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.55rem;
    right: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

.blazor-error-boundary {
    padding: 1rem;
    border-left: 4px solid var(--danger);
    background: #fff4f4;
    color: var(--danger);
}

.blazor-error-boundary::after {
    content: "Ứng dụng gặp sự cố.";
}

@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .auth-intro h1 {
        font-size: clamp(2.3rem, 10vw, 3.6rem);
    }
}

@media (max-width: 680px) {
    .home-web-hero {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .hero-visual {
        display: none;
    }
    .web-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-details > div {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .dashboard-details,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

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

    .classroom-map {
        height: 18rem;
    }
}

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

.success-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.academic-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: "📖";
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--navy);
    padding-left: 2.4rem;
}

.tab-button:hover::before {
    opacity: 1;
    transform: translateY(-50%);
}

.tab-button.active {
    background: var(--teal-soft);
    color: var(--teal);
}

.management-form-container {
    margin-bottom: 2.5rem;
}

.workspace-page {
    min-width: 0;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: var(--navy);
    font-weight: 700;
}

.spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 4px solid var(--teal-soft);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.25rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(30, 58, 138, 0.15);
}

.metric-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.8rem;
    background: var(--teal-soft);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 850;
    color: var(--navy);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
