:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --bg: #f3f6f7;
  --card: #fff;
  --ink: #172b2b;
  --muted: #526867;
  --soft: #748987;
  --line: #e1e9e8;
  --accent: #087c65;
  --accent-dark: #056651;
  --nav: #102524;
  --radius: 13px;
  --screen-padding: clamp(19px, 2.7vw, 42px);
  font-size: 16px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, select, input[type=checkbox] { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #0a987f;
  outline-offset: 2px;
}
h1, h2, h3, p, dl, dd { margin: 0; }
.icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.loading { display: grid; min-height: 100dvh; place-content: center; padding: 20px; text-align: center; }
.loading p, .loading a { display: block; margin-top: 12px; }
.layout { display: grid; grid-template-columns: 218px minmax(0,1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; min-height: 0; height: 100dvh; flex-direction: column; background: var(--nav); color: #edf7f5; padding: 25px 15px 14px; overflow-y: auto; }
.brand { color: #edf7f5; display: flex; align-items: center; gap: 11px; text-align: left; white-space: nowrap; }
.sidebar .brand { padding: 0 8px 26px; }
.brand img { flex: none; }
.brand strong, .brand span { display: block; }
.brand strong { letter-spacing: .05em; font-size: 19px; line-height: 1.3; }
.brand span { margin-top: 2px; color: #9ab7b2; font-size: 12px; letter-spacing: .08em; }
.nav-group + .nav-group { margin-top: 17px; }
.nav-group h2 { font-size: 12px; font-weight: 550; color: #9bb5b1; padding: 0 11px 7px; letter-spacing: .06em; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 41px; padding: 0 11px; color: #b9cdca; text-decoration: none; font-size: 14px; border-radius: 8px; margin: 2px 0; }
.nav-item:hover { background: #1b3431; color: #edf7f5; }
.nav-item.active { background: #1b423b; color: #c2fae9; font-weight: 650; }
.nav-item.active .icon { color: #61ddbd; }
.nav-item i { display: inline-block; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #55d7b5; }
.sidebar-bottom { margin-top: auto; padding: 14px 10px 0; display: flex; gap: 10px; border-top: 1px solid #2a423f; align-items: flex-start; }
.sidebar nav { margin-bottom: 22px; }
.online-dot { width: 7px; height: 7px; border-radius: 100%; background: #53d8a1; margin-top: 6px; box-shadow: 0 0 0 4px #254a3e; }
.sidebar-bottom strong, .sidebar-bottom small { display: block; }
.sidebar-bottom strong { color: #e3f1ee; font-size: 13px; font-weight: 600; }
.sidebar-bottom small { margin-top: 4px; color: #9bb5b1; font-size: 12px; }
.main-layout { min-width: 0; }
.topbar { min-height: 69px; padding: 0 var(--screen-padding); display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.crumb, .top-actions { display: flex; align-items: center; gap: 13px; }
.crumb { min-width: 0; font-size: 14px; white-space: nowrap; }
.crumb-root { color: var(--soft); }
.crumb > .icon { width: 13px; height: 13px; color: #849694; }
.branch-select { display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; height: 37px; color: var(--muted); background: #fff; }
.branch-select .icon { width: 15px; height: 15px; }
.branch-select select { appearance: none; border: 0; background: transparent; color: var(--ink); font-size: 14px; max-width: 135px; }
.user-button { padding: 0 0 0 11px; border: 0; border-left: 1px solid var(--line); background: none; display: flex; align-items: center; text-align: left; gap: 8px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; background: #dff2ec; border: 1px solid #d1ebe2; color: #126953; border-radius: 9px; font-size: 14px; font-weight: 750; }
.user-caption { max-width: 115px; overflow: hidden; }
.user-caption strong, .user-caption small { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.user-caption small { color: var(--soft); font-size: 12px; }
.user-button .icon { color: var(--soft); width: 13px; height: 13px; }
#main-content { display: grid; align-content: start; gap: 18px; padding: 23px var(--screen-padding) 35px; max-width: 1900px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.page-head h1 { font-size: clamp(24px,2.15vw,32px); line-height: 1.25; letter-spacing: -.03em; font-weight: 750; }
.page-head p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.head-actions, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-actions { justify-content: flex-end; }
.btn { text-decoration: none; min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; padding: 7px 12px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; font-weight: 650; line-height: 1.35; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover:enabled { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.secondary { background: #fff; color: #2d4947; border-color: #d9e4e2; }
.btn.secondary:hover:enabled, .btn.icon-button:hover:enabled { background: #edf7f3; border-color: #d0e7df; }
.btn.icon-button { padding: 0; min-width: 36px; background: transparent; color: var(--muted); }
.btn.menu-button { display: none; }
.btn.text-btn { color: var(--accent-dark); padding: 4px 3px; background: transparent; min-height: 29px; }
.btn.text-btn.danger-text { color: #a12630; }
.btn.text-btn:hover, .link-button:hover { text-decoration: underline; }
.hero { min-height: 154px; background: linear-gradient(105deg,#123730,#0d4d40 75%,#115546); border: 1px solid #20594d; border-radius: var(--radius); color: #fff; position: relative; overflow: hidden; padding: 23px 25px; display: flex; align-items: center; }
.hero-content { position: relative; z-index: 1; }
.hero-date { display: flex; align-items: center; gap: 7px; color: #a6d8ca; font-size: 13px; }
.hero-date .icon { width: 15px; height: 15px; }
.hero h2 { font-size: clamp(23px,3vw,36px); font-weight: 750; line-height: 1.2; margin: 8px 0 7px; }
.hero p { font-size: 14px; color: #bee3d9; }
.hero-art { position: absolute; inset: 0 0 0 54%; background: repeating-linear-gradient(0deg,transparent 0 23px,#b9eed811 24px,transparent 25px),repeating-linear-gradient(90deg,transparent 0 23px,#b9eed811 24px,transparent 25px); mask-image: linear-gradient(90deg,transparent,#000 35%); }
.hero-orbit { position: absolute; width: 230px; height: 90px; border: 1px solid #71d6b663; border-radius: 50%; transform: rotate(-18deg); right: 6%; top: 22%; }
.orbit-two { right: 10%; top: 6%; transform: rotate(-25deg); }
.orbit-three { right: 2%; top: 37%; transform: rotate(-25deg); }
.hero-node { position: absolute; display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid #7bd6bb77; border-radius: 11px; background: #15594c; color: #a8f0d7; box-shadow: 0 8px 22px #092d2866; transform: rotate(-11deg); }
.hero-node .icon { width: 24px; height: 24px; }
.node-one { right: 43%; top: 36%; }
.node-two { right: 25%; top: 20%; width: 58px; height: 58px; }
.node-two .icon { width: 31px; height: 31px; }
.node-three { right: 8%; top: 40%; width: 35px; height: 35px; }
.node-three .icon { width: 18px; height: 18px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 2px 5px #183d3b04; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.metric { display: flex; flex-direction: column; align-items: flex-start; padding: 13px 16px; text-align: left; line-height: 1.2; color: var(--ink); }
.metric:hover, .stock-card:hover { border-color: #99c9ba; }
.metric-top { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #3e5a57; white-space: normal; font-weight: 650; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; }
.metric-icon .icon { width: 17px; height: 17px; }
.metric strong { padding-top: 9px; font-size: clamp(23px,2.05vw,30px); font-variant-numeric: tabular-nums; max-width: 100%; overflow-wrap: anywhere; }
.metric .small { font-weight: 500; font-size: 14px; }
.metric-foot { margin-top: 5px; font-size: 13px; color: var(--soft); }
.home-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(220px, .35fr); gap: 16px; }
.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.card-header { min-height: 62px; padding: 12px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h2 { font-size: 17px; font-weight: 750; }
.card-header p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.table-scroll { overflow: auto; }
.card > .table-scroll:last-child { border-radius: 0 0 var(--radius) var(--radius); }
table { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { padding: 12px 13px; white-space: nowrap; vertical-align: middle; text-align: left; }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
th { border-block: 1px solid #eaf0ef; background: #f6f9f9; color: #4c6562; font-size: 13px; font-weight: 650; }
td { border-top: 1px solid #edf2f1; color: #233d3a; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
tr:hover td { background: #f9fcfb; }
.cell-secondary { display: block; color: var(--soft); font-size: 12px; margin-top: 4px; }
.wrap { white-space: normal; display: block; min-width: 150px; overflow-wrap: anywhere; }
.link-button { background: none; border: 0; padding: 4px 0; text-align: left; color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.route { display: inline-flex; gap: 8px; align-items: center; }
.route > span { color: #638d83; }
.badge { display: inline-flex; align-items: center; border-radius: 20px; gap: 6px; padding: 4px 8px; white-space: nowrap; font-size: 13px; font-weight: 650; line-height: 1.2; }
.badge i, .dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; flex: none; }
.teal { background: #e1f4ee; color: #08745b; }
.blue { background: #e9f1fd; color: #275ba0; }
.violet { background: #efeafa; color: #674aaa; }
.amber { background: #fff1d9; color: #835c0d; }
.red { background: #fce9e7; color: #aa3f37; }
.green { background: #e6f4e9; color: #257345; }
.muted { background: #eef2f2; color: #617773; }
.stock-summary { padding: 1px 16px 9px; }
.stock-line { display: flex; min-height: 40px; width: 100%; justify-content: space-between; align-items: center; padding: 4px 0; border: 0; border-top: 1px solid #edf2f1; background: none; color: var(--ink); font-size: 14px; }
.stock-line:hover { color: var(--accent); }
.stock-line span, .stock-card span { display: flex; gap: 9px; align-items: center; }
.stock-line strong { font-size: 15px; }
.stock-line small, .stock-card small { color: var(--soft); font-size: 12px; font-weight: 500; }
.stock-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 9px; }
.stock-card { padding: 12px; display: grid; gap: 7px; text-align: left; background: #fff; color: var(--ink); }
.stock-card.selected { border-color: var(--accent); background: #f3fbf8; }
.stock-card span { font-size: 14px; }
.stock-card strong { font-size: 23px; }
.filters { padding: 15px 17px; display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.filters .form-field { flex: 0 1 auto; min-width: 118px; }
.filters .check-label { align-self: end; min-height: 38px; }
.filter-count { padding: 8px 0; color: var(--muted); font-size: 14px; }
.search-box { display: inline-flex; gap: 6px; align-items: center; padding: 0 8px; min-height: 38px; background: #fff; border: 1px solid #dce6e4; border-radius: 8px; color: #52726a; width: min(100%,270px); }
.search-box .icon { width: 16px; height: 16px; }
.search-box input { border: 0; outline-offset: 0; background: transparent; min-width: 0; width: 100%; padding: 5px; font-size: 14px; color: var(--ink); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input:focus-visible { outline: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager > div { display: flex; gap: 7px; }
.pager .btn { min-height: 32px; padding: 5px 10px; }
.empty { min-height: 155px; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 22px 15px; text-align: center; color: var(--muted); font-size: 14px; }
.empty strong { font-weight: 600; }
.empty-icon { width: 36px; height: 36px; color: #54837a; background: #eaf5f1; border-radius: 9px; display: grid; place-items: center; }
.tabs { display: flex; gap: 8px; padding: 12px 17px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.btn.tab { background: transparent; color: var(--muted); border-radius: 0; border-bottom: 2px solid transparent; padding-inline: 11px; }
.btn.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.pickup-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 5px; margin-left: auto; background: #d9efea; color: #164d43; border-radius: 12px; font-size: 11px; }
.pickup-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; padding: 15px; }
.pickup-card { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.pickup-card header { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.pickup-card small { display: block; margin-top: 2px; color: var(--muted); }
.pickup-card address { font-style: normal; color: var(--ink); }
.pickup-summary { color: var(--muted); font-size: 13px; }
.pickup-summary:empty { display: none; }
.pickup-reason { margin: 0; padding: 8px; background: #fff2e9; color: #813d28; border-radius: 7px; }
.pickup-actions { padding-top: 5px; }
@media (max-width: 760px) {
 .pickup-cards { padding: 11px; }
 .dock-item { position: relative; }
 .dock-item .pickup-count { position: absolute; inset: 3px 7px auto auto; }
 .pickup-actions .btn { min-height: 42px; }
}
.form-field { min-width: 0; display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: #354f4b; }
.form-field em { font-style: normal; color: #ac473b; margin-left: 4px; }
.form-field :is(input,select,textarea) { background: #fff; border: 1px solid #d7e4e1; border-radius: 8px; color: var(--ink); padding: 8px 10px; min-height: 38px; min-width: 0; width: 100%; font-weight: 400; }
.form-field textarea { resize: vertical; min-height: 72px; }
.form-field :is(input,textarea)::placeholder, .search-box input::placeholder { color: #758985; }
.check-label { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); line-height: 1.35; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; flex: none; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.span-full { grid-column: 1/-1; }
.form-section { display: block; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; margin: 0; }
.form-section legend, .form-section h3 { padding: 0 4px; font-size: 14px; font-weight: 750; }
.permission-box { display: grid; gap: 12px; }
.permission-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
[data-permission-groups] { display: grid; gap: 10px; }
.permission-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; min-width: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px 12px; }
.permission-grid input:disabled + span { opacity: .6; }
.form-error { color: #a53930; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.dialog-body .note { color: #41635b; font-size: 14px; line-height: 1.55; background: #f0f7f4; padding: 10px 12px; border-radius: 8px; margin: 0; }
#modal { width: min(92vw,525px); max-height: min(91vh,1000px); border: 1px solid #cbded9; border-radius: 13px; color: var(--ink); padding: 0; box-shadow: 0 19px 65px #0c29285c; }
#modal.wide { width: min(94vw,900px); }
#modal::backdrop { background: #0b212287; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; position: sticky; top: 0; z-index: 2; }
.dialog-head h2 { font-size: 19px; overflow-wrap: anywhere; }
.dialog-body { display: grid; gap: 13px; padding: 15px 17px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 11px 16px; border-top: 1px solid var(--line); background: #fff; position: sticky; bottom: 0; z-index: 1; }
.dialog-footer .form-error { margin-right: auto; flex: 1 1 125px; }
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.detail-section { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.detail-section h3 { font-size: 15px; margin-bottom: 9px; }
.detail-actions { padding-bottom: 2px; }
dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px 13px; }
dt { color: var(--soft); font-size: 13px; }
dd { margin-top: 2px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.definition { padding: 0 17px 15px; }
.timeline { border-left: 1px solid #dcebe6; margin: 0 0 0 6px; padding: 0 0 0 13px; list-style: none; }
.timeline li { padding: 3px 0 8px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -17px; top: 8px; width: 7px; height: 7px; background: #43a68b; border-radius: 100%; }
.timeline li strong { font-size: 14px; }
.timeline li span { margin-left: 8px; font-size: 12px; color: var(--soft); }
.timeline li p { font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.load-list { display: grid; max-height: 220px; overflow: auto; margin-top: 7px; }
.load-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.load-choice span { color: var(--muted); }
#toast { position: fixed; bottom: 19px; right: 19px; max-width: min(85vw,410px); background: #123c33; color: #fff; border-radius: 9px; box-shadow: 0 4px 18px #1025243b; padding: 11px 14px; opacity: 0; pointer-events: none; font-size: 14px; z-index: 6; }
#toast.visible { opacity: 1; }
#toast.error { background: #8c3128; }
.auth-screen { display: grid; grid-template-columns: minmax(260px,.85fr) minmax(0,1fr); min-height: 100dvh; }
.auth-aside { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; color: #fff; background: radial-gradient(ellipse at 95% 30%,#205d4e 0%,#12342c 42%,#102524 100%); padding: clamp(26px,6vw,86px); }
.auth-copy { max-width: 500px; }
.auth-copy > span { color: #a8d8cd; font-size: 14px; }
.auth-copy h1 { font-size: clamp(29px,4vw,57px); line-height: 1.23; margin: 16px 0; }
.auth-copy p, .auth-footer { font-size: 14px; line-height: 1.7; color: #b5d6cd; }
.auth-main { display: grid; place-items: center; padding: 30px; }
.auth-card { width: min(100%,480px); }
.auth-card h2 { font-size: 30px; margin-bottom: 7px; }
.auth-card > p { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.auth-card form { display: grid; gap: 12px; }
.auth-card .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.auth-card .form-field :is(input,select) { min-height: 42px; }
.auth-submit { width: 100%; min-height: 42px; }
.mobile-brand { display: none; }
.preview-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.sheet-preview { background: #eff3f2; padding: 10px; overflow: auto; }
.print-sheet { border: 1px solid #495f5a; background: #fff; color: #131d1a; padding: 13px; display: grid; gap: 9px; font-size: 13px; overflow-wrap: anywhere; }
.sheet-preview .print-sheet.label { max-width: 420px; margin: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.sheet-head h2 { font-size: 18px; }
.sheet-head strong { font-size: 13px; }
.sheet-serial { text-align: center; width: 39%; min-width: 118px; }
.barcode { display: block; width: 100%; height: 30px; }
.sheet-route { border-block: 1px solid #596b67; padding: 4px 0; font-weight: 750; font-size: 18px; }
.sheet-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.sheet-grid dl, .sheet-details dl { border: 1px solid #a5b4b1; padding: 6px; gap: 5px 7px; }
.sheet-grid dl { grid-template-columns: 1fr; }
.sheet-grid dl div { display: grid; grid-template-columns: 50px 1fr; gap: 5px; }
.print-sheet dt { font-size: 11px; color: #3b4b46; }
.print-sheet dd { font-size: 12px; margin: 0; }
.sheet-sign, .sheet-footer { display: flex; justify-content: space-between; gap: 8px; padding-block: 5px; }
.sheet-footer { border-top: 1px solid #a5b4b1; font-size: 11px; }
#print-root { display: none; }
.print-document #print-root { display: grid; gap: 12px; width: min(96vw, 205mm); margin: 14px auto; }
.print-document.label-mode #print-root { width: min(96vw, 100mm); }
.print-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: min(96vw,205mm); margin: 15px auto; }
.print-toolbar p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.print-sheet.label .sheet-head { display: grid; grid-template-columns: minmax(0,1fr); }
.print-sheet.label .sheet-serial { width: 100%; }
.print-sheet.label .barcode { height: 40px; }
.print-sheet dd { white-space: normal; }
@media(max-width:1150px) {
  .layout { grid-template-columns: 190px minmax(0,1fr); }
  .stock-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .home-grid { grid-template-columns: minmax(0,1fr) minmax(180px,.34fr); }
  .home-grid th, .home-grid td { padding-inline: 10px; }
}
@media(max-width:930px) {
  .home-grid, .report-grid { grid-template-columns: minmax(0,1fr); }
  .stock-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 22px; }
  .hero-art { opacity: .65; inset-inline-start: 45%; }
}
@media(max-width:700px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: fixed; z-index: 4; inset: 56px auto 0 0; width: 218px; height: calc(100dvh - 56px); display: none; }
  .menu-open .sidebar { display: flex; box-shadow: 12px 0 28px #10252452; }
  .topbar { min-height: 56px; padding-inline: 12px; }
  .btn.menu-button { display: inline-flex; }
  .crumb { gap: 4px; }
  .crumb-root, .crumb > .icon, .user-caption, .user-button > .icon { display: none; }
  .top-actions { gap: 6px; }
  .branch-select { padding-inline: 6px; }
  .branch-select select { max-width: 83px; }
  .user-button { padding-left: 6px; }
  #main-content { gap: 13px; padding: 17px 12px 26px; }
  .page-head { flex-wrap: wrap; }
  .head-actions { justify-content: flex-start; }
  .hero { padding: 16px; min-height: 125px; }
  .hero-art { opacity: .36; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .metric { padding-inline: 10px; }
  .stock-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-grid :is(th,td):is(:nth-child(3),:nth-child(5),:nth-child(6)) { display: none; }
  .home-grid .route { display: inline; white-space: normal; overflow-wrap: anywhere; }
  .home-grid .route > span { margin: 0 4px; }
  .form-grid, dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dialog-body, .dialog-footer { padding-inline: 11px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .mobile-brand { display: block; background: var(--nav); border-radius: 11px; padding: 12px; margin-bottom: 16px; }
  .auth-main { padding: 20px; place-items: start center; }
}
@page { size: A4; margin: 11mm; }
@page thermal { size: 100mm 150mm; margin: 3mm; }
@media print {
  html, body { margin: 0; padding: 0; background: #fff; }
  #app, #modal, #toast { display: none !important; }
  #print-root, .print-document #print-root, .print-document.label-mode #print-root { display: block; width: auto; margin: 0; }
  body.label-mode #print-root { page: thermal; }
  .print-sheet { break-after: page; break-inside: avoid; padding: 3mm; }
  .print-sheet:last-child { break-after: auto; }
  .print-sheet.label { page: thermal; width: 93mm; max-width: 100%; padding: 2mm; gap: 4px; }
  .print-sheet.label h2 { font-size: 14px; }
  .print-sheet.label :is(dt,dd) { font-size: 9px; line-height: 1.16; }
  .print-sheet.label dl { gap: 3px; padding: 3px; }
  .print-sheet.label .sheet-route { font-size: 14px; }
  .print-sheet.label .sheet-grid dl div { grid-template-columns: 38px minmax(0,1fr); }
  .print-sheet.label .sheet-details dl { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .print-sheet.label .sheet-details dl div:last-child { grid-column: 1/-1; }
  .print-sheet.label .sheet-footer { padding: 2px 0; }
  .print-sheet.label .sheet-route .route { display: inline; white-space: normal; }
  .print-sheet .route > span { color: #202a27; }
}



/* Paper-style waybill editor and landscape print layout */
#modal.waybill-dialog { width: min(96vw, 1130px); }
.waybill-form-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.waybill-form-toolbar .form-field { flex: 0 1 245px; }
.waybill-paper, .waybill-template-preview { min-width: 0; border: 1px solid #abbfba; padding: 16px 18px; background: #fcfdfc; }
.waybill-heading, .waybill-template-preview h3 { margin: 0 0 13px; text-align: center; font-size: clamp(22px,3vw,32px); color: #172723; font-weight: 750; overflow-wrap: anywhere; }
.waybill-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: center; gap: 11px; margin-bottom: 13px; }
.waybill-meta .form-field { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: center; }
.waybill-meta-item { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 7px; padding: 0 3px; min-height: 36px; font-size: 14px; color: var(--muted); }
.waybill-meta-item strong { font-size: 13px; overflow-wrap: anywhere; color: var(--ink); }
.waybill-parties { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.waybill-party { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); min-width: 0; gap: 8px 10px; padding: 10px 11px; margin: 0; border: 1px solid #b9c9c5; }
.waybill-party legend { color: var(--ink); font-size: 15px; font-weight: 700; padding: 0 5px; }
.waybill-party + .waybill-party { border-left: 0; }
.waybill-party .form-field:last-child { grid-column: 1 / -1; }
.waybill-shipment { display: grid; grid-template-columns: minmax(0,1fr) minmax(126px,.21fr); }
.waybill-paper .waybill-shipment { border: 1px solid #b9c9c5; border-top: 0; }
.waybill-table-scroll { min-width: 0; overflow-x: auto; }
.waybill-goods-table { table-layout: fixed; }
.waybill-goods-table th:first-child { width: 29%; }
.waybill-goods-table th:nth-child(2) { width: 10%; }
.waybill-goods-table th:nth-child(3) { width: 13%; }
.waybill-paper .waybill-goods-table :is(th,td) { padding: 4px 6px; border: 1px solid #dbe4e2; border-left: 0; }
.waybill-paper .waybill-goods-table th { color: #324c46; text-align: center; }
.waybill-paper .waybill-goods-table .form-field { display: block; position: relative; }
.waybill-paper .waybill-goods-table .form-field > span { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.waybill-paper .waybill-goods-table input { min-height: 32px; padding: 5px 6px; }
.waybill-money > div { display: grid; align-items: center; grid-template-columns: 200px 1fr; gap: 8px; padding: 5px 9px; }
.waybill-money > div + div { border-top: 1px solid #dbe4e2; }
.waybill-money .form-field { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: center; }
.waybill-money output { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.waybill-instructions { display: grid; align-content: start; gap: 8px; padding: 9px; border-left: 1px solid #b9c9c5; }
.waybill-notes { padding: 8px 10px; border: 1px solid #b9c9c5; border-top: 0; }
.waybill-notes textarea { min-height: 42px; }
.waybill-bottom { display: grid; grid-template-columns: 53% 47%; overflow-wrap: anywhere; }
.waybill-paper > .waybill-bottom:not(:empty), .waybill-template-preview .waybill-bottom { border: 1px solid #b9c9c5; border-top: 0; color: #304740; font-size: 13px; }
.waybill-paper > .waybill-bottom:not(:has(p)):not(:has(.waybill-terms:not(:empty))) { display: none; }
.waybill-template-preview .waybill-bottom { border-top: 1px solid #b9c9c5; }
.waybill-contact, .waybill-terms, .waybill-received { padding: 7px 9px; }
.waybill-contact p { margin: 0 0 3px; }
.waybill-contact p:last-child { margin-bottom: 0; }
.waybill-contact b { font-weight: 700; }
.waybill-contact .complaint { font-weight: 700; }
.waybill-terms { border-left: 1px solid #b9c9c5; white-space: pre-line; }
.waybill-options { width: 100%; padding: 8px 10px; border: 1px solid #c9d7d4; border-radius: 8px; }
.waybill-options summary { cursor: pointer; font-size: 14px; color: #304740; }
.waybill-options .form-grid { padding-top: 12px; }
.print-document.form-mode #print-root { width: min(96vw,277mm); }
.sheet-preview:has(.form-sheet) { overflow: auto; }
.print-sheet.form-sheet { min-width: 690px; border: 0; color: #171717; gap: 6px; font-size: 13px; }
.form-sheet .waybill-heading { margin: 0 0 5px; color: inherit; font-family: "SimSun", "Songti SC", "Microsoft YaHei", serif; }
.waybill-copy-meta { display: grid; grid-template-columns: 1fr 1fr 1.1fr 1.1fr; gap: 8px; align-items: end; padding: 0 4px 4px; }
.waybill-copy-meta b { white-space: nowrap; }
.waybill-copy-paper { border: 1px solid #444; }
.waybill-copy-party { display: grid; grid-template-columns: 4em 1fr; align-items: stretch; min-width: 0; }
.waybill-copy-party + .waybill-copy-party { border-left: 1px solid #444; }
.waybill-copy-party h3 { display: grid; place-items: center; text-align: center; font-size: 1em; padding: 2px 4px; border-right: 1px solid #555; }
.waybill-copy-party p, .waybill-copy-instructions p { margin: 0; padding: 3px 5px; border-bottom: 1px solid #555; }
.waybill-copy-party p:last-child, .waybill-copy-instructions p:last-child { border-bottom: 0; }
.waybill-copy-party p b { display: inline-block; min-width: 2.2em; }
.form-sheet .waybill-shipment { border-block: 1px solid #444; grid-template-columns: minmax(0,1fr) minmax(130px,.22fr); }
.form-sheet .waybill-goods-table { font-size: inherit; }
.form-sheet .waybill-goods-table th:first-child { width: 37%; }
.form-sheet .waybill-goods-table :is(th,td) { padding: 3px 6px; height: 1.9em; text-align: center; background: white; color: inherit; white-space: normal; border: 1px solid #555; border-left: 0; border-top: 0; }
.form-sheet .waybill-goods-table :is(th,td):last-child { border-right: 0; }
.form-sheet .waybill-goods-table td:first-child { text-align: left; }
.waybill-copy-money { display: grid; grid-template-columns: 6.5em minmax(0,1fr) max-content; gap: 6px; padding: 4px 6px; align-items: center; }
.waybill-copy-money + .waybill-copy-money { border-top: 1px solid #555; }
.waybill-copy-money span { letter-spacing: .03em; }
.waybill-copy-instructions { border-left: 1px solid #555; }
.waybill-copy-instructions h3 { font-size: 1em; margin: 0; padding: 3px 5px; font-weight: 700; border-bottom: 1px solid #555; }
.waybill-copy-instructions p { display: flex; gap: 3px 10px; flex-wrap: wrap; }
.waybill-copy-instructions p span { white-space: nowrap; }
.waybill-copy-instructions .receipt-line { display: block; }
.waybill-copy-note { display: grid; grid-template-columns: 4em minmax(0,1fr); padding: 4px 6px; min-height: 1.9em; border-bottom: 1px solid #555; }
.form-sheet .waybill-terms, .form-sheet .waybill-received { border-color: #555; }
.form-sheet .waybill-contact { grid-row: span 2; }
.form-sheet .waybill-received { grid-column: 2; border-left: 1px solid #555; border-top: 1px solid #555; }
.waybill-signatures { display: flex; justify-content: space-between; padding-top: 3px; gap: 7px; }
@media (max-width: 750px) {
  .waybill-paper { padding: 12px; }
  .waybill-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .waybill-party { grid-template-columns: minmax(0,1fr); }
  .waybill-paper .waybill-shipment { grid-template-columns: minmax(0,1fr); }
  .waybill-instructions { grid-template-columns: repeat(2,minmax(0,1fr)); border-left: 0; border-top: 1px solid #b9c9c5; }
  .waybill-money > div { grid-template-columns: minmax(0,1fr); }
  .waybill-paper .waybill-goods-table { min-width: 525px; }
  .waybill-form-toolbar .form-field { flex: 1 1 145px; }
}
@page waybill-landscape { size: A4 landscape; margin: 10mm; }
@media print {
  body.form-mode #print-root { page: waybill-landscape; width: auto; margin: 0; }
  .print-sheet.form-sheet { page: waybill-landscape; min-width: 0; padding: 0; font-size: 9pt; }
  .form-sheet .waybill-heading { font-size: 22pt; }
  .form-sheet .waybill-goods-table :is(th,td) { overflow: visible; overflow-wrap: anywhere; }
  .form-sheet .waybill-terms { white-space: normal; }
}


/* Finance workspace */
.finance-navigation .tabs { flex-wrap: wrap; overflow: visible; padding: 10px 12px 0; }
.finance-navigation .tab { flex: 0 0 auto; }
.finance-filters .form-field { min-width: 135px; }
.finance-filters .form-field:first-child { min-width: 200px; }
.fin-limit { padding: 10px 15px; color: var(--muted); font-size: 13px; }
.fin-status { display: inline-flex; padding: 4px 9px; border-radius: 100px; font-size: 13px; font-weight: 650; background: #e8eeec; color: #354a44; }
.fin-status.pending { background: #fff2d5; color: #744600; }
.fin-status.ready { background: #dceafd; color: #174d94; }
.fin-status.posted { background: #e0f4e8; color: #12573f; }
.fin-status.rejected { background: #f7e5e2; color: #8f3022; }
.fin-allocations { min-width: 0; padding: 8px 0; }
.fin-allocations h3, .fin-comparison h3 { font-size: 15px; margin-bottom: 5px; }
.fin-allocations .subtle { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.fin-allocations .form-field { min-width: 120px; }
.fin-allocations .form-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fin-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.fin-comparison pre { max-height: 380px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; padding: 12px; background: #f3f8f6; border: 1px solid #dce8e5; }
.statement-sheet { border: 1px solid #acbfbb; background: #fff; }
.statement-sheet h2 { text-align: center; }
.statement-total { text-align: right; padding: 8px; }
@media print {
 .statement-sheet { display: block; border: 0; break-inside: auto; }
 .statement-sheet .table-scroll { overflow: visible; }
 .statement-sheet thead { display: table-header-group; }
 .statement-sheet tr { break-inside: avoid; }
 .statement-sheet td { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 650px) {
 .finance-navigation .tabs { gap: 4px; }
 .finance-navigation .tab { padding-inline: 8px; }
 .fin-comparison { grid-template-columns: minmax(0,1fr); }
}



/* Screen surfaces and adaptive navigation. Print uses the paper rules above. */
.mobile-dock, .mobile-scrim, .btn.drawer-close { display: none; }

@media screen {
  :root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Microsoft YaHei UI", system-ui, sans-serif;
    --bg: #eef2f8;
    --card: #fff;
    --ink: #172438;
    --muted: #4c5d73;
    --soft: #5c6c81;
    --line: #dfe6ef;
    --accent: #1b60c5;
    --accent-dark: #1955ac;
    --radius: 20px;
    --screen-padding: clamp(20px,3vw,46px);
    --glass: rgba(250,252,255,.83);
    --glass-edge: rgba(255,255,255,.94);
    --glass-shadow: 0 12px 30px rgba(55,79,125,.11), inset 0 1px 0 rgba(255,255,255,.92);
    --control: #f1f5fa;
  }
  body {
    background:
      radial-gradient(ellipse at 70% -15%, #dbe9fc 0%, transparent 50%),
      radial-gradient(ellipse at 0% 10%, #e4ebfa 0%, transparent 32%),
      var(--bg);
    background-attachment: fixed;
  }
  .layout { grid-template-columns: 238px minmax(0,1fr); min-height: 100dvh; }
  .sidebar {
    top: 16px; align-self: start; height: calc(100dvh - 32px); min-height: 0;
    margin: 16px 0 16px 16px; padding: 18px 11px 13px;
    background: var(--glass); color: var(--ink);
    border: 1px solid var(--glass-edge); border-radius: 27px;
    box-shadow: var(--glass-shadow);
    scrollbar-width: thin;
  }
  .sidebar .brand { padding: 0 7px 21px; gap: 10px; color: var(--ink); }
  .sidebar .brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 8px #0c4d502c; }
  .sidebar .brand strong { font-size: 16px; letter-spacing: 0; }
  .sidebar .brand span { font-size: 12px; letter-spacing: 0; color: var(--muted); }
  .nav-group h2 { margin-bottom: 3px; padding: 0 9px 4px; font-size: 12px; font-weight: 650; color: var(--soft); }
  .nav-group + .nav-group { margin-top: 15px; }
  .nav-item {
    display: flex; align-items: center; gap: 9px; margin: 2px 0; padding: 4px 8px;
    min-height: 42px; color: #32445c; border-radius: 13px; border: 1px solid transparent;
    font-size: 14px; font-weight: 550;
  }
  .nav-item:hover { background: #eaf0f8; color: var(--ink); }
  .nav-item.active {
    color: #164b99; background: linear-gradient(180deg,#e2edff,#dce9ff);
    border-color: #d9e6fb; font-weight: 730;
  }
  .nav-glyph {
    display: grid; place-items: center; flex: none; width: 27px; height: 27px;
    color: #3865a9; background: #e9f0fd; border-radius: 8px;
  }
  .nav-glyph .icon { width: 16px; height: 16px; stroke-width: 1.85; }
  .nav-group:nth-child(2) .nav-glyph { background: #e1f0f3; color: #136b74; }
  .nav-group:nth-child(3) .nav-glyph { background: #eee9f8; color: #694b96; }
  .nav-group:nth-child(4) .nav-glyph { background: #e9edf4; color: #53637d; }
  .nav-item.active .nav-glyph { background: #fbfdff; }
  .nav-item.active .icon { color: var(--accent-dark); }
  .sidebar nav { margin-bottom: 13px; }
  .sidebar-bottom { display: flex; align-items: center; gap: 9px; padding: 13px 11px 1px; border-top: 1px solid var(--line); }
  .sidebar-bottom strong { color: var(--muted); font-size: 13px; }
  .online-dot { display: inline-block; width: 7px; height: 7px; flex: none; margin: 0; background: #218260; box-shadow: 0 0 0 3px #d7eee5; }
  .topbar {
    position: sticky; z-index: 4; top: 12px;
    min-height: 56px; margin: 16px var(--screen-padding) 0;
    padding: 6px 9px 6px 16px; gap: 10px;
    background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 19px;
    box-shadow: var(--glass-shadow);
  }
  .crumb-root { color: var(--soft); }
  .crumb > .icon, .user-button .icon { color: var(--soft); }
  .top-actions { gap: 8px; min-width: 0; }
  .branch-select, .user-button {
    min-height: 39px; padding: 4px 9px; gap: 7px;
    border: 1px solid #e1e8f3; border-radius: 12px; background: #fff;
  }
  .branch-select select { min-width: 0; color: var(--ink); }
  .branch-select > .icon:last-child { pointer-events: none; width: 13px; height: 13px; }
  .user-button:hover { background: #f5f8ff; }
  .avatar { width: 28px; height: 28px; border-radius: 50%; background: #e2ebfc; border: 0; color: #295494; }
  #main-content { max-width: 1690px; padding-top: 24px; gap: 19px; }
  .page-head h1 { font-size: clamp(28px,3vw,40px); line-height: 1.12; letter-spacing: -.025em; font-weight: 760; }
  .page-head p { margin-top: 9px; font-size: 14px; color: var(--muted); }
  .btn { min-height: 38px; border-radius: 12px; line-height: 1.3; padding-inline: 13px; }
  .btn.primary {
    border-color: #195bc1; background: linear-gradient(180deg,#2974d7,#1a5ac1);
    color: #fff; box-shadow: 0 3px 7px #153f9435, inset 0 1px 0 #ffffff37;
  }
  .btn.primary:hover:enabled { background: #164fa7; border-color: #164fa7; }
  .btn.secondary { background: #f6f8fc; border-color: #e0e7f1; color: #2e4a71; }
  .btn.secondary:hover:enabled, .btn.icon-button:hover:enabled { background: #e9f1ff; border-color: #cadbf6; color: var(--accent-dark); }
  .btn.text-btn, .link-button { color: var(--accent-dark); }
  .btn.icon-button { min-width: 40px; background: var(--control); border-color: var(--line); color: var(--muted); }
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #1769d3; outline-offset: 2px;
  }
  .hero {
    min-height: 156px; padding: 21px 25px;
    background: linear-gradient(105deg,#edf4ff 0%,#dceafe 72%,#d5e5ff 100%);
    border-color: #d1e1f7; color: #193762;
  }
  .hero-date, .hero p { color: #405c80; }
  .hero-art {
    background: repeating-linear-gradient(0deg,transparent 0 25px,#3872b918 26px,transparent 27px),
      repeating-linear-gradient(90deg,transparent 0 25px,#3872b918 26px,transparent 27px);
  }
  .hero-orbit { border-color: #5382bf75; }
  .hero-node { background: #f1f6ff; border-color: #fbfdff; color: #2b65aa; box-shadow: 0 8px 22px #3365aa36; }
  .card { border-color: var(--line); background: var(--card); box-shadow: 0 4px 13px #2a416708; }
  .card-header { min-height: 60px; padding: 12px 18px; }
  .card-header h2 { font-size: 18px; font-weight: 720; }
  .metric-grid { gap: 14px; }
  .metric { padding: 15px 16px; }
  .metric:hover, .stock-card:hover { border-color: #b7cef2; background: #fbfdff; }
  .metric-top { color: #344863; }
  .metric-icon { border-radius: 10px; }
  .metric strong { padding-top: 11px; font-size: clamp(23px,2.5vw,34px); letter-spacing: -.03em; }
  .metric-foot { color: var(--soft); }
  .stock-card.selected { background: #f2f7ff; border-color: #b6cef1; }
  .card table th { color: #465a73; background: #f3f6fa; border-color: #e8edf5; }
  .card table td { color: #283b52; border-color: #e9edf4; }
  .card table tr:hover td { background: #f7faff; }
  .cell-secondary { color: var(--soft); }
  .table-scroll { scrollbar-width: thin; scrollbar-color: #b8c9e0 transparent; }
  .filters { padding: 14px 17px; gap: 10px; }
  .tabs, .finance-navigation .tabs {
    gap: 4px; padding: 5px; margin: 12px 16px 0;
    border: 1px solid #e4eaf3; border-radius: 15px; background: #edf2f9;
  }
  .btn.tab { border: 1px solid transparent; border-radius: 11px; padding: 6px 10px; min-height: 34px; color: #425672; }
  .btn.tab:hover { background: #f7faff; }
  .btn.tab.active { background: #fff; color: var(--accent-dark); border-color: #dce7f7; box-shadow: 0 2px 5px #233d6117; font-weight: 730; }
  .finance-filter-details > summary { display: none; }
  .form-field { color: #3a4c66; }
  .form-field :is(input,select,textarea), .search-box {
    border-color: #dce5f0; background: #f7f9fc; border-radius: 11px;
  }
  .form-field :is(input,textarea)::placeholder, .search-box input::placeholder { color: #5f7087; }
  .form-field :is(input,select,textarea):focus { background: #fff; }
  .search-box:focus-within { border-color: var(--accent); }
  .search-box { color: var(--muted); }
  .empty-icon { background: #eaf1fe; color: #396398; border-radius: 12px; }
  #modal {
    border-radius: 24px; border-color: #e5edf8; color: var(--ink);
    box-shadow: 0 24px 70px #15264d45; background: #fff;
  }
  #modal::backdrop { background: rgba(17,30,55,.37); }
  .dialog-head, .dialog-footer {
    background: var(--glass); border-color: var(--line);
    padding: 11px 17px;
  }
  .dialog-head .icon-button { border-radius: 50%; }
  .dialog-body .note { background: #eff5ff; color: #37547a; border-radius: 12px; }
  .detail-section { border-radius: 13px; }
  #toast { border-radius: 15px; background: #213a62; box-shadow: 0 9px 24px #26385335; }
  #toast.error { background: #8c3128; }
  .auth-screen {
    grid-template-columns: minmax(300px,.95fr) minmax(340px,1fr);
    gap: clamp(12px,4vw,72px); padding: 15px; min-height: 100dvh;
  }
  .auth-aside {
    position: relative; isolation: isolate; overflow: hidden; color: #f6faff;
    min-height: calc(100dvh - 30px); border-radius: 27px;
    background: radial-gradient(ellipse at 90% 18%,#3766a4,transparent 72%), #183354;
    padding: clamp(25px,5vw,75px);
  }
  .auth-aside::before, .auth-aside::after {
    content: ""; position: absolute; z-index: -1; width: 74%; aspect-ratio: 1.38;
    right: -12%; bottom: 3%; border: 1px solid #96b9ed66; border-radius: 30%; transform: rotate(-24deg);
  }
  .auth-aside::after { right: -6%; bottom: 7%; background: linear-gradient(145deg,#a4caff34,transparent); }
  .auth-copy h1 { margin: 0 0 13px; letter-spacing: -.02em; }
  .auth-copy p, .auth-footer, .auth-aside .brand span { color: #d4e7ff; }
  .auth-footer { display: flex; align-items: center; gap: 9px; }
  .auth-main { padding: 14px 15px; }
  .auth-card { padding: clamp(22px,4vw,42px); border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 14px 40px #294d8219; }
  .auth-card h2 { font-size: 31px; }
  .auth-submit { min-height: 45px; }
}
@media screen and (min-width:761px) {
  .sidebar, .topbar, .dialog-head, .dialog-footer {
    -webkit-backdrop-filter: blur(22px) saturate(138%);
    backdrop-filter: blur(22px) saturate(138%);
  }
}
@media screen and (max-width:1030px) and (min-width:761px) {
  .layout { grid-template-columns: 198px minmax(0,1fr); }
  .sidebar { margin-left: 11px; padding-inline: 8px; }
  .home-grid { grid-template-columns: minmax(0,1fr); }
}
@media screen and (max-width:760px) {
  :root { --screen-padding: 13px; --radius: 17px; }
  .layout { display: block; }
  .topbar {
    top: max(6px,env(safe-area-inset-top)); margin: 9px var(--screen-padding) 0;
    min-height: 51px; padding: 5px 7px 5px 12px; border-radius: 16px;
  }
  .crumb { min-width: 0; }
  .crumb strong { overflow: hidden; text-overflow: ellipsis; }
  .crumb-root, .crumb > .icon, .user-caption, .user-button > .icon { display: none; }
  .branch-select, .user-button { min-height: 36px; }
  .branch-select select { max-width: clamp(65px,25vw,138px); }
  .user-button { padding: 3px; }
  .topbar, .sidebar, .mobile-dock, .dialog-head, .dialog-footer {
    -webkit-backdrop-filter: blur(20px) saturate(138%);
    backdrop-filter: blur(20px) saturate(138%);
  }
  #main-content { padding-top: 19px; gap: 14px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 29px; }
  .head-actions { justify-content: flex-start; }
  .metric-grid { gap: 8px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 12px 11px; }
  .metric strong { font-size: clamp(20px,5vw,27px); }
  .metric-top { gap: 6px; }
  .metric-icon { width: 28px; height: 28px; }
  .hero { padding: 16px; min-height: 127px; }
  .hero-art { opacity: .6; }
  .home-grid { grid-template-columns: minmax(0,1fr); }
  .home-grid :is(th,td):is(:nth-child(3),:nth-child(5),:nth-child(6)) { display: none; }
  .home-grid .route { display: inline; white-space: normal; overflow-wrap: anywhere; }
  .home-grid .route > span { margin: 0 4px; }
  .card-header { min-height: 52px; padding: 10px 13px; }
  .card-header h2 { font-size: 17px; }
  .mobile-dock {
    position: fixed; z-index: 5; inset-inline: 11px; bottom: max(9px,env(safe-area-inset-bottom));
    margin-inline: auto; max-width: 500px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px;
    padding: 5px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 25px;
    box-shadow: var(--glass-shadow);
  }
  .dock-item {
    min-width: 0; min-height: 52px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; text-decoration: none; border: 0; border-radius: 19px; color: #435a77; background: transparent; font-size: 12px; font-weight: 630;
  }
  .dock-item .icon { width: 20px; height: 20px; stroke-width: 1.85; }
  .dock-item:hover { background: #f2f6fe; }
  .dock-item[aria-current], .dock-item.current { color: #164eaa; background: #e1edff; }
  .sidebar {
    display: none; position: fixed; z-index: 9; inset: max(9px,env(safe-area-inset-top)) auto max(9px,env(safe-area-inset-bottom)) 9px;
    width: min(316px,calc(100vw - 30px)); height: auto; margin: 0; padding: 15px 12px;
  }
  .menu-open .sidebar { display: flex; box-shadow: 0 20px 65px #192a5045; }
  .sidebar-heading { display: flex; justify-content: space-between; align-items: flex-start; }
  .btn.drawer-close { display: inline-flex; border-radius: 50%; }
  .mobile-scrim { display: block; position: fixed; inset: 0; z-index: 8; border: 0; background: #15264454; }
  .nav-item { min-height: 44px; }
  .tabs, .finance-navigation .tabs { margin-inline: 9px; }
  .finance-navigation .tabs {
    display: grid; grid-template-columns: none; grid-auto-flow: column;
    grid-template-rows: repeat(2,minmax(40px,auto)); grid-auto-columns: minmax(86px,max-content);
    overflow-x: auto; scrollbar-width: thin; scrollbar-color: #b8c9e0 transparent;
  }
  .finance-navigation .btn.tab { min-height: 40px; padding: 5px 6px; }
  .finance-filter-details > summary {
    display: flex; align-items: center; gap: 7px; color: #34527a;
    cursor: pointer; padding: 11px 14px; min-height: 44px; font-size: 14px; font-weight: 630;
  }
  .finance-filter-details > summary::-webkit-details-marker { display: none; }
  .finance-filter-details > summary .icon { width: 16px; height: 16px; }
  .finance-filter-details > summary .icon:last-child { margin-left: auto; }
  .finance-filter-details[open] > summary .icon:last-child { transform: rotate(180deg); }
  .finance-filter-details .filters { padding-top: 2px; }
  .finance-filters .form-field:first-child { flex: 1 0 100%; }
  .finance-filters .form-field:not(:first-child) { flex: 1 1 125px; }
  .form-field :is(input,select,textarea), .search-box input, .branch-select select { font-size: 16px; }
  #modal, #modal.wide, #modal.waybill-dialog {
    max-height: min(91dvh,1000px); width: min(100% - 14px,560px); max-width: none;
    border-radius: 23px; margin: auto auto max(7px,env(safe-area-inset-bottom));
  }
  .dialog-head, .dialog-footer { padding-inline: 12px; }
  .dialog-footer .btn { min-height: 43px; }
  .auth-screen { grid-template-columns: minmax(0,1fr); align-items: center; padding: 12px; }
  .auth-aside { display: none; }
  .mobile-brand { display: block; background: transparent; padding: 0; margin-bottom: 19px; }
  .mobile-brand .brand strong { color: var(--ink); }
  .mobile-brand .brand span { color: var(--muted); }
  .auth-main { place-items: center; padding: 6px; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: #f8fbff; }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .sidebar, .topbar, .mobile-dock, .dialog-head, .dialog-footer {
    --glass: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

