* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--primary-soft) 75%, transparent), transparent 42%),
        linear-gradient(180deg, var(--background-main), color-mix(in srgb, var(--background-main) 72%, var(--background-surface)));
    color: var(--text-main);
}

body.dialog-open {
    overflow: hidden;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

input,
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: 14px;
    background: var(--background-surface);
    color: var(--text-main);
    line-height: 1.15;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.guest-shell,
.app-shell {
    min-height: 100vh;
}

.guest-body {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.landing-body {
    min-height: 100vh;
    padding: 2rem;
}

.landing-shell {
    display: grid;
    gap: 2rem;
    width: min(100%, 72rem);
    margin: 0 auto;
}

.landing-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.guest-panel {
    width: min(100%, 32rem);
    padding: 2rem;
    border: 1px solid var(--border-default);
    border-radius: 1.5rem;
    background: color-mix(in srgb, var(--background-surface) 92%, var(--primary-soft));
    box-shadow: var(--shadow-soft);
}

.guest-panel-wide {
    width: min(100%, 40rem);
}

.brand-block,
.panel-stack,
.card,
.hero-card,
.stat-card,
.notice,
.placeholder-panel,
.landing-copy,
.landing-hero {
    display: grid;
    gap: 0.75rem;
}

.eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.brand-name {
    display: block;
    margin-top: 0.55rem;
    margin-bottom: 0.6rem;
    white-space: pre-line;
    text-align: center;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.sidebar-brand {
    display: grid;
    justify-items: center;
}

.sidebar-brand .brand-lockup {
    justify-content: center;
}

.brand-lockup-compact {
    margin-bottom: 0.4rem;
}

.brand-logo {
    width: auto;
    height: 4.6rem;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-campus {
    display: grid;
    gap: 0.08rem;
    line-height: 1.2;
}

.brand-campus > span {
    display: block;
}

.landing-hero {
    min-height: clamp(18rem, 48vh, 30rem);
    align-content: end;
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid var(--border-default);
    border-radius: 2rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 82%, var(--background-surface)), color-mix(in srgb, var(--secondary-soft) 72%, var(--background-surface))),
        var(--background-surface);
    box-shadow: var(--shadow-soft);
}

.landing-copy {
    width: min(100%, 34rem);
}

.app-shell {
    display: grid;
    grid-template-columns: 18rem 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 1.5rem;
    align-content: start;
    align-self: start;
    height: 100dvh;
    padding: 1.5rem;
    overflow: hidden;
    background: color-mix(in srgb, var(--primary) 88%, var(--neutral-dark));
    color: var(--text-inverse);
}

.sidebar-backdrop {
    display: none;
}

.sidebar a {
    color: var(--text-inverse);
}

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: 2px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.nav-link,
.nav-sublink {
    display: grid;
    align-items: center;
    min-height: 36px;
    line-height: 1.15;
}

.nav-link {
    padding: 6px 11px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--background-surface) 0%, transparent);
}

.nav-link.is-active,
.nav-link:hover {
    background: color-mix(in srgb, var(--background-surface) 12%, transparent);
    text-decoration: none;
}

.nav-group {
    display: grid;
    gap: 1px;
}

.nav-group-toggle {
    width: 100%;
    border: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.nav-subnav {
    display: none;
    gap: 1px;
    margin-top: 2px;
    padding-left: 11px;
    border-left: 2px solid rgba(255, 255, 255, 0.22);
}

.nav-group.is-open .nav-subnav {
    display: grid;
}

.nav-sublink {
    padding: 5px 10px;
    border-radius: 12px;
    color: var(--text-inverse);
    background: color-mix(in srgb, var(--background-surface) 0%, transparent);
}

.nav-sublink:hover,
.nav-sublink.is-active {
    background: color-mix(in srgb, var(--background-surface) 12%, transparent);
    text-decoration: none;
}

.statistics-filter-card {
    gap: 1rem;
}

.statistics-card {
    gap: 0.55rem;
    padding: 0.5rem;
}

.statistics-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: end;
}

.statistics-filters .form-field {
    min-width: 0;
}

.statistics-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    grid-column: 1 / -1;
}

.apprende-query-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.apprende-query-grid .form-field {
    min-width: 0;
}

.apprende-query-grid .filters-actions {
    grid-column: 1 / -1;
}

.statistics-universe-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    padding-top: 0.2rem;
}

.statistics-universe-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.statistics-universe-summary strong {
    font-size: 0.92rem;
}

.statistics-section {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.statistics-section-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.statistics-section-summary::-webkit-details-marker {
    display: none;
}

.statistics-section-summary::before {
    content: '▸';
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1;
    transform: translateY(1px);
}

.statistics-section[open] .statistics-section-summary::before {
    content: '▾';
}

.statistics-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.statistics-line-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    margin-top: 0.8rem;
}

.statistics-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
}

.statistics-card-header h4 {
    margin: 0;
}

.statistics-card-header p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.statistics-chart {
    width: 100%;
    height: 15rem;
}

.statistics-card-line {
    width: 100%;
}

.statistics-chart-line {
    height: 24rem;
}

.schedule-adjustment-inline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 900px) {
    .statistics-filters,
    .statistics-universe-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .statistics-filters,
    .statistics-universe-summary,
    .statistics-card-grid {
        grid-template-columns: 1fr;
    }

    .statistics-card-line {
        width: 100%;
    }

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

    .statistics-chart-line {
        height: 20rem;
    }
}

.nav-group.is-open > .nav-group-toggle {
    font-weight: 700;
}

.sidebar .user-chip span {
    color: color-mix(in srgb, var(--primary-soft) 82%, var(--background-surface));
}

.sidebar-system-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    margin-top: 0.25rem;
    text-align: center;
}

.sidebar-system-brand__logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 27px;
    object-fit: contain;
}

.sidebar-system-brand__version {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: color-mix(in srgb, var(--primary-soft) 82%, var(--background-surface));
    white-space: nowrap;
}

.sidebar-footer,
.main-column,
.content,
.filters-grid,
.filters-grid-compact,
.form-grid,
.grid-2,
.stats-grid,
.placeholder-grid {
    display: grid;
    gap: 1rem;
}

.sidebar-footer {
    position: relative;
}

.main-column {
    padding: 1.5rem;
    min-width: 0;
    align-content: start;
}

.content {
    align-content: start;
}

.topbar {
    display: grid;
    gap: 4px;
    padding-block: 4px;
    margin-bottom: 4px;
}

.topbar-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.topbar-heading {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.topbar-meta .badge {
    flex: 0 0 auto;
    align-self: flex-start;
}

.page-title,
h1,
h2,
h3,
p {
    margin: 0;
}

.hero-card,
.card,
.stat-card {
    padding: 1.35rem;
    border: 1px solid var(--border-default);
    border-radius: 1.3rem;
    background: color-mix(in srgb, var(--background-surface) 94%, var(--primary-soft));
    box-shadow: var(--shadow-soft);
}

.hero-card {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
}

.hero-meta,
.actions-cell,
.filters-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-welcome-copy {
    min-width: 0;
}

.dashboard-welcome-photo {
    width: 7rem;
    height: 7rem;
    border-radius: 999px;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-soft);
    flex: 0 0 auto;
}

.dashboard-welcome-media {
    margin-left: auto;
}

.dashboard-welcome-status {
    width: 100%;
    margin-top: 0.8rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.placeholder-grid {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.placeholder-panel {
    min-height: 7rem;
    place-items: center;
    border: 1px dashed var(--border-strong);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--background-surface) 76%, var(--primary-soft));
    color: var(--text-muted);
}

.dashboard-widget-trigger {
    width: 100%;
    border: 1px dashed var(--border-strong);
    cursor: pointer;
    font: inherit;
}

.dashboard-widget-trigger:hover {
    border-color: var(--border-accent);
    color: var(--text-default);
}

.dashboard-qr-dialog {
    width: min(34rem, calc(100vw - 2rem));
}

.dashboard-qr-region {
    min-height: 16rem;
}

.student-filter-layout {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(16rem, 24rem) minmax(18rem, 1fr);
    align-items: end;
}

.student-filter-selects {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    width: 100%;
}

.student-filter-selects > .form-field {
    min-width: 0;
}

.student-filter-search {
    display: grid;
    gap: 6px;
}

.student-filter-search .inline-search {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.applications-search-bar {
    margin-bottom: 12px;
}

@media (max-width: 920px) {
    .student-filter-layout {
        grid-template-columns: 1fr;
    }
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border: 0;
    border-radius: 14px;
    line-height: 1.1;
    cursor: pointer;
}

.button-primary {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
}

.button-secondary {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
}

.button-danger {
    background: var(--button-danger-bg);
    color: var(--button-danger-text);
}

.button-full {
    width: 100%;
}

.button-icon-only {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
}

.button-icon-only svg {
    width: 18px;
    height: 18px;
}

.button-inline {
    padding: 6px 11px;
}

.qr-video {
    width: 100%;
    min-height: 18rem;
    border-radius: 1rem;
    background: var(--neutral-dark);
    object-fit: cover;
}

.attendance-scanner-card {
    position: relative;
    overflow: hidden;
}

.scanner-name-pop {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: color-mix(in srgb, var(--background-surface) 18%, transparent);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.scanner-name-pop.is-visible {
    opacity: 1;
    transform: scale(1);
}

.scanner-name-pop span {
    max-width: min(100%, 16ch);
    padding: 1rem 1.3rem;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--success) 86%, white 14%);
    color: #ffffff;
    font-size: clamp(1.9rem, 4.8vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    text-wrap: balance;
    box-shadow: 0 1rem 2.3rem rgba(0, 0, 0, 0.18);
}

.scanner-feedback,
.scanner-status {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-default);
    background: color-mix(in srgb, var(--background-surface) 92%, var(--primary-soft));
}

.scanner-status {
    grid-template-columns: 1fr;
}

.scanner-status-idle {
    background: color-mix(in srgb, var(--background-surface) 78%, var(--info) 22%);
    border-color: color-mix(in srgb, var(--info) 45%, var(--border-default));
}

.scanner-status-success {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--success) 28%);
    border-color: color-mix(in srgb, var(--success) 50%, var(--border-default));
}

.scanner-status-warning {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--warning) 28%);
    border-color: color-mix(in srgb, var(--warning) 50%, var(--border-default));
}

.scanner-status-error {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--danger) 28%);
    border-color: color-mix(in srgb, var(--danger) 50%, var(--border-default));
}

.scanner-status-offline {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--secondary) 28%);
    border-color: color-mix(in srgb, var(--secondary) 50%, var(--border-default));
}

.scanner-history {
    display: grid;
    gap: 0.65rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-default);
    background: color-mix(in srgb, var(--background-surface) 94%, var(--primary-soft));
}

.scanner-history-list {
    display: grid;
    gap: 0.55rem;
    max-height: 22rem;
    overflow: auto;
}

.scanner-history-item,
.scanner-history-empty {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.8rem;
    background: var(--background-surface);
    border: 1px solid var(--border-default);
}

.scanner-history-item strong {
    font-size: 0.92rem;
}

.scanner-history-item span,
.scanner-history-empty {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
}

.scanner-history-item {
    align-items: start;
    grid-template-columns: auto 1fr;
    column-gap: 0.65rem;
}

.scanner-history-item strong {
    grid-column: 1 / -1;
}

.scanner-history-success strong {
    color: var(--success);
}

.scanner-history-warning strong {
    color: var(--warning);
}

.scanner-history-error strong {
    color: var(--danger);
}

.scanner-history-offline strong {
    color: var(--secondary);
}

.scanner-pending-banner {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid color-mix(in srgb, var(--warning) 50%, var(--border-default));
    background: color-mix(in srgb, var(--background-surface) 74%, var(--warning) 26%);
}

.scanner-pending-banner.is-hidden {
    display: none;
}

.scanner-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.55rem;
}

.scanner-summary-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.8rem;
    background: var(--background-surface);
    border: 1px solid var(--border-default);
}

.scanner-summary-item span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.scanner-summary-item strong {
    font-size: 1rem;
    color: var(--text-default);
}

.schedule-group-grade-list {
    display: grid;
    gap: 8px;
}

.schedule-group-grade-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.schedule-group-grade-row strong {
    min-width: 2rem;
    line-height: 28px;
}

.schedule-group-inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.scanner-mode-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.scanner-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: var(--background-surface);
}

.scanner-history-item {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.scanner-history-item strong,
.scanner-history-item span:first-of-type {
    grid-column: 1;
}

.scanner-history-state {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    font-size: 1.15rem;
    font-weight: 700;
}

.scanner-history-state.is-pending {
    color: var(--danger);
}

.scanner-history-state.is-registered {
    color: var(--success);
}

.scanner-history-state.is-duplicate,
.scanner-history-state.is-warning {
    color: var(--warning);
}

.scanner-history-state.is-error {
    color: var(--danger);
}


.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 2.9rem;
}

.password-toggle {
    position: absolute;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle:hover {
    background: color-mix(in srgb, var(--background-main) 92%, transparent);
    color: var(--text-main);
}

.password-toggle svg {
    width: 1rem;
    height: 1rem;
}

.field-hint-popover {
    position: absolute;
    z-index: 40;
    max-width: 18rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--background-surface) 96%, var(--primary-soft));
    box-shadow: var(--shadow-soft);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transform: translateY(0.2rem);
    transition: opacity 140ms ease, transform 140ms ease;
}

.field-hint-popover::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -0.45rem;
    width: 0.9rem;
    height: 0.9rem;
    background: inherit;
    border-left: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    transform: translateY(-50%) rotate(45deg);
}

.field-hint-popover.is-left::after {
    left: auto;
    right: -0.45rem;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid var(--border-default);
    border-top: 1px solid var(--border-default);
}

.field-hint-popover.is-bottom::after {
    top: -0.45rem;
    left: 1.25rem;
    border-left: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    border-right: 0;
    border-top: 0;
    transform: rotate(135deg);
}

.field-hint-popover.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.86rem;
    line-height: 1.1;
}

.badge-success {
    background: var(--alert-success-bg);
    color: var(--success);
}

.badge-danger {
    background: color-mix(in srgb, var(--danger) 16%, white);
    color: var(--danger);
}

.badge-warning {
    background: var(--alert-warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--alert-info-bg);
    color: var(--info);
}

.alert,
.notice {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-default);
}

.alert-success,
.notice-info {
    background: var(--alert-info-bg);
}

.alert-warning,
.notice-warning {
    background: var(--alert-warning-bg);
}

.alert-danger,
.notice-danger {
    background: var(--alert-danger-bg);
}

.flash-stack {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.required-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.required-indicator::after {
    content: "*";
    color: var(--danger);
    font-weight: 700;
    line-height: 1;
    transition: opacity 140ms ease, transform 140ms ease;
}

.required-indicator.is-satisfied::after {
    opacity: 0;
    transform: scale(0.7);
}

.form-grid-3,
.filters-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.form-span-2 {
    grid-column: span 2;
}

.form-span-3,
.detail-span {
    grid-column: span 3;
}

.helper-text {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.consent-dialog {
    width: min(100%, 34rem);
    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: 1.3rem;
    background: var(--background-surface);
    box-shadow: var(--shadow-soft);
}

.consent-dialog::backdrop {
    background: color-mix(in srgb, var(--neutral-dark) 40%, transparent);
}

.consent-dialog > div {
    padding: 1.5rem;
}

.dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

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

.detail-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.detail-grid div,
.data-card,
.timeline-item {
    display: grid;
    gap: 0.3rem;
}

.data-card,
.timeline-item {
    padding: 1rem;
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    background: var(--background-surface);
}

.student-photo-frame {
    width: 100%;
    max-width: 18rem;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--background-subtle);
}

.student-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transform: scale(1.01);
    transform-origin: center;
}

.student-photo-placeholder-frame {
    display: grid;
    place-items: center;
}

.student-photo-placeholder-frame .placeholder-panel {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.student-summary-card {
    display: grid;
    gap: 0.7rem;
}

.student-summary-block {
    display: grid;
    gap: 0.6rem;
}

.student-summary-grid {
    display: grid;
    gap: 0.55rem 0.7rem;
}

.student-summary-grid > div {
    display: grid;
    gap: 0.22rem;
    min-width: 0;
}

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

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

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

.student-summary-divider {
    border-top: 1px solid var(--border-default);
}

@media (max-width: 1180px) {
    .student-summary-grid-7 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

@media (max-width: 820px) {
    .student-summary-grid-7,
    .student-summary-grid-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .student-summary-grid-7,
    .student-summary-grid-6,
    .student-summary-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.guardian-contact-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.document-row,
.inline-upload-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.document-row-copy {
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    text-align: center;
    width: 100%;
}

.inline-upload-form input[type="file"] {
    flex: 1 1 14rem;
}

.document-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.85rem;
}

.document-upload-card {
    gap: 0.65rem;
    padding: 0.9rem;
    align-content: start;
}

.inline-upload-form-compact {
    align-items: stretch;
    justify-content: initial;
    width: 100%;
}

.document-row-actions {
    display: flex;
    justify-content: center;
}

.document-upload-card .file-dropzone-compact {
    width: 100%;
    margin-inline: auto;
}

.student-photo-upload-form {
    width: 100%;
    max-width: 20rem;
    margin-inline: auto;
}

.student-photo-upload-form .file-dropzone-compact {
    width: 100%;
    margin-inline: auto;
}

.file-dropzone-compact {
    min-height: 5.75rem;
    padding: 0.8rem 0.9rem;
}

.file-dropzone-compact .file-dropzone-copy strong {
    font-size: 0.95rem;
}

.file-dropzone-compact .file-dropzone-copy [data-file-label] {
    font-size: 0.82rem;
    line-height: 1.25;
}

.button-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.module-nav {
    display: flex;
    column-gap: 12px;
    row-gap: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.module-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    line-height: 1.1;
    text-decoration: none;
}

.module-nav-link:hover {
    text-decoration: none;
}

.module-nav-link.is-active {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
}

.role-context-stack {
    gap: 12px;
}

.role-context-group {
    display: grid;
    gap: 8px;
}

.role-context-title {
    margin: 0;
    font-size: 0.98rem;
}

.role-context-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-context-form {
    margin: 0;
}

.app-toast,
.context-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    max-width: min(26rem, calc(100vw - 32px));
    padding: 10px 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--neutral-dark) 92%, black);
    color: var(--text-inverse);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(8px);
    animation: context-toast-in 180ms ease forwards, context-toast-out 180ms ease 9820ms forwards;
}

.app-toast-success {
    background: color-mix(in srgb, var(--success) 18%, var(--neutral-dark));
}

.app-toast-warning {
    background: color-mix(in srgb, var(--warning) 24%, var(--neutral-dark));
}

.app-toast-danger {
    background: color-mix(in srgb, var(--danger) 24%, var(--neutral-dark));
}

.app-toast-info {
    background: color-mix(in srgb, var(--primary) 30%, var(--neutral-dark));
}

@keyframes context-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes context-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

select[data-attendance-status-select][data-status-color="present"] {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--success) 28%);
    border-color: color-mix(in srgb, var(--success) 55%, var(--border-default));
}

select[data-attendance-status-select][data-status-color="late"],
select[data-attendance-status-select][data-status-color="late_justified"] {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--warning) 28%);
    border-color: color-mix(in srgb, var(--warning) 55%, var(--border-default));
}

select[data-attendance-status-select][data-status-color="absence_justified"],
select[data-attendance-status-select][data-status-color="absence_unjustified"] {
    background: color-mix(in srgb, var(--background-surface) 72%, var(--danger) 28%);
    border-color: color-mix(in srgb, var(--danger) 55%, var(--border-default));
}

.checkbox-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.checkbox-row input,
.checkbox-field input {
    width: auto;
}

.error-text {
    color: var(--button-danger-bg);
    font-weight: 600;
}

.form-actions-full {
    grid-column: 1 / -1;
}

.timeline-list {
    display: grid;
    gap: 0.9rem;
}

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

.content,
.card,
.hero-card,
.panel-stack,
.table-wrap,
form {
    min-width: 0;
}

.card > form {
    width: 100%;
    max-width: 100%;
}

nav[role="navigation"] {
    margin-top: 1rem;
}

nav[role="navigation"] svg {
    width: 0.95rem;
    height: 0.95rem;
    display: inline-block;
    vertical-align: middle;
}

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

.table-students {
    min-width: 108rem;
}

.students-infinite-loader,
.students-infinite-end {
    padding-top: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.table-edit-dialog {
    width: min(42rem, calc(100vw - 2rem));
}

.table-edit-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.table-edit-dialog-header form {
    margin: 0 0 0 auto;
    display: flex;
    align-items: center;
}

.dialog-close-button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.dialog-close-button:hover,
.dialog-close-button:focus-visible {
    color: var(--text-main);
}

.table-edit-danger-zone {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #d9dde6);
}

.subject-name-editable {
    display: inline-block;
    min-width: 10rem;
    outline: none;
    border-bottom: 1px dashed transparent;
}

.subject-name-editable:hover,
.subject-name-editable:focus {
    border-bottom-color: var(--border-default);
}

.status-actions-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    width: 100%;
}

.table-students th input,
.table-students th select {
    min-width: 0;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.table th,
.table td,
.data-table th,
.data-table td {
    padding: 0.8rem 0.7rem;
    border-bottom: 0;
    text-align: left;
    vertical-align: top;
    width: auto;
}

.table th,
.data-table th {
    background: var(--table-header-bg);
}

.table thead tr,
.table tbody tr,
.data-table thead tr,
.data-table tbody tr {
    box-shadow: inset 0 -1px 0 var(--border-default);
}

.table tbody tr:hover,
.data-table tbody tr:hover {
    background: var(--table-row-hover);
}

.quick-link {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    background: var(--background-surface);
}

.quick-link:hover {
    text-decoration: none;
    border-color: var(--border-strong);
}

.family-confirm-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.58);
    z-index: 80;
}

.family-confirm-modal {
    width: min(100%, 32rem);
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--background-surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.submit-feedback-overlay {
    z-index: 120;
}

.submit-feedback-modal {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    width: min(100%, 34rem);
}

.submit-feedback-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 3px solid rgba(35, 131, 204, 0.18);
    border-top-color: var(--brand-primary);
    animation: submit-feedback-spin 0.9s linear infinite;
}

.submit-feedback-progress-label {
    color: var(--text-default);
    font-size: 0.92rem;
}

.submit-feedback-steps {
    display: grid;
    gap: 0.6rem;
}

.submit-feedback-step {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.submit-feedback-step-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.submit-feedback-step.is-current {
    color: var(--text-default);
}

.submit-feedback-step.is-current .submit-feedback-step-icon {
    border-color: color-mix(in srgb, var(--brand-primary) 35%, white);
    background: color-mix(in srgb, var(--brand-primary) 14%, white);
    color: var(--brand-primary);
}

.submit-feedback-step.is-complete {
    color: var(--text-default);
}

.submit-feedback-step.is-complete .submit-feedback-step-icon {
    border-color: color-mix(in srgb, var(--success) 34%, white);
    background: color-mix(in srgb, var(--success) 16%, white);
    color: var(--success);
}

.submit-feedback-step.is-complete .submit-feedback-step-icon::before {
    content: "✓";
}

@keyframes submit-feedback-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.button-reset {
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.linked-student-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 1rem;
    align-items: start;
}

.linked-student-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.linked-student-line {
    display: block;
    width: 100%;
    line-height: 1.45;
}

.linked-student-presence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.linked-student-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.linked-student-photo-wrap {
    display: flex;
    justify-content: flex-end;
}

.linked-student-photo-frame {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--background-subtle);
}

.linked-student-photo {
    width: 100% !important;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transform: scale(1.2);
    transform-origin: center;
}

.linked-student-photo-placeholder {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.muted-text,
.user-chip span {
    color: var(--text-muted);
}

.list-compact {
    margin: 0;
    padding-left: 1rem;
}

.option-list {
    display: grid;
    gap: 0.55rem;
}

.option-list-columns {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.option-item {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.option-item input {
    width: auto;
}

.text-link {
    font-weight: 600;
}

.report-card-sheet {
    background: var(--background-surface);
}

.grade-import-input {
    min-width: 5.5rem;
    text-align: center;
}

.print-page {
    background: color-mix(in srgb, var(--background-surface) 92%, var(--primary-soft));
}

.print-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem;
}

.print-card {
    background: var(--background-surface);
}

.print-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.print-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default);
    background: var(--background-surface);
    color: var(--text-default);
    cursor: pointer;
}

@page {
    margin: 1.2cm;
}

@page letter {
    size: letter portrait;
}

@page oficio {
    size: 216mm 340mm portrait;
}

.print-page-letter {
    page: letter;
}

.print-page-oficio {
    page: oficio;
}

@media print {
    .print-shell {
        max-width: none;
        padding: 0;
    }

    .print-actions {
        display: none;
    }

    .card.print-card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.report-card-meta {
    display: grid;
    gap: 0.35rem;
}

.report-card-workshops {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: var(--table-header-bg);
}

.file-dropzone {
    position: relative;
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--background-surface) 90%, var(--primary-soft));
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.file-dropzone:hover,
.file-dropzone.is-dragover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--background-surface) 82%, var(--primary-soft));
    transform: translateY(-1px);
}

.file-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-dropzone-copy {
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    text-align: center;
    pointer-events: none;
}

.is-hidden {
    display: none !important;
}

.topbar-shift-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-shift-form select {
    min-width: 10rem;
}

.text-center {
    text-align: center;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.option-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

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

.field-error-input {
    border-color: var(--accent-danger, #b42318) !important;
    color: var(--accent-danger, #b42318);
    font-weight: 700;
}

.helper-text-error,
.text-danger {
    color: var(--accent-danger, #b42318);
}

.student-import-table input,
.student-import-table select {
    width: 100%;
}

.student-import-input-default {
    min-width: 9rem;
}

.student-import-input-medium {
    min-width: 14rem;
}

.student-import-input-wide {
    min-width: 18rem;
}

.student-import-select-short {
    min-width: 7rem;
}

.student-import-select-default {
    min-width: 10rem;
}

.class-cell-button {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 5rem;
    border: 1px dashed var(--border-default);
    border-radius: 0.85rem;
    background: var(--background-muted);
    color: var(--text-main);
    padding: 0.4rem 0.5rem 0.4rem 1.2rem;
    text-align: left;
    overflow-wrap: anywhere;
}

.class-cell-button::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 10px;
    border-radius: 0.85rem 0 0 0.85rem;
    background: var(--class-subject-color, transparent);
    box-shadow: inset -1px 0 0 rgba(22, 50, 75, 0.14);
}

.classes-grid {
    width: 100%;
    min-width: 60rem;
    table-layout: fixed;
}

.classes-grid-period-col {
    width: 6.25rem;
}

.classes-grid-day-col {
    width: calc((100% - 6.25rem) / 5);
}

.classes-grid td,
.classes-grid th {
    vertical-align: top;
}

.class-cell-lines {
    display: grid;
    gap: 0.18rem;
}

.class-cell-lines span,
.class-cell-placeholder {
    display: block;
    line-height: 1.2;
}

.form-field-checkbox {
    align-content: center;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.class-cell-button.is-success {
    border-color: #2f8f5b;
    background: #e7f6ed;
}

.class-cell-button.is-error {
    border-color: #c64646;
    background: #fdeceb;
}

.class-dialog {
    width: min(42rem, calc(100vw - 2rem));
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--background-surface);
}

.attendance-listing-cell {
    text-align: center;
}

.attendance-cell-button {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.attendance-cell-button span {
    display: inline-block;
}

.attendance-cell-button .badge {
    gap: 6px;
    align-items: center;
}

.attendance-badge-meta {
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.9;
}

.attendance-cell-dialog {
    width: min(26rem, calc(100vw - 2rem));
}

.class-dialog::backdrop {
    background: rgba(16, 24, 40, 0.32);
}

.nav-toggle {
    display: none;
}

.ham {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform 400ms;
}

.ham .line {
    fill: none;
    stroke: currentColor;
    stroke-width: 5.5;
    stroke-linecap: round;
    transition: stroke-dasharray 400ms, stroke-dashoffset 400ms, transform 400ms;
}

.ham8 .top {
    stroke-dasharray: 40 160;
}

.ham8 .middle {
    stroke-dasharray: 40 142;
    transform-origin: 50%;
}

.ham8 .bottom {
    stroke-dasharray: 40 85;
    transform-origin: 50%;
}

.ham8.active {
    transform: rotate(45deg);
}

.ham8.active .top {
    stroke-dashoffset: -64px;
}

.ham8.active .middle {
    transform: rotate(90deg);
}

.ham8.active .bottom {
    stroke-dashoffset: -64px;
}

@media (max-width: 920px) {
    :root {
        --mobile-topbar-main-height: 6.25rem;
    }

    html,
    body {
        min-height: 100%;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        z-index: 220;
        width: max-content;
        max-width: calc(100vw - 1rem);
        display: grid;
        grid-template-rows: 1fr auto;
        gap: 0.7rem;
        padding: calc(var(--mobile-topbar-main-height) + 0.75rem) 0.85rem 0.9rem;
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        background: color-mix(in srgb, var(--primary) 70%, transparent);
        backdrop-filter: blur(10px);
        box-shadow: none;
        transform: translateX(104%);
        transition: transform 180ms ease;
        border-top-left-radius: 0;
        clip-path: inset(var(--mobile-topbar-main-height) 0 0 0);
    }

    .sidebar.is-open {
        display: grid;
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        z-index: 200;
        display: block;
        border: 0;
        padding: 0;
        background: transparent;
        pointer-events: none;
    }

    .sidebar-backdrop.is-open {
        pointer-events: auto;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--text-main);
        box-shadow: none;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 400;
        width: 2.5rem;
        height: 2.5rem;
        outline: none;
        box-shadow: none;
    }

    .nav-toggle:focus,
    .nav-toggle:focus-visible,
    .nav-toggle:active {
        outline: none;
        box-shadow: none;
    }

    .hero-card {
        flex-direction: column;
    }

    .landing-header {
        flex-direction: column;
        align-items: stretch;
    }

    .linked-student-card {
        grid-template-columns: 1fr;
    }

    .linked-student-photo-wrap {
        justify-content: flex-start;
    }

    .brand-lockup {
        align-items: flex-start;
    }

    .brand-logo {
        height: 3.5rem;
    }

    .form-span-2,
    .form-span-3,
    .detail-span {
        grid-column: auto;
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-nav {
        align-content: start;
        gap: 0.15rem;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 0.1rem;
        min-width: max-content;
        justify-items: end;
    }

    .sidebar-footer {
        padding-top: 0.55rem;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        justify-items: end;
        text-align: right;
    }

    .sidebar .user-chip strong,
    .sidebar .user-chip span {
        display: block;
    }

    .main-column {
        padding: 1rem;
    }

    .topbar {
        position: relative;
        z-index: 20;
        display: block;
        gap: 0.5rem;
        padding-top: var(--mobile-topbar-main-height);
        margin-bottom: 6px;
    }

    .topbar-main {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 320;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        min-height: var(--mobile-topbar-main-height);
        padding: 0.85rem 1rem 0.75rem;
        background: color-mix(in srgb, var(--background-body) 92%, transparent);
        backdrop-filter: blur(10px);
    }

    .topbar-heading {
        flex: 1 1 auto;
    }

    .topbar-meta {
        position: relative;
        z-index: 10;
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: flex-end;
    }

    .page-title {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .brand-lockup-compact {
        gap: 0.55rem;
    }

    .brand-lockup-compact .brand-logo {
        height: 2.4rem;
    }

    .brand-lockup-compact .brand-campus {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .nav-link,
    .nav-sublink {
        font-size: 0.94rem;
        text-align: right;
    }

    .nav-link {
        padding: 0.35rem 0.2rem;
        background: transparent;
        width: fit-content;
    }

    .nav-sublink {
        padding: 0.3rem 0.1rem;
        background: transparent;
        width: fit-content;
        opacity: 0.9;
    }

    .nav-subnav {
        gap: 0.05rem;
        margin-top: 0.1rem;
        padding-left: 0;
        padding-right: 0.6rem;
        border-left: 0;
        border-right: 2px solid rgba(255, 255, 255, 0.22);
        justify-items: end;
    }

    .nav-group {
        gap: 0.05rem;
        justify-items: end;
    }

    .nav-group-toggle {
        text-align: right;
    }

    .nav-group.is-open > .nav-group-toggle {
        font-weight: 700;
    }

    .nav-toggle .ham {
        width: 39px;
        height: 39px;
    }

    .nav-link.is-active,
    .nav-link:hover,
    .nav-sublink:hover,
    .nav-sublink.is-active {
        background: transparent;
        text-decoration: none;
    }

    .sidebar .user-chip {
        gap: 0.15rem;
        justify-items: end;
        text-align: right;
    }

    .sidebar .user-chip span {
        font-size: 0.8rem;
        opacity: 0.9;
    }

    .sidebar .button-full {
        width: auto;
        justify-self: end;
    }

    .sidebar-system-brand {
        justify-content: center;
        text-align: center;
    }

    .sidebar-system-brand__logo {
        width: auto;
        height: 27px;
    }

    .sidebar-system-brand__version {
        font-size: 0.72rem;
    }
}

@media print {
    html,
    body,
    .app-body,
    .app-shell,
    .main-column,
    .content,
    .print-page,
    .print-card {
        background: #fff !important;
        box-shadow: none !important;
    }

    .sidebar,
    .topbar,
    .flash-stack,
    .report-card-screen-actions {
        display: none !important;
    }

    .app-shell,
    .main-column,
    .content {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .report-card-sheet {
        box-shadow: none;
        border: 0;
        margin: 0;
        padding: 0;
    }
}
