:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #15243a;
  background: #f3f6fa;
  font-synthesis: none;
  --navy: #102a5e;
  --navy-2: #1b467b;
  --blue: #1769d2;
  --blue-soft: #eaf3ff;
  --green: #177a58;
  --amber: #a76500;
  --red: #b42318;
  --line: #d9e3ef;
  --muted: #637189;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f3f6fa; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { border: 1px solid #c8d5e5; background: #fff; color: #20324c; min-height: 36px; padding: 0 13px; border-radius: 6px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease; }
button:hover { border-color: var(--blue); color: var(--blue); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid rgba(23, 105, 210, .2); outline-offset: 2px; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #0f55b2; color: #fff; }
button.wide { width: 100%; }
button.text-button { border: 0; padding: 0; min-height: auto; color: #cfe1ed; background: transparent; text-align: left; }
.icon-button { width: 38px; padding: 0; font-size: 24px; line-height: 1; }
input, select, textarea { width: 100%; border: 1px solid #c8d5e5; border-radius: 6px; background: #fff; color: #15243a; padding: 9px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 105, 210, .12); }
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: #455463; font-size: 13px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #edf3f9; }
.login-panel { width: min(450px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--blue); padding: 36px 38px 38px; border-radius: 8px; box-shadow: 0 20px 50px rgba(16, 42, 94, .14); }
.login-panel h1 { margin: 10px 0 12px; color: var(--navy); }
.brand-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.brand-symbol { position: relative; width: 62px; height: 62px; flex: 0 0 62px; overflow: hidden; border: 1px solid #dbe8f7; border-radius: 8px; background: #f5f9ff; }
.brand-symbol img { position: absolute; top: -45px; left: -26px; width: 420px; max-width: none; height: auto; }
.brand-wordmark { min-width: 0; }
.brand-wordmark strong { display: block; color: var(--navy); font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; font-size: 28px; font-weight: 900; line-height: 1; }
.brand-wordmark > span:not(.sr-only) { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--blue); font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.brand-wordmark > span:not(.sr-only)::before { content: ""; width: 12px; height: 2px; flex: 0 0 12px; background: #55a8ff; }
.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.login-error { margin-top: -4px; padding: 10px 12px; border: 1px solid #e5a49f; border-left: 4px solid var(--red); border-radius: 4px; background: #fff3f2; color: #8f1d16; font-size: 13px; line-height: 1.45; }
#loginForm input[aria-invalid="true"] { border-color: var(--red); background: #fffafa; box-shadow: 0 0 0 3px rgba(180, 35, 24, .1); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; box-shadow: 6px 0 20px rgba(16, 42, 94, .08); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.13); }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 16px; }
.sidebar-brand span { margin-top: 3px; font-size: 12px; color: #b9cbd7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.sidebar-logo-mark { position: relative; width: 42px; height: 44px; flex: 0 0 42px; overflow: hidden; border-radius: 6px; background: #fff; }
.sidebar-logo-mark img { position: absolute; top: -42px; left: -25px; width: 360px; max-width: none; height: auto; }
.sidebar-wordmark strong { color: #fff; font-size: 18px; line-height: 1; }
.sidebar-wordmark > span:not(.sr-only) { margin-top: 6px; color: #8fc6ff; font-size: 9px; }
.sidebar-wordmark > span:not(.sr-only)::before { width: 9px; flex-basis: 9px; background: #55a8ff; }
.sidebar-brand #companyName.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; }
nav { display: grid; gap: 6px; margin-top: 20px; }
.nav-item { border: 0; border-left: 3px solid transparent; color: #d9e6f5; background: transparent; text-align: left; padding: 0 13px; }
.nav-item:hover, .nav-item.active { color: #fff; background: var(--navy-2); border-left-color: #55a8ff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 5px; padding: 16px 10px 4px; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-footer small { color: #aebfca; }

.main-area { min-width: 0; }
.topbar { min-height: 72px; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(16, 42, 94, .04); }
.topbar h2 { margin-top: 4px; }
.top-actions { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.page { display: none; padding: 20px 24px 30px; }
.active-page { display: block; animation: page-in .16s ease-out; }
@keyframes page-in { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dashboard-kpis { grid-template-columns: repeat(7, minmax(100px, 1fr)); }
.compact-kpis { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.review-task-kpis { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.ledger-kpis { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); padding: 14px; border-radius: 6px; min-height: 94px; box-shadow: 0 4px 14px rgba(16, 42, 94, .04); }
.kpi.interactive { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.kpi.interactive:hover { border-color: #aebfca; box-shadow: 0 5px 16px rgba(21, 50, 75, .08); transform: translateY(-1px); }
.kpi.interactive:focus-visible { outline: 3px solid rgba(35, 107, 142, .2); outline-offset: 2px; }
.kpi.green { border-left-color: var(--green); }
.kpi.amber { border-left-color: var(--amber); }
.kpi.red { border-left-color: var(--red); }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin-top: 10px; font-size: 24px; line-height: 1; }

.section-band { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); padding: 16px; margin-bottom: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.status-strip { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); border: 1px solid var(--line); }
.status-cell { min-height: 70px; padding: 10px; border: 0; border-right: 1px solid var(--line); border-radius: 0; text-align: center; background: #fff; }
.status-cell:last-child { border-right: 0; }
.status-cell:hover { background: #f5f9fb; color: var(--blue); }
.status-cell span { display: block; color: var(--muted); font-size: 12px; }
.status-cell strong { display: block; margin-top: 7px; font-size: 20px; }

.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 160px 160px auto auto auto; gap: 8px; align-items: center; background: #fff; padding: 12px; border: 1px solid var(--line); border-top: 3px solid var(--blue); margin-bottom: 12px; }
.toolbar-count { grid-column: 1 / -1; color: var(--muted); font-size: 12px; min-height: 16px; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ledger-toolbar { grid-template-columns: minmax(280px, 1fr) 180px auto; padding: 0 0 14px; border-top: 0; }
.settlement-section { border-top-color: var(--green); }
.settlement-toolbar { display: grid; grid-template-columns: 190px 190px auto auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.settlement-toolbar button { min-width: 112px; }
.settlement-kpis { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.settlement-preview-table { max-height: 340px; }
.settlement-confirm-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.settlement-confirm-summary div { min-width: 0; padding: 12px; background: #f8fbff; }
.settlement-confirm-summary span, .settlement-confirm-summary strong { display: block; }
.settlement-confirm-summary span { color: var(--muted); font-size: 12px; }
.settlement-confirm-summary strong { margin-top: 6px; font-size: 16px; overflow-wrap: anywhere; }
.settlement-warning { padding: 10px 12px; border-left: 4px solid var(--amber); background: #fff8e8; color: #6f4b0c; font-size: 12px; line-height: 1.55; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); background: #fff; scrollbar-color: #aebfca #edf1f4; }
table { width: 100%; border-collapse: collapse; min-width: 940px; }
th { position: sticky; top: 0; z-index: 2; background: #eef4fb; color: #263d5e; font-size: 12px; font-weight: 700; text-align: left; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #e7ecef; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafcfd; }
.dashboard-table { max-height: 450px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.comment-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 3px; background: #e8f1f6; color: #195a79; font-size: 12px; white-space: nowrap; }
.badge.completed { background: #e5f4ec; color: #176640; }
.badge.cancelled { background: #fdecea; color: var(--red); }
.badge.created, .badge.signed_pending_review, .badge.review_pending_acceptance, .badge.unpaid { background: #fff3d6; color: #8a5707; }
.badge.review-pending_content, .badge.review-pending_publish, .badge.review-pending_acceptance { background: #fff3d6; color: #8a5707; }
.badge.review-pending_receipt { background: #e8f1f6; color: #195a79; }
.badge.paid { background: #e5f4ec; color: #176640; }
.image-required { display: inline-block; padding: 2px 5px; background: #fff3d6; color: #8a5707; border-radius: 3px; font-size: 11px; }
.negative { color: var(--red); font-weight: 700; }
.positive { color: var(--green); font-weight: 700; }
.ledger-decrease td { background: #fffafa; }
.ledger-decrease:hover td { background: #fff4f3; }
.ledger-table { max-height: 520px; }
.inactive-row td { color: #85919c; background: #f6f7f8; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button:disabled { opacity: .45; cursor: not-allowed; }
.table-action { min-height: 30px; padding: 0 9px; font-size: 12px; white-space: nowrap; }
.orders-table th:first-child, .orders-table td:first-child { min-width: 128px; }
.orders-table th:last-child, .orders-table td:last-child { min-width: 88px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); border: 1px dashed #cbd5dd; background: #fafcfd; }
.review-summary { width: fit-content; min-width: 240px; margin-bottom: 14px; padding: 14px 18px; display: flex; align-items: baseline; gap: 8px; background: #fff; border-left: 4px solid var(--amber); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-summary span, .review-summary small { color: var(--muted); }
.review-summary strong { font-size: 28px; color: var(--amber); }
.approval-pending { background: #fff3d8; color: #8a5900; }
.approval-approved { background: #e3f4ec; color: #176d4b; }

.commission-section { max-width: 1080px; }
.commission-section .form-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.quick-forms { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px; }
.quick-forms form { border: 1px solid var(--line); padding: 14px; display: grid; gap: 9px; border-radius: 5px; }
.quick-forms strong { font-size: 13px; }

dialog { width: min(820px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 0; padding: 0; border-radius: 6px; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.wide-dialog { width: min(1060px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(14, 29, 41, .55); }
.dialog-form { padding: 20px; display: grid; gap: 18px; }
.dialog-form.compact { width: min(460px, 100%); }
.dialog-form header, .dialog-form footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-form footer { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 15px; }
#reviewDialog .dialog-form footer { position: sticky; bottom: -20px; z-index: 4; margin: 0 -20px -20px; padding: 15px 20px 20px; background: #fff; box-shadow: 0 -8px 18px rgba(21, 50, 75, .08); }
#batchCommentDialog .dialog-form footer { position: sticky; bottom: -20px; z-index: 4; margin: 0 -20px -20px; padding: 15px 20px 20px; background: #fff; box-shadow: 0 -8px 18px rgba(21, 50, 75, .08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.field-hint { color: var(--muted); font-size: 11px; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 9px; }
.image-item { width: 100%; height: 100%; border: 1px solid var(--line); background: #f7f9fa; padding: 6px; border-radius: 4px; min-width: 0; text-align: left; cursor: zoom-in; }
.image-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; background: #e7ecef; }
.image-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-dialog { width: min(1200px, calc(100vw - 28px)); height: min(90vh, 900px); max-width: none; max-height: none; background: #101820; color: #fff; overflow: hidden; }
.image-preview-dialog::backdrop { background: rgba(3, 10, 16, .88); }
.image-preview-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.image-preview-shell header { min-height: 58px; padding: 10px 14px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(255,255,255,.16); }
.image-preview-shell header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-close { width: 42px; height: 42px; min-height: 42px; padding: 0; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; font-size: 28px; line-height: 1; }
.image-preview-close:hover { border-color: #fff; background: rgba(255,255,255,.16); color: #fff; }
.image-preview-canvas { min-height: 0; overflow: auto; display: grid; place-items: center; padding: 18px; }
.image-preview-canvas img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.bill-detail-dialog { width: min(980px, calc(100vw - 28px)); max-height: min(88vh, 860px); overflow: hidden; }
.bill-detail-shell { max-height: min(88vh, 860px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #fff; }
.bill-detail-shell > header, .bill-detail-shell > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.bill-detail-shell > header { border-bottom: 1px solid var(--line); }
.bill-detail-shell > footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.bill-detail-shell h3 { margin-top: 4px; }
.bill-detail-content { min-height: 0; overflow: auto; padding: 16px 18px 20px; }
.bill-detail-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: #f8fafb; }
.bill-detail-meta div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.bill-detail-meta div:last-child { border-right: 0; }
.bill-detail-meta span, .bill-detail-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-detail-meta span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.bill-detail-meta strong { font-size: 13px; }
.bill-detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.bill-detail-kpis .kpi { min-height: 82px; }
.bill-detail-section + .bill-detail-section { margin-top: 16px; }
.kpi-detail { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
.fx-conversion { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; border: 1px solid #bfd5ef; border-left: 4px solid var(--blue); background: #f5f9ff; }
.fx-conversion div { min-width: 0; padding: 11px 14px; border-right: 1px solid #d8e5f3; }
.fx-conversion div:last-child { border-right: 0; }
.fx-conversion span, .fx-conversion strong { display: block; }
.fx-conversion span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.fx-conversion strong { color: #17365f; font-size: 13px; font-variant-numeric: tabular-nums; }
.ledger-fx-detail { min-width: 150px; }
.ledger-fx-detail strong, .ledger-fx-detail span { display: block; white-space: nowrap; }
.ledger-fx-detail strong { color: #17365f; font-size: 12px; }
.ledger-fx-detail span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.orders-dialog { width: min(1320px, calc(100vw - 28px)); height: min(88vh, 900px); max-width: none; max-height: none; overflow: hidden; }
.orders-dialog-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #fff; }
.orders-dialog-shell > header, .orders-dialog-shell > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; }
.orders-dialog-shell > header { border-bottom: 1px solid var(--line); }
.orders-dialog-shell > footer { border-top: 1px solid var(--line); }
.orders-dialog-content { min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 14px 18px 18px; }
.dialog-orders-toolbar { grid-template-columns: minmax(260px, 1fr) 170px 170px auto auto; margin: 0; border-top-color: var(--blue); }
#dialogOrdersTable { min-height: 0; overflow: hidden; }
#dialogOrdersTable .table-wrap { height: 100%; max-height: none; }
.bill-detail-section h4 { margin: 0 0 9px; color: var(--navy); font-size: 14px; }
.bill-detail-section .table-wrap { max-height: 260px; }
.comment-section { border-top: 1px solid var(--line); padding-top: 16px; }
.bulk-note { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-left: 4px solid var(--green); background: #eef8f3; color: #385349; }
.bulk-note strong { white-space: nowrap; color: #176640; }
.bulk-note span { font-size: 12px; }
.batch-comment-context { display: grid; grid-template-columns: 1.4fr 1fr .7fr; border: 1px solid var(--line); background: #f8fafb; }
.batch-comment-context div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); }
.batch-comment-context div:last-child { border-right: 0; }
.batch-comment-context span, .batch-comment-context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-comment-context span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.batch-comment-context strong { font-size: 13px; }
.batch-preview { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 11px 13px; border: 1px solid var(--line); background: #f4f7f9; color: var(--muted); font-size: 12px; }
.batch-preview strong { margin: 0 3px; color: var(--navy); font-size: 15px; }
.comment-editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.comment-editor { border: 1px solid var(--line); background: #f8fafb; padding: 12px; display: grid; gap: 9px; border-radius: 5px; }
.comment-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.check-label { display: flex; grid-auto-flow: column; align-items: center; gap: 6px; white-space: nowrap; }
.check-label input { width: 16px; height: 16px; margin: 0; }
.review-comment-editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-comment-card { min-width: 0; border: 1px solid var(--line); background: #f8fafb; padding: 12px; display: grid; gap: 10px; border-radius: 5px; }
.review-comment-card textarea { min-height: 92px; }
.review-image-gallery { min-height: 42px; }
.order-context { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.order-context div { padding: 10px; border-right: 1px solid var(--line); min-width: 0; }
.order-context div:last-child { border-right: 0; }
.order-context span, .order-context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-context span { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.order-context strong { font-size: 12px; }
.inline-form { display: grid; grid-template-columns: 180px 200px minmax(240px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.rates-table { max-height: 330px; }
.rate-banner { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; align-items: center; gap: 14px; padding: 15px 18px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); }
.rate-banner div { min-width: 0; }
.rate-banner span, .rate-banner strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate-banner span { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.rate-banner strong { font-size: 14px; }
.rate-banner a, .sync-status a { color: var(--blue); font-size: 12px; }
.sync-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -4px 0 14px; padding: 10px 12px; background: #f4f7f9; border: 1px solid var(--line); font-size: 12px; }
.commission-input { min-width: 130px; text-align: right; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.toast { position: fixed; z-index: 100; right: 22px; top: 20px; max-width: 390px; padding: 12px 16px; border-radius: 5px; background: #1d3344; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); transform: translateY(-90px); opacity: 0; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #8f1d16; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .status-strip { grid-template-columns: repeat(3, 1fr); }
  .status-cell:nth-child(3n) { border-right: 0; }
  .quick-forms { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .comment-editors { grid-template-columns: 1fr; }
  .review-comment-editors { grid-template-columns: 1fr; }
  .rate-banner { grid-template-columns: 1fr 1fr; }
  .order-context { grid-template-columns: 1fr 1fr; }
  .bill-detail-meta, .bill-detail-kpis { grid-template-columns: 1fr 1fr; }
  .settlement-toolbar { grid-template-columns: 1fr 1fr auto auto; }
  .order-context div:nth-child(2n) { border-right: 0; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-width: 0; max-width: 100vw; padding: 12px; overflow: hidden; }
  .sidebar-brand { padding-bottom: 12px; }
  nav { display: flex; width: 100%; min-width: 0; overflow-x: auto; margin-top: 12px; }
  .nav-item { white-space: nowrap; }
  .sidebar-footer { display: flex; align-items: center; gap: 10px; padding-top: 10px; flex-wrap: wrap; }
  .main-area, .section-band, .table-wrap { min-width: 0; max-width: 100%; }
  .topbar { padding: 14px 16px; }
  .top-actions .muted { display: none; }
  .page { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-cell:nth-child(2n) { border-right: 0; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input { grid-column: 1 / -1; }
  .settlement-toolbar { grid-template-columns: 1fr 1fr; }
  .settlement-toolbar button { width: 100%; }
  .settlement-kpis { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .compact-kpis { grid-template-columns: 1fr; }
  .heading-actions { width: 100%; }
  .heading-actions button { flex: 1; }
  .inline-form { grid-template-columns: 1fr; }
  .rate-banner { grid-template-columns: 1fr; }
  .order-context { grid-template-columns: 1fr; }
  .order-context div { border-right: 0; border-bottom: 1px solid var(--line); }
  .order-context div:last-child { border-bottom: 0; }
  .bulk-note { align-items: flex-start; flex-direction: column; }
  .batch-comment-context { grid-template-columns: 1fr; }
  .batch-comment-context div { border-right: 0; border-bottom: 1px solid var(--line); }
  .batch-comment-context div:last-child { border-bottom: 0; }
  .bill-detail-dialog, .bill-detail-shell { max-height: calc(100vh - 20px); }
  .orders-dialog { width: calc(100vw - 20px); height: calc(100vh - 20px); }
  .orders-dialog-content { padding: 12px; }
  .dialog-orders-toolbar { grid-template-columns: 1fr 1fr; }
  .dialog-orders-toolbar input { grid-column: 1 / -1; }
  .bill-detail-meta, .bill-detail-kpis { grid-template-columns: 1fr; }
  .settlement-confirm-summary { grid-template-columns: 1fr; }
  .fx-conversion { grid-template-columns: 1fr; }
  .fx-conversion div { border-right: 0; border-bottom: 1px solid #d8e5f3; }
  .fx-conversion div:last-child { border-bottom: 0; }
  .bill-detail-meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .bill-detail-meta div:last-child { border-bottom: 0; }
}
