:root {
  color-scheme: light;
  --canvas: #f0f2f5;
  --surface: #fff;
  --ink: #252b36;
  --muted: #4e5868;
  --secondary-text: #626e7e;
  --border: #dcdfe6;
  --line: #e4e7ed;
  --primary: #409eff;
  --primary-fill: #236dbb;
  --primary-hover: #1c589b;
  --primary-text: #205f9d;
  --primary-light: #ecf5ff;
  --sidebar: #1a1f2e;
  --sidebar-text: #bfcbd9;
  --sidebar-active: #263445;
  --sidebar-active-text: #8dc5ff;
  --radius: 4px;
  --sidebar-width: 200px;
  --header-height: 56px;
  --text-body: 15px;
  --text-caption: 13px;
  --text-title: 24px;
  --text-section: 18px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: var(--text-title); line-height: 1.35; font-weight: 700; }
h2 { font-size: var(--text-section); line-height: 1.4; font-weight: 600; }
svg { flex: 0 0 auto; vertical-align: middle; }

.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); color: var(--sidebar-text); }
.brand {
  height: var(--header-height); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; color: white;
}
.brand strong { white-space: nowrap; font-size: 17px; font-weight: 600; }
.brand-icon {
  display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px;
  color: white; background: var(--primary); border-radius: 5px;
}
.side-nav { margin-top: 16px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 9px 16px; border-left: 4px solid transparent;
  color: var(--sidebar-text); text-decoration: none; white-space: nowrap;
}
.side-link:hover { background: var(--sidebar-active); color: #fff; }
.side-link:focus-visible { outline-color: var(--sidebar-active-text); outline-offset: -3px; }
.side-link[aria-current="page"] {
  border-color: var(--primary);
  background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 600;
}
.workspace { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 2; min-height: var(--header-height);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px #0015290b; font-size: 14px;
}
.breadcrumb, .topbar-actions, .account { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.breadcrumb { color: var(--secondary-text); }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { gap: 14px; }
.account { gap: 6px; color: var(--muted); }
.logout {
  border: 0; border-left: 1px solid var(--border); padding: 0 0 0 14px; min-height: 26px;
  background: none; color: var(--muted); white-space: nowrap;
}
.logout:hover { color: var(--primary-text); }
.matched {
  display: inline-flex; align-items: center; padding: 3px 8px; min-height: 24px;
  background: var(--primary-light); color: var(--primary-text); border: 1px solid #d9ecff;
  border-radius: var(--radius); font-size: var(--text-caption); line-height: 1.3; white-space: nowrap;
}

.work-content { margin-inline: auto; padding: 22px 20px 32px; }
.work-intro { margin: 0 2px 19px; }
.work-intro p { margin-top: 7px; color: var(--muted); line-height: 1.6; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-width: 0; box-shadow: 0 1px 2px #00152905;
}
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.overview-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px;
}
.warehouse .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.warehouse .overview-card { min-height: 92px; }
.overview-stage h2 { margin-bottom: 9px; }
.overview-stage .overview-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.overview-stage .overview-card { min-height: 88px; }
.overview-trends { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.overview-heading + .notice { margin: 0 0 12px; }
.overview-heading-with-period {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 16px;
}
.overview-heading-with-period > :is(h1, button) { white-space: nowrap; }
.overview-period-note { grid-column: 2 / -1; color: var(--muted); font-size: var(--text-caption); }
.overview-filter-summary { margin: 0 0 10px; color: var(--muted); font-size: var(--text-caption); }
.overview-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px;
  align-content: start; min-height: 124px; padding: 14px 16px 12px;
}
.overview-card dt { position: relative; grid-column: 2; color: var(--muted); font-size: 14px; }
.overview-card-link { position: relative; }
.overview-card-link dt { position: static; }
.overview-card-link .overview-symbol { top: 20px; right: auto; left: 16px; }
.overview-card-link a { color: var(--primary-text); text-decoration: none; }
.overview-card-link a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.overview-card-link a:focus-visible::after { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.overview-card-link:hover { border-color: var(--primary); }
.overview-count { grid-column: 2; margin: 3px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.overview-card strong { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-card dd span { color: var(--secondary-text); font-size: var(--text-caption); }
.overview-symbol {
  position: absolute; top: 6px; right: calc(100% + 16px);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--primary-light); color: var(--primary-text);
}
.overview-symbol.amber { background: #fdf6ec; color: #9c6417; }
.overview-symbol.green { background: #f0f9eb; color: #417829; }
.overview-symbol.red { background: #fef0f0; color: #a9353c; }
.overview-trend > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.overview-trend > header span, .overview-loading { color: var(--secondary-text); font-size: var(--text-caption); }
.overview-loading { display: grid; place-items: center; min-height: 270px; }
.overview-plot {
  --plot-height: 215px; --plot-top: 25px; --axis-width: 42px;
  position: relative; padding: var(--plot-top) 18px 13px calc(18px + var(--axis-width));
  font-size: var(--text-caption); font-variant-numeric: tabular-nums;
}
.overview-gridlines {
  position: absolute; inset: var(--plot-top) 18px auto calc(18px + var(--axis-width));
  display: flex; flex-direction: column; justify-content: space-between;
  height: var(--plot-height); pointer-events: none;
}
.overview-gridlines div { position: relative; border-top: 1px solid var(--line); }
.overview-gridlines div:last-child { border-color: var(--border); }
.overview-gridlines span { position: absolute; right: calc(100% + 7px); transform: translateY(-50%); color: var(--secondary-text); white-space: nowrap; }
.overview-bars { position: relative; display: grid; grid-template-columns: repeat(var(--day-columns), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; text-align: center; }
.overview-track { position: relative; height: var(--plot-height); }
.overview-bar { position: absolute; bottom: 0; left: 50%; width: min(68%, 106px); transform: translateX(-50%); background: var(--primary-fill); border-radius: 2px 2px 0 0; }
.overview-bars li:hover .overview-bar { background: var(--primary-hover); }
.overview-bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; font-weight: 600; white-space: nowrap; }
.overview-bars time { display: block; margin-top: 6px; color: var(--secondary-text); white-space: nowrap; }
.action-panel { margin-bottom: 20px; }
.action-panel p { margin-top: 5px; color: var(--muted); line-height: 1.6; }
.scan-panel { display: grid; grid-template-columns: 106px minmax(0, 1fr); padding: 17px 16px; }
.action-icon { border-right: 1px solid var(--line); display: grid; place-items: center; padding-right: 14px; }
.action-icon span {
  width: 74px; height: 74px; display: grid; place-items: center;
  background: var(--primary-light); color: var(--primary); border-radius: var(--radius);
}
.action-content { padding-left: 20px; min-width: 0; }
.scan-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 13px; }

input, textarea {
  width: 100%; min-width: 0; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); font-weight: 400;
}
input { min-height: 36px; padding: 7px 11px; }
textarea { padding: 8px 10px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--secondary-text); opacity: 1; }
input:focus, textarea:focus {
  outline: 0; border-color: var(--primary); box-shadow: 0 0 0 2px #409eff20;
}
.primary, .secondary, .danger {
  min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border: 1px solid transparent; border-radius: var(--radius);
  line-height: 1.4; font-weight: 600;
}
.primary { color: white; background: var(--primary-fill); border-color: var(--primary-fill); }
.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.primary:disabled { background: #a0cfff; border-color: #a0cfff; color: #203f62; }
.secondary { color: var(--muted); background: var(--surface); border-color: var(--border); }
.secondary:hover:not(:disabled) { color: var(--primary-text); border-color: #b3d8ff; background: var(--primary-light); }
.secondary:disabled { color: #a8abb2; }
.danger { color: #fff; background: #a9353c; border-color: #a9353c; }
.danger:hover:enabled { background: #8e2a31; border-color: #8e2a31; }
.danger:disabled { opacity: .6; }
.action-button { min-width: 122px; white-space: nowrap; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); gap: 14px; }
.followup .work-grid { grid-template-columns: minmax(0, 1fr); }
.list-panel, .preview-panel, .users-panel { padding: 13px 14px 15px; }
.panel-heading {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; margin-bottom: 15px; min-height: 32px;
}
.preview-panel .panel-heading { justify-content: flex-start; margin-bottom: 9px; }
.warehouse-list-heading { justify-content: flex-start; }
.warehouse-list-heading .filters { margin-left: auto; }
.list-title { margin-bottom: 24px; }
.user-toolbar { justify-content: flex-start; }
.user-toolbar input { flex: 1 1 180px; max-width: 320px; }
.user-toolbar button { white-space: nowrap; }
.users-panel > .notice { margin: 0 0 10px; }
.user-table table { table-layout: fixed; min-width: 960px; }
.user-table th:nth-child(2) { width: 138px; }
.user-table th:nth-child(3) { width: 132px; }
.user-table th:nth-child(4) { width: 88px; }
.user-table th:nth-child(5) { width: 146px; }
.user-table th:nth-child(6) { width: 76px; }
.user-table th:nth-child(7) { width: 164px; }
.user-table td:nth-child(7) { white-space: nowrap; }
.user-table th:last-child { width: 172px; text-align: center; }
.user-table .row-actions { flex-wrap: nowrap; }
.user-table small { color: var(--secondary-text); font-size: var(--text-caption); }
.agent-table table { table-layout: fixed; min-width: 340px; }
.agent-table th:nth-child(2) { width: clamp(104px, 12vw, 160px); }
.agent-table th:last-child { width: 120px; text-align: center; }
.agent-table .row-actions { flex-wrap: nowrap; }
:is(.user-form, .registration-form, .column-filter-form, .common-filters) select {
  width: 100%; min-height: 36px; padding: 7px 11px; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
:is(.user-form, .registration-form) :is(select:disabled, input[readonly]) { background: #f5f7fa; color: var(--muted); }
.record-toolbar { display: flex; align-items: center; gap: 12px; overflow-x: auto; padding: 3px; margin: -3px -3px 12px; }
.toolbar-group { display: flex; flex: none; align-items: center; gap: 6px; }
.toolbar-group + .toolbar-group { padding-left: 12px; border-left: 1px solid var(--line); }
.record-toolbar button { padding-inline: 10px; font-size: var(--text-caption); white-space: nowrap; }
:is(#selection-count, .selection-count) { color: var(--muted); font-size: var(--text-caption); white-space: nowrap; }
.record-toolbar .filters { flex: none; margin-left: auto; }
.record-toolbar .filters button { min-height: 36px; }
.common-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px;
  margin: 0 0 14px; padding: 6px 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius);
}
.common-filters label { display: grid; gap: 3px; flex: 1 1 142px; min-width: 0; max-width: 216px; font-size: var(--text-caption); }
.common-filters label:has([name="service_no"]) { flex-basis: 175px; max-width: 270px; }
.common-filters :is(input, select) { width: 100%; font-size: 14px; }
.common-filters button { flex: none; }
.common-filters :is(input, select, button) { min-height: 32px; padding-block: 4px; }
.overview-period { align-items: center; margin: 0; padding: 0; background: transparent; border: 0; }
.overview-period label { display: flex; flex: none; align-items: center; gap: 6px; white-space: nowrap; }
.overview-period select { width: 112px; }
.overview-period input { width: 132px; }
.overview-period button { padding-inline: 10px; }
.interception-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.interception-tabs button {
  min-height: 36px; padding: 6px 12px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.interception-tabs button:hover { color: var(--primary-text); background: var(--primary-light); }
.interception-tabs button:focus-visible { outline-offset: -2px; }
.interception-tabs button[aria-selected="true"] { color: var(--primary-text); border-bottom-color: var(--primary-fill); }
.filters { display: inline-flex; }
.filters button {
  min-height: 32px; padding: 5px 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); white-space: nowrap;
}
.filters button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.filters button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.filters button + button { margin-left: -1px; }
.filters button:hover { color: var(--primary-text); background: var(--primary-light); }
.filters button[aria-pressed="true"] {
  position: relative; z-index: 1; color: var(--primary-text); background: var(--primary-light);
  border-color: #b3d8ff; font-weight: 600;
}

.table-scroll { overflow: auto; border-top: 1px solid var(--line); }
:root:has(.list-panel) { scrollbar-gutter: stable; }
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums;
}
th {
  height: 40px; padding: 8px 12px; background: #f8f8f9; color: #515a6e;
  text-align: left; font-size: var(--text-caption); font-weight: 600;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
td { height: 44px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.list-panel table { table-layout: fixed; min-width: 520px; }
.followup .list-panel table { min-width: 1000px; }
.column-filter-heading { display: flex; align-items: center; gap: 4px; }
.column-filter-heading span { white-space: normal; }
.warehouse th:last-child .column-filter-heading { justify-content: center; }
.column-filter-trigger {
  flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted);
}
.column-filter-trigger:hover, .column-filter-trigger.is-filtered {
  color: var(--primary-text); border-color: #b3d8ff; background: var(--primary-light);
}
.column-filter-trigger.is-filtered svg { fill: currentColor; }
.interceptions-panel .column-filter-trigger { flex-basis: 20px; width: 20px; height: 22px; }
.warehouse .list-panel th:nth-child(6) { width: 84px; }
.followup .registration-list table { min-width: 1356px; }
.registration-list :is(th, td) { padding-inline: 10px; }
.registration-list .column-filter-heading span { white-space: nowrap; }
.registration-list .column-filter-trigger { flex-basis: 18px; width: 18px; }
.registration-selection { width: 40px; }
.registration-cabinet { width: 116px; }
.registration-waybill { width: 216px; }
:is(.registration-old_no, .registration-new_no) { width: 184px; }
.registration-agent_code { width: 100px; }
.registration-status { width: 100px; }
.registration-followup_name { width: 92px; }
.registration-print_log { width: 156px; }
.registration-actions { width: 168px; }
.registration-list .row-actions { flex-wrap: nowrap; gap: 8px; }
.registration-list .fetch-error:hover { text-decoration: underline; border-color: currentColor; }
.registration-list :is(th, td):nth-child(7) { text-align: center; }
.registration-list th:nth-child(7) .column-filter-heading { justify-content: center; }
.followup .interceptions-panel th:nth-child(2) { width: 12%; }
.followup .interception-detail table { min-width: 1350px; }
.interception-detail :is(th, td):not(.selection-cell) { padding-inline: 10px; }
.interception-detail .column-filter-heading span { white-space: nowrap; }
#interception-view-detail th:nth-child(2) { width: 112px; }
.interception-detail th:nth-child(3) { width: 202px; }
.interception-detail th:nth-child(4) { width: 238px; }
.interception-detail th:is(:nth-child(5), :nth-child(6)) { width: 174px; }
.interception-detail th:nth-child(7) { width: 88px; }
.interception-detail th:nth-child(7) .column-filter-heading { justify-content: center; }
.interception-detail th:nth-child(8) { width: 84px; }
.interception-detail td:nth-child(9) { white-space: pre-wrap; }
#interception-view-detail th:last-child { width: 124px; }
.followup .interceptions-panel .interception-group-table table { min-width: 640px; }
.followup .interceptions-panel #interception-view-waybill table { min-width: 1270px; }
.followup .interceptions-panel #interception-view-cabinet table { min-width: 1558px; }
#interception-view-cabinet .column-filter-heading span { white-space: nowrap; }
#interception-view-cabinet th:nth-child(2) { width: 120px; }
#interception-view-cabinet th:nth-child(3) { width: 100px; }
#interception-view-cabinet th:is(:nth-child(4), :nth-child(5)) { width: 152px; }
#interception-view-cabinet td:is(:nth-child(4), :nth-child(5)) { white-space: nowrap; font-size: var(--text-caption); }
#interception-view-cabinet :is(th, td):nth-child(n+6):nth-child(-n+12) { padding-inline: 6px; text-align: center; }
#interception-view-cabinet th:where(:nth-child(n+6):nth-child(-n+12)) { width: 88px; }
#interception-view-cabinet th:is(:nth-child(6), :nth-child(8), :nth-child(11)) { width: 76px; }
#interception-view-cabinet th:nth-child(n+6):nth-child(-n+12) .column-filter-heading { justify-content: center; }
#interception-view-cabinet th:nth-child(13) { width: 88px; }
#interception-view-cabinet td:nth-child(14) { white-space: pre-wrap; }
#interception-view-cabinet th:last-child { width: 172px; }
#interception-view-cabinet .row-actions { flex-wrap: nowrap; }
.interception-group-table td:last-child { text-align: center; }
#interception-view-waybill th:nth-child(2) { width: 120px; }
#interception-view-waybill th:nth-child(3) { width: 226px; }
#interception-view-waybill :is(th, td):nth-child(n+4):nth-child(-n+9) { padding-inline: 6px; text-align: center; }
#interception-view-waybill th:where(:nth-child(n+4):nth-child(-n+9)) { width: 88px; }
#interception-view-waybill th:is(:nth-child(5), :nth-child(8)) { width: 76px; }
#interception-view-waybill th:nth-child(n+4):nth-child(-n+9) .column-filter-heading { justify-content: center; }
#interception-view-waybill .column-filter-heading span { white-space: nowrap; }
#interception-view-waybill th:nth-child(10) { width: 88px; }
#interception-view-waybill td:nth-child(11) { white-space: pre-wrap; }
#interception-view-waybill th:last-child { width: 172px; }
#interception-view-waybill .row-actions { flex-wrap: nowrap; }
.followup .interceptions-panel th:last-child { width: 15%; }
.warehouse .list-panel :is(th, td):nth-child(6),
.interception-detail :is(th, td):nth-child(7),
.followup .list-panel th:last-child { text-align: center; }
:is(.list-panel, .users-panel) .selection-cell { width: 44px; padding-inline: 6px; text-align: center; }
.selection-cell input { width: 16px; height: 16px; min-height: 0; margin: 0; vertical-align: middle; accent-color: var(--primary-fill); }
#field-edit-value label { display: grid; gap: 4px; }
tbody tr:hover td { background: #f5f7fa; }
tr[data-select] { cursor: pointer; }
tr[data-select].selected { cursor: text; }
tr[data-select]:focus-visible { outline-offset: -2px; }
tr.selected td, tr.selected:hover td, tr:has([data-check]:checked) td { background: var(--primary-light); }
.status {
  display: inline-flex; align-items: center; padding: 0 8px; height: 24px;
  border-radius: var(--radius); border: 1px solid transparent; font-size: var(--text-caption); white-space: nowrap;
}
.status.pending, .status.stale { color: #945d08; background: #fdf6ec; border-color: #faecd8; }
.status.printed, .status.enabled { color: #417829; background: #f0f9eb; border-color: #e1f3d8; }
.status.waiting { color: var(--muted); background: #f4f4f5; border-color: #e9e9eb; }
.status.fetching { color: var(--primary-text); background: var(--primary-light); border-color: #d9ecff; }
.status.failed { color: #a9353c; background: #fef0f0; border-color: #fde2e2; }
.interception-status-button:hover { text-decoration: underline; }
.text-button {
  padding: 0; border: 0; background: none; color: var(--primary-text);
  text-align: left; overflow-wrap: anywhere;
}
.text-button:hover { text-decoration: underline; }
.text-button { min-height: 24px; font-size: var(--text-caption); white-space: nowrap; }
a.text-button { display: inline-flex; align-items: center; text-decoration: none; }
a.text-button:hover { text-decoration: underline; }
.delete-button { color: #a9353c; }
.text-button:disabled { color: var(--secondary-text); text-decoration: none; }
.sync-detail { font-size: var(--text-caption); color: var(--muted); }
.row-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 12px; }
.print-log small { display: block; color: var(--secondary-text); font-size: var(--text-caption); }
.table-empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.pager {
  display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 16px; color: var(--muted); font-size: var(--text-caption);
}
.page-size { display: inline-flex; align-items: center; gap: 6px; }
.page-size select {
  min-height: 28px; padding: 2px 5px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.pager .secondary, .pager [aria-current] {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px;
  min-height: 28px; padding: 0 5px; border: 0; border-radius: var(--radius);
}
.pager .secondary { background: #f4f4f5; }
.pager .secondary:hover:enabled { color: var(--primary-text); background: var(--primary-light); }
.pager [aria-current] { background: var(--primary-fill); color: #fff; font-weight: 600; }

.mapping {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-bottom: 12px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.preview-window { position: relative; }
#zoom-preview {
  position: absolute; inset-block-start: 8px; inset-inline-end: 8px;
  width: 36px; min-height: 36px; padding: 0; z-index: 1;
  box-shadow: 0 1px 3px #0002;
}
#zoom-preview:not([hidden]) + .label-stage { padding-inline-end: 52px; }
.label-stage {
  min-height: 235px; padding: 14px; background: #eef1f5; border: 1px solid var(--line);
  border-radius: var(--radius); display: grid; place-items: center; text-align: center; color: var(--muted);
}
.label-stage > img {
  display: block; max-width: 100%; max-height: clamp(260px, 48dvh, 580px);
  width: auto; height: auto;
}
.preview-empty { display: grid; justify-items: center; gap: 8px; padding: 12px 6px; }
.preview-empty svg { color: #909399; margin-bottom: 4px; }
.preview-empty strong { color: var(--muted); font-weight: 600; }
.preview-empty span { font-size: var(--text-caption); }
.print-button { margin-bottom: 12px; min-height: 40px; width: 100%; }
.notice {
  margin-top: 10px; padding: 8px 10px; border-radius: var(--radius);
  background: #fef0f0; color: #a9353c; border: 1px solid #fde2e2; font-size: var(--text-caption); line-height: 1.55;
}
.notice[data-type="success"] { background: #f0f9eb; color: #417829; border-color: #e1f3d8; }
.notice[data-type="warning"] { background: #fdf6ec; color: #8b550b; border-color: #faecd8; }
.notice[data-type="info"] { background: var(--primary-light); color: var(--primary-text); border-color: #d9ecff; }
#print-message { margin: 0 0 10px; }
#action-message, #delete-message { white-space: pre-line; overflow-wrap: anywhere; }
.list-panel > .notice { margin: 0 0 10px; }

dialog {
  width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 20px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 3px 18px #0003;
}
dialog::backdrop { background: #0006; }
dialog p { margin-top: 9px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#register-dialog { width: min(510px, calc(100% - 24px)); }
.excel-import-dialog { width: min(620px, calc(100% - 24px)); }
:is(#interception-cabinet-register, #interception-waybill-dialog, #interception-refresh-dialog) { width: min(640px, calc(100% - 24px)); }
#processing-dialog { width: min(500px, calc(100% - 24px)); }
.task-progress { display: grid; gap: 8px; margin-top: 12px; }
.task-progress .task-status { margin: 0; }
.task-progress button { justify-self: start; }
.task-meter { display: block; width: 100%; height: 12px; accent-color: var(--primary-fill); }
#import-progress { margin-top: 0; }
.column-filter-popover {
  position: fixed; inset: auto; margin: 0; width: min(340px, calc(100% - 16px)); padding: 14px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 4px 16px #00152924;
}
.column-filter-form { display: grid; gap: 12px; }
.column-filter-form label { display: grid; gap: 4px; }
.column-filter-form .filter-exact { display: flex; align-items: center; gap: 7px; }
.filter-exact input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--primary-fill); }
.column-filter-form textarea { resize: none; }
.column-filter-form .dialog-actions { margin-top: 4px; }
.column-filter-form .notice { margin: 0; }
#label-preview-dialog { width: min(1024px, calc(100% - 24px)); padding: 14px; }
#label-preview-dialog > img {
  display: block; max-width: 100%; max-height: calc(100dvh - 104px);
  width: auto; height: auto; margin-inline: auto;
}
.registration-form { display: grid; gap: 11px; margin-top: 14px; }
.registration-form label { display: grid; gap: 5px; font-weight: 600; }
.registration-form .registration-checkbox { display: flex; align-items: center; gap: 8px; }
.registration-checkbox input { width: 16px; height: 16px; min-height: 0; margin: 0; flex: none; accent-color: var(--primary-fill); }
#cabinet-delete-impact { max-height: 250px; margin-top: 12px; }
#cabinet-delete-impact th { position: sticky; top: 0; }
#cabinet-delete-impact :is(th, td):not(:first-child) { text-align: center; }
.agent-checklist { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.agent-checklist legend { padding-inline: 4px; font-weight: 600; }
#warehouse-agent-options { display: grid; gap: 7px; max-height: 150px; overflow: auto; }
.agent-checklist label { display: flex; align-items: center; font-weight: 400; overflow-wrap: anywhere; }
.agent-checklist input { width: 16px; height: 16px; min-height: 0; margin: 0; flex: none; accent-color: var(--primary-fill); }
.registration-form :is(.notice, .dialog-actions) { margin-top: 0; }
.template-link { color: var(--primary-text); white-space: nowrap; }
.excel-import-results { max-height: 250px; }
.excel-import-results table { min-width: 690px; }
.excel-import-results th { position: sticky; top: 0; }
.excel-import-results td { height: auto; }
.interception-results { max-height: 300px; margin-top: 12px; }
.interception-results th { position: sticky; top: 0; }
#interception-refresh-results table { min-width: 420px; }
.interceptions-panel .sync-detail { display: block; }
.import-status { font-size: var(--text-caption); }
.import-status.added, .import-status.updated { color: #417829; }
.import-status.skipped { color: var(--muted); }
.import-status.invalid { color: #a9353c; }
input[type="file"]::file-selector-button {
  margin-right: 9px; padding: 3px 8px; border: 1px solid #b3d8ff; border-radius: var(--radius);
  background: var(--primary-light); color: var(--primary-text); font: inherit; cursor: pointer;
}

.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px;
  background: #edf2f8;
}
.login-card {
  width: min(100%, 420px); padding: 34px 34px 32px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 36px #23344f12;
}
.login-header { display: flex; align-items: center; gap: 13px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.login-header .brand-icon { flex-basis: 44px; width: 44px; height: 44px; border-radius: 9px; background: var(--primary-fill); }
.login-header h1 { font-size: clamp(22px, 5vw, 27px); }
.login-card form { display: grid; gap: 16px; margin-top: 21px; }
.login-control { display: grid; gap: 6px; }
.login-card label { font-weight: 600; }
.login-field { position: relative; }
.login-field svg { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--secondary-text); pointer-events: none; }
.login-field input { width: 100%; min-height: 46px; padding-left: 42px; border-radius: 7px; font-size: 16px; }
.login-password-field input { padding-right: 88px; }
.login-password-toggle {
  position: absolute; inset: 4px 4px 4px auto; padding: 0 9px; border: 0; border-radius: 5px;
  background: transparent; color: var(--primary-text); font-size: var(--text-caption); white-space: nowrap;
}
.login-password-toggle:hover { background: var(--primary-light); }
.login-card .primary { min-height: 46px; margin-top: 3px; border-radius: 7px; font-weight: 600; }
.login-card .notice { margin: 0; }
.loading { padding: 32px; }
.loading button { margin-top: 10px; }
#print-sheet { display: none; }

@media (min-width: 1440px) {
  :root { --sidebar-width: 224px; }
  .work-content { padding-inline: 22px 18px; }
  .work-intro { margin-bottom: 26px; }
  .action-panel { margin-bottom: 24px; }
  .scan-panel { grid-template-columns: 128px minmax(0, 1fr); padding: 22px 16px; }
  .action-icon span { width: 84px; height: 84px; }
  .scan-form { margin-top: 16px; }
  .scan-form input, .scan-form button { min-height: 44px; }
  .filters button { min-height: 36px; }
  td { height: 46px; }
  .label-stage { min-height: 252px; }
}
@media (max-width: 1180px) {
  .overview-heading-with-period { grid-template-columns: minmax(0, 1fr) auto; }
  .overview-period { grid-column: 1 / -1; grid-row: 2; }
  .overview-period-note { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .warehouse .preview-panel { grid-row: 1; }
  .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-trends { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  :root { --header-height: 42px; --text-body: 14px; --text-title: 22px; --text-section: 17px; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; }
  .side-nav { display: flex; gap: 4px; margin: 0; padding-inline: 8px; }
  .side-link { gap: 6px; min-height: 38px; padding: 6px 10px; border-left: 0; border-bottom: 2px solid transparent; }
  .side-link svg { width: 15px; height: 15px; }
  .account { display: none; }
  .brand { padding-inline: 12px; }
  .brand strong { font-size: 15px; }
  .brand-icon { width: 26px; height: 26px; flex-basis: 26px; }
  .topbar { padding-inline: 12px; font-size: 13px; }
  .breadcrumb, .topbar-actions { gap: 7px; }
  .logout { padding-left: 7px; }
  .work-content { padding: 15px 11px 22px; }
  .work-intro { margin-bottom: 13px; }
  .overview-heading { margin-bottom: 14px; }
  .overview-cards { gap: 8px; margin-bottom: 12px; }
  .overview-card { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; min-height: 112px; padding: 9px; }
  .overview-card-link .overview-symbol { top: 17px; right: auto; left: 9px; }
  .overview-stage .overview-card { grid-template-columns: minmax(0, 1fr); min-height: 82px; }
  .overview-stage .overview-card :is(dt, dd) { grid-column: 1; }
  .overview-stage .overview-symbol { display: none; }
  .overview-card strong { font-size: 22px; }
  .overview-symbol { top: 8px; right: calc(100% + 8px); width: 30px; height: 30px; }
  .overview-symbol svg { width: 19px; height: 19px; }
  .overview-trend > header { padding: 10px 12px; }
  .overview-plot { --plot-height: 176px; --axis-width: 25px; padding-inline: calc(8px + var(--axis-width)) 8px; font-size: 11px; }
  .overview-gridlines { inset-inline: calc(8px + var(--axis-width)) 8px; }
  .action-panel { margin-bottom: 12px; }
  .scan-panel { display: block; padding: 13px; }
  .action-icon { display: none; }
  .action-content { padding: 0; }
  .scan-form { gap: 7px; margin-top: 10px; }
  .action-button { min-width: 0; padding-inline: 10px; }
  .work-grid { gap: 12px; }
  .list-panel, .preview-panel, .users-panel { padding: 11px; }
  .interceptions-panel .record-toolbar { gap: 6px; }
  .interceptions-panel .toolbar-group + .toolbar-group { padding-left: 6px; }
  .interceptions-panel .record-toolbar button { padding-inline: 8px; }
  .list-title { margin-bottom: 20px; }
  .panel-heading { margin-bottom: 10px; }
  .label-stage { min-height: 182px; padding: 11px; }
  .login { padding: 20px 14px; }
  .login-card { padding: 24px 20px; }
}
@media (prefers-contrast: more) {
  :root { --primary-fill: #194f87; --primary-hover: #153d69; --primary-text: #184577; }
}

@media print {
  html, body { margin: 0; padding: 0; background: #fff; }
  .printing-label #app { display: none !important; }
  .printing-label #print-sheet { display: block; overflow: hidden; }
  #print-sheet img { display: block; width: 100%; height: 100%; object-fit: contain; }
}
