:root {
  color-scheme: light;
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #6b7a8d;
  --primary: #1f6feb;
  --primary-soft: #e8f1ff;
  --border: #dce3ec;
  --danger: #d4380d;
  --ok: #389e0d;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.06);
  --page-bg: linear-gradient(160deg, #e8eef6 0%, #f5f7fa 45%, #eef3f8 100%);
  --input-bg: #f8fafc;
  --topbar-bg: rgba(255, 255, 255, .8);
  --hover-bg: #f8fbff;
  --dashed: #edf1f5;
  --ghost-bg: #ffffff;
  --soft-panel: #fbfcfe;
  --track: #edf1f5;
  --pending-track: #d9e2ec;
  --card-border: rgba(220, 227, 236, .8);
  --chip-bg: #f8fbff;
  --chip-border: #edf1f5;
  --stage-bg: #eef3f8;
  /* 全局表单控件规范：新增输入框和选项框应放在 .field 中并复用这些变量。 */
  --control-height: 42px;
  --control-radius: 10px;
  --control-padding-x: 12px;
  --control-chevron: url("/icons/chevron-down.svg");
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8eef6;
  --muted: #94a3b8;
  --primary: #4c8dff;
  --primary-soft: rgba(76, 141, 255, .18);
  --border: #2d3a4d;
  --danger: #ff7875;
  --ok: #73d13d;
  --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  --page-bg: linear-gradient(160deg, #0b1220 0%, #121a27 45%, #0f1623 100%);
  --input-bg: #121a27;
  --topbar-bg: rgba(18, 26, 39, .88);
  --hover-bg: #243044;
  --dashed: #2d3a4d;
  --ghost-bg: #1a2332;
  --soft-panel: #152031;
  --track: #2d3a4d;
  --pending-track: #3a4a60;
  --card-border: rgba(45, 58, 77, .95);
  --chip-bg: #152031;
  --chip-border: #2d3a4d;
  --stage-bg: #121a27;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.login-page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(31,111,235,.18), transparent 36%),
    radial-gradient(circle at 80% 10%, rgba(19, 84, 160, .14), transparent 28%),
    linear-gradient(160deg, #163a6b, #1f6feb 55%, #6aa1ff);
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  color: var(--text);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  border: 1px solid var(--card-border);
}

.login-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  background: rgba(255, 255, 255, .92) !important;
  color: #1a2332 !important;
  border-color: rgba(255, 255, 255, .55) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
html[data-theme="dark"] .login-theme-toggle {
  background: rgba(26, 35, 50, .92) !important;
  color: #e8eef6 !important;
  border-color: rgba(255, 255, 255, .18) !important;
}

.login-brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 2px;
}

.login-product-name {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
}

.login-sub { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input:not([type="radio"]):not([type="checkbox"]),
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--input-bg);
  color: var(--text);
}
.field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.field select {
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 var(--control-padding-x);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: right var(--control-padding-x) center;
  background-size: 16px 16px;
  cursor: pointer;
}
.field textarea {
  min-height: 72px;
  padding: 10px var(--control-padding-x);
  resize: none;
}
.field input[type="file"] {
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 4px;
  cursor: pointer;
}
.field input[type="file"]::file-selector-button {
  height: 32px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.order-edit-base {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.order-edit-base[disabled] {
  opacity: .72;
}
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 0 2px;
  min-height: 42px;
  align-items: center;
}
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.radio-group input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}
.customer-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.customer-form-grid .field {
  margin-bottom: 0;
  min-width: 0;
}
.customer-form-grid .field input,
.customer-form-grid .field select,
.customer-form-grid .region-cascader-trigger {
  width: 100%;
  height: var(--control-height);
  box-sizing: border-box;
}
.order-no-input {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  overflow: hidden;
}
.order-no-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.order-no-input input {
  flex: 1;
  min-width: 0;
  border: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: transparent;
  padding: 10px 12px;
  color: var(--text);
}
.order-no-input input:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.order-no-input input:focus {
  outline: none;
}
.order-no-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* 可添加多条信息：统一区块间距 */
.multi-section-title {
  font-weight: 600;
  margin: 16px 0 12px;
}
.multi-section-title:first-child {
  margin-top: 0;
}
.multi-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}
.multi-item {
  margin: 0;
  padding: 0;
}
.multi-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.multi-item .field {
  margin-bottom: 0;
}
.multi-item .customer-form-grid {
  margin-bottom: 0;
}
.multi-item .chip {
  margin-top: 8px;
}
.multi-item .row {
  align-items: flex-end;
  gap: 10px;
}
.multi-item .row .btn {
  margin-bottom: 0;
  flex-shrink: 0;
}
.multi-add {
  margin: 0 0 4px;
}
.region-cascader {
  position: relative;
  width: 100%;
  min-width: 0;
}
.region-cascader-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--border);
  height: var(--control-height);
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  padding: 0 var(--control-padding-x);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.region-cascader-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.region-cascader-trigger:hover,
.region-cascader.open .region-cascader-trigger {
  border-color: var(--primary);
  background: var(--panel);
}
.region-cascader-trigger .placeholder { color: var(--muted); }
.region-cascader-trigger .arrow {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  flex-shrink: 0;
  font-size: 0;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}
.region-cascader-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 420px;
  display: block;
  background: var(--ghost-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 310px;
}
.region-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.region-search-box input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.region-search-box input::-webkit-search-cancel-button { display: none; }
.region-search-box > button {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--soft-panel);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
.region-search-box > button:hover { color: var(--text); background: var(--hover-bg); }
.region-search-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}
.region-search-icon::after {
  content: '';
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 6px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}
.region-cascader-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  min-width: 0;
}
.region-search-results {
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
}
.region-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.region-search-item:hover,
.region-search-item:focus-visible {
  outline: none;
  background: var(--primary-soft);
}
.region-search-item strong { flex: 0 0 auto; font-size: 13px; }
.region-search-item span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.region-search-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 12px;
}
.region-col {
  overflow: auto;
  max-height: 260px;
  border-right: 1px solid var(--dashed);
}
.region-col:last-child { border-right: none; }
.region-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.region-item:hover { background: var(--hover-bg); }
.region-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.searchable-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.searchable-select-control {
  position: relative;
  width: 100%;
}
.field .searchable-select-control input {
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  padding-right: 66px;
}
.searchable-select.open .searchable-select-control input {
  border-color: var(--primary);
  outline: none;
}
.searchable-select-clear {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 34px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 22px;
  cursor: pointer;
}
.searchable-select-clear:hover {
  color: var(--text);
  background: var(--hover-bg);
}
.searchable-select-arrow {
  position: absolute;
  top: 50%;
  right: var(--control-padding-x);
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}
.searchable-select-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--ghost-bg);
  box-shadow: var(--shadow);
}

/* 下拉列表保留滚轮、触控和键盘滚动，但不显示滚动条。 */
.region-search-results,
.region-col,
.searchable-select-panel,
select {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.region-search-results::-webkit-scrollbar,
.region-col::-webkit-scrollbar,
.searchable-select-panel::-webkit-scrollbar,
select::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.searchable-select-option {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.searchable-select-option:hover,
.searchable-select-option.active {
  background: var(--hover-bg);
}
.searchable-select-option.selected {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.searchable-select-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
}
.searchable-select.disabled {
  opacity: .62;
}
.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}
.execution-lock-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(212, 72, 13, .28);
  border-radius: var(--control-radius);
  background: rgba(212, 72, 13, .1);
  color: var(--danger);
  font-weight: 600;
}
@media (max-width: 900px) {
  .customer-form-grid { grid-template-columns: 1fr; }
  .region-cascader-panel {
    min-width: 0;
    max-height: 410px;
  }
  .region-cascader-columns { grid-template-columns: 1fr; }
  .region-col {
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--dashed);
  }
  .region-col:last-child { border-bottom: none; }
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--ghost-bg);
}

/* 日期选择：整框可点开日历 */
.field.date-field .date-input-wrap {
  position: relative;
}
.field.date-field input[type="date"] {
  position: relative;
  display: block;
  width: 100%;
  min-height: var(--control-height);
  padding-right: 42px;
  color-scheme: inherit;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.field.date-field input[type="date"]:not(:focus):invalid,
.field.date-field input[type="date"]:not(:focus)[value=""] {
  color: var(--muted);
}
.field.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.field.date-field .date-input-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7a8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.field.date-field .date-input-wrap:hover::after {
  opacity: 1;
}
.field.date-field input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}
.field.date-field input[type="date"]::-webkit-datetime-edit-text {
  color: var(--muted);
  padding: 0 3px;
}
.field.date-field input[type="date"]::-webkit-datetime-edit-year-field,
.field.date-field input[type="date"]::-webkit-datetime-edit-month-field,
.field.date-field input[type="date"]::-webkit-datetime-edit-day-field {
  color: var(--text);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost {
  background: var(--ghost-bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; }

.demo-list {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  max-height: 220px;
  overflow: auto;
}
.demo-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--dashed);
  font-size: 13px;
  cursor: pointer;
}
.demo-item:hover { color: var(--primary); }

.shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: 168px 1fr;
  transition: grid-template-columns .2s ease;
}
.shell.sider-collapsed {
  grid-template-columns: 64px 1fr;
}

.sider {
  background: #132238;
  color: #dce7f5;
  padding: 9px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 40;
}
.sider::-webkit-scrollbar { display: none; }

.sider-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.notification-dock {
  margin-top: auto;
  position: relative;
  flex: 0 0 auto;
}
.notification-button {
  width: 100%;
  min-height: 46px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: #b7c6d8;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  font: inherit;
  line-height: 1;
}
.notification-button.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.notification-bell {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255,255,255,.09);
}
.notification-bell svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notification-button-label {
  min-width: 0;
  min-height: 28px;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: .01em;
}
.notification-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.notification-panel {
  position: fixed;
  left: 178px;
  bottom: 16px;
  z-index: 100;
  width: min(420px, calc(100vw - 200px));
  max-height: min(620px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 55px rgba(0,0,0,.24);
}
.shell.sider-collapsed .notification-panel {
  left: 74px;
}
.notification-panel-head {
  min-height: 56px;
  padding: 12px 14px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.notification-panel-heading { min-width: 0; }
.notification-panel-title { font-size: 16px; font-weight: 700; line-height: 1.35; }
.notification-panel-subtitle { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.notification-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.notification-close:hover { background: var(--hover-bg); color: var(--text); }
.notification-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 8px;
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--dashed);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.notification-item:hover { background: var(--hover-bg); }
.notification-item.unread { background: var(--primary-soft); }
.notification-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #64748b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
.notification-type-icon.tone-order { background: #1677ff; }
.notification-type-icon.tone-plan { background: #722ed1; }
.notification-type-icon.tone-production { background: #d97706; }
.notification-type-icon.tone-quality { background: #15803d; }
.notification-type-icon.tone-rework { background: #c2410c; }
.notification-type-icon.tone-system { background: #64748b; }
.notification-type-icon.tone-action {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}
.notification-item-body { min-width: 0; display: block; }
.notification-item-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.notification-item-title strong { font-size: 14px; }
.notification-item-title time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.notification-title-main { min-width: 0; display: inline-flex; align-items: center; gap: 6px; }
.notification-action-tag {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(220,38,38,.12);
  color: #dc2626;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}
.notification-item-content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.notification-unread-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: #ff4d4f;
}
.notification-empty { padding: 36px 16px; text-align: center; font-size: 13px; }
.notification-error { padding: 9px 14px; background: rgba(212,56,13,.1); color: var(--danger); font-size: 12px; }

.sider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 29px;
  padding: 0 2px 3px;
}

.sider .logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sider-toggle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(220,231,245,.22);
  background: rgba(255,255,255,.07);
  color: #dce7f5;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease, border-color .18s ease;
}
.sider-toggle:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(220,231,245,.34);
  color: #fff;
}
.sider-toggle:focus-visible {
  outline: 2px solid rgba(255,255,255,.72);
  outline-offset: 2px;
}
.sider-toggle-icon {
  width: 16px;
  height: 16px;
  background: url("/icons/chevrons-left.svg") center / 16px 16px no-repeat;
  transition: transform .2s ease;
}
.shell.sider-collapsed .sider-toggle-icon { transform: rotate(180deg); }

.nav-item {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  color: #b9c8da;
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: background .16s ease, color .16s ease;
}
.nav-item:hover {
  background: #22344b;
  color: #fff;
}
.nav-item.active {
  background: #284f86;
  color: #fff;
  font-weight: 600;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nav-group-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.nav-group-trigger:focus { outline: none; }
.nav-group-trigger:focus-visible {
  outline: 2px solid rgba(255,255,255,.65);
  outline-offset: 1px;
}
.nav-chevron {
  flex: 0 0 auto;
  margin-left: 6px;
  font-size: 13px;
  line-height: 1;
  transition: transform .18s ease;
}
.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}
.nav-group.open > .nav-group-trigger,
.nav-group.open > .nav-group-trigger.active {
  background: #2c3d53;
  color: #fff;
  font-weight: 600;
}
.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 5px 4px;
  border: 0;
  border-radius: 10px;
  background: #0c1a2d;
}
.nav-subitem {
  padding: 8px 10px;
  font-size: 13px;
}
.nav-subitem::before {
  display: none;
}
.nav-subitem.active { background: #284f86; }

.nav-chevron {
  width: 14px;
  height: 14px;
  background: var(--control-chevron) center / 13px 13px no-repeat;
}

.shell.sider-collapsed .sider {
  padding: 12px 8px;
  align-items: stretch;
}
.shell.sider-collapsed .sider-top {
  flex-direction: column;
  align-items: center;
  padding-bottom: 8px;
}
.shell.sider-collapsed .sider .logo {
  font-size: 18px;
  text-align: center;
  width: 100%;
}
.shell.sider-collapsed .nav-item {
  text-align: center;
  padding: 10px 4px;
  font-size: 13px;
}
.shell.sider-collapsed .nav-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
}
.shell.sider-collapsed .nav-group {
  gap: 3px;
}
.shell.sider-collapsed .nav-group-trigger {
  padding: 10px 3px;
  justify-content: center;
}
.shell.sider-collapsed .nav-chevron {
  margin-left: 2px;
  font-size: 9px;
}
.shell.sider-collapsed .nav-submenu {
  margin-left: 0;
  padding: 4px 2px;
  border-left: 0;
}
.shell.sider-collapsed .nav-subitem::before {
  display: none;
}
.shell.sider-collapsed .notification-button {
  justify-content: center;
  padding: 10px 4px;
}
.shell.sider-collapsed .notification-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  margin: 0;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.topbar-brand {
  display: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
}
.topbar-role {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions {
  align-items: center;
  flex-shrink: 0;
}

.ai-search-trigger {
  width: 210px;
  height: 36px;
  padding: 0 8px 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.ai-search-trigger:hover,
.ai-search-trigger:focus-visible {
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}
.ai-search-trigger svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ai-search-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.ai-search-trigger kbd {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.ai-assistant-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 16, 28, .52);
  backdrop-filter: blur(4px);
}
.ai-assistant-panel {
  width: min(760px, 100%);
  height: min(720px, calc(100vh - 48px));
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .3);
}
.ai-assistant-head {
  min-height: 70px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.ai-assistant-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}
.ai-assistant-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #1677ff, #6d4aff);
  color: #fff;
  box-shadow: 0 7px 18px rgba(31, 111, 235, .25);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.ai-assistant-title-wrap h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}
.ai-assistant-title-wrap p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.ai-assistant-head-actions { flex-shrink: 0; }
.ai-assistant-notice,
.ai-assistant-error {
  padding: 9px 16px;
  border-bottom: 1px solid rgba(212, 56, 13, .18);
  background: rgba(212, 56, 13, .09);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.ai-assistant-notice code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(212, 56, 13, .09);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ai-message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 20px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ai-message-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.ai-welcome {
  max-width: 570px;
  margin: 24px auto;
  text-align: center;
}
.ai-welcome-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 24px;
}
.ai-welcome h3 { margin: 0 0 7px; font-size: 20px; }
.ai-welcome > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.ai-suggestions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.ai-suggestions button {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--soft-panel);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
}
.ai-suggestions button:hover,
.ai-suggestions button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}
.ai-message {
  max-width: 88%;
  margin: 0 0 17px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.ai-message.is-user {
  margin-left: auto;
  flex-direction: row-reverse;
}
.ai-message.is-assistant { max-width: 100%; }
.ai-message-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #1677ff, #6d4aff);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.ai-message.is-user .ai-message-avatar { background: #64748b; }
.ai-message-content,
.ai-thinking {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  background: var(--soft-panel);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-message.is-user .ai-message-content {
  border-color: transparent;
  border-radius: 12px 4px 12px 12px;
  background: var(--primary);
  color: #fff;
}
.ai-markdown {
  max-width: calc(100% - 39px);
  white-space: normal;
}
.ai-markdown > :first-child { margin-top: 0; }
.ai-markdown > :last-child { margin-bottom: 0; }
.ai-markdown p { margin: 0 0 10px; }
.ai-markdown h3,
.ai-markdown h4,
.ai-markdown h5,
.ai-markdown h6 {
  margin: 16px 0 8px;
  color: var(--text);
  line-height: 1.4;
}
.ai-markdown h3 { font-size: 17px; }
.ai-markdown h4 { font-size: 15px; }
.ai-markdown h5,
.ai-markdown h6 { font-size: 14px; }
.ai-markdown ul,
.ai-markdown ol {
  margin: 5px 0 11px;
  padding-left: 22px;
}
.ai-markdown li + li { margin-top: 4px; }
.ai-markdown blockquote {
  margin: 8px 0 11px;
  padding: 7px 11px;
  border-left: 3px solid var(--primary);
  border-radius: 0 7px 7px 0;
  background: var(--primary-soft);
  color: var(--muted);
}
.ai-markdown hr {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: var(--border);
}
.ai-markdown code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(100, 116, 139, .13);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92em;
}
.ai-markdown pre {
  max-width: 100%;
  margin: 9px 0 12px;
  padding: 12px 13px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  line-height: 1.55;
  white-space: pre;
}
.ai-markdown pre code { padding: 0; background: transparent; }
.ai-table-scroll {
  max-width: 100%;
  margin: 9px 0 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.ai-table-scroll table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.5;
}
.ai-table-scroll th,
.ai-table-scroll td {
  padding: 9px 11px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}
.ai-table-scroll th:last-child,
.ai-table-scroll td:last-child { border-right: 0; }
.ai-table-scroll tbody tr:last-child td { border-bottom: 0; }
.ai-table-scroll th {
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.ai-table-scroll tbody tr:nth-child(even) { background: var(--soft-panel); }
.ai-table-scroll tbody tr:hover { background: var(--hover-bg); }
.ai-table-scroll .align-left { text-align: left; }
.ai-table-scroll .align-center { text-align: center; }
.ai-table-scroll .align-right { text-align: right; }
.ai-message.is-streaming .ai-markdown::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  border-radius: 2px;
  background: var(--primary);
  vertical-align: -.12em;
  animation: ai-answer-cursor .8s steps(1, end) infinite;
}
@keyframes ai-answer-cursor {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-message.is-streaming .ai-markdown::after { animation: none; }
}
.ai-thinking {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.ai-thinking i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: ai-thinking-dot 1.1s infinite ease-in-out;
}
.ai-thinking i:nth-child(2) { animation-delay: .14s; }
.ai-thinking i:nth-child(3) { animation-delay: .28s; }
.ai-thinking span { margin-left: 4px; font-size: 12px; }
@keyframes ai-thinking-dot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.ai-composer {
  padding: 13px 16px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--soft-panel);
}
.ai-composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  line-height: 1.5;
}
.ai-composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}
.ai-send-button {
  min-width: 74px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.ai-send-button:disabled { opacity: .5; cursor: not-allowed; }
.ai-composer > p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.content { padding: 20px 24px 40px; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

.dash-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  min-height: 48px;
}
.dash-hero-title {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.2;
  color: var(--text);
}
.dash-fs-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.dash-main-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) minmax(140px, 200px);
  gap: 14px;
  align-items: stretch;
}
.dash-side-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-status-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 88px;
}
.dash-chart-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
}

.dash-stat-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.dashboard-fs-root:fullscreen,
.dashboard-fs-root:-webkit-full-screen {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 24px 28px;
  overflow: auto;
  background: var(--page-bg);
  color: var(--text);
}
.dashboard-fs-root:fullscreen .dash-hero-title,
.dashboard-fs-root:-webkit-full-screen .dash-hero-title {
  font-size: clamp(36px, 4vw, 52px);
}
.dashboard-fs-root:fullscreen .dash-recent-viewport,
.dashboard-fs-root:-webkit-full-screen .dash-recent-viewport {
  max-height: min(42vh, 420px);
}

.schedule-board-root {
  min-width: 0;
}
.schedule-board-root:fullscreen,
.schedule-board-root:-webkit-full-screen {
  width: 100%;
  height: 100%;
  padding: 22px;
  overflow: auto;
  color: var(--text);
  background: var(--page-bg);
}
.schedule-board-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.schedule-board-hero .page-title {
  margin-bottom: 4px;
}
.schedule-board-refresh {
  font-size: 12px;
}
.schedule-board-toolbar .date-field {
  width: 180px;
}
.schedule-board-summary {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  margin-bottom: 14px;
}
.schedule-board-stat {
  border-top: 4px solid var(--primary);
  text-align: center;
}
.schedule-board-card,
.schedule-pending-card {
  margin-top: 14px;
}
.schedule-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.schedule-board-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.schedule-board-head .muted {
  font-size: 12px;
}
.schedule-board-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.schedule-board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.schedule-board-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8c8c8c;
}
.schedule-board-legend i.draft { background: #d48806; }
.schedule-board-legend i.released { background: #1677ff; }
.schedule-board-legend i.frozen { background: #722ed1; }
.schedule-board-legend i.late { background: #cf1322; }
.schedule-board-loading {
  padding: 36px 12px;
  text-align: center;
}
.schedule-board-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.schedule-board-grid {
  display: grid;
  grid-template-columns: 112px repeat(7, minmax(168px, 1fr));
  min-width: 1290px;
  background: var(--border);
  gap: 1px;
}
.schedule-board-corner,
.schedule-board-day,
.schedule-board-group,
.schedule-board-cell {
  background: var(--panel);
}
.schedule-board-corner,
.schedule-board-group {
  position: sticky;
  left: 0;
  z-index: 3;
}
.schedule-board-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.schedule-board-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  gap: 3px;
}
.schedule-board-day strong { font-size: 13px; }
.schedule-board-day span { color: var(--muted); font-size: 12px; }
.schedule-board-day.today,
.schedule-board-cell.today {
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--panel));
}
.schedule-board-group {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 148px;
  padding: 18px 8px;
  text-align: center;
  box-shadow: 5px 0 12px rgba(15, 23, 42, .04);
}
.schedule-board-group strong {
  font-size: 13px;
  line-height: 1.45;
}
.schedule-board-cell {
  position: relative;
  min-height: 148px;
  padding: 7px;
}
.schedule-board-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--pending-track);
  transform: translate(-50%, -50%);
}
.schedule-plan-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  margin-bottom: 7px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--plan-color, #1677ff) 46%, var(--border));
  border-left: 4px solid var(--plan-color, #1677ff);
  border-radius: 9px;
  color: var(--text);
  background: color-mix(in srgb, var(--plan-color, #1677ff) 8%, var(--panel));
  text-align: left;
  cursor: pointer;
}
.schedule-plan-card:hover {
  border-color: var(--plan-color, var(--primary));
  box-shadow: 0 5px 16px rgba(15, 23, 42, .10);
}
.schedule-plan-card.status-draft { border-style: dashed; }
.schedule-plan-card.late { box-shadow: inset 0 0 0 1px rgba(207, 19, 34, .32); }
.schedule-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.schedule-plan-top b { font-size: 13px; }
.schedule-plan-top em {
  color: var(--plan-color, var(--primary));
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.schedule-plan-customer,
.schedule-plan-product,
.schedule-plan-dates,
.schedule-plan-qty {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-plan-customer { font-size: 12px; font-weight: 600; }
.schedule-plan-product,
.schedule-plan-dates,
.schedule-plan-qty { color: var(--muted); font-size: 10px; }
.schedule-plan-risk {
  color: #cf1322;
  font-size: 10px;
  font-weight: 700;
}
.schedule-pending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.schedule-pending-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.schedule-pending-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft-panel) 72%, var(--panel));
}
.schedule-pending-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.schedule-pending-group-head strong { font-size: 14px; }
.schedule-pending-group-head span {
  padding: 2px 8px;
  border-radius: 999px;
  color: #d48806;
  background: rgba(212, 136, 6, .12);
  font-size: 11px;
  font-weight: 700;
}
.schedule-pending-group-empty {
  padding: 22px 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 9px;
  text-align: center;
  font-size: 12px;
}
.schedule-pending-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--soft-panel);
  text-align: left;
  cursor: pointer;
}
.schedule-pending-item:hover {
  border-color: var(--primary);
  background: var(--hover-bg);
}
.schedule-pending-item > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.schedule-pending-item i {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}
.schedule-pending-item b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-pending-item small { color: var(--muted); }

@media (max-width: 900px) {
  .schedule-board-hero,
  .schedule-board-head { align-items: flex-start; flex-direction: column; }
  .schedule-board-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-pending-groups { grid-template-columns: 1fr; }
  .schedule-board-refresh { display: none; }
}

@media (max-width: 520px) {
  .schedule-board-summary { grid-template-columns: 1fr; }
  .schedule-board-toolbar .date-field { width: 100%; }
}

/* 智能车间数据驾驶舱 */
.smart-workshop-dashboard {
  --smart-blue: #1677ff;
  --smart-cyan: #13a8a8;
  --smart-green: #24a865;
  min-width: 0;
}
.smart-dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 6px 2px 0;
}
.smart-dash-hero .dash-hero-title {
  margin-top: 5px;
  font-size: clamp(28px, 3.2vw, 42px);
  text-align: left;
  letter-spacing: .04em;
}
.smart-dash-hero p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.smart-dash-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}
.smart-dash-kicker span {
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}
.smart-dash-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.smart-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.smart-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #24a865;
  box-shadow: 0 0 0 4px rgba(36, 168, 101, .12);
  animation: smart-live-pulse 2.4s ease-in-out infinite;
}
@keyframes smart-live-pulse { 50% { box-shadow: 0 0 0 7px rgba(36, 168, 101, .04); } }
.smart-dash-loading { padding: 60px; color: var(--muted); text-align: center; }

.smart-kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.smart-kpi {
  position: relative;
  min-width: 0;
  padding: 15px 16px 14px;
  overflow: hidden;
  box-shadow: 0 5px 22px rgba(18, 38, 63, .05);
}
.smart-kpi::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  border-radius: 0 0 0 70px;
  background: color-mix(in srgb, var(--kpi-color) 8%, transparent);
  content: '';
}
.smart-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.smart-kpi-top i { width: 8px; height: 8px; border: 2px solid color-mix(in srgb, var(--kpi-color) 72%, white); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--kpi-color) 11%, transparent); }
.smart-kpi-value { margin-top: 10px; font-size: 28px; font-weight: 780; line-height: 1; letter-spacing: -.02em; }
.smart-kpi-value small { margin-left: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.smart-kpi-note { margin-top: 9px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.smart-chart-grid { display: grid; gap: 12px; margin-top: 12px; }
.smart-chart-grid-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.smart-chart-grid-secondary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.smart-chart-grid-tertiary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.smart-chart-wide, .smart-output-card { grid-column: span 2; }
.smart-chart-card { min-width: 0; padding: 17px 18px; box-shadow: 0 5px 22px rgba(18, 38, 63, .05); }
.smart-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.smart-card-head > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.smart-card-head strong { font-size: 14px; font-weight: 750; }
.smart-card-head span { color: var(--muted); font-size: 10px; }
.smart-card-head em { color: var(--primary); font-size: 14px; font-style: normal; font-weight: 750; }
.smart-chart-legend { display: flex !important; flex-direction: row !important; gap: 13px !important; }
.smart-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.smart-chart-legend i { width: 14px; height: 3px; border-radius: 2px; }
.smart-chart-legend i.blue { background: var(--smart-blue); }
.smart-chart-legend i.green { background: var(--smart-green); }
.smart-line-chart { min-height: 190px; }
.smart-line-chart svg { display: block; width: 100%; height: auto; max-height: 220px; overflow: visible; }
.smart-chart-gridlines line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 5; }
.smart-line { fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 3px 4px rgba(22, 119, 255, .14)); }
.smart-line.blue { stroke: var(--smart-blue); }
.smart-line.green { stroke: var(--smart-green); }
.smart-line.strong { stroke-width: 3.4; }
.smart-chart-axis text { fill: var(--muted); font-size: 9px; }
.smart-trend-summary { display: flex; align-items: center; gap: 22px; padding-top: 9px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.smart-trend-summary b { margin-left: 4px; color: var(--text); font-size: 12px; }

.smart-donut-layout { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 190px; }
.smart-donut { position: relative; width: 138px; height: 138px; flex: 0 0 auto; border-radius: 50%; }
.smart-donut::after { position: absolute; inset: 25px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px var(--border); content: ''; }
.smart-donut.small { width: 116px; height: 116px; }
.smart-donut.small::after { inset: 21px; }
.smart-donut > div { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.smart-donut b { font-size: 25px; line-height: 1; }
.smart-donut span { margin-top: 6px; color: var(--muted); font-size: 9px; }
.smart-donut-legend { min-width: 112px; }
.smart-donut-legend > div { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 7px; padding: 5px 0; }
.smart-donut-legend i { width: 7px; height: 7px; border-radius: 2px; }
.smart-donut-legend span { color: var(--muted); font-size: 10px; }
.smart-donut-legend b { font-size: 11px; }

.smart-bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 9px; min-height: 190px; padding: 14px 3px 0; }
.smart-bar-col { display: flex; min-width: 30px; height: 180px; flex: 1; align-items: center; justify-content: flex-end; flex-direction: column; }
.smart-bar-col > b { margin-bottom: 6px; font-size: 10px; }
.smart-bar-col > div { display: flex; height: 150px; width: min(28px, 72%); align-items: flex-end; border-radius: 6px 6px 3px 3px; background: var(--soft-panel); overflow: hidden; }
.smart-bar-col > div span { width: 100%; min-height: 0; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #48a1ff 0%, #1677ff 100%); }
.smart-bar-col small { margin-top: 7px; color: var(--muted); font-size: 9px; }
.smart-empty { padding: 34px 10px; color: var(--muted); text-align: center; font-size: 12px; }

.smart-progress-list { display: flex; flex-direction: column; gap: 13px; padding-top: 3px; }
.smart-progress-list > div > div:first-child { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px; margin-bottom: 6px; }
.smart-progress-list span { font-size: 11px; }
.smart-progress-list small { color: var(--muted); font-size: 9px; }
.smart-progress-list b { font-size: 10px; }
.smart-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--pending-track); }
.smart-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--smart-blue), #5a9dff); }
.smart-horizontal-bars { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.smart-horizontal-bars > div { display: grid; grid-template-columns: 72px minmax(50px, 1fr) 22px; align-items: center; gap: 7px; }
.smart-horizontal-bars span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.smart-horizontal-bars > div > div { height: 7px; overflow: hidden; border-radius: 999px; background: var(--pending-track); }
.smart-horizontal-bars i { display: block; height: 100%; border-radius: inherit; background: var(--smart-blue); }
.smart-horizontal-bars b { font-size: 10px; text-align: right; }
.smart-horizontal-bars.type i { background: linear-gradient(90deg, #13a8a8, #40c9c2); }

.smart-quality-layout { display: flex; align-items: center; justify-content: space-around; gap: 16px; min-height: 148px; }
.smart-quality-ring { position: relative; width: 104px; height: 104px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#24a865 var(--quality-rate), var(--pending-track) 0); }
.smart-quality-ring::after { position: absolute; inset: 17px; border-radius: 50%; background: var(--panel); content: ''; }
.smart-quality-ring > div { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.smart-quality-ring b { font-size: 18px; }
.smart-quality-ring span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.smart-quality-metrics { display: flex; min-width: 78px; flex-direction: column; gap: 8px; }
.smart-quality-metrics > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smart-quality-metrics span { color: var(--muted); font-size: 9px; }
.smart-quality-metrics b { font-size: 11px; }
.smart-quality-metrics b.good { color: #24a865; }
.smart-quality-metrics b.bad { color: #cf1322; }

.smart-recent-card { margin-top: 12px; padding: 17px 18px 8px; }
.smart-recent-list { display: flex; flex-direction: column; }
.smart-recent-row { display: grid; width: 100%; grid-template-columns: minmax(220px, .85fr) minmax(500px, 1.5fr); align-items: center; gap: 24px; padding: 12px 4px; border: 0; border-top: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.smart-recent-row:hover { background: var(--hover-bg); }
.smart-recent-meta { min-width: 0; }
.smart-recent-meta > div { display: flex; align-items: center; gap: 8px; }
.smart-recent-meta strong { font-size: 12px; }
.smart-recent-meta p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.smart-stage-grid { display: grid; grid-template-columns: repeat(5, minmax(58px, 1fr)); gap: 12px; }
.smart-stage-grid > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; }
.smart-stage-grid span, .smart-stage-grid b { font-size: 9px; }
.smart-stage-grid span { color: var(--muted); }
.smart-stage-grid > div > div { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: var(--pending-track); }
.smart-stage-grid i { display: block; height: 100%; border-radius: inherit; background: #aab8c8; }
.smart-stage-grid i.doing { background: var(--primary); }
.smart-stage-grid i.done { background: #24a865; }

.smart-workshop-dashboard:fullscreen,
.smart-workshop-dashboard:-webkit-full-screen { padding: 20px 24px 32px; }
@media (max-width: 1280px) {
  .smart-kpi-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .smart-chart-grid-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-chart-grid-tertiary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .smart-dash-hero { align-items: flex-start; flex-direction: column; }
  .smart-dash-actions { width: 100%; justify-content: space-between; }
  .smart-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-chart-grid-primary, .smart-chart-grid-secondary, .smart-chart-grid-tertiary { grid-template-columns: 1fr; }
  .smart-chart-wide, .smart-output-card { grid-column: auto; }
  .smart-recent-row { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 560px) {
  .smart-kpi-grid { grid-template-columns: 1fr; }
  .smart-kpi { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .smart-kpi-top { grid-column: 1; }
  .smart-kpi-value { grid-row: 1 / span 2; grid-column: 2; margin: 0; }
  .smart-kpi-note { grid-column: 1; }
  .smart-donut-layout { align-items: stretch; flex-direction: column; }
  .smart-donut { margin: 0 auto; }
  .smart-trend-summary { align-items: flex-start; flex-direction: column; gap: 5px; }
  .smart-stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dash-region-card {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(67, 111, 118, .42);
  background: #07171c;
  color: #edf8f5;
  box-shadow: 0 18px 50px rgba(3, 18, 22, .24);
}
.region-dashboard-page .dash-region-card { margin-top: 0; }
.region-dashboard-refresh {
  margin-top: 5px;
  font-size: 12px;
}
.dash-region-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(155, 205, 198, .13);
}
.dash-region-kicker {
  display: block;
  margin-bottom: 7px;
  color: #6fd9cb;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
}
.dash-region-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: .04em;
}
.dash-region-head p {
  margin: 7px 0 0;
  color: #86a39f;
  font-size: 12px;
}
.dash-region-summary {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.dash-region-summary > div {
  min-width: 94px;
  padding: 8px 14px;
  border-left: 1px solid rgba(155, 205, 198, .15);
}
.dash-region-summary b,
.dash-region-summary span {
  display: block;
}
.dash-region-summary b {
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-region-summary span {
  margin-top: 7px;
  color: #78948f;
  font-size: 11px;
}
.dash-region-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 530px;
}
.dash-map-canvas {
  position: relative;
  min-width: 0;
  min-height: 530px;
  padding: 14px 12px 8px;
  overflow: hidden;
  background-color: #091c22;
}
.dash-map-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(2, 11, 14, .62);
}
.dash-map-canvas svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 500px;
  touch-action: pan-y;
  user-select: none;
}
.dash-map-canvas svg.is-pannable { cursor: grab; }
.dash-map-canvas svg.is-pannable .dash-map-shape path { cursor: grab; }
.dash-map-canvas svg.is-dragging,
.dash-map-canvas svg.is-dragging * { cursor: grabbing !important; }
.dash-map-zoom-controls {
  position: absolute;
  z-index: 4;
  top: 64px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(131, 221, 208, .28);
  border-radius: 9px;
  background: rgba(4, 20, 24, .88);
  box-shadow: 0 10px 24px rgba(2, 11, 14, .25);
  backdrop-filter: blur(10px);
}
.dash-map-fullscreen {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  min-width: 122px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(131, 221, 208, .28);
  border-radius: 9px;
  color: #d8f5f0;
  background: rgba(4, 20, 24, .88);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.dash-map-fullscreen:hover,
.dash-map-fullscreen:focus-visible {
  outline: none;
  background: rgba(100, 225, 209, .14);
}
.dash-map-zoom-controls button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-right: 1px solid rgba(131, 221, 208, .18);
  border-radius: 0;
  color: #d8f5f0;
  background: transparent;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.dash-map-zoom-controls button:last-child { border-right: 0; }
.dash-map-zoom-controls button:hover:not(:disabled),
.dash-map-zoom-controls button:focus-visible {
  color: #fff;
  background: rgba(100, 225, 209, .14);
}
.dash-map-zoom-controls button:disabled {
  color: #506b68;
  cursor: not-allowed;
}
.dash-map-zoom-controls .dash-map-zoom-reset {
  width: 58px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.dash-map-shape path {
  fill: #15323a;
  stroke: #426069;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
  transition: fill .18s ease;
}
.dash-map-point {
  cursor: pointer;
  outline: none;
}
.dash-map-point-halo {
  fill: rgba(88, 225, 207, .12);
  stroke: rgba(88, 225, 207, .28);
  stroke-width: .8;
  transform-box: fill-box;
  transform-origin: center;
  animation: dash-map-point-pulse 10s ease-in-out var(--point-pulse-delay, 0s) infinite;
}
.dash-map-point-core {
  fill: #64e1d1;
  stroke: #d5fff9;
  stroke-width: 1.1;
  filter: drop-shadow(0 0 4px rgba(100, 225, 209, .76));
  animation: dash-map-point-glow 10s ease-in-out var(--point-pulse-delay, 0s) infinite;
}
@keyframes dash-map-point-pulse {
  0%, 16%, 100% { opacity: .34; transform: scale(.86); }
  5% { opacity: 1; transform: scale(1.28); }
  9% { opacity: .52; transform: scale(1); }
}
@keyframes dash-map-point-glow {
  0%, 16%, 100% { opacity: .82; }
  5% { opacity: 1; }
  9% { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-map-point-halo,
  .dash-map-point-core { animation: none; }
}
.dash-map-label {
  fill: #d8f5f0;
  stroke: #07171c;
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  pointer-events: none;
}
.dash-map-detail {
  position: absolute;
  z-index: 3;
  left: 24px;
  bottom: 22px;
  min-width: 210px;
  padding: 13px 15px;
  border: 1px solid rgba(131, 221, 208, .26);
  border-radius: 11px;
  background: rgba(4, 20, 24, .88);
  backdrop-filter: blur(10px);
}
.dash-map-detail > span {
  display: block;
  color: #789a95;
  font-size: 10px;
}
.dash-map-detail > strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}
.dash-map-detail > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  color: #9bb4b0;
  font-size: 12px;
}
.dash-map-detail b {
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
.dash-map-detail small {
  margin-left: auto;
  color: #6f8d88;
}
.dash-map-loading {
  display: grid;
  min-height: 500px;
  place-items: center;
  color: #789a95;
  font-size: 13px;
}
.dash-region-ranking {
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  border-right: 1px solid rgba(155, 205, 198, .13);
  background: #08191e;
}
.dash-region-brand { margin-bottom: 22px; }
.dash-region-brand h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 720;
  letter-spacing: .04em;
}
.dash-region-brand p {
  margin: 8px 0 0;
  color: #86a39f;
  font-size: 11px;
  line-height: 1.6;
}
.dash-region-ranking-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-region-ranking-list { display: contents; }
.dash-region-ranking-head span { font-size: 14px; font-weight: 650; }
.dash-region-ranking-head small { color: #6f8e89; font-size: 10px; }
.dash-region-ranking button {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cfe5e1;
  text-align: left;
  cursor: pointer;
}
.dash-region-ranking button:hover,
.dash-region-ranking button:focus-visible,
.dash-region-ranking button.active {
  outline: none;
  background: rgba(102, 225, 209, .08);
}
.dash-region-rank {
  color: #54736e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.dash-region-rank-body { min-width: 0; }
.dash-region-rank-body > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.dash-region-rank-body b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-region-rank-body em {
  flex: 0 0 auto;
  color: #9fc2bc;
  font-size: 11px;
  font-style: normal;
}
.dash-region-rank-body i {
  display: block;
  height: 2px;
  margin-top: 7px;
  overflow: hidden;
  background: #173139;
}
.dash-region-rank-body u {
  display: block;
  height: 100%;
  background: #64e1d1;
  text-decoration: none;
}
.dash-region-unlocated {
  margin-top: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 188, 89, .18);
  border-radius: 8px;
  color: #d4ad70;
  background: rgba(255, 188, 89, .05);
  font-size: 10px;
  line-height: 1.5;
}
.dash-region-updated {
  margin-top: auto;
  padding: 18px 8px 2px;
  color: #6f8e89;
  font-size: 10px;
}
html[data-theme="light"] .dash-region-card {
  border-color: #dce7e8;
  background: #f8fbfb;
  color: #152326;
  box-shadow: 0 18px 50px rgba(35, 64, 69, .10);
}
html[data-theme="light"] .dash-region-head {
  border-bottom-color: #dce7e8;
}
html[data-theme="light"] .dash-region-kicker { color: #159b8d; }
html[data-theme="light"] .dash-region-head p,
html[data-theme="light"] .dash-region-summary span { color: #718487; }
html[data-theme="light"] .dash-region-summary > div { border-left-color: #d8e4e5; }
html[data-theme="light"] .dash-map-canvas { background: #edf4f5; }
html[data-theme="light"] .dash-map-canvas::after {
  box-shadow: inset 0 0 90px rgba(123, 157, 162, .14);
}
html[data-theme="light"] .dash-map-zoom-controls {
  border-color: rgba(56, 146, 137, .24);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 24px rgba(56, 91, 95, .10);
}
html[data-theme="light"] .dash-map-zoom-controls button {
  border-right-color: rgba(56, 146, 137, .16);
  color: #26494a;
}
html[data-theme="light"] .dash-map-zoom-controls button:hover:not(:disabled),
html[data-theme="light"] .dash-map-zoom-controls button:focus-visible {
  color: #123a38;
  background: rgba(31, 164, 150, .10);
}
html[data-theme="light"] .dash-map-zoom-controls button:disabled { color: #9aabaa; }
html[data-theme="light"] .dash-map-shape path {
  fill: #dce8e9;
  stroke: #afc5c8;
}
html[data-theme="light"] .dash-map-label {
  fill: #26494a;
  stroke: #edf4f5;
}
html[data-theme="light"] .dash-map-detail {
  border-color: rgba(56, 146, 137, .26);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 32px rgba(56, 91, 95, .10);
}
html[data-theme="light"] .dash-map-detail > span,
html[data-theme="light"] .dash-map-detail small { color: #6c8382; }
html[data-theme="light"] .dash-map-detail > div { color: #627574; }
html[data-theme="light"] .dash-map-detail b { color: #142729; }
html[data-theme="light"] .dash-map-loading { color: #6c8382; }
html[data-theme="light"] .dash-region-ranking {
  border-left-color: #dce7e8;
  background: #f7faf9;
}
html[data-theme="light"] .dash-region-ranking-head small,
html[data-theme="light"] .dash-region-rank { color: #80928f; }
html[data-theme="light"] .dash-region-ranking button { color: #274542; }
html[data-theme="light"] .dash-region-ranking button:hover,
html[data-theme="light"] .dash-region-ranking button:focus-visible,
html[data-theme="light"] .dash-region-ranking button.active { background: rgba(31, 164, 150, .08); }
html[data-theme="light"] .dash-region-rank-body em { color: #617a76; }
html[data-theme="light"] .dash-region-rank-body i { background: #dce9e7; }
html[data-theme="light"] .dash-region-unlocated {
  border-color: rgba(173, 120, 30, .20);
  color: #94651d;
  background: rgba(255, 194, 86, .10);
}

/* 全国订单分布：参考能源地图看板的浅色信息栏 + 大地图构图。 */
.region-dashboard-page {
  --region-viewport-height: 100vh;
  --region-shell-offset: 120px;
  --region-board-height: max(530px, calc(var(--region-viewport-height) - var(--region-shell-offset)));
  min-height: var(--region-board-height);
}
.region-dashboard-page .dash-region-card {
  min-height: var(--region-board-height);
  border-color: #c8e1ee;
  border-radius: 8px;
  background: #e4f3fb;
  color: #10233f;
  box-shadow: 0 14px 38px rgba(44, 96, 126, .12);
}
.region-dashboard-page .dash-region-layout {
  min-height: var(--region-board-height);
}
.region-dashboard-page .dash-map-canvas { min-height: var(--region-board-height); }
@supports (height: 100dvh) {
  .region-dashboard-page { --region-viewport-height: 100dvh; }
}
.region-dashboard-page .dash-region-ranking {
  border-right-color: #c7dfec;
  background: #eef8fe;
}
.region-dashboard-page .dash-region-kicker {
  color: #5f84a5;
  letter-spacing: .16em;
}
.region-dashboard-page .dash-region-brand h2 { color: #0d2040; }
.region-dashboard-page .dash-region-brand p { color: #7890a6; }
.region-dashboard-page .dash-region-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 24px;
}
.region-dashboard-page .dash-region-summary > div {
  min-width: 0;
  padding: 0 8px 16px 0;
  border: 0;
  border-bottom: 1px solid #d4e7f1;
}
.region-dashboard-page .dash-region-summary > div:first-child {
  grid-column: 1 / -1;
  padding-bottom: 20px;
}
.region-dashboard-page .dash-region-summary > div:nth-child(2),
.region-dashboard-page .dash-region-summary > div:nth-child(3) {
  padding-top: 16px;
}
.region-dashboard-page .dash-region-summary > div:nth-child(3) {
  padding-left: 16px;
  border-left: 1px solid #d4e7f1;
}
.region-dashboard-page .dash-region-summary span {
  margin: 0 0 7px;
  color: #7b91a6;
  font-size: 10px;
}
.region-dashboard-page .dash-region-summary b {
  color: #0b2143;
  font-size: 26px;
  font-weight: 500;
}
.region-dashboard-page .dash-region-summary > div:first-child b { font-size: 36px; }
.region-dashboard-page .dash-region-ranking-head {
  color: #183654;
}
.region-dashboard-page .dash-region-ranking-head small,
.region-dashboard-page .dash-region-rank,
.region-dashboard-page .dash-region-updated { color: #7d96aa; }
.region-dashboard-page .dash-region-ranking button { color: #264767; }
.region-dashboard-page .dash-region-ranking button:hover,
.region-dashboard-page .dash-region-ranking button:focus-visible,
.region-dashboard-page .dash-region-ranking button.active { background: rgba(80, 135, 177, .10); }
.region-dashboard-page .dash-region-rank-body em { color: #557490; }
.region-dashboard-page .dash-region-rank-body i { background: #d6e8f1; }
.region-dashboard-page .dash-region-rank-body u { background: #4f83ad; }
.region-dashboard-page .dash-region-unlocated {
  border-color: rgba(181, 151, 79, .30);
  color: #866d32;
  background: rgba(210, 180, 106, .10);
}
.region-dashboard-page .dash-map-canvas { background: #dceff9; }
.region-dashboard-page .dash-map-canvas::after { box-shadow: inset 0 0 70px rgba(88, 151, 184, .10); }
.region-dashboard-page .dash-map-shape path {
  fill: #eef8fd;
  stroke: #9fc9df;
}
.region-dashboard-page .dash-map-point-halo {
  fill: rgba(50, 101, 148, .14);
  stroke: rgba(50, 101, 148, .28);
}
.region-dashboard-page .dash-map-point-core {
  fill: #376d9d;
  stroke: #f8fdff;
  filter: drop-shadow(0 0 4px rgba(49, 99, 145, .52));
}
.region-dashboard-page .dash-map-label {
  fill: #173856;
  stroke: #dceff9;
}
.region-dashboard-page .dash-map-point:not(.active) .dash-map-label { display: none; }
.region-dashboard-page .dash-map-detail {
  border-color: rgba(78, 128, 164, .24);
  background: rgba(244, 251, 255, .92);
  box-shadow: 0 12px 32px rgba(49, 95, 124, .14);
}
.region-dashboard-page .dash-map-detail > span,
.region-dashboard-page .dash-map-detail small { color: #70899e; }
.region-dashboard-page .dash-map-detail > strong,
.region-dashboard-page .dash-map-detail b { color: #102b49; }
.region-dashboard-page .dash-map-detail > div { color: #59758d; }
.region-dashboard-page .dash-map-zoom-controls,
.region-dashboard-page .dash-map-fullscreen {
  border-color: rgba(66, 116, 153, .24);
  color: #294e6d;
  background: rgba(244, 251, 255, .92);
  box-shadow: 0 8px 22px rgba(48, 94, 123, .10);
}
.region-dashboard-page .dash-map-zoom-controls button {
  border-right-color: rgba(66, 116, 153, .16);
  color: #294e6d;
}
.region-dashboard-page .dash-map-zoom-controls button:hover:not(:disabled),
.region-dashboard-page .dash-map-zoom-controls button:focus-visible,
.region-dashboard-page .dash-map-fullscreen:hover,
.region-dashboard-page .dash-map-fullscreen:focus-visible {
  color: #102f4d;
  background: #e7f3fa;
}
.region-dashboard-page .dash-map-zoom-controls button:disabled { color: #9cb1c0; }

/* 全国订单分布：亮色主题保持通透的浅蓝地图与白色信息栏。 */
html[data-theme="light"] .region-dashboard-page .dash-region-card {
  border-color: #c7deea;
  background: #e6f3f9;
  color: #10243d;
  box-shadow: 0 14px 38px rgba(42, 88, 114, .11);
}
html[data-theme="light"] .region-dashboard-page .dash-region-ranking {
  border-right-color: #c9dfeb;
  background: #f4fafe;
}
html[data-theme="light"] .region-dashboard-page .dash-region-kicker { color: #547f9f; }
html[data-theme="light"] .region-dashboard-page .dash-region-brand h2 { color: #0e2541; }
html[data-theme="light"] .region-dashboard-page .dash-region-brand p,
html[data-theme="light"] .region-dashboard-page .dash-region-summary span,
html[data-theme="light"] .region-dashboard-page .dash-region-ranking-head small,
html[data-theme="light"] .region-dashboard-page .dash-region-rank,
html[data-theme="light"] .region-dashboard-page .dash-region-updated { color: #718ba0; }
html[data-theme="light"] .region-dashboard-page .dash-region-summary > div { border-bottom-color: #d5e7f0; }
html[data-theme="light"] .region-dashboard-page .dash-region-summary > div:nth-child(3) { border-left-color: #d5e7f0; }
html[data-theme="light"] .region-dashboard-page .dash-region-summary b { color: #0b2341; }
html[data-theme="light"] .region-dashboard-page .dash-region-ranking-head { color: #183854; }
html[data-theme="light"] .region-dashboard-page .dash-region-ranking button { color: #244864; }
html[data-theme="light"] .region-dashboard-page .dash-region-ranking button:hover,
html[data-theme="light"] .region-dashboard-page .dash-region-ranking button:focus-visible,
html[data-theme="light"] .region-dashboard-page .dash-region-ranking button.active {
  background: rgba(66, 121, 162, .11);
}
html[data-theme="light"] .region-dashboard-page .dash-region-rank-body em { color: #54738c; }
html[data-theme="light"] .region-dashboard-page .dash-region-rank-body i { background: #d6e7ef; }
html[data-theme="light"] .region-dashboard-page .dash-region-rank-body u { background: #477da6; }
html[data-theme="light"] .region-dashboard-page .dash-map-canvas { background: #dceef7; }
html[data-theme="light"] .region-dashboard-page .dash-map-canvas::after {
  box-shadow: inset 0 0 74px rgba(74, 133, 164, .10);
}
html[data-theme="light"] .region-dashboard-page .dash-map-shape path {
  fill: #f2f9fc;
  stroke: #9fc5d8;
}
html[data-theme="light"] .region-dashboard-page .dash-map-point-halo {
  fill: rgba(47, 101, 148, .13);
  stroke: rgba(47, 101, 148, .30);
}
html[data-theme="light"] .region-dashboard-page .dash-map-point-core {
  fill: #376f9e;
  stroke: #fbfeff;
  filter: drop-shadow(0 0 4px rgba(45, 96, 141, .50));
}
html[data-theme="light"] .region-dashboard-page .dash-map-label {
  fill: #173955;
  stroke: #dceef7;
}
html[data-theme="light"] .region-dashboard-page .dash-map-detail {
  border-color: rgba(68, 119, 155, .25);
  background: rgba(249, 253, 255, .94);
  box-shadow: 0 12px 30px rgba(42, 85, 111, .13);
}
html[data-theme="light"] .region-dashboard-page .dash-map-detail > span,
html[data-theme="light"] .region-dashboard-page .dash-map-detail small { color: #6b8498; }
html[data-theme="light"] .region-dashboard-page .dash-map-detail > strong,
html[data-theme="light"] .region-dashboard-page .dash-map-detail b { color: #102c49; }
html[data-theme="light"] .region-dashboard-page .dash-map-detail > div { color: #57728a; }
html[data-theme="light"] .region-dashboard-page .dash-map-zoom-controls,
html[data-theme="light"] .region-dashboard-page .dash-map-fullscreen {
  border-color: rgba(61, 110, 145, .24);
  color: #284d6a;
  background: rgba(250, 253, 255, .94);
  box-shadow: 0 8px 22px rgba(43, 82, 107, .11);
}
html[data-theme="light"] .region-dashboard-page .dash-map-zoom-controls button {
  border-right-color: rgba(61, 110, 145, .16);
  color: #284d6a;
}
html[data-theme="light"] .region-dashboard-page .dash-map-zoom-controls button:hover:not(:disabled),
html[data-theme="light"] .region-dashboard-page .dash-map-zoom-controls button:focus-visible,
html[data-theme="light"] .region-dashboard-page .dash-map-fullscreen:hover,
html[data-theme="light"] .region-dashboard-page .dash-map-fullscreen:focus-visible {
  color: #102f4c;
  background: #e8f3f9;
}
html[data-theme="light"] .region-dashboard-page .dash-map-zoom-controls button:disabled { color: #9aafbd; }

/* 全国订单分布：暗色主题使用深海军蓝地图，强化边界、点位和浮层对比度。 */
html[data-theme="dark"] .region-dashboard-page .dash-region-card {
  border-color: #203d50;
  background: #081925;
  color: #e7f2f8;
  box-shadow: 0 18px 46px rgba(0, 8, 15, .42);
}
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking {
  border-right-color: #254354;
  background: #0c202d;
}
html[data-theme="dark"] .region-dashboard-page .dash-region-kicker { color: #79a8c4; }
html[data-theme="dark"] .region-dashboard-page .dash-region-brand h2 { color: #f1f8fc; }
html[data-theme="dark"] .region-dashboard-page .dash-region-brand p,
html[data-theme="dark"] .region-dashboard-page .dash-region-summary span,
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking-head small,
html[data-theme="dark"] .region-dashboard-page .dash-region-rank,
html[data-theme="dark"] .region-dashboard-page .dash-region-updated { color: #7894a7; }
html[data-theme="dark"] .region-dashboard-page .dash-region-summary > div { border-bottom-color: #233f50; }
html[data-theme="dark"] .region-dashboard-page .dash-region-summary > div:nth-child(3) { border-left-color: #233f50; }
html[data-theme="dark"] .region-dashboard-page .dash-region-summary b { color: #edf7fc; }
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking-head { color: #d8eaf4; }
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking button { color: #c8dce7; }
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking button:hover,
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking button:focus-visible,
html[data-theme="dark"] .region-dashboard-page .dash-region-ranking button.active {
  background: rgba(86, 145, 181, .16);
}
html[data-theme="dark"] .region-dashboard-page .dash-region-rank-body em { color: #91adbd; }
html[data-theme="dark"] .region-dashboard-page .dash-region-rank-body i { background: #1c3748; }
html[data-theme="dark"] .region-dashboard-page .dash-region-rank-body u { background: #6ca7cb; }
html[data-theme="dark"] .region-dashboard-page .dash-region-unlocated {
  border-color: rgba(214, 177, 92, .28);
  color: #d5b66f;
  background: rgba(197, 155, 63, .09);
}
html[data-theme="dark"] .region-dashboard-page .dash-map-canvas { background: #071823; }
html[data-theme="dark"] .region-dashboard-page .dash-map-canvas::after {
  box-shadow: inset 0 0 92px rgba(0, 6, 11, .54);
}
html[data-theme="dark"] .region-dashboard-page .dash-map-shape path {
  fill: #123142;
  stroke: #41677b;
}
html[data-theme="dark"] .region-dashboard-page .dash-map-point-halo {
  fill: rgba(105, 174, 216, .16);
  stroke: rgba(105, 174, 216, .42);
}
html[data-theme="dark"] .region-dashboard-page .dash-map-point-core {
  fill: #71b1d8;
  stroke: #e9f8ff;
  filter: drop-shadow(0 0 5px rgba(93, 170, 215, .68));
}
html[data-theme="dark"] .region-dashboard-page .dash-map-label {
  fill: #e5f4fb;
  stroke: #071823;
}
html[data-theme="dark"] .region-dashboard-page .dash-map-detail {
  border-color: rgba(99, 160, 196, .30);
  background: rgba(8, 28, 41, .93);
  box-shadow: 0 14px 34px rgba(0, 6, 11, .34);
}
html[data-theme="dark"] .region-dashboard-page .dash-map-detail > span,
html[data-theme="dark"] .region-dashboard-page .dash-map-detail small { color: #7898ab; }
html[data-theme="dark"] .region-dashboard-page .dash-map-detail > strong,
html[data-theme="dark"] .region-dashboard-page .dash-map-detail b { color: #f2f9fc; }
html[data-theme="dark"] .region-dashboard-page .dash-map-detail > div { color: #9ab4c3; }
html[data-theme="dark"] .region-dashboard-page .dash-map-zoom-controls,
html[data-theme="dark"] .region-dashboard-page .dash-map-fullscreen {
  border-color: rgba(100, 164, 202, .30);
  color: #d8edf8;
  background: rgba(8, 28, 41, .93);
  box-shadow: 0 10px 26px rgba(0, 7, 12, .34);
}
html[data-theme="dark"] .region-dashboard-page .dash-map-zoom-controls button {
  border-right-color: rgba(100, 164, 202, .20);
  color: #d8edf8;
}
html[data-theme="dark"] .region-dashboard-page .dash-map-zoom-controls button:hover:not(:disabled),
html[data-theme="dark"] .region-dashboard-page .dash-map-zoom-controls button:focus-visible,
html[data-theme="dark"] .region-dashboard-page .dash-map-fullscreen:hover,
html[data-theme="dark"] .region-dashboard-page .dash-map-fullscreen:focus-visible {
  color: #ffffff;
  background: #14384d;
}
html[data-theme="dark"] .region-dashboard-page .dash-map-zoom-controls button:disabled { color: #536f7f; }
html[data-theme="dark"] .region-dashboard-page:fullscreen,
html[data-theme="dark"] .region-dashboard-page:-webkit-full-screen { background: #081925; }
.region-dashboard-page:fullscreen,
.region-dashboard-page:-webkit-full-screen {
  padding: 0;
  background: #e4f3fb;
}
.region-dashboard-page:fullscreen .dash-region-card,
.region-dashboard-page:-webkit-full-screen .dash-region-card,
.region-dashboard-page:fullscreen .dash-region-layout,
.region-dashboard-page:-webkit-full-screen .dash-region-layout {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}
.dash-chart-title {
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 220px;
  padding: 8px 4px 0;
  overflow-x: auto;
}
.bar-col {
  flex: 1;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bar-track {
  width: 100%;
  max-width: 42px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--track);
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
}
.bar-fill {
  width: 100%;
  border-radius: 8px 8px 2px 2px;
  transition: height .25s ease;
}
.bar-fill.completed {
  background: linear-gradient(180deg, #6aa1ff 0%, #1f6feb 100%);
}
.bar-fill.defect {
  background: linear-gradient(180deg, #ff7875 0%, #cf1322 100%);
}
.bar-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.bar-label {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  word-break: break-all;
}

@media (max-width: 960px) {
  .dash-main-row {
    grid-template-columns: 1fr;
  }
  .dash-side-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .dash-status-card {
    flex: 1 1 140px;
    min-height: 72px;
  }
  .dash-fs-btn {
    position: static;
    transform: none;
  }
  .dash-hero {
    flex-direction: column;
    gap: 10px;
  }
  .dash-region-head { flex-direction: column; }
  .dash-region-summary { width: 100%; }
  .dash-region-summary > div { flex: 1; min-width: 0; }
  .dash-region-layout { grid-template-columns: 1fr; }
  .dash-region-ranking {
    border-top: 1px solid rgba(155, 205, 198, .13);
    border-left: 0;
  }
  .region-dashboard-page .dash-region-layout { grid-template-columns: 1fr; }
  .region-dashboard-page .dash-region-ranking {
    border-top: 0;
    border-right: 0;
    border-bottom: 1px solid #c7dfec;
  }
}

@media (max-width: 900px) {
  .dash-charts { grid-template-columns: 1fr; }
}

.dash-recent-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dash-recent-viewport {
  height: 320px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(180deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.dash-recent-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation-name: dash-recent-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.dash-recent-viewport:hover .dash-recent-track {
  animation-play-state: paused;
}
@keyframes dash-recent-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.dash-recent-item {
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  padding: 12px;
  background: var(--hover-bg);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dash-recent-item:hover {
  border-color: var(--primary);
  background: var(--ghost-bg);
}
.dash-recent-meta { margin-bottom: 10px; }
.dash-recent-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-stage-mini {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.dash-stage-chip {
  min-width: 0;
  background: var(--ghost-bg);
  border: 1px solid var(--chip-border);
  border-radius: 8px;
  padding: 6px 8px;
}
.dash-stage-chip-head {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.progress.sm { height: 6px; }
.progress > span.done { background: linear-gradient(90deg, #3f9d5f, #52c41a); }
.progress > span.doing { background: linear-gradient(90deg, #1f6feb, #6aa1ff); }
.progress > span.pending { background: var(--pending-track); }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.toolbar:has(.field) { align-items: flex-end; }
.toolbar .field { margin-bottom: 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  background: var(--ghost-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--dashed);
  font-size: 14px;
}
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table tr { cursor: pointer; }
.table tr:hover td { background: var(--hover-bg); }
.table .cell-nowrap {
  white-space: nowrap;
}
.table .product-lines {
  line-height: 1.55;
}
.table .product-lines > div + div {
  margin-top: 2px;
}
.table-actions {
  white-space: nowrap;
  width: 1%;
}
.table-actions .btn + .btn {
  margin-left: 8px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.progress {
  height: 10px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1f6feb, #6aa1ff);
  transition: width .3s ease;
}
.progress.dual {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.progress.dual > span {
  display: block;
  height: 100%;
  transition: width .3s ease;
}
.progress.dual > span.ok {
  background: linear-gradient(90deg, #3f9d5f, #52c41a);
}
.progress.dual > span.bad {
  background: linear-gradient(90deg, #d4380d, #ff4d4f);
}
.progress.lg { height: 14px; }
.qc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}
.bad-text { color: #cf1322; }
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.progress-pct {
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
}
.stage-list { display: flex; flex-direction: column; gap: 12px; }
.stage-item {
  padding: 12px;
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  background: var(--hover-bg);
}

.prod-order-list { display: flex; flex-direction: column; gap: 12px; }
.admin-user-list { display: flex; flex-direction: column; gap: 12px; }
.admin-user-list .table tr { cursor: default; }
.admin-user-list .table tr:hover td { background: transparent; }
.prod-order-group { padding: 0; overflow: hidden; }
.prod-order-body {
  border-top: 1px solid var(--dashed);
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prod-product-block {
  padding: 12px;
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  background: var(--soft-panel);
}
.prod-product-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}
.prod-order-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.prod-order-head:hover { background: var(--hover-bg); }
.prod-order-arrow {
  color: var(--muted);
  transition: transform .18s ease;
  flex-shrink: 0;
}
.prod-order-arrow.open { transform: rotate(90deg); }
.prod-order-meta { flex: 1; min-width: 0; }
.prod-order-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prod-order-overall {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.prod-stage-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--dashed);
  padding-top: 14px;
}
.prod-stage-card {
  flex: 0 0 150px;
  width: 150px;
  padding: 12px;
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  background: var(--hover-bg);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.prod-stage-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.08);
}
.prod-stage-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-stage-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.prod-stage-pct {
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
}

.chip {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip span {
  background: var(--stage-bg);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--muted);
}

.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 140px; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; }
.ok-text { color: var(--ok); }

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
  align-items: start;
}
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.material-progress-textarea {
  min-height: 150px;
  height: 150px;
  overflow-y: hidden;
  resize: none;
  line-height: 1.65;
}
.material-progress-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.material-progress-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
}
.material-progress-content {
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.material-progress-history {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.material-progress-log {
  padding: 12px 0;
  border-bottom: 1px solid var(--dashed);
}
.material-progress-log:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.material-progress-log-content {
  margin-top: 8px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.order-deadline-kv {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(212, 56, 13, 0.24);
  border-radius: 10px;
  background: rgba(212, 56, 13, 0.07);
}
.order-deadline-kv > b {
  margin-right: 0;
}
.order-deadline-date {
  color: var(--danger);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.order-deadline-countdown {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 56, 13, 0.12);
  color: #ad2102;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.order-deadline-countdown.is-today,
.order-deadline-countdown.is-overdue {
  background: rgba(207, 19, 34, 0.14);
  color: var(--danger);
}

.production-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
}

.production-action-card {
  border-color: rgba(31, 111, 235, 0.22);
}

.production-action-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.production-action-card-head > div > div {
  font-size: 18px;
  font-weight: 700;
}

.production-action-card-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.production-action-form {
  min-width: 0;
}

.shipping-source-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.shipping-source-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft-panel);
}
.shipping-source-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 13px;
}
.shipping-source-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}
.shipping-report-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.shipping-report-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr);
  align-items: end;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft-panel);
}
.shipping-report-line-meta {
  align-self: center;
}
.shipping-report-line-meta strong,
.shipping-report-line-meta span {
  display: block;
}
.shipping-report-line-meta span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.shipping-report-line .field { margin-bottom: 0; }

@media (max-width: 560px) {
  .shipping-source-summary { grid-template-columns: 1fr; }
  .shipping-report-line { grid-template-columns: 1fr; }
}

.kv { margin: 8px 0; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 500; margin-right: 8px; }

.edit-log-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--dashed);
}
.edit-log-item:last-child { border-bottom: none; }

.list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--dashed);
}

@media (max-width: 900px) {
  .shell,
  .shell.sider-collapsed {
    grid-template-columns: 1fr;
  }

  /* 窄屏：全宽横向导航，Logo 移到顶栏 */
  .sider {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    max-height: none;
    overflow: hidden;
  }
  .topbar {
    /* 贴在横向导航下方，避免叠在导航上 */
    top: 48px;
    z-index: 45;
  }
  .sider-top {
    display: none;
  }
  .sider-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 6px 8px;
    scrollbar-width: none;
  }
  .sider-nav::-webkit-scrollbar {
    display: none;
  }
  .notification-dock {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 80;
    margin: 0;
  }
  .notification-button,
  .shell.sider-collapsed .notification-button {
    width: auto;
    min-width: 52px;
    min-height: 44px;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: #132238;
    box-shadow: 0 8px 24px rgba(0,0,0,.24);
  }
  .notification-panel,
  .shell.sider-collapsed .notification-panel {
    left: 12px;
    right: 12px;
    bottom: 68px;
    width: auto;
    max-height: min(560px, calc(100vh - 96px));
  }
  .nav-item {
    flex: 0 0 auto;
    padding: 8px 14px;
    margin: 0 2px;
    white-space: nowrap;
    text-align: center;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 999px;
    overflow: visible;
    text-overflow: unset;
  }
  .nav-item.active {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 600;
  }
  .nav-group {
    display: flex;
    flex-direction: row;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    margin: 0 2px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .nav-group.open > .nav-group-trigger,
  .nav-group.open > .nav-group-trigger.active {
    background: rgba(255, 255, 255, .16);
  }
  .nav-group-trigger {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 999px;
  }
  .nav-chevron {
    margin-left: 5px;
  }
  .nav-submenu {
    flex-direction: row;
    gap: 0;
    margin-left: 0;
    padding: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
  }
  .nav-subitem::before {
    display: none;
  }
  .shell.sider-collapsed .nav-item {
    text-align: center;
    padding: 8px 14px;
    font-size: 14px;
  }
  .shell.sider-collapsed .nav-text {
    display: inline;
    max-width: none;
    overflow: visible;
  }
  .topbar-brand {
    display: block;
  }
  .topbar-role {
    font-size: 12px;
    color: var(--muted);
  }
  .ai-search-trigger { width: 150px; }
  .ai-search-trigger kbd { display: none; }

  .detail-grid { grid-template-columns: 1fr; }
  .material-progress-columns { grid-template-columns: 1fr; }
  .customer-form-grid { grid-template-columns: 1fr; }
  .region-cascader-panel {
    min-width: 0;
    max-height: 410px;
  }
  .region-cascader-columns { grid-template-columns: 1fr; }
  .region-col {
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--dashed);
  }
  .region-col:last-child { border-bottom: none; }
}

@media (max-width: 720px) {
  .content {
    padding: 12px 12px 28px;
  }
  .dash-region-head {
    gap: 16px;
    padding: 19px 16px 14px;
  }
  .dash-region-head h2 { font-size: 20px; }
  .dash-region-head p { line-height: 1.6; }
  .dash-region-summary {
    flex-wrap: wrap;
    gap: 0;
  }
  .dash-region-summary > div {
    flex: 1 1 33.333%;
    min-width: 88px;
    padding: 8px 10px;
  }
  .dash-region-summary b { font-size: 21px; }
  .dash-region-layout { min-height: 0; }
  .dash-map-canvas {
    min-height: 370px;
    padding: 5px 2px 3px;
  }
  .dash-map-canvas svg { min-height: 360px; }
  .dash-map-zoom-controls {
    top: 54px;
    right: 10px;
  }
  .dash-map-fullscreen {
    top: 10px;
    right: 10px;
    min-width: 112px;
    height: 34px;
  }
  .dash-map-zoom-controls button {
    width: 34px;
    height: 34px;
  }
  .dash-map-zoom-controls .dash-map-zoom-reset { width: 52px; }
  .dash-map-label { font-size: 9px; }
  .dash-map-point:not(.active) .dash-map-label { display: none; }
  .dash-map-point.active .dash-map-label { font-size: 11px; }
  .dash-map-detail {
    left: 12px;
    bottom: 11px;
    min-width: 190px;
    padding: 11px 12px;
  }
  .dash-region-ranking { padding: 17px 12px; }
  .dash-region-ranking button { padding-left: 5px; padding-right: 5px; }
  .region-admin-form { grid-template-columns: 1fr; }
  .region-admin-title { flex-direction: column; }
  .region-admin-tools {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .topbar {
    height: auto;
    min-height: 52px;
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  .topbar-role {
    font-size: 13px;
    max-width: 100%;
  }
  .theme-toggle {
    min-width: 40px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .theme-toggle-text {
    display: none;
  }
  .ai-search-trigger {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .ai-search-label { display: none; }
  .ai-assistant-backdrop { padding: 0; place-items: stretch; }
  .ai-assistant-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
  .ai-assistant-head { min-height: 62px; padding: 10px 12px; }
  .ai-assistant-title-wrap p {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ai-message-list { padding: 17px 12px; }
  .ai-welcome { margin: 16px auto; }
  .ai-suggestions { grid-template-columns: 1fr; gap: 7px; margin-top: 17px; }
  .ai-suggestions button { min-height: 48px; }
  .ai-message { max-width: 96%; }
  .ai-message.is-assistant { max-width: 100%; }
  .ai-table-scroll table { min-width: 440px; }
  .ai-table-scroll th,
  .ai-table-scroll td { padding: 8px 9px; }
  .ai-composer { padding: 10px 12px 9px; }
  .page-title {
    font-size: 18px;
    margin-bottom: 10px;
  }
  .toolbar {
    gap: 8px;
    margin-bottom: 10px;
  }
  .toolbar .field.grow {
    flex: 1 1 100%;
    min-width: 0;
  }
  .grow {
    min-width: 0;
  }
  .toolbar .btn,
  .toolbar .btn.ghost {
    flex: 0 0 auto;
  }
  .card {
    padding: 12px;
    border-radius: 12px;
  }
  .stat-value {
    font-size: 24px;
  }
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }
  /* 表格横向滚动，避免挤乱列 */
  .card:has(> .table),
  .card:has(> table.table),
  .prod-order-body:has(.table),
  .admin-user-list .prod-order-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    min-width: 620px;
  }
  .table th, .table td {
    padding: 10px 8px;
    font-size: 13px;
  }
  .table-actions {
    white-space: nowrap;
  }
  .cell-nowrap {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .login-page {
    padding: 16px;
  }
  .login-card {
    padding: 24px 18px;
    border-radius: 14px;
  }
  .login-brand {
    font-size: 24px;
  }
  .login-theme-toggle {
    top: 10px;
    right: 10px;
  }
  .dash-stage-mini {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dash-recent-viewport {
    height: 300px;
  }
  .dash-hero-title {
    font-size: clamp(22px, 6vw, 30px);
    letter-spacing: 0.03em;
  }
  .bar-chart {
    min-height: 180px;
    gap: 8px;
  }
  .bar-track {
    height: 120px;
    max-width: 36px;
  }
  .bar-col {
    min-width: 48px;
  }
  .prod-order-head {
    flex-wrap: wrap;
    padding: 12px;
  }
  .prod-order-overall {
    width: 100%;
    padding-left: 22px;
  }
  .prod-order-overall .progress {
    flex: 1;
    width: auto !important;
  }
  .prod-stage-row {
    padding-left: 12px;
    padding-right: 12px;
  }
  .prod-stage-card {
    flex: 0 0 132px;
    width: 132px;
  }
  .multi-item .row {
    flex-direction: column;
    align-items: stretch;
  }
  .multi-item .row .field {
    width: 100% !important;
  }
  .assign-groups {
    gap: 6px;
  }
  .assign-chip > span {
    padding: 6px 10px;
    font-size: 12px;
  }
  .pdf-viewer-overlay {
    padding: 0;
    align-items: stretch;
  }
  .pdf-viewer-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .admin-stat-row {
    grid-template-columns: 72px 1fr 36px;
    gap: 8px;
  }
  .kv {
    font-size: 13px;
    word-break: break-word;
  }
  .tabs {
    width: 100%;
  }
  .tab {
    flex: 1 1 auto;
    text-align: center;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 10px 8px 24px;
  }
  .topbar-user {
    display: none;
  }
  .sider .logo {
    font-size: 13px;
  }
  .nav-item {
    padding: 7px 10px;
    font-size: 13px;
  }
  .table {
    min-width: 540px;
  }
  .dash-stage-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .btn {
    padding: 8px 12px;
  }
  .btn.sm {
    padding: 4px 8px;
    font-size: 12px;
  }
  .field input,
  .field textarea,
  .field select {
    font-size: 16px; /* 避免 iOS 聚焦缩放 */
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  justify-content: center;
}
.theme-toggle .theme-icon {
  font-size: 14px;
  line-height: 1;
}

.admin-stat-row {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.region-admin-summary {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-bottom: 14px;
}
.region-type-summary { position: relative; overflow: hidden; }
.region-type-summary::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}
.region-type-summary.ftu::after { background: #2479c9; }
.region-type-summary.dtu::after { background: #d88316; }
.region-type-summary-detail {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.region-admin-table-card {
  margin-bottom: 14px;
}
.region-admin-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.region-admin-title strong,
.region-admin-title span {
  display: block;
}
.region-admin-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.region-admin-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.region-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.region-admin-message { margin-top: 10px; font-size: 13px; }
.region-admin-table-card { overflow-x: auto; }
.region-device-tree {
  width: 100%;
  min-width: 0;
  max-height: 68vh;
  overflow: auto;
}
.region-tree-head,
.region-tree-row {
  display: grid;
  min-width: 880px;
  grid-template-columns: minmax(190px, 1.45fr) repeat(8, minmax(70px, .56fr));
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.region-tree-head {
  position: sticky;
  z-index: 3;
  top: 0;
  min-height: 38px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.region-tree-row > *:not(:first-child) { text-align: right; }
.region-tree-head > :first-child,
.region-tree-row > :first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  background: var(--card);
}
.region-tree-head > :last-child,
.region-tree-row > :last-child {
  position: sticky;
  z-index: 2;
  right: 0;
  background: var(--card);
  box-shadow: -8px 0 12px rgba(15, 23, 42, .04);
}
.region-tree-row.level-province { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.region-tree-row.level-city { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.region-tree-row.level-province > :first-child,
.region-tree-row.level-province > :last-child { background: color-mix(in srgb, var(--primary) 8%, var(--card)); }
.region-tree-row.level-city > :first-child,
.region-tree-row.level-city > :last-child { background: color-mix(in srgb, var(--primary) 3%, var(--card)); }
.region-tree-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.level-city .region-tree-toggle { padding-left: 22px; font-weight: 600; }
.region-tree-district { padding-left: 58px; }
.region-tree-arrow { color: var(--muted); transition: transform .16s ease; }
.region-tree-arrow.open { transform: rotate(90deg); }
.region-ftu-value { color: #2479c9; }
.region-dtu-value { color: #d88316; }
.region-base-input {
  width: 100%;
  min-width: 70px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}
.region-base-input:focus {
  outline: none;
  border-color: var(--primary);
}
.region-base-input:disabled { opacity: .55; cursor: not-allowed; }
.region-missing {
  color: var(--danger);
  font-size: 12px;
}

/* 地图下钻与设备类型图例 */
.region-dashboard-page {
  --map-ftu: #3d91cf;
  --map-dtu: #dc8a25;
  --map-other: #8296a8;
  --map-office: #786bc4;
  --map-headquarters: #1e4e78;
  container: region-dashboard / inline-size;
}
.dash-map-scope {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  width: 250px;
}
.dash-map-scope button,
.dash-map-scope select {
  height: 34px;
  border: 1px solid rgba(104, 151, 180, .28);
  border-radius: 8px;
  color: inherit;
  background: rgba(244, 251, 255, .92);
  box-shadow: 0 8px 22px rgba(48, 94, 123, .10);
  font: inherit;
  font-size: 12px;
}
.dash-map-scope button { cursor: pointer; }
.dash-map-scope button.active {
  border-color: var(--map-ftu);
  color: var(--map-ftu);
  background: color-mix(in srgb, var(--map-ftu) 12%, transparent);
}
.dash-map-scope select { min-width: 0; padding: 0 30px 0 10px; }
.region-dashboard-page .dash-map-fullscreen { top: 18px; }
.region-dashboard-page .dash-map-zoom-controls { top: 62px; }
.dash-map-shape path.actionable { cursor: pointer; }
.dash-map-shape path.actionable:hover {
  fill: color-mix(in srgb, var(--map-ftu) 20%, #eef8fd);
  stroke: var(--map-ftu);
}
.dash-map-shape.province-view path { stroke-width: 1.25; }
.dash-map-area-label {
  fill: #6f8da2;
  stroke: rgba(238, 248, 253, .42);
  stroke-width: 1.2px;
  paint-order: stroke;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .68;
  pointer-events: none;
}
.region-dashboard-page .dash-map-point.type-ftu .dash-map-point-core { fill: var(--map-ftu); }
.region-dashboard-page .dash-map-point.type-ftu .dash-map-point-halo { fill: color-mix(in srgb, var(--map-ftu) 22%, transparent); stroke: var(--map-ftu); }
.region-dashboard-page .dash-map-point.type-dtu .dash-map-point-core { fill: var(--map-dtu); }
.region-dashboard-page .dash-map-point.type-dtu .dash-map-point-halo { fill: color-mix(in srgb, var(--map-dtu) 22%, transparent); stroke: var(--map-dtu); }
.region-dashboard-page .dash-map-point.type-other .dash-map-point-core { fill: var(--map-other); }
.region-dashboard-page .dash-map-point.type-other .dash-map-point-halo { fill: color-mix(in srgb, var(--map-other) 22%, transparent); stroke: var(--map-other); }
.region-dashboard-page .dash-map-point.active .dash-map-point-core { stroke-width: 2; }
.dash-map-filter-enter-active,
.dash-map-filter-leave-active {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .30s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
}
.dash-map-filter-leave-active { pointer-events: none; }
.dash-map-filter-enter-from,
.dash-map-filter-leave-to {
  opacity: 0;
  transform: scale(.68);
}
.dash-map-scope-transition-enter-active,
.dash-map-scope-transition-leave-active {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .46s ease, transform .52s cubic-bezier(.22, 1, .36, 1);
}
.dash-map-scope-transition-leave-active { pointer-events: none; }
.dash-map-scope-transition-enter-from {
  opacity: 0;
  transform: scale(.84);
}
.dash-map-scope-transition-leave-to {
  opacity: 0;
  transform: scale(1.10);
}
.dash-map-landmark { pointer-events: none; }
.dash-map-landmark-halo {
  fill: color-mix(in srgb, var(--map-office) 16%, transparent);
  stroke: color-mix(in srgb, var(--map-office) 46%, transparent);
  stroke-width: 1;
}
.dash-map-landmark-core {
  fill: var(--map-office);
  stroke: #f8f7ff;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--map-office) 48%, transparent));
}
.dash-map-landmark.type-headquarters .dash-map-landmark-halo {
  fill: color-mix(in srgb, var(--map-headquarters) 20%, transparent);
  stroke: color-mix(in srgb, var(--map-headquarters) 68%, transparent);
  stroke-width: 1.5;
}
.dash-map-landmark.type-headquarters .dash-map-landmark-core {
  fill: var(--map-headquarters);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--map-headquarters) 62%, transparent));
}
.dash-map-landmark.type-headquarters .dash-map-landmark-label { fill: var(--map-headquarters); }
.dash-map-landmark-center { fill: #fff; }
.dash-map-landmark-label {
  fill: #594b99;
  stroke: rgba(244, 251, 255, .94);
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.dash-map-legend {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 22px;
  display: flex;
  gap: 3px;
  padding: 5px 7px;
  border: 1px solid rgba(78, 128, 164, .24);
  border-radius: 9px;
  color: #56748b;
  background: rgba(244, 251, 255, .90);
  font-size: 11px;
  backdrop-filter: blur(10px);
}
.dash-map-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  opacity: .58;
  transition: opacity .16s ease, color .16s ease, background .16s ease, border-color .16s ease;
}
.dash-map-legend button:hover,
.dash-map-legend button:focus-visible { opacity: .88; background: color-mix(in srgb, var(--map-ftu) 8%, transparent); }
.dash-map-legend button.active {
  border-color: color-mix(in srgb, var(--map-ftu) 26%, transparent);
  color: var(--text);
  background: color-mix(in srgb, var(--map-ftu) 13%, transparent);
  opacity: 1;
}
.dash-map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.dash-map-legend i.ftu { background: var(--map-ftu); }
.dash-map-legend i.dtu { background: var(--map-dtu); }
.dash-map-legend i.other { background: var(--map-other); }
.dash-map-legend i.office { background: var(--map-office); }
.dash-map-legend i.headquarters {
  width: 10px;
  height: 10px;
  border: 2px solid color-mix(in srgb, var(--map-headquarters) 32%, #fff);
  background: var(--map-headquarters);
}
.dash-map-status {
  position: absolute;
  z-index: 5;
  top: 62px;
  left: 18px;
  padding: 8px 11px;
  border-radius: 8px;
  color: #355a76;
  background: rgba(244, 251, 255, .92);
  font-size: 11px;
}
.dash-map-status.error { color: var(--danger); }
html[data-theme="dark"] .region-dashboard-page {
  --map-ftu: #66b9ed;
  --map-dtu: #f2a747;
  --map-other: #95a7b5;
  --map-office: #9f91e8;
  --map-headquarters: #4f85b4;
}
html[data-theme="dark"] .dash-map-scope button,
html[data-theme="dark"] .dash-map-scope select {
  border-color: rgba(105, 174, 216, .28);
  background-color: rgba(8, 28, 41, .92);
  box-shadow: 0 10px 26px rgba(0, 7, 12, .26);
}
html[data-theme="dark"] .dash-map-shape path.actionable:hover { fill: #1a465e; }
html[data-theme="dark"] .dash-map-area-label {
  fill: #7290a1;
  stroke: rgba(7, 24, 35, .38);
  opacity: .7;
}
html[data-theme="dark"] .dash-map-landmark-label {
  fill: #beb4fa;
  stroke: rgba(7, 24, 35, .94);
}
html[data-theme="dark"] .dash-map-legend,
html[data-theme="dark"] .dash-map-status {
  border-color: rgba(100, 164, 202, .30);
  color: #bdd5e2;
  background: rgba(8, 28, 41, .92);
}

@media (prefers-reduced-motion: reduce) {
  .dash-map-filter-enter-active,
  .dash-map-filter-leave-active,
  .dash-map-scope-transition-enter-active,
  .dash-map-scope-transition-leave-active { transition-duration: .01ms; }
}

@media (max-width: 720px) {
  .dash-map-scope {
    top: 10px;
    left: 10px;
    grid-template-columns: 56px minmax(0, 1fr);
    width: 210px;
  }
  .region-dashboard-page .dash-map-fullscreen { top: 54px; }
  .region-dashboard-page .dash-map-zoom-controls { top: 98px; }
}

/* 配电设备网络：窄屏下地图优先，排行使用横向卡片，浮层工具分区排列。 */
@media (max-width: 960px) {
  .region-dashboard-page {
    --region-shell-offset: 128px;
    --region-map-height: max(440px, calc(var(--region-viewport-height) - var(--region-shell-offset)));
  }
  .region-dashboard-page,
  .region-dashboard-page .dash-region-card,
  .region-dashboard-page .dash-region-layout {
    min-height: 0;
  }
  .region-dashboard-page .dash-region-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .region-dashboard-page .dash-map-canvas {
    grid-row: 1;
    height: var(--region-map-height);
    min-height: var(--region-map-height);
  }
  .region-dashboard-page .dash-region-ranking {
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(320px, 1.4fr);
    gap: 16px 22px;
    padding: 18px;
  }
  .region-dashboard-page .dash-region-brand { margin: 0; }
  .region-dashboard-page .dash-region-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-self: center;
    margin: 0;
  }
  .region-dashboard-page .dash-region-summary > div,
  .region-dashboard-page .dash-region-summary > div:first-child,
  .region-dashboard-page .dash-region-summary > div:nth-child(2),
  .region-dashboard-page .dash-region-summary > div:nth-child(3) {
    grid-column: auto;
    padding: 10px 14px;
    border: 0;
    border-left: 1px solid #d4e7f1;
  }
  .region-dashboard-page .dash-region-summary > div:first-child { border-left: 0; }
  .region-dashboard-page .dash-region-summary > div:first-child b { font-size: 26px; }
  .region-dashboard-page .dash-region-ranking-head,
  .region-dashboard-page .dash-region-ranking-list,
  .region-dashboard-page .dash-region-unlocated,
  .region-dashboard-page .dash-region-updated {
    grid-column: 1 / -1;
  }
  .region-dashboard-page .dash-region-ranking-head { margin: 2px 0 -4px; }
  .region-dashboard-page .dash-region-ranking-list {
    display: grid;
    grid-auto-columns: minmax(180px, 240px);
    grid-auto-flow: column;
    gap: 8px;
    padding: 1px 0 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
  }
  .region-dashboard-page .dash-region-ranking-list button {
    scroll-snap-align: start;
    border: 1px solid color-mix(in srgb, #7fa8be 22%, transparent);
    background: color-mix(in srgb, #ffffff 38%, transparent);
  }
  .region-dashboard-page .dash-region-updated {
    margin-top: 0;
    padding: 0 2px;
  }
}

/* 侧栏展开时，平板横屏的页面可用宽度会明显小于视口宽度。
   按看板容器而不是整机视口切换布局，避免地图、图例和详情卡互相挤压。 */
@container region-dashboard (max-width: 900px) {
  .region-dashboard-page .dash-region-card,
  .region-dashboard-page .dash-region-layout {
    min-height: 0;
  }
  .region-dashboard-page .dash-region-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .region-dashboard-page .dash-map-canvas {
    grid-row: 1;
    height: var(--region-map-height, max(440px, calc(var(--region-viewport-height) - var(--region-shell-offset))));
    min-height: var(--region-map-height, max(440px, calc(var(--region-viewport-height) - var(--region-shell-offset))));
  }
  .region-dashboard-page .dash-region-ranking {
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(320px, 1.4fr);
    gap: 16px 22px;
    padding: 18px;
    border: 0;
  }
  .region-dashboard-page .dash-region-brand { margin: 0; }
  .region-dashboard-page .dash-region-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-self: center;
    margin: 0;
  }
  .region-dashboard-page .dash-region-summary > div,
  .region-dashboard-page .dash-region-summary > div:first-child,
  .region-dashboard-page .dash-region-summary > div:nth-child(2),
  .region-dashboard-page .dash-region-summary > div:nth-child(3) {
    grid-column: auto;
    padding: 10px 14px;
    border: 0;
    border-left: 1px solid #d4e7f1;
  }
  .region-dashboard-page .dash-region-summary > div:first-child { border-left: 0; }
  .region-dashboard-page .dash-region-summary > div:first-child b { font-size: 26px; }
  .region-dashboard-page .dash-region-ranking-head,
  .region-dashboard-page .dash-region-ranking-list,
  .region-dashboard-page .dash-region-unlocated,
  .region-dashboard-page .dash-region-updated {
    grid-column: 1 / -1;
  }
  .region-dashboard-page .dash-region-ranking-head { margin: 2px 0 -4px; }
  .region-dashboard-page .dash-region-ranking-list {
    display: grid;
    grid-auto-columns: minmax(180px, 240px);
    grid-auto-flow: column;
    gap: 8px;
    padding: 1px 0 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
  }
  .region-dashboard-page .dash-region-ranking-list button {
    scroll-snap-align: start;
    border: 1px solid color-mix(in srgb, #7fa8be 22%, transparent);
    background: color-mix(in srgb, #ffffff 38%, transparent);
  }
  .region-dashboard-page .dash-region-updated {
    margin-top: 0;
    padding: 0 2px;
  }
}

@media (max-width: 720px) {
  .region-dashboard-page {
    --region-shell-offset: 132px;
    --region-map-height: max(510px, calc(var(--region-viewport-height) - var(--region-shell-offset)));
  }
  .region-dashboard-page .dash-region-card {
    padding: 0;
    border-radius: 10px;
  }
  .region-dashboard-page .dash-map-canvas {
    height: var(--region-map-height);
    min-height: var(--region-map-height);
    padding: 134px 8px 118px;
  }
  .region-dashboard-page .dash-map-canvas svg {
    min-height: 250px;
  }
  .region-dashboard-page .dash-map-scope {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }
  .region-dashboard-page .dash-map-fullscreen {
    top: 54px;
    right: auto;
    left: 10px;
    min-width: 108px;
  }
  .region-dashboard-page .dash-map-zoom-controls {
    top: 54px;
    right: 10px;
  }
  .region-dashboard-page .dash-map-legend {
    top: 98px;
    right: 10px;
    bottom: auto;
    left: 10px;
    max-width: none;
    padding: 4px 5px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .region-dashboard-page .dash-map-legend::-webkit-scrollbar { display: none; }
  .region-dashboard-page .dash-map-legend button { flex: 0 0 auto; }
  .region-dashboard-page .dash-map-detail {
    right: 10px;
    bottom: 10px;
    left: 10px;
    min-width: 0;
    padding: 10px 12px;
  }
  .region-dashboard-page .dash-map-area-label { font-size: 9px; }
  .region-dashboard-page .dash-map-landmark-label { font-size: 9px; }
  .region-dashboard-page .dash-region-ranking {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 17px 14px;
  }
  .region-dashboard-page .dash-region-brand h2 { font-size: 21px; }
  .region-dashboard-page .dash-region-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 7px 0;
    border: 1px solid color-mix(in srgb, #7fa8be 24%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, #ffffff 34%, transparent);
  }
  .region-dashboard-page .dash-region-summary > div,
  .region-dashboard-page .dash-region-summary > div:first-child,
  .region-dashboard-page .dash-region-summary > div:nth-child(2),
  .region-dashboard-page .dash-region-summary > div:nth-child(3) {
    padding: 7px 9px;
  }
  .region-dashboard-page .dash-region-summary b,
  .region-dashboard-page .dash-region-summary > div:first-child b { font-size: 21px; }
  .region-dashboard-page .dash-region-summary span { margin-bottom: 5px; font-size: 9px; }
  .region-dashboard-page .dash-region-ranking-list {
    grid-auto-columns: minmax(168px, 72vw);
  }
}

@media (max-width: 960px) and (max-height: 560px) {
  .region-dashboard-page { --region-map-height: 440px; }
  .region-dashboard-page .dash-map-canvas {
    height: var(--region-map-height);
    min-height: var(--region-map-height);
  }
  .region-dashboard-page .dash-map-canvas svg {
    height: 410px;
    min-height: 410px;
  }
}

@media (max-width: 420px) {
  .region-dashboard-page {
    --region-map-height: max(530px, calc(var(--region-viewport-height) - var(--region-shell-offset)));
  }
  .region-dashboard-page .dash-map-canvas {
    height: var(--region-map-height);
    min-height: var(--region-map-height);
    padding-bottom: 134px;
  }
  .region-dashboard-page .dash-map-fullscreen { min-width: 102px; padding: 0 12px; font-size: 11px; }
  .region-dashboard-page .dash-map-detail > div { flex-wrap: wrap; }
  .region-dashboard-page .dash-map-detail > div small {
    width: 100%;
    margin: 3px 0 0;
  }
}

@media (max-width: 980px) {
  .region-admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.admin-stat-label {
  font-size: 13px;
  color: var(--muted);
}
.admin-stat-value {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pdf-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 96px;
  padding: 0;
  border: 1px solid var(--border, #dbe2ea);
  border-radius: 8px;
  background: var(--card, #fff);
  overflow: hidden;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.pdf-thumb.compact {
  width: 44px;
  height: 58px;
  border-radius: 6px;
}
.pdf-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.pdf-thumb-placeholder {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #8c8c8c);
  letter-spacing: 0.04em;
}
.pdf-thumb.failed .pdf-thumb-placeholder {
  color: #1f6feb;
}
.pdf-thumb:hover {
  border-color: #1f6feb;
}

.pdf-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pdf-viewer-panel {
  width: min(960px, 100%);
  height: min(90vh, 900px);
  background: var(--card, #fff);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
}
.pdf-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #edf1f5);
}
.pdf-viewer-body {
  flex: 1;
  min-height: 0;
  background: #525659;
}
.pdf-viewer-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}
.pdf-viewer-status {
  padding: 48px 20px;
  text-align: center;
  background: var(--card, #fff);
  height: 100%;
}

.qc-photo-field {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--soft-panel);
}
.qc-photo-label {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.qc-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-upload-btn {
  position: relative;
  cursor: pointer;
}
.photo-upload-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.qc-photo-preview-list,
.qc-photo-records {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.qc-photo-preview {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--input-bg);
}
.qc-photo-preview img,
.quality-photo-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.qc-photo-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .68);
  cursor: pointer;
  line-height: 24px;
}
.quality-photo-thumb {
  width: 88px;
  height: 88px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: var(--input-bg);
  cursor: pointer;
  font-size: 12px;
}
.quality-photo-thumb:hover {
  border-color: var(--primary);
}
.quality-photo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .72);
}
.quality-photo-viewer {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
}
.quality-photo-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.quality-photo-viewer-body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
  text-align: center;
  background: #111827;
}
.quality-photo-viewer-body img {
  max-width: 100%;
  max-height: calc(92vh - 82px);
  object-fit: contain;
}

.assign-inline {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--dashed);
}
.assign-inline-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.assign-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assign-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.assign-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.assign-chip > span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.assign-chip.active > span {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
}
.assign-chip.disabled {
  cursor: not-allowed;
  opacity: .6;
}

/* 生产计划 */
.plan-title-row,
.plan-section-head,
.plan-card-head,
.plan-card-foot,
.plan-log-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.plan-title-row { margin-bottom: 16px; }
.plan-risk-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.plan-risk-button.active {
  border-color: rgba(212, 56, 13, .42);
  color: var(--danger);
  background: rgba(212, 56, 13, .06);
}
.plan-risk-button-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
  font-weight: 800;
}
.plan-risk-button:not(.active) .plan-risk-button-icon { background: var(--muted); }
.plan-risk-button-count {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  color: inherit;
  background: var(--soft-panel);
  font-size: 10px;
  font-weight: 700;
}
.plan-group-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 3px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.plan-group-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 126px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px 9px 0 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.plan-group-tab:hover { color: var(--text); background: var(--hover-bg); }
.plan-group-tab.active {
  border-color: var(--border);
  border-bottom-color: var(--panel);
  color: var(--primary);
  background: var(--panel);
  box-shadow: inset 0 3px 0 var(--primary);
}
.plan-group-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.plan-tab-count {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.plan-group-tab.active .plan-tab-count { color: var(--primary); background: var(--primary-soft); }
.plan-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.plan-summary .card { padding: 13px 15px; }
.plan-summary .stat-value { font-size: 24px; }
.plan-stat-warning { border-color: rgba(212, 56, 13, .42); }
.plan-stat-warning .stat-value { color: var(--danger); }
.plan-risk-definition {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.plan-stat-warning .plan-risk-definition { color: var(--danger); }
.plan-toolbar { align-items: flex-end; }
.plan-notice {
  margin: -4px 0 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(212, 56, 13, .08);
}
.plan-success {
  color: var(--ok);
  background: rgba(56, 158, 13, .09);
  font-size: 13px;
}
.process-library-title,
.process-library-filter-head,
.process-library-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.process-library-title { margin-bottom: 14px; }
.process-library-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.process-library-summary .card { padding: 15px 17px; }
.process-library-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}
.process-library-summary strong {
  color: var(--primary);
  font-size: 25px;
}
.process-library-filter-card { margin-bottom: 14px; }
.process-library-filter-head { margin-bottom: 14px; }
.process-library-filter-head > div,
.process-library-list-head > div { min-width: 0; }
.process-library-filter-head strong,
.process-library-list-head strong { display: block; font-size: 15px; }
.process-library-filter-head .muted,
.process-library-list-head .muted { display: block; margin-top: 4px; font-size: 12px; }
.process-library-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.process-library-list-card { padding: 0; overflow: hidden; }
.process-library-list-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.process-library-list-head > span {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}
.process-library-table-scroll {
  max-height: calc(100vh - 390px);
  min-height: 220px;
  overflow: auto;
}
.process-library-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.process-library-table th,
.process-library-table td {
  padding: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.process-library-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--soft-panel);
  color: var(--muted);
  font-weight: 700;
}
.process-library-table th:last-child,
.process-library-table td:last-child { border-right: 0; }
.process-library-table tbody tr:last-child td { border-bottom: 0; }
.process-library-table tbody tr:hover { background: var(--hover-bg); }
.process-library-table td:nth-child(n + 5),
.process-library-table th:nth-child(n + 5) {
  width: 94px;
  text-align: center;
}
.process-library-table td:nth-child(4) { min-width: 220px; }
.process-library-table td strong,
.process-library-table td small {
  display: block;
  max-width: 240px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.process-library-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.process-library-table input {
  width: 74px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  text-align: right;
}
.process-library-table input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.process-library-action { width: 84px; text-align: center; }
.process-library-action .btn { min-height: 34px; padding: 6px 13px; }
.process-library-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 30px;
}
.taxonomy-group-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-category-card { padding: 14px; }
.process-taxonomy-tree { padding: 14px; }
.taxonomy-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.taxonomy-group > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 13px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.taxonomy-group > summary::-webkit-details-marker { display: none; }
.taxonomy-group > summary::before {
  content: '›';
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  transition: transform .16s ease;
}
.taxonomy-group[open] > summary::before { transform: rotate(90deg); }
.taxonomy-group > summary:hover { background: var(--hover-bg); }
.taxonomy-group > summary strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taxonomy-level-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}
.taxonomy-summary-count {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.taxonomy-inline-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}
.taxonomy-inline-actions .btn {
  min-height: 29px;
  padding: 4px 9px;
}
.taxonomy-group-children {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px 26px;
}
.taxonomy-level-2 { background: var(--soft-panel); }
.taxonomy-level-2 > summary { min-height: 42px; }
.taxonomy-level-3 { background: var(--panel); }
.taxonomy-level-3 > summary { min-height: 40px; }
.taxonomy-level-2 .taxonomy-level-badge {
  background: rgba(114, 46, 209, .11);
  color: #722ed1;
}
.taxonomy-level-3 .taxonomy-level-badge {
  background: rgba(19, 168, 168, .11);
  color: #0f8585;
}
.taxonomy-leaf-table-scroll {
  max-width: 100%;
  overflow: auto;
  border-top: 1px solid var(--border);
}
.taxonomy-product-table { margin: 0; }
.taxonomy-product-table th { background: var(--soft-panel); }
.taxonomy-empty {
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.process-library-table-scroll.taxonomy-leaf-table-scroll {
  min-height: 0;
  max-height: none;
}
.process-library-table.taxonomy-process-table { min-width: 860px; }
.taxonomy-process-table td:first-child { min-width: 220px; }
.taxonomy-process-table td:nth-child(n + 2),
.taxonomy-process-table th:nth-child(n + 2) {
  width: 94px;
  text-align: center;
}
.process-category-hours {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.process-category-hours-path {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}
.process-category-hours-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.process-category-hours-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.process-category-hours-grid input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  text-align: right;
}
.process-category-hours-grid input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.process-category-save {
  min-height: 36px;
  white-space: nowrap;
}
.plan-section-head { margin-bottom: 12px; }
.plan-section-head > .muted { font-size: 12px; }
.plan-capacity-scroll { overflow-x: auto; }
.plan-board-scroll { overflow: clip; }
.plan-capacity-grid,
.plan-board {
  display: grid;
  width: 100%;
  min-width: 0;
}
.plan-capacity-grid { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.plan-capacity-row { display: contents; }
.plan-grid-corner,
.plan-grid-day,
.plan-capacity-group,
.plan-group-label {
  background: var(--soft-panel);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.plan-grid-corner,
.plan-capacity-group,
.plan-group-label {
  display: flex;
  align-items: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
}
.plan-grid-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  font-size: 12px;
}
.plan-grid-day span { color: var(--muted); }
.plan-grid-day.today { background: var(--primary-soft); color: var(--primary); }
.plan-capacity-cell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 7px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--group-soft);
  box-shadow: inset 0 3px 0 var(--group-color);
}
.plan-capacity-cell label,
.plan-capacity-group label {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.plan-capacity-cell label span,
.plan-capacity-group label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}
.plan-capacity-cell input,
.plan-capacity-group input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 8px;
  background: var(--input-bg);
  color: var(--text);
}
.plan-capacity-cell input:focus,
.plan-capacity-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.plan-capacity-group {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  border-left: 5px solid var(--group-color);
  background: var(--group-soft);
  box-shadow: inset 0 3px 0 var(--group-color);
}
.plan-capacity-group label { width: 100%; }
.plan-capacity-group strong { font-size: 12px; }
.plan-capacity-group span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.plan-capacity-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--group-color);
}
.plan-capacity-group-title i {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--group-color);
  box-shadow: 0 0 0 3px var(--group-soft);
}
.plan-type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.plan-type-dot.dtu {
  background: #722ed1;
  box-shadow: 0 0 0 3px rgba(114, 46, 209, .12);
}
.plan-workspace {
  display: block;
  min-width: 0;
}
.plan-board-card { padding: 0; overflow: clip; }
.plan-board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}
.plan-board-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.plan-board-heading .muted { font-size: 12px; }
.plan-gantt-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}
.plan-gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.plan-gantt-legend i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  background: var(--primary-soft);
}
.plan-gantt-legend i.plan-group-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.plan-gantt-legend i.resize {
  border-width: 1px 3px;
}
.plan-gantt-legend i.overdue {
  border-color: #cf1322;
  background: rgba(207, 19, 34, .16);
}
.plan-gantt-help {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 10px;
}
.plan-gantt-help span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.plan-gantt-help i.overdue {
  display: inline-block;
  width: 16px;
  height: 7px;
  border: 1px solid #cf1322;
  border-radius: 3px;
  background: rgba(207, 19, 34, .16);
}
.plan-gantt-help i.plan-status-swatch {
  display: inline-block;
  width: 17px;
  height: 9px;
  border-radius: 3px;
  background: var(--panel);
}
.plan-gantt-help i.plan-status-swatch.status-draft { border: 2px dashed #d48806; }
.plan-gantt-help i.plan-status-swatch.status-released { border: 3px solid #22a06b; }
.plan-gantt-help i.plan-status-swatch.status-frozen { border: 3px solid #8b5cf6; }
.plan-gantt-table {
  width: 100%;
  min-width: 0;
}
.plan-gantt-head,
.plan-gantt-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(0, 6.65fr);
  min-width: 0;
}
.plan-gantt-head {
  position: sticky;
  top: 60px;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--soft-panel);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .12);
}
.plan-gantt-group-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--border);
  box-shadow: inset 4px 0 0 var(--plan-group-color, var(--primary));
}
.plan-gantt-group-cell strong {
  color: var(--plan-group-color, var(--primary));
  font-size: 13px;
}
.plan-gantt-group-cell span {
  color: var(--muted);
  font-size: 10px;
}
.plan-gantt-load-days { background: var(--panel); }
.plan-gantt-load-matrix {
  border-bottom: 6px solid var(--soft-panel);
}
.plan-gantt-load-row { background: color-mix(in srgb, var(--soft-panel) 58%, var(--panel)); }
.plan-gantt-load-day {
  position: relative;
  height: 56px;
  min-height: 56px;
  padding: 5px 5px 11px;
  overflow: hidden;
}
.plan-load-primary {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.plan-load-primary .hours {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plan-load-percent {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
}
.plan-load-percent.safe { color: #237804; }
.plan-load-percent.danger { color: var(--danger); }
.plan-load-meter {
  position: absolute;
  right: 5px;
  bottom: 4px;
  left: 5px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100, 116, 139, .16);
}
.plan-load-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .2s ease;
}
.plan-load-meter.safe i { background: #52c41a; }
.plan-load-meter.danger i { background: #cf1322; }
.plan-gantt-task-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  font-size: 13px;
}
.plan-gantt-task-head span { color: var(--muted); font-size: 11px; }
.plan-gantt-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
}
.plan-gantt-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 7px 3px;
  border-right: 1px solid var(--border);
  font-size: 11px;
}
.plan-gantt-day span { color: var(--muted); }
.plan-gantt-day small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.plan-gantt-day small.danger { color: var(--danger); font-weight: 700; }
.plan-gantt-day .plan-load-line { line-height: 1.3; }
.plan-gantt-day .plan-load-line.ftu { color: var(--primary); }
.plan-gantt-day .plan-load-line.dtu { color: #722ed1; }
.plan-gantt-day .plan-load-line.other { color: var(--muted); }
.plan-gantt-day .plan-load-line.hours { color: var(--text); font-size: 14px; font-weight: 800; }
.plan-gantt-day .plan-load-line.missing { color: #d48806; font-size: 11px; }
.plan-gantt-day .plan-load-line.overtime { color: #1677ff; font-size: 11px; }
.plan-gantt-day .plan-load-line.safe { color: #237804; }
.plan-gantt-day .plan-load-line.danger { color: var(--danger); }
.plan-gantt-day.today { color: var(--primary); background: var(--primary-soft); }
.plan-gantt-day.overloaded { background: rgba(212, 56, 13, .07); }
.plan-gantt-load-day.within-capacity {
  background: rgba(82, 196, 26, .09);
  box-shadow: inset 0 0 0 1px rgba(82, 196, 26, .08);
}
.plan-gantt-load-day.overloaded {
  background: rgba(207, 19, 34, .11);
  box-shadow: inset 0 0 0 1px rgba(207, 19, 34, .14);
}
.plan-gantt-row {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.plan-gantt-row.overdue-incomplete {
  border-bottom-color: rgba(207, 19, 34, .34);
  box-shadow: inset 4px 0 0 #cf1322;
}
.plan-gantt-row.overdue-incomplete .plan-gantt-order-cell,
.plan-gantt-row.overdue-incomplete .plan-gantt-track {
  background-color: rgba(207, 19, 34, .105);
}
.plan-gantt-row.overdue-incomplete .plan-gantt-bar {
  border-color: #cf1322;
  box-shadow: 0 0 0 2px rgba(207, 19, 34, .16), 0 4px 12px rgba(207, 19, 34, .18);
}
.plan-gantt-row:last-child { border-bottom: 0; }
.plan-gantt-order-row { min-height: 190px; }
.plan-gantt-order-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  position: relative;
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--border);
}
.plan-gantt-order-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.plan-gantt-order-main:hover,
.plan-gantt-order-main:focus-visible {
  border-color: var(--primary);
  outline: none;
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.plan-gantt-order-main strong { font-size: 14px; }
.plan-gantt-order-main span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plan-gantt-order-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plan-gantt-order-main em {
  color: var(--primary);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.plan-gantt-unscheduled,
.plan-gantt-order-warnings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.plan-gantt-unscheduled > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.plan-gantt-unscheduled-chip,
.plan-gantt-order-warnings > button {
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: grab;
}
.plan-gantt-unscheduled-chip {
  min-height: 28px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .16);
}
.plan-gantt-unscheduled-chip:hover,
.plan-gantt-unscheduled-chip:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid var(--panel);
  outline-offset: 1px;
}
.plan-gantt-order-warnings > button {
  padding: 3px 6px;
  background: var(--panel);
  font-size: 10px;
  cursor: pointer;
}
.plan-gantt-order-warnings .plan-gantt-warning {
  flex: 1 0 100%;
}
.plan-gantt-backlog-row { background: rgba(212, 136, 6, .035); }
.plan-gantt-backlog {
  min-width: 0;
  padding: 9px;
  border-right: 1px solid var(--border);
}
.plan-gantt-backlog-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}
.plan-gantt-backlog .plan-card { margin-bottom: 6px; }
.plan-gantt-backlog .plan-row-empty { min-height: 46px; }
.plan-gantt-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  position: relative;
  min-width: 0;
  min-height: 68px;
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--border) 0);
  background-size: calc(100% / 7) 100%;
}
.plan-gantt-order-track {
  grid-template-rows: repeat(5, 38px);
  min-height: 190px;
  background-image:
    linear-gradient(to right, transparent calc(100% - 1px), var(--border) 0),
    linear-gradient(to bottom, transparent calc(100% - 1px), color-mix(in srgb, var(--border) 62%, transparent) 0);
  background-size: calc(100% / 7) 100%, 100% 38px;
}
.plan-gantt-order-empty {
  align-self: center;
  justify-self: center;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  padding: 7px 10px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--muted);
  background: var(--panel);
  font-size: 10px;
}
.plan-gantt-drop-track {
  min-height: 100%;
  place-items: center;
  color: var(--muted);
  background-color: rgba(212, 136, 6, .025);
  font-size: 11px;
}
.plan-gantt-drop-track > span {
  grid-column: 1 / -1;
  padding: 7px 11px;
  border: 1px dashed rgba(212, 136, 6, .45);
  border-radius: 8px;
  background: var(--panel);
}
.plan-gantt-task-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid var(--border);
}
.plan-gantt-task-cell.selected { background: var(--primary-soft); }
.plan-gantt-task-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.plan-gantt-task-main strong,
.plan-gantt-task-main span,
.plan-gantt-task-main small {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plan-gantt-task-main strong { font-size: 11px; }
.plan-gantt-task-main span { font-size: 11px; font-weight: 600; }
.plan-gantt-task-main small { color: var(--muted); font-size: 9px; }
.plan-gantt-task-main small.plan-gantt-overdue {
  color: #cf1322;
  font-weight: 700;
}
.plan-gantt-warning {
  grid-column: 1 / -1;
  margin: 3px 0 0;
}
.plan-gantt-bar {
  display: flex;
  align-items: stretch;
  align-self: center;
  grid-row: 1;
  z-index: 2;
  min-width: 28px;
  height: 32px;
  margin: 3px 4px;
  overflow: hidden;
  border: 1px solid var(--primary);
  border-radius: 7px;
  color: #fff;
  cursor: grab;
  box-shadow: 0 4px 11px rgba(26, 35, 50, .18);
}
.plan-gantt-bar.status-draft {
  outline: 2px dashed #d48806;
  outline-offset: 1px;
  opacity: .88;
}
.plan-gantt-bar:active { cursor: grabbing; }
.plan-gantt-bar:hover,
.plan-gantt-bar.selected {
  box-shadow: 0 0 0 2px var(--primary-soft), 0 4px 12px rgba(26, 35, 50, .12);
}
.plan-gantt-bar.locked { cursor: default; }
.plan-gantt-bar.status-released {
  z-index: 3;
  outline: 3px solid #22a06b;
  outline-offset: 1px;
  box-shadow:
    0 0 0 1px var(--panel),
    0 0 0 5px rgba(34, 160, 107, .2),
    0 4px 12px rgba(20, 92, 62, .28);
}
.plan-gantt-bar.status-frozen {
  z-index: 3;
  outline: 3px solid #8b5cf6;
  outline-offset: 1px;
  box-shadow:
    0 0 0 1px var(--panel),
    0 0 0 5px rgba(139, 92, 246, .22),
    0 4px 12px rgba(76, 29, 149, .32);
}
.plan-gantt-bar.continues-before { border-left-style: dashed; border-radius: 2px 7px 7px 2px; }
.plan-gantt-bar.continues-after { border-right-style: dashed; border-radius: 7px 2px 2px 7px; }
.plan-gantt-bar-content {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 6px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 10px;
  pointer-events: none;
}
.plan-gantt-bar-content strong {
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-gantt-bar-content span { color: rgba(255,255,255,.86); font-variant-numeric: tabular-nums; }
.plan-gantt-bar-content i {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}
.plan-gantt-bar-content b { color: #fff; font-size: 9px; }
.plan-gantt-handle {
  position: relative;
  flex: 0 0 12px;
  width: 12px;
  padding: 0;
  border: 0;
  background: rgba(255,255,255,.24);
  cursor: ew-resize;
}
.plan-gantt-handle::after {
  content: '';
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: .55;
}
.plan-gantt-handle:hover,
.plan-gantt-handle:focus-visible {
  color: var(--primary);
  background: rgba(255,255,255,.42);
  outline: none;
}
.plan-gantt-empty {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.plan-group-label {
  min-height: 142px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  padding-top: 29px;
}
.plan-group-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
.plan-unscheduled-head { background: rgba(212, 136, 6, .08); }
.plan-unscheduled-cell {
  min-height: 142px;
  padding: 27px 6px 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(212, 136, 6, .035);
}
.plan-row-empty {
  display: grid;
  min-height: 88px;
  place-items: center;
  font-size: 12px;
}
.plan-day-cell {
  position: relative;
  min-height: 142px;
  padding: 27px 7px 7px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  transition: background .15s ease;
}
.plan-day-cell:hover { background: var(--hover-bg); }
.plan-day-cell.overloaded { background: rgba(212, 56, 13, .055); }
.plan-load {
  position: absolute;
  top: 5px;
  right: 7px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.plan-load.danger { color: var(--danger); font-weight: 700; }
.plan-card {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid #8c8c8c;
  border-radius: 8px;
  background: var(--ghost-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 11px;
  box-shadow: 0 3px 10px rgba(26, 35, 50, .05);
}
.plan-card:hover,
.plan-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.plan-card.status-draft { border-left-color: #d48806; }
.plan-card.status-released { border-left-color: #1677ff; }
.plan-card.status-frozen { border-left-color: #722ed1; cursor: default; }
.plan-card-head strong { font-size: 12px; }
.plan-card-product {
  margin: 5px 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
}
.plan-card-foot { margin-top: 6px; color: var(--muted); }
.plan-card-foot .tag { padding: 1px 5px; font-size: 10px; }
.plan-warning-dot {
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-weight: 700;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
}
.plan-warning-dot:hover,
.plan-warning-dot:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}
.plan-card-warning-popover {
  margin-top: 7px;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(212, 56, 13, .09);
  color: var(--danger);
  font-size: 10px;
  line-height: 1.45;
  cursor: default;
}
.plan-card-warning-popover > div + div {
  margin-top: 4px;
}
.backlog-card { padding: 7px; margin-bottom: 6px; }
.backlog-card .muted { font-size: 12px; }
.plan-card-deadline { margin-top: 7px; color: var(--muted); font-size: 11px; }
.plan-card-deadline.late { color: var(--danger); font-weight: 600; }
.plan-empty { padding: 18px 0; text-align: center; }
.plan-logs { margin-top: 14px; }
.plan-editor-overlay,
.plan-risk-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(2px);
}
.plan-risk-modal {
  display: flex;
  flex-direction: column;
  width: min(780px, 100%);
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .34);
}
.plan-risk-definition-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 16px 18px 0;
  padding: 11px 13px;
  border: 1px solid rgba(212, 56, 13, .24);
  border-radius: 9px;
  color: var(--danger);
  background: rgba(212, 56, 13, .07);
  font-size: 12px;
}
.plan-risk-definition-box strong { white-space: nowrap; }
.plan-risk-modal-body {
  min-height: 0;
  padding: 14px 18px 18px;
  overflow: auto;
}
.plan-risk-item {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.plan-risk-item + .plan-risk-item { margin-top: 10px; }
.plan-risk-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.plan-risk-item-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.plan-risk-item-head strong { flex: 0 0 auto; font-size: 13px; }
.plan-risk-item-head > div span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 600;
}
.plan-risk-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}
.plan-risk-reasons {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--dashed);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.55;
}
.plan-risk-reasons div {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.plan-risk-reasons div + div { margin-top: 5px; }
.plan-risk-reasons b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 10px;
}
.plan-risk-empty {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.plan-editor-modal {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(90vh, 760px);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .34);
}
.plan-editor-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.plan-editor-modal-head strong { font-size: 16px; }
.plan-editor-modal-head .muted { margin-top: 4px; font-size: 12px; }
.plan-editor-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--ghost-bg);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.plan-editor-close:hover,
.plan-editor-close:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}
.plan-editor-modal-body {
  min-height: 0;
  padding: 18px;
  overflow: auto;
}
.plan-editor-modal-actions {
  align-items: center;
  margin-top: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--soft-panel);
}
.plan-capacity-button {
  position: relative;
  padding-left: 32px;
}
.plan-capacity-button::before {
  position: absolute;
  left: 12px;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, #1677ff 0 20%, #722ed1 20% 40%, #13a8a8 40% 60%, #d46b08 60% 80%, #389e0d 80%);
  content: "";
}
.plan-capacity-modal {
  width: min(1280px, 100%);
  max-height: min(92vh, 860px);
}
.plan-capacity-modal-body { padding: 16px 18px 14px; }
.plan-capacity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.plan-capacity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.plan-capacity-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.plan-capacity-tip {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft-panel);
  font-size: 12px;
}
.plan-order-modal {
  width: min(1120px, 100%);
  max-height: min(92vh, 860px);
}
.plan-order-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-order-modal-body {
  display: grid;
  gap: 14px;
  background: color-mix(in srgb, var(--soft-panel) 45%, var(--panel));
}
.plan-order-loading {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}
.plan-order-section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
}
.plan-order-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.plan-order-section-title span {
  color: var(--muted);
  font-size: 12px;
}
.plan-order-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.plan-order-info-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--soft-panel);
}
.plan-order-info-grid > div.wide { grid-column: span 2; }
.plan-order-info-grid > div.plan-order-deadline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-color: rgba(212, 56, 13, .24);
  background: rgba(212, 56, 13, .07);
}
.plan-order-deadline > b { color: var(--danger); }
.plan-order-deadline .order-deadline-date { font-size: 20px; }
.plan-order-deadline .order-deadline-countdown {
  min-height: 25px;
  font-size: 12px;
}
.plan-order-info-grid b,
.plan-order-materials b {
  color: var(--muted);
  font-size: 10px;
}
.plan-order-info-grid span,
.plan-order-materials span {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}
.plan-order-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.plan-order-product-list article {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--soft-panel);
}
.plan-order-product-list article.current {
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}
.plan-order-product-list article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-order-product-list article span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}
.plan-order-product-list article small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.plan-order-task-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.plan-order-task-list article {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--task-color);
  border-radius: 9px;
  background: var(--soft-panel);
}
.plan-order-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-order-task-head strong { color: var(--task-color); font-size: 12px; }
.plan-order-task-head span { color: var(--muted); font-size: 10px; }
.plan-order-task-product {
  margin-top: 5px;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plan-order-task-progress {
  height: 6px;
  margin: 9px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}
.plan-order-task-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--task-color);
}
.plan-order-task-list article small { color: var(--muted); font-size: 10px; }
.plan-order-stage-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}
.plan-order-stage-summary > strong { margin-right: 3px; font-size: 11px; }
.plan-order-stage-summary > span {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--summary-color) 38%, var(--border));
  border-radius: 999px;
  color: var(--summary-color);
  background: color-mix(in srgb, var(--summary-color) 8%, var(--panel));
  font-size: 10px;
  font-weight: 700;
}
.plan-order-materials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.plan-order-materials > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 11px;
  border-radius: 8px;
  background: var(--soft-panel);
}
.plan-auto-modal { width: min(1040px, 100%); }
.plan-auto-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}
.plan-auto-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft-panel);
}
.plan-auto-summary span { color: var(--muted); font-size: 11px; }
.plan-auto-summary strong { font-size: 21px; }
.plan-auto-note {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
}
.plan-auto-list { display: grid; gap: 8px; }
.plan-auto-list article {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}
.plan-auto-list article.late { border-color: rgba(212, 56, 13, .42); }
.plan-auto-list article > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.plan-auto-list article > div + div {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.plan-auto-list article b {
  color: var(--primary);
  font-size: 11px;
}
.plan-auto-list article span { font-size: 12px; }
.plan-auto-skipped {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--danger);
  background: rgba(212, 56, 13, .07);
  font-size: 12px;
}
.plan-auto-skipped > div { margin-top: 5px; }
.plan-edit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}
.plan-edit-grid .field { margin-bottom: 0; }
.plan-edit-remark { grid-column: span 2; }
.plan-warning-list {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(212, 56, 13, .08);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
}
.plan-editor-actions { align-items: center; margin-top: 14px; }
.plan-log-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.plan-log-toggle span { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .plan-summary { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .plan-edit-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .plan-order-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-order-task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1179px) {
  .plan-capacity-scroll,
  .plan-board-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .plan-board-scroll { max-height: calc(100vh - 72px); }
  .plan-gantt-head { top: 0; }
  .plan-capacity-grid { min-width: 800px; }
  .plan-board { min-width: 880px; }
  .plan-gantt-table { min-width: 900px; }
}

@media (max-width: 760px) {
  .plan-title-row { align-items: flex-start; flex-direction: column; }
  .plan-title-row .row { width: 100%; }
  .plan-title-row .btn { flex: 1; }
  .plan-board-heading { align-items: flex-start; flex-direction: column; }
  .plan-gantt-legend { flex-wrap: wrap; }
  .plan-group-tab { flex: 0 0 auto; min-width: 116px; }
  .plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-edit-grid { grid-template-columns: 1fr 1fr; }
  .plan-auto-summary { grid-template-columns: 1fr 1fr; }
  .plan-order-info-grid,
  .plan-order-product-list,
  .plan-order-task-list,
  .plan-order-materials { grid-template-columns: 1fr; }
  .plan-order-info-grid > div.wide { grid-column: auto; }
  .plan-edit-remark { grid-column: span 2; }
  .plan-editor-overlay,
  .plan-risk-overlay { align-items: flex-end; padding: 8px; }
  .plan-editor-modal { max-height: calc(100dvh - 16px); }
  .plan-risk-modal { max-height: calc(100dvh - 16px); }
  .plan-risk-definition-box { align-items: flex-start; flex-direction: column; gap: 4px; margin: 12px 14px 0; }
  .plan-risk-modal-body { padding: 12px 14px 14px; }
  .plan-editor-modal-head,
  .plan-editor-modal-body,
  .plan-editor-modal-actions { padding-left: 14px; padding-right: 14px; }
  .plan-editor-actions .btn { flex: 1 1 40%; }
}

/* 报工记录 / 生产数据统计 */
.product-kind-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
}
.product-kind-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.product-kind-tab:hover { color: var(--text); background: var(--hover-bg); }
.product-kind-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.product-kind-tab b {
  min-width: 21px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--panel);
  color: inherit;
  font-size: 10px;
}
.product-kind-row-label { margin-top: 4px; font-size: 11px; }
.product-taxonomy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-taxonomy-manager { margin-bottom: 14px; }
.taxonomy-manage-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--text);
  font-size: 12px;
}
.taxonomy-manage-notice > :first-child { flex: 1; }
.product-taxonomy-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.product-taxonomy-manager-head strong { display: block; font-size: 15px; }
.product-taxonomy-manager-head .muted { display: block; margin-top: 4px; font-size: 12px; }
.product-taxonomy-editor {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
}
.product-taxonomy-editor .field { margin: 0; }
.taxonomy-editor-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 16, 32, .45);
  backdrop-filter: blur(2px);
}
.taxonomy-editor-modal {
  width: min(460px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(7, 21, 43, .24);
}
.taxonomy-editor-modal-head,
.taxonomy-editor-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.taxonomy-editor-modal-head { margin-bottom: 16px; }
.taxonomy-editor-modal-head strong { font-size: 16px; }
.taxonomy-editor-modal-actions {
  justify-content: flex-end;
  margin-top: 14px;
}
.product-taxonomy-manager-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.product-taxonomy-admin-level1 {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft-panel);
}
.product-taxonomy-admin-level1-head,
.product-taxonomy-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.product-taxonomy-admin-level1-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.product-taxonomy-admin-level1-head > div,
.product-taxonomy-admin-row > div:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}
.product-taxonomy-admin-level2-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
}
.product-taxonomy-admin-level2 {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}
.product-taxonomy-admin-row { padding: 9px 10px; }
.product-taxonomy-admin-level3-list {
  border-top: 1px solid var(--border);
  background: var(--soft-panel);
}
.product-taxonomy-admin-level3 + .product-taxonomy-admin-level3 {
  border-top: 1px dashed var(--dashed);
}
.product-taxonomy-admin-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}
.product-taxonomy-admin-actions .btn { min-height: 30px; padding: 4px 9px; }
.product-taxonomy-admin-empty { padding: 12px; text-align: center; font-size: 12px; }

.production-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.production-page-heading .page-title { margin-bottom: 4px; }
.production-page-subtitle { font-size: 13px; }
.production-result-count,
.production-range-label {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.production-filter-card,
.production-period-card,
.production-group-stat-card { margin-bottom: 16px; }
.production-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.production-filter-grid .field,
.production-period-control .field { margin-bottom: 0; }
.production-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-height);
}
.production-filter-actions .btn { min-height: var(--control-height); }
.production-records-table-card { padding: 0; overflow: hidden; }
.production-records-table-wrap { overflow-x: auto; }
.production-records-table { min-width: 1080px; }
.production-records-table th:first-child,
.production-records-table td:first-child { padding-left: 18px; }
.production-records-table th:last-child,
.production-records-table td:last-child { padding-right: 18px; }
.production-cell-sub { margin-top: 4px; font-size: 12px; }
.production-qty-cell { color: var(--primary); font-weight: 700; }
.production-quality-gap { margin-left: 9px; }
.production-remark-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.production-row-link { color: var(--primary); font-size: 12px; font-weight: 650; }
.production-records-mobile { display: none; }
.production-empty { padding: 30px 18px; text-align: center; }
.production-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.production-period-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.production-period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--soft-panel);
}
.production-period-tab {
  min-width: 88px;
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.production-period-tab:hover { color: var(--text); background: var(--hover-bg); }
.production-period-tab.active { color: #fff; background: var(--primary); }
.production-period-control {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.production-period-control .field { min-width: 190px; }
.production-period-control .btn { min-height: var(--control-height); }
.production-stat-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 2px 10px;
}
.production-stat-section-title strong { font-size: 15px; }
.production-stat-section-title span { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.production-stat-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.production-stat-summary-production { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.production-stat-summary-quality { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.production-stat-card {
  position: relative;
  min-height: 105px;
  overflow: hidden;
}
.production-stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
  opacity: .75;
}
.production-stat-card > span { display: block; color: var(--muted); font-size: 12px; }
.production-stat-card > strong { display: block; margin-top: 12px; font-size: 28px; line-height: 1; }
.production-stat-ok::before { background: var(--ok); }
.production-stat-ok > strong { color: var(--ok); }
.production-stat-bad::before { background: var(--danger); }
.production-stat-bad > strong { color: var(--danger); }
.production-stat-rate { background: linear-gradient(135deg, var(--panel), var(--primary-soft)); }
.production-group-stat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.production-group-stat-head strong { font-size: 16px; }
.production-group-stat-head .muted { margin-top: 5px; font-size: 12px; }
.production-group-stat-table-wrap { overflow-x: auto; }
.production-group-stat-table { min-width: 990px; }
.production-group-stat-table tr { cursor: default; }
.production-group-stat-table thead tr:first-child th { text-align: center; border-bottom-color: var(--border); }
.production-group-stat-table thead tr:first-child th:first-child { text-align: left; }
.production-stat-col-production { color: var(--primary) !important; background: var(--primary-soft); }
.production-stat-col-quality { color: var(--ok) !important; background: rgba(56, 158, 13, .08); }
.production-group-total-row { background: var(--soft-panel); }
.production-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 6px 3px 2px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.production-group-toggle:hover:not(:disabled) { background: var(--hover-bg); }
.production-group-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.production-group-toggle:disabled { cursor: default; }
.production-group-toggle-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: transform .18s ease;
}
.production-group-toggle-chevron.open { transform: rotate(90deg); }
.production-group-toggle:disabled .production-group-toggle-chevron { visibility: hidden; }
.production-group-toggle small {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.production-worker-stat-row td { color: var(--muted); font-size: 12px; }
.production-worker-stat-row:hover { background: var(--hover-bg); }
.production-worker-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 16px;
  color: var(--text);
  font-weight: 650;
}
.production-worker-name::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .65;
}
.production-rate-cell { min-width: 95px; }
.production-rate-cell strong { display: block; margin-bottom: 5px; font-size: 12px; }
.production-group-stat-mobile { display: none; }
.production-worker-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--dashed);
}
.production-worker-mobile-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel);
}
.production-worker-mobile-item > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.production-worker-mobile-item span,
.production-worker-mobile-item small { color: var(--muted); font-size: 11px; }

/* 管理后台 · 系统经营报表 */
.admin-report-heading { margin-top: 4px; }
.admin-report-title { margin: 0 0 4px; font-size: 22px; line-height: 1.25; }
.admin-report-period-card { margin-bottom: 18px; }
.admin-report-loading { padding: 28px; text-align: center; }
.admin-report-business-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.production-stat-card > small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}
.admin-report-group-card,
.admin-report-orders-card { margin-top: 18px; }
.admin-report-orders-table-wrap { overflow-x: auto; }
.admin-report-orders-table { min-width: 850px; }
.admin-report-orders-table tr { cursor: default; }
.admin-report-orders-mobile { display: none; }

@media (max-width: 1200px) {
  .production-filter-grid { grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(150px, 1fr)); }
  .production-filter-actions { justify-content: flex-end; }
  .production-stat-summary-quality { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-report-business-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .product-taxonomy-grid { grid-template-columns: 1fr; }
  .product-taxonomy-manager-list { grid-template-columns: 1fr; }
  .taxonomy-group > summary { flex-wrap: wrap; }
  .taxonomy-inline-actions {
    width: 100%;
    padding-left: 30px;
  }
  .taxonomy-inline-actions .btn { flex: 1 1 auto; }
  .production-page-heading { align-items: flex-start; }
  .production-filter-grid { grid-template-columns: 1fr 1fr; }
  .production-filter-keyword { grid-column: 1 / -1; }
  .production-filter-actions { justify-content: stretch; }
  .production-filter-actions .btn { flex: 1; }
  .production-records-table-wrap { display: none; }
  .production-records-mobile { display: flex; flex-direction: column; }
  .production-record-card {
    width: 100%;
    padding: 15px 16px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
  }
  .production-record-card:hover { background: var(--hover-bg); }
  .production-record-card-head,
  .production-record-card-metrics,
  .production-record-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .production-record-card-head { margin-bottom: 7px; }
  .production-record-card-metrics { justify-content: flex-start; margin-top: 10px; font-size: 13px; }
  .production-record-card-foot { margin-top: 10px; font-size: 11px; }
  .production-record-card-foot span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .production-period-card { align-items: stretch; flex-direction: column; }
  .production-period-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .production-period-tab { min-width: 0; }
  .production-period-control { width: 100%; }
  .production-period-control .field { flex: 1; min-width: 0; }
  .production-stat-summary-production,
  .production-stat-summary-quality { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-group-stat-table-wrap { display: none; }
  .production-group-stat-mobile { display: flex; flex-direction: column; gap: 10px; }
  .production-group-stat-mobile-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--soft-panel);
  }
  .production-group-stat-mobile-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .production-group-stat-mobile-head span { color: var(--primary); font-size: 12px; font-weight: 650; }
  .production-group-stat-mobile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
  .production-group-stat-mobile-grid div { display: flex; flex-direction: column; gap: 4px; }
  .production-group-stat-mobile-grid span { color: var(--muted); font-size: 11px; }
  .production-group-stat-mobile-grid strong { font-size: 16px; }
  .admin-report-business-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-report-orders-table-wrap { display: none; }
  .admin-report-orders-mobile { display: flex; flex-direction: column; gap: 9px; }
  .admin-report-order-mobile-card {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--soft-panel);
  }
  .admin-report-order-mobile-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .admin-report-order-mobile-card > div + div { margin-top: 8px; }
  .admin-report-order-mobile-card .muted { justify-content: flex-start; font-size: 12px; }
  .admin-report-order-mobile-card > div:last-child { color: var(--muted); font-size: 11px; }
}

@media (max-width: 540px) {
  .product-taxonomy-editor { grid-template-columns: 1fr; }
  .product-taxonomy-editor .btn { width: 100%; }
  .product-taxonomy-admin-row { align-items: flex-start; flex-direction: column; }
  .product-taxonomy-admin-actions { width: 100%; flex-wrap: wrap; }
  .production-page-heading { flex-direction: column; }
  .production-filter-grid { grid-template-columns: 1fr; }
  .production-filter-keyword { grid-column: auto; }
  .production-period-control { align-items: stretch; flex-direction: column; }
  .production-stat-section-title span { display: block; margin: 4px 0 0; }
  .production-stat-summary-production,
  .production-stat-summary-quality { grid-template-columns: 1fr 1fr; }
  .production-stat-card { min-height: 94px; padding: 15px; }
  .production-stat-card > strong { font-size: 24px; }
  .production-group-stat-head { flex-direction: column; }
}

@media (max-width: 820px) {
  .process-library-title,
  .process-library-filter-head,
  .process-library-list-head { align-items: flex-start; }
  .process-library-summary { grid-template-columns: 1fr; }
  .process-library-filters { grid-template-columns: 1fr; }
  .process-library-table-scroll { max-height: none; }
  .process-category-hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-category-save { width: 100%; }
}

@media (max-width: 540px) {
  .process-library-title,
  .process-library-filter-head,
  .process-library-list-head { flex-direction: column; }
  .process-library-title .btn,
  .process-library-filter-head .btn { width: 100%; }
  .process-category-hours-grid { grid-template-columns: 1fr; }
}

.password-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
}

.password-dialog {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.password-dialog h3 { margin: 0; }

/* 响应式导航与移动端信息视图 */
.mobile-nav-bar,
.mobile-nav-backdrop,
.mobile-record-list,
.schedule-board-mobile,
.plan-gantt-mobile {
  display: none;
}

@media (max-width: 900px) {
  .sider {
    min-height: 48px;
    overflow: visible;
  }

  .mobile-nav-bar {
    position: relative;
    z-index: 54;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #132238;
  }

  .mobile-nav-toggle {
    min-width: 64px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(220, 231, 245, .24);
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
  }

  .mobile-nav-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .75);
    outline-offset: 2px;
  }

  .mobile-nav-current {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #fff;
  }

  .mobile-nav-current span {
    flex: 0 0 auto;
    color: #91a4bc;
    font-size: 11px;
  }

  .mobile-nav-current strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sider-nav {
    position: fixed;
    top: 56px;
    left: 12px;
    right: 12px;
    z-index: 53;
    width: auto;
    max-height: calc(100dvh - 72px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(220, 231, 245, .16);
    border-radius: 14px;
    background: #132238;
    box-shadow: 0 18px 50px rgba(2, 8, 23, .38);
    scrollbar-width: none;
  }

  .sider-nav::-webkit-scrollbar { display: none; }
  .sider-nav.mobile-open { display: flex; }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 48px 0 0;
    z-index: 49;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, .42);
    cursor: default;
  }

  .sider-nav .nav-item,
  .shell.sider-collapsed .sider-nav .nav-item {
    width: 100%;
    min-height: 44px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: left;
    font-size: 14px;
  }

  .sider-nav .nav-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
  }

  .sider-nav .nav-group-trigger {
    width: 100%;
    margin: 0;
  }

  .sider-nav .nav-submenu {
    width: 100%;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    border-radius: 10px;
    background: #0c1a2d;
  }

  .sider-nav .nav-subitem {
    padding-left: 18px;
    color: #c8d5e5;
  }

  .notification-dock {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .notification-button,
  .shell.sider-collapsed .notification-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 7px;
  }

  .notification-button-label { display: none !important; }
  .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    margin: 0;
  }

  .notification-panel,
  .shell.sider-collapsed .notification-panel {
    bottom: 64px;
  }
}

@media (max-width: 720px) {
  .btn,
  .tab,
  .topbar-actions > button,
  .topbar-actions > a {
    min-height: 40px;
  }

  .btn.sm { min-height: 36px; }
  .mobile-nav-toggle,
  .topbar-actions .btn { min-height: 40px; }

  .region-dashboard-page .dash-map-scope button,
  .region-dashboard-page .dash-map-scope select {
    height: 40px;
    min-height: 40px;
  }

  .region-dashboard-page .dash-map-fullscreen {
    top: 60px;
    height: 40px;
    min-height: 40px;
  }

  .region-dashboard-page .dash-map-zoom-controls { top: 60px; }
  .region-dashboard-page .dash-map-zoom-controls button {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .region-dashboard-page .dash-map-zoom-controls .dash-map-zoom-reset { width: 58px; }
  .region-dashboard-page .dash-map-legend { top: 108px; }
  .region-dashboard-page .dash-map-legend button {
    min-height: 40px;
    min-width: 40px;
  }
  .region-dashboard-page .dash-map-canvas { padding-top: 154px; }

  .mobile-record-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .responsive-table-desktop { display: none; }

  .mobile-record-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--soft-panel);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
  }

  .mobile-record-card[role="button"] { cursor: pointer; }
  .mobile-record-card[role="button"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  .mobile-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-record-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-record-head strong {
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.4;
  }

  .mobile-record-head > div > span {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-record-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    margin-top: 13px;
    color: var(--text);
    font-size: 13px;
  }

  .mobile-record-meta span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-wrap: anywhere;
  }

  .mobile-record-meta span.wide { grid-column: 1 / -1; }
  .mobile-record-meta b,
  .mobile-record-section > b {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }

  .mobile-record-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 13px;
    font-size: 13px;
    line-height: 1.55;
  }

  .mobile-record-progress {
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-record-progress strong {
    color: var(--text);
    font-size: 12px;
  }

  .mobile-record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--dashed);
  }

  .mobile-record-actions .btn { width: 100%; }

  .taxonomy-leaf-table-scroll {
    overflow: visible;
  }

  .schedule-board-scroll { display: none; }
  .schedule-board-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .schedule-mobile-day {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
  }

  .schedule-mobile-day > header {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--soft-panel);
  }

  .schedule-mobile-day.today > header {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .schedule-mobile-day > header span {
    color: var(--muted);
    font-size: 12px;
  }

  .schedule-mobile-day > header em {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-style: normal;
  }

  .schedule-mobile-group {
    padding: 11px 12px 12px;
    border-bottom: 1px solid var(--dashed);
  }

  .schedule-mobile-group:last-child { border-bottom: 0; }
  .schedule-mobile-group-title {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .schedule-mobile-group-plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .schedule-mobile-group-plans .schedule-plan-card {
    margin: 0;
    min-height: 44px;
  }

  .schedule-mobile-empty {
    color: var(--muted);
    font-size: 12px;
  }

  .schedule-board-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-title-row > .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-title-row > .row .btn { width: 100%; }
  .plan-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
  }
  .plan-toolbar .date-field { width: auto !important; min-width: 0; }
  .plan-toolbar .field.grow,
  .plan-toolbar > .btn:last-child {
    grid-column: 1 / -1;
    width: 100%;
  }
  .plan-board-heading > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .plan-board-heading .plan-gantt-legend {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 7px;
  }
  .plan-gantt-legend span {
    justify-content: center;
    gap: 4px;
    font-size: 10px;
  }
  .plan-gantt-help { display: none; }
  .plan-board-scroll { display: none; }
  .plan-gantt-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .plan-gantt-mobile-load {
    min-width: 0;
    padding: 12px 0 2px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
  }
  .plan-gantt-mobile-load-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 0 13px 10px;
  }
  .plan-gantt-mobile-load-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .plan-gantt-mobile-load-head strong { font-size: 14px; }
  .plan-gantt-mobile-load-head span,
  .plan-gantt-mobile-load-head small {
    color: var(--muted);
    font-size: 10px;
  }
  .plan-gantt-mobile-load-head small {
    flex: 0 0 auto;
    padding-top: 2px;
    white-space: nowrap;
  }
  .plan-gantt-mobile-load-scroll {
    display: grid;
    grid-auto-columns: minmax(218px, 72vw);
    grid-auto-flow: column;
    gap: 9px;
    padding: 0 13px 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .plan-gantt-mobile-load-scroll::-webkit-scrollbar { display: none; }
  .plan-gantt-mobile-day {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--soft-panel);
    scroll-snap-align: start;
  }
  .plan-gantt-mobile-day > header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
  }
  .plan-gantt-mobile-day > header span {
    color: var(--muted);
    font-size: 10px;
  }
  .plan-gantt-mobile-day.today > header {
    color: var(--primary);
    background: var(--primary-soft);
  }
  .plan-gantt-mobile-day-groups {
    display: grid;
    gap: 0;
  }
  .plan-gantt-mobile-load-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 7px 9px 9px;
    border-bottom: 1px solid var(--dashed);
  }
  .plan-gantt-mobile-load-item:last-child { border-bottom: 0; }
  .plan-gantt-mobile-load-item > div:first-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
  }
  .plan-gantt-mobile-load-item > div:first-child span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
  }
  .plan-gantt-mobile-load-item > div:first-child span i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--plan-group-color);
  }
  .plan-gantt-mobile-load-item > div:first-child strong { color: #237804; font-size: 11px; }
  .plan-gantt-mobile-load-item > small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
  }
  .plan-gantt-mobile-load-item.overloaded {
    background: rgba(207, 19, 34, .07);
  }
  .plan-gantt-mobile-load-item.overloaded > div:first-child strong { color: var(--danger); }
  .plan-gantt-mobile-meter {
    grid-column: 1 / -1;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(100, 116, 139, .15);
  }
  .plan-gantt-mobile-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #52c41a;
  }
  .plan-gantt-mobile-load-item.overloaded .plan-gantt-mobile-meter i { background: #cf1322; }

  .plan-gantt-mobile-card {
    padding: 13px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 11px;
    background: var(--soft-panel);
  }

  .plan-gantt-mobile-card.late { border-left-color: var(--danger); }
  .plan-gantt-mobile-head {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .plan-gantt-mobile-order-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
  }
  .plan-gantt-mobile-order-button:focus-visible {
    border-radius: 6px;
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }

  .plan-gantt-mobile-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .plan-gantt-mobile-head strong { font-size: 15px; }
  .plan-gantt-mobile-head span,
  .plan-gantt-mobile-head small,
  .plan-gantt-mobile-customer {
    color: var(--muted);
    font-size: 11px;
  }

  .plan-gantt-mobile-head small {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .plan-gantt-mobile-customer { margin-top: 5px; }
  .plan-gantt-mobile-list {
    display: grid;
    gap: 8px;
    margin-top: 11px;
  }

  .plan-gantt-mobile-plan {
    min-height: 48px;
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid color-mix(in srgb, var(--plan-group-color) 45%, var(--border));
    border-left: 4px solid var(--plan-group-color);
    border-radius: 9px;
    background: var(--panel);
    color: var(--text);
    text-align: left;
    cursor: pointer;
  }

  .plan-gantt-mobile-plan span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
  }

  .plan-gantt-mobile-plan b {
    padding: 2px 6px;
    border-radius: 999px;
    color: #ad6800;
    background: rgba(212, 136, 6, .12);
    font-size: 10px;
  }
  .plan-gantt-mobile-plan b.status-released { color: #237804; background: rgba(82, 196, 26, .13); }
  .plan-gantt-mobile-plan b.status-frozen { color: #6d28d9; background: rgba(139, 92, 246, .13); }

  .plan-gantt-mobile-plan em {
    color: var(--danger);
    font-size: 10px;
    font-style: normal;
  }

  .plan-gantt-mobile-unscheduled {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
  }

  .plan-gantt-mobile-unscheduled > span {
    width: 100%;
    color: var(--muted);
    font-size: 11px;
  }

  .plan-gantt-mobile-unscheduled button {
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid;
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
  }

  .plan-log-toggle {
    min-height: 40px;
    padding: 8px 0;
  }

  .plan-gantt-mobile-empty {
    padding: 24px 12px;
    color: var(--muted);
    text-align: center;
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 7px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .topbar-left { max-width: 104px; }
  .topbar-brand {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-role { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn {
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }
  .plan-board-heading { padding: 12px; }
  .plan-gantt-mobile-card { margin: 0 10px; }
  .plan-gantt-mobile-load-scroll {
    grid-auto-columns: minmax(210px, 78vw);
    padding-left: 10px;
    padding-right: 10px;
  }
  .schedule-board-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
