/* ═══════════════════════════════════════════════════════════
   DASHBOARDS — KPI grids, widget panels, activity feeds
   ═══════════════════════════════════════════════════════════ */

/* ── KPI Row ────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ── Widget Grid ────────────────────────────────────────── */
.widget-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

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

/* ── Panel Card ─────────────────────────────────────────── */
.panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-3);
}

.panel-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 1px;
}

.panel-body { padding: var(--space-5); }

.panel-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* ── Activity Feed ──────────────────────────────────────── */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-hover); }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.success { background: var(--success); }
.activity-dot.warning { background: var(--warning); }
.activity-dot.danger  { background: var(--danger); }

.activity-content { flex: 1; min-width: 0; }
.activity-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.4;
}
.activity-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Quick Stats Row ────────────────────────────────────── */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-3);
}

.stat-row:last-child { border-bottom: none; }

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.stat-value {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress-bar-wrap {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-2);
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    transition: width var(--transition-slow);
}

.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger  { background: var(--danger); }

/* ── Pending Actions ────────────────────────────────────── */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.action-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.action-item:last-child { border-bottom: none; }
.action-item:hover { background: var(--bg-hover); }

.action-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: grid;
    place-items: center;
    font-size: 15px;
    flex-shrink: 0;
}

.action-label {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 500;
}

.action-count {
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    color: var(--accent-primary);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .widget-grid { grid-template-columns: 1fr; }
    .widget-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
    .widget-grid-3 { grid-template-columns: 1fr; }
}

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

/* Tenant admin dashboard */
.tenant-admin-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
    gap: 1.5rem;
    padding: 2rem;
    margin-bottom: 1.75rem;
    overflow: hidden;
    border: 1px solid hsl(212 42% 85% / 0.8);
    border-radius: 2rem;
    background:
        radial-gradient(circle at top left, hsl(206 100% 96% / 0.95), transparent 32%),
        radial-gradient(circle at bottom right, hsl(171 72% 92% / 0.7), transparent 30%),
        linear-gradient(135deg, hsl(0 0% 100% / 0.96), hsl(214 44% 97% / 0.96));
    box-shadow:
        0 24px 60px hsl(218 34% 24% / 0.08),
        inset 0 1px 0 hsl(0 0% 100% / 0.88);
}

.tenant-admin-hero::before,
.tenant-admin-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.tenant-admin-hero::before {
    top: -4rem;
    right: -2rem;
    width: 14rem;
    height: 14rem;
    background: radial-gradient(circle, hsl(213 88% 60% / 0.16), transparent 72%);
}

.tenant-admin-hero::after {
    bottom: -5rem;
    left: -4rem;
    width: 16rem;
    height: 16rem;
    background: radial-gradient(circle, hsl(172 67% 45% / 0.12), transparent 74%);
}

.tenant-admin-hero__content,
.tenant-admin-hero__aside {
    position: relative;
    z-index: 1;
}

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

.tenant-admin-hero__eyebrow,
.tenant-admin-panel__eyebrow,
.tenant-admin-kpi-card__label,
.tenant-admin-location__summary-label,
.tenant-admin-hero__aside-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: hsl(216 20% 46%);
}

.tenant-admin-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    border: 1px solid hsl(214 68% 86%);
    background: hsl(0 0% 100% / 0.82);
    color: hsl(217 50% 38%);
    font-size: 0.82rem;
    font-weight: 700;
}

.tenant-admin-hero__badge-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, hsl(214 88% 56%), hsl(172 72% 42%));
    box-shadow: 0 0 0 4px hsl(208 100% 96%);
}

.tenant-admin-hero__title {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1;
    color: hsl(222 32% 16%);
}

.tenant-admin-hero__title span {
    display: inline-block;
    color: hsl(var(--accent-primary-hsl));
}

.tenant-admin-hero__copy {
    max-width: 48rem;
    margin-top: 0.9rem;
    font-size: 1rem;
    line-height: 1.7;
    color: hsl(217 18% 40%);
}

.tenant-admin-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.35rem;
}

.tenant-admin-hero__stat,
.tenant-admin-kpi-card,
.tenant-admin-panel,
.tenant-admin-stat,
.tenant-admin-action,
.tenant-admin-location__summary,
.tenant-admin-location__item,
.tenant-admin-timeline__item,
.tenant-admin-spotlight {
    background: linear-gradient(180deg, hsl(0 0% 100% / 0.97), hsl(214 35% 98% / 0.96));
    border: 1px solid hsl(214 30% 88% / 0.95);
    box-shadow: 0 16px 40px hsl(220 25% 23% / 0.06);
}

.tenant-admin-hero__stat {
    padding: 1rem 1.05rem;
    border-radius: 1.25rem;
}

.tenant-admin-hero__stat-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: hsl(216 15% 48%);
}

.tenant-admin-hero__stat-value {
    display: block;
    margin-top: 0.55rem;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    /* color: hsl(222 30% 18%); */
}

.tenant-admin-hero__aside {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.4rem;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, hsl(220 43% 18%), hsl(217 40% 14%));
    box-shadow: 0 22px 44px hsl(222 44% 14% / 0.22);
}

.tenant-admin-hero__aside-label {
    color: hsl(214 80% 78%);
}

.tenant-admin-hero__aside-title {
    font-family: var(--font-display);
    font-size: 1.55rem;
    line-height: 1.2;
    color: hsl(0 0% 100%);
}

.tenant-admin-hero__aside-copy {
    font-size: 0.94rem;
    line-height: 1.65;
    color: hsl(213 35% 82%);
}

.tenant-admin-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.tenant-admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.tenant-admin-kpi-card,
.tenant-admin-panel {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
}

.tenant-admin-kpi-card {
    padding: 1.25rem;
}

.tenant-admin-kpi-card::before,
.tenant-admin-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, hsl(var(--tenant-accent-hsl, 215 85% 55%)), transparent 72%);
}

.tenant-admin-kpi-card::after,
.tenant-admin-panel::after {
    content: "";
    position: absolute;
    inset: auto -18% -58% 42%;
    height: 120px;
    background: radial-gradient(circle, hsl(var(--tenant-accent-hsl, 215 85% 55%) / 0.14), transparent 68%);
    pointer-events: none;
}

.tenant-admin-kpi-card--blue { --tenant-accent-hsl: 214 88% 56%; }
.tenant-admin-kpi-card--slate { --tenant-accent-hsl: 216 18% 42%; }
.tenant-admin-kpi-card--amber { --tenant-accent-hsl: 35 93% 52%; }
.tenant-admin-kpi-card--emerald { --tenant-accent-hsl: 160 84% 38%; }
.tenant-admin-kpi-card--violet { --tenant-accent-hsl: 262 70% 58%; }
.tenant-admin-kpi-card--rose { --tenant-accent-hsl: 350 82% 58%; }

.tenant-admin-kpi-card__value {
    margin-top: 0.85rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.65rem);
    line-height: 1;
    color: hsl(222 30% 18%);
}

.tenant-admin-kpi-card__meta {
    margin-top: 0.7rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: hsl(217 16% 42%);
}

.tenant-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
    gap: 1.1rem;
}

.tenant-admin-panel {
    padding: 1.45rem;
}

.tenant-admin-panel--wide {
    grid-column: span 2;
}

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

.tenant-admin-panel__title {
    margin-top: 0.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.28rem, 1.8vw, 1.6rem);
    line-height: 1.15;
    color: hsl(222 28% 18%);
}

.tenant-admin-panel__copy {
    margin-top: 0.55rem;
    max-width: 42rem;
    font-size: 0.94rem;
    line-height: 1.65;
    color: hsl(217 16% 42%);
}

.tenant-admin-panel--hero {
    min-height: 255px;
}

.tenant-admin-spotlight {
    flex-shrink: 0;
    min-width: 148px;
    padding: 1rem 1.05rem;
    border-radius: 1.2rem;
    text-align: right;
}

.tenant-admin-spotlight__label,
.tenant-admin-spotlight__meta {
    display: block;
    font-size: 0.78rem;
    color: hsl(216 14% 48%);
}

.tenant-admin-spotlight__value {
    display: block;
    margin: 0.45rem 0;
    font-family: var(--font-display);
    font-size: 2.3rem;
    line-height: 1;
    color: hsl(var(--accent-primary-hsl));
}

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

.tenant-admin-stat {
    padding: 1rem;
    border-radius: 1.15rem;
}

.tenant-admin-stat__label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(216 15% 48%);
}

.tenant-admin-stat__value {
    display: block;
    margin-top: 0.6rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: hsl(222 30% 18%);
}

.tenant-admin-meter {
    margin-top: 1rem;
    height: 0.8rem;
    border-radius: 999px;
    background: hsl(214 33% 91%);
    overflow: hidden;
}

.tenant-admin-meter__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, hsl(211 87% 56%), hsl(170 72% 41%));
}

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

.tenant-admin-action {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    min-height: 106px;
    padding: 1.05rem 1rem;
    border-radius: 1.15rem;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tenant-admin-action::after {
    content: "\2192";
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: hsl(214 40% 58%);
    font-size: 1rem;
    transition: transform 160ms ease, color 160ms ease;
}

.tenant-admin-action:hover {
    transform: translateY(-2px);
    border-color: hsl(var(--accent-primary-hsl) / 0.28);
    box-shadow: 0 20px 32px hsl(220 26% 20% / 0.09);
}

.tenant-admin-action:hover::after {
    color: hsl(var(--accent-primary-hsl));
    transform: translateX(2px);
}

.tenant-admin-action__label {
    max-width: calc(100% - 1.5rem);
    font-size: 1rem;
    font-weight: 800;
    color: hsl(222 28% 18%);
}

.tenant-admin-action__meta {
    max-width: 18rem;
    font-size: 0.86rem;
    line-height: 1.55;
    color: hsl(217 16% 42%);
}

.tenant-admin-chart-wrap {
    position: relative;
    min-height: 290px;
}

.tenant-admin-chart-wrap--doughnut {
    min-height: 265px;
}

.tenant-admin-switches {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem;
    border-radius: 999px;
    background: hsl(216 33% 95%);
    border: 1px solid hsl(214 30% 88%);
}

.tenant-admin-switch {
    border: 0;
    background: transparent;
    color: hsl(217 16% 42%);
    padding: 0.56rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.tenant-admin-switch.is-active {
    background: hsl(var(--accent-primary-hsl) / 0.12);
    color: hsl(var(--accent-primary-hsl));
}

.tenant-admin-location {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(200px, 0.85fr);
    gap: 1rem;
    align-items: stretch;
}

.tenant-admin-location__stage {
    position: relative;
    min-height: 340px;
    border-radius: 1.35rem;
    overflow: hidden;
    border: 1px solid hsl(214 32% 88%);
    background:
        radial-gradient(circle at top left, rgba(116, 165, 255, 0.14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 159, 119, 0.08), transparent 28%),
        linear-gradient(180deg, hsl(212 40% 97%), hsl(213 32% 94%));
}

.tenant-admin-location__live-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tenant-admin-location__live-map .leaflet-control-attribution,
.tenant-admin-location__live-map .leaflet-control-zoom a {
    font-family: inherit;
}

.tenant-admin-location__live-map .leaflet-popup-content-wrapper,
.tenant-admin-location__live-map .leaflet-popup-tip {
    background: hsl(0 0% 100% / 0.96);
    color: hsl(222 30% 18%);
    box-shadow: 0 18px 40px hsl(220 24% 16% / 0.16);
}

.tenant-admin-location__live-map .leaflet-popup-content {
    margin: 0.85rem 0.95rem;
    line-height: 1.55;
    font-size: 0.82rem;
}

.tenant-admin-location__status {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 500;
    border-radius: 999px;
    background: hsl(0 0% 100% / 0.88);
    border: 1px solid hsl(214 30% 88% / 0.96);
    box-shadow: 0 12px 26px hsl(220 24% 16% / 0.1);
    padding: 0.65rem 0.9rem;
    color: hsl(217 18% 36%);
    font-size: 0.78rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.tenant-admin-location__status.is-error {
    color: #b91c1c;
}

.tenant-admin-location__mesh {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.92));
    pointer-events: none;
}

.tenant-admin-location__map {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    fill: rgba(210, 223, 240, 0.88);
    stroke: rgba(134, 157, 193, 0.7);
    stroke-width: 1.1;
}

.tenant-admin-location__line {
    stroke: rgba(37, 99, 235, 0.28);
    stroke-width: 1.4;
    stroke-dasharray: 3 3;
}

.tenant-admin-location__hub {
    fill: rgba(15, 23, 42, 0.92);
}

.tenant-admin-location__hub-ring {
    fill: rgba(37, 99, 235, 0.16);
    stroke: rgba(37, 99, 235, 0.28);
    stroke-width: 1;
}

.tenant-admin-location__hub-ring--outer {
    fill: rgba(37, 99, 235, 0.08);
}

.tenant-admin-location__hub-text,
.tenant-admin-location__label {
    fill: #23324d;
    font-size: 3.2px;
    font-weight: 700;
}

.tenant-admin-location__bubble {
    fill: rgba(37, 99, 235, 0.18);
    stroke: rgba(37, 99, 235, 0.34);
    stroke-width: 0.7;
}

.tenant-admin-location__core {
    fill: hsl(var(--accent-primary-hsl));
    stroke: hsl(0 0% 100% / 0.92);
    stroke-width: 1.2;
}

.tenant-admin-location__legend {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.tenant-admin-location__summary {
    padding: 1rem 1.05rem;
    border-radius: 1.1rem;
}

.tenant-admin-location__summary-value {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: hsl(222 30% 18%);
}

.tenant-admin-location__summary-copy {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: hsl(217 16% 42%);
}

.tenant-admin-location__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0.95rem;
    border-radius: 1rem;
}

.tenant-admin-location__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: hsl(var(--accent-primary-hsl) / 0.12);
    color: hsl(var(--accent-primary-hsl));
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.tenant-admin-location__meta {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.tenant-admin-location__city {
    font-weight: 800;
    color: hsl(222 30% 18%);
}

.tenant-admin-location__share {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: hsl(216 14% 48%);
}

.tenant-admin-location__count {
    font-size: 0.83rem;
    color: hsl(217 16% 42%);
    white-space: nowrap;
}

.tenant-admin-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tenant-admin-timeline__item {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border-radius: 1.1rem;
}

.tenant-admin-timeline__date strong,
.tenant-admin-timeline__body strong {
    display: block;
    color: hsl(222 30% 18%);
}

.tenant-admin-timeline__date span,
.tenant-admin-timeline__body span,
.tenant-admin-empty {
    font-size: 0.86rem;
    line-height: 1.55;
    color: hsl(217 16% 42%);
}

.tenant-admin-empty {
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, hsl(0 0% 100% / 0.9), hsl(214 35% 98% / 0.92));
    border: 1px dashed hsl(214 28% 84%);
}

/* ── Light mode — dashboard polish ─────────────────────── */
html[data-theme="dark"] .tenant-admin-hero {
    border-color: hsl(var(--border-subtle-hsl) / 0.88);
    background:
        radial-gradient(circle at top left, hsl(211 95% 56% / 0.14), transparent 34%),
        radial-gradient(circle at bottom right, hsl(171 76% 44% / 0.1), transparent 30%),
        linear-gradient(135deg, hsl(222 34% 16% / 0.98), hsl(224 32% 13% / 0.98));
    box-shadow:
        0 28px 60px hsl(222 56% 4% / 0.34),
        inset 0 1px 0 hsl(0 0% 100% / 0.04);
}

html[data-theme="dark"] .tenant-admin-hero__eyebrow,
html[data-theme="dark"] .tenant-admin-panel__eyebrow,
html[data-theme="dark"] .tenant-admin-kpi-card__label,
html[data-theme="dark"] .tenant-admin-location__summary-label {
    color: hsl(216 28% 72%);
}

html[data-theme="dark"] .tenant-admin-hero__badge {
    border-color: hsl(var(--border-subtle-hsl) / 0.88);
    background: hsl(var(--bg-elevated-hsl) / 0.82);
    color: hsl(var(--text-primary-hsl) / 0.96);
}

html[data-theme="dark"] .tenant-admin-hero__badge-dot {
    box-shadow: 0 0 0 4px hsl(214 54% 18% / 0.55);
}

html[data-theme="dark"] .tenant-admin-hero__title,
html[data-theme="dark"] .tenant-admin-kpi-card__value,
html[data-theme="dark"] .tenant-admin-panel__title,
html[data-theme="dark"] .tenant-admin-stat__value,
html[data-theme="dark"] .tenant-admin-action__label,
html[data-theme="dark"] .tenant-admin-location__summary-value,
html[data-theme="dark"] .tenant-admin-location__city,
html[data-theme="dark"] .tenant-admin-timeline__date strong,
html[data-theme="dark"] .tenant-admin-timeline__body strong {
    color: hsl(var(--text-primary-hsl) / 0.98);
}

html[data-theme="dark"] .tenant-admin-hero__copy,
html[data-theme="dark"] .tenant-admin-kpi-card__meta,
html[data-theme="dark"] .tenant-admin-panel__copy,
html[data-theme="dark"] .tenant-admin-action__meta,
html[data-theme="dark"] .tenant-admin-location__summary-copy,
html[data-theme="dark"] .tenant-admin-location__count,
html[data-theme="dark"] .tenant-admin-timeline__date span,
html[data-theme="dark"] .tenant-admin-timeline__body span,
html[data-theme="dark"] .tenant-admin-empty {
    color: hsl(var(--text-secondary-hsl) / 0.95);
}

html[data-theme="dark"] .tenant-admin-hero__stat-label,
html[data-theme="dark"] .tenant-admin-stat__label,
html[data-theme="dark"] .tenant-admin-spotlight__label,
html[data-theme="dark"] .tenant-admin-spotlight__meta,
html[data-theme="dark"] .tenant-admin-location__share {
    color: hsl(var(--text-muted-hsl) / 0.96);
}

html[data-theme="dark"] .tenant-admin-hero__stat,
html[data-theme="dark"] .tenant-admin-kpi-card,
html[data-theme="dark"] .tenant-admin-panel,
html[data-theme="dark"] .tenant-admin-stat,
html[data-theme="dark"] .tenant-admin-action,
html[data-theme="dark"] .tenant-admin-location__summary,
html[data-theme="dark"] .tenant-admin-location__item,
html[data-theme="dark"] .tenant-admin-timeline__item,
html[data-theme="dark"] .tenant-admin-spotlight,
html[data-theme="dark"] .tenant-admin-empty {
    border-color: hsl(var(--border-subtle-hsl) / 0.84);
    background:
        radial-gradient(circle at top right, hsl(212 95% 56% / 0.08), transparent 30%),
        linear-gradient(180deg, hsl(var(--bg-surface-hsl) / 0.95), hsl(var(--bg-surface-hsl) / 0.88));
    box-shadow:
        0 18px 40px hsl(220 60% 4% / 0.28),
        inset 0 1px 0 hsl(0 0% 100% / 0.03);
}

html[data-theme="dark"] .tenant-admin-hero__aside {
    background:
        radial-gradient(circle at top right, hsl(214 90% 58% / 0.16), transparent 36%),
        linear-gradient(180deg, hsl(224 42% 18%), hsl(226 38% 14%));
    box-shadow:
        0 24px 44px hsl(222 60% 4% / 0.34),
        inset 0 1px 0 hsl(0 0% 100% / 0.04);
}

html[data-theme="dark"] .tenant-admin-hero__aside-label {
    color: hsl(213 65% 74%);
}

html[data-theme="dark"] .tenant-admin-hero__aside-title {
    color: hsl(var(--text-primary-hsl) / 0.99);
}

html[data-theme="dark"] .tenant-admin-hero__aside-copy {
    color: hsl(214 26% 82%);
}

html[data-theme="dark"] .tenant-admin-switches {
    background: hsl(var(--bg-elevated-hsl) / 0.88);
    border-color: hsl(var(--border-subtle-hsl) / 0.84);
}

html[data-theme="dark"] .tenant-admin-switch {
    color: hsl(var(--text-secondary-hsl) / 0.94);
}

html[data-theme="dark"] .tenant-admin-switch.is-active {
    background: hsl(var(--accent-primary-hsl) / 0.16);
    color: hsl(var(--text-primary-hsl) / 0.98);
}

html[data-theme="dark"] .tenant-admin-meter {
    background: hsl(var(--bg-elevated-hsl) / 0.95);
}

html[data-theme="dark"] .tenant-admin-location__stage {
    border-color: hsl(var(--border-subtle-hsl) / 0.82);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.08), transparent 28%),
        linear-gradient(180deg, hsl(221 29% 18%), hsl(223 28% 14%));
}

html[data-theme="dark"] .tenant-admin-location__live-map .leaflet-layer,
html[data-theme="dark"] .tenant-admin-location__live-map .leaflet-control-zoom a,
html[data-theme="dark"] .tenant-admin-location__live-map .leaflet-control-attribution {
    filter: saturate(0.9) brightness(0.92) contrast(1.05);
}

html[data-theme="dark"] .tenant-admin-location__live-map .leaflet-popup-content-wrapper,
html[data-theme="dark"] .tenant-admin-location__live-map .leaflet-popup-tip {
    background: hsl(223 28% 16% / 0.98);
    color: hsl(var(--text-primary-hsl) / 0.96);
}

html[data-theme="dark"] .tenant-admin-location__status {
    background: hsl(223 28% 14% / 0.86);
    border-color: hsl(var(--border-subtle-hsl) / 0.9);
    color: hsl(210 28% 82%);
}

html[data-theme="dark"] .tenant-admin-location__mesh {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
}

html[data-theme="dark"] .tenant-admin-location__map {
    fill: rgba(68, 89, 122, 0.68);
    stroke: rgba(122, 146, 187, 0.58);
}

html[data-theme="dark"] .tenant-admin-location__hub {
    fill: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .tenant-admin-location__hub-text,
html[data-theme="dark"] .tenant-admin-location__label {
    fill: #dbe7ff;
}

html[data-theme="dark"] .tenant-admin-location__bubble {
    fill: rgba(59, 130, 246, 0.2);
    stroke: rgba(96, 165, 250, 0.36);
}

html[data-theme="dark"] .tenant-admin-action::after {
    color: hsl(215 38% 72%);
}

html[data-theme="dark"] .tenant-admin-action:hover {
    box-shadow: 0 22px 34px hsl(220 60% 4% / 0.28);
}

html[data-theme="dark"] .tenant-admin-empty {
    border-style: solid;
}

html[data-theme="light"] .panel-card {
    border: 1px solid hsl(214 48% 100% / 0.52);
    background: linear-gradient(
        168deg,
        hsl(210 80% 100% / 0.84) 0%,
        hsl(214 55% 98.5% / 0.68) 55%,
        hsl(220 45% 96.5% / 0.62) 100%
    );
    box-shadow:
        0 16px 44px hsl(225 38% 22% / 0.1),
        inset 0 1px 0 hsl(0 0% 100% / 0.94);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

html[data-theme="light"] .panel-head {
    border-bottom-color: hsl(var(--border-subtle-hsl) / 0.55);
    background: linear-gradient(
        180deg,
        hsl(214 70% 100% / 0.55) 0%,
        hsl(218 40% 98% / 0.2) 100%
    );
}

html[data-theme="light"] .panel-title {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

html[data-theme="light"] .panel-footer {
    background: linear-gradient(180deg, hsl(var(--bg-elevated-hsl) / 0.5), hsl(var(--bg-elevated-hsl) / 0.85));
    border-top-color: hsl(var(--border-subtle-hsl) / 0.6);
}

html[data-theme="light"] .activity-item:hover,
html[data-theme="light"] .action-item:hover {
    background: hsl(var(--accent-primary-hsl) / 0.05);
}

html[data-theme="light"] .action-icon {
    background: hsl(var(--accent-subtle-hsl) / 0.85);
    border: 1px solid hsl(var(--accent-primary-hsl) / 0.12);
}

html[data-theme="light"] .progress-bar-wrap {
    background: hsl(var(--border-subtle-hsl) / 0.45);
    box-shadow: inset 0 1px 2px hsl(var(--shadow-color-hsl) / 0.06);
}

html[data-theme="light"] .progress-bar-fill {
    box-shadow: 0 0 12px hsl(var(--accent-primary-hsl) / 0.25);
}

html[data-theme="light"] .kpi-grid {
    gap: var(--space-5);
}

/* Admin leave dashboard */
.admin-leave-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.leave-hero-card,
.leave-panel,
.leave-metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.82);
    background:
        radial-gradient(circle at top right, hsl(197 100% 92% / 0.75), transparent 28%),
        radial-gradient(circle at top left, hsl(222 95% 93% / 0.7), transparent 34%),
        linear-gradient(180deg, hsl(var(--bg-surface-hsl) / 0.98), hsl(var(--bg-surface-hsl) / 0.92));
    box-shadow:
        0 18px 48px hsl(219 33% 31% / 0.1),
        inset 0 1px 0 hsl(0 0% 100% / 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.leave-hero-card,
.leave-panel {
    border-radius: 1.75rem;
}

.leave-hero-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.65rem;
}

.leave-section-kicker,
.leave-metric-label,
.leave-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.leave-section-kicker {
    color: var(--accent-primary);
}

.leave-hero-title {
    margin-top: 0.7rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.2vw, 2.55rem);
    line-height: 1.05;
    color: var(--text-primary);
}

.leave-hero-copy {
    margin-top: 0.7rem;
    max-width: 46rem;
    font-size: 0.97rem;
    color: var(--text-secondary);
}

.leave-hero-pill {
    flex-shrink: 0;
    align-self: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid hsl(var(--accent-primary-hsl) / 0.12);
    background: hsl(var(--bg-surface-hsl) / 0.82);
    color: hsl(var(--accent-primary-hsl) / 0.9);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

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

.leave-metric-card {
    min-height: 7.25rem;
    border-radius: 1.5rem;
    padding: 1.45rem 1.35rem;
}

.leave-metric-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 55%;
    bottom: 0;
    height: 4px;
    border-radius: 999px;
}

.leave-metric-card-total::after { background: linear-gradient(90deg, #605dff, #6f8cff); }
.leave-metric-card-pending::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.leave-metric-card-approved::after { background: linear-gradient(90deg, #10b981, #22c55e); }
.leave-metric-card-rejected::after { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.leave-metric-label {
    color: var(--text-muted);
}

.leave-metric-value {
    margin-top: 0.85rem;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.leave-metric-card-pending .leave-metric-value { color: #d97706; }
.leave-metric-card-approved .leave-metric-value { color: #16a34a; }
.leave-metric-card-rejected .leave-metric-value { color: #dc2626; }

.leave-panel {
    padding: 1.5rem;
}

.leave-panel-head,
.leave-table-head {
    padding: 0 0 1rem;
    border-bottom: 1px solid hsl(var(--border-subtle-hsl) / 0.7);
}

.leave-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.leave-panel-title-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: hsl(var(--accent-primary-hsl) / 0.7);
}

.leave-panel-title-icon svg {
    width: 100%;
    height: 100%;
}

.leave-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.15rem;
    padding-top: 1.25rem;
}

.leave-field {
    min-width: 0;
}

.leave-field-label {
    display: block;
    margin-bottom: 0.55rem;
    color: #8a9abc;
}

.leave-field-control {
    display: block;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.95rem 1rem;
    border: 1px solid hsl(218 25% 73% / 0.95);
    border-radius: 1rem;
    background: hsl(0 0% 100% / 0.88);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.85);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.leave-field-control::placeholder {
    color: #97a3bd;
}

.leave-field-control:focus {
    outline: none;
    border-color: hsl(var(--accent-primary-hsl) / 0.55);
    box-shadow: 0 0 0 4px hsl(var(--accent-primary-hsl) / 0.12);
}

.leave-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.15rem;
}

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

.leave-table-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.leave-table-copy {
    margin-top: 0.45rem;
    color: #7f8fb3;
}

.leave-table-wrap {
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.leave-data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0 0.9rem;
}

.leave-data-table thead th {
    padding: 0 0.9rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8a99b6;
    text-align: left;
}

.leave-data-table tbody td {
    padding: 1.05rem 0.9rem;
    vertical-align: middle;
    background: hsl(0 0% 100% / 0.78);
    border-top: 1px solid hsl(var(--border-subtle-hsl) / 0.72);
    border-bottom: 1px solid hsl(var(--border-subtle-hsl) / 0.72);
}

.leave-data-table tbody td:first-child {
    border-left: 1px solid hsl(var(--border-subtle-hsl) / 0.72);
    border-radius: 1rem 0 0 1rem;
}

.leave-data-table tbody td:last-child {
    border-right: 1px solid hsl(var(--border-subtle-hsl) / 0.72);
    border-radius: 0 1rem 1rem 0;
}

.leave-staff-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.leave-staff-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 1px solid hsl(42 92% 75% / 0.7);
    background: linear-gradient(180deg, #fff7db, #fff2c4);
    color: #d97706;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.leave-staff-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.leave-staff-meta {
    margin-top: 0.18rem;
    font-size: 0.76rem;
    color: #8796b4;
}

.leave-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.55rem;
    border-radius: 0.6rem;
    background: #f4f7ff;
    color: #20406f;
    font-size: 0.88rem;
    font-weight: 600;
}

.leave-date-primary,
.leave-days-count {
    color: #334155;
    font-weight: 600;
}

.leave-date-secondary {
    margin-top: 0.25rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a99b6;
}

.leave-days-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #ecebff;
    color: #4f46e5;
    font-weight: 700;
}

.leave-reason-cell {
    color: #60708f;
}

.leave-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.leave-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 700;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

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

.leave-action-btn-approve {
    border-color: #86efac;
    background: #ecfdf5;
    color: #059669;
}

.leave-action-btn-reject {
    border-color: #fda4af;
    background: #fff1f2;
    color: #e11d48;
}

.leave-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 700;
}

.leave-status-badge.is-pending {
    border-color: #fcd34d;
    background: #fff8db;
    color: #d97706;
}

.leave-status-badge.is-approved {
    border-color: #86efac;
    background: #ecfdf5;
    color: #059669;
}

.leave-status-badge.is-rejected {
    border-color: #fda4af;
    background: #fff1f2;
    color: #e11d48;
}

.leave-row-link {
    color: hsl(var(--accent-primary-hsl) / 0.95);
    font-weight: 700;
}

.leave-row-link:hover {
    text-decoration: underline;
}

.leave-empty-state {
    padding: 3rem 1rem !important;
    border-radius: 1rem !important;
    text-align: center;
    color: #6b7c98;
}

html[data-theme="dark"] .leave-hero-card,
html[data-theme="dark"] .leave-panel,
html[data-theme="dark"] .leave-metric-card {
    background:
        radial-gradient(circle at top right, hsl(210 100% 32% / 0.18), transparent 30%),
        radial-gradient(circle at top left, hsl(228 78% 38% / 0.16), transparent 34%),
        linear-gradient(180deg, hsl(var(--bg-surface-hsl) / 0.95), hsl(var(--bg-surface-hsl) / 0.88));
    box-shadow:
        0 18px 44px hsl(220 60% 4% / 0.28),
        inset 0 1px 0 hsl(0 0% 100% / 0.04);
}

html[data-theme="dark"] .leave-field-control,
html[data-theme="dark"] .leave-data-table tbody td,
html[data-theme="dark"] .leave-hero-pill {
    background: hsl(var(--bg-elevated-hsl) / 0.78);
}

html[data-theme="dark"] .leave-data-table tbody td,
html[data-theme="dark"] .leave-data-table tbody td:first-child,
html[data-theme="dark"] .leave-data-table tbody td:last-child {
    border-color: hsl(var(--border-subtle-hsl) / 0.82);
}

html[data-theme="dark"] .leave-type-badge {
    background: hsl(var(--accent-primary-hsl) / 0.14);
    color: hsl(var(--text-primary-hsl) / 0.92);
}

html[data-theme="dark"] .leave-staff-avatar {
    border-color: hsl(var(--warning) / 0.35);
    background: hsl(var(--warning) / 0.14);
    color: hsl(var(--warning) / 0.98);
}

html[data-theme="dark"] .leave-field-label,
html[data-theme="dark"] .leave-table-copy,
html[data-theme="dark"] .leave-data-table thead th,
html[data-theme="dark"] .leave-staff-meta,
html[data-theme="dark"] .leave-date-secondary,
html[data-theme="dark"] .leave-empty-state {
    color: hsl(var(--text-muted-hsl) / 0.96);
}

html[data-theme="dark"] .leave-date-primary,
html[data-theme="dark"] .leave-days-count,
html[data-theme="dark"] .leave-reason-cell {
    color: hsl(var(--text-secondary-hsl) / 0.96);
}

html[data-theme="dark"] .leave-field-control::placeholder {
    color: hsl(var(--text-muted-hsl) / 0.9);
}

@media (max-width: 1200px) {
    .leave-metric-grid,
    .leave-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .leave-hero-card {
        flex-direction: column;
    }

    .leave-hero-pill {
        align-self: flex-start;
    }

    .leave-table-title {
        font-size: 1.7rem;
    }
}

@media (max-width: 640px) {
    .leave-panel,
    .leave-hero-card {
        padding: 1.2rem;
        border-radius: 1.4rem;
    }

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

    .leave-metric-card {
        min-height: auto;
    }
}

/* Student portal dashboard */
.student-portal-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.student-dashboard-hero,
.student-panel,
.student-kpi-card {
    border: 1px solid var(--border-subtle);
    background:
        linear-gradient(180deg, hsl(var(--bg-surface-hsl) / 0.96), hsl(var(--bg-surface-hsl) / 0.88));
    box-shadow: var(--shadow-sm);
}

.student-dashboard-hero,
.student-panel {
    border-radius: 28px;
}

.student-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 1.25rem;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
}

.student-dashboard-hero::before {
    content: "";
    position: absolute;
    inset: auto -10% -35% auto;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: radial-gradient(circle, hsl(var(--accent-primary-hsl) / 0.18), transparent 68%);
    pointer-events: none;
}

.student-dashboard-kicker,
.student-panel-kicker,
.student-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.student-dashboard-kicker,
.student-panel-kicker {
    color: var(--accent-primary);
}

.student-dashboard-title {
    margin-top: 0.65rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.6rem);
    line-height: 1.04;
    color: var(--text-primary);
}

.student-dashboard-copy {
    margin-top: 0.8rem;
    max-width: 48rem;
    color: var(--text-secondary);
    font-size: 0.96rem;
}

.student-dashboard-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    position: relative;
    z-index: 1;
}

.student-dashboard-mini-stat,
.student-kpi-card {
    border-radius: 22px;
}

.student-dashboard-mini-stat {
    padding: 1rem 1.1rem;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-app-hsl) / 0.55);
}

.student-dashboard-mini-stat span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.student-dashboard-mini-stat strong {
    display: block;
    margin-top: 0.55rem;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 700;
}

.student-profile-identity-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-app-hsl) / 0.45);
}

.student-profile-avatar {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-surface-hsl) / 0.96);
}

.student-profile-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.student-profile-avatar-fallback {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.75rem;
    font-weight: 800;
}

.student-profile-identity-copy {
    min-width: 0;
    flex: 1;
}

.student-profile-identity-kicker {
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.student-profile-identity-name {
    margin-top: 0.5rem;
    color: var(--text-primary);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.1;
}

.student-profile-identity-meta {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.student-profile-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.student-dashboard-kpis,
.student-dashboard-main-grid,
.student-dashboard-secondary-grid,
.student-dashboard-table-grid {
    display: grid;
    gap: 1.25rem;
}

.student-dashboard-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.student-kpi-card {
    padding: 1.3rem;
}

.student-kpi-card-primary {
    background: linear-gradient(135deg, hsla(216.5, 89.5%, 11.2%, 0.96), hsl(212 88% 45% / 0.94));
        border-color: transparent;
    }

    .student-kpi-card-primary .student-kpi-label,
    .student-kpi-card-primary .student-kpi-value,
    .student-kpi-card-primary .student-kpi-meta {
    color: white;
}

.student-kpi-label {
    color: var(--text-muted);
}

.student-kpi-value {
    margin-top: 0.65rem;
    font-size: clamp(1.7rem, 2.3vw, 2.3rem);
    line-height: 1;
    font-weight: 800;
    color: var(--text-primary);
}

.student-kpi-meta {
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.student-dashboard-main-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
}

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

.student-dashboard-table-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
}

.student-panel {
    padding: 1.35rem;
}

.student-panel-feature {
    padding-bottom: 1rem;
}

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

.student-panel-title {
    margin-top: 0.35rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.15;
    color: var(--text-primary);
}

.student-chart-shell {
    height: 240px;
    margin-top: 1rem;
    border-radius: 22px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.85);
    background: hsl(var(--bg-app-hsl) / 0.35);
    padding: 1rem;
}

.student-chart-shell-lg {
    height: 310px;
}

.student-chart-shell-donut {
    height: 260px;
}

.student-donut-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.student-donut-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.student-donut-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.student-summary-list,
.student-feed-list,
.student-compact-stack {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.student-summary-row,
.student-feed-item,
.student-compact-item {
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    border-radius: 20px;
    background: hsl(var(--bg-app-hsl) / 0.38);
}

.student-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.student-summary-row strong,
.student-feed-title,
.student-compact-title {
    color: var(--text-primary);
    font-weight: 700;
}

.student-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.student-chip {
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: hsl(var(--accent-primary-hsl) / 0.08);
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.student-feed-item,
.student-compact-item {
    padding: 0.95rem 1rem;
}

.student-feed-copy,
.student-compact-copy {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.student-feed-tag {
    display: inline-flex;
    margin-top: 0.6rem;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: hsl(var(--accent-primary-hsl) / 0.1);
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-compact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.student-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.85);
    background: hsl(var(--bg-app-hsl) / 0.34);
}

.student-data-table {
    width: 100%;
    border-collapse: collapse;
}

.student-data-table th,
.student-data-table td {
    padding: 0.95rem 1rem;
    text-align: left;
    border-bottom: 1px solid hsl(var(--border-subtle-hsl) / 0.7);
    font-size: 0.9rem;
}

.student-data-table th {
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.student-data-table td {
    color: var(--text-secondary);
}

.student-data-table tbody tr:last-child td {
    border-bottom: none;
}

.student-dashboard-secondary-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

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

.student-infra-card {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-app-hsl) / 0.38);
}

.student-infra-media {
    aspect-ratio: 4 / 3;
    border-bottom: 1px solid hsl(var(--border-subtle-hsl) / 0.8);
    background:
        linear-gradient(135deg, hsl(var(--accent-primary-hsl) / 0.12), transparent 72%),
        hsl(var(--bg-surface-hsl) / 0.9);
}

.student-infra-image-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.student-infra-image,
.student-infra-fallback {
    width: 100%;
    height: 100%;
}

.student-infra-image {
    display: block;
    object-fit: cover;
}

.student-infra-fallback {
    display: grid;
    place-items: center;
    color: var(--accent-primary);
    font-size: 2rem;
    font-weight: 800;
}

.student-infra-copy {
    padding: 1rem;
}

.student-infra-copy h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
}

.student-infra-copy p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.student-lightbox[hidden] {
    display: none;
}

.student-lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
}

.student-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: hsl(220 40% 8% / 0.82);
    cursor: pointer;
}

.student-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: min(92vw, 1100px);
    max-height: 90vh;
    margin: 5vh auto;
    padding: 1rem;
    border-radius: 28px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.7);
    background: hsl(var(--bg-surface-hsl) / 0.98);
    box-shadow: 0 28px 80px hsl(220 50% 4% / 0.45);
}

.student-lightbox-close {
    align-self: flex-end;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: hsl(var(--accent-primary-hsl) / 0.12);
    color: var(--text-primary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.student-lightbox-image {
    width: 100%;
    max-height: calc(90vh - 110px);
    border-radius: 22px;
    object-fit: contain;
    background: hsl(var(--bg-app-hsl) / 0.55);
}

.student-lightbox-caption {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

body.student-lightbox-open {
    overflow: hidden;
}

.student-holiday-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.student-holiday-highlight-card {
    padding: 1.05rem 1.1rem;
    border-radius: 22px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background:
        linear-gradient(155deg, hsl(var(--accent-primary-hsl) / 0.1), transparent 70%),
        hsl(var(--bg-app-hsl) / 0.38);
}

.student-holiday-highlight-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.student-holiday-highlight-card strong {
    display: block;
    margin-top: 0.7rem;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
}

.student-holiday-highlight-card p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.student-holiday-item-top,
.student-holiday-item-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.student-holiday-item-meta {
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.student-diary-page {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.student-diary-intro {
    position: relative;
    overflow: hidden;
    padding: 1.8rem 2rem;
    border-radius: 30px;
    border: 1px solid hsl(213 52% 82% / 0.9);
    background:
        linear-gradient(135deg, hsl(210 86% 92% / 0.96), hsl(213 72% 96% / 0.92));
    box-shadow: 0 18px 46px hsl(214 38% 44% / 0.14);
}

.student-diary-intro::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, hsl(207 88% 74% / 0.28), transparent 68%);
}

.student-diary-page-kicker {
    color: hsl(214 54% 40%);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.student-diary-page-title {
    margin-top: 0.55rem;
    color: hsl(218 38% 24%);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1;
}

.student-diary-page-copy {
    margin-top: 0.8rem;
    max-width: 48rem;
    color: hsl(215 18% 36%);
    font-size: 0.95rem;
}

.student-diary-app {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border-radius: 34px;
    border: 1px solid hsl(213 42% 84% / 0.9);
    background:
        linear-gradient(180deg, hsl(210 88% 96% / 0.98), hsl(214 76% 93% / 0.96));
    box-shadow:
        0 24px 60px hsl(214 35% 40% / 0.14),
        inset 0 1px 0 hsl(0 0% 100% / 0.78);
}

.student-diary-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    gap: 1rem;
    min-width: 0;
}

.student-diary-rail,
.student-diary-window,
.student-diary-security-card,
.student-diary-templates-card,
.student-diary-history-card {
    border-radius: 28px;
    border: 1px solid hsl(214 34% 86% / 0.92);
    background: hsl(0 0% 100% / 0.78);
    box-shadow: 0 10px 30px hsl(214 32% 45% / 0.08);
}

.student-diary-rail {
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    min-width: 0;
}

.student-diary-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.student-diary-brand-mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background:
        linear-gradient(145deg, hsl(211 84% 88%), hsl(199 100% 94%));
    color: hsl(216 40% 35%);
    font-size: 1.5rem;
    font-weight: 800;
}

.student-diary-brand h2 {
    color: hsl(218 26% 28%);
    font-size: 1rem;
    font-weight: 800;
}

.student-diary-brand p {
    margin-top: 0.15rem;
    color: hsl(215 15% 50%);
    font-size: 0.74rem;
}

.student-diary-nav {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.student-diary-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: none;
    border-radius: 18px;
    padding: 0.78rem 0.7rem;
    background: transparent;
    color: hsl(215 18% 47%);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.student-diary-nav-btn:hover,
.student-diary-nav-btn.is-active {
    background: hsl(211 86% 88% / 0.72);
    color: hsl(214 54% 42%);
}

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

.student-diary-mini-card {
    padding: 0.9rem 0.8rem;
    border-radius: 20px;
    background: hsl(212 72% 97%);
    border: 1px solid hsl(214 40% 87%);
}

.student-diary-mini-label,
.student-diary-section-kicker {
    display: block;
    color: hsl(214 30% 52%);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.student-diary-mini-card strong {
    display: block;
    margin-top: 0.55rem;
    color: hsl(218 24% 28%);
    font-size: 0.94rem;
    font-weight: 800;
}

.student-diary-mini-card p {
    margin-top: 0.3rem;
    color: hsl(215 14% 45%);
    font-size: 0.8rem;
    line-height: 1.45;
}

.student-diary-window {
    padding: 0.9rem;
    min-width: 0;
}

.student-diary-window-bar,
.student-diary-editor-top,
.student-diary-editor-footer,
.student-diary-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.student-diary-window-title,
.student-diary-section-head h2 {
    color: hsl(218 24% 28%);
    font-size: 1.02rem;
    font-weight: 800;
}

.student-diary-window-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.student-diary-icon-btn,
.student-diary-action-btn,
.student-diary-primary-btn,
.student-diary-secondary-btn {
    border: none;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.student-diary-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: hsl(212 60% 96%);
    color: hsl(214 25% 38%);
    font-size: 1.4rem;
    line-height: 1;
}

.student-diary-action-btn,
.student-diary-primary-btn {
    padding: 0.78rem 1.35rem;
    border-radius: 16px;
    background: linear-gradient(135deg, hsl(214 78% 59%), hsl(221 74% 54%));
    color: white;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 14px 26px hsl(217 52% 54% / 0.2);
}

.student-diary-secondary-btn {
    padding: 0.78rem 1.2rem;
    border-radius: 16px;
    background: hsl(212 60% 96%);
    color: hsl(214 30% 42%);
    font-size: 0.88rem;
    font-weight: 800;
}

.student-diary-icon-btn:hover,
.student-diary-action-btn:hover,
.student-diary-primary-btn:hover,
.student-diary-secondary-btn:hover,
.student-diary-template-card:hover,
.student-diary-prompt-btn:hover {
    transform: translateY(-1px);
}

.student-diary-editor-card,
.student-diary-history-card,
.student-diary-security-card,
.student-diary-templates-card {
    padding: 1rem;
}

.student-diary-editor-card {
    margin-top: 0.9rem;
    border-radius: 24px;
    background: hsl(212 52% 97%);
    border: 1px solid hsl(214 36% 87%);
}

.student-diary-editor-top {
    align-items: end;
}

.student-diary-title-input,
.student-diary-editor-meta select,
.student-diary-editor-meta input,
.student-diary-security-form select,
.student-diary-security-form input,
.student-diary-unlock-card input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid hsl(214 34% 86%);
    background: hsl(0 0% 100% / 0.9);
    color: hsl(218 24% 28%);
    font-size: 0.9rem;
    padding: 0.78rem 0.9rem;
}

.student-diary-title-input {
    flex: 1 1 320px;
    font-size: 1.22rem;
    font-weight: 800;
}

.student-diary-editor-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    flex: 1;
    min-width: min(100%, 320px);
}

.student-diary-editor-meta label,
.student-diary-security-form label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.student-diary-editor-meta span,
.student-diary-security-form span {
    color: hsl(215 15% 45%);
    font-size: 0.74rem;
    font-weight: 700;
}

.student-diary-paper {
    position: relative;
    margin-top: 1rem;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid hsl(210 70% 87%);
    background:
        linear-gradient(160deg, hsl(209 100% 93%), hsl(212 95% 86%));
}

.student-diary-paper textarea {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 320px;
    border: none;
    resize: vertical;
    background: transparent;
    color: hsl(218 35% 28%);
    font-size: 1rem;
    line-height: 1.75;
    padding: 1.35rem 1.4rem;
}

.student-diary-paper textarea:focus {
    outline: none;
}

.student-diary-paper-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 14%, hsl(0 0% 100% / 0.55), transparent 22%),
        radial-gradient(circle at 80% 10%, hsl(0 0% 100% / 0.38), transparent 22%);
    pointer-events: none;
}

.student-diary-prompt-block {
    margin-top: 1rem;
}

.student-diary-prompt-title {
    color: hsl(218 24% 28%);
    font-size: 0.9rem;
    font-weight: 800;
}

.student-diary-prompt-grid,
.student-diary-template-list,
.student-diary-security-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-diary-prompt-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-diary-prompt-btn,
.student-diary-template-card {
    width: 100%;
    text-align: left;
    border: 1px solid hsl(214 38% 86%);
    border-radius: 18px;
    padding: 0.9rem 1rem;
    background: hsl(0 0% 100% / 0.88);
    color: hsl(218 18% 30%);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.student-diary-template-card strong {
    display: block;
    color: hsl(214 38% 44%);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.student-diary-template-card span {
    display: block;
    margin-top: 0.45rem;
    color: hsl(215 15% 40%);
    font-size: 0.84rem;
    line-height: 1.5;
}

.student-diary-editor-footer,
.student-diary-history-card {
    margin-top: 1rem;
}

.student-diary-editor-footer {
    justify-content: flex-end;
}

.student-diary-history-table-wrap {
    margin-top: 0.9rem;
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid hsl(214 34% 87%);
    background: hsl(212 72% 98%);
}

.student-diary-history-table {
    width: 100%;
    border-collapse: collapse;
}

.student-diary-history-table th,
.student-diary-history-table td {
    padding: 0.92rem 1rem;
    border-bottom: 1px solid hsl(214 28% 89%);
    text-align: left;
    color: hsl(215 15% 38%);
    font-size: 0.85rem;
}

.student-diary-history-table th {
    color: hsl(214 24% 48%);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.student-diary-history-table tbody tr:last-child td {
    border-bottom: none;
}

.student-diary-sidepanel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.student-diary-lock-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    margin-top: 0.8rem;
}

.student-diary-lock-book {
    width: 82px;
    height: 98px;
    border-radius: 20px 18px 18px 20px;
    border: 2px solid hsl(214 20% 72%);
    background:
        linear-gradient(180deg, hsl(0 0% 100%), hsl(212 45% 96%));
    box-shadow: inset 12px 0 0 hsl(214 45% 94%);
    transform: rotate(-8deg);
}

.student-diary-lock-badge {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: hsl(214 72% 57%);
    color: white;
    font-size: 1.15rem;
    box-shadow: 0 12px 26px hsl(217 44% 52% / 0.22);
}

.student-diary-security-copy {
    margin-top: 0.9rem;
    color: hsl(215 14% 42%);
    font-size: 0.88rem;
    line-height: 1.7;
}

.student-diary-unlock-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: hsl(214 32% 20% / 0.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.student-diary-unlock-card {
    width: min(100%, 360px);
    padding: 1.3rem;
    border-radius: 28px;
    border: 1px solid hsl(214 34% 85%);
    background: hsl(0 0% 100% / 0.94);
    box-shadow: 0 24px 56px hsl(214 32% 25% / 0.2);
}

.student-diary-unlock-card h2 {
    margin-top: 0.5rem;
    color: hsl(218 24% 28%);
    font-size: 1.2rem;
    font-weight: 800;
}

.student-diary-unlock-card p {
    margin-top: 0.45rem;
    color: hsl(215 14% 42%);
    font-size: 0.88rem;
    line-height: 1.65;
}

.student-diary-unlock-card input,
.student-diary-unlock-card .student-diary-primary-btn {
    margin-top: 0.9rem;
}

html[data-theme="dark"] .student-diary-intro {
    border-color: hsl(var(--border-strong-hsl) / 0.9);
    background:
        linear-gradient(135deg, hsl(219 34% 24% / 0.96), hsl(222 30% 18% / 0.94));
    box-shadow: 0 18px 46px hsl(222 52% 5% / 0.3);
}

html[data-theme="dark"] .student-diary-intro::after {
    background: radial-gradient(circle, hsl(var(--accent-primary-hsl) / 0.2), transparent 68%);
}

html[data-theme="dark"] .student-diary-page-kicker,
html[data-theme="dark"] .student-diary-mini-label,
html[data-theme="dark"] .student-diary-section-kicker,
html[data-theme="dark"] .student-diary-history-table th,
html[data-theme="dark"] .student-diary-template-card strong {
    color: hsl(215 80% 76%);
}

html[data-theme="dark"] .student-diary-page-title,
html[data-theme="dark"] .student-diary-brand h2,
html[data-theme="dark"] .student-diary-window-title,
html[data-theme="dark"] .student-diary-section-head h2,
html[data-theme="dark"] .student-diary-prompt-title,
html[data-theme="dark"] .student-diary-mini-card strong,
html[data-theme="dark"] .student-diary-paper textarea,
html[data-theme="dark"] .student-diary-title-input,
html[data-theme="dark"] .student-diary-editor-meta select,
html[data-theme="dark"] .student-diary-editor-meta input,
html[data-theme="dark"] .student-diary-security-form input,
html[data-theme="dark"] .student-diary-unlock-card h2,
html[data-theme="dark"] .student-diary-unlock-card input {
    color: hsl(var(--text-primary-hsl));
}

html[data-theme="dark"] .student-diary-page-copy,
html[data-theme="dark"] .student-diary-brand p,
html[data-theme="dark"] .student-diary-mini-card p,
html[data-theme="dark"] .student-diary-editor-meta span,
html[data-theme="dark"] .student-diary-security-form span,
html[data-theme="dark"] .student-diary-template-card span,
html[data-theme="dark"] .student-diary-history-table td,
html[data-theme="dark"] .student-diary-security-copy,
html[data-theme="dark"] .student-diary-unlock-card p {
    color: hsl(var(--text-secondary-hsl));
}

html[data-theme="dark"] .student-diary-app {
    border-color: hsl(var(--border-strong-hsl) / 0.95);
    background:
        linear-gradient(180deg, hsl(221 32% 17% / 0.98), hsl(222 34% 12% / 0.98));
    box-shadow:
        0 24px 60px hsl(222 52% 5% / 0.32),
        inset 0 1px 0 hsl(0 0% 100% / 0.04);
}

html[data-theme="dark"] .student-diary-rail,
html[data-theme="dark"] .student-diary-window,
html[data-theme="dark"] .student-diary-security-card,
html[data-theme="dark"] .student-diary-templates-card,
html[data-theme="dark"] .student-diary-history-card,
html[data-theme="dark"] .student-diary-unlock-card {
    border-color: hsl(var(--border-strong-hsl) / 0.9);
    background: hsl(var(--bg-surface-hsl) / 0.92);
    box-shadow: 0 14px 34px hsl(222 52% 5% / 0.18);
}

html[data-theme="dark"] .student-diary-brand-mark {
    background:
        linear-gradient(145deg, hsl(217 45% 28%), hsl(212 52% 22%));
    color: hsl(214 88% 88%);
}

html[data-theme="dark"] .student-diary-nav-btn {
    color: hsl(var(--text-secondary-hsl));
}

html[data-theme="dark"] .student-diary-nav-btn:hover,
html[data-theme="dark"] .student-diary-nav-btn.is-active {
    background: hsl(var(--accent-subtle-hsl) / 0.95);
    color: hsl(var(--text-primary-hsl));
}

html[data-theme="dark"] .student-diary-mini-card,
html[data-theme="dark"] .student-diary-history-table-wrap {
    background: hsl(var(--bg-elevated-hsl) / 0.9);
    border-color: hsl(var(--border-strong-hsl) / 0.9);
}

html[data-theme="dark"] .student-diary-icon-btn,
html[data-theme="dark"] .student-diary-secondary-btn {
    background: hsl(var(--bg-elevated-hsl));
    color: hsl(var(--text-secondary-hsl));
}

html[data-theme="dark"] .student-diary-editor-card {
    background: hsl(var(--bg-canvas-hsl) / 0.58);
    border-color: hsl(var(--border-strong-hsl) / 0.9);
}

html[data-theme="dark"] .student-diary-title-input,
html[data-theme="dark"] .student-diary-editor-meta select,
html[data-theme="dark"] .student-diary-editor-meta input,
html[data-theme="dark"] .student-diary-security-form select,
html[data-theme="dark"] .student-diary-security-form input,
html[data-theme="dark"] .student-diary-unlock-card input,
html[data-theme="dark"] .student-diary-prompt-btn,
html[data-theme="dark"] .student-diary-template-card {
    border-color: hsl(var(--border-strong-hsl));
    background: hsl(var(--bg-elevated-hsl) / 0.88);
}

html[data-theme="dark"] .student-diary-paper {
    border-color: hsl(216 42% 30%);
    background:
        linear-gradient(160deg, hsl(216 40% 23%), hsl(219 36% 18%));
}

html[data-theme="dark"] .student-diary-paper-glow {
    background:
        radial-gradient(circle at 12% 14%, hsl(0 0% 100% / 0.08), transparent 22%),
        radial-gradient(circle at 80% 10%, hsl(var(--accent-primary-hsl) / 0.12), transparent 22%);
}

html[data-theme="dark"] .student-diary-history-table th,
html[data-theme="dark"] .student-diary-history-table td {
    border-bottom-color: hsl(var(--border-subtle-hsl));
}

html[data-theme="dark"] .student-diary-lock-book {
    border-color: hsl(var(--border-strong-hsl));
    background:
        linear-gradient(180deg, hsl(var(--bg-elevated-hsl)), hsl(var(--bg-surface-hsl)));
    box-shadow: inset 12px 0 0 hsl(var(--bg-hover-hsl));
}

@media (max-width: 1280px) {
    .student-dashboard-kpis,
    .student-dashboard-secondary-grid,
    .student-infra-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-dashboard-main-grid,
    .student-dashboard-table-grid,
    .student-dashboard-hero {
        grid-template-columns: 1fr;
    }

    .student-diary-app {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .student-diary-workspace {
        grid-template-columns: 1fr;
    }

    .student-diary-sidepanel {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .student-dashboard-kpis,
    .student-dashboard-secondary-grid,
    .student-dashboard-hero-meta,
    .student-donut-legend,
    .student-infra-grid,
    .student-holiday-highlight-grid {
        grid-template-columns: 1fr;
    }

    .student-dashboard-hero,
    .student-panel,
    .student-kpi-card {
        border-radius: 24px;
    }

    .student-panel-head,
    .student-summary-row,
    .student-compact-item,
    .student-holiday-item-top,
    .student-holiday-item-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .student-diary-app {
        grid-template-columns: 1fr;
        padding: 0.8rem;
        border-radius: 26px;
    }

    .student-diary-workspace,
    .student-diary-prompt-grid,
    .student-diary-editor-meta {
        grid-template-columns: 1fr;
    }

    .student-diary-rail {
        flex-direction: column;
    }

    .student-diary-window-actions {
        margin-left: 0;
        width: 100%;
    }

    .student-diary-window-bar,
    .student-diary-editor-top,
    .student-diary-editor-footer,
    .student-diary-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .student-diary-action-btn,
    .student-diary-primary-btn,
    .student-diary-secondary-btn {
        width: 100%;
    }

    .student-profile-identity-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-chart-shell-lg {
        height: 260px;
    }
}

/* Student fee portal */
.student-fee-dashboard {
    gap: 1.35rem;
}

.student-fee-hero {
    align-items: start;
}

.student-fee-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.1rem;
}

.student-fee-highlight-card {
    position: relative;
    z-index: 1;
    padding: 1.35rem;
    border-radius: 24px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background:
        linear-gradient(155deg, hsl(var(--accent-primary-hsl) / 0.16), transparent 60%),
        hsl(var(--bg-app-hsl) / 0.5);
}

.student-fee-highlight-amount {
    margin-top: 0.8rem;
    font-size: clamp(1.9rem, 2.8vw, 2.6rem);
    line-height: 1;
    font-weight: 800;
    color: var(--text-primary);
}

.student-fee-main-grid {
    align-items: start;
}

.student-fee-invoices-panel {
    min-width: 0;
}

.student-fee-filter-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: hsl(var(--bg-app-hsl) / 0.5);
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.8);
}

.student-fee-filter-btn {
    border: none;
    border-radius: 999px;
    padding: 0.62rem 0.9rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.student-fee-filter-btn:hover,
.student-fee-filter-btn.is-active {
    background: hsl(var(--accent-primary-hsl) / 0.14);
    color: var(--accent-primary);
}

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

.student-fee-cards,
.student-fee-side-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.student-fee-card {
    padding: 1.1rem;
    border-radius: 24px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-app-hsl) / 0.38);
}

.student-fee-card[hidden] {
    display: none;
}

.student-fee-card-head,
.student-fee-card-footer,
.student-fee-progress-top,
.student-fee-line-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.student-fee-card-code {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.student-fee-card-title {
    margin-top: 0.45rem;
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--text-primary);
    font-weight: 700;
}

.student-fee-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.72rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-fee-status-open,
.student-fee-status-partial {
    background: hsl(42 96% 56% / 0.14);
    color: hsl(38 92% 44%);
}

.student-fee-status-paid {
    background: hsl(152 60% 42% / 0.14);
    color: hsl(151 65% 34%);
}

.student-fee-status-overdue {
    background: hsl(0 84% 60% / 0.14);
    color: hsl(0 72% 49%);
}

.student-fee-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.student-fee-stat {
    padding: 0.9rem;
    border-radius: 18px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.75);
    background: hsl(var(--bg-surface-hsl) / 0.42);
}

.student-fee-stat span,
.student-fee-progress-top span,
.student-fee-card-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.student-fee-stat strong,
.student-fee-progress-top strong {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 700;
}

.student-fee-progress {
    margin-top: 1rem;
}

.student-fee-line-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
}

.student-fee-line-item {
    padding: 0.8rem 0.95rem;
    border-radius: 16px;
    background: hsl(var(--bg-surface-hsl) / 0.34);
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.65);
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.student-fee-line-item strong {
    color: var(--text-primary);
    font-weight: 700;
}

.student-fee-card-footer {
    margin-top: 1rem;
}

.student-fee-empty-state {
    padding: 2.25rem 1.25rem;
    text-align: center;
    border-radius: 24px;
    border: 1px dashed hsl(var(--border-subtle-hsl) / 0.8);
    background: hsl(var(--bg-app-hsl) / 0.3);
}

.student-fee-empty-state h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.student-fee-empty-state p {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .student-fee-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .student-fee-filter-bar,
    .student-fee-card-head,
    .student-fee-card-footer,
    .student-fee-progress-top,
    .student-fee-line-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .student-fee-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Student timetable portal */
.student-timetable-main-grid {
    align-items: start;
}

.student-timetable-board-panel {
    position: relative;
}

.student-timetable-board-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 24px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.85);
    background:
        linear-gradient(180deg, hsl(var(--bg-app-hsl) / 0.46), hsl(var(--bg-surface-hsl) / 0.58));
}

.student-timetable-board {
    display: grid;
    grid-template-columns: 180px repeat(var(--day-count), minmax(160px, 1fr));
    min-width: 980px;
}

.student-timetable-head,
.student-timetable-time-cell,
.student-timetable-slot {
    min-height: 120px;
    padding: 1rem;
    border-right: 1px solid hsl(var(--border-subtle-hsl) / 0.72);
    border-bottom: 1px solid hsl(var(--border-subtle-hsl) / 0.72);
}

.student-timetable-head {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    background: hsl(var(--bg-surface-hsl) / 0.74);
    color: var(--text-primary);
    text-align: center;
    font-weight: 800;
}

.student-timetable-head small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.student-timetable-head-time,
.student-timetable-time-cell {
    background:
        linear-gradient(155deg, hsl(var(--accent-primary-hsl) / 0.14), transparent 65%),
        hsl(var(--bg-surface-hsl) / 0.82);
}

.student-timetable-time-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.student-timetable-time-cell strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 800;
}

.student-timetable-time-cell span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.student-timetable-slot {
    background: hsl(var(--bg-surface-hsl) / 0.42);
}

.student-timetable-slot.is-today,
.student-timetable-head.is-today {
    background:
        linear-gradient(155deg, hsl(27 95% 58% / 0.18), transparent 60%),
        hsl(var(--bg-surface-hsl) / 0.78);
}

.student-timetable-subject {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.student-timetable-meta {
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}

.student-timetable-empty {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    padding-top: 1.5rem;
}

.student-timetable-empty-state {
    margin-top: 1rem;
}

.student-timetable-dashboard {
    gap: 1.25rem;
}

.student-timetable-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.student-timetable-hero-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.student-timetable-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: hsl(var(--accent-primary-hsl) / 0.12);
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.student-timetable-hero-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.student-timetable-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.student-timetable-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.student-timetable-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    background:
        linear-gradient(180deg, hsl(var(--bg-surface-hsl) / 0.96), hsl(var(--bg-surface-hsl) / 0.88));
    box-shadow: var(--shadow-sm);
    padding: 1.2rem;
}

.student-timetable-stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    /* color: hsl(var(--bg-surface-hsl) / 0.92); */
    box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.28);
}

.student-timetable-stat-icon svg {
    width: 28px;
    height: 28px;
    opacity: 0.92;
}

.student-timetable-stat-icon-indigo {
    background: linear-gradient(135deg, hsl(245 78% 63% / 0.24), hsl(257 88% 86% / 0.42));
}

.student-timetable-stat-icon-emerald {
    background: linear-gradient(135deg, hsl(160 84% 42% / 0.2), hsl(154 66% 86% / 0.42));
}

.student-timetable-stat-icon-sky {
    background: linear-gradient(135deg, hsl(199 89% 48% / 0.2), hsl(208 95% 86% / 0.42));
}

.student-timetable-stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.student-timetable-stat-value {
    margin-top: 0.55rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2vw, 2.05rem);
    line-height: 1.05;
}

.student-timetable-stat-value-accent {
    color: var(--accent-primary);
}

.student-timetable-stat-meta {
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.student-timetable-focus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.student-timetable-focus-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    border-radius: 16px;
    background: hsl(var(--accent-primary-hsl) / 0.08);
    padding: 0.8rem 0.5rem;
}

.student-timetable-focus-pill strong {
    color: #4f46e5;
    font-size: 1rem;
    font-weight: 800;
}

.student-timetable-focus-pill span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.student-timetable-focus-pill-green {
    background: hsl(158 64% 52% / 0.09);
}

.student-timetable-focus-pill-green strong {
    color: #059669;
}

.student-timetable-focus-pill-amber {
    background: hsl(40 96% 56% / 0.12);
}

.student-timetable-focus-pill-amber strong {
    color: #d97706;
}

.student-timetable-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.student-timetable-day-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.student-timetable-day-pill,
.student-timetable-mini-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-app-hsl) / 0.55);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: 180ms ease;
}

.student-timetable-day-pill {
    padding: 0.6rem 0.9rem;
}

.student-timetable-focus-filter {
    gap: 0.45rem;
    padding-inline: 1rem;
}

.student-timetable-focus-filter.tone-dark {
    background: hsl(223 31% 17% / 0.06);
    color: #1e293b;
}

.student-timetable-focus-filter.tone-indigo {
    color: #5b6f93;
}

.student-timetable-focus-filter.tone-emerald {
    color: #4f7c73;
}

.student-timetable-focus-filter.tone-amber {
    color: #8c6a24;
}

.student-timetable-day-pill:hover,
.student-timetable-mini-day:hover {
    border-color: hsl(var(--accent-primary-hsl) / 0.38);
    color: var(--accent-primary);
}

.student-timetable-day-pill.is-active,
.student-timetable-mini-day.is-active {
    background: hsl(var(--accent-primary-hsl) / 0.12);
    border-color: hsl(var(--accent-primary-hsl) / 0.22);
    color: var(--accent-primary);
}

.student-timetable-focus-filter.tone-dark.is-active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

.student-timetable-toolbar-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.student-timetable-board-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.student-timetable-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 16px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-app-hsl) / 0.7);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.78rem 1rem;
    transition: 180ms ease;
}

.student-timetable-expand-btn:hover {
    border-color: hsl(var(--accent-primary-hsl) / 0.35);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.student-timetable-expand-btn:focus-visible {
    outline: 2px solid hsl(var(--accent-primary-hsl) / 0.28);
    outline-offset: 2px;
}

.student-timetable-expand-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.student-timetable-expand-icon-close {
    display: none;
}

.student-timetable-panel-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.student-timetable-week-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 18px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.85);
    background: hsl(var(--bg-app-hsl) / 0.62);
    padding: 0.4rem;
}

.student-timetable-week-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: 180ms ease;
}

.student-timetable-week-nav-btn:hover {
    background: hsl(var(--bg-surface-hsl) / 0.95);
    color: var(--accent-primary);
}

.student-timetable-week-nav-btn span {
    font-size: 1.35rem;
    line-height: 1;
}

.student-timetable-week-nav-center {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 14px;
    background: hsl(var(--bg-surface-hsl) / 0.86);
    padding: 0.65rem 0.95rem;
}

.student-timetable-week-nav-center span {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.student-timetable-week-nav-center strong {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.student-timetable-expanded {
    overflow: hidden;
}

body.student-timetable-expanded .sidebar,
body.student-timetable-expanded .topbar {
    opacity: 0;
    pointer-events: none;
}

.student-timetable-board-panel.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-radius: 0;
    background:
        linear-gradient(180deg, hsl(var(--bg-surface-hsl) / 0.98), hsl(var(--bg-surface-hsl) / 0.94));
    box-shadow:
        0 28px 80px hsl(224 41% 15% / 0.26),
        0 0 0 1px hsl(var(--border-subtle-hsl) / 0.92);
}

.student-timetable-board-panel.is-expanded::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: hsl(223 35% 12% / 0.46);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.student-timetable-board-panel.is-expanded .student-panel-head {
    align-items: center;
    padding-inline: 0.25rem;
}

.student-timetable-board-panel.is-expanded .student-timetable-board-wrap {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: auto;
    margin-top: 1rem;
    border-radius: 28px;
    scrollbar-gutter: stable both-edges;
}

.student-timetable-board-panel.is-expanded .student-timetable-board {
    min-height: 100%;
    min-width: max-content;
}

.student-timetable-board-panel.is-expanded .student-timetable-expand-icon-open {
    display: none;
}

.student-timetable-board-panel.is-expanded .student-timetable-expand-icon-close {
    display: block;
}

@media (max-width: 768px) {
    .student-timetable-board {
        grid-template-columns: 150px repeat(var(--day-count), minmax(150px, 1fr));
        min-width: 860px;
    }

    .student-timetable-head,
    .student-timetable-time-cell,
    .student-timetable-slot {
        min-height: 108px;
        padding: 0.85rem;
    }
}

.student-timetable-head.is-selected {
    background:
        linear-gradient(155deg, hsl(var(--accent-primary-hsl) / 0.14), transparent 60%),
        hsl(var(--bg-surface-hsl) / 0.82);
    color: var(--accent-primary);
}

.student-timetable-slot.is-selected {
    background:
        linear-gradient(155deg, hsl(var(--accent-primary-hsl) / 0.06), transparent 60%),
        hsl(var(--bg-surface-hsl) / 0.48);
}

.student-timetable-entry-card {
    min-height: 100%;
    border-radius: 18px;
    border: 1px solid transparent;
    padding: 0.95rem;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.student-timetable-entry-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.student-timetable-tone-indigo {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(224, 231, 255, 0.82));
    border-color: rgba(129, 140, 248, 0.34);
}

.student-timetable-tone-blue {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.82));
    border-color: rgba(96, 165, 250, 0.34);
}

.student-timetable-tone-violet {
    background: linear-gradient(180deg, rgba(245, 243, 255, 0.96), rgba(237, 233, 254, 0.82));
    border-color: rgba(167, 139, 250, 0.34);
}

.student-timetable-tone-emerald {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(209, 250, 229, 0.82));
    border-color: rgba(52, 211, 153, 0.34);
}

.student-timetable-tone-amber {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.82));
    border-color: rgba(251, 191, 36, 0.34);
}

.student-timetable-tone-rose {
    background: linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 228, 230, 0.82));
    border-color: rgba(251, 113, 133, 0.34);
}

html[data-theme="dark"] .student-timetable-entry-card {
    box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.03);
}

html[data-theme="dark"] .student-timetable-tone-indigo {
    background: linear-gradient(180deg, rgba(52, 67, 111, 0.82), rgba(36, 49, 86, 0.9));
    border-color: rgba(129, 140, 248, 0.34);
}

html[data-theme="dark"] .student-timetable-tone-blue {
    background: linear-gradient(180deg, rgba(31, 68, 112, 0.82), rgba(22, 50, 87, 0.9));
    border-color: rgba(96, 165, 250, 0.34);
}

html[data-theme="dark"] .student-timetable-tone-violet {
    background: linear-gradient(180deg, rgba(74, 54, 116, 0.84), rgba(52, 39, 88, 0.92));
    border-color: rgba(167, 139, 250, 0.34);
}

html[data-theme="dark"] .student-timetable-tone-emerald {
    background: linear-gradient(180deg, rgba(28, 86, 88, 0.84), rgba(20, 64, 66, 0.92));
    border-color: rgba(52, 211, 153, 0.34);
}

html[data-theme="dark"] .student-timetable-tone-amber {
    background: linear-gradient(180deg, rgba(111, 87, 29, 0.88), rgba(84, 62, 18, 0.94));
    border-color: rgba(251, 191, 36, 0.38);
}

html[data-theme="dark"] .student-timetable-tone-rose {
    background: linear-gradient(180deg, rgba(118, 48, 76, 0.84), rgba(90, 35, 56, 0.92));
    border-color: rgba(251, 113, 133, 0.34);
}

html[data-theme="dark"] .student-timetable-entry-card .student-timetable-subject {
    color: hsl(var(--text-primary-hsl));
}

html[data-theme="dark"] .student-timetable-entry-card .student-timetable-meta,
html[data-theme="dark"] .student-timetable-entry-card .student-timetable-cell-day {
    color: hsl(210 32% 78%);
}

html[data-theme="dark"] .student-timetable-entry-card .student-timetable-room-badge {
    background: hsl(0 0% 100% / 0.12);
    color: hsl(var(--text-primary-hsl));
}

.student-timetable-entry-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.student-timetable-room-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
    padding: 0.28rem 0.48rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-timetable-cell-day {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.student-timetable-week-empty {
    margin-top: 1rem;
    border-radius: 24px;
    border: 1px dashed hsl(var(--border-subtle-hsl) / 0.85);
    background: hsl(var(--bg-app-hsl) / 0.38);
    padding: 1.8rem 1.25rem;
    text-align: center;
}

.student-timetable-week-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.85rem;
    border-radius: 999px;
    background: hsl(var(--accent-primary-hsl) / 0.1);
    color: var(--accent-primary);
}

.student-timetable-week-empty-icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.student-timetable-week-empty h3 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.student-timetable-week-empty p {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.student-timetable-empty-state-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    border-radius: 18px;
    border: 1px dashed hsl(var(--border-subtle-hsl) / 0.7);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 700;
}

.student-timetable-count-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: hsl(var(--bg-app-hsl) / 0.7);
    padding: 0.45rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
}

.student-timetable-mini-days {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0.35rem;
    border-radius: 18px;
    background: hsl(var(--bg-app-hsl) / 0.55);
}

.student-timetable-mini-day {
    padding: 0.55rem 0.35rem;
    border-radius: 12px;
    border-color: transparent;
    font-size: 0.75rem;
}

.student-timetable-selected-list {
    gap: 0.9rem;
}

.student-timetable-selected-item {
    border-radius: 20px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.9);
    background: hsl(var(--bg-surface-hsl) / 0.74);
    padding: 1rem;
}

.student-timetable-selected-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.student-timetable-selected-time {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.student-timetable-selected-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.student-timetable-tone-dot-indigo { background: #4f46e5; }
.student-timetable-tone-dot-blue { background: #2563eb; }
.student-timetable-tone-dot-violet { background: #7c3aed; }
.student-timetable-tone-dot-emerald { background: #059669; }
.student-timetable-tone-dot-amber { background: #d97706; }
.student-timetable-tone-dot-rose { background: #e11d48; }

.student-timetable-selected-tag {
    border-radius: 999px;
    background: hsl(var(--accent-primary-hsl) / 0.1);
    padding: 0.28rem 0.55rem;
    color: var(--accent-primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.student-timetable-selected-subject {
    margin-top: 0.8rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.15;
}

.student-timetable-selected-meta {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.student-timetable-room-inline {
    display: inline-flex;
    align-items: center;
    margin-left: 0.45rem;
    border-radius: 10px;
    background: hsl(var(--bg-app-hsl) / 0.82);
    padding: 0.2rem 0.45rem;
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-timetable-selected-note {
    margin-top: 0.8rem;
    border-radius: 14px;
    border: 1px solid hsl(var(--border-subtle-hsl) / 0.8);
    background: hsl(var(--bg-app-hsl) / 0.45);
    padding: 0.8rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

.student-timetable-coach-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(135deg, #272d8a 0%, #1c225a 52%, #171b43 100%);
    box-shadow: var(--shadow-md);
    padding: 1.35rem;
    color: #eef2ff;
}

.student-timetable-coach-card::before {
    content: "";
    position: absolute;
    top: -2rem;
    right: -1rem;
    width: 10rem;
    height: 10rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.24), transparent 70%);
    pointer-events: none;
}

.student-timetable-coach-kicker {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #c7d2fe;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.student-timetable-coach-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #34d399;
}

.student-timetable-coach-copy {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    color: #eef2ff;
    font-size: 0.95rem;
    line-height: 1.65;
    font-weight: 600;
}

.student-timetable-coach-metrics {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
    padding: 0.95rem 1rem;
}

.student-timetable-coach-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    color: #cbd5e1;
    font-size: 0.83rem;
}

.student-timetable-coach-row + .student-timetable-coach-row {
    margin-top: 0.7rem;
}

.student-timetable-coach-row strong {
    color: #ffffff;
    font-size: 0.83rem;
    font-weight: 800;
}

.student-timetable-coach-footnote {
    position: relative;
    z-index: 1;
    margin-top: 0.95rem;
    color: #a5b4fc;
    font-size: 0.74rem;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .student-timetable-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .student-timetable-hero {
        grid-template-columns: 1fr;
    }

    .student-timetable-hero-actions {
        justify-content: flex-start;
    }

    .student-timetable-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .student-timetable-week-nav {
        width: 100%;
        justify-content: space-between;
    }

    .student-timetable-week-nav-center {
        flex: 1;
        justify-content: center;
    }

    .student-timetable-board-actions {
        width: 100%;
        justify-content: stretch;
    }

    .student-timetable-expand-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .student-timetable-board-panel.is-expanded {
        padding: 1rem;
    }

    .student-timetable-board-panel.is-expanded .student-timetable-board-wrap {
        border-radius: 20px;
    }
}

@media (max-width: 640px) {
    .student-timetable-stat-grid {
        grid-template-columns: 1fr;
    }

    .student-timetable-mini-days {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .tenant-admin-hero {
        grid-template-columns: 1fr;
    }

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

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

    .tenant-admin-panel--wide {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .tenant-admin-hero__stats,
    .tenant-admin-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .tenant-admin-hero {
        padding: 1.3rem;
        border-radius: 1.5rem;
    }

    .tenant-admin-hero__title {
        font-size: 2rem;
        line-height: 1.1;
    }

    .tenant-admin-hero__copy {
        font-size: 0.92rem;
    }

    .tenant-admin-hero__stats,
    .tenant-admin-kpi-grid,
    .tenant-admin-stat-grid,
    .tenant-admin-actions,
    .tenant-admin-location {
        grid-template-columns: 1fr;
    }

    .tenant-admin-panel__head {
        flex-direction: column;
    }

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

    .tenant-admin-spotlight {
        width: 100%;
        text-align: left;
    }
}
