:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --text-strong: #0f172a;
  --muted: #6b7a90;
  --line: #e5eaf2;
  --primary: #2f6fed;
  --primary-dark: #1d55cc;
  --primary-soft: #eaf1ff;
  --teal: #0d9488;
  --teal-soft: #e6f7f4;
  --amber: #d97706;
  --amber-soft: #fff5e6;
  --red: #dc2626;
  --red-soft: #fff0f0;
  --green: #059669;
  --green-soft: #e9f8f1;
  --purple: #7c3aed;
  --purple-soft: #f2ecff;
  --sidebar: #0b1b33;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.16);
  --radius: 18px;
  --transition: 0.2s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.2);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 252px;
  padding: 24px 16px 18px;
  color: #dbe7f7;
  background:
    radial-gradient(circle at 15% 0%, rgba(47, 111, 237, 0.28), transparent 36%),
    linear-gradient(180deg, var(--sidebar) 0%, #09172c 100%);
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }

.brand-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
}

.brand-logo img { width: 42px; height: 42px; border-radius: 13px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 20px; letter-spacing: 1px; }
.brand-text span { margin-top: 3px; color: #7f9bc0; font-size: 9px; letter-spacing: 1.3px; }

.sidebar-label { margin: 0 10px 10px; color: #6f88aa; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; }
.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  color: #a9bdd8;
  background: transparent;
  font-size: 14px;
  text-align: left;
  transition: var(--transition);
}

.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(47,111,237,.9), rgba(47,111,237,.62));
  box-shadow: 0 8px 18px rgba(13, 42, 92, 0.35);
}
.nav-item svg { flex: 0 0 18px; opacity: .95; }
.nav-item span { flex: 1; }

.nav-count {
  min-width: 21px;
  padding: 0 6px;
  border-radius: 20px;
  color: #d8e7ff;
  background: rgba(255,255,255,.12);
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.sidebar-card {
  position: relative;
  margin-top: 24px;
  padding: 17px 16px 15px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  overflow: hidden;
}

.sidebar-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(13,148,136,.14);
}

.sidebar-card-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  border-radius: 9px;
  color: #67e8d4;
  background: rgba(13,148,136,.16);
}
.sidebar-card-icon svg { width: 18px; height: 18px; }
.sidebar-card strong { display: block; color: #fff; font-size: 14px; }
.sidebar-card p { position: relative; z-index: 1; margin: 6px 0 12px; color: #90a8c7; font-size: 12px; line-height: 1.65; }

.sidebar-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: #7dd3fc;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}
.sidebar-card-btn span { transition: transform .2s ease; }
.sidebar-card-btn:hover span { transform: translateX(3px); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #60a5fa, #2563eb);
  font-size: 14px;
  font-weight: 700;
}
.avatar-small { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: 12px; }
.sidebar-user-info { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.sidebar-user-info strong { color: #fff; font-size: 13px; }
.sidebar-user-info span { color: #7f9bc0; font-size: 11px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.13); }

.main-wrap { margin-left: 252px; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 70px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
}

.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 13px; }
.breadcrumb span { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb i { color: #c3ccda; font-style: normal; }
.breadcrumb strong { color: var(--text-strong); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }

.top-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.top-picker > span { color: var(--muted); font-size: 11px; }
.top-picker select { max-width: 120px; padding: 3px 2px; border: 0; color: var(--text-strong); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #53657f;
  background: var(--surface);
  transition: var(--transition);
}
.icon-btn:hover { color: var(--primary); border-color: #c7d8f8; background: var(--primary-soft); }
.icon-btn svg { width: 18px; height: 18px; }

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: none;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 20px;
  color: #fff;
  background: #ef4444;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cart-badge.show { display: grid; }
.notification-dot { position: absolute; top: 8px; right: 9px; width: 6px; height: 6px; border: 1.5px solid #fff; border-radius: 50%; background: #f59e0b; }

.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 6px; color: var(--text-strong); font-size: 13px; font-weight: 600; }
.mobile-menu { display: none; }

.content { max-width: 1560px; margin: 0 auto; padding: 28px 30px 64px; }
.loading-state { display: grid; place-items: center; min-height: 320px; color: var(--muted); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0; color: var(--text-strong); font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: var(--transition);
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), #1f5ed6); box-shadow: 0 7px 16px rgba(47,111,237,.22); }
.btn-primary:hover { background: linear-gradient(135deg, #3a78f2, var(--primary-dark)); transform: translateY(-1px); }
.btn-outline { color: var(--primary); border-color: #cbdcf8; background: #fff; }
.btn-outline:hover { background: var(--primary-soft); }
.btn-soft { color: var(--text); border-color: var(--line); background: var(--surface); }
.btn-soft:hover { border-color: #cbd5e1; background: var(--surface-soft); }
.btn-danger { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.text-btn.danger { color: var(--red); }
.alert { padding: 12px 14px; border: 1px solid #dbe3f0; border-radius: 10px; background: #f8faff; color: var(--text); font-size: 13px; line-height: 1.7; }
.alert.warning { border-color: #f4d08a; background: #fff9e8; color: #8a5a00; }
.alert.danger { border-color: #f4b8b8; background: #fff5f5; color: #a61b1b; }
.btn-sm { min-height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px 0; }
.card-head h2, .card-head h3 { margin: 0; color: var(--text-strong); font-size: 15px; font-weight: 800; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 18px 20px 20px; }

.text-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 12px; font-weight: 700; }
.text-btn:hover { color: var(--primary-dark); text-decoration: underline; }
.link-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-soft); }
.link-icon:hover { color: var(--primary); background: var(--primary-soft); }
.link-icon svg { width: 16px; height: 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { position: relative; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -26px; top: -26px; width: 82px; height: 82px; border-radius: 50%; background: var(--accent-soft, var(--primary-soft)); opacity: .75; }
.kpi-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--accent, var(--primary)); background: var(--accent-soft, var(--primary-soft)); }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-value { position: relative; z-index: 1; margin-top: 12px; color: var(--text-strong); font-size: 24px; font-weight: 800; letter-spacing: -.6px; }
.kpi-foot { position: relative; z-index: 1; margin-top: 4px; color: var(--muted); font-size: 11px; }
.kpi-foot strong { color: var(--green); font-weight: 700; }
.kpi-foot .warn { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); gap: 16px; margin-bottom: 16px; }
.dashboard-grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); gap: 16px; }

.chart-wrap { position: relative; padding: 10px 6px 0; }
.chart-wrap svg { display: block; width: 100%; height: 218px; }
.chart-legend { display: flex; align-items: center; gap: 7px; padding: 0 14px 2px; color: var(--muted); font-size: 11px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(180deg, #5b8df5, #2f6fed); }

.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid #f4e1c4; border-radius: 12px; background: #fffbf4; }
.alert-item-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; color: var(--amber); background: var(--amber-soft); }
.alert-item-icon svg { width: 16px; height: 16px; }
.alert-item-main { flex: 1; min-width: 0; }
.alert-item-main strong { display: block; overflow: hidden; color: var(--text-strong); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.alert-item-main span { color: var(--muted); font-size: 11px; }
.alert-item-qty { color: var(--amber); font-size: 12px; font-weight: 800; white-space: nowrap; }

.bar-list { display: flex; flex-direction: column; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 46px; align-items: center; gap: 10px; font-size: 12px; }
.bar-row > span:first-child { color: var(--muted); }
.bar-row > strong { color: var(--text-strong); text-align: right; }
.bar-track { height: 8px; border-radius: 10px; background: #edf1f7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #2f6fed, #0d9488); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 14px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 700; letter-spacing: .2px; text-align: left; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid var(--line); color: var(--text); vertical-align: middle; white-space: nowrap; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafcff; }
.cell-main { display: flex; flex-direction: column; gap: 2px; }
.cell-main strong { color: var(--text-strong); font-weight: 700; }
.cell-main small { color: var(--muted); font-size: 11px; }
.cell-strong { color: var(--text-strong); font-weight: 700; }
.cell-right { text-align: right; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-wait { color: var(--amber); background: var(--amber-soft); }
.status-partial { color: var(--primary); background: var(--primary-soft); }
.status-done, .status-normal { color: var(--green); background: var(--green-soft); }
.status-low { color: var(--red); background: var(--red-soft); }
.status-soon { color: var(--amber); background: var(--amber-soft); }
.status-in { color: var(--green); background: var(--green-soft); }
.status-out { color: var(--purple); background: var(--purple-soft); }
.status-error { color: var(--red); background: var(--red-soft); }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  min-height: 178px;
  margin-bottom: 20px;
  padding: 28px 32px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 20%, rgba(45, 212, 191, .28), transparent 28%),
    radial-gradient(circle at 18% 110%, rgba(96, 165, 250, .3), transparent 35%),
    linear-gradient(115deg, #0b2241 0%, #123b70 55%, #0e5c69 100%);
  box-shadow: 0 16px 40px rgba(12, 45, 88, .18);
  overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; bottom: -110px; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.hero-main { position: relative; z-index: 1; max-width: 660px; }
.hero-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; color: #b9e6ff; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 700; }
.hero h2 { margin: 13px 0 6px; font-size: 27px; line-height: 1.3; letter-spacing: -.5px; }
.hero p { margin: 0; color: #bcd0e8; font-size: 13px; }
.hero-stats { position: relative; z-index: 1; display: flex; gap: 26px; }
.hero-stat { display: flex; flex-direction: column; min-width: 80px; }
.hero-stat strong { font-size: 24px; }
.hero-stat span { color: #a9c4df; font-size: 11px; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.search-box { position: relative; flex: 1 1 260px; }
.search-box svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; color: var(--muted); transform: translateY(-50%); }
.search-box input { width: 100%; height: 40px; padding: 0 14px 0 39px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface); }
.search-box input::placeholder { color: #9aa7b8; }
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 600; transition: var(--transition); }
.chip:hover { border-color: #cbdcf8; color: var(--primary); }
.chip.active { color: #fff; border-color: var(--primary); background: var(--primary); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 14px; }
.section-head h2 { margin: 0; color: var(--text-strong); font-size: 17px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.soft-note { padding: 6px 11px; border-radius: 20px; color: var(--teal); background: var(--teal-soft); font-size: 11px; font-weight: 700; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15,23,42,.1); }

.product-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  padding: 14px 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #eaf1ff, #dff6f2);
}
.product-visual::after { content: ""; position: absolute; right: -24px; top: -35px; width: 110px; height: 110px; border: 14px solid rgba(255,255,255,.42); border-radius: 50%; }
.product-visual code { position: relative; z-index: 1; color: #1d4ed8; font-family: inherit; font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.product-visual small { position: relative; z-index: 1; padding: 4px 9px; border-radius: 20px; color: #0f766e; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; }
.product-visual[data-cat="过滤设备"] { background: linear-gradient(135deg, #ede9fe, #e0f2fe); }
.product-visual[data-cat="洁净服饰"] { background: linear-gradient(135deg, #dbeafe, #ecfdf5); }
.product-visual[data-cat="清洁消毒"] { background: linear-gradient(135deg, #fef3c7, #dcfce7); }
.product-visual[data-cat="防静电"] { background: linear-gradient(135deg, #e0e7ff, #f3e8ff); }

.product-body { padding: 15px 16px 16px; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-badge { padding: 3px 8px; border-radius: 20px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 700; }
.product-body h3 { margin: 9px 0 3px; color: var(--text-strong); font-size: 15px; }
.product-spec { margin: 0; color: var(--muted); font-size: 12px; }
.product-supplier { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: #64748b; font-size: 11px; }
.product-supplier svg { width: 13px; height: 13px; color: var(--teal); }
.product-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; min-height: 22px; }
.product-tag { padding: 2px 7px; border-radius: 5px; color: #64748b; background: #f1f5f9; font-size: 10px; }
.product-stock { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.product-stock strong { color: var(--text-strong); }
.product-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.product-price { color: #e11d48; font-size: 19px; font-weight: 800; }
.product-price small { color: var(--muted); font-size: 11px; font-weight: 500; }
.product-actions { display: flex; align-items: center; gap: 6px; }
.qty-input { width: 64px; height: 32px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: 12px; }

.empty-state { display: grid; place-items: center; gap: 8px; min-height: 240px; padding: 30px; border: 1px dashed #cfd9e8; border-radius: 16px; color: var(--muted); background: #fbfcfe; text-align: center; }
.empty-state svg { width: 30px; height: 30px; color: #a9b8cd; }
.empty-state strong { color: var(--text-strong); font-size: 14px; }
.empty-state p { margin: 0; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(9, 19, 36, .56); backdrop-filter: blur(4px); }
.modal { display: flex; flex-direction: column; width: min(760px, 100%); max-height: min(88vh, 820px); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal.modal-wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; color: var(--text-strong); font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.modal-close { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-soft); }
.modal-close:hover { color: var(--red); background: var(--red-soft); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-soft); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; font-size: 13px; }
.field textarea { min-height: 76px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 11px; }

.summary-box { padding: 14px 16px; border: 1px solid #d7e5ff; border-radius: 13px; background: #f5f9ff; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.summary-row strong { color: var(--text-strong); }
.summary-total { margin-top: 8px; padding-top: 10px; border-top: 1px solid #d7e5ff; }
.summary-total strong { color: #e11d48; font-size: 20px; }

.section-title { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--text-strong); }
.payment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.payment-option { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.payment-option.selected { border-color: #2f6fed; background: #f5f9ff; box-shadow: 0 0 0 2px rgba(47, 111, 237, .12); }
.payment-option.disabled { opacity: .55; cursor: not-allowed; }
.payment-option-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.payment-option-head span { font-size: 11px; color: var(--muted); }
.payment-option-body { display: grid; gap: 4px; font-size: 12px; }
.payment-option-body > div { display: flex; gap: 8px; }
.payment-option-body span { min-width: 64px; color: var(--muted); }
.payment-option-body strong { color: var(--text-strong); font-weight: 600; word-break: break-all; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-item { padding: 11px 13px; border-radius: 11px; background: var(--surface-soft); }
.detail-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-item strong { color: var(--text-strong); font-size: 13px; }

.progress { height: 7px; border-radius: 10px; background: #edf1f7; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #2f6fed, #0d9488); }
.inline-progress { display: flex; align-items: center; gap: 8px; }
.inline-progress .progress { width: 92px; }
.inline-progress small { color: var(--muted); font-size: 11px; }

.price-preview { padding: 5px 9px; border-radius: 8px; color: #e11d48; background: var(--red-soft); font-size: 12px; font-weight: 800; text-align: right; }
.markup-range { color: var(--muted); font-size: 11px; }

.outbound-row { display: grid; grid-template-columns: minmax(160px, 2fr) 110px minmax(130px, 1fr) 32px; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); margin-bottom: 9px; }
.stock-hint { color: var(--teal); font-size: 11px; }
.row-remove { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: #fff; }
.row-remove:hover { color: var(--red); background: var(--red-soft); }
.row-remove svg { width: 15px; height: 15px; }

.api-flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.api-node { flex: 1 1 220px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.api-node strong { display: block; color: var(--text-strong); font-size: 14px; }
.api-node p { margin: 6px 0 10px; color: var(--muted); font-size: 12px; }
.api-node code { display: block; padding: 5px 8px; border-radius: 7px; color: #1d4ed8; background: #eef4ff; font-size: 11px; word-break: break-all; }
.api-arrow { display: grid; place-items: center; min-width: 34px; color: var(--primary); font-size: 22px; font-weight: 800; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 260px; max-width: 390px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #fff; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; }
.toast::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.info::before { background: var(--primary); }
.toast.warn::before { background: var(--amber); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .dashboard-grid, .dashboard-grid-2 { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
  .top-picker > span { display: none; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px 56px; }
  .user-chip span { display: none; }
}

@media (max-width: 640px) {
  .breadcrumb span, .breadcrumb i { display: none; }
  .topbar-actions { gap: 6px; }
  .top-picker { padding: 4px 6px; }
  .top-picker select { max-width: 82px; font-size: 11px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 24px 20px; }
  .hero h2 { font-size: 22px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .outbound-row { grid-template-columns: 1fr 90px 32px; }
  .outbound-row .stock-hint { grid-column: 1 / -1; }
  .modal-backdrop { padding: 10px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 15px; padding-right: 15px; }
}

.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.catalog-col { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.catalog-title { margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.catalog-list { display: flex; flex-wrap: wrap; gap: 7px; max-height: 138px; overflow-y: auto; }
.catalog-item { padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #fff; font-size: 12px; transition: var(--transition); }
.catalog-item:hover { color: var(--primary); border-color: #cbdcf8; }
.catalog-item.active { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 5px 12px rgba(47,111,237,.18); }

.stage-stepper { display: flex; align-items: center; gap: 5px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: #d8e0ec; }
.stage-dot.done { background: var(--teal); }
.stage-dot.active { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

@media (max-width: 760px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-list { max-height: 104px; }
}

.product-thumb { width: 64px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.image-upload-preview { margin-top: 8px; min-height: 56px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-soft); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.image-upload-preview img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.panel-spec-input { display: flex; align-items: center; gap: 6px; min-width: 180px; }
.panel-spec-input .qty-input { flex: 1; min-width: 72px; }
.panel-spec-input span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.field input[type="file"] { font-size: 12px; padding: 6px 0; }
.product-price-cell { color: #e11d48; }
.table-wrap select { min-width: 190px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #fff; font-size: 12px; }

.top-picker.hidden { display: none !important; }
.login-screen { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at 16% 18%, rgba(255,255,255,.24), transparent 40%), radial-gradient(circle at 84% 82%, rgba(255,255,255,.16), transparent 46%), linear-gradient(135deg, #174b9c 0%, #2f6fed 52%, #123b82 100%); }
.login-card { width: 100%; max-width: 420px; padding: 32px; border: 1px solid rgba(255,255,255,.28); border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(6, 31, 76, .34); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 20px; font-weight: 800; color: #1f3a68; letter-spacing: 2px; }
.login-brand img { width: 46px; height: 46px; border-radius: 14px; object-fit: contain; box-shadow: 0 10px 28px rgba(6, 31, 76, .28); }
.login-card h1 { margin: 12px 0 6px; font-size: 24px; }
.login-card > p { margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.login-card .field { margin-bottom: 14px; }
.login-error { min-height: 18px; margin-bottom: 8px; font-size: 12px; color: #e11d48; }
.login-submit { width: 100%; height: 42px; }
.login-switch { width: 100%; margin-top: 12px; font-size: 12px; }
.login-hint { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.7; color: var(--muted); }

.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 34; background: rgba(9, 19, 36, .45); }
  .sidebar.open ~ .sidebar-backdrop { display: block; }
}
@media (max-width: 640px) {
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .content { padding: 16px 12px 56px; }
  .breadcrumb { gap: 6px; font-size: 12px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 21px; }
  .page-head p { font-size: 12px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
  .btn { min-height: 38px; padding: 0 10px; font-size: 12px; }
  .text-btn { min-height: 34px; padding: 0 4px; font-size: 12px; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap th, .table-wrap td { padding: 10px 8px; font-size: 12px; }
  .kpi-grid { gap: 10px; }
  .kpi-card { padding: 12px; }
  .kpi-value { font-size: 20px; }
  .toast { min-width: 0; max-width: none; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .login-screen { padding: 14px; }
  .login-card { padding: 24px 20px; border-radius: 18px; }
}
@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .user-chip { display: none; }
  .top-picker select { max-width: 72px; }
}
