:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-soft: #f8fafc;
    --line: #d9dee7;
    --line-strong: #b8c0cc;
    --text: #182230;
    --muted: #64748b;
    --primary: #166534;
    --primary-dark: #14532d;
    --primary-soft: #dcfce7;
    --nav-bg: #edf3ef;
    --nav-text: #233247;
    --warning: #b54708;
    --warning-soft: #fff7ed;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --info: #075985;
    --info-soft: #e0f2fe;
    --focus: #2563eb;
    --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.07);
}

/* Initial data import */
.data-import-title {
    align-items: flex-start;
}

.data-import-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.data-import-steps div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.data-import-steps strong {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
}

.data-import-steps span {
    font-size: 14px;
    font-weight: 700;
}

.data-import-panel,
.data-import-history {
    margin-bottom: 16px;
}

.data-import-form {
    display: grid;
    gap: 14px;
}

.data-import-actions {
    margin-top: 0;
}

.data-import-result {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.data-import-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.data-import-summary:empty {
    display: none;
}

.data-import-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.data-import-summary span {
    color: var(--muted);
    font-size: 13px;
}

.data-import-summary strong {
    font-size: 15px;
}

.data-import-issues {
    margin-top: 16px;
}

.compact-heading {
    margin-bottom: 8px;
}

.compact-heading h3 {
    margin: 0;
    font-size: 16px;
}

@media (max-width: 600px) {
    .data-import-steps {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .data-import-steps div {
        min-height: 42px;
        padding: 7px 10px;
    }

    .data-import-steps strong {
        width: 24px;
        height: 24px;
    }

    .data-import-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .data-import-actions .button {
        width: 100%;
    }

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

.form-field-wide {
    grid-column: 1 / -1;
}

.report-filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.report-filter-bar label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.84rem;
}

.report-summary {
    margin-bottom: 18px;
}

.report-panel {
    break-inside: avoid;
}

.report-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.print-generated-at {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.82rem;
}

.report-print-view {
    background: #fff;
}

.report-print-view .app-shell,
.print-layout,
.print-layout .content {
    width: 100%;
    max-width: none;
    min-height: auto;
}

.accounting-period-create {
    margin-bottom: 18px;
}

.accounting-period-create .section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.period-create-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.period-create-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.84rem;
}

.period-card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.period-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.period-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.period-card-heading h3,
.period-card-heading p {
    margin: 4px 0 0;
}

.period-card-heading p {
    color: var(--muted);
}

.period-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.period-metrics dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.period-metrics dd {
    margin: 3px 0 0;
    font-weight: 700;
}

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

@media (max-width: 900px) {
    .period-create-form,
    .period-card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .period-create-form,
    .period-card-list {
        grid-template-columns: 1fr;
    }
}

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

@media (max-width: 480px) {
    .report-filter-bar {
        grid-template-columns: 1fr;
    }

    .report-export-actions {
        width: 100%;
    }

    .report-export-actions .button {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }
}

@media print {
    .topbar,
    .sidebar,
    .report-filter-bar,
    .page-actions {
        display: none !important;
    }

    .layout,
    .content {
        display: block;
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .report-panel .desktop-table {
        display: block !important;
        overflow: visible;
    }

    .report-panel table {
        font-size: 8pt;
    }

    .report-print-view .summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.settlement-allocation-section {
    margin-top: 24px;
}

.settlement-allocation-section .section-heading p {
    margin: 4px 0 0;
    color: var(--muted, #64748b);
    font-size: 0.9rem;
}

.settlement-total {
    color: #0f766e;
    white-space: nowrap;
}

.settlement-allocation-list {
    display: grid;
    gap: 10px;
}

.settlement-allocation-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(260px, 1.5fr) minmax(220px, 1fr);
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    background: #fff;
}

.settlement-document,
.settlement-allocation-input {
    display: grid;
    gap: 5px;
}

.settlement-document span,
.settlement-allocation-input label {
    color: #64748b;
    font-size: 0.84rem;
}

.settlement-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.settlement-amounts div {
    min-width: 0;
}

.settlement-amounts dt {
    color: #64748b;
    font-size: 0.78rem;
}

.settlement-amounts dd {
    margin: 3px 0 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.settlement-allocation-input > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

@media (max-width: 900px) {
    .settlement-allocation-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .settlement-amounts {
        gap: 6px;
    }

    .settlement-allocation-row {
        padding: 14px;
    }
}

* {
    box-sizing: border-box;
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    max-width: 100%;
    overflow-x: hidden;
}

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

button,
input,
select {
    font: inherit;
}

.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;
}

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

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    font-size: 17px;
}

.global-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 520px;
    width: min(100%, 600px);
    max-width: 600px;
}

.global-search-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 0 12px;
    background: var(--surface-soft);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.user-chip {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.logout-form {
    margin: 0;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    min-height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.link-button:hover,
.button:hover,
.nav-link:hover {
    filter: brightness(0.98);
}

.layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
}

.sidebar {
    border-right: 1px solid var(--line);
    background: var(--nav-bg);
    padding: 18px 14px;
    overflow-y: auto;
}

.nav-group + .nav-group {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(184, 192, 204, 0.65);
}

.nav-group-title {
    margin: 0 8px 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.nav-group-title:first-child {
    margin-top: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--nav-text);
    font-size: 14px;
    line-height: 1.25;
}

.nav-link.active {
    background: var(--surface);
    color: var(--primary-dark);
    font-weight: 700;
    border: 1px solid var(--line);
    box-shadow: inset 3px 0 0 var(--primary);
}

/* ERP navigation information architecture */
.navigation-shell {
    min-width: 0;
    border-right: 1px solid var(--line);
    background: var(--nav-bg);
}

.mobile-nav-toggle {
    display: none;
}

.mobile-nav-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.navigation-content.sidebar {
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 64px);
    border-right: 0;
    padding: 14px 12px 20px;
    overflow-x: hidden;
    overflow-y: auto;
}

.nav-dashboard-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--nav-text);
    font-size: 14px;
    font-weight: 700;
}

.nav-account-link {
    display: block;
    margin: 0 0 12px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    background: var(--surface);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.nav-account-link:hover,
.nav-account-link:focus-visible {
    border-color: var(--brand);
    color: var(--brand);
}

.account-password-panel {
    max-width: 720px;
}

.security-summary-grid {
    margin-bottom: 22px;
}

.security-user-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.security-user-actions form {
    margin: 0;
}

.security-reset {
    min-width: 180px;
}

.security-reset summary {
    cursor: pointer;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.security-reset form {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.nav-dashboard-link.active {
    border-color: var(--line);
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(184, 192, 204, 0.65);
}

.nav-section-title {
    margin: 0 8px 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.nav-function-group {
    margin: 2px 0;
}

.nav-function-group > summary {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 30px 8px 10px;
    border-radius: 6px;
    color: var(--nav-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    list-style: none;
}

.nav-function-group > summary::-webkit-details-marker {
    display: none;
}

.nav-function-group > summary::after {
    position: absolute;
    right: 12px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: rotate(45deg) translateY(-2px);
    transition: transform 140ms ease;
}

.nav-function-group[open] > summary::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.nav-function-group.active-branch > summary,
.nav-function-group > summary:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-dark);
}

.nav-function-items {
    display: grid;
    gap: 2px;
    padding: 2px 0 5px 8px;
}

.nav-function-items .nav-link {
    min-height: 36px;
    padding-left: 12px;
}

.content {
    min-width: 0;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 28px;
}

.page-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-title h1 {
    margin: 0;
    font-size: 24px;
}

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

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.page-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

.filter-panel {
    margin-bottom: 16px;
}

.filter-panel summary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 0;
}

.field {
    display: grid;
    gap: 4px;
}

.field label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.text-input,
.select-input {
    min-height: 40px;
    min-width: 220px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 0 10px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.text-input:hover,
.select-input:hover {
    border-color: #94a3b8;
}

.text-input:focus,
.select-input:focus,
.button:focus,
.link-button:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 0 14px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.1;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.button.compact {
    min-height: 38px;
    min-width: 64px;
    padding: 0 12px;
    white-space: nowrap;
}

.button.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line-strong);
}

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

.button.subtle {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--line);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}


.export-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.export-button {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.file-action.download {
    color: var(--info);
    border-color: #bae6fd;
    background: var(--info-soft);
}

.file-action.delete {
    background: var(--danger);
    border-color: var(--danger);
}

.print-page {
    background: #ffffff;
}

.print-sheet {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 28px;
    color: #111827;
}

.print-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    border-bottom: 2px solid #111827;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.print-header h1 {
    margin: 0;
    font-size: 24px;
}

.print-header p {
    margin: 4px 0 0;
    color: #4b5563;
}

.print-meta {
    display: grid;
    gap: 4px;
    color: #4b5563;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 14px;
}

.print-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.print-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 12px;
    background: #ffffff;
}

.print-table th,
.print-table td {
    border: 1px solid #d1d5db;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.print-table th {
    background: #f3f4f6;
    font-weight: 800;
}

@media print {
    html,
    body {
        background: #ffffff;
        overflow: visible;
    }

    .print-sheet {
        width: 100%;
        padding: 0;
    }

    .print-actions {
        display: none;
    }

    .print-table-scroll {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .print-table {
        min-width: 0;
        font-size: 10px;
    }

    .print-table th,
    .print-table td {
        padding: 4px 5px;
    }
}
.notice {
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--surface);
    font-weight: 700;
}

.notice.success {
    border-color: #bbf7d0;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.notice.error {
    border-color: #fecaca;
    background: var(--danger-soft);
    color: var(--danger);
}

.form-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.crud-form {
    display: grid;
    gap: 18px;
}

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

.form-grid .field.wide {
    grid-column: 1 / -1;
}

.form-grid .text-input,
.form-grid .select-input {
    width: 100%;
    min-width: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    width: 100%;
}

.checkbox-option {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 14px;
}

.checkbox-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.textarea-input {
    min-height: 120px;
    padding: 10px;
    resize: vertical;
}

.file-upload-field {
    position: relative;
}

.file-upload-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.file-upload-card:hover,
.file-upload-card:focus-within {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.file-upload-card.has-file {
    border-style: solid;
    border-color: #86efac;
    background: var(--primary-soft);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.file-upload-main {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.file-upload-title {
    font-weight: 900;
}

.file-upload-help,
.file-upload-selected {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.file-upload-selected {
    overflow-wrap: anywhere;
    font-weight: 700;
}

.file-upload-card.has-file .file-upload-selected {
    color: var(--primary-dark);
}

.file-upload-button {
    width: 100%;
    white-space: nowrap;
    justify-content: center;
    pointer-events: none;
}

.file-upload-action {
    position: relative;
    min-width: 140px;
}

.file-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.form-actions,
.delete-form {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.delete-form {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.line-editor {
    display: grid;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-top: 4px;
}

.line-editor-head,
.line-editor-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) minmax(90px, 0.7fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(160px, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 760px;
}

.line-editor-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.line-editor-row {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.line-item-cell,
.source-line-cell {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.source-line-cell strong,
.source-line-cell small,
.stock-summary {
    overflow-wrap: anywhere;
}

.source-line-cell small,
.stock-summary {
    color: var(--muted);
    font-size: 12px;
}

.stock-summary {
    font-weight: 700;
}

.line-editor-row .text-input,
.line-editor-row .select-input {
    width: 100%;
    min-width: 0;
}

.row-action-cell {
    white-space: nowrap;
}

.row-actions,
.card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

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

.bulk-action-form {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 10px;
}

.row-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

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

.result-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
}

.compact-select {
    min-width: 120px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.pager-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.pager-button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.pager-button.disabled {
    color: var(--muted);
    background: var(--surface-soft);
    cursor: not-allowed;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
}

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

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    background: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

.status.success {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.status.neutral {
    background: var(--info-soft);
    color: var(--info);
}

.status.info {
    background: var(--info-soft);
    color: var(--info);
}

.status.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.status.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cell-link {
    display: block;
    min-height: 24px;
}

.row-clickable:hover td {
    background: #f8fafc;
}

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

.kpi-card {
    display: grid;
    gap: 6px;
    min-height: 132px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.kpi-card strong {
    font-size: 32px;
    line-height: 1;
}

.kpi-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.kpi-helper {
    color: var(--muted);
    font-size: 13px;
}

.kpi-card.muted {
    background: var(--surface-soft);
}

.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 16px;
}

.work-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
}

.flow-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.flow-list li {
    padding-left: 4px;
}

.action-list {
    display: grid;
    gap: 8px;
}

.action-list a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.dashboard-content {
    display: grid;
    gap: 18px;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-hero h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.dashboard-hero p:not(.eyebrow) {
    margin: 5px 0 0;
    color: var(--muted);
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-kpi-card {
    min-height: 118px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: var(--surface-raised);
}

.dashboard-kpi-card strong {
    font-size: 30px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dashboard-kpi-card.tone-warning {
    border-left-color: var(--warning);
}

.dashboard-kpi-card.tone-danger {
    border-left-color: var(--danger);
}

.dashboard-kpi-card.tone-info {
    border-left-color: var(--focus);
}

.dashboard-kpi-card.tone-neutral {
    border-left-color: var(--line-strong);
}

.dashboard-kpi-card.tone-success {
    border-left-color: var(--primary);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.dashboard-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px;
}

.dashboard-panel-primary {
    border-color: #bbf7d0;
}

.panel-kicker {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.task-list,
.activity-list {
    display: grid;
    gap: 8px;
}

.task-row,
.activity-row {
    min-width: 0;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.task-row span,
.activity-row span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.task-row strong,
.activity-row strong {
    overflow-wrap: anywhere;
}

.task-row small,
.activity-row small,
.activity-row time {
    color: var(--muted);
    font-size: 12px;
}

.task-row em {
    flex: 0 0 auto;
    font-style: normal;
}

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

.quick-action {
    min-height: 64px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.quick-action span {
    color: var(--muted);
    font-size: 12px;
}

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

.support-metric {
    display: grid;
    gap: 4px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.support-metric span,
.support-metric small {
    color: var(--muted);
    font-size: 12px;
}

.support-metric strong {
    font-size: 22px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.empty-inline {
    margin: 0;
    padding: 18px 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

.mobile-card-list {
    display: none;
}

.data-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
}

.data-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.data-card h2 {
    margin: 2px 0 0;
    font-size: 17px;
    line-height: 1.25;
}

.card-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.meta-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.meta-list div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
}

.meta-list dt {
    color: var(--muted);
    font-weight: 700;
}

.meta-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

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

.empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--muted);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 7px;
    min-height: 142px;
    padding: 28px 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--text);
    font-size: 16px;
}

.empty-state span {
    max-width: 440px;
    font-size: 14px;
    line-height: 1.45;
}

.print-empty {
    margin-top: 14px;
}

.detail-panel,
.flow-panel,
.summary-grid,
.detail-lines {
    margin-bottom: 18px;
}

.detail-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px;
}

.detail-action-panel {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px;
}

.detail-action-form {
    display: grid;
    gap: 12px;
}

.detail-action-form .textarea-input {
    width: 100%;
    min-width: 0;
}

.detail-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 18px;
    margin: 0;
}

.detail-grid div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.detail-grid dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-grid dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.flow-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.flow-step {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
}

.flow-index {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--primary-dark);
    font-weight: 800;
}

.flow-step div {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.flow-step strong {
    overflow-wrap: anywhere;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.summary-card {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
}

.summary-card span,
.summary-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-card strong {
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.summary-card strong .status {
    vertical-align: middle;
}

.error-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}

.error-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    display: grid;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 28px;
    box-shadow: 0 18px 54px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.error-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--focus));
}

.error-code {
    width: fit-content;
    margin: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 900;
}

.error-card h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.25;
}

.error-card p {
    margin: 0;
    color: var(--muted);
}

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

.alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fef3c7;
    color: #713f12;
}

.alert.error {
    background: #fee4e2;
    color: var(--danger);
}

.alert.success {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

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

.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(20, 83, 45, 0.10), transparent 30%),
        linear-gradient(135deg, #f8fafc 0%, #eef4f8 100%);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
    padding: 32px;
}

.auth-brand {
    display: grid;
    gap: 16px;
    margin-bottom: 28px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
}

.auth-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-field {
    gap: 7px;
}

.auth-field .text-input {
    min-height: 46px;
    width: 100%;
    min-width: 0;
    border-radius: 8px;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 800;
}

.auth-help,
.auth-footer {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.auth-help {
    margin: 18px 0 0;
}

.auth-footer {
    margin: 8px 0 0;
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        padding: 12px 16px;
    }

    .global-search {
        flex: none;
        max-width: none;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .global-search .button.compact {
        width: auto;
        min-width: 72px;
    }

    .top-actions {
        justify-content: space-between;
    }

    .layout {
        display: block;
    }

    .sidebar {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 10px 12px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-group-title {
        display: none;
    }

    .nav-link {
        white-space: nowrap;
        min-height: 44px;
    }

    .content {
        padding: 16px;
    }

    .page-title {
        display: block;
    }

    .page-actions {
        display: grid;
        justify-content: stretch;
        gap: 8px;
        margin-top: 12px;
    }

    .page-title .button {
        margin-top: 12px;
    }

    .page-actions > .button {
        margin-top: 0;
    }

    .page-title h1 {
        font-size: 20px;
    }

    .toolbar {
        display: grid;
    }

    .form-panel {
        padding: 14px;
    }

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

    .form-actions,
    .delete-form,
    .detail-action-buttons {
        display: grid;
        justify-content: stretch;
    }

    .line-editor-head {
        display: none;
    }

    .line-editor {
        overflow-x: visible;
    }

    .line-editor-row {
        grid-template-columns: 1fr;
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 10px;
        background: var(--surface-soft);
    }

    .filter-panel summary {
        width: 100%;
    }

    .text-input,
    .select-input,
    .button,
    .button.secondary {
        width: 100%;
        min-width: 0;
    }

    .export-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
    }

    .export-actions .button {
        margin-top: 0;
        padding: 0 8px;
    }

    .file-upload-card {
        grid-template-columns: 1fr;
        justify-items: stretch;
        gap: 12px;
        min-height: 0;
        padding: 14px;
    }

    .file-upload-icon {
        width: 42px;
        height: 42px;
    }

    .file-upload-button {
        width: 100%;
    }

    .desktop-table {
        display: none;
    }

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

    .kpi-grid,
    .work-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        min-height: 112px;
    }

    .card-actions,
    .row-actions {
        justify-content: stretch;
    }

    .inline-delete-form {
        width: 100%;
    }

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

    .flow-step {
        align-items: flex-start;
    }

    .error-card {
        padding: 24px 20px;
    }
}

@media (max-width: 760px) {
    .navigation-shell {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        background: var(--nav-bg);
    }

    .navigation-content.sidebar {
        display: none;
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 44px;
        padding: 9px 12px;
        color: var(--nav-text);
        cursor: pointer;
        font-size: 14px;
        list-style: none;
    }

    .mobile-nav-toggle::after {
        width: 8px;
        height: 8px;
        margin-left: auto;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        content: "";
        transform: rotate(45deg) translateY(-2px);
    }

    .mobile-nav-checkbox:checked + .mobile-nav-toggle::after {
        transform: rotate(225deg) translate(-1px, -1px);
    }

    .mobile-nav-checkbox:focus-visible + .mobile-nav-toggle {
        outline: 2px solid var(--primary);
        outline-offset: -2px;
    }

    .mobile-nav-toggle strong {
        min-width: 0;
        max-width: 58%;
        overflow: hidden;
        color: var(--primary-dark);
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navigation-content.sidebar {
        position: static;
        max-width: 100%;
        max-height: min(66vh, 520px);
        padding: 8px 10px 14px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .mobile-nav-checkbox:checked ~ .navigation-content.sidebar {
        display: block;
    }

    .nav-dashboard-link,
    .nav-function-group > summary,
    .nav-function-items .nav-link {
        min-height: 44px;
    }

    .nav-section-title {
        display: block;
    }

    .nav-function-items .nav-link {
        width: 100%;
        border-radius: 6px;
        white-space: normal;
    }

    .nav-function-items .nav-link.active {
        border-color: #bbf7d0;
        background: var(--primary);
        color: #ffffff;
    }
}

@media (max-width: 1100px) and (min-width: 761px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .layout {
        grid-template-columns: 214px minmax(0, 1fr);
    }

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

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .global-search {
        max-width: 440px;
    }
}

@media (max-width: 420px) {
    .auth-page {
        align-items: stretch;
        padding: 16px;
    }

    .auth-card {
        margin: auto 0;
        padding: 24px 20px;
    }

    .auth-title {
        font-size: 23px;
    }

    .content {
        padding: 14px;
    }

    .data-card {
        padding: 12px;
    }

    .meta-list div {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 6px;
    }

    .flow-step {
        padding: 12px;
    }

    .summary-card {
        min-height: 84px;
        padding: 12px;
    }

    .error-actions .button,
    .error-actions .button.secondary {
        width: 100%;
    }
}

@media (min-width: 761px) {
    .filter-panel summary {
        display: none;
    }
}

@media (max-width: 1100px) and (min-width: 761px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile WebView polish: keep the page fixed while header/menu/table internals scroll. */
@media (max-width: 760px) {
    .app-shell,
    .layout,
    .content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 10px;
        min-height: 0;
        padding: 10px 12px;
    }

    .brand {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 16px;
        line-height: 1.2;
    }

    .top-actions {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
        gap: 7px;
        font-size: 12px;
    }

    .top-actions span {
        max-width: 56px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-actions .user-chip {
        max-width: 92px;
        font-size: 11px;
    }

    .top-actions .link-button {
        min-height: 30px;
        padding: 0 9px;
        border-radius: 999px;
        font-size: 12px;
    }

    .global-search {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr) 58px;
        gap: 6px;
    }

    .global-search-input {
        min-height: 34px;
        padding: 0 10px;
        border-radius: 8px;
        font-size: 14px;
    }

    .global-search .button.compact {
        width: auto;
        min-width: 0;
        min-height: 34px;
        padding: 0 10px;
        border-radius: 8px;
        font-size: 14px;
    }

    .sidebar {
        display: flex;
        max-width: 100%;
        gap: 6px;
        padding: 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .nav-group {
        display: contents;
    }

    .nav-link {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 11px;
        border: 1px solid transparent;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.62);
        font-size: 14px;
        line-height: 1.2;
    }

    .nav-link.active {
        border-color: #bbf7d0;
        background: var(--primary);
        color: #ffffff;
    }

    .content {
        padding: 12px;
    }

    .dashboard-content {
        gap: 12px;
    }

    .dashboard-hero h1 {
        font-size: 22px;
    }

    .dashboard-hero p:not(.eyebrow) {
        font-size: 14px;
        line-height: 1.4;
    }

    .page-title {
        margin-bottom: 12px;
    }

    .page-title h1 {
        font-size: 21px;
        line-height: 1.25;
    }

    .page-title p {
        font-size: 14px;
        line-height: 1.4;
    }

    .toolbar {
        gap: 10px;
        padding: 12px;
    }

    .result-bar {
        margin-bottom: 10px;
        font-size: 13px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 14px;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .kpi-card {
        min-height: 92px;
        gap: 5px;
        padding: 12px;
    }

    .dashboard-kpi-card {
        min-height: 96px;
        gap: 5px;
        padding: 12px;
    }

    .kpi-card strong {
        font-size: 28px;
    }

    .dashboard-kpi-card strong {
        font-size: 27px;
    }

    .kpi-label,
    .kpi-helper {
        font-size: 12px;
        line-height: 1.3;
    }

    .dashboard-main-grid,
    .work-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-panel,
    .work-panel {
        padding: 12px;
    }

    .quick-action-grid,
    .support-metric-grid {
        grid-template-columns: 1fr;
    }

    .task-row,
    .activity-row {
        min-height: 50px;
        padding: 10px;
    }

    .data-card {
        padding: 12px;
    }
}
.search-content {
    max-width: 1120px;
}

.work-queue-content {
    max-width: 1120px;
}

.work-queue-summary {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.work-summary-card {
    color: inherit;
    text-decoration: none;
}

.work-summary-card:hover {
    border-color: var(--primary);
    background: var(--surface-soft);
}

.work-summary-card.tone-danger {
    border-top: 3px solid #dc2626;
}

.work-summary-card.tone-warning {
    border-top: 3px solid #d97706;
}

.work-summary-card.tone-info {
    border-top: 3px solid #0284c7;
}

.work-queue-sections {
    display: grid;
    gap: 26px;
}

.work-queue-section {
    min-width: 0;
    scroll-margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line-strong);
}

.work-section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.work-queue-list {
    display: grid;
}

.work-queue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

.work-queue-row:hover {
    background: var(--surface-soft);
}

.work-item-main,
.work-item-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.work-item-main strong,
.work-item-main span,
.work-item-meta small {
    overflow-wrap: anywhere;
}

.work-item-main > span,
.work-item-meta small {
    color: var(--muted);
    font-size: 13px;
}

.work-item-code {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.work-item-meta {
    justify-items: end;
    text-align: right;
}

.work-queue-empty {
    min-height: 120px;
}

.work-queue-limit {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

@media (max-width: 640px) {
    .work-queue-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .work-queue-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 13px 2px;
    }

    .work-item-meta {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        justify-items: start;
        text-align: left;
    }

    .work-item-meta strong {
        justify-self: end;
    }

    .work-section-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.search-page-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.search-page-form .text-input {
    min-width: 0;
    height: 44px;
}

.search-intro {
    display: grid;
    gap: 5px;
    padding: 28px 0;
    color: var(--muted);
}

.search-intro strong {
    color: var(--text);
}

.search-result-summary {
    margin-bottom: 8px;
}

.search-result-groups {
    display: grid;
    gap: 20px;
}

.search-result-group {
    min-width: 0;
    padding-top: 4px;
}

.search-result-group .section-heading {
    margin-bottom: 0;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--line-strong);
}

.search-result-list {
    display: grid;
}

.search-result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

.search-result-row:hover {
    background: var(--surface-soft);
}

.search-result-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.search-result-main strong,
.search-result-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-main small {
    color: var(--muted);
}

.search-result-code {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .search-page-form {
        grid-template-columns: 1fr;
    }

    .search-page-form .button {
        width: 100%;
    }

    .search-result-row {
        align-items: start;
    }
}
