:root {
    --bg: #eef2f7;
    --bg-deep: #dde5ee;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --text: #222b3a;
    --muted: #607087;
    --line: rgba(25, 30, 43, 0.09);
    --brand: #46b82e;
    --brand-dark: #2f8f1d;
    --brand-soft: rgba(70, 184, 46, 0.1);
    --ink: #191e2b;
    --danger: #b42318;
    --danger-soft: #fbeae7;
    --success: #46b82e;
    --success-soft: #eaf8e6;
    --warning: #9a6700;
    --warning-soft: #fff7dd;
    --info: #2457a6;
    --info-soft: #e7efff;
    --shadow: 0 18px 46px rgba(25, 30, 43, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(70, 184, 46, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(25, 30, 43, 0.1), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a {
    color: inherit;
}

.app-shell {
    width: min(1320px, calc(100vw - 2rem));
    margin: 0 auto;
}

.page-shell {
    padding: 0.6rem 0 1.25rem;
}

.page-header > div:first-child,
.card-header > * {
    min-width: 0;
}

.drop-zone-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(25, 30, 43, 0.68);
    backdrop-filter: blur(4px);
}

.drop-zone-overlay.is-active {
    display: flex;
}

.drop-zone-panel {
    width: min(100%, 540px);
    padding: 2rem 2.2rem;
    border: 2px dashed rgba(70, 184, 46, 0.6);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(25, 30, 43, 0.18);
    text-align: center;
}

.drop-zone-title {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 800;
}

.drop-zone-copy {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.96rem;
}

.site-nav {
    margin-bottom: 0.85rem;
    background: linear-gradient(90deg, #191e2b 0%, #232c3f 100%);
    box-shadow: 0 14px 36px rgba(25, 30, 43, 0.22);
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-brand-logo {
    display: block;
    height: 42px;
    width: auto;
    max-width: min(260px, 48vw);
    object-fit: contain;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

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

.nav-link {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.nav-link-button {
    padding: 0.55rem 1rem;
    border: 1px solid rgba(70, 184, 46, 0.35);
    border-radius: 999px;
    background: rgba(70, 184, 46, 0.14);
}

.flash-stack {
    margin-bottom: 0.85rem;
}

.alert {
    display: flex;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid transparent;
    box-shadow: 0 10px 24px rgba(25, 30, 43, 0.08);
}

.alert + .alert {
    margin-top: 0.75rem;
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(21, 128, 61, 0.16);
}

.alert-danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(180, 35, 24, 0.14);
}

.alert-warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(161, 98, 7, 0.16);
}

.alert-info {
    color: var(--info);
    background: var(--info-soft);
    border-color: rgba(29, 78, 216, 0.14);
}

.page-header,
.card,
.stat-card,
.auth-card {
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
    padding: 0.9rem 1.15rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 249, 252, 0.92) 100%);
}

.page-title {
    margin: 0;
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1.1;
}

.page-copy {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.page-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(70, 184, 46, 0.18);
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.page-tag-success {
    border-color: rgba(70, 184, 46, 0.18);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.page-tag-danger {
    border-color: rgba(180, 35, 24, 0.18);
    background: var(--danger-soft);
    color: var(--danger);
}

.section-copy,
.empty-state,
.staff-subtitle,
.history-note,
.auth-copy,
.auth-footer {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.stat-card {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--surface);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-value {
    display: block;
    margin-top: 0.2rem;
    color: var(--ink);
    font-size: 1.55rem;
    line-height: 1.05;
}

.stat-value-small {
    font-size: 0.98rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(480px, 1.4fr);
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.card {
    margin-bottom: 0.9rem;
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
}

.collapsible-card {
    padding: 0;
}

.card-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #191e2b 0%, #2a3448 100%);
}

.collapsible-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

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

.collapse-indicator {
    position: relative;
    flex: 0 0 auto;
    width: 0.95rem;
    height: 0.95rem;
}

.collapse-indicator::before,
.collapse-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.75rem;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    transform: translate(-50%, -50%);
}

.collapse-indicator::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: transform 0.18s ease;
}

.collapsible-card[open] .collapse-indicator::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.card-title {
    margin: 0;
    color: #fff;
    font-size: 0.96rem;
    font-weight: 700;
}

.card-body {
    padding: 1rem;
}

.directory-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.9rem;
}

.directory-filter-card .card-body {
    padding-bottom: 0.85rem;
}

.directory-filter-field {
    min-width: 0;
}

.filter-label {
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.filter-control {
    padding: 0.7rem 0.85rem;
    min-height: 2.9rem;
}

.directory-filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.directory-export-fields {
    grid-column: 1 / -1;
    padding-top: 0.1rem;
}

.directory-export-fields.is-hidden {
    display: none;
}

.directory-export-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem 0.5rem;
}

.directory-export-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.55rem;
}

.directory-export-option {
    margin-bottom: 0;
    gap: 0.45rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid rgba(25, 30, 43, 0.06);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
    font-size: 0.82rem;
    font-weight: 600;
}

.field-access-note {
    display: inline-block;
    margin-left: 0.32rem;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}

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

.field-group-large {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.92rem;
}

.form-control {
    display: block;
    width: 100%;
    border: 1px solid rgba(95, 107, 118, 0.2);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.88);
}

.form-control:focus {
    outline: none;
    border-color: rgba(70, 184, 46, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(70, 184, 46, 0.16);
}

.input-large {
    min-height: 3.4rem;
}

.field-error {
    margin-top: 0.5rem;
    color: var(--danger);
    font-size: 0.92rem;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    color: var(--ink);
    font-weight: 600;
}

.checkbox-row input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand);
}

.form-actions {
    display: grid;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-large {
    min-height: 3.5rem;
    font-size: 1rem;
}

.btn-small {
    padding: 0.55rem 0.8rem;
    font-size: 0.86rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-danger {
    color: #fff;
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: #931f13;
    border-color: #931f13;
}

.btn-secondary {
    color: var(--ink);
    background: rgba(25, 30, 43, 0.08);
    border-color: rgba(25, 30, 43, 0.12);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: rgba(25, 30, 43, 0.14);
    border-color: rgba(25, 30, 43, 0.18);
}

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

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

.table thead th {
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid rgba(29, 42, 51, 0.08);
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.6rem;
    border-bottom: 1px solid rgba(29, 42, 51, 0.06);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(70, 184, 46, 0.06);
}

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

.staff-name {
    font-weight: 700;
}

.staff-link {
    color: var(--ink);
    text-decoration: none;
}

.staff-link:hover,
.staff-link:focus {
    color: var(--brand-dark);
    text-decoration: underline;
}

.staff-subtitle {
    margin-top: 0.12rem;
    font-size: 0.76rem;
}

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

.badge-success {
    color: #fff;
    background-color: var(--success);
}

.badge-danger {
    color: #fff;
    background-color: var(--danger);
}

.badge-neutral {
    color: var(--ink);
    background: rgba(25, 30, 43, 0.08);
}

.history-note {
    font-size: 0.82rem;
    font-weight: 600;
}

.diff-summary,
.diff-grid {
    display: grid;
    gap: 0.75rem;
}

.admin-grid {
    grid-template-columns: minmax(420px, 1.5fr) minmax(280px, 0.9fr);
}

.admin-actions,
.admin-control-list {
    display: grid;
    gap: 0.6rem;
}

.admin-create-user {
    margin-bottom: 1.25rem;
    padding: 0.95rem;
    border: 1px solid rgba(25, 30, 43, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
}

.admin-user-form {
    display: grid;
}

.admin-actions {
    justify-content: end;
}

.diff-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0.9rem;
}

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

.diff-stat,
.diff-block {
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(25, 30, 43, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
}

.diff-stat-label,
.diff-heading,
.diff-field {
    color: var(--ink);
    font-weight: 700;
}

.diff-stat-label {
    display: block;
    font-size: 0.82rem;
}

.diff-stat-value {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.2rem;
}

.diff-heading {
    margin: 0 0 0.7rem;
    font-size: 0.9rem;
}

.diff-list {
    display: grid;
    gap: 0.5rem;
}

.diff-list-item {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.diff-change-list {
    display: grid;
    gap: 0.4rem;
}

.diff-change-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.84rem;
}

.detail-actions {
    margin-bottom: 0.75rem;
}

.detail-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.detail-summary-card {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.detail-summary-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-summary-value {
    display: block;
    margin-top: 0.2rem;
    color: var(--ink);
    font-size: 0.96rem;
    line-height: 1.3;
}

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

.detail-section {
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(25, 30, 43, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
}

.detail-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
}

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

.detail-section-title {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.detail-list {
    margin: 0.75rem 0 0;
    display: grid;
    gap: 0.35rem;
}

.detail-item {
    display: grid;
    grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.2fr);
    gap: 0.35rem 0.8rem;
    align-items: start;
    padding: 0.28rem 0;
    border-bottom: 1px solid rgba(25, 30, 43, 0.05);
}

.detail-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-section .collapse-indicator {
    position: relative;
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
}

.detail-section .collapse-indicator::before,
.detail-section .collapse-indicator::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.7rem;
    height: 2px;
    border-radius: 999px;
    background: rgba(25, 30, 43, 0.72);
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.detail-section .collapse-indicator::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.detail-section[open] .collapse-indicator::after {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
}

.detail-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
    line-height: 1.35;
}

.detail-value-notes {
    white-space: pre-wrap;
}

.compliance-form {
    display: grid;
}

.compliance-textarea {
    min-height: 8rem;
    resize: vertical;
}

.history-timeline {
    display: grid;
    gap: 0.85rem;
}

.history-entry {
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(25, 30, 43, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
}

.history-entry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.history-entry-title {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.history-entry-meta {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.diff-old {
    color: var(--muted);
}

.diff-arrow {
    color: var(--brand-dark);
    font-weight: 700;
}

.diff-new {
    color: var(--ink);
    font-weight: 600;
}

.empty-state {
    margin: 0;
    padding: 0.15rem 0;
}

.auth-page {
    background:
        radial-gradient(circle at top, rgba(70, 184, 46, 0.16), transparent 24%),
        linear-gradient(180deg, #edf2f8 0%, #dce6ef 100%);
}

.auth-nav {
    background: linear-gradient(90deg, rgba(20, 27, 35, 0.94) 0%, rgba(31, 40, 53, 0.92) 100%);
    box-shadow: 0 16px 40px rgba(16, 22, 30, 0.22);
    backdrop-filter: blur(10px);
}

.auth-page-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem 0 3rem;
}

.auth-card {
    width: min(100%, 520px);
    padding: 2.25rem;
    border: 1px solid rgba(29, 42, 51, 0.08);
    border-radius: 28px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 24px 70px rgba(25, 30, 43, 0.14);
}

.auth-card-header {
    margin: -2.25rem -2.25rem 1.75rem;
    padding: 1.5rem 2.25rem 1.35rem;
    border-radius: 28px 28px 22px 22px;
    background:
        linear-gradient(180deg, rgba(20, 27, 35, 0.96) 0%, rgba(33, 43, 56, 0.94) 100%);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.auth-logo {
    display: block;
    height: 74px;
    width: auto;
    max-width: 100%;
    margin-bottom: 1rem;
    object-fit: contain;
}

.auth-heading {
    margin: 0 0 0.65rem;
    color: #f7fafc;
    font-size: clamp(2rem, 5vw, 2.6rem);
    line-height: 0.98;
}

.auth-copy {
    margin: 0;
    font-size: 1rem;
    color: rgba(232, 239, 245, 0.82);
}

.auth-form {
    margin-top: 1.25rem;
}

.auth-footer {
    margin: 1.25rem 0 0;
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--brand-dark);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1280px) {
    .app-shell {
        width: min(100vw - 1rem, 1320px);
    }

    .page-shell {
        padding-top: 0.45rem;
    }

    .site-nav {
        margin-bottom: 0.65rem;
    }

    .nav-shell {
        padding: 0.65rem 0;
    }

    .site-brand-logo {
        height: 38px;
    }

    .page-header {
        gap: 0.7rem;
        margin-bottom: 0.7rem;
        padding: 0.8rem 0.95rem;
    }

    .page-tags {
        gap: 0.35rem;
    }

    .page-tag {
        padding: 0.28rem 0.58rem;
        font-size: 0.76rem;
    }

    .stats-grid {
        gap: 0.6rem;
        margin-bottom: 0.7rem;
    }

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

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

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

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

    .card,
    .dashboard-grid,
    .page-header {
        margin-bottom: 0.7rem;
    }

    .card-header {
        padding: 0.65rem 0.85rem;
    }

    .card-body {
        padding: 0.8rem 0.85rem;
    }

    .directory-filters {
        gap: 0.6rem;
        margin-bottom: 0.7rem;
    }

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

    .filter-control {
        padding: 0.6rem 0.75rem;
        min-height: 2.6rem;
    }

    .stat-card {
        padding: 0.75rem 0.85rem;
    }

    .stat-label {
        font-size: 0.84rem;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .diff-summary,
    .diff-grid {
        gap: 0.6rem;
    }

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

    .detail-grid {
        gap: 0.7rem;
    }

    .detail-section,
    .history-entry {
        padding: 0.75rem 0.8rem;
    }

    .diff-summary {
        margin-bottom: 0.7rem;
    }

    .diff-grid {
        margin-top: 0.7rem;
    }

    .diff-stat,
    .diff-block {
        padding: 0.65rem 0.75rem;
    }

    .table thead th {
        padding: 0.5rem 0.45rem;
        font-size: 0.72rem;
    }

    .table tbody td {
        padding: 0.48rem 0.45rem;
        font-size: 0.84rem;
    }

    .staff-subtitle {
        font-size: 0.72rem;
    }
}

@media (max-width: 1100px) {
    .page-shell {
        padding-bottom: 1rem;
    }

    .page-header {
        align-items: flex-start;
        padding: 0.7rem 0.85rem;
    }

    .page-title {
        font-size: 1.08rem;
    }

    .page-copy {
        margin-top: 0.15rem;
        font-size: 0.82rem;
    }

    .stat-card {
        padding: 0.68rem 0.78rem;
    }

    .stat-value {
        font-size: 1.22rem;
    }

    .stat-value-small {
        font-size: 0.9rem;
    }

    .card-header {
        padding: 0.58rem 0.78rem;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.72rem 0.78rem;
    }

    .detail-summary-card {
        padding: 0.68rem 0.78rem;
    }

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

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

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

    .detail-item {
        grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.15fr);
        gap: 0.3rem 0.6rem;
    }

    .directory-filter-actions {
        justify-content: flex-start;
    }

    .btn {
        padding: 0.72rem 0.95rem;
        font-size: 0.9rem;
    }

    .btn-small {
        padding: 0.48rem 0.7rem;
        font-size: 0.8rem;
    }

    .badge {
        padding: 0.36rem 0.58rem;
        font-size: 0.73rem;
    }

    .diff-stat-label,
    .diff-heading {
        font-size: 0.8rem;
    }

    .diff-stat-value {
        font-size: 1.05rem;
    }

    .diff-change-item {
        gap: 0.28rem;
        font-size: 0.8rem;
    }

    .table thead th {
        font-size: 0.68rem;
    }

    .table tbody td {
        font-size: 0.81rem;
    }

    .staff-name {
        font-size: 0.92rem;
    }

    .history-note {
        font-size: 0.76rem;
    }
}

@media (max-width: 840px) {
    .dashboard-grid,
    .diff-summary,
    .diff-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .history-entry-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .app-shell {
        width: min(100vw - 1rem, 1320px);
    }

    .nav-shell,
    .site-nav-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header,
    .card-body,
    .auth-card {
        padding: 0.95rem;
    }

    .stats-grid,
    .stats-grid-dashboard,
    .stats-grid-admin {
        gap: 0.85rem;
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.7rem;
    }

    .auth-page-shell {
        min-height: auto;
        padding-top: 1rem;
    }
}
