/* =========================================================
   NOVA ERP — design system
   ========================================================= */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e8edf4;
  --line-strong: #d9e1ec;
  --brand: #2f5bea;
  --brand-dark: #1e44c8;
  --brand-soft: #eef2ff;
  --green: #0f9f77;
  --green-soft: #e9f9f2;
  --amber: #d68a06;
  --amber-soft: #fff6e5;
  --rose: #e11d48;
  --rose-soft: #ffeef2;
  --violet: #7c3aed;
  --violet-soft: #f3eeff;
  --navy: #0b1220;
  --navy-2: #101b31;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 8px 24px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open, body.drawer-open { overflow: hidden; }
::selection { background: #c7d2fe; color: #1e1b4b; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd6e3; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb9c9; border: 3px solid transparent; background-clip: content-box; }

.icon { flex: none; }
.muted { color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: 12px; font-weight: 650; white-space: nowrap; }
.text-link:hover { color: var(--brand-dark); }

/* =========================================================
   Boot / fatal
   ========================================================= */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(700px 500px at 30% 20%, rgba(47, 91, 234, .16), transparent 60%),
    linear-gradient(135deg, #08101d, #0f1a30 70%, #08101d);
  color: #fff;
}
.boot-logo { display: flex; align-items: center; gap: 16px; }
.logo-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; color: #6ee7b7; background: rgba(110, 231, 183, .1); border: 1px solid rgba(110, 231, 183, .22); box-shadow: 0 0 60px rgba(110, 231, 183, .12); }
.boot-title { font-size: 26px; font-weight: 850; letter-spacing: .08em; }
.boot-title span { color: #6ee7b7; }
.boot-sub { color: #8fa0b8; font-size: 12px; margin-top: 3px; letter-spacing: .08em; }
.boot-bar { width: 288px; height: 3px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 28px; }
.boot-bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, #34d399, #6ee7b7); border-radius: 4px; animation: boot 1.1s ease-in-out infinite alternate; }
@keyframes boot { from { transform: translateX(-20%); } to { transform: translateX(260%); } }
.fatal-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.fatal-card { background: #fff; padding: 40px; border-radius: 22px; text-align: center; max-width: 460px; box-shadow: var(--shadow-lg); }
.fatal-logo { width: 58px; height: 58px; display: inline-grid; place-items: center; border-radius: 16px; background: var(--rose-soft); color: var(--rose); margin-bottom: 18px; }
.fatal-card h1 { font-size: 22px; margin: 0 0 8px; }
.fatal-card p { color: var(--muted); margin: 0 0 22px; }

/* =========================================================
   Layout / sidebar
   ========================================================= */
.app-layout { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 258px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
  color: #c9d5e8;
  background:
    radial-gradient(340px 260px at 50% -10%, rgba(47, 91, 234, .3), transparent 70%),
    radial-gradient(240px 240px at 100% 90%, rgba(16, 185, 129, .08), transparent 70%),
    linear-gradient(180deg, #0b1220 0%, #0c1526 55%, #0a1220 100%);
  border-right: 1px solid rgba(255, 255, 255, .04);
  z-index: 50;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 18px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #6ee7b7; background: linear-gradient(145deg, rgba(110,231,183,.16), rgba(110,231,183,.05)); border: 1px solid rgba(110, 231, 183, .2); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.brand-copy strong { display: block; font-size: 17px; font-weight: 850; letter-spacing: .1em; line-height: 1.15; }
.brand-copy strong em { font-style: normal; color: #6ee7b7; font-size: 12px; letter-spacing: .12em; margin-left: 2px; }
.brand-copy small { display: block; color: #7f91aa; font-size: 10px; letter-spacing: .18em; margin-top: 3px; }
.sidebar-close { display: none; color: #aab8cc; }

.workspace-switcher {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .035);
  border-radius: 12px;
  color: #e7eef9;
  text-align: left;
  transition: background .18s ease, border-color .18s ease;
}
.workspace-switcher:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .13); }
.workspace-avatar { width: 31px; height: 31px; border-radius: 9px; background: linear-gradient(135deg, #2f5bea, #6d8dff); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.workspace-copy { flex: 1; min-width: 0; }
.workspace-copy strong { display: block; font-size: 12px; font-weight: 700; }
.workspace-copy small { display: block; color: #7f91aa; font-size: 10px; }
.workspace-switcher .icon { color: #7f91aa; }

.nav { margin-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.nav-label { padding: 0 10px 7px; font-size: 9px; letter-spacing: .18em; color: #63738c; font-weight: 700; text-transform: uppercase; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  margin-bottom: 3px;
  border-radius: 10px;
  color: #a8b6ca;
  font-size: 13px;
  font-weight: 560;
  transition: color .16s ease, background .16s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(47, 91, 234, .28), rgba(47, 91, 234, .1)); box-shadow: inset 0 0 0 1px rgba(109, 141, 255, .16); }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 4px 4px 0; background: #6ee7b7; box-shadow: 0 0 12px rgba(110, 231, 183, .6); }
.nav-icon { color: #7e90aa; display: grid; place-items: center; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: #bfdbfe; }
.nav-item.active .nav-icon { color: #6ee7b7; }
.nav-badge { margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 20px; background: #2f5bea; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.nav-badge.warn { background: rgba(245, 158, 11, .18); color: #fbbf24; }

.sidebar-status { margin-top: auto; margin-bottom: 14px; padding: 13px; border-radius: 14px; background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); border: 1px solid rgba(255, 255, 255, .07); }
.status-orbit { display: flex; align-items: center; gap: 9px; padding-bottom: 11px; border-bottom: 1px solid rgba(255,255,255,.07); }
.pulse-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .12); flex: none; }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(52, 211, 153, .35); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(2.1); opacity: 0; } }
.status-orbit strong { display: block; font-size: 11px; color: #e2e8f0; }
.status-orbit small { display: block; font-size: 9.5px; color: #7f91aa; }
.status-live { margin-left: auto; font-size: 8px; font-weight: 800; letter-spacing: .1em; color: #6ee7b7; border: 1px solid rgba(110,231,183,.25); background: rgba(110,231,183,.08); padding: 2px 5px; border-radius: 4px; }
.status-row { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 10.5px; color: #7f91aa; }
.status-row b { color: #dbe4f0; font-weight: 650; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 11px 8px 2px; border-top: 1px solid rgba(255,255,255,.07); }
.user-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #392c00; background: linear-gradient(145deg, #fde68a, #f5c400); }
.gold-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(145deg, #fff7d1, #f6c83d);
  border: 1px solid #eab308;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 3px 8px rgba(180, 83, 9, .12);
}
.gold-avatar svg { width: 90%; height: 90%; display: block; }
.topbar-gold-avatar { width: 32px; height: 32px; border-radius: 9px; }
.topbar-gold-avatar svg { width: 86%; height: 86%; }
.user-copy { flex: 1; min-width: 0; }
.user-copy strong { display: block; color: #e7eef9; font-size: 12px; }
.user-copy small { display: block; color: #7f91aa; font-size: 10px; }
.sidebar-user .icon-btn { color: #7f91aa; }
.sidebar-scrim { display: none; }

.main-area { margin-left: 258px; min-height: 100vh; display: flex; flex-direction: column; }

/* =========================================================
   Topbar
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 30px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.mobile-menu { display: none; }
.crumb { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.crumb strong { color: var(--ink-2); font-weight: 650; }
.crumb .icon { color: #b9c3d2; }
.topbar-search { position: relative; width: min(380px, 34vw); margin-left: 18px; }
.topbar-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #95a3b8; }
.topbar-search input {
  width: 100%;
  height: 38px;
  border: 1px solid #e6ebf3;
  border-radius: 10px;
  background: #f7f9fc;
  padding: 0 40px 0 37px;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.topbar-search input::placeholder { color: #9aa8ba; }
.topbar-search input:focus { background: #fff; border-color: #b9c8fb; box-shadow: 0 0 0 3px rgba(47, 91, 234, .08); }
.topbar-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 2px 5px; border: 1px solid #e2e8f0; border-bottom-width: 2px; border-radius: 5px; color: #94a3b8; font-size: 10px; background: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.topbar-divider { width: 1px; height: 27px; background: var(--line); margin: 0 5px; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding: 4px 5px 4px 4px; border: 0; background: transparent; border-radius: 10px; color: var(--ink); }
.topbar-user:hover { background: #f4f7fb; }
.topbar-user-copy { text-align: left; line-height: 1.2; }
.topbar-user-copy strong { display: block; font-size: 12px; font-weight: 650; white-space: nowrap; }
.topbar-user-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.topbar-user > .icon { color: #94a3b8; }
.notification-btn { position: relative; width: 36px; height: 36px; color: #516079; border: 1px solid #e8edf4; background: #fff; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 2px #fff; }
.mobile-search { display: none; }

/* =========================================================
   Common primitives
   ========================================================= */
.page { flex: 1; padding: 27px 30px 34px; max-width: 1680px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head h1 { margin: 4px 0 4px; font-size: 27px; letter-spacing: -.02em; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--brand); font-size: 9.5px; font-weight: 800; letter-spacing: .16em; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.page-footer a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 19px 21px 0; }
.card-head h2 { margin: 0 0 3px; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.card-head p { margin: 0; color: var(--muted); font-size: 11.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(47, 91, 234, .18); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { border-color: var(--line-strong); background: #fff; color: #41506a; }
.btn.ghost:hover { background: #f7f9fc; border-color: #c8d3e2; }
.btn.light { background: #fff; color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .16); }
.btn.light:hover { background: #f1f5ff; }
.btn.hero-ghost { border-color: rgba(255,255,255,.18); color: #dbe5f5; background: rgba(255,255,255,.05); }
.btn.hero-ghost:hover { background: rgba(255,255,255,.1); }
.btn.danger { background: var(--rose); color: #fff; }
.btn.danger:hover { background: #be123c; }
.btn.danger-ghost { border-color: #fecdd3; color: var(--rose); background: #fff7f9; width: 100%; }
.btn.danger-ghost:hover { background: #fff1f5; }
.btn.small { height: 32px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
.btn.tiny { height: 27px; padding: 0 8px; font-size: 10.5px; border-radius: 7px; gap: 5px; }
.btn.primary-soft { background: var(--brand-soft); color: var(--brand); border-color: #dfe7ff; }
.btn.primary-soft:hover { background: #e3e9ff; }
.btn.is-loading { pointer-events: none; }
.btn-count { background: rgba(15, 23, 42, .08); color: var(--ink); font-size: 10px; border-radius: 20px; padding: 1px 6px; margin-left: 2px; }
.sync-btn { border: 1px solid var(--line-strong); background: #fff; color: #3f4d64; }
.sync-btn:hover { border-color: #bcc9dc; background: #f8faff; }

.icon-btn {
  width: 33px;
  height: 33px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #68758b;
  transition: background .15s ease, color .15s ease;
}
button.mobile-menu, button.sidebar-close { display: none; }
.icon-btn:hover { background: #f1f5fa; color: var(--ink); }
.icon-btn:focus-visible, .btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; flex: none; }
.spinner.dark { border-color: #d8e0ec; border-top-color: var(--brand); width: 20px; height: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 320px; color: var(--muted); font-size: 12.5px; }
.error-state { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 60px 28px; text-align: center; }
.error-state.small { padding: 38px 24px; }
.error-icon { width: 54px; height: 54px; display: inline-grid; place-items: center; background: var(--rose-soft); color: var(--rose); border-radius: 16px; margin-bottom: 14px; }
.error-state h2, .error-state h3 { margin: 0 0 7px; font-size: 17px; }
.error-state p { color: var(--muted); margin: 0 0 18px; font-size: 12px; }

/* chips / badges */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.chip i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.chip-green { background: var(--green-soft); color: #0a7a5b; }
.chip-amber { background: var(--amber-soft); color: #a16207; }
.chip-blue { background: #eef4ff; color: #2058c7; }
.chip-rose { background: var(--rose-soft); color: #be123c; }
.chip-violet { background: var(--violet-soft); color: #6d28d9; }
.chip-slate { background: #f1f5f9; color: #526176; }
.badge-soft { padding: 3px 8px; border-radius: 6px; background: #f2f5fa; color: #64748b; font-size: 10px; font-weight: 650; }
.tag { display: inline-flex; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; color: #5b6b82; font-size: 9.5px; margin-right: 3px; }

/* avatars / thumbs / logos */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 10px; font-weight: 800; color: #334155; flex: none; }
.avatar-small { width: 29px; height: 29px; border-radius: 8px; font-size: 9px; }
.avatar-tiny { width: 23px; height: 23px; border-radius: 6px; font-size: 8px; }
.product-thumb { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; position: relative; overflow: hidden; flex: none; background: linear-gradient(145deg, color-mix(in srgb, var(--thumb), #fff 68%), color-mix(in srgb, var(--thumb), #fff 88%)); border: 1px solid color-mix(in srgb, var(--thumb), #fff 75%); }
.product-thumb::after { content: ""; position: absolute; width: 46px; height: 46px; border-radius: 50%; right: -19px; top: -19px; background: var(--thumb); opacity: .18; }
.product-thumb b { color: color-mix(in srgb, var(--thumb), #000 18%); font-size: 10px; font-weight: 850; letter-spacing: .02em; z-index: 1; }
.product-thumb-tiny { width: 28px; height: 28px; border-radius: 7px; }
.product-thumb-tiny b { font-size: 7.5px; }
.product-thumb-small { width: 34px; height: 34px; border-radius: 8px; }
.product-thumb-small b { font-size: 8px; }
.product-thumb.has-image {
  background: #fff;
  border-color: #e2e8f0;
}
.product-thumb.has-image::after { display: none; }
.product-thumb.has-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}
.image-zoom-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100000;
  width: 300px;
  height: 300px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #dbe4f0;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
}
.image-zoom-preview.show { opacity: 1; visibility: visible; }
.image-zoom-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.platform-logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 850; white-space: nowrap; }
.platform-logo.lazada { font-size: 15px; letter-spacing: -.045em; font-style: italic; gap: 0; }
.platform-logo.lazada.small { font-size: 11.5px; }
.platform-logo .lz-a { color: #1f4fd8; }
.platform-logo .lz-b { color: #f97316; }
.platform-logo.mercado { gap: 6px; }
.platform-logo.mercado .ml-mark { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; background: #ffe600; color: #333; font-size: 8px; font-weight: 900; letter-spacing: -.03em; }
.platform-logo.mercado .ml-word { font-size: 10.5px; line-height: 1; color: #1f2937; letter-spacing: -.02em; }
.platform-logo.mercado .ml-word b { color: #0b1220; }
.platform-logo.mercado.small .ml-mark { width: 17px; height: 17px; font-size: 7px; }
.platform-logo.mercado.small .ml-word { font-size: 8px; }
.platform-logo.generic { font-size: 12px; color: var(--muted); }
.platform-badge { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 9px; font-weight: 900; flex: none; }
.platform-badge.lazada { background: linear-gradient(145deg, #1f4fd8, #3d6ff2); color: #fff; font-style: italic; }
.platform-badge.mercado { background: #ffe600; color: #2b2b2b; font-size: 8px; letter-spacing: -.04em; }
.platform-badge.generic { background: #eef2f7; color: #475569; }

/* =========================================================
   Dashboard
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  padding: 28px 30px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(500px 240px at 86% 10%, rgba(47, 91, 234, .45), transparent 65%),
    radial-gradient(420px 260px at 10% 110%, rgba(16, 185, 129, .18), transparent 65%),
    linear-gradient(120deg, #0a1220, #101f3b 60%, #0c1830);
  box-shadow: 0 24px 50px rgba(11, 18, 32, .16);
}
.hero-copy { position: relative; z-index: 2; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: .06em; color: #9db0cb; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); padding: 5px 9px; border-radius: 20px; }
.hero-copy h1 { margin: 14px 0 7px; font-size: 28px; letter-spacing: -.025em; font-weight: 750; }
.hero-copy p { margin: 0; color: #a4b4cc; font-size: 13px; max-width: 650px; }
.hero-copy p b { color: #fff; font-weight: 700; }
.hero-actions { display: flex; gap: 9px; margin-top: 20px; }
.hero-side { display: flex; align-items: stretch; gap: 12px; position: relative; z-index: 2; }
.hero-date { width: 105px; border-radius: 15px; border: 1px solid rgba(255,255,255,.11); background: rgba(255,255,255,.055); backdrop-filter: blur(8px); padding: 12px; text-align: center; }
.hero-date span { display: block; color: #93a7c4; font-size: 9px; letter-spacing: .12em; }
.hero-date strong { display: block; color: #fff; font-size: 42px; line-height: 1.05; font-weight: 800; letter-spacing: -.04em; margin: 3px 0; }
.hero-date small { display: block; color: #9db0cb; font-size: 8.5px; white-space: nowrap; }
.hero-channels { display: flex; flex-direction: column; justify-content: center; gap: 8px; width: 196px; }
.hero-channel { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 9px 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.hero-channel .platform-logo.lazada { font-size: 12px; }
.hero-channel .platform-logo.mercado .ml-word { color: #e2e8f0; }
.hero-channel .platform-logo.mercado .ml-word b { color: #fff; }
.hero-channel > div { flex: 1; min-width: 0; }
.hero-channel strong { display: block; font-size: 10px; color: #eef4ff; }
.hero-channel small { display: block; color: #7f94b2; font-size: 8.5px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.12); flex: none; }
.hero-glow { position: absolute; right: 18%; bottom: -140px; width: 360px; height: 300px; border: 1px solid rgba(110,231,183,.13); border-radius: 50%; transform: rotate(-14deg); box-shadow: 0 0 100px rgba(47,91,234,.18), inset 0 0 90px rgba(47,91,234,.08); pointer-events: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.kpi-card { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 17px 18px; box-shadow: var(--shadow); min-height: 130px; }
.kpi-head { display: flex; align-items: center; gap: 9px; }
.kpi-icon { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; }
.tone-blue { background: #edf3ff; color: #2455d6; }
.tone-amber { background: #fff5e2; color: #b97b06; }
.tone-violet { background: #f2edff; color: #6d28d9; }
.tone-rose { background: #fff0f3; color: #be123c; }
.kpi-label { color: #5e6d83; font-size: 11.5px; font-weight: 600; }
.kpi-value { margin-top: 13px; font-size: 26px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.kpi-value small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 3px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 10.5px; flex-wrap: wrap; }
.kpi-foot .muted { font-size: 10px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 10px; padding: 2px 5px; border-radius: 4px; }
.delta.up { color: #07825f; background: #e7f9f1; }
.delta.down { color: #be123c; background: #fff0f3; }
.mini-status { display: inline-flex; align-items: center; gap: 3px; color: #0f9f77; font-size: 9.5px; margin-left: auto; }
.kpi-spark { position: absolute; right: 15px; bottom: 13px; width: 100px; height: 34px; opacity: .85; }
.sparkline { width: 100%; height: 100%; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .78fr); gap: 18px; margin-top: 18px; align-items: start; }
.dashboard-grid.lower { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .78fr); }
.chart-card { padding-bottom: 12px; }
.segmented { display: flex; background: #f4f7fb; border: 1px solid #edf1f7; border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 6px; color: #7a879c; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.chart-meta { display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 21px 0; }
.chart-meta > div:first-child span { display: block; color: var(--muted); font-size: 10px; }
.chart-meta strong { display: block; font-size: 22px; letter-spacing: -.035em; margin-top: 2px; }
.chart-legend { display: flex; gap: 14px; color: #64748b; font-size: 10.5px; padding-bottom: 3px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i, .legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sales-chart { padding: 2px 12px 0 6px; }
.chart-canvas { position: relative; width: 100%; }
.chart-canvas svg { width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #eef2f8; stroke-width: 1; }
.chart-axis { fill: #94a3b8; font-size: 9px; font-family: var(--font); }
.chart-cursor { stroke: #b8c6e2; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-hover-rect.active { fill: rgba(47, 91, 234, .025); }
.chart-tooltip { position: absolute; z-index: 4; width: 160px; background: #0f172a; color: #fff; border-radius: 9px; padding: 9px 10px; box-shadow: 0 12px 24px rgba(15,23,42,.2); transform: translateX(-50%); pointer-events: none; }
.tooltip-date { display: flex; justify-content: space-between; gap: 6px; color: #cbd5e1; font-size: 9.5px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 5px; }
.tooltip-date span { color: #94a3b8; }
.tooltip-row { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: #b8c5d8; padding: 2px 0; }
.tooltip-row b { margin-left: auto; color: #fff; font-size: 10px; }

.channel-card { padding-bottom: 16px; }
.channel-donut { display: flex; justify-content: center; padding: 14px 0 5px; }
.donut-wrap { position: relative; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center span { color: var(--muted); font-size: 9.5px; }
.donut-center strong { font-size: 19px; letter-spacing: -.03em; margin-top: 2px; }
.channel-legend { padding: 5px 21px 0; display: flex; flex-direction: column; gap: 12px; }
.channel-legend-head { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.channel-legend-head strong { font-weight: 650; }
.channel-legend-head span:last-child { margin-left: auto; color: var(--muted); font-size: 10px; }
.progress { height: 5px; border-radius: 5px; background: #f0f3f8; margin: 6px 0 4px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 5px; }
.channel-legend-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 9.5px; }
.channel-legend-foot b { color: var(--ink-2); font-size: 10px; }
.channel-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 20px 0; padding-top: 13px; border-top: 1px solid var(--line); }
.channel-foot span { display: block; color: var(--muted); font-size: 9px; }
.channel-foot b { display: block; font-size: 14px; margin-top: 2px; }

.recent-card { overflow: hidden; }
.compact-table { padding: 8px 8px 0; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th { text-align: left; color: #8491a5; font-size: 9.5px; font-weight: 650; letter-spacing: .04em; padding: 10px 12px; background: #f8fafc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th:first-child { border-left: 1px solid var(--line); border-radius: 8px 0 0 8px; }
.data-table th:last-child { border-right: 1px solid var(--line); border-radius: 0 8px 8px 0; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #f0f3f8; font-size: 11.5px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td, .data-table tr:hover td { background: #f9fbff; }
.data-table tr.selected td { background: #f2f6ff; }
.order-cell { display: flex; align-items: center; gap: 9px; min-width: 145px; }
.order-cell strong { display: block; font-size: 11px; font-weight: 700; color: #1e293b; white-space: nowrap; }
.order-cell span { display: block; color: #94a3b8; font-size: 9px; margin-top: 1px; white-space: nowrap; }
.buyer-cell { display: flex; align-items: center; gap: 7px; }
.buyer-cell strong { display: block; font-size: 10.5px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buyer-cell span { display: block; color: var(--muted); font-size: 9px; }
.amount-cell { min-width: 92px; }
.amount-cell strong { display: block; font-size: 11.5px; font-weight: 750; }
.amount-cell span { display: block; color: #94a3b8; font-size: 9px; margin-top: 1px; }
.time-cell { color: var(--muted); font-size: 10px; white-space: nowrap; }
.date-cell strong { display: block; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.date-cell span { display: block; color: #94a3b8; font-size: 9px; margin-top: 1px; }

.side-stack { display: flex; flex-direction: column; gap: 18px; }
.todo-card { padding-bottom: 8px; }
.todo-list { padding: 8px 10px 4px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); }
.todo-item:hover { background: #f8faff; }
.todo-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.todo-icon.amber { background: #fff5e2; color: #b97b06; }
.todo-icon.rose { background: #fff0f3; color: #be123c; }
.todo-icon.violet { background: #f2edff; color: #6d28d9; }
.todo-item > div { flex: 1; min-width: 0; }
.todo-item strong { display: block; font-size: 11px; font-weight: 650; }
.todo-item span { display: block; color: var(--muted); font-size: 9px; margin-top: 1px; }
.todo-item > b { font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.todo-item > .icon { color: #c0c9d6; }
.top-product-card { padding-bottom: 12px; }
.top-products { padding: 10px 16px 3px; }
.top-product { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.top-product-copy { width: 122px; min-width: 0; }
.top-product-copy strong { display: block; font-size: 9.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-product-copy span { display: block; color: #94a3b8; font-size: 8px; }
.top-product-bar { flex: 1; height: 4px; border-radius: 4px; background: #f0f3f8; overflow: hidden; }
.top-product-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2f5bea, #7d9bff); }
.top-product > b { width: 19px; text-align: right; font-size: 10px; color: #475569; }

/* =========================================================
   Orders
   ========================================================= */
.orders-toolbar, .shipment-toolbar, .inventory-toolbar { padding: 0; overflow: hidden; }
.tabs { display: flex; align-items: center; gap: 3px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 47px; padding: 0 12px; border: 0; background: transparent; color: #728096; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tab span { display: inline-grid; place-items: center; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 20px; background: #f1f5f9; color: #8492a6; font-size: 8.5px; font-weight: 700; }
.tab.active { color: var(--brand); }
.tab.active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand); }
.tab.active span { background: var(--brand-soft); color: var(--brand); }
.toolbar-row { display: flex; align-items: center; gap: 9px; padding: 13px 16px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.filter-pills { display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 8px; background: #f5f7fb; }
.filter-pill { display: inline-flex; align-items: center; gap: 5px; height: 27px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #718096; font-size: 10px; font-weight: 600; }
.filter-pill.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.09); }
.search-field { position: relative; display: flex; align-items: center; min-width: 210px; }
.search-field .icon { position: absolute; left: 10px; color: #9aa8bb; pointer-events: none; }
.search-field input { width: 100%; height: 33px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 0 10px 0 32px; font-size: 10.5px; outline: none; }
.search-field input:focus { border-color: #b8c7fb; box-shadow: 0 0 0 3px rgba(47,91,234,.07); }
.select-field { position: relative; display: flex; align-items: center; }
.select-field .icon { position: absolute; left: 9px; color: #8e9caf; pointer-events: none; }
.select-field select { height: 33px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: #516079; padding: 0 25px 0 29px; font-size: 10.5px; outline: none; appearance: none; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px; margin: 12px 0; background: #0f172a; color: #fff; border-radius: 10px; box-shadow: 0 8px 20px rgba(15,23,42,.13); }
.bulk-bar > div:first-child { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.bulk-bar b { color: #6ee7b7; }
.bulk-check { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: rgba(110,231,183,.14); color: #6ee7b7; }
.bulk-actions { display: flex; gap: 7px; }
.bulk-actions .btn.ghost { background: transparent; border-color: rgba(255,255,255,.2); color: #cbd5e1; }
.bulk-actions .btn.primary { background: #10b981; color: #042f24; box-shadow: none; }
.table-card { overflow: hidden; }
.orders-table-card { min-height: 300px; }
.orders-table th { padding-top: 9px; padding-bottom: 9px; }
.check-cell { width: 36px; padding-right: 0 !important; }
.checkbox { position: relative; display: inline-flex; width: 15px; height: 15px; }
.checkbox input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.checkbox span { width: 15px; height: 15px; border: 1.5px solid #cbd5e1; border-radius: 4px; background: #fff; display: block; transition: .15s ease; }
.checkbox input:checked + span { background: var(--brand); border-color: var(--brand); }
.checkbox input:checked + span::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.item-stack { display: flex; align-items: center; gap: 7px; }
.thumb-stack { display: flex; align-items: center; }
.thumb-stack .product-thumb { margin-right: -7px; border: 2px solid #fff; }
.thumb-stack .product-thumb:last-of-type { margin-right: 0; }
.thumb-more { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: #f1f5f9; color: #64748b; font-size: 8px; font-weight: 700; border: 2px solid #fff; margin-left: -4px; }
.item-count { color: var(--muted); font-size: 9px; white-space: nowrap; }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell .btn, .actions-cell .icon-btn { display: inline-flex; vertical-align: middle; }
.actions-cell .icon-btn { width: 29px; height: 29px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px 0; color: var(--muted); font-size: 10px; flex-wrap: wrap; }
.table-footer b { color: var(--ink); }
.pagination { display: flex; align-items: center; gap: 4px; }
.page-num { width: 28px; height: 28px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #64748b; font-size: 10px; font-weight: 600; }
.page-num:hover { background: #fff; border-color: var(--line-strong); }
.page-num.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.table-footer .btn:disabled { opacity: .4; }

/* =========================================================
   Shipments
   ========================================================= */
.fulfillment-strip { display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.fulfillment-stage { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-right: 14px; border-right: 1px solid var(--line); }
.fulfillment-stage > div { min-width: 0; }
.fulfillment-stage > div span { display: block; color: var(--muted); font-size: 9.5px; }
.fulfillment-stage > div strong { display: block; font-size: 18px; letter-spacing: -.03em; margin-top: 1px; }
.fulfillment-stage > .icon { margin-left: auto; color: #c3ccd9; }
.stage-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stage-icon.amber { background: #fff5e2; color: #b97b06; }
.stage-icon.blue { background: #edf3ff; color: #2455d6; }
.stage-icon.green { background: #e9f9f2; color: #07825f; }
.fulfillment-health { display: flex; align-items: center; gap: 10px; padding-left: 4px; width: 230px; }
.fulfillment-health > div:last-child strong { display: block; font-size: 10.5px; }
.fulfillment-health > div:last-child span { display: block; color: var(--muted); font-size: 8.5px; }
.health-ring { --rate: 0deg; width: 41px; height: 41px; border-radius: 50%; background: conic-gradient(#10b981 var(--rate), #eef2f7 var(--rate)); display: grid; place-items: center; position: relative; flex: none; }
.health-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.health-ring span { position: relative; font-size: 8px; font-weight: 800; }
.shipments-card { padding-bottom: 4px; }
.shipment-toolbar { padding-bottom: 0; }
.shipment-toolbar .tabs { border-bottom: 0; }
.shipment-toolbar .toolbar-row { border-bottom: 1px solid var(--line); }
.tracking-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.carrier-mini { width: 30px; height: 30px; border-radius: 8px; background: #f1f5fb; color: #4d6484; display: grid; place-items: center; flex: none; }
.tracking-cell strong { display: block; font-size: 10px; font-weight: 650; }
.tracking-cell span { display: block; color: #64748b; font-size: 9.5px; font-family: "SFMono-Regular", Consolas, monospace; margin-top: 1px; }
.event-cell span { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #475569; }
.event-cell small { display: block; color: #94a3b8; font-size: 8.5px; margin-top: 2px; }

/* =========================================================
   Inventory
   ========================================================= */
.inventory-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 15px; }
.inventory-stat { display: flex; align-items: center; gap: 11px; padding: 15px 16px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.inventory-stat.warning { border-color: #f9e3b1; background: linear-gradient(135deg, #fffdf7, #fff); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat-icon.blue { background: #edf3ff; color: #2455d6; }
.stat-icon.green { background: #e9f9f2; color: #07825f; }
.stat-icon.violet { background: #f2edff; color: #6d28d9; }
.stat-icon.amber { background: #fff5e2; color: #b97b06; }
.inventory-stat > div span { display: block; color: var(--muted); font-size: 9.5px; }
.inventory-stat > div strong { display: inline-block; font-size: 21px; letter-spacing: -.035em; margin-top: 1px; }
.inventory-stat > div small { color: var(--muted); font-size: 8.5px; margin-left: 3px; }
.stat-arrow { margin-left: auto; color: #b6c0cf; }
.stock-alert { display: flex; align-items: center; gap: 11px; padding: 11px 14px; margin-bottom: 15px; border: 1px solid #fae6ba; background: #fffbf1; border-radius: 11px; }
.stock-alert-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #fff2d4; color: #b97b06; flex: none; }
.stock-alert > div { flex: 1; }
.stock-alert strong { display: block; color: #8a5b02; font-size: 10.5px; }
.stock-alert p { margin: 1px 0 0; color: #a07a32; font-size: 9.5px; }
.inventory-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; }
.inventory-toolbar .tabs { border: 0; padding: 0; }
.inventory-toolbar .tab { height: 32px; padding: 0 9px; border-radius: 7px; }
.inventory-toolbar .tab.active { background: var(--brand-soft); }
.inventory-toolbar .tab.active::after { display: none; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.product-cell strong { display: block; font-size: 10.5px; font-weight: 650; }
.product-cell span { display: block; color: #94a3b8; font-size: 8.5px; margin-top: 2px; }
.stock-bar { min-width: 130px; }
.stock-bar-track { height: 5px; border-radius: 5px; background: #eef2f7; position: relative; overflow: visible; }
.stock-bar-track i { display: block; height: 100%; border-radius: 5px; background: #10b981; }
.stock-bar-track i.low { background: #f59e0b; }
.stock-bar-track i.out { background: #e11d48; }
.stock-bar-track i.healthy { background: #10b981; }
.stock-bar-track b { position: absolute; top: -2px; bottom: -2px; width: 1px; background: #94a3b8; opacity: .55; }
.stock-bar > span { display: block; color: #8492a6; font-size: 8.5px; margin-top: 4px; }
.reserved-count { display: inline-grid; place-items: center; min-width: 24px; height: 21px; padding: 0 5px; background: #f5f7fb; border-radius: 5px; color: #64748b; font-size: 9.5px; }
.inventory-bottom { margin-top: 18px; }
.inventory-logs { padding: 10px 18px 15px; }
.inventory-log { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f2f5f9; }
.inventory-log:last-child { border-bottom: 0; }
.log-icon { width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.log-icon.in { background: #e9f9f2; color: #07825f; }
.log-icon.out { background: #fff0f3; color: #be123c; }
.log-icon.alert { background: #fff5e2; color: #b97b06; }
.inventory-log > div { flex: 1; min-width: 0; }
.inventory-log strong { display: block; font-size: 10px; font-weight: 650; }
.inventory-log strong em { font-style: normal; margin-left: 4px; }
.inventory-log strong em.in { color: #07825f; }
.inventory-log strong em.out { color: #be123c; }
.inventory-log span { display: block; color: var(--muted); font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventory-log time { color: #a4afbf; font-size: 8.5px; white-space: nowrap; }
.stock-note-card { padding-bottom: 14px; }
.rule-list { padding: 10px 18px 4px; display: flex; flex-direction: column; gap: 12px; }
.rule-list > div { display: flex; gap: 9px; }
.rule-list > div > span { width: 28px; height: 28px; border-radius: 8px; background: #f5f7fb; color: #5d6b80; display: grid; place-items: center; flex: none; }
.rule-list strong { display: block; font-size: 10px; }
.rule-list p { margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

/* =========================================================
   Channels
   ========================================================= */
.channel-health-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 15px; margin-bottom: 16px; background: #0f172a; color: #dbe6f5; border-radius: 11px; }
.channel-health-bar > div:first-child { display: flex; align-items: center; gap: 8px; }
.channel-health-bar strong { font-size: 10.5px; color: #fff; }
.channel-health-bar > div:first-child > span:last-child { color: #7f94b2; font-size: 9px; }
.health-items { display: flex; align-items: center; gap: 15px; }
.health-items span { display: inline-flex; align-items: center; gap: 5px; color: #8fa2bd; font-size: 9px; }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-panel { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px 20px 0; box-shadow: var(--shadow); overflow: hidden; }
.channel-panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--channel); opacity: .85; }
.channel-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.channel-brand { display: flex; align-items: center; gap: 11px; }
.channel-brand h2 { margin: 0; font-size: 15px; font-weight: 750; }
.channel-brand p { margin: 1px 0 0; color: var(--muted); font-size: 9.5px; }
.channel-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.channel-desc { color: #64748b; font-size: 10.5px; line-height: 1.6; margin: 12px 0 14px; min-height: 34px; }
.channel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.channel-stats > div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.channel-stats span { display: block; color: var(--muted); font-size: 8.5px; }
.channel-stats strong { display: inline-block; font-size: 17px; letter-spacing: -.03em; margin-top: 1px; }
.channel-stats small { color: var(--muted); font-size: 8px; margin-left: 2px; }
.channel-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 20px; padding: 12px 0; }
.channel-meta span { display: block; color: #94a3b8; font-size: 8.5px; }
.channel-meta b { display: block; font-size: 9.5px; font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-error { display: flex; align-items: flex-start; gap: 5px; padding: 7px 9px; border-radius: 7px; background: #fff1f4; color: #be123c; font-size: 9px; margin-bottom: 10px; }
.channel-panel-foot { display: flex; align-items: center; gap: 7px; padding: 11px 0 12px; border-top: 1px solid var(--line); }
.channel-panel-foot .btn.primary { margin-left: auto; }
.channel-log-line { display: flex; align-items: center; gap: 6px; margin: 0 -20px; padding: 8px 20px; background: #fafbfd; border-top: 1px solid var(--line); color: #8492a6; font-size: 8.5px; }
.channel-log-line span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-log-line time { white-space: nowrap; color: #a4afbf; }
.channel-table-card { overflow: hidden; }
.channel-table { min-width: 1120px; }
.channel-table th, .channel-table td { padding: 12px 10px; vertical-align: middle; }
.channel-table .channel-index { width: 42px; text-align: center; color: var(--muted); font-size: 10px; }
.channel-store-cell { display: flex; align-items: center; gap: 9px; min-width: 210px; }
.channel-store-cell > div { min-width: 0; }
.channel-store-cell strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-store-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-mode-cell b { display: block; font-size: 10.5px; }
.channel-mode-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.channel-site-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 235px; }
.site-count-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: #f5f8ff; border: 1px solid #e0e8fb; color: #3b5bdb; font-size: 8.5px; }
.site-count-pill b { font-weight: 800; }
.site-count-pill em { font-style: normal; color: #64748b; }
.channel-sites small { display: block; margin-top: 4px; color: #a0aec0; font-size: 8px; }
.channel-status-cell { display: grid; justify-items: start; gap: 4px; max-width: 180px; }
.channel-status-cell small { display: block; max-width: 170px; color: var(--rose); font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-actions { white-space: nowrap; }
.channel-actions .btn { margin-right: 3px; }
.channel-actions .icon-btn { width: 27px; height: 27px; margin-right: 1px; }
.channel-actions-head { text-align: right; }
@media (max-width: 900px) {
  .channel-table { min-width: 900px; }
}
.sync-log-list { padding: 8px 18px 14px; }
.sync-log { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f1f4f9; }
.sync-log:last-child { border-bottom: 0; }
.log-status { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.log-status.success { background: #e9f9f2; color: #07825f; }
.log-status.error { background: #fff0f3; color: #be123c; }
.sync-log > div { flex: 1; min-width: 0; }
.sync-log strong { display: block; font-size: 9.5px; font-weight: 650; }
.sync-log strong span { color: #94a3b8; font-weight: 500; margin-left: 3px; }
.sync-log p { margin: 2px 0 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-log time { color: #a4afbf; font-size: 8px; white-space: nowrap; }
.integration-card { padding-bottom: 14px; }
.integration-steps { padding: 10px 20px 4px; }
.integration-steps > div { display: flex; gap: 10px; padding: 8px 0; }
.integration-steps > div > span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #f4f7fc; color: #6b7f9c; font-size: 8px; font-weight: 800; flex: none; }
.integration-steps strong { display: block; font-size: 10px; }
.integration-steps p { margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.integration-note { display: flex; gap: 7px; margin: 10px 20px 0; padding: 9px 10px; background: #f7faff; border: 1px solid #e6eefc; border-radius: 8px; color: #5d7292; font-size: 8.5px; line-height: 1.5; }
.integration-note .icon { color: #2f5bea; margin-top: 1px; }

/* =========================================================
   Settings
   ========================================================= */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.settings-main { display: flex; flex-direction: column; gap: 16px; }
.settings-side { display: flex; flex-direction: column; gap: 16px; }
.settings-card { padding: 20px; }
.settings-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.settings-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.settings-icon.blue { background: #edf3ff; color: #2455d6; }
.settings-icon.violet { background: #f2edff; color: #6d28d9; }
.settings-icon.amber { background: #fff5e2; color: #b97b06; }
.settings-icon.green { background: #e9f9f2; color: #07825f; }
.settings-icon.slate { background: #f1f5f9; color: #526176; }
.settings-icon.rose { background: #fff0f3; color: #be123c; }
.settings-card-head h2 { margin: 0; font-size: 14px; font-weight: 750; }
.settings-card-head p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { color: #506079; font-size: 10px; font-weight: 600; }
.field > span em { font-style: normal; color: #9aa8bb; font-weight: 400; font-size: 8.5px; margin-left: 4px; }
.field-hint { color: #94a3b8; font-size: 8.5px; margin-top: -1px; }
.input { width: 100%; height: 36px; border: 1px solid #dce3ed; border-radius: 8px; background: #fff; color: var(--ink); padding: 0 10px; font-size: 11px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.input:focus { border-color: #b8c7fb; box-shadow: 0 0 0 3px rgba(47,91,234,.07); }
.input::placeholder { color: #aab6c5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b98aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
textarea.input { height: auto; min-height: 78px; padding: 9px 10px; resize: vertical; }
.readonly-box { height: 36px; display: flex; align-items: center; gap: 6px; border: 1px dashed var(--line-strong); border-radius: 8px; background: #fafbfd; color: #64748b; padding: 0 10px; font-size: 10px; }
.toggle-list { margin-top: 16px; border-top: 1px solid var(--line); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid #f2f5f9; cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong { display: block; font-size: 10.5px; font-weight: 650; }
.toggle-row small { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 2; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: #dfe5ee; transition: .18s ease; }
.switch i::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .18s ease; }
.switch input:checked + i { background: #10b981; }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:disabled + i { opacity: .65; }
.system-card { padding: 18px; }
.system-list { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.system-list > div { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 9.5px; }
.system-list dt { color: var(--muted); }
.system-list dd { margin: 0; text-align: right; font-weight: 600; color: #334155; max-width: 60%; }
.system-list .path-value { font-size: 8px; font-family: Consolas, monospace; word-break: break-all; color: #64748b; font-weight: 400; }
.guide-card .check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; align-items: flex-start; gap: 6px; color: #536178; font-size: 9px; line-height: 1.45; }
.check-list .icon { color: #10b981; margin-top: 1px; }
.danger-card { padding: 18px; border-color: #f6dbe2; }
.danger-card p { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 0 0 12px; }

/* =========================================================
   Modal / drawer / popover
   ========================================================= */
.modal-overlay, .drawer-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(9, 16, 30, .48); backdrop-filter: blur(3px); display: flex; animation: fadeIn .15s ease; }
.modal-overlay { align-items: center; justify-content: center; padding: 22px; }
.modal { width: 540px; max-width: 100%; max-height: calc(100vh - 44px); background: #fff; border-radius: 17px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: modalIn .22s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.modal-small { width: 440px; }
.modal-large { width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 21px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.modal-body { padding: 19px 21px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 21px; border-top: 1px solid var(--line); background: #fbfcfe; }
#modal-root.is-closing .modal-overlay, #drawer-root.is-closing .drawer-overlay { animation: fadeOut .15s ease forwards; }
#modal-root.is-closing .modal { animation: modalOut .15s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(6px) scale(.99); } }
.modal-inline-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; padding: 9px 10px; border-radius: 7px; background: #fff1f4; color: #be123c; font-size: 10px; line-height: 1.45; }
.modal-inline-error.success { background: #ecfdf5; color: #047857; }
.inline-note { display: flex; gap: 7px; padding: 9px 10px; margin: 12px 0; border: 1px solid #e2ecff; background: #f7faff; border-radius: 8px; color: #526b8f; font-size: 9.5px; line-height: 1.5; }
.inline-note .icon { color: var(--brand); margin-top: 1px; }
.inline-note.warning { border-color: #fae7bf; background: #fffbf2; color: #8a6113; }
.inline-note.warning .icon { color: #d68a06; }
.inline-note strong { font-weight: 750; }
.inline-note.warning strong { color: #7a4e00; }

.drawer-overlay { justify-content: flex-end; }
.drawer { width: 470px; max-width: 100%; height: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(15,23,42,.18); animation: drawerIn .26s cubic-bezier(.2,.8,.2,1); }
.drawer-wide { width: 590px; }
#drawer-root.is-closing .drawer { animation: drawerOut .18s ease forwards; }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawerOut { to { transform: translateX(100%); } }
.drawer-head { position: relative; padding: 21px 23px 17px; border-bottom: 1px solid var(--line); }
.drawer-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.drawer-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.drawer-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.drawer-close { position: absolute; right: 16px; top: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 23px 24px; background: #fbfcfe; }
.drawer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 23px; border-top: 1px solid var(--line); background: #fff; }
.drawer-loading { display: flex; align-items: center; justify-content: center; gap: 9px; height: 100%; color: var(--muted); font-size: 11px; }
.drawer-error { padding: 60px 30px; text-align: center; }
.drawer-error > span { width: 52px; height: 52px; display: inline-grid; place-items: center; border-radius: 15px; background: #fff0f3; color: #be123c; margin-bottom: 12px; }
.drawer-error h3 { margin: 0 0 5px; }
.drawer-error p { color: var(--muted); font-size: 10px; margin: 0 0 16px; }
.popover { position: absolute; top: calc(100% + 9px); right: 0; z-index: 70; width: 330px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 20px 50px rgba(15,23,42,.16); overflow: hidden; animation: popIn .14s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.popover-wrap { position: relative; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); }
.popover-head strong { font-size: 11px; }
.popover-loading, .popover-empty { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 28px 16px; color: var(--muted); font-size: 10px; }
.notification-list { max-height: 330px; overflow-y: auto; }
.notification-item { display: flex; gap: 8px; padding: 11px 14px; border-bottom: 1px solid #f2f5f9; }
.notification-item:last-child { border-bottom: 0; }
.notify-icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.notify-icon.success { background: #e9f9f2; color: #07825f; }
.notify-icon.error { background: #fff0f3; color: #be123c; }
.notification-item > div { min-width: 0; }
.notification-item strong { display: block; font-size: 9.5px; }
.notification-item p { margin: 2px 0 2px; color: #64748b; font-size: 9px; line-height: 1.4; }
.notification-item small { color: #a4afbf; font-size: 8px; }
.popover-foot { width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px; border: 0; border-top: 1px solid var(--line); background: #fbfcfe; color: var(--brand); font-size: 9.5px; font-weight: 600; }

/* =========================================================
   Toasts / empty / skeleton
   ========================================================= */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: 390px; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 11px; background: #0f172a; color: #fff; box-shadow: 0 16px 36px rgba(15,23,42,.22); animation: toastIn .22s cubic-bezier(.2,.8,.2,1); }
.toast-out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px) scale(.98); } }
.toast-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.toast-success .toast-icon { background: rgba(16,185,129,.17); color: #6ee7b7; }
.toast-error .toast-icon { background: rgba(244,63,94,.18); color: #fda4af; }
.toast-info .toast-icon, .toast-warning .toast-icon { background: rgba(245,158,11,.18); color: #fcd34d; }
.toast-copy { flex: 1; padding-top: 1px; }
.toast-copy strong { display: block; font-size: 10.5px; margin-bottom: 1px; }
.toast-copy span { display: block; color: #cbd5e1; font-size: 9.5px; line-height: 1.45; }
.toast-close { color: #94a3b8; width: 22px; height: 22px; }
.toast-close:hover { background: rgba(255,255,255,.1); color: #fff; }

.empty-state { text-align: center; padding: 45px 22px; }
.empty-state.compact { padding: 28px 20px; }
.empty-icon { width: 52px; height: 52px; display: inline-grid; place-items: center; border-radius: 15px; background: #f2f6fc; color: #7f91aa; margin-bottom: 11px; }
.empty-state h3 { margin: 0 0 4px; font-size: 13px; }
.empty-state p { margin: 0 auto 14px; max-width: 320px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.empty-inline { text-align: center; color: var(--muted); font-size: 10px; padding: 24px; }
.skeleton-table { padding: 12px; }
.skeleton-row { display: flex; gap: 16px; padding: 13px 8px; border-bottom: 1px solid #f2f5f9; }
.skeleton { display: block; height: 11px; border-radius: 5px; background: linear-gradient(90deg, #f0f3f8 25%, #f8fafc 50%, #f0f3f8 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* =========================================================
   Forms / misc components
   ========================================================= */
.form-section { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.form-section-head h3 { margin: 0; font-size: 11.5px; font-weight: 750; }
.form-section-head > span { color: var(--muted); font-size: 8.5px; }
.secure-tag { display: inline-flex; align-items: center; gap: 3px; color: #07825f !important; background: #e9f9f2; border-radius: 4px; padding: 2px 5px; }
.ship-summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
.ship-summary-icon { width: 36px; height: 36px; border-radius: 9px; background: #edf3ff; color: #2455d6; display: grid; place-items: center; flex: none; }
.ship-summary > div { flex: 1; }
.ship-summary strong { display: block; font-size: 10.5px; }
.ship-summary p { margin: 1px 0 0; color: var(--muted); font-size: 9px; }
.ship-summary > b { font-size: 14px; }
.form-grid + .inline-note { margin-bottom: 0; }
.check-row { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; color: #526176; font-size: 10px; }
.check-row input { accent-color: var(--brand); }
.ship-tip { display: flex; align-items: center; gap: 5px; color: #8492a6; font-size: 8.5px; margin-top: 9px; }
.bulk-summary { display: flex; gap: 10px; padding: 11px; background: #f7faff; border: 1px solid #e6eefc; border-radius: 9px; margin-bottom: 14px; }
.bulk-icon { width: 38px; height: 38px; border-radius: 10px; background: #e9f0ff; color: #2455d6; display: grid; place-items: center; flex: none; }
.bulk-summary strong { display: block; font-size: 10.5px; }
.bulk-summary p { margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.mode-select { display: flex; flex-direction: column; gap: 8px; }
.mode-card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.mode-card.active { border-color: #9eb5fb; background: #f7faff; box-shadow: 0 0 0 3px rgba(47,91,234,.05); }
.mode-card input { position: absolute; opacity: 0; }
.mode-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #f3eeff; color: #6d28d9; flex: none; }
.mode-icon.live { background: #e9f9f2; color: #07825f; }
.mode-card > div { flex: 1; }
.mode-card strong { display: block; font-size: 10.5px; }
.mode-card p { margin: 2px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.4; }
.radio-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #cbd5e1; margin-top: 7px; flex: none; position: relative; }
.mode-card.active .radio-dot { border-color: var(--brand); }
.mode-card.active .radio-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.oauth-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 11px; border: 1px dashed #ccd8ef; border-radius: 8px; background: #fbfcff; }
.oauth-box strong { display: block; font-size: 9.5px; }
.oauth-box p { margin: 2px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.4; }
.oauth-wait { text-align: center; }
.oauth-wait-icon { display: flex; justify-content: center; margin-bottom: 12px; transform: scale(1.15); }
.oauth-wait h3 { margin: 0 0 5px; font-size: 15px; letter-spacing: -.02em; }
.oauth-wait > p { margin: 0 auto 15px; max-width: 350px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.oauth-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 16px 0; }
.oauth-step { padding: 10px 7px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.oauth-step span { width: 19px; height: 19px; display: grid; place-items: center; margin: 0 auto 6px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 8px; font-weight: 800; }
.oauth-step b { display: block; font-size: 9px; }
.oauth-step small { display: block; color: var(--muted); font-size: 7.5px; margin-top: 2px; }
.oauth-callback { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px; background: #f6f8fc; text-align: left; margin-bottom: 10px; }
.oauth-callback span { color: #94a3b8; font-size: 8px; white-space: nowrap; }
.oauth-callback code { color: #4f627f; font-family: Consolas, monospace; font-size: 8px; word-break: break-all; }
.oauth-status { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 8px; background: #ecfdf5; color: #047857; font-size: 10px; font-weight: 600; }
.oauth-status .spinner.dark { width: 16px; height: 16px; border-color: #b7e6d8; border-top-color: #07825f; }
.oauth-status.is-error { background: #fff1f4; color: #be123c; }
.oauth-wait .modal-inline-error { text-align: left; }
.redirect-box p { font-family: Consolas, monospace; word-break: break-all; color: #4f627f; }
.token-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 0; font-size: 9px; color: var(--muted); }
.token-status b { color: #526176; font-weight: 600; }
.info-panel { display: flex; gap: 9px; margin-top: 18px; padding: 11px; border-radius: 9px; background: #f8fafc; border: 1px solid var(--line); }
.info-panel-icon { width: 28px; height: 28px; border-radius: 7px; background: #edf3ff; color: #2455d6; display: grid; place-items: center; flex: none; }
.info-panel strong { display: block; font-size: 9.5px; }
.info-panel ol { margin: 4px 0 5px; padding-left: 14px; color: var(--muted); font-size: 8.5px; line-height: 1.55; }
.info-panel a { display: inline-flex; align-items: center; gap: 3px; font-size: 8.5px; font-weight: 600; }
.stock-current { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 11px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 14px; }
.stock-current > div + div { border-left: 1px solid var(--line); padding-left: 10px; }
.stock-current span { display: block; color: var(--muted); font-size: 8.5px; }
.stock-current strong { display: inline-block; font-size: 19px; letter-spacing: -.03em; }
.stock-current small { color: var(--muted); font-size: 8px; margin-left: 2px; }
.stepper { display: flex; gap: 4px; }
.stepper input { text-align: center; width: 80px; }
.stepper button { height: 36px; min-width: 42px; border: 1px solid #dce3ed; background: #f8fafc; border-radius: 7px; color: #526176; font-size: 9.5px; font-weight: 600; }
.stepper button:hover { background: #eef3fb; }
.quick-preview { margin-top: 11px; padding: 8px 10px; border-radius: 7px; background: #ecfdf5; color: #047857; font-size: 9.5px; }
.quick-preview.danger { background: #fff1f4; color: #be123c; }
.confirm-body { display: flex; gap: 12px; align-items: flex-start; }
.confirm-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.confirm-icon.danger { background: #fff0f3; color: #be123c; }
.confirm-icon.primary { background: #edf3ff; color: #2455d6; }
.confirm-message { margin: 4px 0 0; font-size: 11px; line-height: 1.55; }
.confirm-detail { margin: 7px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }

/* =========================================================
   Order drawer details
   ========================================================= */
.drawer-platform { display: inline-flex; }
.action-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid #fae6ba; background: linear-gradient(120deg, #fffbf1, #fff); border-radius: 10px; }
.action-banner strong { display: block; font-size: 10.5px; color: #8a5b02; }
.action-banner p { margin: 2px 0 0; color: #a07a32; font-size: 9px; }
.action-banner.danger { border-color: #fbd5de; background: linear-gradient(120deg, #fff5f7, #fff); }
.action-banner.danger strong { color: #9f1239; }
.action-banner.danger p { color: #b04a65; }
.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; margin-bottom: 12px; }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; margin-bottom: 12px; }
.detail-grid .detail-card { margin-bottom: 0; }
.section-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-mini-head h3 { margin: 0; font-size: 10px; font-weight: 750; letter-spacing: .02em; }
.section-mini-head .muted { font-size: 8.5px; }
.customer-line { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid #f2f5f9; margin-bottom: 9px; }
.customer-line strong { display: block; font-size: 10.5px; }
.customer-line small { display: block; color: var(--muted); font-size: 8.5px; }
.info-lines { display: flex; flex-direction: column; gap: 6px; }
.info-lines > div { display: flex; align-items: flex-start; gap: 6px; color: #5c6b81; font-size: 9px; line-height: 1.45; }
.info-lines .icon { color: #94a3b8; margin-top: 1px; }
.info-list { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.info-list > div { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; }
.info-list dt { color: var(--muted); white-space: nowrap; }
.info-list dd { margin: 0; text-align: right; color: #3f4f66; font-weight: 550; }
.detail-items { display: flex; flex-direction: column; gap: 9px; padding-bottom: 11px; border-bottom: 1px dashed var(--line); }
.detail-item { display: flex; align-items: center; gap: 8px; }
.detail-item-copy { flex: 1; min-width: 0; }
.detail-item-copy strong { display: block; font-size: 9.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-item-copy span { display: block; color: #94a3b8; font-size: 8px; margin-top: 1px; }
.qty-pill { width: 24px; height: 21px; display: grid; place-items: center; border-radius: 5px; background: #f4f7fb; color: #64748b; font-size: 8.5px; font-weight: 600; }
.detail-item > b { min-width: 64px; text-align: right; font-size: 9.5px; font-weight: 650; }
.payment-summary { padding-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.payment-summary > div { display: flex; justify-content: space-between; font-size: 9px; color: #64748b; }
.payment-summary b { color: #334155; font-weight: 600; }
.payment-summary b.discount { color: #0f9f77; }
.payment-summary .total { margin-top: 3px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink); font-size: 10.5px; font-weight: 700; }
.payment-summary .total b { font-size: 14px; letter-spacing: -.02em; }
.payment-summary .cny-total { color: var(--muted); font-size: 8.5px; }
.payment-summary .cny-total b { font-size: 9.5px; }
.logistics-box { padding: 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 11px; }
.logistics-head { display: flex; align-items: center; gap: 8px; }
.carrier-icon { width: 33px; height: 33px; border-radius: 8px; background: #edf3ff; color: #2455d6; display: grid; place-items: center; flex: none; }
.logistics-head > div { flex: 1; }
.logistics-head strong { display: block; font-size: 9.5px; }
.logistics-head p { margin: 1px 0 0; color: #64748b; font-size: 9px; font-family: Consolas, monospace; }
.tracking-copy { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: #64748b; font-size: 8px; cursor: pointer; }
.tracking-copy:hover { color: var(--brand); }
.timeline { position: relative; padding-left: 15px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 9px; width: 1px; background: #e4eaf3; }
.timeline.compact { padding-left: 14px; }
.timeline-item { position: relative; padding: 0 0 13px 8px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -14px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.timeline-item.active .timeline-dot { background: #10b981; box-shadow: 0 0 0 1px #10b981, 0 0 0 4px rgba(16,185,129,.1); }
.timeline-item strong { display: block; font-size: 9.5px; font-weight: 650; }
.timeline-item p { margin: 1px 0; color: #7a879b; font-size: 8.5px; }
.timeline-item time { color: #a4afbf; font-size: 8px; }
.empty-shipment { display: flex; align-items: center; gap: 9px; padding: 11px; background: #f8fafc; border: 1px dashed var(--line-strong); border-radius: 8px; color: #7b8a9f; margin-bottom: 11px; }
.empty-shipment strong { display: block; font-size: 9.5px; color: #526176; }
.empty-shipment p { margin: 1px 0 0; font-size: 8.5px; }
.note-card p { margin: 0; color: #536178; font-size: 9.5px; line-height: 1.55; background: #fbf8ee; border: 1px solid #f3e8c7; border-radius: 7px; padding: 8px 9px; }
.drawer-actions-stack { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.drawer-actions-stack .btn { justify-content: flex-start; }
.tracking-overview { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tracking-big-icon { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; background: #edf3ff; color: #2455d6; flex: none; }
.tracking-overview span { display: block; color: var(--muted); font-size: 8.5px; }
.tracking-overview strong { display: block; font-size: 12px; margin-top: 1px; }
.tracking-overview p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.tracking-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding-top: 12px; }
.tracking-meta-grid span { display: block; color: var(--muted); font-size: 8px; }
.tracking-meta-grid b { display: block; font-size: 9px; font-weight: 600; margin-top: 1px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1320px) {
  .page { padding: 24px 24px 32px; }
  .topbar { padding: 0 24px; }
  .hero-side { display: none; }
  .hero { grid-template-columns: 1fr; }
  .dashboard-grid, .dashboard-grid.lower { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); }
  .settings-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-grid { grid-template-columns: 1fr; }
  .channel-panel { max-width: none; }
  .fulfillment-health { width: 190px; }
  .topbar-search { width: min(300px, 30vw); margin-left: 8px; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 50px rgba(15,23,42,.2); }
  .sidebar.open { transform: none; }
  button.sidebar-close { display: inline-grid; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(9,16,30,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; backdrop-filter: blur(2px); }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .main-area { margin-left: 0; }
  button.mobile-menu { display: inline-grid; }
  .topbar { gap: 10px; padding: 0 18px; }
  .crumb { display: none; }
  .topbar-search { margin-left: 0; flex: 1; width: auto; }
  .topbar-user-copy { display: none; }
  .topbar-divider { display: none; }
  .page { padding: 20px 18px 30px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-actions { width: 100%; }
  .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-side .danger-card { grid-column: 1 / -1; }
  .channel-health-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .health-items { flex-wrap: wrap; gap: 9px 14px; }
}
@media (max-width: 760px) {
  .topbar { height: 62px; }
  .sync-btn span { display: none; }
  .sync-btn { width: 36px; padding: 0; height: 36px; }
  .topbar-search { display: none; }
  .mobile-search { display: flex; position: relative; padding: 9px 18px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
  .mobile-search .search-icon { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); color: #95a3b8; }
  .mobile-search input { width: 100%; height: 35px; border: 1px solid #e6ebf3; border-radius: 9px; background: #f7f9fc; padding: 0 11px 0 34px; font-size: 11px; outline: none; }
  .topbar-actions { gap: 4px; }
  .topbar-user { padding: 2px; }
  .topbar-user > .icon { display: none; }
  .page-head h1 { font-size: 23px; }
  .hero { padding: 22px 20px; border-radius: 16px; }
  .hero-copy h1 { font-size: 23px; }
  .hero-copy p { font-size: 11.5px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px; min-height: 118px; }
  .kpi-value { font-size: 21px; }
  .kpi-spark { display: none; }
  .fulfillment-strip { flex-wrap: wrap; gap: 12px; }
  .fulfillment-stage { flex: 1 1 40%; border-right: 0; padding-right: 0; }
  .fulfillment-health { width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
  .inventory-toolbar { flex-direction: column; align-items: stretch; }
  .shipment-toolbar .toolbar-row { padding-top: 0; }
  .data-table th, .data-table td { padding-left: 9px; padding-right: 9px; }
  .orders-table { min-width: 900px; }
  .shipments-card .data-table { min-width: 830px; }
  .inventory-card .data-table { min-width: 760px; }
  .search-field { flex: 1; min-width: 150px; }
  .settings-side { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { width: 100%; max-height: calc(100vh - 20px); border-radius: 17px 17px 13px 13px; }
  .modal-foot { padding-bottom: max(13px, env(safe-area-inset-bottom)); }
  .toast-root { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .channel-stats strong { font-size: 15px; }
  .channel-meta { grid-template-columns: 1fr; gap: 6px; }
  .page-footer { flex-direction: column; align-items: flex-start; }
  .table-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .recent-card .data-table th:nth-child(2),
  .recent-card .data-table td:nth-child(2),
  .recent-card .data-table th:nth-child(5),
  .recent-card .data-table td:nth-child(5) { display: none; }
  .recent-card .order-cell { min-width: 0; }
  .recent-card .data-table td { padding-left: 8px; padding-right: 8px; }
  .recent-card .amount-cell { min-width: 74px; }
}
@media (max-width: 480px) {
  .page { padding: 17px 13px 28px; }
  .topbar { padding: 0 13px; }
  .mobile-search { padding: 8px 13px; }
  .hero-copy h1 { font-size: 21px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-actions .btn { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 104px; padding: 13px 12px; }
  .kpi-value { font-size: 19px; }
  .kpi-label { font-size: 10.5px; }
  .kpi-foot { gap: 4px; }
  .kpi-foot .muted { font-size: 8.5px; }
  .inventory-stat { padding: 12px; }
  .inventory-stat > div strong { font-size: 18px; }
  .stat-icon { width: 31px; height: 31px; }
  .inventory-toolbar { padding: 10px 12px; }
  .tabs { padding: 0 10px; }
  .tab { padding: 0 9px; }
  .toolbar-row { padding: 11px 11px; }
  .filter-pills { width: 100%; }
  .filter-pill { flex: 1; justify-content: center; }
  .search-field { width: 100%; }
  .toolbar-spacer { display: none; }
  .actions-cell .btn span { display: none; }
  .settings-card { padding: 16px; }
  .stock-current { grid-template-columns: 1fr 1fr 1fr; }
  .info-panel { display: none; }
  .channel-panel { padding: 16px 15px 0; }
  .channel-log-line { margin: 0 -15px; padding: 8px 15px; }
}

/* Mercado listing workspace */
.listing-thumb {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
  flex: none;
}
.listing-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-2);
}
.listing-product strong {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listing-product small,
.listing-category + small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.listing-error {
  color: var(--rose) !important;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listing-category {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 11px;
}
.check-cell { width: 34px; text-align: center; }
.check-cell input { width: 14px; height: 14px; accent-color: var(--blue); }
.listing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.listing-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.listing-edit-grid .span-2 { grid-column: span 2; }
.listing-edit-grid .field { margin: 0; }
.inline-triple { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.publish-results { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow: auto; }
.publish-result {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.publish-result.ok > span { color: var(--green); }
.publish-result.bad > span { color: var(--rose); }
.publish-result strong { display: block; font-size: 11.5px; }
.publish-result p { margin: 3px 0 0; color: var(--muted); font-size: 10px; word-break: break-word; }
@media (max-width: 760px) {
  .listing-edit-grid { grid-template-columns: 1fr; }
  .listing-edit-grid .span-2 { grid-column: span 1; }
  .listing-product strong { max-width: 190px; }
  .listing-category { max-width: 110px; }
  .listing-footer { padding: 10px 12px; }
}

.orders-table .order-stage-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
}
.orders-table .store-chip {
  display: inline-block;
  max-width: 130px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f1f5ff;
  border: 1px solid #dbe5ff;
  color: #3b5bdb;
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.label-printed-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.deadline-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.deadline-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
}
.deadline-chip.urgent { color: #b45309; }
.deadline-chip.urgent::before { background: #f59e0b; }
.deadline-chip.overdue { color: #be123c; }
.deadline-chip.overdue::before { background: #f43f5e; }

/* Warehouse dispatch workspace */
.dispatch-layout {
  display: grid;
  grid-template-columns: minmax(280px, 310px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.dispatch-queue {
  position: sticky;
  top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.dispatch-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}
.dispatch-queue-head strong { font-size: 12px; }
.dispatch-queue-head span { color: var(--muted); font-size: 10px; }
.dispatch-queue-list { max-height: calc(100vh - 230px); overflow: auto; padding: 8px; }
.dispatch-order {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.dispatch-order:hover { background: #f7f9fd; }
.dispatch-order.active {
  border-color: #bfd4ff;
  background: #f1f6ff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
}
.dispatch-order-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dispatch-order-top strong {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dispatch-order-top span { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.dispatch-order-main { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dispatch-order-main > div { min-width: 0; flex: 1; }
.dispatch-order-main strong { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dispatch-order-main span, .dispatch-order-main small { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.dispatch-order-main b { font-size: 10px; white-space: nowrap; }
.dispatch-main { min-width: 0; display: grid; gap: 14px; }
.dispatch-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.dispatch-workspace-head h2 { margin: 2px 0 4px; font-size: 20px; letter-spacing: -.03em; }
.dispatch-workspace-head p { margin: 0; color: var(--muted); font-size: 11px; }
.dispatch-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dispatch-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; }
.dispatch-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  padding: 14px;
}
.dispatch-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dispatch-card-head h3 { margin: 0; font-size: 12px; }
.dispatch-card-head span { color: var(--muted); font-size: 10px; }
.dispatch-items { display: grid; gap: 8px; }
.dispatch-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
}
.dispatch-item > div { min-width: 0; flex: 1; }
.dispatch-item strong { display: block; font-size: 10.5px; line-height: 1.35; }
.dispatch-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.dispatch-item > span, .dispatch-item > b { white-space: nowrap; font-size: 10px; }
.dispatch-address { display: flex; gap: 10px; align-items: flex-start; }
.dispatch-avatar { flex: none; }
.dispatch-address strong { display: block; font-size: 11.5px; }
.dispatch-address p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.dispatch-ship-card { display: grid; gap: 11px; }
.dispatch-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.dispatch-form .check-row { margin: 4px 0; white-space: nowrap; }
.dispatch-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.dispatch-submit > span { color: var(--muted); font-size: 10px; }
.modal-inline-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  font-size: 10px;
  line-height: 1.5;
}
@media (max-width: 1200px) {
  .dispatch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .dispatch-layout { grid-template-columns: 1fr; }
  .dispatch-queue { position: static; }
  .dispatch-queue-list { max-height: 280px; }
  .dispatch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .dispatch-form { grid-template-columns: 1fr; }
  .dispatch-submit { flex-direction: column; align-items: stretch; }
}

