:root {
    --bg: #eef4ff;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --surface-muted: #edf3ff;
    --border: rgba(19, 60, 139, 0.14);
    --text: #0f1b46;
    --muted: #59719a;
    --primary: #133c8b;
    --primary-dark: #09124a;
    --secondary: #4c82f7;
    --sidebar-bg: #09124a;
    --sidebar-accent: #f8ef5c;
    --primary-rgb: 19, 60, 139;
    --primary-dark-rgb: 9, 18, 74;
    --secondary-rgb: 76, 130, 247;
    --sidebar-rgb: 9, 18, 74;
    --success: #166534;
    --danger: #b42318;
    --warning: #b45309;
    --shadow: 0 24px 60px rgba(19, 37, 89, 0.12);
    --radius: 22px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(var(--secondary-rgb), 0.18), transparent 24%),
        linear-gradient(180deg, #f5f8ff 0%, #e8eefc 100%);
    font-family: Aptos, "Segoe UI", "Trebuchet MS", sans-serif;
}

body[data-js-ready="true"] {
    overflow-x: clip;
}

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

.app-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    background: var(--sidebar-bg);
    color: #f8fbff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar form {
    margin-top: auto;
    padding-top: 18px;
}

.brand-card {
    margin-bottom: 18px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-brand-mark,
.sidebar-profile-avatar,
.sidebar-link-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-brand-mark {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-color: rgba(var(--secondary-rgb), 0.48);
}

.brand-card h1,
.topbar h1,
.login-panel h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.02em;
}

.brand-card p,
.muted,
.eyebrow,
.meta,
.table-note {
    color: var(--muted);
}

.sidebar-brand-copy h1 {
    font-size: 2rem;
    font-weight: 500;
    color: #ffffff;
}

.sidebar-brand-copy p {
    margin: 6px 0 0;
    color: rgba(232, 238, 255, 0.74);
    font-size: 0.94rem;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 6px 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-profile-avatar svg,
.sidebar-link-icon svg {
    width: 22px;
    height: 22px;
}

.sidebar-profile-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.sidebar-profile-copy strong {
    color: var(--sidebar-accent);
    font-size: 0.98rem;
    font-weight: 600;
}

.sidebar-profile-copy span,
.sidebar-profile-copy small {
    color: rgba(232, 238, 255, 0.8);
    font-size: 0.88rem;
}

.sidebar-sections {
    display: grid;
    gap: 4px;
}

.sidebar-section,
.sidebar-link {
    display: block;
}

.sidebar-link,
.sidebar-section-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 8px;
    color: rgba(245, 248, 255, 0.94);
    background: transparent;
    text-align: left;
    border-radius: 16px;
    transition: background 0.18s ease, color 0.18s ease;
}

.sidebar-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(245, 248, 255, 0.88);
    border-bottom: 2px solid rgba(245, 248, 255, 0.88);
    transform: rotate(-45deg);
    transition: transform 0.2s ease, border-color 0.18s ease;
}

.sidebar-section[data-open="true"] .sidebar-chevron {
    transform: rotate(45deg);
}

.sidebar-section-body {
    display: grid;
    gap: 4px;
    padding: 0 0 8px 74px;
}

.sidebar-section-body[hidden] {
    display: none !important;
}

.sidebar-link:hover,
.sidebar-link.active,
.sidebar-section-trigger:hover,
.sidebar-section.is-active > .sidebar-section-trigger {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-accent);
}

.sidebar-link-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-link-icon {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.96);
}

.sidebar-link:hover .sidebar-link-icon,
.sidebar-link.active .sidebar-link-icon,
.sidebar-section-trigger:hover .sidebar-link-icon,
.sidebar-section.is-active > .sidebar-section-trigger .sidebar-link-icon {
    color: var(--sidebar-accent);
}

.sidebar-link:hover .sidebar-chevron,
.sidebar-link.active .sidebar-chevron,
.sidebar-section-trigger:hover .sidebar-chevron,
.sidebar-section.is-active > .sidebar-section-trigger .sidebar-chevron {
    border-color: var(--sidebar-accent);
}

.sidebar-link-label {
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.3;
}

.sidebar-sub-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    color: rgba(232, 238, 255, 0.88);
    transition: color 0.18s ease, transform 0.18s ease;
}

.sidebar-sub-link:hover,
.sidebar-sub-link.active {
    color: var(--sidebar-accent);
    transform: translateX(2px);
}

.sidebar-sub-dot {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 999px;
    border: 2px solid currentColor;
    opacity: 0.92;
}

.sidebar-sub-label {
    font-size: 0.98rem;
    line-height: 1.3;
}

.sidebar-logout {
    justify-content: flex-start;
    padding-left: 18px;
}

.app-main {
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.topbar h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.user-chip {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}

.year-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: 18px;
    backdrop-filter: blur(12px);
}

.year-switcher label {
    font-size: 0.92rem;
    color: var(--muted);
    white-space: nowrap;
}

.year-switcher select {
    min-width: 190px;
    padding: 10px 12px;
}

.page-grid,
.cards-grid {
    display: grid;
    gap: 18px;
}

.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 20px;
}

.panel,
.metric-card,
.login-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.panel {
    padding: 22px;
}

.metric-card {
    padding: 20px;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    font-family: Georgia, "Times New Roman", serif;
}

.metric-card.primary {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.96), rgba(var(--primary-dark-rgb), 0.95));
    color: #f7fbff;
}

.metric-card.primary .muted {
    color: rgba(231, 240, 255, 0.76);
}

.panel:hover,
.metric-card:hover,
.login-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb), 0.18);
    box-shadow: 0 28px 70px rgba(var(--primary-dark-rgb), 0.16);
}

.section-head,
.table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.section-head h2,
.panel h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.btn,
button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    transition: transform 0.2s ease, background 0.2s ease;
    position: relative;
    white-space: nowrap;
}

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

.btn-icon {
    width: 1.95rem;
    height: 1.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(96, 78, 56, 0.08);
}

.btn-icon svg {
    width: 1rem;
    height: 1rem;
}

.btn-primary {
    color: #fff6f0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-secondary {
    background: rgba(var(--secondary-rgb), 0.12);
    color: var(--secondary);
}

.btn-danger {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.btn-primary .btn-icon {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.18);
}

.btn-secondary .btn-icon {
    background: rgba(var(--secondary-rgb), 0.1);
    border-color: rgba(var(--secondary-rgb), 0.12);
}

.btn-danger .btn-icon {
    background: rgba(180, 35, 24, 0.12);
    border-color: rgba(180, 35, 24, 0.12);
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
    min-width: 0;
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(96, 78, 56, 0.09);
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge.success {
    color: var(--success);
    background: rgba(22, 101, 52, 0.12);
}

.badge.warning {
    color: var(--warning);
    background: rgba(180, 83, 9, 0.12);
}

.badge.danger {
    color: var(--danger);
    background: rgba(180, 35, 24, 0.12);
}

.badge.info {
    color: var(--secondary);
    background: rgba(var(--secondary-rgb), 0.12);
}

.status-banner,
.error-banner {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 18px;
}

.status-banner {
    background: rgba(22, 101, 52, 0.12);
    color: var(--success);
}

.error-banner {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
}

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

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
}

select[multiple] {
    min-height: 148px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.actions form {
    margin: 0;
    display: inline-flex;
}

.table-wrap .actions {
    justify-content: flex-end;
    gap: 8px;
}

.table-wrap .actions .btn {
    padding: 10px 14px;
}

.table-action-btn.table-action-icon-only {
    width: 50px;
    min-width: 50px;
    height: 50px;
    padding: 0;
    gap: 0;
    border-radius: 16px;
    font-size: 0;
}

.table-action-btn.table-action-icon-only .btn-icon {
    width: auto;
    height: auto;
    background: transparent;
    border: 0;
}

.table-action-btn.table-action-icon-only .btn-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.split {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
}

.empty-state {
    padding: 24px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--muted);
    text-align: center;
}

.pagination {
    margin-top: 16px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.92rem;
}

.pagination-list {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.pagination-link:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--primary-rgb), 0.24);
    background: rgba(var(--secondary-rgb), 0.1);
}

.pagination-link.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: #ffffff;
}

.pagination-link.is-disabled {
    opacity: 0.54;
    cursor: default;
}

.field .single-site-display {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
}

.field .single-site-helper {
    display: block;
    margin-top: 8px;
}

.field select.is-auto-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.btn.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1fr 0.9fr;
    overflow: hidden;
}

.login-aside {
    padding: 36px;
    color: #fff6ef;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 52%, var(--secondary) 100%);
}

.login-form {
    padding: 36px;
}

.hero-points {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.hero-point {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 24px;
    margin-bottom: 20px;
    padding: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 26%),
        linear-gradient(145deg, rgba(var(--primary-dark-rgb), 0.96), rgba(var(--primary-rgb), 0.92) 46%, rgba(var(--secondary-rgb), 0.86) 100%);
    color: #fff9f4;
}

.dashboard-hero::before,
.dashboard-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    filter: blur(1px);
}

.dashboard-hero::before {
    width: 220px;
    height: 220px;
    top: -80px;
    right: -20px;
}

.dashboard-hero::after {
    width: 160px;
    height: 160px;
    bottom: -70px;
    left: 40%;
}

.dashboard-hero h2 {
    position: relative;
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fffaf7;
}

.dashboard-hero .eyebrow,
.dashboard-hero .meta,
.dashboard-hero .table-note,
.dashboard-hero .hero-summary,
.dashboard-hero small {
    color: rgba(255, 245, 236, 0.78);
}

.hero-summary {
    position: relative;
    max-width: 62ch;
    margin: 0;
    line-height: 1.65;
}

.hero-highlights {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.hero-highlight,
.hero-stat-card,
.analytics-chip,
.site-card,
.insight-item,
.cycle-chip,
.weekday-card {
    border: 1px solid rgba(96, 78, 56, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.hero-highlight {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.hero-highlight strong,
.hero-stat-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.4rem;
    font-family: Georgia, "Times New Roman", serif;
    color: #fffdf9;
}

.hero-highlight span,
.hero-stat-card small {
    color: rgba(255, 245, 236, 0.8);
}

.dashboard-hero-side {
    position: relative;
    display: grid;
    gap: 14px;
    align-content: center;
    justify-items: end;
}

.hero-stat-stack {
    width: 100%;
    display: grid;
    gap: 12px;
}

.hero-stat-card {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.metric-card-shell {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: center;
}

.metric-footnote {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.radial-meter {
    --value: 0%;
    --meter-color: var(--primary);
    position: relative;
    display: grid;
    place-items: center;
    width: 118px;
    aspect-ratio: 1;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: conic-gradient(var(--meter-color) 0 var(--value), rgba(47, 36, 26, 0.08) var(--value) 100%);
}

.radial-meter::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 0 0 1px rgba(96, 78, 56, 0.08);
}

.dashboard-hero .radial-meter::before {
    background: rgba(var(--primary-dark-rgb), 0.86);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.radial-meter-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 28px);
    padding: 4px;
    text-align: center;
}

.radial-meter.large .radial-meter-content {
    width: calc(100% - 38px);
    gap: 8px;
}

.radial-meter-content span,
.radial-meter-content small {
    position: relative;
    text-align: center;
}

.radial-meter-content span {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.radial-meter-content small {
    display: block;
    max-width: 88px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1.22;
    color: #4f6694;
}

.dashboard-hero .radial-meter-content span,
.dashboard-hero .radial-meter-content small,
.metric-card.primary .radial-meter-content span,
.metric-card.primary .radial-meter-content small {
    color: #fffaf6;
}

.radial-meter.large {
    width: 176px;
}

.radial-meter.large::before {
    inset: 16px;
}

.radial-meter.large .radial-meter-content span {
    font-size: 1.9rem;
}

.radial-meter.large .radial-meter-content small {
    max-width: 120px;
    font-size: 0.78rem;
}

.metric-card.primary .radial-meter::before {
    background: rgba(var(--primary-dark-rgb), 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.meter-primary {
    --meter-color: #a6c3ff;
}

.meter-secondary {
    --meter-color: var(--secondary);
}

.meter-success {
    --meter-color: var(--success);
}

.meter-warning {
    --meter-color: var(--warning);
}

.dashboard-analytics-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.analytics-panel {
    min-height: 100%;
    min-width: 0;
}

.span-7 {
    grid-column: span 7;
}

.span-6 {
    grid-column: span 6;
}

.span-5 {
    grid-column: span 5;
}

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

.analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.analytics-chip {
    padding: 16px;
}

.analytics-chip span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.analytics-chip strong {
    font-size: 1.15rem;
}

.meter-list,
.site-card-stack,
.insight-list,
.cycle-distribution {
    display: grid;
    gap: 12px;
}

.meter-card,
.site-card,
.insight-item,
.cycle-chip {
    padding: 16px;
}

.meter-head,
.insight-item-head,
.site-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.site-card h3,
.insight-item h3 {
    margin: 0 0 4px;
    font-size: 1.02rem;
    font-family: Georgia, "Times New Roman", serif;
}

.bar-track {
    width: 100%;
    height: 11px;
    border-radius: 999px;
    background: rgba(47, 36, 26, 0.08);
    overflow: hidden;
}

.bar-track.compact {
    height: 9px;
}

.bar-track.micro {
    height: 8px;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.bar-fill.success {
    background: linear-gradient(135deg, #2f9e44, #166534);
}

.bar-fill.warning {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.bar-fill.info,
.bar-fill.secondary {
    background: linear-gradient(135deg, var(--secondary), #0b7e80);
}

.bar-fill.danger {
    background: linear-gradient(135deg, #d95d4f, #b42318);
}

.mini-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.mini-bar-item {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.mini-bar-track {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), rgba(var(--secondary-rgb), 0.12));
}

.mini-bar-track span {
    width: 100%;
    min-height: 12px;
    border-radius: 999px 999px 16px 16px;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.95), rgba(var(--secondary-rgb), 0.88));
}

.site-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.weekday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.weekday-card {
    padding: 16px 14px;
    text-align: center;
}

.weekday-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
}

.weekday-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.weekday-card.today {
    border-color: rgba(var(--secondary-rgb), 0.26);
    background: rgba(var(--secondary-rgb), 0.08);
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.definition-card {
    padding: 18px;
    border: 1px solid rgba(96, 78, 56, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.definition-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.05rem;
    line-height: 1.45;
}

.definition-card .table-note:last-child {
    display: block;
    margin-top: 8px;
}

.notification-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 200;
    width: min(380px, calc(100vw - 32px));
    display: grid;
    gap: 12px;
    pointer-events: none;
}

.toast {
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    padding: 16px 18px 18px;
    border-radius: 20px;
    border: 1px solid rgba(96, 78, 56, 0.12);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 60px rgba(var(--primary-dark-rgb), 0.18);
    backdrop-filter: blur(16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

body[data-js-ready="true"] .toast {
    opacity: 0;
    transform: translateY(-10px) translateX(18px);
}

body[data-js-ready="true"] .toast.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
}

.toast-success::before {
    background: var(--success);
}

.toast-info::before {
    background: var(--secondary);
}

.toast-warning::before {
    background: var(--warning);
}

.toast-error::before {
    background: var(--danger);
}

.toast-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.toast-head strong {
    font-size: 1rem;
}

.toast p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.toast-dismiss {
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
}

.has-tooltip {
    position: relative;
}

@media (hover: hover) {
    .has-tooltip::before,
    .has-tooltip::after {
        position: absolute;
        left: 50%;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease, transform 0.18s ease;
        z-index: 40;
    }

    .has-tooltip::before {
        content: "";
        bottom: calc(100% + 8px);
        width: 10px;
        height: 10px;
        background: rgba(47, 36, 26, 0.94);
        border-radius: 2px;
        transform: translateX(-50%) rotate(45deg) translateY(6px);
    }

    .has-tooltip::after {
        content: attr(data-tooltip);
        bottom: calc(100% + 12px);
        max-width: 240px;
        padding: 8px 12px;
        border-radius: 12px;
        background: rgba(47, 36, 26, 0.94);
        color: #fff7ef;
        font-size: 0.78rem;
        line-height: 1.4;
        white-space: normal;
        box-shadow: 0 18px 35px rgba(25, 17, 11, 0.22);
        transform: translateX(-50%) translateY(6px);
    }

    .has-tooltip:hover::before,
    .has-tooltip:hover::after,
    .has-tooltip:focus-visible::before,
    .has-tooltip:focus-visible::after {
        opacity: 1;
    }

    .has-tooltip:hover::before,
    .has-tooltip:focus-visible::before {
        transform: translateX(-50%) rotate(45deg);
    }

    .has-tooltip:hover::after,
    .has-tooltip:focus-visible::after {
        transform: translateX(-50%) translateY(0);
    }
}

.toast-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}

.toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.92), rgba(var(--secondary-rgb), 0.92));
    transform-origin: left center;
    animation-name: toast-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.confirm-dialog {
    padding: 0;
    border: 0;
    width: min(520px, calc(100vw - 32px));
    max-width: 100%;
    background: transparent;
    box-shadow: none;
}

.confirm-dialog::backdrop {
    background: rgba(47, 36, 26, 0.36);
    backdrop-filter: blur(5px);
}

.confirm-dialog-card {
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(96, 78, 56, 0.12);
    box-shadow: 0 32px 80px rgba(var(--primary-dark-rgb), 0.24);
}

.confirm-dialog-copy h2 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
}

.confirm-dialog-copy p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.notification-panel {
    margin-bottom: 20px;
}

.notice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.inline-notice {
    position: relative;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(96, 78, 56, 0.1);
    background: rgba(255, 255, 255, 0.75);
    overflow: hidden;
}

.inline-notice::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    opacity: 0.95;
}

.inline-notice.success::before {
    background: var(--success);
}

.inline-notice.info::before {
    background: var(--secondary);
}

.inline-notice.warning::before {
    background: var(--warning);
}

.inline-notice.error::before {
    background: var(--danger);
}

.inline-notice-label {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(47, 36, 26, 0.06);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.inline-notice h3 {
    margin: 0 0 10px;
    font-size: 1.08rem;
    font-family: Georgia, "Times New Roman", serif;
}

.inline-notice p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

body[data-js-ready="true"] .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-js-ready="true"] .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

body[data-js-ready="true"] .panel.reveal.is-visible:hover,
body[data-js-ready="true"] .metric-card.reveal.is-visible:hover,
body[data-js-ready="true"] .login-panel.reveal.is-visible:hover {
    transform: translateY(-4px);
}

body[data-js-ready="true"] .reveal[data-reveal-delay="1"] {
    transition-delay: 0.05s;
}

body[data-js-ready="true"] .reveal[data-reveal-delay="2"] {
    transition-delay: 0.1s;
}

body[data-js-ready="true"] .reveal[data-reveal-delay="3"] {
    transition-delay: 0.15s;
}

body[data-js-ready="true"] .reveal[data-reveal-delay="4"] {
    transition-delay: 0.2s;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .dashboard-hero,
    .dashboard-analytics-grid {
        grid-template-columns: 1fr;
    }

    .span-7,
    .span-6,
    .span-5,
    .span-12 {
        grid-column: span 1;
    }

    .split,
    .login-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-main,
    .sidebar,
    .login-form,
    .login-aside {
        padding: 20px;
    }

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

    .topbar,
    .section-head,
    .table-toolbar,
    .pagination-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-card-shell,
    .meter-head,
    .insight-item-head,
    .site-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-card-meta {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-side {
        justify-items: flex-start;
    }

    .notification-stack {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.portal-shell {
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(var(--secondary-rgb), 0.16), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 243, 255, 0.94));
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
    padding: 18px 20px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(var(--primary-rgb), 0.09);
    box-shadow: 0 18px 42px rgba(var(--primary-dark-rgb), 0.08);
}

.portal-topbar-main,
.portal-topbar-side {
    display: flex;
    align-items: center;
    gap: 18px;
}

.portal-topbar-side {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.portal-brand strong {
    display: block;
    font-size: 1.1rem;
}

.portal-brand small {
    color: var(--muted);
}

.portal-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-nav-link {
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible,
.portal-nav-link.active {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.portal-year-switcher {
    min-width: 210px;
}

.portal-student-chip {
    min-width: 190px;
    padding: 12px 16px;
    border-radius: 20px;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.08);
}

.portal-student-chip strong,
.portal-student-chip span,
.portal-student-chip small {
    display: block;
}

.portal-student-chip span,
.portal-student-chip small {
    color: var(--muted);
}

.portal-main {
    display: grid;
    gap: 22px;
}

.portal-inline-notice {
    margin-bottom: 18px;
}

.portal-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 28px;
    border-radius: 30px;
    color: #fff;
    background: linear-gradient(135deg, rgba(var(--primary-dark-rgb), 0.97), rgba(var(--primary-rgb), 0.92));
    box-shadow: 0 22px 52px rgba(var(--primary-dark-rgb), 0.18);
}

.portal-hero .muted {
    color: rgba(255, 255, 255, 0.78);
}

.portal-hero-badge {
    min-width: 220px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.portal-hero-badge strong,
.portal-hero-badge span {
    display: block;
}

.portal-hero-badge span {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.78);
}

.portal-stat-grid,
.portal-card-grid,
.portal-doc-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.portal-list {
    display: grid;
    gap: 12px;
}

.portal-list-item,
.portal-homework-card,
.portal-doc-card,
.portal-submission-card,
.portal-question-card,
.homework-question-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    background: rgba(255, 255, 255, 0.88);
}

.portal-list-item p,
.portal-homework-card p,
.portal-doc-card p,
.portal-submission-card p,
.portal-question-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.portal-list-item,
.portal-homework-head,
.portal-question-head,
.portal-submission-head,
.homework-question-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.portal-list-side,
.portal-homework-meta {
    display: grid;
    gap: 6px;
    color: var(--muted);
    text-align: right;
}

.portal-homework-card h3,
.portal-doc-card strong {
    margin: 14px 0 0;
    font-size: 1.08rem;
}

.portal-homework-type {
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-slot {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(var(--primary-rgb), 0.05);
}

.portal-slot + .portal-slot {
    margin-top: 8px;
}

.portal-slot span,
.portal-slot small {
    color: var(--muted);
}

.portal-option-list {
    display: grid;
    gap: 10px;
}

.portal-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(var(--primary-rgb), 0.04);
}

.portal-question-card textarea {
    min-height: 120px;
}

.homework-builder-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.homework-question-stack {
    display: grid;
    gap: 16px;
}

.homework-question-card textarea {
    min-height: 110px;
}

.portal-login-shell .login-panel {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.95fr);
}

.portal-login-aside {
    background: linear-gradient(160deg, rgba(var(--primary-dark-rgb), 0.98), rgba(var(--primary-rgb), 0.92));
}

@media (max-width: 1080px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-topbar-main,
    .portal-topbar-side,
    .portal-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .portal-shell {
        padding: 16px;
    }

    .portal-nav {
        width: 100%;
    }

    .portal-nav-link {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }
}

.portal-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
}

.portal-header {
    margin-bottom: 24px;
}

.portal-header-banner {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 34px;
    color: #f8fbff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(var(--primary-dark-rgb), 0.98), rgba(var(--primary-rgb), 0.94) 52%, rgba(var(--secondary-rgb), 0.84) 100%);
    box-shadow: 0 28px 72px rgba(var(--primary-dark-rgb), 0.18);
}

.portal-header-top,
.portal-header-body,
.portal-nav-bar,
.portal-footer,
.portal-identity-meta {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.portal-header-top {
    align-items: center;
}

.portal-header-support {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.portal-header-support span {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(247, 251, 255, 0.86);
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-header-body {
    align-items: end;
    margin-top: 26px;
}

.portal-header-copy {
    max-width: 760px;
}

.portal-header-copy .eyebrow,
.portal-header-copy .muted {
    color: rgba(247, 251, 255, 0.76);
}

.portal-header-copy h1 {
    margin: 0;
    font-size: clamp(2.1rem, 3vw, 3.2rem);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.08;
}

.portal-header-description {
    max-width: 62ch;
    margin: 14px 0 0;
    color: rgba(247, 251, 255, 0.84);
    line-height: 1.65;
}

.portal-brand {
    color: #f8fbff;
}

.portal-brand strong {
    font-size: 1.3rem;
    line-height: 1.1;
}

.portal-brand small {
    color: rgba(247, 251, 255, 0.72);
}

.portal-brand-mark {
    width: 60px;
    height: 60px;
    border-radius: 22px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.portal-identity-card {
    min-width: 310px;
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
}

.portal-identity-card strong,
.portal-identity-card span,
.portal-identity-card small {
    display: block;
}

.portal-identity-card strong {
    font-size: 1.55rem;
}

.portal-identity-card span,
.portal-identity-card small {
    margin-top: 6px;
    color: rgba(247, 251, 255, 0.78);
}

.portal-identity-meta {
    margin-top: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.portal-identity-meta > span {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.portal-nav-bar {
    align-items: center;
    margin-top: -22px;
    padding: 14px 18px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    box-shadow: 0 20px 52px rgba(var(--primary-dark-rgb), 0.12);
}

.portal-nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-dark);
    font-weight: 700;
}

.portal-nav-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
}

.portal-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 18px;
    font-weight: 700;
    color: #4f6694;
    background: transparent;
    transform: none;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible {
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), 0.08);
}

.portal-nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 34px rgba(var(--primary-dark-rgb), 0.18);
}

.portal-nav-icon {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    align-items: center;
    justify-content: center;
}

.portal-nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
}

.portal-nav-link.active .portal-nav-count {
    background: rgba(255, 255, 255, 0.16);
}

.portal-hero {
    padding: 30px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 26%),
        linear-gradient(145deg, rgba(var(--primary-dark-rgb), 0.95), rgba(var(--primary-rgb), 0.88));
}

.portal-hero-badge {
    min-width: 260px;
}

.portal-main {
    display: grid;
    gap: 22px;
}

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

.portal-shortcut-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 170px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-shortcut-card .portal-nav-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.portal-shortcut-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 22px 44px rgba(var(--primary-dark-rgb), 0.1);
}

.portal-list-item.is-selected {
    border-color: rgba(var(--primary-rgb), 0.22);
    background: rgba(var(--secondary-rgb), 0.08);
}

.portal-conversation {
    display: grid;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
}

.portal-message-bubble,
.portal-notification-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.portal-message-bubble {
    max-width: 86%;
}

.portal-message-bubble.staff {
    margin-right: auto;
    background: rgba(var(--primary-rgb), 0.06);
}

.portal-message-bubble.portal {
    margin-left: auto;
    background: rgba(var(--secondary-rgb), 0.08);
}

.portal-message-meta,
.portal-notification-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.portal-message-meta span {
    color: var(--muted);
    font-size: 0.85rem;
}

.portal-message-bubble h3,
.portal-notification-card h3 {
    margin: 10px 0 0;
    font-size: 1.02rem;
}

.portal-message-bubble p,
.portal-notification-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.portal-notification-card.is-unread {
    border-color: rgba(var(--secondary-rgb), 0.24);
    background: rgba(var(--secondary-rgb), 0.08);
}

.portal-notification-card.is-read {
    opacity: 0.92;
}

.portal-page-hero {
    margin-bottom: 4px;
}

.portal-section-head {
    align-items: flex-start;
}

.portal-section-actions {
    display: flex;
    justify-content: flex-end;
}

.portal-notification-actions {
    margin-top: 14px;
}

.portal-footer {
    align-items: center;
    margin-top: 10px;
    padding: 20px 6px 4px;
    color: var(--muted);
}

.portal-footer strong {
    display: block;
    color: var(--text);
}

.portal-footer p {
    margin: 6px 0 0;
}

.portal-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

@media (max-width: 1200px) {
    .portal-header-body,
    .portal-nav-bar,
    .portal-footer,
    .portal-identity-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .portal-identity-card {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 860px) {
    .portal-grid,
    .portal-grid-3 {
        grid-template-columns: 1fr;
    }

    .portal-header-top,
    .portal-header-support {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-header-banner {
        padding: 22px;
        border-radius: 28px;
    }

    .portal-nav-bar {
        margin-top: 16px;
        align-items: stretch;
    }

    .portal-nav-toggle {
        display: inline-flex;
        justify-content: center;
    }

    .portal-nav-panel {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: 100%;
        padding-top: 14px;
    }

    .portal-nav-bar[data-open="true"] .portal-nav-panel {
        display: flex;
    }

    .portal-nav,
    .portal-logout-form {
        width: 100%;
    }

    .portal-nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .portal-logout-form .btn,
    .portal-section-actions .btn {
        width: 100%;
    }

    .portal-notification-head,
    .portal-list-item,
    .portal-homework-head,
    .portal-question-head,
    .portal-submission-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-list-side,
    .portal-homework-meta {
        width: 100%;
        text-align: left;
    }

    .portal-message-bubble,
    .portal-notification-card {
        max-width: 100%;
    }
}
