﻿:root {
    --bg: #f4efe6;
    --surface: rgba(255, 250, 242, 0.9);
    --surface-strong: #fffaf2;
    --line: #d9c8af;
    --text: #2d2418;
    --muted: #76624b;
    --brand: #1f7a5c;
    --brand-dark: #165844;
    --accent: #c96f3b;
    --shadow: 0 20px 50px rgba(45, 36, 24, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background: radial-gradient(circle at top left, rgba(201, 111, 59, 0.22), transparent 30%), linear-gradient(135deg, #f7f1e7 0%, #efe2cb 100%);
    color: var(--text);
}
body.modal-open { overflow: hidden; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar {
    padding: 24px 18px;
    background: rgba(255, 250, 242, 0.98);
    color: var(--text);
    border-right: 1px solid rgba(217, 200, 175, 0.7);
    box-shadow: 8px 0 30px rgba(45, 36, 24, 0.05);
}
.sidebar h1, .page-head h2, .card h3, .login-card h2, .modal-card h3 { margin: 0; }
.subtle, .eyebrow { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.page-eyebrow, .login-eyebrow { color: var(--muted); }
.nav { display: grid; gap: 7px; margin-top: 24px; }
.nav a {
    color: var(--text);
    text-decoration: none;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 12px;
    background: rgba(31, 122, 92, 0.05);
    border: 1px solid transparent;
}
.nav a.active, .nav a:hover {
    background: rgba(31, 122, 92, 0.12);
    border-color: rgba(31, 122, 92, 0.16);
    color: var(--brand-dark);
}
.user-card {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    padding: 12px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(31, 122, 92, 0.06);
    color: var(--text);
    border: 1px solid rgba(217, 200, 175, 0.65);
}
.content { padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.badge, .flash { padding: 8px 12px; border-radius: 12px; background: rgba(31,122,92,0.12); color: var(--brand-dark); }
.flash { margin-bottom: 20px; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid rgba(217,200,175,0.6); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.accent-card { background: linear-gradient(135deg, rgba(31,122,92,0.15), rgba(201,111,59,0.18)); }
.stat span, .meta-label { display: block; color: var(--muted); margin-bottom: 12px; }
.stat strong { font-size: 32px; }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid rgba(217,200,175,0.6); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.stat-card strong { display: block; font-size: 28px; margin: 8px 0; }
.stat-label { display: block; color: var(--muted); }
.finance-overview-grid .card {
    padding: 16px;
}
.finance-overview-grid .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin-top: 12px;
}
.finance-overview-grid .mini-stats div {
    align-items: center;
}
.finance-overview-grid .mini-stats strong {
    font-size: 13px;
    white-space: nowrap;
}
.finance-stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.finance-stats-grid .card {
    padding: 12px 14px;
    border-radius: 16px;
}
.finance-stats-grid .stat span {
    margin-bottom: 6px;
    font-size: 11px;
}
.finance-stats-grid .stat strong {
    font-size: 18px;
    line-height: 1.2;
}
.helper, .login-copy { color: var(--muted); font-size: 12px; line-height: 1.45; }
.form { display: grid; gap: 14px; margin-top: 18px; }
.compact-form { margin-top: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.form label, .inline-form label { display: grid; gap: 8px; color: var(--muted); }
input, select, textarea, button { font: inherit; border-radius: 12px; }
input, select, textarea { border: 1px solid var(--line); background: var(--surface-strong); padding: 9px 11px; }
textarea { resize: vertical; }
button { border: none; padding: 9px 13px; background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: white; cursor: pointer; }
.ghost-button[disabled],
.toolbar-button[disabled],
button[disabled],
input[type="submit"][disabled] { opacity: 0.65; cursor: not-allowed; }
.is-loading { position: relative; }
.ghost-button, .ghost-link { background: rgba(31,122,92,0.12); color: var(--brand-dark); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 10px; font-size: 12px; }
.ghost-danger { background: rgba(201,111,59,0.14); color: #9a4d22; }
.status-pill,
.health-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.4;
    border: 1px solid rgba(217,200,175,0.75);
    white-space: nowrap;
}
.status-pill-active { background: rgba(31,122,92,0.12); color: var(--brand-dark); }
.status-pill-paused { background: rgba(118,98,75,0.12); color: var(--muted); }
.status-pill-warning { background: rgba(201,111,59,0.14); color: #9a4d22; }
.status-pill-danger { background: rgba(138,54,54,0.14); color: #8a3636; }
.status-pill-rectification { background: rgba(201,111,59,0.16); color: #9a4d22; }
.status-pill-closed { background: rgba(138,54,54,0.14); color: #8a3636; }
.health-pill-ok { background: rgba(31,122,92,0.10); color: var(--brand-dark); }
.health-pill-warning { background: rgba(201,111,59,0.14); color: #9a4d22; }
.health-pill-danger { background: rgba(138,54,54,0.14); color: #8a3636; }
.sync-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(217,200,175,0.7);
    font-size: 11px;
    line-height: 1.45;
    white-space: nowrap;
}
.sync-pill-success { background: rgba(31,122,92,0.12); color: var(--brand-dark); }
.sync-pill-pending { background: rgba(201,111,59,0.12); color: #9a6b00; }
.sync-pill-muted { background: rgba(118,98,75,0.10); color: var(--muted); }
.sync-pill-warning { background: rgba(181,71,8,0.12); color: #b54708; }
.sync-status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sync-status-line__label {
    color: var(--muted);
}
.sync-status-line__value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.health-pill-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.table-wrap { overflow-x: auto; }
.table-window {
    max-height: min(520px, 68vh);
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    border: 1px solid rgba(217,200,175,0.58);
    border-radius: 16px;
    background: rgba(255,250,242,0.5);
}
.table-window table { margin-top: 0; }
.table-window thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fffaf2;
    box-shadow: 0 1px 0 rgba(217,200,175,0.7);
}
.table-window-compact { max-height: 340px; }
.table-window-medium { max-height: 430px; }
.table-window-tall { max-height: min(640px, 72vh); }
.panel-scroll {
    align-self: start;
    max-height: min(720px, calc(100vh - 160px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
}
.panel-scroll-slim { max-height: min(560px, calc(100vh - 150px)); }
table { width: 100%; border-collapse: collapse; margin-top: 18px; }
th, td { text-align: left; padding: 9px 7px; border-bottom: 1px solid rgba(217,200,175,0.6); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.mini-stats { display: grid; gap: 12px; margin-top: 18px; }
.mini-stats div, .payment-summary div { display: flex; justify-content: space-between; gap: 12px; }
.performance-summary-card {
    padding: 22px;
}
.performance-kpi-grid {
    margin-bottom: 0;
}
.performance-kpi-grid .card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,250,242,0.88);
}
.performance-kpi-grid .stat span {
    margin-bottom: 8px;
    font-size: 11px;
}
.performance-kpi-grid .stat strong {
    font-size: 24px;
    line-height: 1.2;
}
.performance-kpi-grid .stat p {
    margin: 8px 0 0;
}
.performance-detail-grid .card {
    padding: 18px;
}
.performance-detail-grid .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-top: 14px;
}
.performance-detail-grid .mini-stats div {
    align-items: center;
}
.performance-detail-grid .mini-stats strong {
    font-size: 13px;
    white-space: nowrap;
}
.performance-footnote {
    margin: 14px 0 0;
}
.dashboard-kpi-grid .stat p { margin: 6px 0 0; }
.dashboard-action-card { padding: 20px; }
.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.dashboard-action-item {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(217,200,175,0.78);
    background: rgba(255,250,242,0.86);
    color: var(--text);
    text-decoration: none;
}
.dashboard-action-item:hover {
    border-color: rgba(45,104,78,0.45);
    box-shadow: 0 12px 24px rgba(71,52,29,0.08);
    transform: translateY(-1px);
}
.dashboard-action-item span { color: var(--muted); font-weight: 700; }
.dashboard-action-item strong { font-size: 24px; line-height: 1; color: var(--brand-dark); }
.dashboard-action-item em { color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.45; }
.dashboard-action-danger strong { color: #8a3636; }
.dashboard-action-warning strong { color: #8a6a2a; }
.dashboard-board-card { padding: 24px; }
.dashboard-board-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; flex-wrap: wrap; margin-bottom: 18px; }
.dashboard-board-summary { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.dashboard-board-filter { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.dashboard-board-filter label { display: grid; gap: 8px; color: var(--muted); }
.dashboard-preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.dashboard-preset-active { background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: #fff; }
.dashboard-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,250,242,0.92);
    border: 1px solid rgba(217,200,175,0.85);
    color: var(--brand-dark);
    font-weight: 600;
}
.dashboard-board-grid { margin-bottom: 0; }
.dashboard-board-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,250,242,0.88);
    border: 1px solid rgba(217,200,175,0.72);
}
.dashboard-board-panel__head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.dashboard-board-table { margin-top: 0; }
.dashboard-board-table th:first-child,
.dashboard-board-table td:first-child { width: 42px; color: var(--brand-dark); font-weight: 700; }
.dashboard-board-table strong { display: inline-block; margin-bottom: 2px; }
.filter-bar { padding: 18px 22px; }
.orders-workbench-card {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    z-index: 30;
    overflow: visible;
}
.orders-workbench-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    flex-wrap: wrap;
}
.orders-workbench-head-compact {
    align-items: center;
}
.orders-summary-line {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.orders-summary-line strong {
    font-size: 15px;
}
.orders-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(217,200,175,0.55);
}
.orders-filter-form-flat {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}
.orders-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.orders-filter-grid-wide {
    grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(96px, 1fr));
}
.orders-filter-grid label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}
.orders-filter-grid input,
.orders-filter-grid select {
    min-height: 34px;
}
.orders-filter-span-2 { grid-column: span 1; }
.orders-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}
.orders-dropdown-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    z-index: 8;
}
.orders-dropdown {
    position: relative;
    display: inline-flex;
    min-width: 0;
}
.orders-dropdown > summary {
    cursor: pointer;
    list-style: none;
}
.orders-dropdown > summary::-webkit-details-marker {
    display: none;
}
.orders-dropdown > summary::marker {
    content: "";
}
.orders-dropdown-toggle {
    gap: 7px;
    white-space: nowrap;
}
.orders-dropdown-toggle.is-active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: #fff;
}
.orders-dropdown-caret {
    font-size: 10px;
    line-height: 1;
}
.orders-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 220px;
    max-width: min(720px, calc(100vw - 48px));
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(217,200,175,0.72);
    background: rgba(255,250,242,0.98);
    box-shadow: 0 18px 38px rgba(45,36,24,0.14);
}
.orders-dropdown.is-open .orders-dropdown-menu,
.orders-dropdown[open] .orders-dropdown-menu {
    display: block;
}
.orders-dropdown-menu-wide {
    width: min(680px, calc(100vw - 48px));
}
.orders-dropdown-menu-right {
    left: auto;
    right: 0;
}
.orders-filter-more .orders-dropdown-menu {
    left: auto;
    right: 0;
}
.orders-dropdown-actions {
    align-items: flex-start;
}
.orders-filter-grid-advanced {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.orders-inline-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.orders-inline-group {
    display: flex;
    gap: 10px;
    align-items: start;
    padding-top: 0;
    border-top: 0;
}
.orders-inline-group .meta-label {
    min-width: 74px;
    margin: 5px 0 0;
    font-size: 12px;
}
.orders-inline-group__main {
    display: grid;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.orders-summary-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.orders-sync-inline {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(31,122,92,0.05);
    border: 1px solid rgba(31,122,92,0.10);
}
.orders-inline-group-sync .orders-summary-chips {
    justify-content: flex-start;
}
.orders-inline-group-sync .toolbar-actions {
    align-items: flex-start;
}
.orders-collapsible-sync {
    flex: 1;
    min-width: 0;
}
.orders-collapsible-sync summary {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 700;
    list-style-position: inside;
}
.orders-collapsible-sync__body {
    margin-top: 10px;
}
.orders-sync-inline__head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
    flex-wrap: wrap;
}
.orders-sync-inline__list {
    display: grid;
    gap: 8px;
}
.orders-sync-inline__item {
    display: grid;
    grid-template-columns: auto minmax(100px, 160px) minmax(110px, 130px) 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.62);
    border: 1px solid rgba(217,200,175,0.48);
    text-decoration: none;
    color: var(--text);
}
.orders-sync-inline__item strong {
    color: var(--brand-dark);
}
.orders-sync-card .toolbar-row-secondary {
    padding-top: 6px;
}
.orders-sync-card .badge {
    min-width: 92px;
    justify-content: center;
}
.orders-sync-card table th {
    white-space: nowrap;
}
.orders-sync-card table td {
    font-size: 13px;
}
.orders-toolbar-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.orders-toolbar-block {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(217,200,175,0.55);
}
.orders-sync-card .table-wrap table { margin-top: 10px; }
.orders-list-card {
    position: relative;
    z-index: 1;
}
.orders-list-card .table-head {
    align-items: center;
}
.orders-list-card .inline-note {
    max-width: 420px;
}
.orders-list-card .table-wrap {
    margin-top: 6px;
}
.toolbar-row { display: flex; justify-content: space-between; gap: 16px; align-items: end; flex-wrap: wrap; }
.toolbar-row-secondary { margin-top: 14px; align-items: center; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.finance-workbench-card {
    display: grid;
    gap: 14px;
}
.finance-section-nav {
    justify-content: flex-end;
}
.finance-current-filter-note strong {
    color: var(--text);
}
.finance-reminder {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(201,111,59,0.34);
    border-radius: 16px;
    background: rgba(201,111,59,0.12);
}
.finance-reminder div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
}
.finance-reminder strong {
    font-size: 20px;
}
.finance-reminder em {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}
.finance-panel {
    display: grid;
    gap: 14px;
}
.finance-panel__tools {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: end;
}
.finance-section-filter {
    gap: 10px;
}
.finance-mini-filters {
    justify-content: flex-end;
}
.finance-inline-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
}
.finance-inline-field input,
.finance-inline-field select {
    min-width: 150px;
}
.finance-table-window {
    max-height: 420px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(217,200,175,0.55);
    border-radius: 18px;
    background: rgba(255,255,255,0.38);
}
.finance-table-window table {
    margin-top: 0;
    min-width: 960px;
}
.finance-table-window-compact {
    max-height: 320px;
}
.finance-transaction-window {
    max-height: 260px;
    margin-top: 12px;
}
.finance-transaction-window table {
    min-width: 720px;
}
.finance-table-window thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fffaf2;
}
.finance-table-empty {
    margin-top: -4px;
}
.finance-batch-confirm {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.finance-batch-confirm .inline-note {
    flex: 1 1 320px;
}
.finance-payout-pending-row td {
    background: rgba(201,111,59,0.08);
}
.shipping-view-switch { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-button { border: none; padding: 8px 12px; background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: white; cursor: pointer; border-radius: 10px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.inline-note { padding: 12px 14px; border-radius: 14px; background: rgba(31,122,92,0.08); color: var(--brand-dark); }
.finance-import-note { margin-bottom: 12px; line-height: 1.55; }
.payment-summary { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(201,111,59,0.10); }
.action-stack { display: flex; gap: 8px; flex-wrap: wrap; }
.field-inline { display: flex; gap: 8px; align-items: center; }
.field-inline input { flex: 1; }
.table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(46px, 1fr));
    gap: 5px;
    min-width: 104px;
}
.table-actions form {
    display: contents;
}
.table-actions .ghost-link,
.table-actions .ghost-button {
    width: 100%;
    min-height: 26px;
    padding: 4px 7px;
    font-size: 11px;
}
.table-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.logistics-summary { display: grid; gap: 3px; min-width: 150px; }
.logistics-summary strong { font-size: 12px; color: var(--text); }
.logistics-summary span { font-size: 11px; color: var(--muted); line-height: 1.35; }
.logistics-event-line {
    display: -webkit-box;
    max-width: 260px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.order-money-sort {
    display: grid;
    gap: 3px;
}
.order-money-cell {
    display: grid;
    gap: 3px;
    min-width: 118px;
}
.order-money-cell span {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}
.order-money-cell strong {
    color: var(--text);
    white-space: nowrap;
}
.order-profit-line {
    font-weight: 800;
}
.order-profit-positive { color: var(--brand-dark) !important; }
.order-profit-negative { color: #8a3636 !important; }
.order-profit-muted { color: var(--muted) !important; }
.order-priority-cell {
    display: grid;
    gap: 4px;
    min-width: 132px;
}
.order-priority-value {
    display: inline-flex;
    width: fit-content;
    max-width: 220px;
    align-items: center;
    padding: 4px 9px;
    border-radius: 12px;
    border: 1px solid rgba(217,200,175,0.72);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.order-priority-value-success { background: rgba(31,122,92,0.12); color: var(--brand-dark); }
.order-priority-value-warning { background: rgba(201,111,59,0.14); color: #9a4d22; }
.order-priority-value-danger { background: rgba(138,54,54,0.14); color: #8a3636; }
.order-priority-value-muted { background: rgba(118,98,75,0.10); color: var(--muted); }
.order-code-stack { display: grid; gap: 4px; min-width: 118px; }
.order-code-stack .status-pill,
.order-code-stack .health-pill { width: fit-content; }
.order-code-stack strong,
.order-product-meta strong,
.order-product-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-code-stack strong {
    max-width: 150px;
}
.order-product-meta strong,
.order-product-meta span {
    max-width: 140px;
}
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.orders-table-wrap { position: relative; }
.orders-table { min-width: 1580px; font-size: 12px; }
.orders-table th,
.orders-table td { background: rgba(255, 250, 242, 0.96); }
.orders-table th {
    font-size: 11px;
    line-height: 1.25;
}
.orders-table strong {
    font-size: 13px;
}
.orders-table .order-priority-value {
    font-size: 13px;
}
.orders-table td:nth-child(3) strong,
.orders-table td:nth-child(5) strong,
.orders-table td:nth-child(8) strong {
    font-size: 14px;
}
.order-sticky-col {
    position: sticky;
    z-index: 2;
    box-shadow: 1px 0 0 rgba(217,200,175,0.45);
}
.orders-table thead .order-sticky-col { z-index: 4; }
.order-sticky-col-1 { left: 0; min-width: 44px; }
.order-sticky-col-2 { left: 44px; min-width: 112px; }
.order-sticky-col-3 { left: 156px; min-width: 160px; }
.page-jump-form { gap: 8px; align-items: end; }
.page-jump-form input[type="number"] { width: 88px; }
.tracking-link { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.tracking-hover-card {
    position: fixed;
    z-index: 30;
    width: min(320px, calc(100vw - 24px));
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(217,200,175,0.8);
    background: rgba(255,250,242,0.98);
    box-shadow: 0 20px 40px rgba(0,0,0,0.16);
    display: none;
    pointer-events: auto;
}
.tracking-hover-card.is-visible { display: grid; gap: 6px; }
.tracking-hover-card__title { font-size: 14px; font-weight: 700; color: var(--text); }
.tracking-hover-card__meta,
.tracking-hover-card__line { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tracking-hover-card__event {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(217,200,175,0.65);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text);
}
.tracking-preview-card { width: min(760px, 100%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); background: var(--surface); border: 1px solid rgba(217,200,175,0.6); border-radius: 28px; padding: 28px; box-shadow: var(--shadow); }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(26,24,20,0.48); z-index: 2000; }
.modal-card { width: min(640px, 100%); background: #fffaf2; border-radius: 28px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,0.18); }
.modal-backdrop-static { overflow-y: auto; align-items: start; place-items: start center; padding-top: 24px; padding-bottom: 24px; }
.scroll-modal-card { max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.order-modal-card { width: min(1440px, calc(100vw - 40px)); }
.logistics-modal-card { width: min(620px, 100%); }
.finance-modal-card { width: min(760px, calc(100vw - 40px)); }
.finance-ledger-modal-card { width: min(960px, calc(100vw - 40px)); }
.modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.ledger-batch-lines { display: grid; gap: 14px; margin-top: 14px; }
.ledger-batch-line {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(217,200,175,0.72);
    background: rgba(255,255,255,0.72);
}
.ledger-batch-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.ledger-batch-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.remove-ledger-line-button.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}
.timeline-box { padding: 16px; border-radius: 18px; background: rgba(31,122,92,0.08); }
.divider-line { height: 1px; background: rgba(217,200,175,0.8); margin: 18px 0; }
.subheading { margin: 0 0 12px; }
.callback-tools { margin-top: 10px; }
.callback-url-box {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(31,122,92,0.08);
    border: 1px solid rgba(217,200,175,0.6);
    overflow-x: auto;
}
.callback-url-box code {
    white-space: nowrap;
    color: var(--brand-dark);
    font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
    font-size: 12px;
}
.logistics-callback-card {
    margin-top: 18px;
}
.logistics-callback-window {
    max-height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
}
.logistics-callback-window .form-section {
    margin-top: 0;
    padding: 14px;
}
.logistics-callback-window label {
    gap: 6px;
}
.logistics-callback-window .helper {
    margin-bottom: 0;
}
.diagnostic-pre {
    margin: 14px 0 0;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(217,200,175,0.7);
    background: rgba(255,255,255,0.72);
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
@media (max-width: 1180px) { .cols-5, .cols-4, .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .dashboard-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1380px) {
    .orders-filter-form {
        grid-template-columns: 1fr;
    }
    .orders-filter-grid-wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .orders-filter-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 980px) {
    .shell, .cols-5, .cols-4, .cols-3, .cols-2, .modal-grid { grid-template-columns: 1fr; }
    .dashboard-action-grid { grid-template-columns: 1fr; }
    .page-head, .modal-head, .toolbar-row, .table-head { align-items: start; flex-direction: column; }
}
@media (max-width: 1320px) {
    .orders-toolbar-grid {
        grid-template-columns: 1fr;
    }
    .finance-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 980px) {
    .orders-filter-grid {
        grid-template-columns: 1fr;
    }
    .orders-filter-grid-wide {
        grid-template-columns: 1fr;
    }
    .orders-filter-span-2 {
        grid-column: span 1;
    }
    .orders-inline-group {
        flex-direction: column;
        gap: 8px;
    }
    .orders-inline-group__main {
        width: 100%;
    }
    .orders-sync-inline__item {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .orders-inline-group .meta-label {
        min-width: 0;
        margin-top: 0;
    }
    .orders-summary-chips {
        justify-content: flex-start;
    }
    .finance-panel__tools,
    .finance-mini-filters,
    .finance-section-nav {
        justify-content: flex-start;
    }
    .finance-inline-field input,
    .finance-inline-field select,
    .finance-section-filter select,
    .finance-section-filter input {
        min-width: 0;
        width: 100%;
    }
    .finance-table-window table {
        min-width: 760px;
    }
    .finance-overview-grid .mini-stats,
    .finance-stats-grid,
    .performance-detail-grid .mini-stats {
        grid-template-columns: 1fr;
    }
}
.form-section { margin-top: 20px; padding: 18px; border-radius: 20px; background: rgba(255,255,255,0.45); border: 1px solid rgba(217,200,175,0.55); }
.section-head { margin-bottom: 14px; }
.section-head h4 { margin: 0 0 6px; }
.compact-grid { margin-top: 0; }
.wide-modal-card { width: min(1440px, calc(100vw - 40px)); }
.span-2 { grid-column: span 2; }
.order-modal-card .compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.order-modal-card .form-section { margin-top: 14px; }
.order-modal-card .product-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.order-modal-card .product-option-body { min-height: 168px; }
.order-modal-card .span-2 { grid-column: span 3; }
.product-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(217,200,175,0.7); background: rgba(255,255,255,0.7); }
.product-side-column {
    display: grid;
    gap: 18px;
    align-self: start;
}
.product-form-panel {
    max-height: clamp(340px, calc(100vh - 260px), 420px);
}
.product-side-guide {
    margin-top: 0;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(217,200,175,0.68);
    background: rgba(252,250,245,0.86);
}
.product-side-guide h4 {
    margin: 0 0 10px;
    font-size: 15px;
}
.product-side-guide pre {
    margin: 12px 0;
    max-height: 150px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d9c8af;
    background: #f7f2e9;
    font-size: 12px;
}
.product-side-guide ul {
    margin: 12px 0 0;
    padding-left: 18px;
}
.product-side-collision .table-window {
    max-height: 260px;
    margin-top: 12px;
}
.product-side-collision table {
    min-width: 560px;
}
.product-thumb-empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.product-gallery { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin: 16px 0 8px; }
.product-gallery-window {
    max-height: min(560px, 62vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    align-content: start;
}
.product-gallery-card { display: grid; gap: 8px; min-width: 0; padding: 10px; border-radius: 18px; background: rgba(255,255,255,0.72); border: 1px solid rgba(217,200,175,0.75); }
.product-gallery-media { display: grid; }
.product-gallery-image { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: rgba(244,239,230,0.9); }
.product-gallery-image-empty { display: grid; place-items: center; color: var(--muted); border: 1px dashed rgba(217,200,175,0.9); }
.product-gallery-copy { display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.product-gallery-copy strong { color: var(--text); }
.product-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.product-option { display: block; cursor: pointer; }
.product-option input { position: absolute; opacity: 0; pointer-events: none; }
.product-option-body { display: grid; gap: 6px; padding: 10px; border-radius: 16px; border: 1px solid rgba(217,200,175,0.75); background: rgba(255,255,255,0.72); min-height: 190px; }
.product-option input:checked + .product-option-body { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,122,92,0.18); }
.product-option-image { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; background: rgba(244,239,230,0.9); }
.product-option-image-empty { display: grid; place-items: center; color: var(--muted); border: 1px dashed rgba(217,200,175,0.9); }
.order-product-cell { display: flex; gap: 9px; align-items: center; min-width: 190px; }
.order-product-meta { display: grid; gap: 2px; color: var(--muted); font-size: 11px; }
.order-product-meta strong { color: var(--text); }
.logistics-product-card { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.logistics-product-image { width: 120px; height: 120px; object-fit: cover; border-radius: 18px; background: rgba(244,239,230,0.9); border: 1px solid rgba(217,200,175,0.7); }
.logistics-product-image-empty { display: grid; place-items: center; color: var(--muted); border: 1px dashed rgba(217,200,175,0.9); }
.logistics-product-copy { display: grid; gap: 8px; color: var(--muted); }
.logistics-product-copy strong { color: var(--text); font-size: 18px; }
@media (max-width: 980px) { .span-2, .order-modal-card .span-2 { grid-column: span 1; } }
@media (max-width: 980px) { .product-form-panel { max-height: min(520px, calc(100vh - 160px)); } }
@media (max-width: 1760px) { .product-gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 980px) { .product-picker, .product-gallery, .order-modal-card .compact-grid, .order-modal-card .product-picker, .logistics-product-card, .ledger-batch-grid, .ledger-batch-actions { grid-template-columns: 1fr; } }
.trend-table { display: grid; gap: 14px; margin-top: 18px; }
.trend-row {
    display: grid;
    grid-template-columns: 110px 90px repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(217,200,175,0.7);
    background: rgba(255,255,255,0.65);
}
.trend-month { font-weight: 700; color: var(--text); }
.trend-orders { color: var(--muted); font-size: 13px; }
.trend-metric { display: grid; gap: 8px; }
.trend-metric span { color: var(--muted); font-size: 13px; }
.trend-bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(217,200,175,0.45);
    overflow: hidden;
}
.trend-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--brand) 0%, #49a07e 100%);
}
.trend-bar-fill-secondary { background: linear-gradient(135deg, #c96f3b 0%, #e0a16f 100%); }
.trend-bar-fill-profit { background: linear-gradient(135deg, #4b8f67 0%, #7ab88f 100%); }
.trend-bar-fill-negative { background: linear-gradient(135deg, #8a3636 0%, #b95f5f 100%); }
@media (max-width: 1180px) {
    .trend-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .trend-row { grid-template-columns: 1fr; }
}


.compact-product-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.order-modal-card .compact-product-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-product-option-body { min-height: 0; padding: 8px; gap: 3px; font-size: 11px; }
.compact-product-option-row { display: block; }
.compact-product-option-body-row { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 10px; }
.compact-product-option-image { width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; max-height: 150px; object-fit: cover; }
.compact-product-option-thumb { width: 72px; height: 72px; max-height: 72px; aspect-ratio: auto; }
.compact-product-option strong { font-size: 12px; line-height: 1.2; }
.compact-product-option-copy { display: grid; gap: 2px; min-width: 0; }
.compact-product-option-copy span { font-size: 11px; line-height: 1.35; color: var(--muted); }
.compact-product-filter { align-items: end; }
.product-option.is-hidden { display: none; }
.order-product-picker-scroll {
    max-height: 460px;
    overflow-y: auto;
    padding-right: 6px;
    align-content: start;
}
.order-selected-products-card {
    margin-top: 8px;
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(217,200,175,0.72);
    background: rgba(255,255,255,0.65);
}
.order-selected-products-card h5 {
    margin: 0 0 4px;
    font-size: 15px;
}
.selected-product-list {
    display: grid;
    gap: 10px;
}
.empty-selected-products {
    color: var(--muted);
    font-size: 13px;
    padding: 8px 2px;
}
.selected-product-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 110px auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(217,200,175,0.72);
    background: rgba(255,250,242,0.96);
}
.selected-product-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(217,200,175,0.72);
    background: rgba(244,239,230,0.9);
}
.selected-product-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    border: 1px dashed rgba(217,200,175,0.9);
}
.selected-product-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.selected-product-copy strong {
    color: var(--text);
}
.selected-product-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}
.selected-product-qty {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}
.selected-product-qty input {
    width: 100%;
    padding: 10px 12px;
}
.selected-product-remove {
    white-space: nowrap;
}
.order-product-add {
    width: 100%;
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}
.product-variant-card {
    display: grid;
    gap: 10px;
    padding: 10px;
}
.product-variant-card .product-option-body {
    cursor: pointer;
}
.product-variant-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.order-product-variant-button {
    width: auto;
    min-width: 84px;
    padding: 8px 10px;
    border: 1px solid rgba(217,200,175,0.9);
    border-radius: 12px;
    background: rgba(255,255,255,0.96);
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}
.order-product-variant-button:hover,
.order-product-variant-button.is-selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(31,122,92,0.16);
}
.order-product-variant-button.is-selected {
    background: rgba(31,122,92,0.08);
}
.order-product-add .product-option-body {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.order-product-add:hover .product-option-body,
.order-product-add.is-selected .product-option-body {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(31,122,92,0.18);
}
.order-product-add.is-selected .product-option-body {
    background: rgba(31,122,92,0.08);
}
.order-multi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(31,122,92,0.12);
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 600;
}
@media (max-width: 1180px) {
    .selected-product-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }
    .selected-product-qty,
    .selected-product-remove {
        grid-column: 2;
    }
}
