:root {
    --color-bg: #f4f6f3;
    --color-surface: #ffffff;
    --color-sidebar: #202522;
    --color-text: #202522;
    --color-muted: #66706a;
    --color-border: #dde2de;
    --color-accent: #e3b505;
    --color-primary: #315c3b;
    --color-primary-hover: #274b31;
    --color-success: #2f7d4a;
    --color-warning: #a66a00;
    --color-danger: #b42318;
    --color-info: #245e8a;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --sidebar-width: 236px;
    --content-max: 1520px;
    /* Compatibility aliases for screens outside the reference redesign scope. */
    --graphite: var(--color-text);
    --gold: var(--color-accent);
    --gold-light: #fff6d6;
    --gold-dark: #9a7800;
    --gray: var(--color-muted);
    --line: var(--color-border);
    --bg: var(--color-bg);
}

* { box-sizing: border-box; }
html { min-width: 0; max-width: 100%; overflow-x: hidden; background: var(--color-bg); }
body {
    margin: 0; max-width: 100%; overflow-x: hidden;
    min-width: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42;
}
body.nav-open { overflow: hidden; }
a { color: #315c3b; text-underline-offset: 2px; }
a:hover { color: #1f452b; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(227, 181, 5, .65); outline-offset: 2px; }
.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;
}

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    display: flex; flex-direction: column; width: var(--sidebar-width);
    overflow-y: auto; background: var(--color-sidebar); color: #fff;
    border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand {
    display: block; padding: 20px 20px 15px; color: #fff; text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { display: block; width: 156px; max-width: 100%; height: auto; }
.sidebar-brand span {
    display: block; margin-top: 7px; color: #8f9992; font-size: 11px; letter-spacing: .02em;
}
.sidebar-nav { flex: 1; padding: 12px 10px 18px; }
.nav-group + .nav-group { margin-top: 15px; }
.nav-group-label {
    padding: 0 12px 5px; color: #7d8881; font-size: 10px;
    font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
}
.nav-link {
    position: relative; display: flex; align-items: center; gap: 10px;
    min-height: 37px; margin: 1px 0; padding: 8px 12px; border-radius: 7px;
    color: #d8ded9; font-size: 13px; font-weight: 500; text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,.035); color: #fff; }
.nav-link.is-active { background: rgba(255,255,255,.05); color: #fff; font-weight: 650; }
.nav-link.is-active::before {
    content: ""; position: absolute; inset: 9px auto 9px -10px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--color-accent);
}
.nav-marker { position: relative; width: 12px; height: 12px; flex: none; }
.nav-marker::before { content: ""; position: absolute; inset: 3px; border: 1px solid #77827a; border-radius: 2px; }
.nav-link.is-active .nav-marker::before { border-color: var(--color-accent); background: var(--color-accent); }
.sidebar-foot { padding: 13px 20px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-user-name { overflow: hidden; color: #f4f6f3; font-size: 13px; font-weight: 600; text-overflow: ellipsis; }
.sidebar-user-role { margin-top: 3px; color: #aeb6b0; font-size: 12px; overflow-wrap: anywhere; }

.app-main { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
    min-height: 54px; padding: 0 24px; background: #fff;
    border-bottom: 1px solid #e6e9e6;
}
.breadcrumbs { flex: 1; min-width: 0; color: var(--color-muted); font-size: 13px; }
.breadcrumbs a { color: var(--color-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-text); }
.breadcrumbs .separator { margin: 0 7px; color: #aab1ac; }
.breadcrumbs .current { color: var(--color-text); font-weight: 600; }
.profile-menu { position: relative; }
.profile-menu > summary { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 7px; border-radius: 7px; cursor: pointer; list-style: none; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu > summary:hover { background: #f2f4f2; }
.profile-avatar { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 7px; background: #e9efea; color: var(--color-primary); font-size: 12px; font-weight: 750; }
.profile-summary { display: grid; max-width: 190px; line-height: 1.18; }
.profile-summary strong, .profile-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-summary strong { font-size: 12px; font-weight: 650; }
.profile-summary small { margin-top: 2px; color: var(--color-muted); font-size: 10px; }
.profile-chevron { color: var(--color-muted); font-size: 12px; }
.profile-popover { position: absolute; top: calc(100% + 5px); right: 0; z-index: 30; min-width: 210px; padding: 6px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(25,40,30,.10); }
.profile-popover-meta { display: grid; gap: 2px; padding: 8px 9px; border-bottom: 1px solid #edf0ed; }
.profile-popover-meta strong { font-size: 12px; }
.profile-popover-meta span { color: var(--color-muted); font-size: 11px; }
.profile-popover form { margin: 3px 0 0; }
.profile-popover button { justify-content: flex-start; width: 100%; }
.profile-popover-link { display: block; margin-top: 3px; padding: 8px 9px; border-radius: 6px; color: var(--color-text); font-size: 12px; text-decoration: none; }
.profile-popover-link:hover { background: #eef1ee; color: var(--color-text); }
.nav-toggle {
    display: none; width: 40px; height: 40px; margin-right: 10px; padding: 0;
    border: 1px solid var(--color-border); border-radius: 8px; background: #fff;
    color: var(--color-text); cursor: pointer;
}
.nav-overlay { display: none; }
.page-content { min-width: 0; padding: 24px; }
.page-content > * { width: 100%; max-width: var(--content-max); margin-right: auto; margin-left: auto; }

h1, h2, h3, h4 { color: var(--color-text); line-height: 1.2; }
h1 { margin: 0; font-size: clamp(23px, 2.1vw, 29px); letter-spacing: -.025em; }
h2 { font-size: 20px; letter-spacing: -.012em; }
h3 { font-size: 17px; }
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
    margin-bottom: 16px;
}
.page-header-copy { min-width: 0; }
.page-eyebrow {
    margin-bottom: 3px; color: var(--color-warning); font-size: 10px;
    font-weight: 750; letter-spacing: .09em; text-transform: uppercase;
}
.page-subtitle { max-width: 820px; margin: 5px 0 0; color: var(--color-muted); font-size: 13px; }
.page-actions { display: flex; flex: none; flex-wrap: wrap; gap: 8px; }
.section-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    min-width: 0; margin: 0 0 9px;
}
.section-header > * { min-width: 0; }
.section-header h2, .section-header h3 { margin: 0; }
.section-note { margin: 3px 0 0; color: var(--color-muted); font-size: 12px; }

.button, .btn, button[type="submit"] {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 36px; padding: 8px 14px; border: 1px solid transparent;
    border-radius: 7px; background: var(--color-primary); color: #fff;
    font-weight: 650; line-height: 1.2; text-align: center; text-decoration: none;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.button:hover, .btn:hover, button[type="submit"]:hover { background: var(--color-primary-hover); color: #fff; }
.button:active, .btn:active, button[type="submit"]:active { transform: translateY(1px); }
.button-secondary, button.button-secondary {
    border-color: var(--color-border); background: #fff; color: var(--color-text);
}
.button-secondary:hover, button.button-secondary:hover { border-color: #aab4ad; background: #f8faf8; color: var(--color-text); }
.button-danger, button.button-danger { border-color: #e6aaa6; background: #fff; color: var(--color-danger); }
.button-danger:hover, button.button-danger:hover { border-color: var(--color-danger); background: #fff5f4; color: #8f1c13; }
.button-quiet, button.button-quiet { border-color: transparent; background: transparent; color: var(--color-muted); }
.button-quiet:hover, button.button-quiet:hover { background: #eef1ee; color: var(--color-text); }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 12px; }
.icon-button {
    display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--color-border); border-radius: 7px; background: #fff;
    color: var(--color-text); font-size: 20px; font-weight: 650; line-height: 1;
    text-decoration: none; cursor: pointer;
}
.icon-button:hover { border-color: #b5bdb7; background: #f4f6f4; color: var(--color-text); }
.icon-button:active { transform: translateY(1px); }
.button[aria-disabled="true"] { pointer-events: none; opacity: .55; }

.card {
    width: 100%; max-width: none; padding: 18px; background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    box-shadow: none;
}
.card + .card { margin-top: 14px; }
.pwa-settings { display: grid; gap: 14px; }
.pwa-settings [hidden] { display: none !important; }
.pwa-settings .card + .card { margin-top: 0; }
.pwa-status { margin: 8px 0 14px; font-weight: 650; }
.pwa-help { margin-top: 14px; color: var(--color-muted); }
.pwa-help summary { cursor: pointer; color: var(--color-text); font-weight: 650; }
.pwa-help p { margin: 9px 0 0; }
.card-flat { padding: 0; overflow: hidden; }
.card-section { padding: 16px 18px; }
.card-section + .card-section { border-top: 1px solid var(--color-border); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }
.metric-card { min-width: 0; padding: 13px 15px; border: 1px solid #e3e7e3; border-radius: var(--radius); background: rgba(255,255,255,.72); }
.metric-label { color: var(--color-muted); font-size: 12px; font-weight: 600; }
.metric-value { margin-top: 2px; font-size: 22px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric-detail { margin-top: 2px; color: var(--color-muted); font-size: 12px; }
.metric-card.is-warning .metric-value { color: var(--color-warning); }
.metric-card.is-success .metric-value { color: var(--color-success); }
.metric-card.is-danger { border-color: #efc3c0; background: #fff9f8; }
.metric-card.is-danger .metric-value { color: var(--color-danger); }
.compact-card { padding-top: 15px; padding-bottom: 15px; }
.compact-card .section-header { margin-bottom: 5px; }
.warehouse-date-toolbar { align-items: center; }
.warehouse-date-toolbar > label { color: #3f4942; font-size: 13px; font-weight: 650; }
.warehouse-date-toolbar input[type="date"] { width: 150px; }
.history-slice { color: var(--color-warning); font-size: 12px; }
.history-slice span { margin-left: 5px; color: var(--color-muted); }
.empty-inline { margin: 0; color: var(--color-muted); font-size: 12px; }
.empty-inline strong { color: var(--color-text); }

.badge {
    display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px;
    border-radius: 999px; background: #edf0ed; color: #49534c;
    font-size: 11px; font-weight: 650; line-height: 1.2; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; opacity: .62; }
.badge-neutral { background: #edf0ed; color: #59625c; }
.badge-info { background: #eaf2f8; color: var(--color-info); }
.badge-warning { background: #fff3d6; color: var(--color-warning); }
.badge-success { background: #eaf5ee; color: var(--color-success); }
.badge-danger { background: #fdecea; color: var(--color-danger); }
.badge-dark { background: var(--color-sidebar); color: #fff; }

.alert { position: relative; padding: 13px 15px 13px 42px; border: 1px solid var(--color-border); border-radius: var(--radius); background: #f8faf8; }
.alert::before { content: "i"; position: absolute; top: 13px; left: 15px; display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800; }
.alert-info { border-color: #c7dceb; background: #f2f8fc; color: #174f76; }
.alert-warning { border-color: #ebd59d; background: #fff9e9; color: #795000; }
.alert-success { border-color: #bfddca; background: #f0f8f3; color: #23663b; }
.alert-danger { border-color: #ecc0bd; background: #fff5f4; color: #8f1c13; }
.message-stack { margin-bottom: 16px; }

.toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.toolbar-spacer { flex: 1; }
.field-group { min-width: 0; margin-bottom: 14px; }
.field-label, .field-group > label { display: block; margin-bottom: 5px; color: #3f4942; font-size: 13px; font-weight: 650; }
.field-help { display: block; margin-top: 5px; color: var(--color-muted); font-size: 12px; }
.field-error, .errorlist { margin: 5px 0 0; padding: 0; color: var(--color-danger); font-size: 12px; list-style: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.spaced-top { margin-top: 14px !important; }
.spaced-top-small { margin-top: 10px !important; }
.flush-table { border: 0; border-radius: 0; }
.field-inline { margin-bottom: 0; }
.field-wide { min-width: 230px; }
.form-medium { max-width: 520px; }
.heading-flush { margin-top: 0; }
.toolbar-compact { margin-bottom: 10px; }
.narrow-page { max-width: 720px !important; margin-left: 0 !important; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.permission-section { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--color-border); border-radius: var(--radius); }
.permission-section legend { padding: 0 5px; font-weight: 700; }
.check-row { display: block; padding: 8px 0; color: var(--color-text); font-size: 13px; }
.check-row + .check-row { border-top: 1px solid #edf0ed; }
.check-row small { display: block; margin: 3px 0 0 24px; color: var(--color-muted); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], select, textarea {
    width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #cbd2cc;
    border-radius: 8px; background: #fff; color: var(--color-text);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--color-accent); outline: 3px solid rgba(227,181,5,.22); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primary); }

.tabs { display: flex; gap: 3px; margin: 0 0 14px; padding: 3px; overflow-x: auto; border: 0; border-radius: 8px; background: #e9ede9; }
.tab-link { min-height: 33px; padding: 7px 13px; border-radius: 6px; color: var(--color-muted); font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.tab-link:hover { color: var(--color-text); }
.tab-link.is-active { background: #fff; color: var(--color-text); box-shadow: 0 1px 2px rgba(20,30,20,.08); }

.table-shell { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th { padding: 8px 11px; background: #f6f8f6; color: #59625c; font-size: 11px; font-weight: 700; text-align: left; white-space: nowrap; }
.data-table td { padding: 9px 11px; border-top: 1px solid #e7eae7; vertical-align: middle; }
.data-table tbody tr { background: #fff; }
.data-table tbody tr:hover { background: #f8faf8; }
.data-table .numeric { text-align: right; }
.data-table .muted { color: var(--color-muted); }
.data-table .primary-cell { color: var(--color-text); font-weight: 700; }
.data-table a.primary-link { color: var(--color-text); text-decoration-color: #a9b0aa; }
.data-table tr[data-href] { cursor: pointer; }
.data-table tr[data-href]:focus-visible { outline-offset: -3px; }
.table-empty { padding: 20px 16px !important; color: var(--color-muted); text-align: center; }
.table-subvalue { display: block; margin-top: 2px; color: var(--color-muted); font-size: 11px; font-weight: 400; }
.table-progress { min-width: 110px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #e5e9e6; }
.progress-value { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); }
.progress-value.is-warning { background: var(--color-warning); }
.progress-value.is-danger { background: var(--color-danger); }

.filter-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-pill { padding: 5px 9px; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; color: var(--color-muted); font-size: 11px; font-weight: 650; text-decoration: none; }
.filter-pill:hover { border-color: #aab4ad; color: var(--color-text); }
.filter-pill.is-active { border-color: var(--color-sidebar); background: var(--color-sidebar); color: #fff; }

.empty-state { padding: 20px 16px; color: var(--color-muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--color-text); font-size: 16px; }
.action-menu { position: relative; display: inline-block; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu[open] .action-menu-popover { display: grid; animation: menu-in .14s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.action-menu-popover {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; display: none;
    min-width: 200px; padding: 6px; border: 1px solid var(--color-border);
    border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(26,38,29,.11);
}
.action-menu-popover.is-floating {
    position: fixed; top: auto; right: auto; left: auto; z-index: 100; display: grid;
    animation: menu-in .14s ease-out;
}
.action-menu-popover a, .action-menu-popover button { justify-content: flex-start; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--color-text); font-size: 13px; font-weight: 500; text-align: left; text-decoration: none; }
.action-menu-popover a:hover, .action-menu-popover button:hover { background: #f1f4f1; }
.action-menu-popover .is-danger { color: var(--color-danger); }
.action-menu-popover form { margin: 0; }

.dashboard-section + .dashboard-section { margin-top: 20px; }
.attention-list { display: grid; gap: 8px; }
.attention-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #ead8aa; border-radius: var(--radius); background: #fffaf0; color: var(--color-text); text-decoration: none; }
.attention-item:hover { border-color: #b9c3bb; background: #fbfcfb; color: var(--color-text); }
.attention-marker { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--color-info); }
.attention-item.is-warn .attention-marker { background: var(--color-warning); }
.attention-text { flex: 1; font-weight: 600; }
.attention-arrow { color: var(--color-muted); font-size: 18px; }
.work-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 8px; }
.work-action { display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 12px; border: 1px solid #e0e5e1; border-radius: var(--radius); background: rgba(255,255,255,.55); color: var(--color-text); text-decoration: none; }
.work-action:hover { border-color: #9dad9f; background: #fafcf9; color: var(--color-text); }
.work-action-count { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 7px; background: #edf3ee; color: var(--color-primary); font-size: 16px; font-weight: 750; }
.work-action-title { display: block; font-weight: 700; }
.work-action-note { display: block; margin-top: 2px; color: var(--color-muted); font-size: 12px; }

.workflow { display: grid; width: 100%; min-width: 0; max-width: 100%; grid-template-columns: repeat(5, 1fr); margin-top: 12px; }
.receiving-tabs, .work-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 5px; border: 1px solid var(--color-border); border-radius: var(--radius); background: #f5f8f5; }
.receiving-tabs a, .work-tabs a { padding: 9px 13px; border-radius: 7px; color: var(--color-text); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.receiving-tabs a:hover, .work-tabs a:hover { background: #e8efe8; }
.receiving-tabs a[aria-current="page"], .work-tabs a[aria-current="page"] { background: var(--color-primary); color: #fff; }
.receiving-backlinks { display: flex; flex-wrap: wrap; gap: 14px; margin: 11px 0 0; font-size: 13px; }
.receiving-dialog { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 22px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.receiving-dialog::backdrop { background: rgba(19,27,21,.5); }
.receiving-dialog .section-header { align-items: center; }
.receiving-dialog textarea { width: 100%; box-sizing: border-box; }
.workflow-step { position: relative; min-width: 0; padding-top: 20px; color: var(--color-muted); font-size: 12px; font-weight: 650; text-align: center; }
.workflow-step::before { content: ""; position: absolute; top: 7px; left: 0; width: 100%; height: 2px; background: var(--color-border); }
.workflow-step:first-child::before { left: 50%; width: 50%; }
.workflow-step:last-child::before { width: 50%; }
.workflow-step::after { content: ""; position: absolute; top: 2px; left: calc(50% - 6px); width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: #cbd2cc; box-shadow: 0 0 0 1px #cbd2cc; }
.workflow-step.is-done { color: var(--color-text); }
.workflow-step.is-done::before, .workflow-step.is-done::after { background: var(--color-success); }
.workflow-step.is-current { color: var(--color-text); font-weight: 750; }
.workflow-step.is-current::after { background: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }
.workflow-mobile { display: none; }
.workflow-mobile span { display: block; color: var(--color-muted); font-size: 11px; font-weight: 650; }
.workflow-mobile strong { display: block; margin-top: 2px; font-size: 16px; }
.workflow-mobile progress {
    width: 100%; height: 5px; margin-top: 11px; overflow: hidden;
    border: 0; border-radius: 999px; background: #e3e8e4; color: var(--color-primary);
}
.workflow-mobile progress::-webkit-progress-bar { border-radius: 999px; background: #e3e8e4; }
.workflow-mobile progress::-webkit-progress-value { border-radius: 999px; background: var(--color-primary); }
.workflow-mobile progress::-moz-progress-bar { border-radius: 999px; background: var(--color-primary); }
.next-step-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border: 0; border-left: 3px solid var(--color-primary); border-radius: 5px; background: #edf4ef; }
.next-step-panel > * { min-width: 0; }
.next-step-panel h2 { margin: 0; font-size: 18px; }
.next-step-panel p { margin: 4px 0 0; color: var(--color-muted); font-size: 13px; }
.next-step-panel.is-terminal { border-left-color: #7a857d; background: #f0f2f0; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px 18px; }
.summary-item dt { color: var(--color-muted); font-size: 12px; }
.summary-item dd { margin: 3px 0 0; color: var(--color-text); font-weight: 650; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.decision-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); gap: 16px; }
.danger-zone { padding: 16px; border: 1px solid #efc3c0; border-radius: var(--radius); background: #fff9f8; }
.history-list details { padding: 12px 0; border-top: 1px solid var(--color-border); }
.history-list details:first-child { border-top: 0; }
.history-list summary { cursor: pointer; font-weight: 650; }
.receiving-workflow-history .history-entry {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
    overflow-wrap: anywhere;
}
.receiving-workflow-history .history-entry:first-child { border-top: 0; }
.receiving-workflow-history .history-entry-detail { display: block; margin-top: 4px; }
@media (max-width: 600px) {
    .receiving-workflow-history .history-entry { flex-direction: column; gap: 4px; }
}

.access-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.access-toolbar .search-field { width: min(340px, 100%); }
.audit-event { padding: 14px 0; border-top: 1px solid var(--color-border); }
.audit-event:first-child { border-top: 0; }
.audit-event summary { cursor: pointer; list-style-position: outside; }
.audit-meta { display: block; margin-top: 3px; color: var(--color-muted); font-size: 12px; }
.technical-data { max-width: 100%; margin-top: 10px; padding: 10px; overflow-x: auto; border-radius: 7px; background: #f3f5f3; color: #465048; font: 12px/1.45 Consolas, monospace; }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-card { width: min(410px, 100%); }
.auth-brand { margin-bottom: 20px; text-align: center; }
.auth-brand img { width: 190px; max-width: 80%; }

@media (max-width: 1100px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 30px rgba(18,28,20,.2); }
    body.nav-open .sidebar { transform: translateX(0); }
    .nav-overlay { position: fixed; inset: 0; z-index: 35; width: 100%; height: 100%; border: 0; background: rgba(19,27,21,.45); }
    body.nav-open .nav-overlay { display: block; }
    .app-main { margin-left: 0; }
    .nav-toggle { display: inline-grid; flex: none; place-items: center; }
    .page-content { padding: 24px; }
    .analysis-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .receiving-tabs, .work-tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; }
    .receiving-tabs a, .work-tabs a { flex: none; min-height: 44px; display: inline-flex; align-items: center; }
    .receiving-dialog { max-height: calc(100dvh - 16px); padding: 16px; }
    .topbar { min-height: 54px; padding: 0 14px; }
    .profile-summary, .profile-chevron { display: none; }
    .profile-menu > summary { min-width: 44px; min-height: 44px; justify-content: center; padding: 4px; }
    .profile-avatar { width: 31px; height: 31px; }
    .page-content { padding: 16px 14px 26px; }
    .page-header { align-items: stretch; flex-direction: column; gap: 11px; }
    .section-header { align-items: flex-start; flex-wrap: wrap; }
    .page-actions { width: 100%; }
    .page-actions > .button, .page-actions > .btn { flex: 1; }
    .page-actions .action-menu { width: auto; max-width: 100%; }
    .page-actions .action-menu > summary { width: auto; max-width: 100%; }
    .card { padding: 15px; border-radius: 9px; }
    .card-section { padding: 15px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { padding: 14px; }
    .metric-value { font-size: 21px; }
    .form-grid, .decision-grid { grid-template-columns: 1fr; }
    .permission-grid { grid-template-columns: 1fr; }
    .next-step-panel { align-items: stretch; flex-direction: column; }
    .next-step-panel .button { width: 100%; min-height: 44px; }
    .table-mobile-cards { overflow: visible; border: 0; }
    .table-mobile-cards .data-table, .table-mobile-cards tbody, .table-mobile-cards tr, .table-mobile-cards td { display: block; width: 100%; }
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards .data-table tr { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius); }
    .table-mobile-cards .data-table td { display: grid; grid-template-columns: minmax(105px, .7fr) minmax(0, 1fr); gap: 10px; padding: 6px 0; border: 0; text-align: left; }
    .table-mobile-cards .data-table td::before { content: attr(data-label); color: var(--color-muted); font-size: 12px; font-weight: 600; }
    .table-mobile-cards .data-table td.is-primary { display: block; padding-bottom: 9px; border-bottom: 1px solid var(--color-border); }
    .table-mobile-cards .data-table td.is-primary::before { display: none; }
    .table-mobile-cards .data-table td.is-actions { display: flex; justify-content: flex-end; padding-top: 9px; border-top: 1px solid var(--color-border); }
    .table-mobile-cards .data-table td.is-actions::before { display: none; }
    .hide-phone { display: none !important; }
}

@media (max-width: 430px) {
    .metric-grid { grid-template-columns: 1fr; }
    .toolbar > *, .toolbar label { width: 100%; }
    .toolbar .button, .toolbar button { width: 100%; }
    .filter-pills { flex-wrap: nowrap; margin-right: -14px; padding-right: 14px; overflow-x: auto; }
    .work-action-grid { grid-template-columns: 1fr; }
    .workflow-desktop { display: none; }
    .workflow-mobile { display: block; }
    .nav-toggle { width: 44px; height: 44px; }
    .button, .btn, button[type="submit"] { min-height: 44px; }
    .icon-button { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
    .sidebar, .topbar, .nav-overlay, .no-print { display: none !important; }
    .app-main { margin: 0; }
    .page-content { padding: 0; }
    .card { border: 0; box-shadow: none; }
}
.search-select{position:relative;display:block;width:100%;max-width:100%}.search-select-native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:0!important;opacity:0!important;pointer-events:none!important}.search-select-trigger{width:100%;min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;text-align:left;background:#fff!important;color:#203129!important;border:1px solid #cbd4cd!important;border-radius:8px!important;font:inherit;font-weight:400!important;box-shadow:none!important}.search-select-trigger:hover{border-color:#829589!important}.search-select-trigger:focus-visible,.search-select.is-open .search-select-trigger{outline:2px solid #4d8062;outline-offset:1px;border-color:#4d8062!important}.search-select-trigger.is-placeholder{color:#67736c!important}.search-select-chevron{font-size:16px;color:#66736b}.search-select-panel{position:absolute;z-index:1200;top:calc(100% + 5px);left:0;width:max(100%,280px);max-width:min(440px,calc(100vw - 24px));padding:8px;background:#fff;border:1px solid #cbd4cd;border-radius:10px;box-shadow:0 12px 34px rgba(22,61,42,.18)}.search-select-panel[hidden]{display:none}.search-select-input{box-sizing:border-box;width:100%!important;min-height:42px;margin:0 0 6px!important;padding:9px 10px!important;border:1px solid #aebbb2!important;border-radius:7px!important;background:#fff!important;color:#203129!important;font:inherit!important;font-size:16px!important}.search-select-options{max-height:min(320px,45vh);overflow-y:auto;overscroll-behavior:contain}.search-select-option{display:block;width:100%;padding:9px 10px;text-align:left;background:transparent!important;color:#203129!important;border:0!important;border-radius:6px!important;font:inherit;font-weight:400!important;box-shadow:none!important}.search-select-option:hover,.search-select-option.is-active{background:#edf4ef!important}.search-select-option.is-selected{color:#174c30!important;font-weight:600!important}.search-select-option.is-selected::after{content:" ✓"}.search-select-empty{padding:14px 10px;color:#67736c;text-align:center;font-size:14px}.search-select.is-invalid .search-select-trigger{border-color:#a93636!important}@media(max-width:520px){.search-select-panel{position:fixed;left:12px;right:12px;top:auto;bottom:12px;width:auto;max-width:none;max-height:65vh}.search-select-options{max-height:48vh}}
