/* ============================================================================
   VANTRO COMMAND CENTER — Admin design system
   Dark-first. Deep black / charcoal surfaces. Electric-lime accent used ONLY
   for live / active / success / interactive states. Cool-gray text hierarchy.
   Buildless: pure CSS custom properties, no framework, no CDN.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ---- Surfaces (deep black → graphite) ---- */
  --void:        #050506;   /* app background, deepest */
  --near-black:  #0a0b0d;   /* base panels */
  --charcoal:    #101216;   /* raised panels */
  --graphite:    #171a20;   /* cards */
  --graphite-2:  #1d2129;   /* hover / inputs */
  --line:        #262b34;   /* hairline borders */
  --line-soft:   #1b1f27;

  /* ---- Text ---- */
  --ink:         #f4f6f8;   /* primary */
  --ink-2:       #aeb6c2;   /* secondary */
  --ink-3:       #6c7480;   /* tertiary / captions */
  --ink-4:       #464d59;   /* disabled / faint */

  /* ---- Accent: electric lime (strategic only) ---- */
  --lime:        #c8ff00;
  --lime-bright: #d6ff3d;
  --lime-dim:    #97be08;
  --lime-glow:   rgba(200, 255, 0, 0.16);
  --lime-glow-2: rgba(200, 255, 0, 0.06);

  /* ---- Semantic (kept desaturated / premium, not "gaming") ---- */
  --ok:      #46e6a0;   /* delivered / paid / success */
  --ok-bg:   rgba(70, 230, 160, 0.10);
  --warn:    #ffb454;   /* pending / processing */
  --warn-bg: rgba(255, 180, 84, 0.10);
  --info:    #5bb8ff;   /* shipped / info */
  --info-bg: rgba(91, 184, 255, 0.10);
  --bad:     #ff5f6d;   /* cancelled / failed / danger */
  --bad-bg:  rgba(255, 95, 109, 0.10);
  --violet:  #b98bff;   /* confirmed */
  --violet-bg: rgba(185, 139, 255, 0.10);

  /* ---- Radius / spacing / shadow ---- */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 10px 30px -12px rgba(0,0,0,0.7);
  --shadow-pop: 0 24px 60px -18px rgba(0,0,0,0.8);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 62px;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--void);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  width: 100vw;
  max-width: 100%;
}

/* Ambient background: faint grid + radial lime bloom top-left */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 600px at -5% -10%, var(--lime-glow-2), transparent 60%),
    radial-gradient(900px 500px at 105% 0%, rgba(91,184,255,0.04), transparent 55%),
    linear-gradient(transparent 0 31px, var(--line-soft) 31px) 0 0 / 100% 32px,
    linear-gradient(90deg, transparent 0 31px, var(--line-soft) 31px) 0 0 / 32px 100%;
  opacity: 0.5;
  mask-image: radial-gradient(circle at 30% 10%, #000 0%, transparent 75%);
}

/* Drag and Drop Styles */
.dragging {
  opacity: 0.5;
}
.drag-over {
  border: 2px dashed var(--lime);
  background: rgba(200, 255, 0, 0.05);
}
.up-thumb[draggable="true"], .prod-card[draggable="true"], tr[draggable="true"] {
  cursor: grab;
}
.up-thumb[draggable="true"]:active, .prod-card[draggable="true"]:active, tr[draggable="true"]:active {
  cursor: grabbing;
}

/* ============================ PUBLIC SCREEN (REVIEWS) ===================== */
.public-screen {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 600px at 50% -10%, rgba(200,255,0,0.06), transparent 60%), var(--void);
  overflow-y: auto;
}
.public-screen[hidden] { display: none !important; }
.public-card {
  width: min(520px, 100%); background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px 28px; box-shadow: var(--shadow-pop);
}
.star-rating {
  display: flex; gap: 10px; font-size: 34px; cursor: pointer; color: var(--line); user-select: none;
}
.star-rating span {
  transition: transform 0.15s ease, color 0.15s ease;
  display: inline-block;
}
.star-rating span:hover {
  transform: scale(1.22);
}

/* Toast & Notification Stack */
.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 48px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #111215;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  color: var(--ink-1);
  font-size: 13px;
  font-weight: 500;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.ok svg { color: var(--ok); }
.toast.bad { border-left: 3px solid var(--bad); }
.toast.bad svg { color: var(--bad); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Active Order Push Notification Card */
.active-order-card {
  pointer-events: auto;
  background: linear-gradient(135deg, #16181d 0%, #0d0e11 100%);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(34, 197, 94, 0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: activeOrderPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}
.active-order-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.85), 0 0 32px rgba(34, 197, 94, 0.25);
}

@keyframes activeOrderPop {
  from { opacity: 0; transform: translateY(-24px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.aoc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.aoc-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
}
.aoc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: aocPulse 1.5s infinite;
}
@keyframes aocPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.aoc-time {
  color: var(--ink-3);
  font-size: 11px;
}
.aoc-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.aoc-id {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.01em;
}
.aoc-total {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 19px;
  color: #4ade80;
}
.aoc-sub {
  font-size: 12px;
  color: var(--ink-2);
}
.aoc-action {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--graphite-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2a303a; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Typography */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-3);
}
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }

/* ============================ BASE SVG ICONS ============================== */
svg.ic, .ic {
  width: 18px;
  height: 18px;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ============================ APP LAYOUT ================================== */
#app { position: relative; z-index: 1; height: 100vh; display: flex; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--near-black), var(--void));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width 0.28s var(--ease), transform 0.28s var(--ease);
  z-index: 40;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
.brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 11px;
  padding: 0 20px; border-bottom: 1px solid var(--line); flex: 0 0 var(--topbar-h);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: radial-gradient(120% 120% at 30% 20%, var(--lime), var(--lime-dim));
  color: #0a0b0d; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  box-shadow: 0 0 0 1px rgba(200,255,0,0.35), 0 6px 18px -6px var(--lime-glow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; white-space: nowrap; }
.brand-text b { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.02em; }
.brand-text span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--ink-3); text-transform: uppercase; }
.sidebar.collapsed .brand-text { display: none; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-4); padding: 14px 12px 6px; }
.sidebar.collapsed .nav-section { text-align: center; font-size: 8px; padding: 12px 0 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink-2); cursor: pointer; position: relative; font-size: 13.5px; font-weight: 500;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease);
  white-space: nowrap;
}
.nav-item .ic { width: 18px; height: 18px; flex: 0 0 18px; color: var(--ink-3); transition: color 0.16s; }
.nav-item:hover { background: var(--graphite); color: var(--ink); transform: translateX(2px); }
.nav-item:hover .ic { color: var(--ink-2); }
.nav-item.active { background: linear-gradient(90deg, var(--lime-glow), transparent); color: var(--ink); }
.nav-item.active .ic { color: var(--lime); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
}
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.sidebar.collapsed .nav-item .lbl { display: none; }
.nav-badge { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--void);
  background: var(--lime); border-radius: var(--r-pill); padding: 1px 7px; font-weight: 700; }
.sidebar.collapsed .nav-badge { display: none; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md);
  cursor: pointer; transition: background 0.16s; }
.userchip:hover { background: var(--graphite); }
.avatar { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; background: var(--graphite-2);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--lime); border: 1px solid var(--line); }
.userchip .meta { overflow: hidden; line-height: 1.2; }
.userchip .meta b { font-size: 12.5px; font-weight: 600; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.userchip .meta span { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); }
.sidebar.collapsed .userchip .meta { display: none; }

/* ---------- Main column ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,18,22,0.85), rgba(10,11,13,0.7));
  backdrop-filter: blur(14px); position: relative; z-index: 30;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--charcoal); color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
  transition: all 0.16s var(--ease); flex: 0 0 36px;
}
.icon-btn:hover { color: var(--ink); border-color: #333a45; background: var(--graphite); }
.icon-btn .ic { width: 18px; height: 18px; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumbs b { color: var(--ink); font-weight: 600; font-family: var(--font-display); }
.crumbs .ic { width: 14px; height: 14px; }

.topbar-spacer { flex: 1; }

.cmd-trigger {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--near-black);
  color: var(--ink-3); cursor: pointer; min-width: 240px; transition: all 0.16s var(--ease);
}
.cmd-trigger:hover { border-color: #333a45; color: var(--ink-2); }
.cmd-trigger .ic { width: 16px; height: 16px; }
.cmd-trigger .kbd { margin-left: auto; }
.kbd { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--graphite); border-radius: 6px; padding: 2px 6px; }

.live-dot { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(70,230,160,0.6); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(70,230,160,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(70,230,160,0); }
  100% { box-shadow: 0 0 0 0 rgba(70,230,160,0); }
}

/* ---------- Scroll viewport for views ---------- */
.viewport { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; width: 100%; max-width: 100vw; }
.view { padding: 26px 28px 60px; max-width: 1500px; margin: 0 auto; animation: viewIn 0.45s var(--ease); width: 100%; overflow-x: hidden; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; letter-spacing: -0.02em; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.head-actions { display: flex; align-items: center; gap: 10px; }

/* ============================ COMPONENTS ================================= */
.panel { background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 9px; }
.panel-head h3 .ic { width: 16px; height: 16px; color: var(--lime); }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1.55fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }

/* KPI hero cards — the signature element (magnetic hover + live sheen) */
.kpi {
  position: relative; overflow: hidden; padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  will-change: transform;
}
.kpi::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), var(--lime-glow-2), transparent 60%);
  opacity: 0; transition: opacity 0.25s; }
.kpi:hover { transform: translateY(-3px); border-color: #2f3742; box-shadow: var(--shadow-2); }
.kpi:hover::after { opacity: 1; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--graphite-2); border: 1px solid var(--line); }
.kpi .kpi-ic .ic { width: 17px; height: 17px; color: var(--lime); }
.kpi .kpi-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3); }
.kpi .kpi-val { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em;
  margin-top: 12px; line-height: 1; }
.kpi .kpi-val small { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.kpi .kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 11.5px;
  padding: 2px 7px; border-radius: var(--r-pill); font-weight: 700; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--ink-3); background: var(--graphite-2); }
.delta .ic { width: 12px; height: 12px; }

/* Mini stat tiles */
.stat-tile { display: flex; align-items: center; gap: 13px; padding: 15px 16px; border-radius: var(--r-md);
  background: var(--charcoal); border: 1px solid var(--line-soft); transition: all 0.16s var(--ease); }
.stat-tile:hover { border-color: var(--line); transform: translateY(-2px); }
.stat-tile .st-ic { width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px; display: grid; place-items: center; }
.stat-tile .st-ic .ic { width: 19px; height: 19px; }
.stat-tile .st-val { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1; }
.stat-tile .st-lbl { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* Chips / badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid transparent; white-space: nowrap; }
.badge i.d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(70,230,160,0.2); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(255,180,84,0.2); }
.badge.info { color: var(--info); background: var(--info-bg); border-color: rgba(91,184,255,0.2); }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: rgba(255,95,109,0.2); }
.badge.violet { color: var(--violet); background: var(--violet-bg); border-color: rgba(185,139,255,0.2); }
.badge.neutral { color: var(--ink-2); background: var(--graphite-2); border-color: var(--line); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--graphite);
  color: var(--ink); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.16s var(--ease); white-space: nowrap; }
.btn .ic { width: 16px; height: 16px; }
.btn:hover { background: var(--graphite-2); border-color: #333a45; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--lime); color: #0a0b0d; border-color: var(--lime);
  box-shadow: 0 6px 20px -8px var(--lime-glow); }
.btn.primary:hover { background: var(--lime-bright); }
.btn.danger { color: var(--bad); border-color: rgba(255,95,109,0.3); background: var(--bad-bg); }
.btn.danger:hover { background: rgba(255,95,109,0.16); }
.btn.ghost { background: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-icon-only { padding: 0; width: 38px; justify-content: center; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.field .hint { font-size: 11px; color: var(--ink-3); }
.input, .select, textarea.input {
  height: 40px; padding: 0 13px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--near-black); color: var(--ink); font-family: var(--font-body); font-size: 13px;
  transition: all 0.16s var(--ease); width: 100%;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--lime-dim); background: var(--charcoal);
  box-shadow: 0 0 0 3px var(--lime-glow-2); }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c7480' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-left: 36px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--near-black); }
.seg button { border: none; background: transparent; color: var(--ink-3); padding: 8px 14px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: all 0.14s; font-family: var(--font-body); }
.seg button:hover { color: var(--ink-2); }
.seg button.active { background: var(--graphite-2); color: var(--lime); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 400; padding: 12px 16px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--charcoal); z-index: 1; }
table.tbl tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); vertical-align: middle; }
table.tbl tbody tr { transition: background 0.14s; cursor: pointer; }
table.tbl tbody tr:hover { background: var(--graphite); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.cell-strong { color: var(--ink); font-weight: 600; }
.cell-sub { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }

.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--graphite-2);
  border: 1px solid var(--line); flex: 0 0 42px; }
.thumb-ph { display: grid; place-items: center; color: var(--ink-4); }
.thumb-ph .ic { width: 18px; height: 18px; }

/* Row actions */
.row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.mini-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--charcoal);
  color: var(--ink-3); display: grid; place-items: center; cursor: pointer; transition: all 0.14s; }
.mini-btn .ic { width: 15px; height: 15px; }
.mini-btn:hover { color: var(--ink); border-color: #333a45; background: var(--graphite-2); }
.mini-btn.danger:hover { color: var(--bad); border-color: rgba(255,95,109,0.3); }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 0; }
.pager .info { font-size: 12.5px; color: var(--ink-3); }
.pager .info b { color: var(--ink); }
.pager .ctrls { display: flex; gap: 8px; }

/* Product card grid */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.prod-card { background: linear-gradient(180deg, var(--graphite), var(--charcoal)); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; transition: all 0.18s var(--ease); position: relative; }
.prod-card:hover { transform: translateY(-3px); border-color: #2f3742; box-shadow: var(--shadow-2); }
.prod-media { aspect-ratio: 4/3; background: var(--near-black); position: relative; overflow: hidden; display: grid; place-items: center; }
.prod-media img { width: 100%; height: 100%; object-fit: cover; }
.prod-media .ph { color: var(--ink-4); }
.prod-media .ph .ic { width: 34px; height: 34px; }
.prod-stockflag { position: absolute; top: 10px; left: 10px; }
.prod-visflag { position: absolute; top: 10px; right: 10px; }
.prod-body { padding: 13px 14px; }
.prod-title { font-weight: 600; font-size: 13.5px; color: var(--ink); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.prod-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.prod-price { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.prod-price del { color: var(--ink-4); font-size: 12px; font-weight: 400; margin-right: 6px; }
.prod-cat { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.prod-actions { display: flex; gap: 6px; padding: 0 14px 14px; }
.prod-actions .btn { flex: 1; height: 32px; font-size: 12px; }

/* Live activity stream */
.activity { display: flex; flex-direction: column; }
.act-item { display: flex; gap: 13px; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); position: relative; }
.act-item:last-child { border-bottom: none; }
.act-ic { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; display: grid; place-items: center;
  background: var(--graphite-2); border: 1px solid var(--line); }
.act-ic .ic { width: 16px; height: 16px; }
.act-body { flex: 1; min-width: 0; }
.act-title { font-size: 13px; color: var(--ink); }
.act-title b { font-weight: 600; }
.act-meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; font-family: var(--font-mono); }
.act-amt { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; white-space: nowrap; }

/* Timeline (order intelligence) */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--graphite); border: 2px solid var(--ink-4); }
.tl-item.done::before { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 10px var(--lime-glow); }
.tl-item.current::before { background: var(--void); border-color: var(--lime); }
.tl-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.tl-time { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 2px; }

/* Charts */
.chart-wrap { width: 100%; }
svg.chart { display: block; width: 100%; overflow: visible; }
svg.chart text { font-family: var(--font-mono); fill: var(--ink-3); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.legend i { width: 9px; height: 9px; border-radius: 3px; }

/* Bars (best sellers / inventory movement) */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.bar-label { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--graphite-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lime-dim), var(--lime));
  width: 0; transition: width 0.9s var(--ease); }
.bar-val { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); }

/* ============================ DRAWER ==================================== */
.drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease); }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw);
  background: linear-gradient(180deg, var(--charcoal), var(--near-black)); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop); transform: translateX(100%); transition: transform 0.34s var(--ease);
  display: flex; flex-direction: column; }
.drawer.wide { width: min(720px, 100vw); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.drawer-head > div:first-child { min-width: 0; flex: 1; }
.drawer-head h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; line-height: 1.25; }
.drawer-head h2 .ic, .drawer-head h2 svg { width: 22px; height: 22px; color: var(--lime); flex-shrink: 0; }
.drawer-head .sub { color: var(--ink-3); font-size: 12px; margin-top: 5px; font-family: var(--font-mono); }
.drawer-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { flex: 0 0 auto; padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px;
  background: var(--near-black); }
.drawer-foot .btn { flex: 1; height: 42px; }
.drawer .grid-2 { grid-template-columns: 1fr; }

.dsec { display: flex; flex-direction: column; gap: 12px; }
.dsec-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.dsec-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); }
.addr-box { padding: 14px; border-radius: var(--r-md); background: var(--near-black); border: 1px solid var(--line-soft);
  font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.li-item { display: flex; gap: 12px; align-items: center; padding: 11px; border-radius: var(--r-md);
  background: var(--near-black); border: 1px solid var(--line-soft); }
.li-item .li-name { flex: 1; font-size: 13px; color: var(--ink); font-weight: 500; }
.li-item .li-qty { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.li-item .li-amt { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--ink-2); }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px;
  font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); }
.summary-row.total .amt { color: var(--lime); }

/* Image uploader */
.uploader { display: flex; flex-wrap: wrap; gap: 12px; }
.up-slot { width: 92px; height: 92px; border-radius: var(--r-md); border: 1px dashed var(--line); background: var(--near-black);
  display: grid; place-items: center; cursor: pointer; position: relative; overflow: hidden; transition: all 0.16s; color: var(--ink-3); }
.up-slot:hover { border-color: var(--lime-dim); color: var(--lime); }
.up-slot img { width: 100%; height: 100%; object-fit: cover; }
.up-slot .ic { width: 22px; height: 22px; }
.up-thumb { position: relative; width: 92px; height: 92px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-thumb .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0,0,0,0.7); color: #fff; border: none; cursor: pointer; display: grid; place-items: center; }
.up-thumb .rm .ic { width: 13px; height: 13px; }

/* ============================ COMMAND PALETTE =========================== */
.cmdk-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(3,3,5,0.6); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s; display: grid; align-items: flex-start; justify-items: center; padding-top: 12vh; }
.cmdk-scrim.open { opacity: 1; pointer-events: auto; }
.cmdk { width: min(640px, 92vw); background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); overflow: hidden;
  transform: translateY(-12px) scale(0.98); transition: transform 0.24s var(--ease); }
.cmdk-scrim.open .cmdk { transform: none; }
.cmdk-input-wrap { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input-wrap .ic { width: 19px; height: 19px; color: var(--lime); }
.cmdk-input { flex: 1; background: transparent; border: none; color: var(--ink); font-size: 16px; font-family: var(--font-body); }
.cmdk-input:focus { outline: none; }
.cmdk-input::placeholder { color: var(--ink-4); }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-4); padding: 12px 12px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md);
  cursor: pointer; color: var(--ink-2); }
.cmdk-item .ic { width: 17px; height: 17px; color: var(--ink-3); }
.cmdk-item .ci-title { flex: 1; font-size: 13.5px; }
.cmdk-item .ci-hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.cmdk-item.sel { background: var(--graphite-2); color: var(--ink); }
.cmdk-item.sel .ic { color: var(--lime); }
.cmdk-empty { padding: 30px; text-align: center; color: var(--ink-3); font-size: 13px; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); }
.cmdk-foot span { font-size: 11px; color: var(--ink-4); display: inline-flex; align-items: center; gap: 6px; }

/* ============================ TOAST / MODAL ============================= */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: var(--r-md);
  background: var(--graphite); border: 1px solid var(--line); box-shadow: var(--shadow-pop); min-width: 260px;
  color: var(--ink); font-size: 13px; animation: toastIn 0.3s var(--ease); }
.toast.ok { border-color: rgba(70,230,160,0.3); }
.toast.ok .ic { color: var(--ok); }
.toast.bad { border-color: rgba(255,95,109,0.3); }
.toast.bad .ic { color: var(--bad); }
.toast .ic { width: 18px; height: 18px; flex: 0 0 18px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.modal-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(3,3,5,0.7); backdrop-filter: blur(5px);
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.24s; padding: 20px; }
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal { width: min(440px, 100%); background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px; box-shadow: var(--shadow-pop);
  transform: scale(0.96); transition: transform 0.24s var(--ease); }
.modal-scrim.open .modal { transform: none; }
.modal h3 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--ink-3); font-size: 13.5px; line-height: 1.55; margin: 0 0 22px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; height: 42px; }

/* ============================ DRAWER / SLIDE-OVER ======================= */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(3, 4, 6, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease);
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 680px; max-width: 100vw; z-index: 130;
  background: var(--near-black); border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.85);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.drawer.wide { width: 780px; }
.drawer.open { transform: translateX(0); }

.drawer-head {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-shrink: 0;
}
.drawer-head h2 {
  font-size: 20px; font-weight: 700; margin: 0;
  font-family: var(--font-display); color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.drawer-head h2 .ic, .drawer-head h2 svg { width: 22px; height: 22px; color: var(--lime); flex-shrink: 0; }
.drawer-head .sub {
  font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-family: var(--font-mono);
}
.drawer-head-actions {
  display: flex; align-items: center; gap: 8px;
}
.drawer .grid-2 { grid-template-columns: 1fr; }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  overscroll-behavior: contain;
}
.drawer-foot {
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--charcoal), var(--near-black));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-shrink: 0;
}

/* ============================ ORDER DETAILS COMPONENTS ================== */
.order-hero-card {
  background: linear-gradient(135deg, rgba(200, 255, 0, 0.05) 0%, rgba(23, 26, 32, 0.95) 40%, var(--charcoal) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; position: relative; overflow: hidden;
}
.order-hero-card::before {
  content: ""; position: absolute; top: -50%; left: -20%; width: 140%; height: 140%;
  background: radial-gradient(circle at 10% 10%, rgba(200, 255, 0, 0.08), transparent 45%);
  pointer-events: none;
}
.order-hero-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.order-hero-id {
  font-size: 24px; font-weight: 700; font-family: var(--font-display);
  letter-spacing: -0.02em; color: var(--ink); display: flex; align-items: center; gap: 10px;
}
.order-hero-id .ic, .order-hero-id svg { width: 22px; height: 22px; color: var(--lime); flex-shrink: 0; }
.order-hero-badges {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.order-hero-meta {
  display: flex; align-items: center; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--ink-3);
  flex-wrap: wrap;
}
.order-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.order-hero-meta span .ic { width: 14px; height: 14px; color: var(--ink-3); flex-shrink: 0; }

/* Timeline Stepper */
.order-stepper {
  display: flex; align-items: flex-start; justify-content: space-between; position: relative;
  margin: 10px 0; padding: 0 10px;
}
.order-stepper::before {
  content: ""; position: absolute; top: 16px; left: 30px; right: 30px; height: 2px;
  background: var(--line); z-index: 1;
}
.stepper-progress {
  position: absolute; top: 16px; left: 30px; height: 2px;
  background: var(--lime); z-index: 2; transition: width 0.4s var(--ease);
  box-shadow: 0 0 10px var(--lime-glow);
}
.step-node {
  position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center;
  text-align: center; flex: 1; min-width: 0; padding: 0 4px;
}
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--charcoal);
  border: 2px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); font-size: 12px; transition: all 0.25s var(--ease);
}
.step-dot .ic { width: 15px; height: 15px; flex-shrink: 0; }
.step-node.done .step-dot {
  background: var(--ok); border-color: var(--ok); color: #000;
  box-shadow: 0 0 12px rgba(70, 230, 160, 0.4);
}
.step-node.active .step-dot {
  background: var(--lime); border-color: var(--lime); color: #000; font-weight: 700;
  box-shadow: 0 0 16px var(--lime-glow); transform: scale(1.12);
}
.step-node.cancelled .step-dot {
  background: var(--bad); border-color: var(--bad); color: #fff;
  box-shadow: 0 0 12px rgba(255, 95, 109, 0.4);
}
.step-label {
  font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 8px; line-height: 1.3;
}
.step-node.done .step-label { color: var(--ink-2); }
.step-node.active .step-label { color: var(--lime); font-weight: 700; }
.step-node.cancelled .step-label { color: var(--bad); }
.step-time {
  font-size: 9.5px; font-family: var(--font-mono); color: var(--ink-4); margin-top: 2px;
}

/* Order Section Cards */
.dsec, .order-card {
  background: var(--charcoal); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; transition: border-color 0.2s;
}
.dsec:hover, .order-card:hover { border-color: rgba(255, 255, 255, 0.12); }
.dsec-title, .order-card-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.dsec-title-left {
  display: flex; align-items: center; gap: 8px;
}
.dsec-title .ic, .order-card-head .ic, .dsec-title-left .ic {
  width: 17px; height: 17px; color: var(--lime); flex-shrink: 0;
}

/* Customer & Address */
.cust-card-body {
  display: flex; flex-direction: column; gap: 14px;
}
.cust-user-row {
  display: flex; align-items: center; gap: 14px;
}
.cust-avatar {
  width: 44px; height: 44px; border-radius: var(--r-md); background: var(--graphite-2);
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
  color: var(--lime); border: 1px solid rgba(200, 255, 0, 0.2); flex-shrink: 0;
}
.cust-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.cust-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px;
}
.cust-action-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--graphite-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
  text-decoration: none; transition: all 0.16s; cursor: pointer;
}
.cust-action-btn .ic { width: 14px; height: 14px; flex-shrink: 0; }
.cust-action-btn:hover {
  background: var(--graphite); color: var(--ink); border-color: var(--ink-3);
}
.cust-action-btn.whatsapp:hover {
  background: rgba(70, 230, 160, 0.15); color: var(--ok); border-color: var(--ok);
}

.addr-box {
  background: var(--graphite); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  position: relative;
}
.addr-box .addr-content {
  display: flex; align-items: flex-start; gap: 10px;
}
.addr-box .addr-icon {
  width: 18px; height: 18px; color: var(--lime); flex-shrink: 0; margin-top: 2px;
  display: inline-flex; align-items: center;
}
.addr-box .addr-icon .ic { width: 18px; height: 18px; color: var(--lime); }
.addr-box .addr-text { flex: 1; min-width: 0; word-break: break-word; }
.addr-box > .ic, .addr-box svg.ic, .addr-box svg {
  width: 17px; height: 17px; color: var(--lime); flex-shrink: 0;
  display: inline-block; vertical-align: -3px; margin-right: 6px;
}

/* Ordered Items List */
.order-items-list {
  display: flex; flex-direction: column; gap: 10px;
}
.li-item, .order-item-row {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  background: var(--graphite); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  transition: all 0.2s;
}
.li-item:hover, .order-item-row:hover {
  border-color: var(--line); background: var(--graphite-2);
}
.li-item .thumb, .order-item-thumb {
  width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover;
  background: var(--near-black); border: 1px solid var(--line); flex-shrink: 0;
}
.thumb-ph {
  display: flex; align-items: center; justify-content: center; color: var(--ink-4);
}
.li-item .li-name, .order-item-info {
  flex: 1; min-width: 0;
}
.order-item-title {
  font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.order-item-variant {
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.li-qty, .order-item-qty {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3);
  padding: 3px 8px; border-radius: var(--r-sm); background: var(--near-black);
  border: 1px solid var(--line-soft); flex-shrink: 0;
}
.li-amt, .order-item-price {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 700;
  color: var(--ink); min-width: 80px; text-align: right; flex-shrink: 0;
}

/* Payment Summary Box */
.summary-box {
  display: flex; flex-direction: column; gap: 9px;
}
.summary-row {
  display: flex; align-items: center; justify-content: space-between; font-size: 13.5px;
  color: var(--ink-2);
}
.summary-row.total {
  margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 16px; font-weight: 700; color: var(--ink);
}
.summary-row.total .amt {
  font-size: 22px; font-family: var(--font-display); color: var(--lime);
  text-shadow: 0 0 16px var(--lime-glow-2);
}

/* Tracking Details Box */
.tracking-fields-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px;
}

/* Full Page Order Detail Layout */
.order-page-container {
  display: flex; flex-direction: column; gap: 24px; max-width: 1280px; margin: 0 auto;
}
.order-page-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.order-page-columns {
  display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start;
}
@media (max-width: 960px) {
  .order-page-columns { grid-template-columns: 1fr; }
}

/* Print Stylesheet for clean A4 receipts */
@media print {
  body { background: #fff !important; color: #000 !important; overflow: visible !important; }
  body::before, .sidebar, .topbar, .bottom-nav, .drawer-head-actions, .drawer-foot,
  .cust-actions, #applyStatus, #saveTracking, .btn, .icon-btn, .order-page-topbar button {
    display: none !important;
  }
  .drawer {
    position: static !important; width: 100% !important; border: none !important;
    box-shadow: none !important; transform: none !important; background: #fff !important;
    color: #000 !important;
  }
  .order-card, .dsec, .order-hero-card, .li-item, .order-item-row, .addr-box {
    background: #fff !important; border: 1px solid #ccc !important; color: #000 !important;
    box-shadow: none !important;
  }
  .order-hero-id, .order-item-title, .order-card-head, .dsec-title, .summary-row.total .amt {
    color: #000 !important;
  }
}

/* ============================ LOADING / EMPTY =========================== */
.skeleton { background: linear-gradient(90deg, var(--graphite) 25%, var(--graphite-2) 50%, var(--graphite) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.center-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 70px 20px; text-align: center; color: var(--ink-3); }
.center-state .ic { width: 42px; height: 42px; color: var(--ink-4); }
.center-state h4 { font-size: 16px; color: var(--ink-2); }
.center-state p { font-size: 13px; max-width: 340px; line-height: 1.55; margin: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--graphite-2); border-top-color: var(--lime);
  animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ LOGIN ===================================== */
.login-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 600px at 50% -10%, rgba(200,255,0,0.06), transparent 60%), var(--void); }
.login-screen[hidden] { display: none !important; }
.login-card { width: min(400px, 100%); background: linear-gradient(180deg, var(--graphite), var(--charcoal));
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px 30px; box-shadow: var(--shadow-pop); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-mark { width: 40px; height: 40px; font-size: 22px; }
.login-brand b { font-family: var(--font-display); font-size: 19px; }
.login-brand span { display: block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.2em;
  color: var(--ink-3); text-transform: uppercase; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .lead { color: var(--ink-3); font-size: 13px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .btn { height: 46px; justify-content: center; margin-top: 4px; }
.login-err { font-size: 12.5px; color: var(--bad); background: var(--bad-bg); border: 1px solid rgba(255,95,109,0.25);
  border-radius: var(--r-md); padding: 10px 12px; display: none; }
.login-err.show { display: block; }
.login-foot { margin-top: 22px; text-align: center; font-size: 11.5px; color: var(--ink-4); font-family: var(--font-mono); }

/* ============================ MOBILE =================================== */
.mobile-only { display: none; }
.scrim-mobile { display: none; }

/* Bottom nav (mobile) */
.bottom-nav { display: none; }

@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  body::before { opacity: 0.3; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); box-shadow: var(--shadow-pop); }
  .sidebar.mobile-open { transform: none; }
  .sidebar.collapsed { width: var(--sidebar-w); flex-basis: var(--sidebar-w); }
  .sidebar.collapsed .brand-text, .sidebar.collapsed .nav-item .lbl, .sidebar.collapsed .userchip .meta { display: block; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 10px 12px; }
  .scrim-mobile { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.28s; }
  .scrim-mobile.open { opacity: 1; pointer-events: auto; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .cmd-trigger { min-width: 0; }
  .cmd-trigger .cmd-trigger-label, .cmd-trigger .kbd { display: none; }

  .view { padding: 18px 16px 100px; }
  .page-head h1 { font-size: 22px; }

  /* Tables collapse into stacked cards on mobile */
  .tbl-wrap { overflow-x: hidden; }
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tbody tr { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 12px;
    padding: 6px; background: var(--charcoal); }
  table.tbl tbody td { border: none; padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
  table.tbl tbody td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); flex-shrink: 0; margin-top: 2px; }
  table.tbl tbody td > div, table.tbl tbody td > span, table.tbl tbody td > a { 
    text-align: right; word-break: break-word; max-width: 100%; min-width: 0; 
  }
  table.tbl tbody td.no-label::before { content: ""; display: none; }
  .row-actions { justify-content: flex-start; flex-wrap: wrap; width: 100%; }

  /* Bottom navigation — native app feel */
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; height: 64px;
    background: linear-gradient(180deg, rgba(16,18,22,0.92), var(--near-black)); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-3); cursor: pointer; border-radius: var(--r-md); font-size: 10px; font-weight: 600;
    transition: color 0.16s; -webkit-tap-highlight-color: transparent; }
  .bn-item .ic { width: 21px; height: 21px; }
  .bn-item.active { color: var(--lime); }
  .bn-item.active .ic { filter: drop-shadow(0 0 6px var(--lime-glow)); }

  .drawer { width: 100vw; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi .kpi-val { font-size: 24px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
}

@media (max-width: 420px) {
  .grid-kpi { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .live-dot i { animation: none; }
}

/* ============================ INVOICE PREVIEW MODAL ===================== */
.inv-modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(3, 4, 6, 0.84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s var(--ease);
}
.inv-modal-dialog {
  width: 920px; max-width: 96vw; height: 92vh;
  background: var(--charcoal); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9);
  display: flex; flex-direction: column; overflow: hidden;
}
.inv-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--near-black);
  flex-shrink: 0;
}
.inv-modal-body {
  flex: 1; padding: 14px; background: var(--void);
}

/* ============================ PRODUCT BUILDER ENHANCEMENTS ================= */
.prod-type-card {
  display: block;
  padding: 12px 14px;
  background: var(--paper-sink);
  border: 1.5px solid var(--ink-hair);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}
.prod-type-card:hover {
  border-color: var(--ink-3);
  background: var(--charcoal);
}
.prod-type-card.is-active {
  border-color: var(--lime);
  background: rgba(200, 255, 0, 0.06);
  box-shadow: 0 0 0 1px var(--lime);
}
.variant-matrix-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.variant-matrix-tbl th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--ink-hair);
}
.variant-matrix-tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ink-hair);
  vertical-align: middle;
}
.variant-matrix-tbl tr:last-child td {
  border-bottom: none;
}