:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --indigo: #4f46e5;
  --green: #16a34a;
  --green-2: #dcfce7;
  --amber: #d97706;
  --amber-2: #fef3c7;
  --red: #dc2626;
  --red-2: #fee2e2;
  --violet: #7c3aed;
  --sidebar: #0b1220;
  --sidebar-2: #101b30;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .16);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.subtle { color: var(--muted-2); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

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

/* Sidebar */
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 18px;
  color: #dbe7ff;
  background:
    radial-gradient(900px 420px at -10% -20%, rgba(59, 130, 246, .22), transparent 60%),
    linear-gradient(180deg, var(--sidebar) 0%, #0a1528 100%);
  border-right: 1px solid rgba(148, 163, 184, .16);
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -.04em;
  background: linear-gradient(135deg, #3b82f6, #6366f1 55%, #8b5cf6);
  box-shadow: 0 8px 22px rgba(59, 130, 246, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #fff; font-size: 15px; letter-spacing: .12em; }
.brand-text span { color: #8fa3c7; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; margin-top: 4px; }
.workspace-switch {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .045);
  border-radius: 12px;
}
.workspace-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(96, 165, 250, .16); color: #93c5fd; }
.workspace-copy { min-width: 0; flex: 1; }
.workspace-copy strong { display: block; color: #f8fafc; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-copy span { display: block; color: #8193b2; font-size: 10.5px; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { padding: 0 10px 6px; color: #6f83a6; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 12px;
  border: 2px solid transparent; /* reserve space for active indicator */
  border-radius: 11px;
  color: #9fb0cd; background: transparent;
  text-align: left; font-size: 13px; font-weight: 550;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, .22), rgba(99, 102, 241, .12));
  border-left-color: #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .08);
}
.nav-item.active .icon { color: #93c5fd; }
.nav-label-text { flex: 1; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: rgba(96, 165, 250, .18); color: #bfdbfe; font-size: 10px; font-weight: 700; }
.context-card {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(255, 255, 255, .04);
  border-radius: 13px;
}
.context-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.context-eyebrow { color: #7f93b3; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.context-card strong { display: block; color: #f1f5f9; font-size: 12.5px; line-height: 1.35; }
.context-card p { margin: 4px 0 0; color: #8da2c4; font-size: 11px; line-height: 1.45; }
.context-card .mini-status { margin-top: 9px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; background: rgba(250, 204, 21, .12); color: #fde68a; font-size: 10px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid rgba(148, 163, 184, .14); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: 0 0 auto; background: linear-gradient(135deg, #64748b, #334155); }
.avatar.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.avatar.green { background: linear-gradient(135deg, #34d399, #059669); }
.avatar.amber { background: linear-gradient(135deg, #fbbf24, #d97706); }
.avatar.violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.avatar.rose { background: linear-gradient(135deg, #fb7185, #e11d48); }
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.sidebar-user { min-width: 0; }
.sidebar-user strong { display: block; color: #f1f5f9; font-size: 12px; }
.sidebar-user span { display: block; color: #7f93b3; font-size: 10.5px; margin-top: 2px; }

/* Main shell and topbar */
.main-shell { flex: 1; min-width: 0; }
.topbar {
  height: 72px;
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid rgba(226, 232, 240, .86);
  backdrop-filter: blur(16px);
}
.topbar-title { min-width: 0; }
.topbar-eyebrow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.topbar-title h1 { margin: 0; color: var(--ink); font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.topbar-subtitle { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-box {
  width: 250px; display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--muted);
}
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: var(--muted-2); }
.icon-button {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--muted);
  position: relative; transition: .18s ease;
}
.icon-button:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; border: 1.5px solid #fff; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.topbar-user-meta strong { display: block; font-size: 12px; line-height: 1.25; }
.topbar-user-meta span { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }

/* Common layout */
.content { max-width: 1540px; margin: 0 auto; padding: 26px 32px 54px; }
.page { display: none; animation: pageIn .26s ease both; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 23px; line-height: 1.18; letter-spacing: -.035em; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; margin-bottom: 12px; }
.breadcrumb button { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: inherit; }
.breadcrumb button:hover { color: var(--blue); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 620; white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, #2563eb, #4f46e5); box-shadow: 0 8px 18px rgba(37, 99, 235, .2); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #4338ca); border-color: transparent; }
.btn-soft { border-color: #dbeafe; background: #eff6ff; color: #1d4ed8; }
.btn-soft:hover { background: #dbeafe; border-color: #bfdbfe; }
.btn-green { border-color: transparent; color: #fff; background: linear-gradient(135deg, #16a34a, #059669); box-shadow: 0 8px 18px rgba(22, 163, 74, .18); }
.btn-green:hover { background: linear-gradient(135deg, #15803d, #047857); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn-danger-soft { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.btn-sm { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; }
.btn-lg { min-height: 44px; padding: 0 18px; border-radius: 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Cards and basic text */
.card { background: var(--surface); border: 1px solid rgba(226, 232, 240, .9); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-header h3 { margin: 0; font-size: 13.5px; letter-spacing: -.01em; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 18px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.section-title .icon { color: var(--blue); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.vstack { display: flex; flex-direction: column; gap: 14px; }
.hstack { display: flex; align-items: center; gap: 9px; }
.hstack-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hstack-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Badges and pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: var(--green-2); color: #15803d; }
.badge-amber { background: var(--amber-2); color: #b45309; }
.badge-red { background: var(--red-2); color: #b91c1c; }
.badge-slate { background: var(--surface-3); color: #475569; }
.badge-violet { background: #f5f3ff; color: #6d28d9; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.channel { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; }
.channel-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 9px; font-weight: 800; letter-spacing: -.02em; }
.channel-wa { color: #15803d; background: #dcfce7; }
.channel-wc { color: #047857; background: #d1fae5; }
.channel-email { color: #1d4ed8; background: #dbeafe; }
.channel-wa .channel-icon { background: #22c55e; color: #fff; }
.channel-wc .channel-icon { background: #10b981; color: #fff; }
.channel-email .channel-icon { background: #3b82f6; color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; max-width: 100%; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.data-table th {
  padding: 10px 14px; background: #fbfcfe; color: var(--muted); text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: #f8fafc; }
.cell-main { color: var(--ink-2); font-weight: 620; }
.cell-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.cell-actions { text-align: right; }

/* Inputs */
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); padding: 9px 11px; outline: 0;
  font-size: 12px; transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: var(--muted); font-size: 10.5px; font-weight: 650; }
.field-hint { color: var(--muted-2); font-size: 10px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); gap: 2px; }
.segmented button { border: 0; background: transparent; border-radius: 7px; padding: 6px 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented.blue button.active { background: #eff6ff; color: #1d4ed8; box-shadow: none; }
.search-inline { position: relative; }
.search-inline .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-inline .input { padding-left: 32px; }

/* Progress and donut */
.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3b82f6, #6366f1); }
.progress.green > span { background: linear-gradient(90deg, #34d399, #059669); }
.progress.amber > span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress.red > span { background: linear-gradient(90deg, #fb7185, #ef4444); }
.meter-row { display: grid; grid-template-columns: 100px 1fr 34px; align-items: center; gap: 9px; font-size: 11px; color: var(--muted); }
.meter-row strong { text-align: right; color: var(--ink-2); font-size: 11px; }
.donut {
  width: 132px; height: 132px; border-radius: 50%;
  background: conic-gradient(#22c55e 0 50%, #3b82f6 50% 75%, #8b5cf6 75% 100%);
  position: relative; display: grid; place-items: center; margin: 4px auto 12px;
}
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--surface); }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 22px; letter-spacing: -.04em; }
.donut-center span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
.legend { display: flex; flex-direction: column; gap: 7px; }
.legend-row { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.legend-row strong { margin-left: auto; color: var(--ink-2); }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: #22c55e; }

/* Toast */
.toast-container { position: fixed; right: 24px; top: 86px; bottom: auto; z-index: 1000; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; border: 1px solid rgba(226, 232, 240, .9);
  background: var(--surface); border-radius: 13px; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease both;
}
.toast-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #dcfce7; color: #15803d; flex: 0 0 auto; }
.toast.info .toast-icon { background: #eff6ff; color: #1d4ed8; }
.toast.warn .toast-icon { background: #fef3c7; color: #b45309; }
.toast strong { display: block; font-size: 12px; line-height: 1.35; }
.toast p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, .46); backdrop-filter: blur(5px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(620px, 100%); max-height: min(86vh, 900px); overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  animation: modalIn .22s ease both;
}
.modal.wide { width: min(820px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-close { border: 0; background: var(--surface-3); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { color: var(--ink); background: #e2e8f0; }
.modal-body { padding: 20px 22px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.modal-footer .left { margin-right: auto; color: var(--muted); font-size: 10.5px; }

/* Misc */
.divider-v { width: 1px; align-self: stretch; background: var(--line); }
.note-box { padding: 11px 12px; border: 1px solid #dbeafe; background: #eff6ff; border-radius: 10px; color: #1e40af; font-size: 11px; line-height: 1.55; }
.warn-box { padding: 11px 12px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; color: #92400e; font-size: 11px; line-height: 1.55; }
.success-box { padding: 11px 12px; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 10px; color: #166534; font-size: 11px; line-height: 1.55; }
.empty-state { padding: 28px; text-align: center; color: var(--muted); font-size: 12px; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-family: ui-monospace, monospace; }

/* Demo banner, stats and dashboard */
.demo-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 13px; margin-bottom: 17px;
  border: 1px solid #dbeafe; border-radius: 12px;
  background: linear-gradient(90deg, #eff6ff, #f5f3ff 72%, #faf5ff);
  color: #1e40af; font-size: 11.5px;
}
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, .13); flex: 0 0 auto; }
.demo-banner .divider-v { height: 18px; align-self: center; background: #bfdbfe; }
.demo-banner .grow { color: #475569; }
.demo-banner .btn { margin-left: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  position: relative; overflow: hidden; min-height: 132px;
  padding: 17px 18px; background: var(--surface);
  border: 1px solid rgba(226, 232, 240, .9); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-card::after {
  content: ""; position: absolute; width: 110px; height: 110px; right: -44px; top: -48px;
  border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, .13), transparent 70%);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.violet { background: #f5f3ff; color: #7c3aed; }
.stat-value { position: relative; z-index: 1; margin-top: 9px; font-size: 28px; font-weight: 760; letter-spacing: -.045em; line-height: 1; }
.stat-meta { position: relative; z-index: 1; margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; }
.trend-up { color: #15803d; font-weight: 750; }
.trend-down { color: #b91c1c; font-weight: 750; }
.sparkline { position: absolute; right: 11px; bottom: 9px; width: 96px; height: 38px; opacity: .75; z-index: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(290px, .85fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dashboard-grid.lower { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.table-link { color: var(--blue); font-weight: 650; }
.funnel { display: flex; flex-direction: column; gap: 11px; }
.funnel-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.funnel-track { height: 20px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3b82f6, #6366f1); }
.funnel-fill.g2 { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.funnel-fill.g3 { background: linear-gradient(90deg, #818cf8, #6366f1); }
.funnel-fill.g4 { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.funnel-fill.g5 { background: linear-gradient(90deg, #34d399, #059669); }
.funnel-row strong { text-align: right; color: var(--ink-2); }
.reminder-list { display: flex; flex-direction: column; gap: 10px; }
.reminder { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.reminder:last-child { border-bottom: 0; padding-bottom: 0; }
.reminder-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #fff7ed; color: #c2410c; flex: 0 0 auto; }
.reminder-icon.blue { background: #eff6ff; color: #2563eb; }
.reminder-icon.green { background: #ecfdf5; color: #059669; }
.reminder strong { display: block; color: var(--ink-2); font-size: 11.5px; line-height: 1.35; }
.reminder span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }

/* Inquiry list */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.status-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.status-tab { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 8px; font-size: 11px; font-weight: 650; }
.status-tab:hover { background: var(--surface-3); color: var(--ink); }
.status-tab.active { background: #eff6ff; color: #1d4ed8; }
.list-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-toolbar .search-inline { width: 190px; }

/* Inquiry detail */
.inquiry-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 20px; border: 1px solid #dbeafe; border-radius: var(--radius);
  background: linear-gradient(110deg, #ffffff 0%, #f8fbff 55%, #eef2ff 100%);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.inquiry-hero-main { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.inquiry-hero h2 { margin: 3px 0 5px; font-size: 22px; letter-spacing: -.035em; }
.inquiry-hero p { margin: 0; color: var(--muted); font-size: 11.5px; }
.inquiry-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr); gap: 16px; align-items: start; }
.chat-card { background: #f8fafc; }
.chat-thread { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.chat-message { max-width: 88%; padding: 11px 13px; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid var(--line); font-size: 12px; line-height: 1.62; }
.chat-message.out { margin-left: auto; background: #dcfce7; border-color: #bbf7d0; border-radius: 14px 14px 4px 14px; }
.chat-time { display: flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--muted-2); font-size: 9.5px; }
.chat-message.out .chat-time { justify-content: flex-end; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.attachment { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.attachment-thumb { height: 86px; display: grid; place-items: center; background: linear-gradient(135deg, #e0f2fe, #eef2ff); color: #2563eb; position: relative; }
.attachment-thumb.alt { background: linear-gradient(135deg, #fef3c7, #fff7ed); color: #c2410c; }
.attachment-thumb.alt2 { background: linear-gradient(135deg, #dcfce7, #ecfdf5); color: #047857; }
.attachment-thumb .file-type { position: absolute; left: 8px; top: 8px; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .8); font-size: 8px; font-weight: 800; }
.attachment-meta { padding: 8px 9px; }
.attachment-meta strong { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.extraction-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.extraction-field { background: #fff; padding: 12px 14px; min-height: 70px; }
.extraction-field label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9.5px; font-weight: 650; }
.extraction-field strong { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; font-weight: 650; }
.extraction-field strong.missing { color: #b45309; }
.confidence-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.confidence-dot.mid { background: #f59e0b; }
.confidence-dot.low { background: #ef4444; }
.line-item-cell { display: flex; align-items: center; gap: 10px; }
.part-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #eff6ff; color: #2563eb; flex: 0 0 auto; }
.part-icon.amber { background: #fffbeb; color: #d97706; }
.candidate-mini { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; color: #1d4ed8; font-weight: 700; }
.customer-card .avatar { width: 44px; height: 44px; font-size: 13px; }
.customer-row { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; padding: 5px 0; }
.customer-row .icon { color: var(--muted-2); }
.missing-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.missing-chip { padding: 4px 8px; border-radius: 7px; background: #fffbeb; color: #b45309; border: 1px solid #fde68a; font-size: 10px; font-weight: 650; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { display: flex; gap: 10px; position: relative; }
.timeline-dot { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--muted); z-index: 1; flex: 0 0 auto; }
.timeline-dot.done { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.timeline-dot.blue { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.timeline-copy { min-width: 0; padding-top: 1px; }
.timeline-copy strong { display: block; font-size: 11.5px; line-height: 1.35; }
.timeline-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border: 1px solid #dbeafe; border-radius: 13px; background: #f8fbff; margin-top: 16px; }
.action-bar-copy strong { display: block; font-size: 12px; }
.action-bar-copy span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }

/* Matching */
.matching-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr); gap: 16px; align-items: start; }
.item-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.item-tab { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); text-align: left; transition: .16s ease; }
.item-tab:hover { border-color: #bfdbfe; color: var(--ink-2); }
.item-tab.active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 3px rgba(59, 130, 246, .09); }
.item-tab strong { display: block; font-size: 11.5px; }
.item-tab span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.vehicle-card { display: flex; align-items: center; gap: 18px; padding: 15px 17px; border: 1px solid #dbeafe; border-radius: 13px; background: linear-gradient(100deg, #f8fbff, #f5f3ff); }
.vehicle-art { width: 150px; height: 82px; flex: 0 0 auto; }
.vehicle-info h3 { margin: 0 0 5px; font-size: 14px; }
.vehicle-info p { margin: 0; color: var(--muted); font-size: 11px; }
.vehicle-specs { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.candidate-list { display: flex; flex-direction: column; gap: 10px; }
.candidate { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.candidate:hover { border-color: #bfdbfe; background: #fbfdff; }
.candidate.selected { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, .1); background: #f8fbff; }
.candidate-radio { width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; margin-top: 2px; flex: 0 0 auto; color: transparent; }
.candidate.selected .candidate-radio { border-color: #2563eb; background: #2563eb; color: #fff; }
.candidate-main { min-width: 0; flex: 1; }
.candidate-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 760; letter-spacing: -.02em; color: var(--ink); }
.candidate-title { margin-top: 2px; font-size: 11.5px; font-weight: 620; color: var(--ink-2); }
.candidate-source { margin-top: 5px; color: var(--muted); font-size: 10px; }
.candidate-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.candidate-confidence { min-width: 88px; text-align: right; }
.confidence-num { font-size: 18px; font-weight: 760; letter-spacing: -.04em; line-height: 1; }
.confidence-num.green { color: #15803d; }
.confidence-num.amber { color: #b45309; }
.confidence-num.red { color: #b91c1c; }
.candidate-confidence span { display: block; color: var(--muted); font-size: 9.5px; margin: 3px 0 6px; }
.confidence-bar { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.confidence-bar > span { display: block; height: 100%; border-radius: inherit; background: #22c55e; }
.confidence-bar.mid > span { background: #f59e0b; }
.confidence-bar.low > span { background: #ef4444; }
.knowledge-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.knowledge-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.knowledge-stat strong { color: var(--ink-2); font-size: 12px; }
.signal-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.signal-row .progress { flex: 1; }
.signal-row span { width: 42px; color: var(--muted); font-size: 9.5px; text-align: right; }
.signal-label { width: 68px; color: var(--muted); font-size: 10px; }
.followup-text { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 10.5px; line-height: 1.6; }

/* Compare */
.compare-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(320px, .75fr); gap: 16px; align-items: start; }
.supplier-row.selected { background: #f8fbff; box-shadow: inset 3px 0 0 #3b82f6; }
.supplier-name { display: flex; align-items: center; gap: 9px; }
.supplier-name strong { display: block; font-size: 11.5px; }
.supplier-name span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
.match-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: #15803d; }
.match-pill.amber { color: #b45309; }
.price-panel { position: sticky; top: 90px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 11px; }
.price-row:last-child { border-bottom: 0; }
.price-row span { color: var(--muted); }
.price-row strong { font-size: 11.5px; font-weight: 650; }
.price-row.total { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line-2); border-bottom: 0; }
.price-total-label { color: var(--ink-2) !important; font-size: 12px !important; font-weight: 700; }
.price-total { font-size: 27px; font-weight: 760; letter-spacing: -.045em; line-height: 1; }
.range { width: 100%; accent-color: #2563eb; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 9.5px; margin-top: 2px; }
.margin-badge { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: #ecfdf5; color: #166534; font-size: 11px; }
.margin-badge strong { font-size: 17px; letter-spacing: -.03em; }
.recommendation { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid #bbf7d0; border-radius: 12px; background: linear-gradient(100deg, #f0fdf4, #f8fffb); color: #166534; font-size: 11px; line-height: 1.55; }
.recommendation .icon { color: #16a34a; margin-top: 1px; }
.compare-footnote { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }

/* Quote document */
.quote-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .62fr); gap: 16px; align-items: start; }
.quote-document { background: #fff; border: 1px solid rgba(226, 232, 240, .9); border-radius: 14px; padding: 28px 30px; box-shadow: var(--shadow); }
.doc-brand { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.doc-logo { display: flex; align-items: center; gap: 10px; }
.doc-logo-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.doc-company strong { display: block; font-size: 15px; letter-spacing: .06em; }
.doc-company span { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; letter-spacing: .04em; }
.doc-title { text-align: right; }
.doc-title h2 { margin: 0; font-size: 25px; letter-spacing: .14em; line-height: 1; }
.doc-title p { margin: 6px 0 0; color: var(--muted); font-size: 9.5px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 17px 0 14px; }
.doc-meta h4 { margin: 0 0 4px; color: var(--muted); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.doc-meta p { margin: 0; font-size: 10.5px; line-height: 1.6; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.doc-table th { padding: 8px 6px; background: #f8fafc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.doc-table td { padding: 9px 6px; border-bottom: 1px solid #eef2f7; vertical-align: top; line-height: 1.5; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-table .oem { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #1d4ed8; font-weight: 700; font-size: 9.5px; }
.doc-totals { margin-left: auto; width: 285px; padding-top: 11px; }
.doc-total-row { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 10px; }
.doc-total-row span { color: var(--muted); }
.doc-total-row.grand { margin-top: 5px; padding-top: 9px; border-top: 1px solid var(--ink); font-size: 14px; font-weight: 760; }
.doc-total-row.grand span { color: var(--ink); }
.doc-terms { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc-terms h4 { margin: 0 0 3px; color: var(--muted); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.doc-terms p { margin: 0; font-size: 9.5px; line-height: 1.55; }
.doc-footer { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 8px; }
.quote-settings { position: sticky; top: 90px; }
.settings-section { padding: 15px 16px; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.settings-title { margin: 0 0 10px; font-size: 10px; font-weight: 750; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.internal-cost { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 10.5px; }
.internal-cost:last-child { border-bottom: 0; }
.internal-cost span { color: var(--muted); }
.internal-cost strong { font-weight: 650; }
.order-success { display: none; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 15px 16px; border: 1px solid #bbf7d0; border-radius: 13px; background: linear-gradient(100deg, #f0fdf4, #f8fffb); color: #166534; }
.order-success.show { display: flex; animation: pageIn .25s ease both; }
.order-success-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; color: #15803d; flex: 0 0 auto; }
.order-success strong { display: block; font-size: 12.5px; }
.order-success p { margin: 3px 0 0; color: #3f6212; font-size: 11px; line-height: 1.5; }

/* Order execution */
.order-metrics .bulk-metric strong { font-size: 21px; }
.order-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-info { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.order-info span { display: block; color: var(--muted); font-size: 9.5px; }
.order-info strong { display: block; margin-top: 3px; font-size: 12px; }
.order-info small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.order-doc-list { display: flex; flex-direction: column; padding-top: 7px; padding-bottom: 10px; }
.order-doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.order-doc-row:last-child { border-bottom: 0; }
.order-doc-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 750; }
.order-doc-icon.blue { background: #eff6ff; color: #1d4ed8; }
.order-doc-icon.amber { background: #fffbeb; color: #b45309; }
.order-doc-row .grow strong { display: block; font-size: 11px; }
.order-doc-row .grow span { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.order-doc-row .btn { flex: 0 0 auto; }
.payment-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 10.5px; }
.payment-row:last-of-type { border-bottom: 0; }
.payment-row span { color: var(--muted); }
.payment-row strong { font-weight: 650; }
.payment-row.total { margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--ink); border-bottom: 0; font-size: 12px; }
.order-todo-list { display: flex; flex-direction: column; }
.order-todo { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.order-todo:last-child { border-bottom: 0; }
.order-todo-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #cbd5e1; flex: 0 0 auto; }
.order-todo-dot.active { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
.order-todo-dot.done { background: #22c55e; }
.order-todo strong { display: block; font-size: 11px; line-height: 1.4; }
.order-todo span:not(.badge):not(.order-todo-dot) { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.order-todo .badge { margin-left: auto; flex: 0 0 auto; }
.stage.done .stage-num { background: #dcfce7; color: #15803d; }

/* Channel inbox */
.channel-metrics .bulk-metric strong { font-size: 21px; }
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.channel-card {
  display: flex; flex-direction: column; min-height: 205px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}
.channel-card-head { display: flex; align-items: flex-start; gap: 9px; }
.channel-logo { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; font-size: 10px; font-weight: 800; }
.channel-logo.wa { background: #dcfce7; color: #15803d; }
.channel-logo.wc { background: #ecfdf5; color: #059669; }
.channel-logo.email { background: #eff6ff; color: #1d4ed8; }
.channel-card-title { flex: 1; min-width: 0; }
.channel-card-title strong { display: block; font-size: 11.5px; line-height: 1.35; }
.channel-card-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.channel-card > p { margin: 10px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.channel-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 9.5px; }
.channel-card-meta strong { color: var(--ink-2); }
.channel-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }
.channel-actions .btn { flex: 1; }
.integration-list { display: flex; flex-direction: column; }
.integration-item { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.integration-item:first-child { padding-top: 0; }
.integration-item:last-child { padding-bottom: 0; border-bottom: 0; }
.integration-item strong { display: block; font-size: 11px; line-height: 1.4; }
.integration-item p { margin: 3px 0 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.field-map { display: flex; flex-direction: column; }
.field-map > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 10.5px; }
.field-map > div:last-child { padding-bottom: 0; border-bottom: 0; }
.field-map > div:first-child { padding-top: 0; }
.field-map span { color: var(--muted); flex: 0 0 auto; }
.field-map strong { text-align: right; font-weight: 600; }
.channel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* Modals */
.entry-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.entry-tab { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.entry-tab.active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.entry-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sample-link { border: 0; background: transparent; color: var(--blue); font-size: 10.5px; font-weight: 650; padding: 0; }
.entry-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.entry-preview-item { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.entry-preview-item span { display: block; color: var(--muted); font-size: 9px; }
.entry-preview-item strong { display: block; margin-top: 2px; font-size: 11px; }
.rfq-suppliers { display: flex; flex-direction: column; gap: 8px; }
.rfq-supplier { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rfq-supplier .checkbox { width: 17px; height: 17px; accent-color: #2563eb; }
.rfq-supplier-meta { flex: 1; min-width: 0; }
.rfq-supplier-meta strong { display: block; font-size: 11.5px; }
.rfq-supplier-meta span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
.rfq-preview { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: var(--ink-2); font-size: 10.5px; line-height: 1.6; white-space: pre-line; }
.channel-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.channel-choice button { display: flex; align-items: center; gap: 9px; text-align: left; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.channel-choice button.active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 3px rgba(59, 130, 246, .08); }
.channel-choice strong { display: block; font-size: 11.5px; }
.channel-choice span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
.order-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0; }
.summary-tile { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.summary-tile span { display: block; color: var(--muted); font-size: 9px; }
.summary-tile strong { display: block; margin-top: 2px; font-size: 11.5px; }
.modal-list { display: flex; flex-direction: column; gap: 9px; }
.modal-list-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11px; }
.modal-list-item .icon { color: #16a34a; margin-top: 1px; }

/* Supplier directory */
.supplier-directory-card { margin-bottom: 16px; overflow: hidden; }
.supplier-filter-select { width: 170px; }
.supplier-table { min-width: 980px; }
.supplier-table td { vertical-align: middle; }
.supplier-tag-list { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.supplier-category-tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.supplier-score-line { display: flex; align-items: baseline; gap: 5px; }
.supplier-score-line span { color: var(--muted); font-size: 12.5px; }
.supplier-rating { font-size: 19px; line-height: 1; letter-spacing: -.03em; }
.supplier-rating.good { color: #15803d; }
.supplier-rating.mid { color: #1d4ed8; }
.supplier-rating.watch { color: #b45309; }
.supplier-table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfe; color: var(--muted); font-size: 12.5px; }
.supplier-table-foot strong { color: var(--ink-2); }
.supplier-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px 16px; color: var(--muted); }
.supplier-empty strong { color: var(--ink); font-size: 15px; }
.supplier-empty span { font-size: 13px; }
.supplier-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 16px; }
.supplier-structure { display: flex; flex-direction: column; gap: 12px; }
.supplier-structure-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 48px; align-items: center; gap: 12px; font-size: 13.5px; }
.supplier-structure-label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
.supplier-structure-label i { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto; }
.supplier-structure-row strong { color: var(--muted); text-align: right; font-size: 13px; }
.supplier-alert-list { display: flex; flex-direction: column; }
.supplier-alert { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.supplier-alert:last-child { border-bottom: 0; padding-bottom: 0; }
.supplier-alert:first-child { padding-top: 0; }
.supplier-alert-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: #fffbeb; color: #b45309; }
.supplier-alert .grow strong { display: block; color: var(--ink-2); font-size: 14px; }
.supplier-alert .grow span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.supplier-profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.supplier-profile-head p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.supplier-profile-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.supplier-profile-metrics .summary-tile span { font-size: 12.5px; }
.supplier-profile-metrics .summary-tile strong { font-size: 17px; }
.supplier-profile-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.supplier-contact-list { display: flex; flex-direction: column; }
.supplier-contact-list > div { display: grid; grid-template-columns: 18px 88px minmax(0, 1fr); align-items: start; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.supplier-contact-list > div:last-child { border-bottom: 0; }
.supplier-contact-list .icon { color: #2563eb; margin-top: 1px; }
.supplier-contact-list span { color: var(--muted); }
.supplier-contact-list strong { color: var(--ink-2); text-align: right; font-weight: 600; word-break: break-word; }
.supplier-cert-list { display: flex; flex-wrap: wrap; gap: 7px; }
.supplier-cert { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.supplier-cert.ready { background: #ecfdf5; color: #15803d; }
.supplier-cert.missing { background: #fffbeb; color: #b45309; }
.supplier-history-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.supplier-history-card p { margin: 9px 0; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.supplier-history-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; }
.supplier-history-meta strong { color: var(--ink-2); font-weight: 650; text-align: right; }
.supplier-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.supplier-field-wide { grid-column: 1 / -1; }

/* Bulk inquiry */
.bulk-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.bulk-metric {
  position: relative; overflow: hidden; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.bulk-metric::after {
  content: ''; position: absolute; right: -16px; bottom: -22px; width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, .11), transparent 70%);
}
.bulk-metric span { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.bulk-metric strong { position: relative; z-index: 1; display: block; margin-top: 4px; font-size: 23px; line-height: 1.1; letter-spacing: -.035em; }
.bulk-metric small { position: relative; z-index: 1; display: block; margin-top: 5px; color: var(--muted-2); font-size: 10.5px; }
.email-body {
  max-height: 360px; overflow: auto; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcfe; color: var(--ink-2);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 12.5px; line-height: 1.72; white-space: pre-wrap; word-break: break-word;
  scrollbar-width: thin;
}
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.category-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.category-head { display: flex; align-items: flex-start; gap: 10px; }
.category-icon {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 10px; background: #eff6ff; color: #2563eb;
}
.category-head h4 { margin: 0; font-size: 12px; line-height: 1.35; }
.category-head p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.stage-list { display: flex; flex-direction: column; }
.stage {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 10px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.stage:last-child { border-bottom: 0; padding-bottom: 0; }
.stage:first-child { padding-top: 0; }
.stage-num {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px;
  background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700;
}
.stage.active .stage-num { background: #eff6ff; color: #1d4ed8; box-shadow: inset 0 0 0 1px #bfdbfe; }
.stage strong { display: block; font-size: 11.5px; line-height: 1.4; }
.stage span:not(.badge) { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.check-row:last-child { border-bottom: 0; padding-bottom: 0; }
.check-row:first-child { padding-top: 0; }
.check-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; }
.check-icon.warn { background: #fffbeb; color: #b45309; }
.check-icon.blue { background: #eff6ff; color: #1d4ed8; }
.check-row strong { display: block; font-size: 11px; line-height: 1.35; }
.check-row span:not(.check-icon) { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.bulk-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.bulk-status-row strong { color: var(--ink-2); font-size: 11.5px; }
.bulk-reply-text {
  width: 100%; min-height: 365px; padding: 13px 14px;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 12px; line-height: 1.65;
}
.bulk-rfq-groups { display: flex; flex-direction: column; gap: 8px; }
.bulk-rfq-group {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.bulk-rfq-group .checkbox { width: 17px; height: 17px; accent-color: #2563eb; flex: 0 0 auto; }
.bulk-rfq-group .category-icon { width: 31px; height: 31px; border-radius: 9px; }
.bulk-rfq-meta { flex: 1; min-width: 0; }
.bulk-rfq-meta strong { display: block; font-size: 11.5px; line-height: 1.35; }
.bulk-rfq-meta span { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

/* AI OE search */
.oe-search-card .card-body { padding-top: 16px; }
.oe-query-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 9px; align-items: end; }
.oe-query-grid .field { margin: 0; }
.oe-search-button { min-height: 39px; white-space: nowrap; }
.oe-query-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.oe-inline-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oe-inline-presets > span { color: var(--muted-2); font-size: 10.5px; }
.oe-inline-presets button { padding: 0; border: 0; background: transparent; color: #2563eb; font-size: 10.5px; font-weight: 600; }
.oe-inline-presets button:hover { text-decoration: underline; }
.oe-preset-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; }
.oe-preset-row > span { color: var(--muted); font-size: 10.5px; }
.preset-chip {
  padding: 5px 9px; border: 1px solid #dbeafe; border-radius: 999px;
  background: #f8fbff; color: #1d4ed8; font-size: 10px; font-weight: 600;
}
.preset-chip:hover { border-color: #93c5fd; background: #eff6ff; }
.oe-modal-query { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.oe-search-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.oe-search-scan { display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 10.5px; line-height: 1.45; max-width: 530px; }
.oe-search-scan .icon { color: #7c3aed; margin-top: 1px; }
.oe-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 0 9px; padding-top: 14px; border-top: 1px solid var(--line); }
.oe-results-head > div { min-width: 0; }
.oe-results-head strong { display: block; font-size: 12px; }
.oe-results-head span:not(.badge) { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.oe-search-results { min-height: 106px; }
.oe-search-answer { padding: 10px 11px; border: 1px solid #dbeafe; border-radius: 11px; background: linear-gradient(100deg, #f8fbff, #f5f3ff); }
.oe-answer-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.oe-answer-title .icon { color: #7c3aed; }
.oe-answer-title strong { font-size: 11.5px; }
.oe-answer-title span:not(.badge) { margin-left: auto; color: #15803d; font-size: 10.5px; font-weight: 650; }
.oe-evidence-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.oe-evidence { padding: 3px 7px; border-radius: 6px; background: #fff; border: 1px solid #e2e8f0; color: var(--muted); font-size: 9.5px; }
.oe-evidence b { color: var(--ink-2); font-weight: 650; margin-right: 3px; }
.oe-result-list { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.oe-result { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.oe-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.oe-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #1d4ed8; font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.oe-result-title { margin-top: 2px; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.oe-confidence { flex: 0 0 auto; padding: 4px 7px; border-radius: 7px; background: #f1f5f9; color: var(--muted); font-size: 10px; font-weight: 700; }
.oe-confidence.high { background: #dcfce7; color: #15803d; }
.oe-confidence.mid { background: #fef3c7; color: #b45309; }
.oe-confidence.low { background: #fee2e2; color: #b91c1c; }
.oe-result-fit { margin-top: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.oe-result-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; color: var(--muted-2); font-size: 9.5px; }
.oe-result-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.oe-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 104px; color: var(--muted); font-size: 11px; text-align: center; }
.oe-loading-dot { width: 8px; height: 8px; border-radius: 50%; background: #6366f1; box-shadow: 0 0 0 0 rgba(99, 102, 241, .35); animation: oePulse 1.1s infinite; }
@keyframes oePulse { 70% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); } 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } }
.oe-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 124px; padding: 12px; text-align: center; }
.oe-empty.compact { min-height: 104px; }
.oe-empty .check-icon { margin-bottom: 7px; }
.oe-empty strong { font-size: 11.5px; }
.oe-empty p { max-width: 500px; margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.bulk-oe-result { padding: 10px; margin-bottom: 10px; border: 1px solid #bfdbfe; border-radius: 10px; background: #f8fbff; }
.bulk-oe-result > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #1d4ed8; font-size: 10px; font-weight: 600; }
.bulk-oe-result > div:first-child strong { color: #15803d; font-size: 10px; }
.bulk-oe-code { margin-top: 4px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; }
.bulk-oe-result p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.modal.xwide { width: min(1140px, 100%); }
.oe-mode-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.oe-mode-tab { padding: 7px 12px; border: 1px solid transparent; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 600; }
.oe-mode-tab:hover { color: var(--ink-2); }
.oe-mode-tab.active { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 2px rgba(59, 130, 246, .06); }
.oe-mode-tabs > span { margin-left: auto; color: var(--muted-2); font-size: 10.5px; }
.oe-demo-note { display: flex; align-items: flex-start; gap: 7px; margin: -3px 0 13px; padding: 8px 10px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.oe-demo-note .icon { color: #b45309; margin-top: 1px; }
.oe-demo-note strong { color: var(--ink-2); }
.oe-batch-preset { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.oe-batch-preset > span { color: var(--muted); font-size: 10.5px; }
.oe-batch-query { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.oe-batch-textarea { min-height: 178px; font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; font-size: 12px; line-height: 1.7; }
.oe-batch-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.batch-metric { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.batch-metric span { display: block; color: var(--muted); font-size: 9.5px; }
.batch-metric strong { display: block; margin-top: 2px; font-size: 18px; line-height: 1.15; letter-spacing: -.03em; }
.oe-batch-table-wrap { max-height: 410px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.oe-batch-table { min-width: 940px; }
.oe-batch-table th { position: sticky; top: 0; z-index: 2; background: #f8fafc; }
.oe-batch-table td { padding-top: 9px; padding-bottom: 9px; vertical-align: top; }
.oe-batch-table .oe-code { font-size: 11.5px; }
.oe-batch-fitment { min-width: 180px; max-width: 250px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.oe-batch-table .oe-confidence { display: inline-flex; }
.oe-batch-detail { margin-top: 10px; }
.oe-batch-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.oe-batch-detail-head strong { display: block; font-size: 11.5px; }
.oe-batch-detail-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.oe-batch-detail-list { display: flex; flex-direction: column; gap: 7px; }
.oe-batch-detail-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.oe-batch-code-wrap { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.oe-batch-detail-copy { min-width: 0; }
.oe-batch-detail-copy strong { display: block; font-size: 10.5px; line-height: 1.4; }
.oe-batch-detail-copy span { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }

/* Readability pass: larger UI text without changing the printable quotation */
body { font-size: 16px; line-height: 1.55; }
.brand-text strong { font-size: 18px; }
.brand-text span, .context-eyebrow, .nav-label { font-size: 12px; }
.workspace-copy strong { font-size: 15px; }
.workspace-copy span, .sidebar-user span { font-size: 12.5px; }
.nav-item { font-size: 15px; }
.nav-count { font-size: 12.5px; }
.context-card strong, .sidebar-user strong { font-size: 15px; }
.context-card p { font-size: 13.5px; }
.context-card .mini-status { font-size: 12.5px; }
.topbar-eyebrow { font-size: 12.5px; }
.topbar-title h1 { font-size: 23px; }
.topbar-subtitle, .page-head p, .breadcrumb, .inquiry-hero p { font-size: 14.5px; }
.search-box input, .input, .select, .textarea { font-size: 15px; }
.topbar-user-meta strong { font-size: 14.5px; }
.topbar-user-meta span { font-size: 12.5px; }
.page-head h2 { font-size: 28px; }
.btn { font-size: 15px; }
.btn-sm { font-size: 13.5px; }
.btn-lg { font-size: 15.5px; }
.card-header h3 { font-size: 17px; }
.card-header p { font-size: 14px; }
.card-body { font-size: 15.5px; }
.section-title { font-size: 15.5px; }
.badge, .channel, .match-pill { font-size: 12.5px; }
.channel-icon { font-size: 11px; }
.data-table { font-size: 14.5px; }
.data-table th { font-size: 12px; }
.cell-sub { font-size: 13px; }
.field label { font-size: 13.5px; }
.field-hint { font-size: 12.5px; }
.segmented button, .status-tab { font-size: 13.5px; }
.note-box, .warn-box, .success-box { font-size: 13.5px; }
.toast strong { font-size: 15px; }
.toast p { font-size: 13.5px; }
.modal-header p, .modal-footer .left { font-size: 13.5px; }
.stat-label { font-size: 14px; }
.stat-value { font-size: 34px; }
.stat-meta, .funnel-row, .legend-row, .meter-row { font-size: 13.5px; }
.reminder strong { font-size: 15px; }
.reminder span { font-size: 13.5px; }
.chat-message { font-size: 15px; }
.chat-time { font-size: 12px; }
.inquiry-hero h2 { font-size: 27px; }
.candidate-code { font-size: 16px; }
.candidate-title, .item-tab strong, .supplier-name strong, .price-row strong, .margin-badge, .recommendation { font-size: 14.5px; }
.candidate-source, .candidate-confidence span, .item-tab span, .supplier-name span, .range-labels, .compare-footnote { font-size: 13px; }
.knowledge-stat, .price-row, .price-total-label, .internal-cost, .order-info small { font-size: 13.5px; }
.knowledge-stat strong, .summary-tile strong, .modal-list-item { font-size: 14.5px; }
.signal-row span, .signal-label, .followup-text { font-size: 13px; }
.settings-title { font-size: 12.5px; }
.order-success strong { font-size: 15.5px; }
.order-success p { font-size: 13.5px; }
.order-info span { font-size: 13px; }
.order-info strong, .order-doc-row .grow strong, .order-todo strong, .stage strong, .check-row strong { font-size: 14.5px; }
.order-doc-row .grow span, .order-todo span:not(.badge):not(.order-todo-dot), .stage span:not(.badge), .check-row span:not(.check-icon), .payment-row { font-size: 13.5px; }
.stage-num { font-size: 13.5px; }
.summary-tile span { font-size: 12.5px; }
.bulk-metric span, .bulk-metric small, .category-head p { font-size: 13.5px; }
.category-head h4 { font-size: 15px; }
.bulk-status-row, .bulk-rfq-meta span { font-size: 13.5px; }
.bulk-rfq-meta strong { font-size: 14px; }
.oe-inline-presets > span, .oe-inline-presets button, .oe-preset-row > span, .oe-search-scan { font-size: 13px; }
.oe-results-head strong, .oe-answer-title strong, .oe-result-title { font-size: 15px; }
.oe-results-head span:not(.badge), .oe-answer-title span:not(.badge) { font-size: 13.5px; }
.oe-evidence, .bulk-oe-result > div:first-child, .bulk-oe-result > div:first-child strong { font-size: 13px; }
.bulk-oe-code { font-size: 15.5px; }
.bulk-oe-result p, .oe-batch-detail-copy span { font-size: 13.5px; }
.oe-batch-detail-copy strong { font-size: 14.5px; }
.channel-card-title strong { font-size: 15px; }
.channel-card-title span, .channel-card-meta, .integration-item p, .field-map > div { font-size: 13.5px; }
.channel-card > p, .integration-item strong { font-size: 14.5px; }
.modal-list-item { font-size: 14px; }

/* Quote intake */
.quote-inbox-body { padding-top: 8px; padding-bottom: 10px; }
.quote-reply-list { display: flex; flex-direction: column; gap: 8px; }
.quote-reply-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.quote-reply-row:hover { border-color: #bfdbfe; background: #f8fbff; transform: translateY(-1px); }
.quote-reply-row.pending { border-color: #fcd34d; background: linear-gradient(90deg, #fffbeb, #fff); }
.quote-reply-source { flex: 0 0 auto; }
.quote-reply-copy { min-width: 0; flex: 1; display: block; }
.quote-reply-copy strong { display: block; font-size: 14.5px; line-height: 1.35; }
.quote-reply-copy span { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-reply-copy small { display: block; margin-top: 4px; color: #475569; font-size: 12.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-reply-tail { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.quote-reply-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.quote-reply-arrow { color: var(--muted-2); }
.quote-intake-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quote-intake-raw { min-height: 150px; resize: vertical; line-height: 1.55; }
.quote-parse-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.parse-status { color: var(--muted); font-size: 13px; line-height: 1.45; }
.parse-status.success { color: #15803d; }
.parse-status.warn { color: #b45309; }
.quote-parsed { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 15px; }
.quote-parsed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.quote-parsed-head strong { display: block; color: var(--ink); font-size: 15px; }
.quote-parsed-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.quote-field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.quote-field-grid .field { margin: 0; }
.quote-parse-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.parse-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 12.5px; font-weight: 600; }
.parse-chip .icon { color: #059669; }
.parse-chip.missing { background: #fff7ed; color: #b45309; }
.parse-chip.missing .icon { color: #d97706; }
#quoteIntakeModal .modal-header { position: sticky; top: 0; z-index: 2; background: #fff; }
#quoteIntakeModal .modal-footer { position: sticky; bottom: 0; z-index: 2; background: #fff; }

/* Responsive */
@media (max-width: 1280px) {
  .sidebar { width: 80px; flex-basis: 80px; padding-left: 10px; padding-right: 10px; align-items: center; }
  .brand { padding: 2px 0; }
  .brand-text, .workspace-copy, .nav-label, .nav-label-text, .nav-count, .context-card, .sidebar-user, .sidebar-footer { display: none; }
  .workspace-switch { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .workspace-icon { width: 32px; height: 32px; }
  .nav { width: 100%; }
  .nav-item { justify-content: center; padding: 12px 0; border-left-width: 0; }
  .nav-item.active { box-shadow: inset 3px 0 0 #60a5fa; }
  .dashboard-grid, .detail-grid, .matching-grid, .compare-grid, .quote-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .detail-grid, .matching-grid, .compare-grid, .quote-grid, .dashboard-grid.lower { grid-template-columns: minmax(0, 1fr); }
  .supplier-bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .price-panel, .quote-settings { position: static; }
  .quote-document { padding: 22px 20px; }
  .attachment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .topbar { height: auto; min-height: 70px; padding: 12px 18px; flex-wrap: wrap; }
  .search-box { display: none; }
  .topbar-user-meta { display: none; }
  .content { padding: 18px 16px 92px; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60;
    width: 100%; height: 68px; flex-basis: auto; flex-direction: row;
    padding: 7px 8px; border-right: 0; border-top: 1px solid rgba(148, 163, 184, .22);
    background: rgba(11, 18, 32, .96); backdrop-filter: blur(16px);
  }
  .brand, .workspace-switch, .sidebar-footer, .context-card { display: none; }
  .nav { flex-direction: row; justify-content: space-around; gap: 0; }
  .nav-item { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 9.5px; border-radius: 8px; }
  .nav-item .icon { width: 19px; height: 19px; }
  .nav-item.active { box-shadow: inset 0 2px 0 #60a5fa; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .page-actions { justify-content: flex-start; }
  .inquiry-hero { flex-direction: column; }
  .inquiry-hero-actions { justify-content: flex-start; }
  .stat-grid { gap: 10px; }
  .stat-card { min-height: 122px; padding: 14px; }
  .stat-value { font-size: 24px; }
  .sparkline { width: 70px; }
  .bulk-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-grid { grid-template-columns: 1fr; }
  .oe-query-grid { grid-template-columns: 1fr 1fr; }
  .oe-search-button { width: 100%; }
  .oe-search-controls { align-items: flex-start; flex-direction: column; }
  .oe-search-controls .btn { width: 100%; }
  .oe-mode-tabs > span { width: 100%; margin-left: 0; }
  .oe-batch-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .extraction-grid { grid-template-columns: 1fr 1fr; }
  .attachment-grid { grid-template-columns: 1fr 1fr; }
  .vehicle-card { align-items: flex-start; }
  .vehicle-art { width: 110px; height: 66px; }
  .candidate { padding: 12px; }
  .candidate-confidence { min-width: 70px; }
  .doc-meta { grid-template-columns: 1fr; gap: 12px; }
  .doc-terms { grid-template-columns: 1fr; gap: 10px; }
  .doc-brand { align-items: flex-start; }
  .doc-title h2 { font-size: 21px; }
  .channel-choice, .entry-preview, .order-summary-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 17px 16px 12px; }
  .modal-footer { padding: 12px 16px 16px; flex-wrap: wrap; }
  .modal-footer .left { width: 100%; margin-bottom: 2px; }
  .toast-container { right: 16px; top: 78px; bottom: auto; }
  .supplier-profile-columns { grid-template-columns: 1fr; gap: 18px; }
  .quote-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-intake-meta { grid-template-columns: 1fr; }
  #page-compare .data-table { min-width: 800px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .bulk-metrics { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .oe-query-grid, .oe-modal-query { grid-template-columns: 1fr; }
  .oe-batch-query { grid-template-columns: 1fr; }
  .oe-results-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .oe-result-actions .btn { flex: 1; }
  .oe-batch-detail-head { flex-direction: column; }
  .oe-batch-detail-head .btn { width: 100%; }
  .oe-batch-detail-row { grid-template-columns: 1fr; align-items: flex-start; }
  .oe-batch-detail-row .btn { width: 100%; }
  .stage { grid-template-columns: 26px minmax(0, 1fr); }
  .stage > .badge { grid-column: 2; justify-self: start; margin-top: 2px; }
  .bulk-rfq-group { flex-wrap: wrap; align-items: flex-start; }
  .bulk-rfq-group .badge { margin-left: 41px; }
  .email-body { max-height: 300px; padding: 12px; font-size: 12px; }
  .bulk-reply-text { min-height: 300px; }
  .extraction-grid { grid-template-columns: 1fr; }
  .attachment-grid { grid-template-columns: 1fr; }
  .order-info-grid { grid-template-columns: 1fr; }
  .order-doc-row { flex-wrap: wrap; }
  .order-doc-row .btn { margin-left: auto; }
  .channel-form-grid { grid-template-columns: 1fr; }
  .channel-actions { flex-direction: column; }
  .doc-totals { width: 100%; }
  .quote-document { padding: 18px 15px; }
  .doc-brand { flex-direction: column; }
  .doc-title { text-align: left; }
  .doc-title h2 { font-size: 22px; }
  .inquiry-hero h2 { font-size: 19px; }
  .action-bar { align-items: flex-start; flex-direction: column; }
  .action-bar .btn { width: 100%; }
  .demo-banner .btn { margin-left: 0; }
  .supplier-directory-card .list-toolbar { width: 100%; }
  .supplier-directory-card .search-inline { flex: 1 1 100%; width: 100%; }
  .supplier-filter-select { width: 100%; }
  .supplier-table-foot { align-items: flex-start; flex-direction: column; }
  .supplier-profile-head { align-items: flex-start; flex-direction: column; }
  .supplier-profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supplier-form-grid { grid-template-columns: 1fr; }
  .supplier-field-wide { grid-column: auto; }
  .supplier-structure-row { grid-template-columns: 94px minmax(0, 1fr) 42px; gap: 8px; }
  .quote-reply-row { align-items: flex-start; flex-wrap: wrap; }
  .quote-reply-source { order: 1; }
  .quote-reply-tail { order: 2; margin-left: auto; }
  .quote-reply-copy { order: 3; flex-basis: 100%; }
  .quote-reply-arrow { display: none; }
  .quote-field-grid { grid-template-columns: 1fr; }
  .quote-parsed-head { flex-direction: column; }
  .quote-parse-bar .btn { width: 100%; }

  /* Turn the quotation line items into readable stacked cards on phones. */
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody { display: block; width: 100%; }
  .doc-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 10px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }
  .doc-table td { display: block; width: 100%; padding: 0; border: 0; text-align: left; }
  .doc-table td:nth-child(1) { display: none; }
  .doc-table td:nth-child(2) { grid-column: 1 / -1; font-size: 13px; }
  .doc-table td:nth-child(3) { grid-column: 1 / -1; padding: 2px 0 7px; }
  .doc-table td:nth-child(4), .doc-table td:nth-child(5), .doc-table td:nth-child(6) { text-align: left; }
  .doc-table td:nth-child(2)::before,
  .doc-table td:nth-child(3)::before,
  .doc-table td:nth-child(4)::before,
  .doc-table td:nth-child(5)::before,
  .doc-table td:nth-child(6)::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  .doc-table td:nth-child(2)::before { content: "OEM / Part No."; }
  .doc-table td:nth-child(3)::before { content: "Description"; }
  .doc-table td:nth-child(4)::before { content: "Qty"; }
  .doc-table td:nth-child(5)::before { content: "Unit Price"; }
  .doc-table td:nth-child(6)::before { content: "Amount"; }
}

/* Print quotation only */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .sidebar, .topbar, .demo-banner, .page:not(#page-quote), .quote-settings, .page-head, .breadcrumb, .order-success, .toast-container, .modal-backdrop { display: none !important; }
  .app-shell, .main-shell, .content { display: block; padding: 0; margin: 0; max-width: none; }
  #page-quote { display: block !important; }
  .quote-grid { display: block; }
  .quote-document { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .quote-document, .doc-table { font-size: 9.5px; }
  .doc-brand { flex-direction: row; }
  .doc-title { text-align: right; }
  .doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
  .doc-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
}

/* Typography clarity: keep Windows text crisp and avoid synthetic weights. */
body {
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
}
.topbar { background: #fff; backdrop-filter: none; }
.nav-item { font-weight: 500; }
.btn, .badge, .channel, .cell-main, .field label, .segmented button, .stat-label,
.table-link, .status-tab, .extraction-field label, .extraction-field strong,
.missing-chip, .candidate-title, .price-row strong, .internal-cost strong,
.entry-tab, .sample-link, .modal-list-item, .summary-tile strong {
  font-weight: 600;
}
.stat-value, .trend-up, .trend-down, .candidate-code, .confidence-num,
.price-total, .doc-total-row.grand, .settings-title {
  font-weight: 700;
}
@media screen {
  .data-table { font-size: 14.5px; }
  .data-table th { font-size: 12.5px; }
  .channel, .card-header p, .stat-label, .stat-meta, .reminder span,
  .legend-row, .meter-row, .funnel-row, .action-bar-copy span, .customer-row,
  .attachment-meta strong, .candidate-title, .field label, .modal-footer .left {
    font-size: 13.5px;
  }
  .badge, .cell-sub, .field-hint, .timeline-copy span, .item-tab span,
  .candidate-source, .candidate-confidence span, .signal-label, .supplier-name span,
  .compare-footnote, .internal-cost, .rfq-preview, .entry-preview-item span,
  .rfq-supplier-meta span, .channel-choice span, .summary-tile span, .chat-time {
    font-size: 13px;
  }
  .signal-row span, .range-labels { font-size: 12.5px; }
  .topbar-eyebrow, .topbar-subtitle, .breadcrumb, .page-head p { font-size: 14.5px; }
  .nav-item { font-size: 15px; }
  .owner-name { font-size: 13.5px; font-weight: 600; }
  .demo-banner { font-size: 13.5px; }
  .meter-row strong { font-size: 13.5px; }
  .donut-center span { font-size: 12.5px; }
  .order-doc-icon { font-size: 11px; }
  .channel-logo { font-size: 12px; }
  .price-total-label { font-size: 13.5px !important; }
  .avatar.blue, .avatar.amber, .avatar.violet, .avatar.green, .avatar.rose { font-size: 12.5px; }
  .avatar.sm { font-size: 11.5px; }

  /* The quotation remains A4-sized for printing, but gets a more legible screen preview. */
  .doc-logo-mark { font-size: 17px; }
  .doc-company strong { font-size: 17px; }
  .doc-company span { font-size: 11px; }
  .doc-title h2 { font-size: 28px; }
  .doc-title p { font-size: 11.5px; }
  .doc-meta h4, .doc-terms h4 { font-size: 11px; }
  .doc-meta p { font-size: 12.5px; }
  .doc-table { font-size: 12px; }
  .doc-table th { font-size: 11px; }
  .doc-table .oem { font-size: 12px; }
  .doc-totals { width: 310px; }
  .doc-total-row { font-size: 12px; }
  .doc-total-row.grand { font-size: 16px; }
  .doc-terms p { font-size: 12px; }
  .doc-footer { font-size: 11px; }
  .vehicle-info h3 { font-size: 16.5px; }
  .vehicle-info p { font-size: 13.5px; }
  .quote-supplier-row .muted { font-size: 13.5px; }
  .quote-supplier-row strong { font-size: 14px; }
}

/* Product master */
.product-library-card { overflow: hidden; }
.product-category-tabs { flex-wrap: wrap; }
.product-list-toolbar { min-width: min(100%, 520px); }
.product-list-toolbar .search-inline { min-width: 260px; }
.product-quality-select { width: 150px; }
.product-shortcut-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f8fafc, #f5f3ff 72%, #eff6ff);
  color: var(--muted);
  font-size: 13.5px;
}
.product-shortcut-list { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.product-shortcut-list > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.product-shortcut-strip .kbd {
  min-width: 29px;
  height: 24px;
  padding: 0 7px;
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 1px 0 #cbd5e1;
}
.product-selected-hint {
  min-width: 0;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1d4ed8;
  font-weight: 600;
}
.product-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.product-table { min-width: 1180px; }
.product-table td { padding: 11px 11px; }
.product-table th { padding: 10px 11px; }
.product-table tbody tr { cursor: pointer; }
.product-table tbody tr:hover { background: #f8fafc; }
.product-table tbody tr.selected { background: #eff6ff; box-shadow: inset 3px 0 0 #2563eb; }
.product-table tbody tr.selected:hover { background: #eaf3ff; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 176px; }
.product-cell-copy { min-width: 0; }
.product-cell-copy strong { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }
.product-cell-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.product-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 14px;
  color: #1d4ed8;
  background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #eff6ff, #dbeafe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 12px rgba(15, 23, 42, .06);
}
.product-thumb .icon { width: 30px; height: 30px; stroke-width: 1.55; }
.product-thumb.sm { width: 42px; height: 42px; flex-basis: 42px; border-radius: 11px; }
.product-thumb.sm .icon { width: 23px; height: 23px; }
.product-thumb.suspension { color: #6d28d9; background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #f5f3ff, #ede9fe); }
.product-thumb.body { color: #b45309; background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #fffbeb, #fef3c7); }
.product-thumb.lighting { color: #0e7490; background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #ecfeff, #cffafe); }
.product-thumb.cooling { color: #047857; background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #ecfdf5, #d1fae5); }
.product-thumb.interior { color: #7c3aed; background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #faf5ff, #f3e8ff); }
.product-thumb.engine { color: #be123c; background: radial-gradient(circle at 70% 22%, rgba(255, 255, 255, .9), transparent 36%), linear-gradient(145deg, #fff1f2, #ffe4e6); }
.product-oe { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.product-en { max-width: 190px; color: #334155; font-size: 13px; line-height: 1.42; }
.product-stock { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.product-stock strong { font-size: 17px; letter-spacing: -.03em; }
.product-stock span { color: var(--muted); font-size: 12px; }
.product-stock.ok strong { color: #15803d; }
.product-stock.low strong { color: #b45309; }
.product-stock.out strong { color: #b91c1c; }
.product-money { white-space: nowrap; font-size: 13.5px; }
.product-price-missing { display: inline-flex; padding: 2px 7px; border-radius: 999px; background: #fffbeb; color: #b45309; font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; font-size: 12px; font-weight: 600; white-space: nowrap; }
.product-row-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.product-row-actions .btn { padding: 6px 8px; font-size: 12.5px; }
.product-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12.5px;
}
.product-table-foot strong { color: var(--ink-2); }
.product-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.product-mini-list { display: flex; flex-direction: column; gap: 2px; }
.product-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}
.product-mini-row:last-child { border-bottom: 0; padding-bottom: 0; }
.product-mini-row:first-child { padding-top: 0; }
.product-mini-row:hover .product-mini-copy strong { color: var(--blue); }
.product-mini-copy { flex: 1; min-width: 0; }
.product-mini-copy strong { display: block; overflow: hidden; color: var(--ink-2); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease; }
.product-mini-copy span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.product-mini-tail { flex: 0 0 auto; text-align: right; }
.product-mini-tail strong { display: block; color: #15803d; font-size: 14px; }
.product-mini-tail span { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.product-demo-note { margin: 11px 2px 0; color: var(--muted-2); font-size: 12px; line-height: 1.55; }

/* Product lookup */
.product-lookup-modal { width: min(760px, 100%); }
.product-lookup-body { padding-top: 16px; }
.product-lookup-search {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 0 15px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #f8fbff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .06);
  color: var(--blue);
}
.product-lookup-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 17px; }
.product-lookup-search input::placeholder { color: #94a3b8; }
.product-lookup-tip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px 11px; color: var(--muted); font-size: 12.5px; }
.product-lookup-tip b { color: var(--ink-2); font-weight: 600; }
.product-lookup-tip > span:last-child { flex: 0 0 auto; color: var(--muted-2); }
.product-lookup-results { max-height: min(52vh, 460px); overflow-y: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.product-lookup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: inherit;
  text-align: left;
}
.product-lookup-row:last-child { border-bottom: 0; }
.product-lookup-row:hover, .product-lookup-row.active { background: #eff6ff; box-shadow: inset 3px 0 0 #2563eb; }
.product-lookup-copy { flex: 1; min-width: 0; }
.product-lookup-oe { display: block; color: #1d4ed8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; font-weight: 700; }
.product-lookup-copy strong { display: block; margin-top: 2px; overflow: hidden; color: var(--ink); font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.product-lookup-copy strong em { color: var(--muted); font-size: 13px; font-style: normal; font-weight: 500; }
.product-lookup-copy > span:last-child { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.product-lookup-side { flex: 0 0 110px; text-align: right; }
.product-lookup-side > * { display: block; }
.product-lookup-side .badge { margin-left: auto; }
.product-lookup-side strong { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; }
.product-lookup-side small { color: var(--muted); font-size: 12px; }
.product-lookup-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 40px 20px; color: var(--muted); text-align: center; }
.product-lookup-empty .icon { width: 30px; height: 30px; margin-bottom: 3px; color: #94a3b8; }
.product-lookup-empty strong { color: var(--ink-2); font-size: 15px; }
.product-lookup-empty span { font-size: 13px; }

/* Product import */
.product-import-tabs .entry-tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; }
.product-import-hint { padding: 9px 11px; border: 1px solid #dbeafe; border-radius: 10px; background: #eff6ff; color: #1e40af; font-size: 12.5px; line-height: 1.5; }
.product-import-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0 7px; }
.product-import-format { color: var(--muted); font-size: 12px; text-align: right; }
.product-import-textarea { min-height: 210px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; }
.product-import-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.product-import-actions > span { color: var(--muted); font-size: 12.5px; }
.product-import-preview { margin-top: 15px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.product-import-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 11px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.product-import-summary .summary-tile { background: #fff; }
.product-import-summary .summary-tile span { font-size: 11.5px; }
.product-import-summary .summary-tile strong { font-size: 18px; }
.product-import-table-wrap { max-height: 340px; overflow: auto; }
.product-import-table { min-width: 930px; }
.product-import-table td, .product-import-table th { padding: 9px 10px; }
.product-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-field-wide { grid-column: 1 / -1; }

/* Stock movements */
.stock-product-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(90deg, #f8fafc, #eff6ff);
}
.stock-product-copy { flex: 1; min-width: 0; }
.stock-product-copy strong { display: block; font-size: 15px; }
.stock-product-copy span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.stock-product-copy small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }
.stock-product-side { flex: 0 0 auto; text-align: right; }
.stock-product-side > * { display: block; }
.stock-product-side .badge { margin-left: auto; }
.stock-product-side strong { margin-top: 6px; font-size: 19px; letter-spacing: -.03em; }
.stock-product-side span { color: var(--muted); font-size: 12px; }
.stock-history-summary { display: grid; grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(110px, .55fr)); gap: 9px; margin-bottom: 13px; }
.stock-history-product { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.stock-history-product > div { flex: 1; min-width: 0; }
.stock-history-product strong { display: block; overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.stock-history-product span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.stock-history-product small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 11.5px; }
.stock-history-summary .summary-tile { display: flex; flex-direction: column; justify-content: center; }
.stock-history-summary .summary-tile span { font-size: 12px; }
.stock-history-summary .summary-tile strong { font-size: 19px; letter-spacing: -.03em; }
.stock-history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.stock-history-table-wrap { max-height: 430px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.stock-history-table { min-width: 850px; }
.stock-history-table td, .stock-history-table th { padding: 10px 11px; }
.stock-history-qty { display: inline-flex; min-width: 48px; justify-content: center; padding: 3px 8px; border-radius: 999px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; }
.stock-history-qty.in { background: #dcfce7; color: #15803d; }
.stock-history-qty.out { background: #dbeafe; color: #1d4ed8; }

@media (max-width: 1080px) {
  .product-bottom-grid { grid-template-columns: 1fr; }
  .stock-history-summary { grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(100px, .6fr)); }
}

@media (max-width: 820px) {
  .product-list-toolbar { width: 100%; min-width: 0; }
  .product-list-toolbar .search-inline { flex: 1 1 100%; width: 100%; min-width: 0; }
  .product-quality-select { width: 150px; }
  .product-category-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .product-category-tabs .status-tab { flex: 0 0 auto; }
  .product-shortcut-strip { align-items: flex-start; flex-direction: column; }
  .product-selected-hint { max-width: 100%; }
  .product-table-foot { align-items: flex-start; flex-direction: column; }
  .product-lookup-tip { align-items: flex-start; flex-direction: column; gap: 4px; }
  .product-import-toolbar { align-items: flex-start; flex-direction: column; }
  .product-import-format { text-align: left; }
  .product-import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-history-product { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .product-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-stat-grid .stat-card { min-height: 112px; padding: 12px; }
  .product-stat-grid .stat-value { font-size: 23px; }
  .product-list-toolbar { align-items: stretch; flex-direction: column; }
  .product-quality-select { width: 100%; }
  .product-shortcut-list { gap: 9px 13px; }
  .product-shortcut-strip { padding: 10px 12px; }
  .product-lookup-row { align-items: flex-start; gap: 9px; }
  .product-lookup-side { flex-basis: 82px; }
  .product-lookup-side .badge { font-size: 10.5px; }
  .product-lookup-copy strong { white-space: normal; }
  .product-lookup-copy strong em { display: block; margin-top: 1px; }
  .product-lookup-search input { font-size: 15px; }
  .product-import-actions { align-items: flex-start; flex-direction: column; }
  .product-import-actions .btn { width: 100%; }
  .product-form-grid { grid-template-columns: 1fr; }
  .product-field-wide { grid-column: auto; }
  .stock-product-banner { align-items: flex-start; flex-wrap: wrap; }
  .stock-product-copy { flex: 1 1 calc(100% - 70px); }
  .stock-product-side { width: 100%; padding-left: 66px; text-align: left; }
  .stock-product-side .badge { margin-left: 0; }
  .stock-product-side > * { display: inline-flex; align-items: baseline; margin-right: 8px; }
  .stock-history-toolbar { align-items: flex-start; flex-direction: column; }
  .stock-history-toolbar .segmented { width: 100%; }
  .stock-history-toolbar .segmented button { flex: 1; }
  .stock-history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-mini-copy strong { font-size: 13px; }
}
