:root {
  --bg: #f1eee6;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --ink: #1d2a2a;
  --muted: #6d7772;
  --line: #ddd8cc;
  --line-strong: #c9c2b2;
  --accent: #1f6f5c;
  --accent-soft: #e1eee8;
  --accent-ink: #155243;
  --amber: #b8783e;
  --amber-soft: #f6e8d7;
  --danger: #a4473a;
  --danger-soft: #f6e0dc;
  --gold: #a98236;
  --shadow: 0 10px 30px rgba(34, 42, 38, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body {
  background-image:
    linear-gradient(rgba(29, 42, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 42, 42, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

button, input, select, textarea {
  font: inherit;
}

button { cursor: pointer; }

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px 20px;
  background: #1d2a2a;
  color: #f2efe8;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotate(-2deg);
}
.brand-mark span {
  display: block;
  height: 5px;
  border-radius: 2px;
  background: #d8b26b;
}
.brand-mark span:nth-child(2) { background: #83b7a6; }
.brand-mark span:nth-child(3) { background: #f2efe8; }

.brand-kicker {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #a7b4ad;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #c9d2cc;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.nav-item.active {
  background: #f2efe8;
  color: #1d2a2a;
  font-weight: 600;
}
.nav-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8b26b;
  font-size: 12px;
  font-weight: 700;
}
.nav-item.active .nav-mark {
  background: #1f6f5c;
  color: #ffffff;
}

.sidebar-controls {
  display: flex;
  gap: 8px;
  margin-top: 0;
}
.side-control {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #c9d2cc;
  font-size: 12px;
  line-height: 1.2;
}
.side-control:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.side-control-icon { font-size: 14px; line-height: 1; }
.side-control-label { white-space: nowrap; }

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9aa8a1;
  font-size: 12px;
}
.side-foot p { margin: 0 0 4px; }
.side-foot strong { color: #f2efe8; font-weight: 600; }

/* 收起菜单：只保留图标和操作按钮；固定关闭时侧栏随页面滚动。 */
body.sidebar-collapsed .shell { grid-template-columns: 78px minmax(0, 1fr); }
.sidebar.collapsed { padding: 26px 10px 20px; gap: 16px; }
.sidebar.collapsed .brand { justify-content: center; padding-bottom: 18px; }
.sidebar.collapsed .brand > div:last-child { display: none; }
.sidebar.collapsed .nav-item { padding: 10px 0; justify-content: center; }
.sidebar.collapsed .nav-item > span:last-child { display: none; }
.sidebar.collapsed .sidebar-controls { flex-direction: column; }
.sidebar.collapsed .side-control-label { display: none; }
.sidebar.collapsed .side-control { flex: none; width: 100%; padding: 9px 0; }
.sidebar.collapsed .side-foot { display: none; }
.sidebar:not(.pinned) { position: static; height: auto; overflow: visible; }

.main {
  padding: 30px 36px 44px;
  max-width: 1500px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.top-title h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 680;
}

.subline {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.industry-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
  color: var(--accent-ink);
  font-weight: 600;
}
.industry-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.ghost-btn, .primary-btn, .soft-btn, .icon-btn {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: 9px;
  padding: 8px 13px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.ghost-btn:hover, .soft-btn:hover, .icon-btn:hover { background: #f7f3ea; border-color: #b9b1a0; }
.primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.primary-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); transform: translateY(-1px); }
.soft-btn { background: var(--accent-soft); border-color: #c9ded5; color: var(--accent-ink); }
.icon-btn { padding: 5px 9px; font-size: 18px; line-height: 1; }

.view { display: flex; flex-direction: column; gap: 18px; }

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-copy h3 {
  margin: 0 0 5px;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.quick-btn {
  border: 1px solid var(--line-strong);
  background: #f8f4ea;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
}
.quick-btn:hover { background: #f0e9db; border-color: #bdb39f; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 17px;
  box-shadow: 0 5px 18px rgba(34, 42, 38, 0.035);
  min-width: 0;
}
.stat-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.stat-value {
  margin: 0;
  font-size: clamp(23px, 2.5vw, 31px);
  font-weight: 680;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.panel-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.panel-body { padding: 16px 18px 18px; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table-wrap table { min-width: 600px; }
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #ece7dc;
  vertical-align: middle;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
td { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:hover { background: #fbf8f0; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.mini-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
}
.mini-btn:hover { color: var(--ink); background: #f7f3ea; }
.mini-btn.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: #dfb8b1; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #f1eee6;
  color: #5f665f;
}
.badge.green { background: var(--accent-soft); color: var(--accent-ink); }
.badge.amber { background: var(--amber-soft); color: #8b5525; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: #e6edf4; color: #3f5d7a; }
.badge.gray { background: #efede7; color: #6b6b63; }

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.focus-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid #ece7dc;
  border-radius: 9px;
  background: #fcfaf4;
}
.focus-main { min-width: 0; }
.focus-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.focus-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.focus-value { font-size: 13px; color: var(--accent-ink); font-weight: 600; white-space: nowrap; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.toolbar h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 0;
}
.filter-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
}
.filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
}
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fffefb;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 92, 0.11);
}
.form-field textarea { min-height: 68px; resize: vertical; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
  min-height: 16px;
}

.order-lines {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fcfaf4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 34px;
  gap: 7px;
  align-items: center;
}
.order-line select, .order-line input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fffefb;
  border-radius: 7px;
  padding: 8px;
  font-size: 12px;
}
.line-remove {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 7px;
  color: var(--muted);
  padding: 7px 0;
}
.line-remove:hover { color: var(--danger); border-color: #dfb8b1; }
.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 12px 2px 0;
  border-top: 1px dashed var(--line-strong);
  font-size: 14px;
}
.order-total strong { font-size: 21px; letter-spacing: -0.02em; }

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.report-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
}
.report-card p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.report-card strong { font-size: 26px; font-weight: 680; letter-spacing: -0.03em; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.bar-track {
  height: 9px;
  background: #ece8de;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  min-width: 2px;
}
.bar-row .num { color: var(--muted); }

.settings-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  margin: 8px 0 0;
}
.module-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.quick-groups {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.quick-group { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.quick-caption {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.quick-btn.more { align-self: flex-end; }

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.list-toolbar input[type="search"],
.list-toolbar select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  background: #fffefb;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
}
.list-search { display: flex; gap: 6px; flex: 1 1 280px; min-width: 0; }
.list-search input { flex: 1; min-width: 0; }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.pager-actions { display: flex; gap: 6px; }

.more-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffefb;
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
}
.more-item:hover { border-color: var(--line-strong); background: #f8f4ea; }
.more-item span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e7efe9;
  color: var(--accent-ink);
  font-weight: 600;
}
.more-item strong { font-size: 13px; font-weight: 600; }

.tag {
  border: 1px solid var(--line);
  background: #f8f4ea;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(29, 42, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(20, 28, 25, 0.22);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-body { padding: 18px 20px 20px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(20, 28, 25, 0.22);
  z-index: 60;
  max-width: min(480px, calc(100vw - 32px));
}
.toast.hidden { display: none; }
.toast.error { background: var(--danger); }

@media (max-width: 1050px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .shell { grid-template-columns: 1fr; }
  .sidebar-controls { display: none; }
  .sidebar.collapsed { padding: 16px 16px 12px; gap: 14px; }
  .sidebar.collapsed .brand > div:last-child { display: block; }
  .sidebar.collapsed .nav-item > span:last-child { display: inline; }
  .sidebar.collapsed .side-foot { display: block; }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px 16px 12px;
    gap: 14px;
  }
  .brand { padding-bottom: 12px; }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .nav-item {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .nav-mark { display: none; }
  .side-foot { display: none; }
  .main { padding: 20px 16px 34px; }
  .topbar { flex-direction: column; }
  .top-actions { width: 100%; justify-content: space-between; }
  .hero { flex-direction: column; align-items: flex-start; }
  .quick-actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
  .order-line select, .order-line input { font-size: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 58px minmax(0, 1fr) 64px; }
  th, td { padding: 9px 8px; }
  .quick-groups { justify-content: flex-start; }
  .quick-group { flex: 1 1 100%; }
  .quick-group .quick-actions { width: 100%; justify-content: flex-start; }
  .list-toolbar input[type="search"],
  .list-toolbar select { font-size: 16px; }
  .list-search { flex: 1 1 100%; }
  .list-toolbar select { flex: 1 1 calc(50% - 4px); }

  .list-table { overflow: visible; }
  .list-table table { min-width: 0; }
  .list-table thead { display: none; }
  .list-table table,
  .list-table tbody,
  .list-table tr,
  .list-table td { display: block; width: 100%; }
  .list-table tbody tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 0 10px;
    background: #fffefb;
  }
  .list-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px dashed #ece7dc;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .list-table td:last-child { border-bottom: 0; padding-bottom: 2px; }
  .list-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    text-align: left;
  }
  .list-table td .table-actions { justify-content: flex-end; }
  .list-table .mini-btn { min-height: 36px; padding: 6px 10px; }
  .more-menu { grid-template-columns: 1fr; }
}

.package-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf8f1;
}

.package-pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  cursor: pointer;
}

.package-pick-item:hover { border-color: var(--accent); }

.package-pick-item span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-pick-item small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.package-sort-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.package-sort-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-strong);
}

.package-sort-item.dragging { opacity: 0.55; }
.package-sort-item.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.drag-handle {
  flex: 0 0 auto;
  color: var(--muted);
  cursor: grab;
  font-size: 16px;
  line-height: 1;
}

.package-sort-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-sort-item small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.package-sort-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.package-sort-actions .mini-btn { min-height: 30px; padding: 3px 8px; }

.package-empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.form-hint {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.appointment-package-items,
.appointment-items-preview {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 9px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.appointment-package-items {
  border: 1px dashed var(--line-strong);
  background: #fbf8f1;
}

.appointment-items-preview {
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

@media (max-width: 700px) {
  .package-picker { grid-template-columns: 1fr; max-height: 220px; }
  .package-sort-item { flex-wrap: wrap; }
  .package-sort-item small { width: 100%; padding-left: 24px; }
  .package-sort-actions { margin-left: auto; }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .quick-btn, .ghost-btn, .primary-btn, .soft-btn { padding: 8px 10px; font-size: 12px; }
  .order-line { grid-template-columns: minmax(0, 1fr) 64px 32px; }
}

