:root {
  color-scheme: light;
  --primary: #087f78;
  --primary-dark: #06665f;
  --primary-bg: #e8f5f1;
  --bg: #f3f5f6;
  --card: #fff;
  --border: #e2e7e9;
  --text: #1c2b35;
  --text-2: #596b78;
  --text-3: #687a86;
  --green: #087957;
  --green-bg: #e9f6ee;
  --orange: #98600c;
  --orange-bg: #fff4df;
  --red: #b84243;
  --red-bg: #fceff0;
  --gray-bg: #f0f3f5;
  --radius: 12px;
  --sidebar-width: 224px;
  --font: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { background: var(--bg); color: var(--text); font: 14px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid #13a493; }
svg { flex: none; width: 20px; height: 20px; vertical-align: middle; }
a { color: var(--primary); }
::selection { color: #123d35; background: #caeee0; }
.skip-link { position: fixed; top: -80px; left: 240px; z-index: 500; padding: 12px 18px; border-radius: 8px; background: #fff; }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 60; display: flex; flex-direction: column; background: #172c35; color: #cad7dc; }
.brand { display: flex; align-items: center; gap: 11px; padding: 31px 21px 29px; text-decoration: none; color: #fff; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 40px; border: 1px solid #4b7776; border-radius: 10px; color: #79ddc5; background: #24434a; }
.brand-mark svg { width: 25px; height: 25px; }
.brand strong { font-family: "Bahnschrift", "Noto Sans", sans-serif; font-size: 23px; font-weight: 650; letter-spacing: -.8px; line-height: 1.2; }
.brand-dot { color: #68d4b7; }
.brand small { display: block; margin-top: 3px; font-size: 11px; letter-spacing: 1.4px; color: #b7cbd0; }
.nav-caption { padding: 12px 23px 13px; font-size: 11px; letter-spacing: .8px; color: #9fb6c0; }
.nav-caption span { float: right; font-size: 9px; letter-spacing: .5px; opacity: .7; }
.tabs-inner { display: flex; flex-direction: column; gap: 7px; padding: 0 12px; }
.tab-btn { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 49px; padding: 11px 15px; border: 1px solid transparent; border-radius: 8px; color: #c1d1d8; background: transparent; text-align: left; font-size: 14px; font-weight: 500; transition: background .16s, color .16s; }
.tab-btn svg { width: 19px; height: 19px; color: #97b1bb; }
.tab-btn:hover { color: #fff; background: #243f49; }
.tab-btn.active { border-color: #39635f; color: #fff; background: #2a514f; }
.tab-btn.active svg { color: #85dfc3; }
.tab-btn.active::before { content: ""; position: absolute; width: 3px; height: 20px; left: -13px; background: #7ee1c3; border-radius: 0 4px 4px 0; }
.nav-count { display: grid; place-items: center; min-width: 24px; height: 22px; margin-left: auto; padding: 0 5px; border-radius: 5px; background: #36545d; color: #d6e4e8; font: 12px "Bahnschrift", sans-serif; }
.active .nav-count { background: #41706a; color: #e7fff7; }
.nav-pending { min-width: 20px; margin-left: auto; padding: 1px 6px; border-radius: 5px; background: #f5c975; color: #4d360f; text-align: center; font-size: 12px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 25px 22px; border-top: 1px solid #2b424c; font-size: 12px; color: #c4d1d7; }
.sidebar-foot small { display: block; font-size: 10px; color: #92aab4; margin-top: 3px; }
.sidebar-foot-mark { display: grid; place-items: center; width: 27px; height: 27px; background: #2a454b; border-radius: 50%; color: #8ed5c2; }
.sidebar-foot-mark svg { width: 15px; }
header.top { position: sticky; top: 0; z-index: 40; margin-left: var(--sidebar-width); background: #ffffffed; border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.top-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 34px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; white-space: nowrap; color: var(--text-2); font-size: 12px; }
.workspace-dot { width: 7px; height: 7px; border-radius: 2px; background: #719598; }
.crumb-divider { color: #bac6cd; }
.breadcrumb b { color: var(--text); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 22px; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.sync .dot { width: 6px; height: 6px; border-radius: 50%; background: #93a1ab; box-shadow: 0 0 0 4px #f0f3f5; }
.sync.ok .dot { background: #299275; box-shadow: 0 0 0 4px #eaf5ef; }
.sync.off .dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.user-box { display: flex; align-items: center; gap: 9px; padding-left: 20px; border-left: 1px solid var(--border); }
.user-avatar { display: grid; place-items: center; width: 34px; height: 34px; background: #eef0fb; color: #545d95; border: 1px solid #e1e5f3; border-radius: 10px; font-weight: 600; font-size: 14px; }
.user-name { display: flex; flex-direction: column; line-height: 1.45; min-width: 46px; }
.user-name b { font-size: 12px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.role-tag { font-size: 10px; color: var(--text-2); }
.btn-mini { min-height: 36px; padding: 5px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--text-2); font-size: 11px; white-space: nowrap; }
.btn-mini:hover { background: var(--gray-bg); color: var(--primary-dark); }
.logout-btn { color: #9b4b4e; }
main { margin-left: var(--sidebar-width); padding: 31px 34px 52px; }
main:focus { outline: none; }
.wrap { max-width: 1440px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin-bottom: 7px; color: #71818b; letter-spacing: 1.2px; font-size: 10px; }
h1 { font-size: 27px; line-height: 1.45; letter-spacing: -.7px; font-weight: 700; }
.page-heading p { margin-top: 5px; color: var(--text-2); font-size: 13px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; }
.btn-primary, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 500; line-height: 1.5; transition: background .16s, border-color .16s, box-shadow .16s; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 2px 3px #087f7816; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 3px 8px #087f7826; }
.btn-ghost { background: #fff; border-color: #d7e0e4; color: #435865; }
.btn-ghost:hover { background: #f7faf9; border-color: #aabfc2; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #9c3036; }
.btn-primary svg, .btn-ghost svg { width: 16px; height: 16px; }
.quickbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; column-gap: 16px; margin-bottom: 23px; }
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #dce3e6; border-radius: 8px; padding: 0 13px; max-width: 560px; transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: #69a89b; box-shadow: 0 0 0 3px #087f780d; }
.search-box svg { color: #7c8d97; width: 17px; height: 17px; }
.search-box input { min-width: 0; width: 100%; padding: 11px 0; border: 0; outline: none; background: transparent; font-size: 13px; color: var(--text); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box kbd { border: 1px solid #e3e8eb; border-radius: 4px; padding: 0 5px; font: 12px/1.6 monospace; color: #8a99a4; }
.search-clear { border: 0; background: var(--gray-bg); color: var(--text-2); border-radius: 4px; min-width: 26px; min-height: 26px; font-size: 18px; }
.search-hint { min-height: 19px; margin-top: 6px; grid-column: 1/-1; font-size: 11px; color: var(--text-3); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panel-in .2s ease-out; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { position: relative; overflow: hidden; min-width: 0; padding: 20px 20px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.kpi .k-label { padding-right: 30px; color: #586c78; font-size: 12px; font-weight: 500; }
.kpi .k-value { margin: 8px 0 6px; color: #243c48; font: 500 33px/1.2 "Bahnschrift", "Noto Sans", var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.7px; }
.kpi .unit { font-size: 12px; letter-spacing: 0; }
.kpi-note { color: #607480; font-size: 10px; }
.kpi-icon { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 31px; height: 31px; color: #167c73; background: #e8f4f1; border-radius: 9px; }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-active .kpi-icon { color: #338457; background: #eaf5e9; }
.kpi-paused .kpi-icon { color: #a67729; background: #fff4de; }
.kpi-ended .kpi-icon { color: #7375a4; background: #f0eff8; }
.block { padding: 22px; margin-bottom: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.block-title { display: flex; align-items: center; gap: 9px; margin-bottom: 19px; font-size: 15px; line-height: 1.5; font-weight: 600; }
.block-title svg { color: var(--primary); width: 18px; height: 18px; }
#tab-service .block-title svg { color: #b17b2b; }
#tab-stats .block-title svg { color: #7771a6; }
.list-count { margin-left: 2px; padding: 2px 8px; border-radius: 5px; background: #f0f4f5; color: #687e88; font-size: 10px; font-weight: 400; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding-bottom: 19px; margin-bottom: 20px; border-bottom: 1px solid #edf0f2; }
.filter-row select { min-width: 155px; max-width: 240px; min-height: 37px; padding: 7px 26px 7px 10px; color: #4d6470; border: 1px solid #dfe6e8; border-radius: 6px; background: #fff; font-size: 12px; }
.btn-text { border: 0; min-height: 36px; padding: 5px 8px; color: #607783; background: transparent; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--primary); }
.card-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.item-card { position: relative; min-width: 0; padding: 20px; border: 1px solid #dfe6e8; border-radius: 9px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.item-card:hover, .item-card:focus-within { border-color: #a6c8c1; box-shadow: 0 3px 12px #2b665c08; }
.card-top { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; padding-right: 2px; }
.card-name { display: block; flex: 1 1 100%; margin-bottom: 8px; color: #233a46; font-size: 16px; line-height: 1.55; font-weight: 600; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 5px; background: #edf3f8; color: #4e6f8e; font-size: 11px; line-height: 1.6; }
.badge.b-green { color: #267858; background: #eaf6ef; }
.badge.b-orange { color: #946614; background: #fff4de; }
.badge.b-red { color: #93616c; background: #f8eef1; }
.badge.b-gray { color: #647783; background: #eff3f5; }
.badge.g-a { color: #886021; background: #fff2d9; }
.badge.g-b { color: #366e86; background: #eaf3f9; }
.badge.g-c { color: #746791; background: #f2eff7; }
.badge.b-custom { background: #f6f8f6; color: #527462; border: 1px dashed #c5d5c9; padding: 2px 7px; }
.card-actions { display: flex; gap: 6px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid #edf1f2; }
.card-actions button, .btn-xs { min-height: 32px; border: 1px solid #dfe7e9; border-radius: 5px; background: #fff; padding: 4px 12px; font-size: 11px; color: #5b737e; }
.card-actions .edit-btn { color: #267c70; background: #f3f9f6; border-color: #d5e9df; }
.card-actions .purchase-details-btn { margin-left: auto; color: #267c70; }
body.role-readonly .card-actions:has(.purchase-details-btn) { display: flex; }
body.role-readonly .card-actions .edit-btn, body.role-readonly .card-actions .del-btn { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.purchase-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 25px; }
.purchase-summary > div { min-width: 0; padding: 20px 22px; background: #fff; border: 1px solid var(--border); border-radius: 9px; }
.purchase-summary span { display: block; color: #607480; font-size: 12px; margin-bottom: 10px; }
.purchase-summary strong { display: block; font-size: clamp(15px,2vw,25px); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.purchase-summary > div:last-child { border-color: #c5dcd3; background: #f1f8f5; color: #167163; }
.purchase-filters { flex-wrap: wrap; }
.purchase-filters > select, .purchase-filters > input { flex: 1 1 180px; min-width: 0; max-width: 250px; }
.purchase-filters > input { min-height: 42px; border: 1px solid #d7e1e4; border-radius: 6px; background: #fff; font-size: 13px; padding: 10px 12px; }
.purchase-filter-hint { padding: 11px 14px; margin-bottom: 16px; border-radius: 6px; color: #217767; background: #eef7f3; font-size: 13px; }
.purchase-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e1e8e9; border-radius: 8px; }
.purchase-table { width: 100%; min-width: 1270px; border-collapse: collapse; font-size: 13px; text-align: left; }
.purchase-table th { padding: 14px 12px; color: #536c76; background: #f3f7f6; border-bottom: 1px solid #dce6e3; white-space: nowrap; font-size: 12px; font-weight: 600; }
.purchase-table td { padding: 16px 12px; border-bottom: 1px solid #e8eeee; vertical-align: top; max-width: 220px; overflow-wrap: anywhere; white-space: pre-wrap; }
.purchase-table tbody tr:last-child td { border-bottom: 0; }
.purchase-table tbody tr:hover { background: #fafcfb; }
.purchase-product-name { min-width: 130px; font-weight: 600; color: #2c4750; }
.purchase-date, .purchase-number { white-space: nowrap !important; font-variant-numeric: tabular-nums; }
.purchase-row-total { color: #177a68; font-weight: 600; }
.purchase-actions { display: flex; gap: 6px; }
.purchase-actions button { white-space: nowrap; }
.purchase-thumbnail { position: relative; width: 64px; height: 64px; padding: 0; background: #f3f6f6; border: 1px solid #e0e8e6; border-radius: 7px; overflow: hidden; }
.purchase-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.purchase-thumbnail span { position: absolute; bottom: 0; right: 0; padding: 2px 5px; color: #fff; background: #183e43c9; font-size: 10px; }
.purchase-image-previews { display: flex; flex-wrap: wrap; gap: 12px; }
.purchase-image-preview { width: 88px; text-align: center; }
.image-preview-button { display: block; width: 88px; height: 88px; padding: 0; border: 1px solid #dce6e3; border-radius: 7px; overflow: hidden; background: #f3f7f6; }
.image-preview-button img { width: 100%; height: 100%; object-fit: cover; }
.purchase-total-field { padding: 15px 17px; border-radius: 8px; background: #eff7f3; }
.purchase-total-field output { color: #167163; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.image-gallery { width: min(900px,calc(100% - 40px)); }
.image-gallery .modal > img { display: block; width: 100%; max-height: 65dvh; object-fit: contain; background: #f4f7f6; }
.gallery-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 8px; font-size: 13px; }
@media (max-width: 600px) {
  .purchase-summary { gap: 7px; }
  .purchase-summary > div { padding: 13px 9px; }
  .purchase-summary span { font-size: 10px; }
  .purchase-filters > select, .purchase-filters > input { max-width: none; flex-basis: 100%; font-size: 16px; }
  .purchase-block { min-width: 0; }
  .purchase-actions button, .gallery-controls button { min-height: 44px; }
  .card-actions .purchase-details-btn { min-height: 40px; }
}
.card-actions .del-btn:hover, .btn-xs.danger { color: #ae4852; background: #fcf1f2; border-color: #f0dce0; }
.meta, .meta-cats { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.meta { margin: 12px 0; }
.meta-line { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; color: #5f7480; font-size: 13px; overflow-wrap: anywhere; }
.meta-line svg { width: 14px; height: 14px; margin-top: 3px; color: #879ca6; }
.note-line { margin-top: 14px; padding: 10px 12px; background: #f6f8f9; border-radius: 5px; color: #607783; font-size: 11px; overflow-wrap: anywhere; white-space: pre-wrap; }
.empty-state { padding: 46px 20px 42px; text-align: center; }
.empty-icon { display: inline-grid; place-items: center; width: 62px; height: 62px; margin-bottom: 17px; background: #f0f6f4; border: 1px solid #e4eeea; color: #66958a; border-radius: 18px; }
.empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: #3b535f; }
.empty-state p { margin: 7px 0 18px; font-size: 13px; color: #607480; }
.empty-state .btn-ghost { min-height: 37px; padding: 8px 14px; font-size: 12px; }
.empty { padding: 28px 16px; color: #607480; text-align: center; font-size: 13px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-box { min-height: 160px; }
.chart-row { display: grid; grid-template-columns: minmax(60px, 110px) minmax(0,1fr) 28px; align-items: center; gap: 14px; margin: 21px 0; font-size: 12px; }
.chart-label { overflow-wrap: anywhere; color: #617783; }
.chart-track { height: 9px; border-radius: 4px; background: #eef3f3; overflow: hidden; }
.chart-fill { height: 100%; min-width: 4px; border-radius: 4px; background: var(--chart-color,var(--primary)); }
.chart-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #3c5660; }
.stat-tip { color: var(--text-2); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.field-full { grid-column: 1/-1; }
.field label { color: #4a606c; font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 12px; color: #263e49; font-size: 14px; line-height: 1.5; background: #fff; border: 1px solid #d7e1e4; border-radius: 6px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #607480; opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #54a490; box-shadow: 0 0 0 3px #087f7810; }
.field [aria-invalid="true"] { border-color: #bd6166; }
.field-help { color: #607480; font-size: 11px; line-height: 1.7; }
.form-section-title { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--primary); }
.field-heading, .password-control, .client-password-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.password-control input { min-width: 0; flex: 1; }
.password-control button { flex-shrink: 0; min-height: 42px; }
.inline-check { display: flex; align-items: center; gap: 8px; }
.inline-check input { width: 16px; min-height: 16px; }
.address-list { display: grid; gap: 10px; }
.address-row { display: flex; align-items: flex-start; gap: 8px; }
.address-row textarea { flex: 1; min-width: 0; min-height: 74px; }
.address-row button { flex-shrink: 0; min-height: 42px; }
.freight-details { margin-top: 14px; padding: 12px; background: #f6f8f9; border-radius: 6px; font-size: 13px; overflow-wrap: anywhere; }
.freight-detail-line, .client-password-line { margin-top: 7px; white-space: pre-wrap; }
.freight-details a { display: block; margin-top: 7px; }
.freight-addresses { padding-left: 20px; }
.freight-addresses li { margin-top: 6px; white-space: pre-wrap; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 12px; border: 1px solid #dce5e7; border-radius: 6px; color: #566f7c; background: #fff; font-size: 12px; cursor: pointer; }
.chip input { width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: var(--primary); }
.chip.checked { color: #116d5d; border-color: #9bcbbb; background: #edf7f0; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; grid-column: 1/-1; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.draft-note { margin-right: auto; color: #607480; font-size: 11px; }
.msg { display: none; grid-column: 1/-1; font-size: 12px; border-radius: 6px; padding: 11px 13px; }
.msg.ok { display: block; color: #21684c; background: #eef7f1; border: 1px solid #d6e9dc; }
.msg.err { display: block; color: #a2404b; background: #fcf1f3; border: 1px solid #eed7db; }
.offline-banner { display: none; margin-bottom: 18px; padding: 13px 16px; border: 1px solid #edd6a5; border-radius: 7px; background: #fff8e8; color: #8d661c; font-size: 13px; }
.modal-mask { width: min(680px,calc(100% - 40px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: none; border-radius: 14px; color: var(--text); background: transparent; box-shadow: 0 24px 90px #0e2d3733; overflow: auto; overscroll-behavior: contain; }
.modal-mask::backdrop { background: #112a3a78; backdrop-filter: blur(3px); }
.modal-mask .modal { max-width: none !important; padding: 27px 29px; background: #fff; }
.modal-mask:has(#pwdForm), .modal-mask:has(#resetForm), #delMask { width: min(440px,calc(100% - 40px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.modal-head h2, .modal-head h3 { font-size: 21px; line-height: 1.4; font-weight: 600; }
.dialog-eyebrow { display: block; margin-bottom: 4px; color: #6d8b89; font-size: 10px; letter-spacing: 1px; }
.dialog-intro { margin: -9px 0 23px; color: #607480; font-size: 12px; }
.modal-close { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #e4e9eb; border-radius: 7px; background: #f7f9f9; color: #607782; font-size: 23px; line-height: 1; }
.modal-close:hover { color: var(--red); background: var(--red-bg); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.modal-actions + .msg { margin-top: 14px; }
.delete-symbol { display: grid; place-items: center; margin: -5px 0 20px; width: 45px; height: 45px; border-radius: 12px; color: #b75056; background: #fceff0; }
.del-tip { color: #526b77; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
body:has(dialog[open]) { overflow: hidden; }
body.locked .sidebar, body.locked header.top, body.locked main, body.locked .skip-link { display: none; }
.session-loading { position: fixed; inset: 0; display: grid; place-content: center; color: var(--text-2); }
body.role-readonly #newRecordBtn, body.role-readonly .card-actions { display: none; }
.acc-row { display: flex; align-items: center; gap: 18px; padding: 19px 0; border-bottom: 1px solid #edf0f2; }
.acc-row:last-child { border-bottom: 0; }
.acc-main { min-width: 0; flex: 1; }
.acc-name { font-size: 14px; font-weight: 600; color: #314c59; }
.acc-sub { margin-top: 4px; color: #647b87; font-size: 11px; overflow-wrap: anywhere; }
.acc-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: 420px; }
.acc-actions select { min-height: 33px; padding: 5px 8px; color: #456270; background: #fff; border: 1px solid #dce5e8; border-radius: 5px; font-size: 11px; }
.btn-xs { padding: 6px 10px; white-space: nowrap; }
.btn-xs.primary { color: #247762; background: #eef8f1; border-color: #d1e7db; }
.toast { position: fixed; bottom: 28px; left: calc(50% + var(--sidebar-width)/2); transform: translateX(-50%); z-index: 400; max-width: min(520px,calc(100% - 32px)); padding: 13px 20px; border: 1px solid #3f655e; border-radius: 9px; color: #fff; background: #24453f; box-shadow: 0 8px 24px #173c3826; font-size: 13px; }
.toast.error { background: #853f46; border-color: #ac6670; }
.auth-mask { position: fixed; inset: 0; z-index: 300; display: flex; align-items: stretch; background: #fff; overflow: auto; }
.auth-aside { display: flex; flex-direction: column; width: 48%; padding: 45px 8%; color: #e3efec; background: #193d40; }
.auth-brand { display: flex; align-items: center; gap: 13px; color: #fff; font: 600 27px "Bahnschrift", "Noto Sans", sans-serif; letter-spacing: -.5px; }
.auth-brand svg { color: #86d9be; width: 31px; height: 31px; }
.auth-story { margin: auto 0; padding: 50px 0; }
.auth-eyebrow { color: #9dbdb7; font: 10px "Noto Sans", sans-serif; letter-spacing: 2.8px; }
.auth-story h2 { margin: 25px 0 24px; font-size: clamp(30px,3vw,43px); line-height: 1.55; font-weight: 500; letter-spacing: .5px; }
.auth-story p { color: #bdd1cd; font-size: 14px; line-height: 2; }
.supply-illustration { display: flex; align-items: center; margin: 48px 0 32px; }
.illustration-node { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #d7e7e0; }
.illustration-node svg { box-sizing: content-box; width: 29px; height: 29px; padding: 14px; border: 1px solid #577a70; border-radius: 12px; background: #2c5050; }
.illustration-node b { font-size: 11px; font-weight: 400; color: #b2cbc3; white-space: nowrap; }
.illustration-line { flex: 1; min-width: 20px; height: 1px; border-bottom: 1px dashed #64867b; margin: 0 10px 28px; }
.illustration-hub { display: grid; place-items: center; padding: 20px; margin-top: -28px; border: 1px solid #84bca5; border-radius: 20px; color: #153b37; background: #b9dbc3; box-shadow: 0 0 0 8px #9fcebc0b; }
.auth-features { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #b9d0c7; }
.auth-features span::before { content: "✓"; margin-right: 7px; color: #8ed4b2; }
.auth-foot { color: #9ab9b1; font-size: 10px; letter-spacing: 1px; }
.auth-card { width: 52%; max-width: 650px; margin: auto; padding: 42px 80px; }
.auth-head { margin-bottom: 32px; }
.auth-head > .logo { display: none; }
.auth-head h1 { font-size: 27px; margin-bottom: 8px; }
.auth-head p { color: #607480; font-size: 13px; }
.auth-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.auth-tab { min-height: 42px; padding: 0 3px 12px; border: 0; border-bottom: 2px solid transparent; color: #71848f; background: transparent; font-size: 13px; }
.auth-tab.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-panel .field { margin-bottom: 19px; }
.auth-panel .field input { min-height: 46px; }
.auth-panel .form-actions { margin-top: 26px; padding: 0; border: 0; }
.auth-panel .btn-primary { width: 100%; min-height: 46px; }
.auth-panel .msg { margin-top: 14px; }
.auth-tip { margin-top: 19px; color: #6a7e89; font-size: 11px; line-height: 1.9; }
.auth-panel[aria-busy="true"] { cursor: progress; }
@keyframes panel-in { from { opacity: .3; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1760px) { .card-list { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 1199px) {
  :root { --sidebar-width: 200px; }
  .brand { padding-left: 17px; gap: 9px; }
  .brand strong { font-size: 21px; }
  .brand small { font-size: 10px; letter-spacing: 1px; }
  .top-inner { padding: 13px 25px; }
  main { padding: 27px 25px 44px; }
  .top-actions { gap: 15px; }
  .kpi { padding: 18px 15px 15px; }
  .kpi-icon { right: 12px; width: 27px; height: 27px; }
  .kpi .k-label { font-size: 11px; }
  .card-list { grid-template-columns: 1fr; }
  .acc-row { flex-wrap: wrap; gap: 11px; }
  .acc-main { min-width: 140px; }
  .acc-actions { flex-basis: 100%; justify-content: flex-start; }
  .auth-aside { padding-left: 7%; padding-right: 7%; }
  .auth-card { padding: 36px 50px; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  .sidebar { position: sticky; top: 0; width: auto; height: auto; z-index: 50; border: 0; background: #19353c; }
  .brand { padding: 13px 20px; gap: 9px; }
  .brand-mark { width: 29px; height: 31px; border-radius: 7px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand strong { font-size: 19px; }
  .brand small, .nav-caption, .sidebar-foot { display: none; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs-inner { flex-direction: row; gap: 3px; padding: 0 12px 8px; min-width: max-content; }
  .tab-btn { width: auto; min-height: 42px; gap: 7px; padding: 9px 12px; font-size: 12px; border-radius: 6px; }
  .tab-btn.active::before { display: none; }
  .tab-btn svg { width: 16px; height: 16px; }
  .nav-count { font-size: 10px; min-width: 18px; height: 18px; }
  .nav-pending { font-size: 10px; }
  header.top { position: static; }
  .top-inner { min-height: 62px; padding: 12px 22px; }
  .breadcrumb { font-size: 11px; gap: 8px; }
  .top-actions { gap: 12px; }
  .user-box { padding-left: 12px; gap: 7px; }
  .user-avatar { width: 29px; height: 29px; border-radius: 8px; font-size: 12px; }
  .user-name b { font-size: 11px; max-width: 120px; }
  .role-tag { font-size: 9px; }
  main { padding: 26px 22px 40px; }
  .card-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .skip-link { left: 16px; }
  .auth-story h2 { font-size: 29px; }
  .auth-aside { padding: 35px 5%; }
  .auth-card { padding: 30px; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .sidebar { position: sticky; }
  .brand { padding: 13px 16px 10px; }
  .tabs-inner { padding: 0 9px 8px; }
  .tab-btn { font-size: 12px; padding: 9px 10px; min-height: 44px; }
  .tab-btn svg { display: none; }
  .nav-count { margin-left: 0; }
  .top-inner { min-height: 61px; padding: 10px 17px; gap: 10px; }
  .breadcrumb { display: none; }
  .top-actions { width: 100%; justify-content: space-between; gap: 7px; }
  .sync { font-size: 10px; gap: 6px; }
  .user-box { gap: 7px; padding-left: 10px; }
  .user-name b { max-width: 85px; font-size: 11px; }
  .btn-mini { padding: 5px; min-height: 36px; font-size: 10px; }
  main { padding: 23px 16px 35px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
  .eyebrow { font-size: 9px; margin-bottom: 5px; letter-spacing: .7px; }
  h1 { font-size: 23px; }
  .page-heading p { font-size: 11px; line-height: 1.8; max-width: 230px; }
  .page-actions { gap: 7px; padding-top: 0; flex-basis: 100%; justify-content: flex-end; }
  .page-actions .btn-ghost { width: 36px; min-height: 38px; padding: 8px; }
  .page-actions .btn-ghost span { display: none; }
  .page-actions .btn-primary { min-height: 38px; padding: 8px 10px; font-size: 11px; gap: 5px; }
  .page-actions .btn-primary svg { width: 13px; }
  .quickbar { gap: 8px; margin-bottom: 17px; }
  .search-box { padding: 0 10px; gap: 7px; border-radius: 7px; }
  .search-box input { font-size: 16px; padding: 9px 0; }
  .search-box kbd { display: none; }
  .search-box svg { width: 16px; }
  .export-btn { padding: 10px; min-height: 44px; font-size: 11px; }
  .search-hint { font-size: 11px; margin-top: 1px; line-height: 1.7; }
  .kpi-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 17px; }
  .kpi { padding: 16px 14px 13px; border-radius: 9px; }
  .kpi-icon { top: 13px; right: 12px; width: 25px; height: 25px; border-radius: 7px; }
  .kpi-icon svg { width: 14px; height: 14px; }
  .kpi .k-label { font-size: 11px; }
  .kpi .k-value { margin-top: 9px; font-size: 28px; }
  .kpi-note { font-size: 10px; }
  .block { padding: 17px 14px; margin-bottom: 17px; border-radius: 9px; }
  .block-title { margin-bottom: 17px; font-size: 14px; }
  .filter-row { gap: 7px; padding-bottom: 13px; margin-bottom: 15px; }
  .filter-row select { flex: 1; width: calc(50% - 4px); min-width: 0; max-width: none; min-height: 42px; font-size: 12px; padding: 9px 5px; }
  .filter-row .clear-filters { min-height: 44px; padding: 0 3px; font-size: 10px; }
  .card-list { grid-template-columns: 1fr; gap: 12px; }
  .item-card { padding: 17px 15px; }
  .card-name { font-size: 16px; }
  .card-actions button { min-height: 38px; padding: 6px 15px; font-size: 12px; }
  .meta-line { font-size: 13px; }
  .charts { grid-template-columns: 1fr; gap: 0; }
  .stat-tip { font-size: 11px; }
  .modal-mask { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .modal-mask .modal { padding: 22px 19px; }
  .modal-head h2, .modal-head h3 { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 17px; }
  .field input, .field select, .field textarea { font-size: 16px; min-height: 44px; }
  .field label { font-size: 13px; }
  .chip { min-height: 42px; padding: 8px 10px; }
  .draft-note { flex-basis: 100%; margin-bottom: 5px; }
  .modal-actions .btn-primary, .modal-actions .btn-ghost, .modal-actions .btn-danger { min-height: 44px; }
  .acc-row { flex-wrap: wrap; gap: 10px; padding: 16px 0; }
  .acc-name { font-size: 14px; }
  .acc-actions { flex-basis: 100%; gap: 7px; }
  .acc-actions select, .btn-xs { min-height: 38px; font-size: 11px; }
  .toast { left: 50%; bottom: max(18px,env(safe-area-inset-bottom)); width: max-content; font-size: 12px; }
  .auth-mask { background: #f4f7f5; flex-direction: column; position: fixed; }
  .auth-aside { width: 100%; padding: 27px 27px 24px; min-height: 100px; background: #193d40; }
  .auth-brand { font-size: 24px; }
  .auth-story, .auth-foot { display: none; }
  .auth-card { width: 100%; max-width: 480px; padding: 33px 27px; margin: 0 auto auto; background: #fff; min-height: calc(100% - 100px); }
  .auth-head { margin-bottom: 24px; }
  .auth-head h1 { font-size: 25px; }
  .auth-head p { font-size: 12px; }
  .auth-tabs { margin-bottom: 25px; }
  .auth-tab { min-height: 44px; font-size: 13px; }
  .auth-tip { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Section accents share one action colour while keeping each resource recognizable. */
.tab-btn[data-tab="tab-service"].active { background: #4a4c3c; border-color: #6c6b50; }
.tab-btn[data-tab="tab-service"].active svg { color: #e3c28a; }
.tab-btn[data-tab="tab-stats"].active { background: #353e59; border-color: #515d7a; }
.tab-btn[data-tab="tab-stats"].active svg { color: #bbc5eb; }
.tab-btn[data-tab="tab-account"].active { background: #2c475a; border-color: #49657a; }
.tab-btn[data-tab="tab-account"].active svg { color: #a1cfeb; }
body[data-page="service"] .kpi-total .kpi-icon { background: #fff2dd; color: #a47b39; }
body[data-page="stats"] .kpi-total .kpi-icon { background: #f0eff9; color: #7a72aa; }
body[data-page="account"] .kpi-total .kpi-icon { background: #eaf2f9; color: #4c7b9c; }
.create-dialog .form-actions { position: sticky; bottom: 0; padding-bottom: 15px; background: #fff; z-index: 2; }
.table-scroll-hint { margin: 0 0 10px; font-size: 11px; color: #607480; }
.upload-count { padding: 3px 8px; color: #3c7c6c; background: #edf6f1; border-radius: 5px; font-size: 11px; font-variant-numeric: tabular-nums; }
.image-upload-zone { position: relative; border: 1.5px dashed #a9cfc1; border-radius: 10px; background: #f7fbf9; transition: background .15s, border-color .15s, box-shadow .15s; }
.image-upload-zone input[type="file"] { width: 1px; height: 1px; min-height: 1px; padding: 0; top: 0; left: 0; border: 0; }
.image-upload-zone:hover, .image-upload-zone:focus-within, .image-upload-zone.drag-over { border-color: #278d73; background: #edf7f2; box-shadow: 0 0 0 3px #087f780d; }
.image-upload-prompt { display: flex; flex-direction: column; align-items: center; padding: 22px 16px; cursor: pointer; text-align: center; }
.upload-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border: 1px solid #d1e7dc; border-radius: 12px; color: #2f8c72; background: #e7f3ec; }
.upload-icon svg { width: 25px; height: 25px; }
.image-upload-prompt strong { color: #32574e; font-size: 14px; font-weight: 600; }
.upload-description { margin-top: 5px; color: #667f77; font-size: 12px; }
.upload-select-button { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; min-height: 36px; padding: 7px 15px; border: 1px solid #bfdbce; border-radius: 6px; background: #fff; color: #207c64; font-size: 12px; font-weight: 600; box-shadow: 0 2px 3px #255b4310; }
.upload-select-button > span { font-size: 18px; line-height: 1; }
.image-upload-zone.has-images .image-upload-prompt { display: grid; grid-template-columns: 40px 1fr auto; gap: 3px 12px; padding: 16px; text-align: left; }
.image-upload-zone.has-images .upload-icon { grid-row: 1/3; width: 40px; height: 40px; margin: 0; }
.image-upload-zone.has-images .upload-description { grid-column: 2; margin: 0; font-size: 11px; }
.image-upload-zone.has-images .upload-select-button { grid-column: 3; grid-row: 1/3; margin: 0; }
.image-upload-zone[aria-busy="true"] { opacity: .65; pointer-events: none; }
.purchase-image-previews { gap: 12px; margin-top: 6px; }
.purchase-image-preview { position: relative; width: 104px; padding: 5px; border: 1px solid #dce6e1; background: #fff; border-radius: 9px; }
.image-preview-button { width: 92px; height: 86px; border: 0; border-radius: 5px; background: #eff5f1; }
.image-preview-button img { transition: transform .2s; }
.image-preview-button:hover img { transform: scale(1.05); }
.image-preview-number { position: absolute; left: 10px; top: 66px; padding: 1px 5px; color: #fff; background: #1d483bba; border-radius: 3px; font-size: 10px; pointer-events: none; }
.image-preview-remove { position: absolute; right: -7px; top: -7px; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #d8e3de; border-radius: 50%; background: #fff; color: #637c70; box-shadow: 0 2px 5px #244c3614; font-size: 19px; line-height: 1; }
.image-preview-remove:hover { color: #b94b58; background: #fff5f5; border-color: #e9c8cc; }
.image-preview-caption { display: block; padding: 6px 2px 2px; color: #667c72; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .purchase-filters > select { flex: 1 1 100%; width: 100%; padding: 10px 12px; font-size: 14px; }
  .purchase-filters > input { font-size: 16px; }
  .image-upload-prompt { padding: 20px 12px; }
  .image-upload-zone.has-images .image-upload-prompt { grid-template-columns: 32px 1fr; padding: 14px 12px; gap: 4px 10px; }
  .image-upload-zone.has-images .upload-icon { width: 32px; height: 32px; border-radius: 8px; }
  .image-upload-zone.has-images .upload-icon svg { width: 21px; height: 21px; }
  .image-upload-zone.has-images .upload-select-button { grid-column: 1/-1; grid-row: 3; justify-self: stretch; justify-content: center; margin-top: 7px; min-height: 42px; }
  .image-preview-remove { width: 32px; height: 32px; top: -9px; right: -9px; }
}

/* ===== 系统设置 ===== */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-grid .block { margin-bottom: 0; }
.settings-info { grid-column: 1/-1; }
.settings-hint { margin: 0 0 12px; color: #5b7180; font-size: 12px; line-height: 1.8; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.settings-meta { margin: 10px 0 0; color: #5b7180; font-size: 12px; line-height: 1.7; }
.settings-form { display: grid; gap: 12px; }
.settings-form .settings-actions { margin-top: 0; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: #33474f; font-size: 13px; line-height: 1.6; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.settings-info-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; margin: 0; }
.settings-info-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.settings-info-list dt { color: #5b7180; flex: none; }
.settings-info-list dd { margin: 0; color: #263e49; font-weight: 500; text-align: right; word-break: break-all; }
.settings-info-list dd.bad { color: #a2404b; }
.settings-info-list dd.good { color: #21684c; }
.backup-progress { margin-top: 12px; }
.backup-progress-bar { height: 8px; background: #e9efee; border-radius: 999px; overflow: hidden; }
.backup-progress-bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .18s; }
#backupPreview { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.settings-grid code { padding: 1px 5px; border-radius: 4px; background: var(--gray-bg); font-size: 11px; }
@media (max-width: 860px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-info { grid-column: auto; }
}
.purchase-thumbnail-missing { display: flex; align-items: center; justify-content: center; color: #8b949e; font-size: 10px; line-height: 1.3; text-align: center; }
