﻿/* ==========================================================================
   ChatDesk Pro UI — Modern Enterprise Light & Obsidian Dark Design System
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f4f8;
  --bg-hover: #eaeff5;
  --bg-sidebar: #fbfcfd;
  --bg-chat: #f7f9fc;

  --ink: #0f172a;
  --sub: #475569;
  --muted: #64748b;
  --faint: #94a3b8;

  --line: #e2e8f0;
  --line-soft: #eef2f6;
  --line-strong: #cbd5e1;

  --brand: #ee4d2d;
  --brand-hover: #d83b1c;
  --brand-soft: #fff2ee;
  --brand-border: #ffd5c8;
  --brand-ink: #c83214;

  --emerald: #10b981;
  --emerald-soft: #ecfdf5;
  --emerald-border: #bbf7d0;
  --emerald-ink: #047857;

  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --amber-ink: #b45309;

  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;
  --blue-ink: #1d4ed8;

  --rose: #ef4444;
  --rose-soft: #fef2f2;
  --rose-border: #fecaca;
  --rose-ink: #b91c1c;

  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --violet-border: #ddd6fe;
  --violet-ink: #6d28d9;

  --bub-in-bg: #ffffff;
  --bub-in-border: #e2e8f0;
  --bub-out-bg: #fff2ed;
  --bub-out-border: #ffd6c9;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 28px -6px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 24px 64px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.06);

  --overlay: rgba(15, 23, 42, 0.45);
  --scroll-thumb: rgba(100, 116, 139, 0.28);
  --scroll-thumb-hover: rgba(100, 116, 139, 0.48);

  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-sans: "Segoe UI Variable Text", "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-elevated: #131823;
  --bg-subtle: #1a2130;
  --bg-hover: #222b3e;
  --bg-sidebar: #0e121b;
  --bg-chat: #0d111a;

  --ink: #f1f5f9;
  --sub: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;

  --line: #232c3f;
  --line-soft: #1a2232;
  --line-strong: #33415c;

  --brand: #ff5b37;
  --brand-hover: #ff7050;
  --brand-soft: rgba(255, 91, 55, 0.15);
  --brand-border: rgba(255, 91, 55, 0.34);
  --brand-ink: #ff8c73;

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.32);
  --emerald-ink: #34d399;

  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --amber-border: rgba(245, 158, 11, 0.34);
  --amber-ink: #fbbf24;

  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --blue-border: rgba(59, 130, 246, 0.34);
  --blue-ink: #60a5fa;

  --rose: #ef4444;
  --rose-soft: rgba(239, 68, 68, 0.15);
  --rose-border: rgba(239, 68, 68, 0.34);
  --rose-ink: #f87171;

  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, 0.16);
  --violet-border: rgba(139, 92, 246, 0.36);
  --violet-ink: #a78bfa;

  --bub-in-bg: #182030;
  --bub-in-border: #263147;
  --bub-out-bg: #2e1d1a;
  --bub-out-border: #5a322a;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.48);
  --shadow-modal: 0 28px 72px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);

  --overlay: rgba(4, 6, 12, 0.68);
  --scroll-thumb: rgba(148, 163, 184, 0.22);
  --scroll-thumb-hover: rgba(148, 163, 184, 0.42);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
svg { display: block; flex-shrink: 0; }
button, input, select, textarea { font-family: inherit; color: inherit; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mut { color: var(--muted); }
.copyable {
  cursor: pointer;
  border-radius: 5px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.copyable:hover { color: var(--brand); }

/* Custom sleek scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

/* ---------- App Shell ---------- */
.app { display: flex; height: 100%; width: 100%; overflow: hidden; }

/* ---------- Left Sidebar ---------- */
.side {
  width: 224px;
  flex: 0 0 224px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 12px;
  user-select: none;
}

.ws {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  margin-bottom: 10px;
}
.ws-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff7043 0%, #ee4d2d 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(238, 77, 45, 0.28);
}
.ws-logo svg { width: 19px; height: 19px; }
.ws-text { flex: 1; min-width: 0; }
.ws-text b { display: block; font-size: 13.5px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.2; }
.ws-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.theme-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.theme-btn:hover { background: var(--bg-hover); color: var(--ink); border-color: var(--line-strong); }
.theme-btn:active { transform: scale(0.94); }
.theme-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="light"] .theme-btn .ic-sun { display: none; }
[data-theme="dark"] .theme-btn .ic-moon { display: none; }

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.slabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.6px;
  padding: 14px 10px 6px;
}
.slabel:first-child { padding-top: 6px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.ni {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.ni svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s ease;
}
.ni:hover { background: var(--bg-subtle); color: var(--ink); }
.ni:hover svg { stroke: var(--ink); }
.ni.on {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.ni.on svg { stroke: var(--brand); }
.ni.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.ni span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
  font-style: normal;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.nav-pill {
  font-style: normal;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.nav-pill.warn { background: var(--amber-soft); color: var(--amber-ink); }

.sfoot {
  margin-top: 10px;
  padding: 10px 10px 4px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.sfoot-status { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.sfoot-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
}
.sfoot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.sfoot .ver { color: var(--faint); font-family: var(--font-mono); font-size: 11px; }
.sfoot a {
  color: var(--sub);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s ease;
}
.sfoot a:hover { color: var(--brand); }

/* ---------- Main Workspace ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.view-chat { gap: 12px; }

/* Page Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}
.top-left { min-width: 0; }
.top-left.row-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-compact { padding: 2px 0; }
.top-compact h1 { font-size: 19px; margin-top: 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--brand);
  text-transform: uppercase;
}
h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-top: 2px;
  line-height: 1.25;
}
.sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.status-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sub);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 99px;
}
.status-chip.hot {
  color: var(--brand-ink);
  background: var(--brand-soft);
  border-color: var(--brand-border);
}

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

/* ---------- Buttons & Inputs ---------- */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--bg-subtle); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.pri {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(238, 77, 45, 0.26);
}
.btn.pri:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.blue {
  background: var(--blue-soft);
  border-color: var(--blue-border);
  color: var(--blue-ink);
  box-shadow: none;
}
.btn.blue:hover { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.btn.danger-soft {
  background: var(--rose-soft);
  border-color: var(--rose-border);
  color: var(--rose-ink);
  box-shadow: none;
}
.btn.danger-soft:hover { background: var(--rose); border-color: var(--rose); color: #ffffff; }
.btn:disabled, .mini:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.mini {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.mini:hover { background: var(--bg-subtle); color: var(--ink); border-color: var(--line-strong); }
.mini.pri { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.mini.pri:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.mini.danger { border-color: var(--rose-border); color: var(--rose-ink); background: var(--rose-soft); }
.mini.danger:hover { background: var(--rose); border-color: var(--rose); color: #ffffff; }

.iconbtn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.iconbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { background: var(--bg-subtle); color: var(--ink); border-color: var(--line-strong); }
.iconbtn.sm { width: 24px; height: 24px; font-size: 15px; line-height: 1; }

.inp-top {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elevated);
  padding: 0 11px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inp-top:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.sel2, .inp2 {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sel2 { padding: 0 8px; cursor: pointer; max-width: 124px; }
.inp2 { flex: 1; padding: 0 10px; min-width: 0; width: 100%; }
.sel2:focus, .inp2:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.search-wrap.sm { width: 220px; flex: 0 0 220px; }
.search-wrap svg {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search-wrap .inp2 { padding-left: 29px; }

/* Form fields inside modals */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.fl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 6px;
}
.inp, .ainput {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-elevated);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inp:focus, .ainput:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- KPI Grid ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  flex: 0 0 auto;
}
.kpi {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .lb { font-size: 12.5px; font-weight: 600; color: var(--sub); }
.kpi .nm {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi .nm small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi .ft { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.brand { background: var(--brand-soft); color: var(--brand); }
.ic.emerald { background: var(--emerald-soft); color: var(--emerald-ink); }
.ic.amber { background: var(--amber-soft); color: var(--amber-ink); }
.ic.blue { background: var(--blue-soft); color: var(--blue-ink); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.chrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.chrow h2 { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.chrow p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chrow .link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}
.chrow .link:hover { background: var(--brand-soft); }

/* Overview Middle Row */
.row2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  flex: 1.15;
  min-height: 220px;
}

.dist { padding: 16px 18px 12px; }
.bar {
  height: 12px;
  border-radius: 99px;
  display: flex;
  overflow: hidden;
  background: var(--bg-subtle);
  gap: 2px;
}
.bar i { height: 100%; border-radius: 99px; transition: width 0.35s ease; }
.seg-on { background: var(--emerald); }
.seg-warn { background: var(--amber); }
.seg-off { background: var(--line-strong); }
.seg-brand { background: var(--brand); }

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.lg {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
}
.lg-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.lg .d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.lg b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.quick-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 2px 18px 14px;
}
.qaction {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.qaction:hover { border-color: var(--brand-border); background: var(--brand-soft); transform: translateY(-1px); }
.qa-ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qa-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.qa-ic.brand { background: var(--brand-soft); color: var(--brand); }
.qa-ic.blue { background: var(--blue-soft); color: var(--blue-ink); }
.qaction b { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.qaction small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.note {
  margin: auto 18px 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
}
.inline-note { margin: 12px 0 0; }

/* Overview Shop List (Scrollable!) */
.shoplist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}
.shop:hover { background: var(--bg-subtle); }
.shop .sq {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shop .nm { flex: 1; min-width: 0; }
.shop .nm b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop .nm span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.shop .shop-go { opacity: 0; transition: opacity 0.15s ease; }
.shop:hover .shop-go { opacity: 1; }

/* Status Pills & Order Tags */
.st, .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
  line-height: 1.25;
}
.st.ok, .tag.on { color: var(--emerald-ink); background: var(--emerald-soft); border: 1px solid var(--emerald-border); }
.st.warn, .tag.warn { color: var(--amber-ink); background: var(--amber-soft); border: 1px solid var(--amber-border); }
.st.off, .tag.off { color: var(--muted); background: var(--bg-subtle); border: 1px solid var(--line); }
.tag.blue { color: var(--blue-ink); background: var(--blue-soft); border: 1px solid var(--blue-border); }
.tag.brand { color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-border); }
.st.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }

/* Recent Orders Card */
.recent { flex: 1.08; min-height: 196px; }
.recent-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.tbl-recent td { padding: 9px 14px; }

/* Empty State */
.empty {
  flex: 1;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.empty b { font-size: 14px; font-weight: 700; color: var(--ink); }
.empty span { max-width: 340px; line-height: 1.6; }
.empty .cir {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 19px;
  margin-bottom: 2px;
}
.empty .cir svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   CHAT CENTER (3-COLUMN DESK)
   ========================================================================== */
.chatwrap { flex: 1; min-height: 0; display: flex; }
.chatcard { flex: 1; flex-direction: row; min-height: 0; }

/* Left Conversation List */
.chatlist {
  width: 296px;
  flex: 0 0 296px;
  border-right: 1px solid var(--line);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.clhead {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.clhead b { font-size: 13.5px; font-weight: 700; }
.clhead span { margin-left: auto; font-size: 11px; color: var(--faint); }

.tabs2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 12px 6px;
}
.tab2 {
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab2:hover { background: var(--bg-hover); color: var(--ink); }
.tab2.on {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand-ink);
}
.tcnt {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.cfilter {
  display: flex;
  gap: 6px;
  padding: 4px 12px 10px;
  border-bottom: 1px solid var(--line);
}
.convs { flex: 1; overflow-y: auto; min-height: 0; padding: 6px; }
.convs .cs { padding: 28px 12px; text-align: center; font-size: 12px; color: var(--muted); }

.conv {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  align-items: center;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background-color 0.14s ease;
}
.conv:hover { background: var(--bg-subtle); }
.conv.on { background: var(--brand-soft); }
.conv.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.conv .av, .conv img.av2 {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: 0 0 38px;
  object-fit: cover;
}
.conv .av {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #64748b, #475569);
}
.conv .m { flex: 1; min-width: 0; }
.conv .m .r1 { display: flex; align-items: center; gap: 5px; }
.conv .m .r1 b {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv .m .r1 time { font-size: 11px; color: var(--faint); white-space: nowrap; flex-shrink: 0; }
.conv .m .r2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.conv .m .r2 span {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv .m .r2 .u {
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}
.conv-shop-row { margin-top: 4px; display: flex; align-items: center; gap: 5px; }

/* Deterministic Shop Pill Badge */
.shop-badge {
  display: inline-flex;
  align-items: center;
  max-width: 135px;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
}
.sb-0 { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-border); }
.sb-1 { background: var(--blue-soft); color: var(--blue-ink); border-color: var(--blue-border); }
.sb-2 { background: var(--emerald-soft); color: var(--emerald-ink); border-color: var(--emerald-border); }
.sb-3 { background: var(--violet-soft); color: var(--violet-ink); border-color: var(--violet-border); }
.sb-4 { background: var(--amber-soft); color: var(--amber-ink); border-color: var(--amber-border); }
.sb-5 { background: var(--rose-soft); color: var(--rose-ink); border-color: var(--rose-border); }

/* Center Thread Area */
.chatmain {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-chat);
}
.ch {
  height: 58px;
  flex: 0 0 58px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}
.ch-who { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.ch-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64748b, #475569);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ch-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-meta { min-width: 0; flex: 1; }
.ch-row1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ch .nm { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch .sb { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch .acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.date-sep {
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 11px;
  margin: 6px 0 4px;
  box-shadow: var(--shadow-xs);
}
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 76%; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg .b {
  background: var(--bub-in-bg);
  border: 1px solid var(--bub-in-border);
  border-radius: 13px 13px 13px 4px;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-xs);
}
.msg.out .b {
  background: var(--bub-out-bg);
  border-color: var(--bub-out-border);
  border-radius: 13px 13px 4px 13px;
}
.msg .t { font-size: 11px; color: var(--faint); margin-top: 4px; padding: 0 3px; font-variant-numeric: tabular-nums; }

.mimg {
  max-width: 240px;
  max-height: 240px;
  border-radius: 11px;
  border: 1px solid var(--line);
  display: block;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mimg:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
.stk { width: 88px; height: 88px; object-fit: contain; display: block; }
.sticker {
  font-size: 12px;
  color: var(--sub);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
}
.mcard {
  min-width: 210px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
}
.mcard b { font-size: 12px; color: var(--brand); display: block; }
.mcard span { font-size: 13px; font-weight: 600; color: var(--ink); display: block; margin-top: 2px; font-family: var(--font-mono); }
.mcard em { font-size: 11px; color: var(--muted); font-style: normal; display: block; margin-top: 4px; }

.pcard {
  display: flex;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  max-width: 320px;
  box-shadow: var(--shadow-xs);
}
.pcard img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-subtle);
  cursor: zoom-in;
  flex-shrink: 0;
}
.pcard .pi { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.pcard .pi b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink);
}
.pcard .pi span { display: block; font-size: 12.5px; font-weight: 700; color: var(--brand); margin-top: 5px; }

/* Collapsible Quick-Reply Drawer */
.qr-drawer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  padding: 8px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.qr-cats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  min-width: 0;
  padding-bottom: 2px;
}
.qr-cats::-webkit-scrollbar { height: 3px; }
.qr-cat {
  height: 25px;
  padding: 0 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--sub);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.14s ease;
}
.qr-cat:hover { color: var(--ink); border-color: var(--line-strong); }
.qr-cat.on { background: var(--violet-soft); border-color: var(--violet-border); color: var(--violet-ink); }
.qr-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qr-add-form { display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: var(--bg-subtle); border-radius: 8px; }
.qr-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; overflow-y: auto; }
.qr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}
.qr-chip:hover { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-ink); }
.qr-del {
  font-size: 13px;
  color: var(--faint);
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
}
.qr-del:hover { color: var(--rose); background: var(--rose-soft); }

/* Composer */
.composer {
  flex: 0 0 auto;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctools { display: flex; gap: 4px; align-items: center; }
.tool {
  height: 30px;
  min-width: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.14s ease;
}
.tool svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: var(--bg-subtle); color: var(--ink); }
.tool.active { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-border); }
.tool-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
.tool-pill {
  padding: 0 10px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--violet-soft);
  color: var(--violet-ink);
  border-color: var(--violet-border);
}
.tool-pill:hover, .tool-pill.active { background: var(--violet); color: #ffffff; border-color: var(--violet); }
.tool-pill svg { width: 14px; height: 14px; }

.composer textarea {
  width: 100%;
  height: 68px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-subtle);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.composer textarea:focus {
  background: var(--bg-elevated);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.cfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chint { font-size: 11px; color: var(--faint); }

.pick-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.ptabs { display: flex; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; overflow-x: auto; }
.ptab { width: 32px; height: 32px; object-fit: contain; border-radius: 7px; padding: 3px; opacity: 0.55; cursor: pointer; transition: all 0.15s ease; }
.ptab:hover { opacity: 0.9; background: var(--bg-subtle); }
.ptab.on { opacity: 1; background: var(--brand-soft); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 5px; }
.pstk { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; padding: 3px; cursor: pointer; transition: background-color 0.14s ease, transform 0.12s ease; }
.pstk:hover { background: var(--brand-soft); transform: scale(1.08); }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.emoji-grid span { display: flex; align-items: center; justify-content: center; height: 32px; font-size: 19px; border-radius: 7px; cursor: pointer; transition: background-color 0.12s ease, transform 0.1s ease; }
.emoji-grid span:hover { background: var(--brand-soft); transform: scale(1.15); }

/* Chat Empty State */
.chatempty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  background: var(--bg-chat);
  text-align: center;
}
.chatempty .cir {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.chatempty .cir svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.chatempty b { font-size: 15.5px; color: var(--ink); font-weight: 700; }
.chatempty p { font-size: 12.5px; color: var(--muted); max-width: 300px; }
.chatempty .hint { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--sub);
}

/* Right Buyer & Order Sidebar (FULLY SCROLLABLE!) */
.chatside {
  width: 312px;
  flex: 0 0 312px;
  border-left: 1px solid var(--line);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidehead {
  height: 48px;
  flex: 0 0 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidehead h2 { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.sidebody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buyer-card {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.buyer-head { display: flex; align-items: center; gap: 11px; }
.buyer-head img, .buyer-head .bav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.buyer-head .bav {
  background: linear-gradient(135deg, #64748b, #475569);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.buyer-meta { flex: 1; min-width: 0; }
.buyer-meta b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-id {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  cursor: pointer;
}
.copy-id:hover { color: var(--brand); }

.buyer-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bstat {
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 7px 9px;
}
.bstat span { display: block; font-size: 11px; color: var(--muted); }
.bstat b { display: block; font-size: 12.5px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.order-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
  padding: 2px 2px 0;
}

.ocard {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 10px;
}
.ocard:last-child { margin-bottom: 0; }
.ohead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 11px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.ohead b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oitem {
  display: flex;
  gap: 9px;
  padding: 9px 11px;
  border-bottom: 1px dashed var(--line-soft);
  align-items: center;
}
.oitem img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--bg-subtle); flex-shrink: 0; cursor: zoom-in; }
.oitem .oi { flex: 1; min-width: 0; }
.oitem .oi b { display: block; font-size: 12px; font-weight: 600; white-space: normal; word-break: break-word; line-height: 1.45; }
.oitem .oi span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: normal; word-break: break-word; line-height: 1.4; }
.oitem em { font-size: 12px; font-style: normal; font-weight: 700; color: var(--ink); white-space: nowrap; }
.oline { display: flex; justify-content: space-between; gap: 8px; padding: 5px 11px; font-size: 12px; color: var(--muted); }
.oline b { color: var(--ink); font-weight: 600; text-align: right; }
.oline.total b { color: var(--brand); font-size: 13px; font-weight: 700; }
.ocard-foot { padding: 8px 11px 10px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; }

/* ==========================================================================
   SHOPS GRID (RESPONSIVE & SCROLLABLE!)
   ========================================================================== */
.shopgrid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  padding-bottom: 10px;
}
.scard {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.scard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.scard .top2 { display: flex; align-items: flex-start; gap: 11px; }
.scard .lg2 {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.scard .nm2 { flex: 1; min-width: 0; }
.scard .nm2 b { font-size: 14px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.4; overflow: hidden; }
.scard .nm2 span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }

.scard .m2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.scard .m2 .mm {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}
.scard .m2 .mm b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.scard .m2 .mm span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.scard .f2 {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.scard .f2 .l { font-size: 11px; color: var(--faint); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scard-add {
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  border-radius: var(--radius-lg);
  min-height: 184px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.scard-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.scard-add .plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.scard-add b { font-size: 13px; font-weight: 600; }

/* ==========================================================================
   DATA TABLES & FILTERS (PER-TABLE COLUMN LAYOUTS)
   ========================================================================== */
.table-card { flex: 1; min-height: 0; }
.table-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.filter-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.filter-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sub);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.tab:hover { background: var(--bg-subtle); color: var(--ink); }
.tab.on { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand-ink); }
.inp-s {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  font-variant-numeric: tabular-nums;
}

/* Base Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 2;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tbody tr { transition: background-color 0.12s ease; }
.data-table tbody tr:hover { background: var(--bg-subtle); }
.data-table tr.row-done td { opacity: 0.56; text-decoration: line-through; }
.data-table tr.row-done td:first-child { text-decoration: none; }

/* Table-specific column widths (NO MORE COLLISIONS!) */
.tbl-orders th:nth-child(1), .tbl-orders td:nth-child(1) { width: 165px; }
.tbl-orders th:nth-child(2), .tbl-orders td:nth-child(2) { width: 130px; }
.tbl-orders th:nth-child(3), .tbl-orders td:nth-child(3) { width: 105px; }
.tbl-orders th:nth-child(4), .tbl-orders td:nth-child(4) { width: auto; }
.tbl-orders th:nth-child(5), .tbl-orders td:nth-child(5) { width: 96px; text-align: right; }
.tbl-orders th:nth-child(6), .tbl-orders td:nth-child(6) { width: 92px; }
.tbl-orders th:nth-child(7), .tbl-orders td:nth-child(7) { width: 115px; }
.tbl-orders th:nth-child(8), .tbl-orders td:nth-child(8) { width: 124px; }

.tbl-recent th:nth-child(1), .tbl-recent td:nth-child(1) { width: 165px; }
.tbl-recent th:nth-child(2), .tbl-recent td:nth-child(2) { width: 130px; }
.tbl-recent th:nth-child(3), .tbl-recent td:nth-child(3) { width: auto; }
.tbl-recent th:nth-child(4), .tbl-recent td:nth-child(4) { width: 100px; text-align: right; }
.tbl-recent th:nth-child(5), .tbl-recent td:nth-child(5) { width: 96px; }

.tbl-products th:nth-child(1), .tbl-products td:nth-child(1) { width: auto; white-space: normal; }
.tbl-products th:nth-child(2), .tbl-products td:nth-child(2) { width: 155px; }
.tbl-products th:nth-child(3), .tbl-products td:nth-child(3) { width: 140px; font-weight: 700; color: var(--brand); }
.tbl-products th:nth-child(4), .tbl-products td:nth-child(4) { width: 140px; }

.tbl-purchase th:nth-child(1), .tbl-purchase td:nth-child(1) { width: 72px; text-align: center; }
.tbl-purchase th:nth-child(2), .tbl-purchase td:nth-child(2) { width: 165px; }
.tbl-purchase th:nth-child(3), .tbl-purchase td:nth-child(3) { width: auto; }
.tbl-purchase th:nth-child(4), .tbl-purchase td:nth-child(4) { width: 100px; text-align: right; }
.tbl-purchase th:nth-child(5), .tbl-purchase td:nth-child(5) { width: 96px; }
.tbl-purchase th:nth-child(6), .tbl-purchase td:nth-child(6) { width: 115px; }

.tbl-inventory th:nth-child(1), .tbl-inventory td:nth-child(1) { width: auto; }
.tbl-inventory th:nth-child(2), .tbl-inventory td:nth-child(2) { width: 150px; }
.tbl-inventory th:nth-child(3), .tbl-inventory td:nth-child(3) { width: 110px; }
.tbl-inventory th:nth-child(4), .tbl-inventory td:nth-child(4) { width: 175px; }
.tbl-inventory th:nth-child(5), .tbl-inventory td:nth-child(5) { width: 92px; text-align: right; }

.tbl-finance th:nth-child(1), .tbl-finance td:nth-child(1) { width: 190px; }
.tbl-finance th:nth-child(2), .tbl-finance td:nth-child(2) { width: 95px; text-align: right; }
.tbl-finance th:nth-child(3), .tbl-finance td:nth-child(3) { width: 130px; text-align: right; }
.tbl-finance th:nth-child(4), .tbl-finance td:nth-child(4) { width: auto; }

.tbl-reports th:nth-child(1), .tbl-reports td:nth-child(1) { width: 160px; }
.tbl-reports th:nth-child(2), .tbl-reports td:nth-child(2) { width: 120px; text-align: right; }
.tbl-reports th:nth-child(3), .tbl-reports td:nth-child(3) { width: 150px; text-align: right; }
.tbl-reports th:nth-child(4), .tbl-reports td:nth-child(4) { width: auto; }

.tbl-audit th:nth-child(1), .tbl-audit td:nth-child(1) { width: 185px; }
.tbl-audit th:nth-child(2), .tbl-audit td:nth-child(2) { width: 130px; }
.tbl-audit th:nth-child(3), .tbl-audit td:nth-child(3) { width: auto; }

.pcell { display: flex; align-items: center; gap: 10px; }
.pcell img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-subtle);
  flex-shrink: 0;
  cursor: zoom-in;
  border: 1px solid var(--line-soft);
}
.pcell span {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Purchase Progress */
.purchase-bar-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.purchase-bar { width: 160px; height: 8px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.purchase-bar i { display: block; height: 100%; background: var(--emerald); border-radius: 99px; transition: width 0.3s ease; }
#purchase-progress-pct { font-size: 12px; font-weight: 700; color: var(--emerald-ink); font-variant-numeric: tabular-nums; }

/* Inventory Stepper */
.qty-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--sub);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: var(--bg-subtle); color: var(--ink); border-color: var(--line-strong); }
.qty-val { min-width: 32px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Finance & Reports Bar Visuals */
.fin-bar-wrap { display: flex; align-items: center; gap: 10px; }
.fin-bar { flex: 1; height: 8px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden; }
.fin-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ff8a65); border-radius: 99px; }
.fin-pct { width: 42px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chart-card { flex: 0 0 230px; }
.sales-chart {
  flex: 1;
  min-height: 0;
  padding: 14px 20px 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.sbar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.sbar-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sbar-track {
  width: 100%;
  max-width: 44px;
  flex: 1;
  display: flex;
  align-items: flex-end;
}
.sbar-fill {
  width: 100%;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: var(--brand-border);
  transition: height 0.35s ease, background-color 0.15s ease;
}
.sbar-col:hover .sbar-fill, .sbar-fill.peak {
  background: linear-gradient(180deg, #ff7043 0%, var(--brand) 100%);
}
.sbar-lbl { font-size: 11px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }

/* ==========================================================================
   SETTINGS
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}
.set-card { padding: 18px; }
.set-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.set-head h2 { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.set-head p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink);
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}
.srow span { font-weight: 500; }
.srow small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.srow b { font-weight: 700; color: var(--ink); }
.toggle-row { cursor: pointer; }

/* Modern Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background-color 0.2s ease;
  cursor: pointer;
}
.switch i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

/* Segmented Theme Control */
.seg-ctrl {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  gap: 2px;
}
.seg-opt {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-opt.on { background: var(--bg-elevated); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ==========================================================================
   MODALS, LIGHTBOX & TOAST
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
  animation: fadeIn 0.14s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: popIn 0.16s ease;
}
.modal-sm { max-width: 460px; }
.modal-lg { max-width: 720px; }

.modal .mh {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.modal .mh b { font-size: 15px; font-weight: 700; color: var(--ink); }
.mclose {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.mclose:hover { background: var(--bg-subtle); color: var(--ink); }

.modal .mb { padding: 18px 20px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.step {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.step b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step strong { display: block; font-size: 12px; font-weight: 700; color: var(--ink); }
.step span { display: block; font-size: 11px; color: var(--muted); line-height: 1.45; margin-top: 2px; }

#cookie-input {
  width: 100%;
  height: 196px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  resize: none;
  background: var(--bg-subtle);
  color: var(--ink);
  outline: none;
}
#cookie-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--bg-elevated); }

.bind-result { font-size: 12px; font-weight: 600; margin-top: 10px; min-height: 18px; line-height: 1.5; }
.bind-result.ok { color: var(--emerald-ink); }
.bind-result.err { color: var(--rose-ink); }

.modal .mf {
  min-height: 58px;
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
}
.mf-hint { font-size: 11.5px; color: var(--muted); }
.mf-acts { display: flex; gap: 8px; flex-shrink: 0; }

.paste-preview {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.paste-preview img { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; }

/* Lightbox */
.lightbox {
  position: relative;
  max-width: 88vw;
  max-height: 88vh;
  animation: popIn 0.16s ease;
}
.lightbox img {
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  display: block;
}
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: var(--brand); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-modal);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive Compact Breakpoint (handles Electron minWidth 1180x720 cleanly) */
@media (max-width: 1320px) {
  .side { width: 196px; flex: 0 0 196px; padding: 12px 10px 10px; }
  .main { padding: 14px 16px; }
  .chatlist { width: 248px; flex: 0 0 248px; }
  .chatside { width: 268px; flex: 0 0 268px; }
  .ch { padding: 0 12px; gap: 8px; }
  .ch .acts .btn.sm { padding: 0 8px; font-size: 11.5px; }
  .msgs { padding: 12px 14px; }
  .composer { padding: 8px 12px 10px; }
  .composer textarea { height: 58px; }
  .cfoot .chint { font-size: 11px; }
}


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

.openable { cursor: pointer; }
.openable:hover { background: var(--bg-hover); }
.link-menu { position: fixed; z-index: 9999; min-width: 130px; padding: 5px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(15,23,42,.18); display: flex; flex-direction: column; gap: 2px; }
.link-menu button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 7px; font-family: inherit; font-size: 12px; color: var(--ink); cursor: pointer; }
.link-menu button:hover { background: var(--brand-soft); color: var(--brand-ink); }
.buyer-actions { display: flex; gap: 6px; margin-top: 8px; }
.buyer-actions .mini { flex: 1; height: 26px; font-size: 11px; }

.tbl-orders th:nth-child(9), .tbl-orders td:nth-child(9) { width: 170px; white-space: nowrap; overflow: visible; text-overflow: clip; }
.tbl-orders td:nth-child(9) .mini { height: 24px; padding: 0 10px; font-size: 11.5px; margin-right: 4px; }

.recent-prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.recent-prod img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; background: var(--bg-subtle); flex-shrink: 0; }
.recent-prod .rp-ph { width: 34px; height: 34px; border-radius: 7px; background: var(--bg-subtle); flex-shrink: 0; }
.recent-prod span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ads-body { padding: 4px 0; }
.ads-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.ads-row:last-child { border-bottom: 0; }
.ads-shop { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.ads-shop b { font-size: 12.5px; font-weight: 600; }
.ads-metrics { display: flex; gap: 26px; margin-left: auto; flex-wrap: wrap; }
.ads-metric { min-width: 96px; }
.ads-metric span { display: block; font-size: 11px; color: var(--muted); }
.ads-metric b { display: block; font-size: 16px; margin-top: 2px; letter-spacing: -0.2px; }
.ads-metric b.low { color: var(--brand); }
.ads-err { color: var(--muted); font-size: 12px; margin-left: auto; }

.ord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; padding: 12px 14px; }
.ord-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elevated); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ord-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ord-top b { font-weight: 700; font-size: 12.5px; }
.ord-mid { display: flex; gap: 10px; align-items: flex-start; }
.ord-mid img, .ord-ph { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--bg-subtle); flex-shrink: 0; }
.ord-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ord-info b { font-size: 12.5px; line-height: 1.45; }
.ord-info span { font-size: 11.5px; color: var(--muted); }
.ord-amt { font-weight: 700; font-size: 13px; white-space: nowrap; }
.ord-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.ord-acts { display: flex; gap: 6px; }

.selfcheck-bad { color: #e5484d; font-weight: 600; }
.selfcheck-warn { color: #d97706; font-weight: 600; }

/* Nav bubbly look + per-item accent (active state only) */
.nav .ni { border-radius: 12px; transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease; }
.nav .ni:hover { background: color-mix(in srgb, var(--acc, var(--brand)) 10%, var(--bg-subtle)); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 4px 10px rgba(15,23,42,.06); transform: translateY(-1px); }
.nav .ni:active { transform: translateY(0) scale(.985); box-shadow: inset 0 2px 6px rgba(15,23,42,.14); }
.nav .ni.on { background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 22%, white 10%), color-mix(in srgb, var(--acc) 12%, transparent)); color: color-mix(in srgb, var(--acc) 80%, black 20%); box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 color-mix(in srgb, var(--acc) 18%, transparent), 0 6px 14px color-mix(in srgb, var(--acc) 24%, transparent); }
[data-theme="dark"] .nav .ni.on { background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 34%, transparent), color-mix(in srgb, var(--acc) 18%, transparent)); color: color-mix(in srgb, var(--acc) 70%, white 30%); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 16px rgba(0,0,0,.35); }
.nav .ni.on svg { stroke: var(--acc); }
.nav .ni.on::before { background: var(--acc); box-shadow: 0 0 10px color-mix(in srgb, var(--acc) 55%, transparent); }
.nav .ni[data-view="overview"] { --acc: #0d9488; }
.nav .ni[data-view="chat"] { --acc: #0ea5e9; }
.nav .ni[data-view="shops"] { --acc: #8b5cf6; }
.nav .ni[data-view="orders"] { --acc: #f97316; }
.nav .ni[data-view="products"] { --acc: #22c55e; }
.nav .ni[data-view="purchase"] { --acc: #eab308; }
.nav .ni[data-view="inventory"] { --acc: #06b6d4; }
.nav .ni[data-view="finance"] { --acc: #ec4899; }
.nav .ni[data-view="reports"] { --acc: #6366f1; }
.nav .ni[data-view="audit"] { --acc: #64748b; }
.nav .ni[data-view="selfcheck"] { --acc: #10b981; }
.nav .ni[data-view="settings"] { --acc: #f43f5e; }
.thread-shop { margin-left: auto; margin-right: 10px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-subtle); color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
