:root {
    --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --ink: #211F20;
    --ink-strong: #1a1819;
    --muted: #6f675f;
    --muted-strong: #343434;
    --page: #F7F4EF;
    --surface: #ffffff;
    --surface-soft: #FBF9F5;
    --surface-strong: #E1D8C4;
    --border: #e1d8c4;
    --border-strong: #cfc4ae;
    --navy: #211F20;
    --navy-soft: #343434;
    --accent: #B39963;
    --accent-strong: #8C7344;
    --gold: #FFBC7D;
    --ok: #157a52;
    --ok-bg: #e6f7ef;
    --warn: #9a6415;
    --warn-bg: #fff4dc;
    --danger: #b43a42;
    --danger-bg: #fdecec;
    --info-bg: #F3EDE3;
    --shadow-sm: 0 8px 24px rgba(33, 31, 32, .08);
    --shadow-md: 0 18px 45px rgba(33, 31, 32, .14);
    --shadow-lg: 0 26px 70px rgba(26, 24, 25, .22);
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
}

html,
body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top left, rgba(179, 153, 99, .22), transparent 32rem),
        radial-gradient(circle at 75% 0%, rgba(255, 188, 125, .2), transparent 28rem),
        var(--page);
    color: var(--ink);
    font-family: var(--font-sans);
    text-rendering: optimizeLegibility;
}

a,
.btn-link {
    color: var(--accent-strong);
    font-weight: 650;
    text-decoration: none;
}

a:hover,
.btn-link:hover {
    color: #343434;
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    color: var(--ink-strong);
    letter-spacing: -.03em;
}

h1 {
    font-size: clamp(2rem, 3vw, 3.25rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: .45rem;
}

h1:focus {
    outline: none;
}

.text-muted {
    color: var(--muted) !important;
}

.content {
    padding-top: 2rem;
}

.btn {
    border-radius: 999px;
    font-weight: 750;
    letter-spacing: -.01em;
    padding: .67rem 1rem;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: .42rem .8rem;
}

.btn-lg {
    padding: .85rem 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #FFBC7D, #B39963);
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(179, 153, 99, .28);
    color: #211F20;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #B39963, #8C7344);
    border-color: transparent;
    color: #211F20;
}

.btn-outline-primary {
    background: rgba(255, 255, 255, .72);
    border-color: rgba(179, 153, 99, .38);
    color: var(--accent-strong);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(179, 153, 99, .1);
    border-color: var(--accent-strong);
    color: #343434;
}

.btn-outline-danger,
.btn-danger {
    border-color: rgba(180, 58, 66, .35);
}

.btn-danger,
.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn:disabled,
.btn.disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    border-color: rgba(179, 153, 99, .72);
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .28rem rgba(179, 153, 99, .28);
}

.form-control,
.form-select,
.input-group-text {
    background-color: rgba(255, 255, 255, .92);
    border-color: var(--border);
    border-radius: 14px;
    color: var(--ink);
}

.form-floating > .form-control {
    border-radius: 16px;
}

.form-check-input {
    border-color: var(--border-strong);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.form-field label {
    color: var(--muted-strong);
    font-size: .85rem;
    font-weight: 750;
}

.auditor-input-grid,
.email-report-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ok);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: .9rem;
    font-weight: 650;
}

.alert {
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.alert-info {
    background: var(--info-bg);
    color: #343434;
}

.alert-warning {
    background: var(--warn-bg);
    color: var(--warn);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    background: var(--ok-bg);
    color: var(--ok);
}

.darker-border-checkbox.form-check-input {
    border-color: var(--border-strong);
}

.page-heading {
    align-items: flex-start;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .68)),
        radial-gradient(circle at top right, rgba(179, 153, 99, .18), transparent 20rem);
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 1.25rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    overflow: hidden;
    padding: clamp(1.25rem, 2vw, 2rem);
    position: relative;
}

.page-heading::after {
    background: linear-gradient(180deg, var(--gold), rgba(179, 153, 99, 0));
    content: "";
    height: 76%;
    position: absolute;
    right: 0;
    top: 12%;
    width: 4px;
}

.page-heading > div {
    position: relative;
    z-index: 1;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: .77rem;
    font-weight: 850;
    letter-spacing: .18em;
    margin-bottom: .45rem;
    text-transform: uppercase;
}

.action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-end;
}

.section-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    justify-content: flex-end;
}

.workspace-action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-start;
}

.workspace-action-btn {
    border-radius: 999px;
    font-weight: 800;
    min-width: 11.5rem;
    padding-inline: 1.15rem;
}

.workspace-action-btn:disabled {
    cursor: not-allowed;
}

.inline-confirmation {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-end;
    padding: .75rem .85rem;
}

.inline-confirmation span {
    flex: 1 1 320px;
}

.inline-confirmation-danger {
    background: var(--danger-bg);
    border-color: rgba(180, 58, 66, .28);
    color: var(--danger);
}

.status-banner {
    align-items: center;
    background: linear-gradient(135deg, rgba(225, 216, 196, .96), rgba(255, 255, 255, .86));
    border: 1px solid rgba(179, 153, 99, .18);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: #343434;
    display: flex;
    gap: .8rem;
    margin-bottom: 1.2rem;
    padding: 1rem 1.15rem;
}

.status-banner-copy {
    flex: 1 1 auto;
}

.status-banner-action {
    flex: 0 0 auto;
    padding: 0;
    text-decoration: none;
}

.status-banner-action:hover,
.status-banner-action:focus {
    text-decoration: underline;
}

.status-dot {
    background: var(--accent);
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(179, 153, 99, .15);
    flex: 0 0 auto;
    height: .65rem;
    width: .65rem;
}

.report-section-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
    margin-bottom: .85rem;
}

.integrity-badge,
.status-chip,
.role-chip {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 850;
    gap: .35rem;
    letter-spacing: .05em;
    padding: .4rem .75rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.integrity-badge {
    cursor: help;
}

.integrity-ok,
.status-chip-ok {
    background: var(--ok-bg);
    border: 1px solid rgba(21, 122, 82, .2);
    color: var(--ok);
}

.integrity-warn,
.status-chip-warn {
    background: var(--warn-bg);
    border: 1px solid rgba(154, 100, 21, .22);
    color: var(--warn);
}

.status-chip-muted {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    color: var(--muted-strong);
}

.role-chip {
    background: rgba(33, 31, 32, .08);
    color: var(--navy-soft);
    letter-spacing: .02em;
    text-transform: none;
}

.row-actions {
    align-items: center;
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

.icon-action-btn {
    align-items: center;
    background: rgba(33, 31, 32, .06);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--navy-soft);
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 850;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    padding: 0 0 0.1rem;
    width: 2rem;
}

.icon-action-btn:hover:not(:disabled) {
    background: rgba(179, 153, 99, .12);
    border-color: rgba(179, 153, 99, .32);
    color: var(--accent-strong);
}

.icon-action-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.role-modal-message {
    box-shadow: none;
    margin: 0;
}

.role-choice-list {
    display: grid;
    gap: .65rem;
}

.role-choice {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--ink);
    display: flex;
    font-weight: 800;
    justify-content: space-between;
    padding: .85rem 1rem;
    text-align: left;
}

.role-choice::after {
    border: 2px solid var(--border-strong);
    border-radius: 999px;
    content: "";
    height: .95rem;
    width: .95rem;
}

.role-choice:hover:not(:disabled) {
    border-color: rgba(179, 153, 99, .42);
    box-shadow: 0 0 0 .18rem rgba(179, 153, 99, .1);
}

.role-choice-selected {
    background: rgba(225, 216, 196, .96);
    border-color: rgba(179, 153, 99, .52);
    color: var(--accent-strong);
}

.role-choice-selected::after {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 3px #fff;
}

.metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 1.5rem;
}

.metric-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 244, 239, .95)),
        radial-gradient(circle at top right, rgba(179, 153, 99, .13), transparent 10rem);
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 1.1rem;
    position: relative;
}

.metric-card::before {
    background: linear-gradient(180deg, var(--accent), var(--gold));
    border-radius: 999px;
    content: "";
    height: 42px;
    left: 0;
    opacity: .8;
    position: absolute;
    top: 1rem;
    width: 4px;
}

.metric-card span {
    color: var(--muted);
    display: block;
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: .04em;
    margin-bottom: .45rem;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--ink-strong);
    display: block;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    letter-spacing: -.04em;
    line-height: 1.1;
}

.metric-card small {
    color: var(--muted);
    display: block;
    margin-top: .45rem;
}

.report-section,
.empty-state,
.operation-panel,
.auth-card,
.manage-panel {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    padding: 1.25rem;
}

.report-section h2,
.empty-state h2,
.operation-panel h2 {
    color: var(--ink-strong);
    font-size: 1.16rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.empty-state {
    align-items: flex-start;
    display: grid;
    gap: .5rem;
    justify-items: start;
    min-height: 180px;
    place-content: center;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 0;
    max-width: 48rem;
}

.summary-text {
    color: var(--muted-strong);
    line-height: 1.7;
    max-width: 900px;
    white-space: pre-line;
}

.table-responsive {
    border-radius: calc(var(--radius) - 4px);
}

.recon-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.upload-summary-panel {
    align-items: center;
    background: linear-gradient(135deg, rgba(247, 244, 239, .96), rgba(255, 255, 255, .9));
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
}

.upload-summary-text {
    color: var(--muted-strong);
    font-size: .92rem;
    margin: .55rem 0 0;
}

.report-upload-modal {
    max-width: 780px;
}

.upload-modal-icon {
    align-items: center;
    background: rgba(179, 153, 99, .12);
    border: 1px solid rgba(179, 153, 99, .26);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-flex;
    font-size: 1rem;
    font-weight: 900;
    height: 1.75rem;
    justify-content: center;
    width: 1.75rem;
}

.upload-report-list {
    display: grid;
    gap: .7rem;
}

.upload-report-item {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    gap: .85rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: .9rem 1rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.upload-report-item:hover {
    border-color: rgba(179, 153, 99, .42);
    box-shadow: 0 0 0 .18rem rgba(179, 153, 99, .1);
    transform: translateY(-1px);
}

.upload-report-item-complete {
    background: linear-gradient(135deg, rgba(230, 247, 239, .92), rgba(255, 255, 255, .94));
    border-color: rgba(21, 122, 82, .26);
}

.upload-report-check {
    align-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ok);
    display: inline-flex;
    font-size: .9rem;
    font-weight: 900;
    height: 1.6rem;
    justify-content: center;
    width: 1.6rem;
}

.upload-report-item-complete .upload-report-check {
    background: var(--ok-bg);
    border-color: rgba(21, 122, 82, .24);
}

.upload-report-copy {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.upload-report-copy strong,
.upload-report-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-report-copy strong {
    color: var(--ink-strong);
    font-size: .95rem;
}

.upload-report-copy small {
    color: var(--muted);
    font-size: .82rem;
}

.upload-report-action {
    color: var(--accent-strong);
    font-size: .82rem;
    font-weight: 850;
    white-space: nowrap;
}

.upload-input-host {
    height: 0;
    overflow: hidden;
    position: relative;
}

.upload-file-input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.stored-upload-input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.stored-upload-action-cell {
    text-align: right;
    white-space: nowrap;
}

.stored-upload-button {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(179, 153, 99, .45);
    border-radius: 999px;
    color: var(--accent-strong);
    cursor: pointer;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 850;
    justify-content: center;
    min-height: 2.25rem;
    min-width: 6.5rem;
    padding: .45rem .9rem;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.stored-upload-button:hover {
    background: rgba(179, 153, 99, .08);
    border-color: rgba(179, 153, 99, .72);
    box-shadow: 0 0 0 .18rem rgba(179, 153, 99, .1);
    transform: translateY(-1px);
}

.stored-upload-button-disabled {
    cursor: not-allowed;
    opacity: .58;
    pointer-events: none;
}

.stored-upload-button-compact {
    min-height: 2rem;
    min-width: 5.6rem;
    padding: .35rem .75rem;
}

.stored-file-name {
    color: var(--ink);
    display: inline-block;
    max-width: 24rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.stored-file-name-empty {
    color: var(--muted);
}

.stored-agent-upload {
    align-items: flex-start;
    display: grid;
    gap: .38rem;
    justify-items: start;
    min-width: 12rem;
}

.agent-summary-name {
    color: var(--ink);
    display: inline-block;
    font-weight: 750;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.agent-token-list {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    min-width: 10rem;
}

.agent-token-chip {
    background: rgba(225, 216, 196, .92);
    border: 1px solid rgba(146, 174, 204, .35);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: .84rem;
    font-weight: 750;
    line-height: 1;
    padding: .43rem .65rem;
    white-space: nowrap;
}

.agent-token-empty {
    color: var(--muted);
    display: inline-block;
    font-size: .92rem;
    min-width: 6rem;
}

.agent-actions {
    align-items: center;
    display: inline-flex;
    gap: .45rem;
    justify-content: flex-end;
    white-space: nowrap;
}

.agent-edit-check {
    align-items: center;
    display: inline-flex;
    gap: .55rem;
    margin: 0;
}

@media (max-width: 640px) {
    .upload-summary-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-summary-panel .btn {
        width: 100%;
    }

    .upload-report-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .upload-report-action {
        grid-column: 2;
    }

    .stored-upload-action-cell {
        text-align: left;
    }

    .stored-file-name {
        max-width: 15rem;
    }
}

.recon-form-span {
    grid-column: 1 / -1;
}

.report-table {
    border-color: var(--border);
    margin-bottom: 0;
}

.report-table thead th {
    background: linear-gradient(180deg, #F7F4EF, #E1D8C4);
    border-bottom: 1px solid var(--border-strong);
    color: var(--ink-strong);
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .05em;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 1;
}

.report-table tbody tr {
    transition: background-color .18s ease;
}

.report-table tbody tr:hover {
    background: rgba(179, 153, 99, .06);
}

.report-table td,
.report-table th {
    padding: .88rem;
    vertical-align: middle;
}

.report-table td:first-child {
    color: var(--ink-strong);
    font-weight: 700;
}

.recon-detail-row td {
    background: rgba(33, 31, 32, 0.04);
}

.recon-detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.recon-detail-grid h3,
.recon-detail-row h3 {
    font-size: 1rem;
    margin-bottom: .75rem;
}

.total-row td {
    background: linear-gradient(90deg, rgba(230, 247, 239, .95), rgba(225, 216, 196, .82));
    color: var(--ink-strong);
    font-weight: 850;
}

.variance-negative {
    color: var(--danger);
    font-weight: 850;
}

.variance-positive {
    color: var(--ok);
    font-weight: 850;
}

.full-report-section {
    break-inside: avoid;
    page-break-inside: avoid;
}

.full-report-section h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: .75rem;
}

.mtd-summary-segment .mtd-summary-grid {
    display: grid;
    gap: 1.25rem;
}

.mtd-summary-segment .mtd-summary-card {
    background: rgba(247, 244, 239, .74);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 3px);
    padding: 1rem;
}

.mtd-summary-segment .mtd-summary-card h3 {
    color: var(--ink-strong);
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: .75rem;
    margin-top: .15rem;
}

.mtd-summary-segment .mtd-summary-card .table-responsive {
    margin-bottom: 0;
}

.archive-toolbar,
.operation-grid {
    display: grid;
    gap: 1rem;
}

.operation-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 1.25rem;
}

.operation-panel {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(247, 244, 239, .88)),
        radial-gradient(circle at top right, rgba(179, 153, 99, .12), transparent 14rem);
}

.operation-panel p {
    color: var(--muted);
}

.reingest-controls {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .85rem;
}

.reingest-controls .form-control {
    max-width: 16rem;
}

.reingest-controls input[type="file"] {
    max-width: 22rem;
}

.report-controls-panel {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(247, 244, 239, .92)),
        radial-gradient(circle at top right, rgba(179, 153, 99, .14), transparent 22rem);
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: 24px;
    box-shadow: 0 18px 46px rgba(33, 31, 32, .12);
    overflow: hidden;
    padding: 1.45rem 1.55rem 1.55rem;
}

.report-controls-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.report-controls-header h2 {
    color: var(--ink-strong);
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: -.04em;
    margin: 0;
}

.report-range-chip {
    background: linear-gradient(135deg, #F7F4EF, #E1D8C4);
    border: 1px solid rgba(179, 153, 99, .16);
    border-radius: 999px;
    color: #343434;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 900;
    justify-content: center;
    letter-spacing: .08em;
    min-width: 12rem;
    padding: .62rem 1rem;
    text-align: center;
}

.report-mode-toggle {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.report-mode-pill {
    background: rgba(255, 255, 255, .76);
    border: 1px solid rgba(179, 153, 99, .35);
    border-radius: 999px;
    color: var(--accent-strong);
    font-weight: 900;
    min-width: 11.8rem;
    padding: .82rem 1.6rem;
    transition: background-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

.report-mode-pill:hover:not(:disabled) {
    transform: translateY(-1px);
}

.report-mode-pill.active {
    background: linear-gradient(135deg, #FFBC7D, #B39963);
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(179, 153, 99, .18), 0 14px 28px rgba(179, 153, 99, .24);
    color: #211F20;
}

.report-mode-pill:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.report-date-grid,
.report-filter-grid {
    display: grid;
    gap: 1rem 1.2rem;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.report-date-grid-single {
    grid-template-columns: minmax(240px, 1fr);
    max-width: 50%;
}

.report-filter-grid {
    border-top: 1px solid rgba(225, 216, 196, .55);
    grid-template-columns: minmax(190px, .7fr) minmax(210px, .8fr) minmax(260px, 1.25fr);
    margin-top: 1rem;
    padding-top: 1rem;
}

.report-field {
    min-width: 0;
}

.report-field .form-label {
    color: #343434;
    font-size: .88rem;
    font-weight: 900;
    margin-bottom: .45rem;
}

.report-field .form-control,
.report-field .form-select {
    border-color: rgba(225, 216, 196, .86);
    border-radius: 16px;
    min-height: 2.85rem;
}

.report-date-input {
    max-width: none;
}

.report-control-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    justify-content: flex-end;
    margin-top: 1.15rem;
}

.report-action-btn {
    min-width: 10rem;
    padding: .85rem 1.25rem;
}

.report-action-btn[aria-disabled="True"],
.report-action-btn[aria-disabled="true"] {
    opacity: .55;
    pointer-events: none;
    transform: none;
}

.loading-state {
    align-items: center;
    background: rgba(255, 255, 255, .76);
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: .9rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem;
}

.loading-state p {
    color: var(--muted);
    margin: 0;
}

.loading-spinner,
.busy-spinner {
    animation: spin .8s linear infinite;
    border: 3px solid rgba(179, 153, 99, .18);
    border-radius: 999px;
    border-top-color: var(--accent);
    display: inline-block;
    flex: 0 0 auto;
    height: 1.35rem;
    width: 1.35rem;
}

.busy-spinner {
    border-width: 2px;
    height: 1rem;
    margin-right: .45rem;
    width: 1rem;
}

.skeleton-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 1.5rem;
}

.skeleton-card,
.skeleton-row,
.skeleton-line {
    animation: shimmer 1.35s ease-in-out infinite;
    background: linear-gradient(90deg, rgba(216, 227, 238, .75), rgba(247, 244, 239, .95), rgba(216, 227, 238, .75));
    background-size: 220% 100%;
    border-radius: var(--radius-sm);
}

.skeleton-card {
    border: 1px solid rgba(255, 255, 255, .86);
    box-shadow: var(--shadow-sm);
    height: 104px;
}

.skeleton-row {
    height: 54px;
    margin-bottom: .65rem;
}

.skeleton-line {
    height: .85rem;
    margin-bottom: .75rem;
}

.skeleton-line.short {
    width: 42%;
}

.skeleton-line.medium {
    width: 68%;
}

.busy-button-content {
    align-items: center;
    display: inline-flex;
    justify-content: center;
}

.app-progress {
    background: rgba(33, 31, 32, .08);
    height: 3px;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1200;
}

.app-progress::after {
    animation: progress-slide 1.05s ease-in-out infinite;
    background: linear-gradient(90deg, transparent, var(--accent), var(--gold), transparent);
    content: "";
    display: block;
    height: 100%;
    transform: translateX(-100%);
    width: 52%;
}

.account-screen {
    align-items: safe center;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem 1rem;
}

.account-panel {
    margin: 0 auto;
    max-width: 920px;
    width: 100%;
}

.auth-shell {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}

.auth-hero,
.auth-card {
    min-height: 100%;
}

.auth-hero {
    background:
        linear-gradient(135deg, rgba(33, 31, 32, .96), rgba(52, 52, 52, .92)),
        radial-gradient(circle at top right, rgba(179, 153, 99, .32), transparent 18rem);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: rgba(255, 255, 255, .82);
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.4rem);
    position: relative;
}

.auth-hero h1,
.auth-hero h2 {
    color: #fff;
}

.auth-hero p {
    max-width: 34rem;
}

.auth-card h2 {
    font-size: 1.35rem;
}

.auth-links {
    display: grid;
    gap: .35rem;
    margin-top: 1rem;
}

.account-loading {
    margin-top: 2rem;
}

.account-page {
    display: grid;
    gap: 1.25rem;
}

.manage-shell {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(220px, .28fr) minmax(0, 1fr);
}

.manage-nav-card {
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: .8rem;
}

.manage-panel {
    min-width: 0;
}

.manage-nav-card .nav {
    gap: .25rem;
}

.manage-nav-card .nav-link {
    border-radius: 14px;
    color: var(--muted-strong);
    font-weight: 750;
    padding: .7rem .85rem;
}

.manage-nav-card .nav-link:hover,
.manage-nav-card .nav-link.active {
    background: rgba(179, 153, 99, .1);
    color: var(--accent-strong);
}

.external-login-card {
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

.external-login-card h3 {
    font-size: 1rem;
    margin-bottom: .75rem;
}

.blazor-error-boundary {
    background: var(--danger-bg);
    border-radius: var(--radius);
    color: var(--danger);
    padding: 1rem 1.2rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui,
#components-reconnect-modal {
    background: rgba(33, 31, 32, .94);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    bottom: 1rem;
    box-shadow: var(--shadow-lg);
    color: #fff;
    display: none;
    left: 1rem;
    padding: .95rem 3rem .95rem 1rem;
    position: fixed;
    right: 1rem;
    z-index: 1300;
}

#blazor-error-ui .reload {
    color: var(--accent);
    margin-left: .45rem;
}

#blazor-error-ui .dismiss {
    color: rgba(255, 255, 255, .75);
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: .9rem;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    align-items: center;
    display: flex;
    gap: .75rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    to {
        background-position: -220% 0;
    }
}

@keyframes progress-slide {
    0% {
        transform: translateX(-100%);
    }

    55% {
        transform: translateX(80%);
    }

    100% {
        transform: translateX(210%);
    }
}

@media (min-width: 992px) {
    .mtd-summary-segment .mtd-summary-grid {
        align-items: start;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .auth-shell,
    .manage-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .content {
        padding-top: 1rem;
    }

    .page-heading {
        border-radius: var(--radius);
        display: grid;
    }

    .action-row,
    .section-actions,
    .inline-confirmation {
        justify-content: stretch;
    }

    .action-row .btn,
    .action-row form,
    .action-row a,
    .section-actions .btn,
    .inline-confirmation .btn {
        width: 100%;
    }

    .report-controls-panel {
        border-radius: var(--radius);
        padding: 1.1rem;
    }

    .report-controls-header,
    .report-control-actions {
        align-items: stretch;
        display: grid;
    }

    .report-range-chip,
    .report-mode-pill,
    .report-action-btn {
        width: 100%;
    }

    .report-date-grid,
    .report-date-grid-single,
    .report-filter-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .top-row,
    .action-row,
    .section-actions,
    .inline-confirmation,
    .app-progress {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .page-heading,
    .report-section,
    .metric-card {
        border: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }
}
/* ── Integrity / Coverage badge buttons ─────────────────────────── */
.integrity-badge-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

.integrity-badge-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Executive Summary redesign ────────────────────────────────── */
.exec-summary {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

/* Status pill row */
.exec-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.status-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.status-pill:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.status-pill-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.status-pill-ok {
    background: var(--ok-bg);
    color: var(--ok);
    border-color: rgba(21, 122, 82, 0.25);
}

.status-pill-warn {
    background: var(--warn-bg);
    color: var(--warn);
    border-color: rgba(154, 100, 21, 0.3);
}

.status-pill-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(180, 58, 66, 0.3);
}

/* Main 12-col grid */
.exec-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 992px) {
    .exec-grid {
        grid-template-columns: 2fr 1fr;
        align-items: stretch;
    }
}

.exec-grid-primary,
.exec-grid-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Generic card */
.exec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.exec-card-side {
    flex: 1;
}

.exec-card-head h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-strong);
    margin: 0;
    letter-spacing: -0.01em;
}

.exec-card-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.exec-card-icon {
    width: 1.4rem;
    height: 1.4rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* Revenue card */
.exec-revenue-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
}

.exec-metric-xl {
    font-size: clamp(1.85rem, 3.2vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink-strong);
    line-height: 1.1;
}

.exec-trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.exec-trend-pill svg {
    width: 0.95rem;
    height: 0.95rem;
}

.exec-trend-pill.trend-up {
    background: var(--ok-bg);
    color: var(--ok);
}

.exec-trend-pill.trend-down {
    background: var(--danger-bg);
    color: var(--danger);
}

.exec-card-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
    margin-top: auto;
}

.exec-card-footer,
.exec-card-footer p {
    font-style: normal !important;
}

.exec-card-footer p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Forecasting pacing card */
.exec-pacing-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.exec-pacing-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.exec-pacing-label {
    font-size: 0.88rem;
    color: var(--muted-strong);
}

.exec-pacing-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink-strong);
    font-variant-numeric: tabular-nums;
}

.exec-progress-track {
    width: 100%;
    height: 0.5rem;
    background: var(--surface-strong);
    border-radius: 999px;
    overflow: hidden;
}

.exec-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.exec-pacing-caption {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.exec-mini-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .exec-mini-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.exec-mini-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.exec-mini-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.exec-mini-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-strong);
    font-variant-numeric: tabular-nums;
}

/* Side metric cards */
.exec-side-metric {
    text-align: center;
    padding: 0.5rem 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.exec-card-foot-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    color: var(--muted-strong);
    font-size: 0.85rem;
    line-height: 1.4;
}

.exec-card-foot-info svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* Tight side metric for compact side cards. */
.exec-side-metric-tight {
    padding: 0.25rem 0 0;
}

/* ── Delta pill row (vs LY / vs Budget) ──────────────────────── */
.exec-delta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: -0.25rem;
}

.exec-delta-row-tight {
    margin-top: 0.25rem;
}

.delta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 500;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted-strong);
}

.delta-pill svg {
    width: 0.85rem;
    height: 0.85rem;
}

.delta-pill strong {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.delta-pill.delta-up {
    background: var(--ok-bg);
    border-color: rgba(21, 122, 82, 0.22);
    color: var(--ok);
}

.delta-pill.delta-down {
    background: var(--danger-bg);
    border-color: rgba(180, 58, 66, 0.22);
    color: var(--danger);
}

/* ── Modal overlay & panel ─────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(33, 31, 32, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.workspace-panel-overlay {
    align-items: flex-start;
    justify-content: flex-end;
    overflow-y: auto;
    padding: 0;
}

.modal-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(33, 31, 32, 0.18), 0 4px 16px rgba(33, 31, 32, 0.1);
    width: min(98vw, 1500px);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-panel.modal-panel-narrow {
    width: 100%;
    max-width: 720px;
}

.workspace-panel {
    border-radius: 0;
    height: auto;
    margin-left: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
    width: min(96vw, 880px);
}

.workspace-panel .modal-body {
    flex: 0 0 auto;
    overflow-y: visible;
}

.workspace-panel-header-copy {
    display: grid;
    gap: .45rem;
}

/* ── Modal header ──────────────────────────────────────────────── */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #ebe4d8;
    flex-shrink: 0;
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.modal-title-row h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #211F20;
    margin: 0;
}

.modal-header-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-header-icon.icon-ok {
    color: var(--ok);
}

.modal-header-icon.icon-warn {
    color: var(--warn);
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6f675f;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.modal-close-btn:hover {
    background: #F7F4EF;
    color: #211F20;
}

/* ── Modal body ────────────────────────────────────────────────── */
.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.modal-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal-status-sub {
    font-size: 0.8rem;
    color: #6f675f;
}

.modal-description {
    color: #343434;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Mismatch list (integrity) ─────────────────────────────────── */
.integrity-mismatch-empty {
    border: 1px solid #f5d08a;
    border-radius: 10px;
    background: var(--warn-bg);
    color: var(--ink-strong);
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem 0.9rem;
}

.integrity-mismatch-empty span {
    color: var(--muted-strong);
    font-size: 0.82rem;
}

.integrity-table-wrap {
    border: 1px solid #ebe4d8;
    border-radius: 10px;
    background: #fff;
}

.integrity-mismatch-table,
.integrity-start-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #211F20;
    line-height: 1.35;
    opacity: 1;
}

.integrity-mismatch-table th,
.integrity-mismatch-table td,
.integrity-start-table th,
.integrity-start-table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #ebe4d8;
    color: #211F20;
    font-size: 0.82rem;
    line-height: 1.35;
    opacity: 1;
    overflow-wrap: anywhere;
    vertical-align: middle;
    white-space: normal;
}

.integrity-mismatch-table th,
.integrity-start-table th {
    position: static !important;
    top: auto !important;
    z-index: auto;
    background: linear-gradient(180deg, #F7F4EF, #E1D8C4);
    color: var(--ink-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.integrity-mismatch-table tbody tr:nth-child(even),
.integrity-start-table tbody tr:nth-child(even) {
    background: #FBF9F5;
}

.integrity-mismatch-table tbody tr:last-child td,
.integrity-start-table tbody tr:last-child td {
    border-bottom: none;
}

.integrity-primary-cell {
    color: var(--ink-strong) !important;
    font-weight: 800;
}

.integrity-number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.diff-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: center;
    text-align: center;
}

.diff-chip.diff-negative {
    background: var(--danger-bg);
    color: var(--danger);
}

.diff-chip.diff-positive {
    background: var(--warn-bg);
    color: var(--warn);
}

/* ── Modal subsection (occupancy table) ────────────────────────── */
.modal-subsection {
    border-top: 1px solid #ebe4d8;
    padding-top: 1rem;
}

.modal-subsection-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #211F20;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.65rem;
}

/* ── Coverage scope blocks ─────────────────────────────────────── */
.coverage-scope-block {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border: 1px solid #ebe4d8;
    border-radius: 10px;
    background: #FBF9F5;
}

.coverage-scope-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.coverage-scope-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #211F20;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.date-chip {
    font-size: 0.75rem;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    background: #ebe4d8;
    color: #343434;
    white-space: nowrap;
}

.date-chip.date-chip-overflow {
    background: var(--warn-bg);
    color: var(--warn);
    font-family: inherit;
    font-weight: 600;
}

/* ── Modal footer ──────────────────────────────────────────────── */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid #ebe4d8;
    flex-shrink: 0;
}

@media print {
    .sidebar,
    .top-row,
    .action-row,
    .qr-screen-only,
    .section-nav,
    .section-nav-wrap,
    .go-up {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .qr-print-card {
        border: 0;
        box-shadow: none;
        max-width: none;
    }

    .report-section {
        border: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }
}

.status-chip-info {
    background: var(--info-bg);
    border: 1px solid rgba(179, 153, 99, .22);
    color: var(--accent-strong);
}

.status-chip-danger {
    background: var(--danger-bg);
    border: 1px solid rgba(180, 58, 66, .22);
    color: var(--danger);
}

.guest-shell {
    background: var(--page);
    margin: 0;
    max-width: none;
    min-height: 100vh;
    padding: 0;
}

.menu-hero {
    background: #201F1D;
    color: #fff;
}

.menu-inner {
    margin: 0 auto;
    max-width: 720px;
    width: 100%;
}

.menu-hero-inner {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.5rem 1rem;
    text-align: center;
}

.menu-logo {
    display: block;
    height: auto;
    max-width: 100%;
    width: 16rem;
}

.menu-hero h1 {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin: .25rem 0;
}

.menu-badge {
    background: rgba(255, 255, 255, .2);
    border-radius: 999px;
    font-size: .85rem;
    padding: .25rem .75rem;
}

.menu-body {
    padding: 1rem 1rem 2.5rem;
}

.go-up {
    align-items: center;
    background: linear-gradient(135deg, #FFBC7D, #B39963);
    border: 0;
    border-radius: 999px;
    bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(33, 31, 32, .18);
    color: #211F20;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    gap: .35rem;
    opacity: 0;
    padding: .55rem .95rem;
    pointer-events: none;
    position: fixed;
    right: 1rem;
    transform: translateY(.5rem);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 20;
}

.go-up.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.go-up-mark {
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    height: .45rem;
    transform: translateY(1px) rotate(-45deg);
    width: .45rem;
}

.section-nav-wrap {
    align-items: center;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    box-sizing: border-box;
    display: flex;
    gap: .5rem;
    padding: .45rem .75rem;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 10;
}

.section-nav {
    background: #fff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.section-nav-chevron {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    color: var(--accent-strong);
    cursor: pointer;
    display: flex;
    flex: 0 0 2rem;
    height: 2rem;
    justify-content: center;
    padding: 0;
    width: 2rem;
}

.section-nav-chevron:disabled {
    cursor: default;
    opacity: .35;
}

.section-nav-chevron:hover,
.section-nav-chevron:focus {
    border-color: var(--accent);
    color: #8C7344;
}

.section-nav-mark {
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    height: .45rem;
    width: .45rem;
}

.section-nav-chevron.is-left .section-nav-mark {
    margin-left: .15rem;
    transform: rotate(-135deg);
}

.section-nav-chevron.is-right .section-nav-mark {
    margin-right: .15rem;
    transform: rotate(45deg);
}

.section-nav::-webkit-scrollbar {
    display: none;
}

.section-nav-inner {
    box-sizing: border-box;
    display: flex;
    gap: .5rem;
    justify-content: safe center;
    min-width: 0;
    padding: .55rem 0;
    width: 100%;
}

.section-nav a[hidden] {
    display: none !important;
}

.section-nav a {
    background: rgba(225, 216, 196, .45);
    border-radius: 999px;
    color: #211F20;
    flex: 0 0 auto;
    font-size: .85rem;
    font-weight: 500;
    padding: .4rem .9rem;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .section-nav-chevron {
        display: none;
    }

    .section-nav-wrap {
        padding: 0;
    }

    .section-nav {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-behavior: smooth;
        scrollbar-width: none;
    }

    .section-nav-inner {
        min-width: 100%;
        padding: .75rem 1rem;
        width: max-content;
    }
}

.section-nav a.active {
    background: #B39963;
    color: #fff;
    font-weight: 600;
}

.guest-card,
.staff-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(1.25rem, 3vw, 2rem);
}

.enhanced-select,
.date-field,
.ts-wrapper {
    width: 100%;
}

.ts-wrapper.form-select {
    --bs-form-select-bg-img: none;
    appearance: none;
    background: transparent;
    background-image: none;
    border: 0;
    box-shadow: none;
    height: auto;
    min-height: 0;
    padding: 0;
}

.ts-wrapper.single .ts-control {
    background-color: rgba(255, 255, 255, .92);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236f675f' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-position: right .85rem center;
    background-repeat: no-repeat;
    background-size: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: none;
    color: var(--ink);
    font-size: 1rem;
    min-height: 2.7rem;
    padding: .55rem 2.2rem .55rem .85rem;
}

.ts-wrapper.single .ts-control::after,
.ts-wrapper.single.dropdown-active .ts-control::after {
    content: none;
}

.ts-wrapper.focus .ts-control,
.dropdown-active .ts-control {
    border-color: rgba(179, 153, 99, .72);
    border-radius: 14px;
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .28rem rgba(179, 153, 99, .28);
}

.ts-dropdown {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 2000;
}

.ts-dropdown-content {
    max-height: 280px;
}

.ts-dropdown .option,
.ts-dropdown .dropdown-input {
    font-size: .95rem;
    padding: .55rem .85rem;
}

.ts-dropdown .active {
    background: #E1D8C4;
    color: var(--ink-strong);
}

.comment-kind {
    flex: 1;
    max-width: 14rem;
}

.date-field {
    position: relative;
}

.date-field .form-control,
.date-field .flatpickr-input {
    padding-right: 2.4rem;
}

.date-clear {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 1.25rem;
    height: 2rem;
    line-height: 1;
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    z-index: 2;
}

.date-clear:hover {
    color: var(--ink);
}

.flatpickr-calendar {
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    font-family: var(--font-sans);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #B39963;
    border-color: #B39963;
    color: #211F20;
}

.flatpickr-day.today {
    border-color: var(--accent);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    font-weight: 700;
}

.info-section {
    padding-top: 1rem;
    scroll-margin-top: 64px;
}

.info-section h2 {
    border-bottom: 2px solid #B39963;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: .75rem;
    padding-bottom: .25rem;
}

.info-section p,
.info-section li {
    color: var(--muted-strong);
    line-height: 1.55;
}

.info-section ul {
    margin-bottom: .75rem;
    padding-left: 1.15rem;
}

.info-callout,
.info-note {
    border-radius: var(--radius-sm);
    color: var(--ink);
    padding: .8rem .95rem;
}

.info-callout {
    background: var(--warn-bg);
    border: 1px solid rgba(154, 100, 21, .22);
    font-weight: 650;
}

.info-note {
    background: var(--ok-bg);
    border: 1px solid rgba(21, 122, 82, .18);
}

.info-signoff {
    margin-bottom: 0;
}

.qr-sheet {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-content: center;
    margin-inline: auto;
    max-width: 900px;
}

.qr-print-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.qr-print-card h2 {
    font-size: 1.45rem;
    margin-bottom: .35rem;
}

.qr-frame {
    margin: 1rem auto;
    max-width: 280px;
}

.qr-frame img,
.qr-frame svg {
    height: auto;
    width: 100%;
}

.qr-url {
    color: var(--muted-strong);
    font-size: .9rem;
    margin: 0;
    word-break: break-all;
}

.rating-row {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.rating-btn {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--ink);
    display: inline-flex;
    font-weight: 800;
    height: 3rem;
    justify-content: center;
    min-width: 3rem;
}

.rating-btn.active {
    background: linear-gradient(135deg, #FFBC7D, #B39963);
    border-color: transparent;
    color: #211F20;
}

.face-row {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.face-choice {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--ink);
    display: flex;
    font-weight: 750;
    gap: .75rem;
    min-height: 3.25rem;
    padding: .7rem .9rem;
    text-align: left;
}

.face-choice.active {
    border-color: transparent;
    color: #fff;
}

.face-mark {
    border-radius: 999px;
    flex: 0 0 auto;
    height: 1.35rem;
    width: 1.35rem;
}

.face-exceeded .face-mark { background: #1f9d55; }
.face-met .face-mark { background: #e0a106; }
.face-failed .face-mark { background: #d64545; }

.face-exceeded.active { background: #1f9d55; }
.face-met.active { background: #c4840a; }
.face-failed.active { background: #c43737; }

.guest-comment {
    white-space: pre-wrap;
}

.filter-grid {
    display: grid;
    gap: .85rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 1.25rem;
}

.case-table {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: auto;
}

.case-table table {
    margin: 0;
    width: 100%;
}

.case-table th {
    color: var(--muted-strong);
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .08em;
    padding: .85rem 1rem;
    text-transform: uppercase;
}

.case-table td {
    padding: .85rem 1rem;
    vertical-align: middle;
}

.case-table tbody tr {
    cursor: pointer;
}

.case-table tbody tr:hover {
    background: var(--surface-soft);
}

.timeline {
    display: grid;
    gap: .85rem;
}

.timeline-item,
.note-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
}

.detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
}

.hp-field {
    position: absolute;
    left: -10000px;
    height: 1px;
    overflow: hidden;
    width: 1px;
}

.case-page {
    margin-inline: auto;
    max-width: 760px;
}

.case-page .page-heading {
    overflow: visible;
}

.case-facts {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .85rem;
    margin-top: .85rem;
}

.case-facts span:not(:last-child)::after {
    content: "·";
    margin-left: .85rem;
}

.case-page .case-menu {
    position: relative;
    z-index: 40;
}

.case-menu-button {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 700;
    height: 2.6rem;
    justify-content: center;
    letter-spacing: .12em;
    line-height: 1;
    width: 2.6rem;
}

.case-menu-button:hover,
.case-menu-button:focus {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.case-menu-backdrop {
    background: transparent;
    border: 0;
    inset: 0;
    position: fixed;
    z-index: 30;
}

.case-menu-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    display: grid;
    min-width: 12.5rem;
    padding: .35rem;
    position: absolute;
    right: 0;
    top: calc(100% + .45rem);
}

.case-menu-panel button {
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--ink);
    padding: .6rem .75rem;
    text-align: left;
}

.case-menu-panel button:hover,
.case-menu-panel button:focus {
    background: var(--surface-soft);
}

.case-page .case-focus,
.case-page .case-notes {
    margin-top: 1rem;
}

.case-focus .guest-comment {
    font-size: 1.15rem;
    line-height: 1.65;
}

.case-history {
    margin-top: 1.5rem;
}

.case-history h2 {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 1.25rem 0 .65rem;
    text-transform: uppercase;
}

.case-history h2:first-child {
    margin-top: 0;
}

.case-history .timeline,
.case-history .note-card {
    margin-bottom: .65rem;
}

.modal-panel.case-action-dialog {
    max-height: none;
    max-width: 28rem;
    outline: none;
    width: 100%;
}

.case-action-dialog .modal-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.case-action-footer {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding: 0 1.5rem 1.25rem;
}

@media (max-width: 900px) {
    .detail-grid,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .case-page {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .case-page .page-heading {
        align-items: flex-start;
        display: flex;
        flex-wrap: nowrap;
    }

    .case-page .page-heading > div {
        min-width: 0;
    }
}

