:root {
  color-scheme: light;
  font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: #1d2635;
  background: #f5f6f9;
  font-size: 14px;
  --canvas: #f5f6f9;
  --rail: #fff;
  --surface: #fff;
  --text: #1d2635;
  --muted: #69758a;
  --border: #e7ebf2;
  --primary: #165dff;
  --primary-hover: #0e48cd;
  --green: #21674a;
  --green-bg: #e8f3ec;
  --blue: #365d89;
  --blue-bg: #eaf0f8;
  --amber: #805714;
  --amber-bg: #f8eedb;
  --purple: #645387;
  --purple-bg: #f0edf7;
  --red: #883b3c;
  --red-bg: #f9e9e8;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #3479ff; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
i[data-icon], .icon { display: inline-flex; width: 17px; height: 17px; flex: 0 0 auto; align-items: center; justify-content: center; }
.icon svg, i[data-icon] svg { width: 100%; height: 100%; }

.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--border); }
.brand { display: flex; gap: 11px; align-items: center; min-height: 68px; padding: 14px 20px; }
.brand-image { display: block; flex: 0 0 auto; width: 60px; height: 36px; object-fit: contain; }
.brand-mark { display: inline-flex; flex: 0 0 auto; gap: 2px; align-items: flex-end; justify-content: center; width: 34px; height: 34px; padding: 8px 7px; border-radius: 9px; background: #246746; color: #fff; box-shadow: inset 0 1px 1px #ffffff35; }
.brand-mark b { display: block; width: 4px; height: 8px; border-radius: 1px; background: currentColor; transform: skewY(-18deg); }
.brand-mark b:nth-child(2) { height: 12px; }
.brand-mark b:nth-child(3) { height: 17px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; font-weight: 750; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 4px; letter-spacing: .045em; }
.nav { display: grid; gap: 4px; padding: 21px 12px 0; }
.nav-label { color: #7b8698; padding: 0 12px 9px; font-size: 11px; letter-spacing: .07em; }
.nav button, .settings { position: relative; display: flex; align-items: center; gap: 11px; min-height: 43px; color: #465267; border: 0; background: transparent; border-radius: 6px; text-align: left; padding: 0 12px; white-space: nowrap; }
.nav button:hover, .settings:hover, .profile:hover { background: #f1f5fc; }
.nav button[aria-current="page"] { color: #165dff; background: #edf3ff; font-weight: 650; }
.nav button[aria-current="page"]::before { content: ""; position: absolute; inset: 12px auto 12px 0; width: 3px; border-radius: 0 3px 3px 0; background: #165dff; }
.nav-count { margin-left: auto; color: #4e6ca1; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #edf3ff; font-variant-numeric: tabular-nums; }
.nav-count:empty { display: none; }
.mobile-nav-text { display: none; }
.nav .mobile-profile-nav, .nav .mobile-business-nav { display: none; }
.business-back { display: none; }
.rail-footer { display: grid; gap: 10px; margin: auto 9px 0; padding: 12px 0 15px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 12px 12px 0; border-top: 1px solid var(--border); font-size: 11px; }
.connection > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #4a9365; box-shadow: 0 0 0 3px #dce9df; }

.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 28px; border-bottom: 1px solid var(--border); background: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.breadcrumb i { width: 12px; height: 12px; color: #7a857d; }
.breadcrumb strong { color: #39463d; font-weight: 600; }
.profile { display: flex; gap: 8px; align-items: center; border: 0; border-radius: 6px; padding: 5px 7px; color: #36423b; background: transparent; font-size: 12px; }
.profile i { width: 12px; height: 12px; color: #6a756e; }
.profile-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #edf3ff; color: #165dff; font-size: 12px; font-weight: 650; }
.workspace { max-width: 1600px; margin: 0 auto; padding: 27px 28px 32px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 25px; line-height: 1.3; font-weight: 700; letter-spacing: -.035em; }
.page-heading p { color: var(--muted); margin-top: 7px; font-size: 13px; line-height: 1.5; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 5px; border: 1px solid #dce3ee; background: var(--surface); color: #3b4d68; font-size: 13px; font-weight: 550; white-space: nowrap; }
.button:hover { background: #f2f6ff; }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px #0d322323; }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.danger { color: var(--red); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 19px 18px; min-height: 100px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); box-shadow: 0 2px 6px #1e365104; }
.metric:hover, .metric[aria-pressed="true"] { border-color: #a3bfff; background: #f8faff; }
.metric > i { height: 38px; width: 38px; padding: 9px; border-radius: 8px; background: var(--tone-bg); color: var(--tone); }
.tone-green, .tone-entrusted, .tone-complete { --tone: var(--green); --tone-bg: var(--green-bg); }
.tone-blue, .tone-shipped { --tone: var(--blue); --tone-bg: var(--blue-bg); }
.tone-amber, .tone-new { --tone: var(--amber); --tone-bg: var(--amber-bg); }
.tone-purple, .tone-handoff, .tone-referred { --tone: var(--purple); --tone-bg: var(--purple-bg); }
.tone-lost { --tone: #5e6962; --tone-bg: #eef1ee; }
.metric-label { display: block; color: #5a655e; font-size: 12px; white-space: nowrap; }
.metric strong { display: block; margin-top: 3px; font-size: 26px; font-weight: 660; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric > .metric-arrow { margin-left: auto; color: #808b83; }
.metric-arrow i { width: 13px; height: 13px; }

.list-panel { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; box-shadow: 0 2px 6px #1e365104; }
.list-heading { min-height: 64px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 11px; padding: 12px 16px; }
.list-caption { display: flex; align-items: center; gap: 8px; }
.list-caption h2 { font-size: 16px; font-weight: 690; white-space: nowrap; }
.record-count { display: inline-grid; place-items: center; min-width: 22px; height: 21px; border-radius: 4px; background: #edf1ee; color: #536459; padding: 0 6px; font-size: 11px; font-variant-numeric: tabular-nums; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.search { display: flex; align-items: center; gap: 6px; min-height: 33px; padding: 0 8px; border: 1px solid #dfe5df; border-radius: 5px; background: #fcfdfc; color: #647168; }
.search:focus-within { border-color: #76a0ff; }
.search input { width: 208px; border: 0; padding: 5px 0; color: var(--text); background: transparent; outline: 0; }
.search input::placeholder { color: #66736b; }
.search input, .select-wrap select { font-size: 12px; }
.search i, .select-wrap i { width: 14px; height: 14px; }
.select-wrap { display: inline-grid; align-items: center; }
.select-wrap select { grid-column: 1; grid-row: 1; height: 33px; padding: 0 26px 0 9px; appearance: none; border: 1px solid #dfe5df; border-radius: 5px; background: #fcfdfc; color: #46524a; }
.select-wrap i { grid-column: 1; grid-row: 1; justify-self: end; margin-right: 7px; pointer-events: none; color: #647168; }
.icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: #536358; }
.icon-button:hover:enabled { background: #edf2ee; }
.icon-button i { width: 15px; height: 15px; }
.refresh { width: 33px; height: 33px; }
.sort-button { min-height: 33px; gap: 5px; padding: 0 8px; font-size: 12px; }
.asset-icon { width: 17px; height: 17px; flex: 0 0 auto; object-fit: contain; }
.sort-button.sort-active { border-color: #b2cdbb; background: var(--green-bg); color: var(--green); }
.sort-options { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; }
.sort-options label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.sort-options label:has(input:checked) { background: var(--green-bg); border-color: #b2cdbb; }
.sort-options input { margin: 0; accent-color: var(--primary); }
.sort-options strong, .sort-options small { display: block; }
.sort-options small { margin-top: 3px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 710px; border-collapse: collapse; text-align: left; table-layout: fixed; }
th { height: 41px; background: #f7f8fb; color: #667287; font-size: 12px; font-weight: 550; border-block: 1px solid #edf0f5; }
th, td { padding: 0 12px; }
th:first-child, td:first-child { padding-left: 16px; width: 20%; }
th:nth-child(2) { width: 13%; }
th:nth-child(3) { width: 26%; }
th:nth-child(4) { width: 19%; }
th:nth-child(5) { width: 15%; }
th:last-child, td:last-child { padding-right: 16px; }
td { height: 55px; border-bottom: 1px solid #edf0f5; font-size: 13px; color: #4b586d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-lead]:hover, tbody tr[data-lead]:focus-within { background: #f7faff; }
.customer { display: flex; align-items: center; gap: 9px; min-width: 0; }
.customer span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 610; }
.customer-avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 29px; height: 29px; border-radius: 6px; color: var(--tone); background: var(--tone-bg); font-size: 12px; font-weight: 650; }
.source { display: inline-flex; gap: 6px; align-items: center; }
.source i { width: 14px; height: 14px; color: var(--tone, var(--muted)); }
.status { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 7px; border-radius: 4px; background: var(--tone-bg); color: var(--tone); font-size: 11px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
.status::before { content: ""; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.updated { font-variant-numeric: tabular-nums; font-size: 12px; }
.table-action { width: 65px; text-align: right; }
.row-view { display: inline-flex; align-items: center; gap: 2px; padding: 4px 0 4px 3px; border: 0; border-radius: 4px; background: transparent; color: var(--primary); font-size: 12px; }
.row-view:hover { text-decoration: underline; }
.row-view i { width: 12px; height: 12px; }
.loading, .empty { padding: 58px 18px; text-align: center; white-space: normal; color: var(--muted); }
.empty i { display: flex; margin: 0 auto 10px; width: 30px; height: 30px; color: #6c8274; }
.empty strong { display: block; color: #3d4a42; font-size: 14px; margin-bottom: 5px; }
.list-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-top: 1px solid #edf0ed; color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination .icon-button { width: 25px; height: 25px; }

dialog { max-width: calc(100vw - 28px); width: 510px; max-height: min(90dvh, 860px); padding: 0; border: 1px solid #d8ded8; border-radius: 8px; background: #fcfdfc; color: var(--text); box-shadow: 0 14px 45px #1a261f38; }
dialog.wide { width: 700px; overflow: hidden; }
dialog::backdrop { background: #18221cc0; opacity: .55; }
.modal { display: flex; flex-direction: column; max-height: min(89dvh, 856px); }
.wide .modal { max-height: min(87dvh, 750px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e5eae5; padding: 17px 20px; }
.modal-head h2 { font-size: 18px; font-weight: 680; }
.modal-head h2:focus { outline: none; }
.modal-head .icon-button { flex: 0 0 auto; border-color: transparent; background: transparent; height: 28px; width: 28px; margin: -2px -5px 0 0; }
.modal-body { overflow: auto; min-height: 0; padding: 17px 20px 20px; }
.modal-footer { display: flex; gap: 7px; align-items: center; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid #e5eae5; padding: 11px 20px; }
.form-fields { display: grid; gap: 13px; }
.waybill-tools { display: grid; gap: 9px; padding: 10px; border: 1px solid #dce8df; border-radius: 6px; background: #f1f6f2; }
.waybill-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.waybill-buttons .button { color: var(--green); }
.waybill-status { color: #405c49; font-size: 12px; line-height: 1.5; }
.waybill-status:empty { display: none; }
a.button { text-decoration: none; }
.field { display: grid; gap: 6px; min-width: 0; color: #3e4b43; font-size: 13px; font-weight: 550; }
.field input, .field select, .field textarea { width: 100%; min-height: 36px; padding: 8px 9px; border: 1px solid #d9e1db; background: #fff; color: var(--text); border-radius: 5px; font-size: 13px; font-weight: 400; }
.field textarea { resize: vertical; min-height: 94px; }
.field small { color: var(--muted); font-size: 12px; font-weight: 400; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.courier-logo { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 4px; object-fit: contain; }
.courier-name { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.courier-name > span { min-width: 0; }
.courier-picker, .courier-picker::picker(select) { appearance: base-select; }
.field .courier-picker { padding-block: 7px; }
.courier-picker selectedcontent { display: flex; align-items: center; gap: 7px; }
.courier-picker::picker-icon { align-self: center; margin-left: auto; color: #52665b; }
.courier-picker::picker(select) { max-height: min(350px, 50dvh); margin-block: 3px; padding: 4px; border: 1px solid #d9e1db; border-radius: 6px; background: #fff; color: var(--text); box-shadow: 0 6px 20px #1a261f26; }
.courier-picker option { gap: 8px; min-height: 32px; padding: 5px 8px; border-radius: 4px; }
.courier-picker option:hover, .courier-picker option:focus-visible { background: #edf4ef; }
.courier-picker option:checked { font-weight: 650; color: var(--green); }
.courier-picker option::checkmark { order: 1; margin-inline-start: auto; }
.form-error { color: var(--red); background: var(--red-bg); border-radius: 5px; padding: 8px 10px; font-size: 12px; }
.modal-note { color: #47594d; font-size: 13px; line-height: 1.7; }
.modal-identity { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.modal-heading { min-width: 0; }
.modal-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; overflow-wrap: anywhere; }
.wide .modal-head { padding: 20px 22px 15px; border-bottom: 0; }
.wide .modal-head h2 { font-size: 21px; line-height: 1.25; }
.detail-avatar { width: 44px; height: 44px; border-radius: 9px; font-size: 18px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.detail-meta .source i { width: 13px; height: 13px; }
.detail-tabs { display: flex; gap: 20px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.detail-tabs button { min-height: 38px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.detail-tabs button:focus-visible { outline-offset: -2px; }
.detail-tabs button:hover, .detail-tabs button[aria-selected="true"] { color: var(--primary); }
.detail-tabs button[aria-selected="true"] { border-bottom-color: var(--primary); font-weight: 650; }
.wide .modal-body { background: #f5f7fb; padding: 16px 22px 20px; scrollbar-gutter: stable; }
.wide .modal-footer { padding-inline: 22px; }
.wide [role="tabpanel"] { min-height: min(192px, 35dvh); }
.detail-overview { display: grid; gap: 12px; }
.detail-card { min-width: 0; padding: 15px 16px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.detail-card h3 { margin: 0 0 11px; color: #2a4778; font-size: 15px; font-weight: 700; }
.detail-fields { display: grid; gap: 9px; margin: 0; }
.detail-fields div { min-width: 0; }
.detail-fields dt, .detail-text h4, .detail-assignee > span { color: #64716c; font-size: 12px; font-weight: 500; }
.detail-fields dd, .detail-copy { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #14251e; font-size: 14px; line-height: 1.6; }
.detail-fields dd { font-weight: 650; font-variant-numeric: tabular-nums; }
.detail-fields .detail-missing { color: #64716c; font-size: 13px; font-weight: 400; }
.detail-contact .detail-fields, .detail-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-related .detail-card:only-child { grid-column: 1 / -1; }
.detail-contact dt { margin-bottom: 3px; }
.detail-text { margin-top: 13px; }
.detail-text h4 { margin: 0 0 4px; }
.detail-communication { padding-top: 11px; border-top: 1px solid #edf0ed; }
.detail-related .detail-fields div { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: baseline; gap: 6px; }
.detail-priority { border-color: color-mix(in srgb, var(--tone) 20%, var(--tone-bg)); background: var(--tone-bg); color: var(--tone); }
.detail-priority h3 { display: flex; gap: 7px; align-items: center; margin: 0; color: var(--tone); }
.detail-priority-heading, .detail-deadline { display: flex; flex-wrap: wrap; gap: 7px 16px; justify-content: space-between; align-items: center; }
.detail-assignee { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.detail-assignee strong { color: #2c2240; font-size: 15px; }
.detail-priority .detail-copy { margin-top: 8px; }
.detail-caption { color: var(--muted); font-size: 12px; }
.detail-priority .detail-caption { margin-top: 5px; }
.timeline { list-style: none; margin: 2px 0 0 6px; padding: 0 0 0 17px; display: grid; gap: 10px; border-left: 1px solid #ccdacf; }
.timeline li { position: relative; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.timeline li::before { position: absolute; top: 15px; left: -22px; content: ""; height: 8px; width: 8px; border: 2px solid #f4f6f4; border-radius: 50%; background: #438963; box-sizing: content-box; }
.timeline-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.timeline-heading strong { font-size: 13px; }
.timeline-heading small { font-size: 12px; color: var(--muted); }
.timeline .detail-copy { margin-top: 5px; color: #47564c; }
.detail-secondary { display: flex; flex-wrap: wrap; gap: 7px; margin-right: auto; }
.detail-secondary .detail-operation { min-height: 38px; padding-inline: 10px; border-color: #bfd4c8; background: #f0f6f2; color: #1b6247; }
.detail-secondary .detail-operation:hover { background: #e1efe6; }
.detail-secondary .detail-operation.danger { border-color: #ecc9cb; background: #fdf1f1; color: #963638; }
.detail-secondary .detail-operation.danger:hover { background: #f8e3e4; }
.role-options { display: grid; gap: 8px; margin-top: 11px; }
.role-option { min-height: 44px; text-align: left; justify-content: space-between; }
.role-option[aria-pressed="true"] { color: var(--green); background: #eaf3ec; border-color: #a7c7b0; }
.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { display: grid; gap: 15px; width: min(100%, 360px); padding: 27px; border: 1px solid var(--border); border-radius: 9px; background: #fcfdfc; box-shadow: 0 8px 30px #15281a15; }
.login-brand { padding: 0; }
.login-card h1 { font-size: 23px; margin: 7px 0 1px; }
.toasts { position: fixed; bottom: 19px; right: 19px; display: grid; gap: 7px; z-index: 5; pointer-events: none; }
.toast { max-width: min(390px, calc(100vw - 38px)); padding: 11px 14px; border: 1px solid #d0e5d6; border-radius: 6px; background: #f3faf5; color: #28593d; box-shadow: 0 4px 15px #15281a13; font-size: 13px; }
.toast.error { border-color: #edd1d0; background: #fff4f3; color: var(--red); }
.profile-page { --mobile-ink: #162644; --mobile-line: #e6ebf4; --mobile-blue: #2758ae; }
.profile-banner { padding: 28px 20px 62px; background: linear-gradient(119deg, #153f83, #356dca 75%, #4f82d8); color: #fff; }
.profile-content { position: relative; display: grid; gap: 14px; margin: -44px auto 0; padding: 0 14px 20px; max-width: 590px; }
.profile-card { border: 1px solid var(--mobile-line); background: #fff; border-radius: 16px; box-shadow: 0 3px 10px #213e6610; }
.profile-identity { display: flex; align-items: center; gap: 14px; min-height: 100px; padding: 15px; }
.profile-identity-copy { min-width: 0; }
.profile-identity h2 { color: var(--mobile-ink); font-size: 18px; overflow-wrap: anywhere; }
.profile-identity-copy > span { display: inline-block; margin-top: 6px; padding: 3px 8px; color: var(--mobile-blue); background: #eaf1ff; border-radius: 5px; font-size: 11px; }
.avatar-picker { position: relative; flex: 0 0 auto; width: 60px; height: 60px; padding: 0; border: 1px solid #e0e8f4; border-radius: 50%; background: #fff; }
.avatar-picker .user-photo { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-picker > span { position: absolute; display: grid; place-items: center; width: 23px; height: 23px; right: -3px; bottom: -2px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--mobile-blue); }
.avatar-picker .icon { width: 12px; height: 12px; }
.profile-menu { padding: 3px 13px; }
.profile-menu-row { display: grid; grid-template-columns: 20px 1fr 17px; align-items: center; gap: 11px; width: 100%; min-height: 52px; padding: 0 4px; border: 0; background: #fff; color: var(--mobile-ink); text-align: left; text-decoration: none; }
.profile-menu-row + .profile-menu-row { border-top: 1px solid #eef1f6; }
.profile-menu-row .icon:first-child { color: var(--mobile-blue); }
.profile-menu-row .icon:last-child { color: #6a7890; }
.profile-menu-row:hover { background: #f6f8fc; }
.profile-logout { min-height: 44px; border-color: #ead6d9; border-radius: 10px; }
.system-nav { margin-top: 28px; padding: 0 12px; }
.system-nav .nav-label { display: block; }
.system-nav-link { display: flex; align-items: center; gap: 9px; padding: 12px; border-radius: 6px; color: #4c5971; text-decoration: none; font-size: 12px; }
.system-nav-link:hover { background: #f1f5ff; color: var(--primary); }
.system-nav-link .icon:last-child { width: 12px; height: 12px; margin-left: auto; }
.overview-panels { display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 16px; margin-bottom: 20px; }
.dashboard-panel { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 2px 6px #1e365104; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.panel-title h2 { font-size: 15px; font-weight: 650; }
.panel-title > span { color: var(--muted); font-size: 11px; }
.activity-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.activity-column { min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.activity-column > span { color: #405371; font-size: 12px; }
.activity-column > small { display: block; margin-top: 9px; color: #7c889c; font-size: 10px; }
.activity-track { display: flex; align-items: flex-end; justify-content: center; height: 72px; margin-top: 8px; border-bottom: 1px solid #e5ebf5; background: repeating-linear-gradient(to top, transparent 0 23px, #f5f7fc 23px 24px); }
.activity-bar { width: 52%; max-width: 26px; min-width: 10px; border-radius: 3px 3px 0 0; background: linear-gradient(#62a0ff, #2765ef); }
.source-breakdown { display: grid; gap: 15px; padding-top: 6px; }
.source-summary { display: grid; grid-template-columns: 58px minmax(0, 1fr) 22px; align-items: center; gap: 9px; font-size: 12px; color: #56647c; }
.source-summary strong { text-align: right; font-size: 12px; font-weight: 550; }
.source-track { height: 6px; border-radius: 4px; background: #f0f3fa; overflow: hidden; }
.source-track > div { height: 100%; background: #4080f5; border-radius: inherit; }
.source-summary:nth-child(2) .source-track > div { background: #50b3c5; }
.source-summary:nth-child(3) .source-track > div { background: #7c73cc; }
.source-summary:nth-child(4) .source-track > div { background: #8ba5c1; }
.system-cards { display: grid; gap: 10px; }
.system-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid #e7edf8; border-radius: 6px; background: #f9fbff; color: #304669; text-decoration: none; }
.system-card:hover { border-color: #adc7ff; background: #f2f6ff; }
.system-icon { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 7px; background: #eaf1ff; color: var(--primary); }
.system-card > span:nth-child(2) { min-width: 0; }
.system-card strong, .system-card small { display: block; overflow-wrap: anywhere; }
.system-card strong { font-size: 12px; font-weight: 600; }
.system-card small { margin-top: 4px; font-size: 10px; color: #7b88a0; }
.system-card > .icon:last-child { width: 13px; height: 13px; margin-left: auto; }
.order-types { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; border: 0; padding: 0; margin: 0; }
.order-types legend { margin-bottom: 7px; font-size: 13px; font-weight: 550; color: #3e4b60; }
.order-types label { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 1px solid #dce3ee; border-radius: 6px; background: #fff; color: #506079; font-size: 13px; cursor: pointer; }
.order-types label:has(input:checked) { color: var(--primary); border-color: #a3c0ff; background: #eef4ff; }
.order-types input { margin: 0; accent-color: var(--primary); }
.order-types strong { margin-left: 4px; }
.order-parts input { min-width: 0; }
.order-preview { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; border: 1px solid #dce8ff; border-radius: 6px; padding: 12px; background: #f3f7ff; }
.order-preview > span { color: #697a97; font-size: 12px; }
.order-preview output { color: #6a7b96; font-size: 13px; }
.order-preview output.is-filled { color: #184caa; font-size: 18px; letter-spacing: .035em; font-weight: 650; font-variant-numeric: tabular-nums; }
.order-paste summary { color: var(--primary); font-size: 12px; cursor: pointer; }
.order-paste .field { margin-top: 9px; }
.business-banner { padding: 25px 18px 27px; color: #fff; background: linear-gradient(115deg, #163d79, #386cbb); }
.business-banner p { margin-top: 6px; color: #e6efff; font-size: 12px; }
.business-section { margin: 16px 13px; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.business-section h2 { margin: 0; padding: 16px 16px 11px; font-size: 15px; }
.business-grid { display: grid; grid-template-columns: 1fr 1fr; }
.business-tile { display: flex; align-items: center; min-height: 86px; gap: 10px; padding: 16px 13px; border: 0; border-top: 1px solid #edf1f7; background: #fff; color: #293c5a; font-size: 13px; text-decoration: none; text-align: left; }
.business-tile:nth-child(odd) { border-right: 1px solid #edf1f7; }
.business-tile:hover { background: #f6f9ff; }
.business-tile-icon { display: grid; place-items: center; flex: 0 0 auto; width: 37px; height: 37px; padding: 7px; border-radius: 9px; color: var(--primary); background: #edf4ff; }
.business-tile:nth-child(2) .business-tile-icon { background: #ecf7f8; color: #2a7e9b; }
.business-tile:nth-child(3) .business-tile-icon { background: #f3f0fa; }
.business-tile-icon img { width: 100%; height: 100%; object-fit: contain; }
.business-tile-icon .icon { width: 22px; height: 22px; }
.users-table table { min-width: 790px; }
.users-table th:first-child { width: 17%; }
.users-table th:nth-child(2) { width: 19%; }
.users-table th:nth-child(3) { width: 17%; }
.users-table th:nth-child(4) { width: 13%; }
.users-table th:nth-child(5) { width: 11%; }
.users-table th:last-child { width: 164px; }
.user-actions .button { min-height: 29px; padding-inline: 8px; font-size: 12px; }
.user-actions .button + .button { margin-left: 6px; }
.permission-badge { display: inline-block; padding: 3px 7px; border-radius: 4px; color: #2859a7; background: #eaf2ff; font-size: 11px; }
.users-error { margin: 12px 16px; }
.user-options { display: grid; gap: 11px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: #f7faff; }
.user-options label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-options input { width: 16px; height: 16px; accent-color: var(--primary); }
.user-options small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 178px minmax(0, 1fr); }
  .workspace, .topbar { padding-inline: 20px; }
  .search input { width: 175px; }
  .metric { gap: 8px; padding-inline: 10px; }
  .metric > .metric-arrow { display: none; }
  .overview-panels { grid-template-columns: 1fr 1fr; }
  .overview-panels .dashboard-panel:last-child { grid-column: 1 / -1; }
  .system-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 64px minmax(0, 1fr); }
  .brand { justify-content: center; padding: 17px 10px; }
  .rail .brand-image { width: 42px; }
  .rail .brand span:last-child, .nav-label, .nav-count, .connection span:last-child { display: none; }
  .nav button, .settings { justify-content: center; padding: 0; font-size: 0; gap: 0; }
  .nav i, .settings i { width: 19px; height: 19px; }
  .connection { justify-content: center; }
  .system-nav { padding-inline: 7px; }
  .system-nav-link { justify-content: center; }
  .system-nav-link > span, .system-nav-link .icon:last-child { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 68px; }
}
@media (max-width: 590px) {
  .shell { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); background: #f1f5fb; }
  .rail { position: fixed; inset: auto 0 0; height: auto; display: block; z-index: 2; padding-bottom: env(safe-area-inset-bottom); border: 0; border-top: 1px solid #e0e7f1; background: #fff; box-shadow: 0 -4px 16px #132b4b0b; }
  .rail > .brand, .rail-footer, .nav-text, .system-nav { display: none; }
  .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 7px 16px; }
  .nav button, .nav .mobile-profile-nav, .nav .mobile-business-nav { display: flex; min-height: 51px; flex-direction: column; gap: 3px; font-size: 11px; text-align: center; color: #51627b; }
  .nav [data-view="samples"], .nav [data-view="feedback"], .nav [data-view="archive"], .nav [data-view="users"] { display: none; }
  .nav button[aria-current="page"] { color: #1b4f9d; background: #eaf2ff; }
  .nav button::before, .nav button[aria-current="page"]::before { content: ''; display: block; position: static; width: 24px; height: 24px; border-radius: 0; background: transparent var(--nav-icon) center / contain no-repeat; }
  .nav button[aria-current="page"]::before { background-image: var(--nav-active-icon); }
  .nav [data-view="overview"] { --nav-icon: url('/icons/mobile-dashboard.png'); --nav-active-icon: url('/icons/mobile-dashboard-active.png'); }
  .nav [data-view="samples"] { --nav-icon: url('/icons/mobile-inbox.png'); --nav-active-icon: url('/icons/mobile-inbox-active.png'); }
  .nav [data-view="feedback"] { --nav-icon: url('/icons/mobile-messages.png'); --nav-active-icon: url('/icons/mobile-messages-active.png'); }
  .nav [data-view="archive"] { --nav-icon: url('/icons/pc-archive.png'); --nav-active-icon: url('/icons/mobile-done.png'); }
  .nav [data-view="profile"] { --nav-icon: url('/icons/mobile-profile.png'); --nav-active-icon: url('/icons/mobile-profile-active.png'); }
  .nav [data-view="business"] { --nav-icon: url('/icons/mobile-inbox.png'); --nav-active-icon: url('/icons/mobile-inbox-active.png'); }
  .nav button .mobile-nav-text { display: block; }
  .nav i, .topbar { display: none; }
  .workspace { padding: 0 13px 16px; }
  h1 { font-size: 23px; }
  .page-heading { align-items: center; margin: 0 -13px 14px; padding: 24px 14px 21px; background: linear-gradient(119deg, #153f83, #356dca 75%, #4f82d8); color: #fff; }
  .page-heading p { margin-top: 4px; color: #f0f5ff; font-size: 12px; }
  .page-heading .button.primary { background: #fff; border-color: #fff; border-radius: 9px; color: #1b4f9d; box-shadow: 0 2px 6px #0d26552b; }
  .business-back { display: flex; align-items: center; gap: 3px; padding: 0 0 11px; border: 0; color: #3568ad; background: transparent; font-size: 12px; }
  .metrics { margin-bottom: 14px; }
  .overview-panels { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .overview-panels .dashboard-panel:first-child, .overview-panels .dashboard-panel:nth-child(2) { display: none; }
  .overview-panels .dashboard-panel:last-child { padding: 12px; border-radius: 12px; }
  .overview-panels .panel-title { margin-bottom: 10px; }
  .system-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .system-card { padding: 8px; }
  .system-icon { width: 25px; height: 25px; border-radius: 5px; }
  .system-card > .icon:last-child, .system-card small { display: none; }
  .system-card strong { font-size: 11px; }
  .metric, .list-panel { border-color: #e4ebf4; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #213e660c; }
  .list-heading { padding: 11px; }
  .filters { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) max-content 33px; width: 100%; gap: 5px; }
  .search { grid-column: 1 / -1; }
  .search input { min-width: 0; flex: 1; }
  .filters .select-wrap { min-width: 0; }
  .filters .select-wrap select { width: 100%; text-overflow: ellipsis; }
  .metrics { gap: 7px; }
  .metric-label { font-size: 11px; }
  .metric > i { width: 33px; height: 33px; padding: 7px; }
  .table-scroll { overflow: visible; }
  .table-scroll table, .table-scroll tbody { display: block; min-width: 0; }
  .table-scroll thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .table-scroll tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; margin: 0 0 2px; padding: 13px 12px; border-top: 1px solid #eaf0f7; }
  .table-scroll td { display: block; width: auto; height: auto; padding: 0; border: 0; }
  .table-scroll td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12px; }
  .table-scroll td:nth-child(3) { grid-column: 1; grid-row: 3; align-self: center; }
  .table-scroll td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
  .table-scroll .updated { grid-column: 2; grid-row: 2; align-self: center; white-space: normal; }
  .table-scroll .updated::before { content: attr(data-label) ' '; color: var(--muted); }
  .table-scroll td.table-action { grid-column: 2; grid-row: 3; }
  .table-scroll td.empty, .table-scroll td.loading { grid-column: 1 / -1; padding: 25px 8px; }
  .wide .modal-head, .wide .modal-body, .wide .modal-footer, .detail-tabs { padding-inline: 13px; }
  .detail-card { padding: 12px; }
  .detail-related { grid-template-columns: 1fr; }
  .detail-secondary { flex: 1 0 100%; }
  .detail-secondary .detail-operation { min-height: 38px; gap: 4px; padding-inline: 7px; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .users-table table { min-width: 0; }
  .users-table tr { grid-template-columns: minmax(0, 1fr) auto; }
  .users-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .users-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); }
  .users-table td:nth-child(3) { grid-column: 1; grid-row: 3; }
  .users-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
  .users-table td:nth-child(5) { grid-column: 2; grid-row: 1; justify-self: end; }
  .users-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; padding-top: 8px; border-top: 1px solid #edf1f7; }
  .user-actions .button { min-height: 35px; }
}
