/* ============================================================
   d6.css — Direction 6 "Channel Cluster" redesign stylesheet.
   Ported from design_handoff_autolist_redesign/ (styles.css +
   variants.css, "combined" variant flattened, cluster mode).
   Loaded AFTER styles/index.css; index.css keeps serving the
   legacy tab panels (Reports / Schedule / What's New / Archive),
   loader, banners and modals.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #f5f6fa;   /* combined variant override of #f4f5fa */
  --bg-2:      #eef0f8;
  --card:      #ffffff;
  --card-2:    #fbfbfe;
  --line:      #e9eaf3;
  --line-2:    #f0f1f8;

  /* Text */
  --ink:       #181b29;
  --ink-2:     #555b73;
  --ink-3:     #8b90a6;
  --ink-faint: #aeb2c6;

  /* Brand */
  --brand:        #5b63f0;
  --brand-2:      #8b5cf6;
  --brand-ink:    #4a4fd6;
  --brand-soft:   #eef0fe;
  --brand-grad:   linear-gradient(135deg, #5b63f0 0%, #8b5cf6 100%);
  --brand-grad-soft: linear-gradient(135deg, #eef0fe 0%, #f3edff 100%);

  /* Status palette (soft bg / strong text / dot) */
  --green:    #15924f;  --green-bg:    #e6f6ec;  --green-fill: #1fae5c;
  --teal:     #0d9488;  --teal-bg:     #e2f6f3;
  /* Ready state: legacy/old-design green so users aren't confused by the redesign.
     Kept a clear green (not the redesign teal) so it reads distinctly from teal. */
  --ready:    #16a34a;  --ready-bg:    #ecfdf5;
  --gray:     #6b7185;  --gray-bg:     #eef0f5;
  --orange:   #d9760a;  --orange-bg:   #fdefdf;
  --purple:   #7c3aed;  --purple-bg:   #f1ebfe;
  --red:      #d83a3a;  --red-bg:      #fdebeb;
  --amber:    #b07807;  --amber-bg:    #fcf3da;
  --blue:     #2563eb;  --blue-bg:     #e8f0fe;
  --gold:     #e0a106;  --gold-bg:     #fdf5d8;

  /* Geometry */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(24,27,41,.05);
  --shadow:    0 4px 16px -6px rgba(24,27,41,.10), 0 1px 3px rgba(24,27,41,.05);
  --shadow-lg: 0 18px 48px -16px rgba(24,27,41,.30);

  --ease: cubic-bezier(.4,.1,.2,1);

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ============================================================
   Base
   ============================================================ */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.tnum { font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #d3d6e4; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bdd0; background-clip: padding-box; }

/* Normalize the new D6 components against index.css element-level
   button/select rules (padding, radius, transitions). Each component
   below re-declares its real values after this reset. */
.sb-nav .nav-tab, .sb-link, .btn, .chip, .fb-collapse, .fb-active, .ks, .star,
.chchip, .chmenu-opt, .bbtn, .drawer-x, .chpill, .ai-btn, .chip-logout {
  background: none; border: none; padding: 0; border-radius: 0;
  font-size: inherit; box-shadow: none; color: inherit; cursor: pointer;
  font-family: inherit; transition: none;
}

/* ============================================================
   App shell (combined: dark sidebar + body column)
   ============================================================ */
.app { min-height: 100vh; display: flex; flex-direction: row; }
.app-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* ---- Sidebar ---- */
.sidebar {
  width: 234px; flex-shrink: 0; background: #14172a; color: #cdd1e6;
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; z-index: 20;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-grad);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 12px -3px rgba(91,99,240,.55);
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #fff; }
.brand-sub { font-size: 10.5px; color: #7e84a8; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2; margin-top: 1px; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; }
.sb-nav .nav-tab, .sb-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  font-weight: 700; font-size: 13.5px; color: #aeb3d4; transition: all .14s var(--ease); width: 100%;
  text-align: left; white-space: nowrap;
}
.sb-nav .nav-tab svg, .sb-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sb-nav .nav-tab:hover, .sb-link:hover { background: rgba(255,255,255,.06); color: #fff; filter: none; }
.sb-nav .nav-tab.active { background: var(--brand-grad); color: #fff; box-shadow: 0 10px 22px -10px rgba(91,99,240,.8); }
.sb-badge, .nav-badge { margin-left: auto; background: rgba(255,255,255,.18); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; color: inherit; }
.sb-nav .nav-tab.active .sb-badge { background: rgba(255,255,255,.25); }

.sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sb-acct { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-acct .who { color: #fff; font-weight: 700; font-size: 13px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.conn-line { font-size: 11px; color: #46d39a; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.conn-line .dot { width: 6px; height: 6px; border-radius: 50%; background: #46d39a; box-shadow: 0 0 0 3px rgba(70,211,154,.18); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
}

/* ============================================================
   Topbar (slim)
   ============================================================ */
header.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  /* neutralize index.css generic header rules */
  position: static; backdrop-filter: none; z-index: auto;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.crumbs svg { width: 16px; height: 16px; color: var(--brand); }
.crumbs .sep { color: var(--ink-faint); }
.crumbs b { color: var(--ink); }
.topbar-spacer { flex: 1; }

/* dealer-switch pill (admin tenant selector) */
.dealer-pill {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-weight: 700; font-size: 13px;
  transition: border-color .15s var(--ease);
}
.dealer-pill:hover { border-color: #d4d7e8; }
.dealer-pill label { color: var(--ink-3); font-weight: 600; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.dealer-pill select {
  border: none; background: transparent; outline: none; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--ink); max-width: 150px; padding: 0;
}
/* admin action inside the pill: email the tenant an account setup link */
.pill-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.pill-action:hover { color: var(--brand); border-color: #d4d7e8; }
.pill-action:disabled { opacity: .45; cursor: default; }
.pill-action svg { width: 14px; height: 14px; }

/* connection badge (#connectionStatus) */
.status-indicator {
  display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px;
  border-radius: var(--r-sm); font-weight: 700; font-size: 12.5px;
  background: var(--gray-bg); color: var(--gray);
  white-space: nowrap;
}
.status-indicator.status-ok, .status-indicator.status-connected {
  background: var(--green-bg); color: var(--green);
}
.status-indicator.status-error, .status-indicator.status-disconnected {
  background: var(--red-bg); color: var(--red);
}
.status-indicator .dot, .conn .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green-fill);
  box-shadow: 0 0 0 3px rgba(31,174,92,.18);
}

/* account chip in topbar */
.account-chip { display: flex; align-items: center; gap: 9px; padding-left: 4px; background: none; border: none; }
.account-chip .chip-text { display: flex; flex-direction: column; }
.account-chip .chip-name { font-weight: 700; font-size: 13px; line-height: 1.1; color: var(--ink); }
.chip-logout { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.chip-logout:hover { color: var(--brand); }

/* ============================================================
   Canvas + command bar
   ============================================================ */
main.canvas { flex: 1; padding: 22px 28px 60px; max-width: 1640px; width: 100%; margin: 0 auto; }

.cmdbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cmd-title { display: flex; align-items: baseline; gap: 10px; }
.cmd-title h1 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); display: block; white-space: nowrap; }
.cmd-title .count { font-size: 13px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }

.exec-pill {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 6px 0 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-sm);
}
.exec-pill > svg:first-child { width: 18px; height: 18px; color: var(--brand); }
.exec-pill .txt { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.exec-pill .txt a { color: var(--ink); text-decoration: none; font-weight: 700; }
.exec-pill .txt a:hover { color: var(--brand-ink); }
.exec-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 12px;
  padding: 6px 11px; border-radius: 999px; letter-spacing: -.01em;
}
.exec-chip svg { width: 12px; height: 12px; }

.express-pill {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 16px;
  background: var(--orange-bg); border: 1px solid #f3d9b3;
  border-radius: 999px; font-family: inherit; cursor: pointer;
  transition: filter .15s var(--ease), box-shadow .15s var(--ease);
}
.express-pill:hover:not(:disabled) { filter: brightness(.97); box-shadow: var(--shadow-sm); }
.express-pill svg { width: 16px; height: 16px; color: var(--orange); flex-shrink: 0; }
.express-pill .txt { font-size: 12.5px; font-weight: 800; color: var(--orange); white-space: nowrap; }
.express-pill .sub { font-size: 11px; font-weight: 600; color: var(--orange); opacity: .75; white-space: nowrap; }
.express-pill:disabled { opacity: .55; cursor: not-allowed; filter: none; }

.cmd-spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: all .15s var(--ease); border: 1px solid transparent;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(91,99,240,.6); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 20px -6px rgba(91,99,240,.7); }
.btn-primary .pending,
.btn-primary .save-dirty-badge {
  background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 2px;
  display: inline-flex; align-items: center; position: static; color: #fff; font-weight: 800;
}
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #d4d7e8; background: var(--card-2); filter: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: #e6e9fe; filter: none; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fbe0e0; filter: none; }
.btn-warn { background: var(--orange-bg); color: var(--orange); }
.btn-warn:hover { background: #fbe6cf; filter: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============================================================
   KPI strip
   ============================================================ */
.kpi-strip {
  display: flex; align-items: stretch; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden;
}
.ks {
  flex: 1 1 0; min-width: 104px; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-right: 1px solid var(--line-2); text-align: left;
  transition: background .14s var(--ease); position: relative;
  border-radius: 0; background: none;
}
.ks:last-child { border-right: none; }
.ks:hover { background: var(--card-2); filter: none; }
.ks.active { background: var(--brand-soft); }
.ks.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; background: var(--accent, var(--brand)); }

/* Neutralize legacy index.css .filter-btn tints/gradient on the KPI cards */
.kpi-strip .ks.filter-btn,
.kpi-strip .ks.filter-btn[data-filter]:not(.active),
.kpi-strip .ks.filter-btn[data-filter]:not(.active):hover {
  background: none; border: none; border-right: 1px solid var(--line-2);
  border-radius: 0; box-shadow: none; color: inherit; padding: 13px 16px; transform: none;
}
.kpi-strip .ks.filter-btn:last-child { border-right: none; }
.kpi-strip .ks.filter-btn:hover { background: var(--card-2); }
.kpi-strip .ks.filter-btn.active { background: var(--brand-soft); border-right: 1px solid var(--line-2); box-shadow: none; color: inherit; }
.kpi-strip .ks.filter-btn.active:last-child { border-right: none; }
.ks-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  /* prototype: color-mix(in srgb, var(--accent) 13%, #fff) — replaced by per-KPI --accent-bg token */
  background: var(--accent-bg, var(--brand-soft)); color: var(--accent, var(--brand)); flex-shrink: 0; }
.ks-ico svg { width: 17px; height: 17px; }
.ks-meta { display: flex; flex-direction: column; line-height: 1.12; }
.ks-val { font-size: 21px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
.ks-label { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }

/* collapse animation for the KPI region */
.kpi-collapse { overflow: hidden; max-height: 280px; opacity: 1; transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .26s ease; }
.kpi-collapse.closed { max-height: 0; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .kpi-collapse { transition: none; } }

/* ============================================================
   Filter bar
   ============================================================ */
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 13px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.filterbar.collapsed { gap: 12px; }
.chip-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip-div { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }

/* chips / active-pill fade in when the panel re-appears */
@media (prefers-reduced-motion: no-preference) {
  .filterbar .chip-group, .filterbar .chip-div, .fb-active { animation: fbFade .3s var(--ease) both; }
}
@keyframes fbFade { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

.fb-collapse {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px 0 9px; border-radius: 999px; flex-shrink: 0;
  font-weight: 700; font-size: 12.5px; color: var(--ink-2);
  background: var(--bg); border: 1.4px solid var(--line);
  transition: all .14s var(--ease);
}
.fb-collapse:hover { border-color: #d4d7e8; background: var(--card-2); color: var(--ink); filter: none; }
.fb-collapse svg { width: 15px; height: 15px; color: var(--ink-3); transition: transform .2s var(--ease); }
.fb-collapse.panel-open svg { transform: rotate(180deg); }

.fb-active {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 9px 0 12px; border-radius: 999px;
  font-weight: 700; font-size: 12.5px; color: var(--brand-ink);
  background: var(--brand-soft); border: 1.4px solid transparent;
  transition: all .14s var(--ease);
}
.fb-active:hover { background: #e6e9fe; filter: none; }
.fb-active-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.fb-active svg { width: 14px; height: 14px; opacity: .65; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  font-weight: 700; font-size: 12.5px; color: var(--ink-2);
  background: transparent; border: 1.4px solid var(--line);
  transition: all .14s var(--ease);
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: #d4d7e8; background: var(--card-2); filter: none; }
.chip.active { color: #fff; border-color: transparent; }
/* Neutralize legacy index.css .filter-btn tints/gradient on the D6 chips */
.filterbar .chip.filter-btn,
.filterbar .chip.filter-btn[data-filter]:not(.active),
.filterbar .chip.filter-btn[data-filter]:not(.active):hover {
  background: transparent; border: 1.4px solid var(--line); border-radius: 999px;
  box-shadow: none; padding: 0 11px; transform: none;
}
.filterbar .chip.filter-btn[data-filter]:not(.active):hover { border-color: #d4d7e8; background: var(--card-2); }
.filterbar .chip.filter-btn.active { border: 1.4px solid transparent; box-shadow: none; padding: 0 11px; }

.chip[data-s="published"] { color: var(--green); } .chip[data-s="published"].active { background: var(--green); color: #fff; }
.chip[data-s="ready"]     { color: var(--ready); } .chip[data-s="ready"].active { background: var(--ready); color: #fff; }
.chip[data-s="hold"]      { color: var(--gray); }  .chip[data-s="hold"].active { background: var(--gray); color: #fff; }
.chip[data-s="republish"] { color: var(--orange); }.chip[data-s="republish"].active { background: var(--orange); color: #fff; }
.chip[data-s="sold"]      { color: var(--purple); }.chip[data-s="sold"].active { background: var(--purple); color: #fff; }
.chip[data-s="error"]     { color: var(--red); }   .chip[data-s="error"].active { background: var(--red); color: #fff; }
.chip[data-s="img"]       { color: var(--amber); } .chip[data-s="img"].active { background: var(--amber); color: #fff; }
.chip[data-s="carfax"]    { color: var(--blue); }  .chip[data-s="carfax"].active { background: var(--blue); color: #fff; }
.chip[data-s="top"]       { color: var(--gold); }  .chip[data-s="top"].active { background: var(--gold); color: #fff; }

.filterbar .search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 13px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); transition: all .14s var(--ease);
}
.filterbar .search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(91,99,240,.12); }
.filterbar .search svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.filterbar .search input { flex: 1; border: none; background: none; outline: none; font-weight: 600; font-size: 13px; color: var(--ink); padding: 0; }
.filterbar .search input::placeholder { color: var(--ink-faint); font-weight: 600; }

.sortsel {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-weight: 700; font-size: 12.5px; color: var(--ink-2); outline: none; cursor: pointer;
}

/* ============================================================
   Table (CSS grid rows)
   ============================================================ */
.tablecard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 18px 44px -22px rgba(24,27,41,.32);
  overflow: hidden; position: relative;
}

.thead {
  display: grid; align-items: center; column-gap: 0;
  grid-template-columns: var(--cols);
  padding: 0 18px; height: 46px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  position: sticky; top: 0; z-index: 5;
}
.th {
  font-size: 11px; font-weight: 800; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.th.sortable-header { cursor: pointer; }
.th.sortable-header:hover { color: var(--ink-2); }
.th.num { justify-content: flex-end; }
.th.center { justify-content: center; }
.th-vin, .th-title, .th-channels { justify-content: flex-start; }
.th-check { justify-content: center; }
.th-year { justify-content: center; }
.th-num { justify-content: flex-end; text-align: right; }
.th-vin { padding-left: 10px; }
.th-channels { padding-left: 14px; }
.th svg { width: 15px; height: 15px; }
.th .sort-icon { opacity: 0; transition: opacity .12s; font-size: 10px; line-height: 1; }
/* updateTableHeaderSortDisplay() marks the sorted header with .active */
.th.active .sort-icon { opacity: 1; color: var(--brand); }
.th.active { color: var(--ink-2); }

.row {
  display: grid; align-items: center;
  grid-template-columns: var(--cols);
  padding: 0 18px; min-height: 62px;
  transition: background .12s var(--ease);
  cursor: pointer; position: relative;
  border-bottom: 1px solid var(--line-2);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--card-2); }
.row.selected, .row.row-selected { background: var(--brand-soft); }
.row.expanded { background: var(--brand-grad-soft); box-shadow: inset 3px 0 0 var(--brand); }
.row.sold { opacity: .62; }

.cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell.num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.cell.center { justify-content: center; }
.row > .cell:nth-child(4) { padding-left: 10px; }

/* row checkbox (existing input.rowSelect, restyled) */
input.rowSelect {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 5px; border: 1.8px solid #ccd0e0;
  background: #fff; cursor: pointer; margin: 0; flex-shrink: 0;
  display: inline-block; position: relative; transition: all .12s var(--ease);
}
input.rowSelect:checked { background-color: var(--brand); border-color: var(--brand); }
input.rowSelect:checked::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.chev { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); transition: all .15s var(--ease); flex-shrink: 0; }
.chev svg { width: 15px; height: 15px; }
.row:hover .chev { background: var(--bg-2); color: var(--ink-2); }
.row.expanded .chev { color: var(--brand); }
/* combined variant: detail opens to the side, chevron does not rotate
   (also neutralizes the legacy .inv-row.expanded .row-caret rotation) */
.inv-row.expanded .row-caret { transform: none; }

/* thumbnail */
.thumb {
  width: 50px; height: 38px; border-radius: 7px; flex-shrink: 0; position: relative; overflow: hidden;
  background: repeating-linear-gradient(135deg, #eceeffe0 0 7px, #e3e6f5 7px 14px);
  border: 1px solid var(--line); display: grid; place-items: center;
}
.thumb .ph-ico { width: 17px; height: 17px; color: #b8bcd2; }
.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.thumb .pcount {
  position: absolute; right: 3px; bottom: 3px; background: rgba(24,27,41,.78); color: #fff;
  font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 4px; line-height: 1.3;
  display: flex; align-items: center; gap: 2px;
}
.thumb.empty { background: var(--amber-bg); border-color: #f0dba8; }
.thumb.empty .ph-ico { color: var(--amber); }

.vin { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.title-cell { flex-direction: column; align-items: flex-start; gap: 2px; justify-content: center; }
.veh-title { font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.veh-meta { font-size: 11.5px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }

.star { width: 24px; height: 24px; display: grid; place-items: center; color: #d2d5e4; flex-shrink: 0; transition: all .14s var(--ease); }
.star svg { width: 17px; height: 17px; }
.star:hover { color: var(--gold); transform: scale(1.12); filter: none; }
.star.on { color: var(--gold); }

.price { font-weight: 800; font-size: 14px; letter-spacing: -.02em; color: var(--ink); }
.year, .odo { font-weight: 700; font-size: 13px; color: var(--ink-2); }

/* asset dots (img / carfax) */
.asset { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.asset svg { width: 15px; height: 15px; }
.asset.ok { background: var(--green-bg); color: var(--green); }
.asset.no { background: var(--amber-bg); color: var(--amber); }

/* ---- channel cluster ---- */
.chcluster { display: flex; gap: 5px; flex-wrap: nowrap; margin-left: 14px; }
.chchip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px;
  padding: 2px 9px 2px 2px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); cursor: pointer; flex-shrink: 0;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease), transform .12s var(--ease);
}
.chchip:hover { border-color: var(--ink-faint); box-shadow: 0 3px 9px rgba(24,27,41,.12); transform: translateY(-1px); filter: none; }
.chchip.open { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.chchip.locked { cursor: not-allowed; }
.chchip.locked:hover { border-color: var(--line); box-shadow: none; transform: none; }
.chtile { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  color: #fff; font-size: 10.5px; font-weight: 800; flex-shrink: 0; overflow: hidden; }
/* Brand marks rendered inside channel tiles. Full app icons fill the tile;
   the transparent CarGurus mark is contained with a little breathing room. */
.chlogo { width: 100%; height: 100%; object-fit: cover; display: block; }
.chlogo.contain { object-fit: contain; padding: 2px; box-sizing: border-box; }
.chlogo-svg { width: 15px; height: 15px; }
.chsdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box; }
.chsdot[data-s="published"] { background: var(--green); }
.chsdot[data-s="ready"]     { background: #fff; border: 2px solid var(--ready); }
.chsdot[data-s="republish"] { background: var(--orange); }
.chsdot[data-s="error"]     { background: var(--red); }
.chsdot[data-s="hold"]      { background: var(--gray); }
.chsdot[data-s="sold"]      { background: var(--purple); }

/* status-change popover */
.chmenu {
  position: fixed; z-index: 150;
  background: #fff; border-radius: 11px; padding: 5px; min-width: 196px;
  box-shadow: 0 16px 40px -8px rgba(24,27,41,.28), 0 0 0 1px var(--line);
  font-family: var(--font);
}
.chmenu-head { display: flex; align-items: center; gap: 8px; padding: 8px 9px 9px;
  font-size: 12px; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.chmenu-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: none;
  background: transparent; padding: 8px 9px; border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: left; }
.chmenu-opt:hover { background: var(--bg-2); filter: none; }
.chmenu-opt.active { color: var(--ink); font-weight: 800; background: var(--brand-soft); }
.chmenu-opt .chk { margin-left: auto; color: var(--brand); display: inline-flex; }
.chmenu-opt .chk svg { width: 13px; height: 13px; }
.chmenu-div { height: 1px; background: var(--line-2); margin: 4px 0; }
.chmenu-meta { display: flex; align-items: center; gap: 8px; padding: 7px 9px; }
.chmenu-meta .chmeta-icon { display: inline-flex; color: var(--ink-2); flex-shrink: 0; }
.chmenu-meta .chmeta-icon svg { width: 12px; height: 12px; }
.chmenu-meta .chmeta-lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.chmenu-meta .chmeta-val { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.chmenu-link { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-ink); text-decoration: none; }
.chmenu-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.chmenu-link:hover { background: var(--brand-soft); }

/* ============================================================
   Bulk action bar
   ============================================================ */
.bulkbar {
  position: fixed; bottom: 20px; left: 50%; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  width: fit-content; max-width: min(1300px, calc(100% - 24px));
  background: #1c2030; color: #fff;
  border-radius: 14px; padding: 10px 12px 10px 16px;
  box-shadow: 0 20px 50px -14px rgba(20,23,40,.55);
  transform: translateX(-50%);
  animation: bulkIn .25s var(--ease);
}
@keyframes bulkIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bulkbar .bsel { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.bulkbar .bsel .num { background: var(--brand-grad); border-radius: 7px; padding: 3px 9px; font-size: 13px; }
.bulkbar .bspacer { width: 6px; flex: 0 0 auto; }
.bdiv { width: 1px; align-self: stretch; margin: 4px 0; background: rgba(255,255,255,.16); flex: 0 0 auto; }
.bscope { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.bscope-lbl { font-size: 10.5px; line-height: 1.05; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.55); white-space: nowrap; flex: 0 0 auto; }
.bscope-chips { display: flex; align-items: center; gap: 6px; }
.bschip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px 0 4px; flex: 0 0 auto;
  border-radius: 999px; border: 1.4px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05);
  color: #fff; cursor: pointer; transition: background .12s var(--ease), border-color .12s var(--ease), opacity .12s var(--ease);
}
.bschip .chtile.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; flex: 0 0 auto; }
.bschip-name { font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
.bschip-tick { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; flex: 0 0 auto; }
.bschip-tick svg { width: 12px; height: 12px; }
.bschip.on { border-color: rgba(255,255,255,.30); background: rgba(255,255,255,.12); }
.bschip.on .bschip-tick { color: #6fe39a; }
.bschip:not(.on) { opacity: .45; }
.bschip:not(.on) .bschip-name { text-decoration: line-through; }
.bschip:not(.on) .bschip-tick { color: rgba(255,255,255,.6); }
.bschip:hover { opacity: 1; border-color: rgba(255,255,255,.4); }
.bbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; font-weight: 700; font-size: 12.5px; color: #fff;
  background: rgba(255,255,255,.10); transition: background .14s var(--ease), filter .14s var(--ease), box-shadow .14s var(--ease);
  white-space: nowrap; flex: 0 0 auto; min-width: 104px;
}
.bbtn svg { width: 15px; height: 15px; }
.bbtn:hover { background: rgba(255,255,255,.20); filter: none; }
.bbtn.go { background: var(--brand-grad); }
.bbtn.go:hover { filter: brightness(1.08); }
.bbtn.state-published { background: #15803d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.bbtn.state-published:hover { background: #16a34a; }
.bbtn.state-republish { background: #b45309; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.bbtn.state-republish:hover { background: #d97706; }
.bbtn.state-hold { background: #475569; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.bbtn.state-hold:hover { background: #64748b; }
/* .bulkbar prefix beats the legacy index.css button.danger gradient */
.bulkbar .bbtn.danger { background: rgba(255,255,255,.10); border: none; }
.bulkbar .bbtn.danger:hover { background: rgba(216,58,58,.4); }
.bbtn.x { width: 36px; min-width: 36px; padding: 0; background: transparent; justify-content: center; }
.bbtn.x:hover { background: rgba(255,255,255,.12); }
.bbtn[disabled] { opacity: .5; cursor: not-allowed; }

@media (max-width: 1120px) {
  .bulkbar { max-width: calc(100% - 24px); }
  .bschip-name { max-width: 58px; }
  .bbtn { min-width: 96px; padding: 0 11px; }
}

@media (max-width: 900px) {
  .bulkbar { flex-wrap: wrap; justify-content: center; width: calc(100% - 24px); bottom: 12px; padding: 10px; gap: 9px; }
  .bulkbar .bspacer, .bulkbar .bdiv { display: none; }
  .bscope { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; }
  .bscope-chips { flex-wrap: wrap; justify-content: center; }
  .bbtn { height: 34px; padding: 0 11px; min-width: 94px; }
}

/* empty state (direct child of #tableBody only: .thumb.empty must not match) */
#tableBody > .empty { padding: 70px 20px; text-align: center; color: var(--ink-3); }
#tableBody > .empty .e-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-faint); }
#tableBody > .empty .e-ico svg { width: 28px; height: 28px; }
#tableBody > .empty h3 { font-size: 16px; font-weight: 800; color: var(--ink-2); margin-bottom: 5px; }
#tableBody > .empty p { font-size: 13px; max-width: 320px; margin: 0 auto; }

/* ============================================================
   Detail drawer
   ============================================================ */
.drawer-layer { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.drawer-layer.open { pointer-events: auto; }
.drawer-scrim {
  position: absolute; inset: 0; background: rgba(16,18,30,.46);
  backdrop-filter: blur(2px); opacity: 0; transition: opacity .26s var(--ease);
}
.drawer-layer.open .drawer-scrim { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(860px, 96vw); background: var(--bg);
  border-left: 1px solid var(--line); box-shadow: -24px 0 60px -28px rgba(16,18,30,.4);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
}
.drawer-layer.open .drawer { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 18px 24px; background: var(--card); border-bottom: 1px solid var(--line);
}
.drawer-head .dh-main { min-width: 0; flex: 1; }
.drawer-head .dh-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head .dh-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.drawer-head .dh-vin { font-family: var(--mono); font-size: 11.5px; }
.drawer-head .dh-meta .sep { color: var(--ink-faint); }
.drawer-head .dh-meta .sep::before { content: "/"; }
.drawer-x { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; color: var(--ink-3); background: var(--bg-2); transition: all .14s var(--ease); }
.drawer-x:hover { background: var(--red-bg); color: var(--red); filter: none; }
.drawer-x svg { width: 18px; height: 18px; }

.drawer-body { flex: 1; overflow-y: auto; min-height: 0; }
.drawer-body .detail-inner { display: flex; flex-direction: column; gap: 18px; padding: 18px 24px 28px; }
.dcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.dcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; }
.dcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dcard-head h4 { font-size: 11.5px; font-weight: 800; color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; margin: 0; }

.fieldgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
@media (max-width: 640px) { .fieldgrid { grid-template-columns: repeat(2, 1fr); } }

.key-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 14px;
  align-items: end;
}
.key-details-grid .key-field-title,
.key-details-grid .key-field-vin {
  grid-column: 1 / -1;
}
.key-details-grid .key-field input {
  background: #fff;
  border-color: #dfe2ef;
}
.key-details-grid .key-field-title input {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
/* VIN is the vehicle's identity, so give it a distinct mono "badge" look
   with a soft brand tint and an accent rail, rather than a tall empty box.
   Scoped under .drawer to win over the generic .drawer .form-item input color. */
.drawer .key-details-grid .key-field-vin input {
  height: 46px;
  padding-left: 14px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border-color: #d8dbfb;
  box-shadow: inset 3px 0 0 var(--brand);
}
.drawer .key-details-grid .key-field-vin input:focus {
  background: #fff;
}
.drawer .key-details-grid .key-field-price input {
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
}
.description-card {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.description-card .dcard-head {
  margin-bottom: 0;
}
.drawer .description-field textarea {
  min-height: 210px;
  padding: 13px 14px;
  background: #fff;
  border-color: #dfe2ef;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
  resize: vertical;
}
.drawer .description-field textarea:focus {
  background: #fff;
}

/* Adapter: app.js field builders (createInputItem / createDropdownItem /
   createTextAreaItem) emit .form-item / .input-item style markup from the
   legacy UI. Restyle them to the D6 field look inside the drawer. */
.drawer .form-item label, .drawer .field label {
  display: block; font-size: 11px; font-weight: 700; color: var(--ink-3);
  margin-bottom: 5px; letter-spacing: .03em; text-transform: uppercase;
}
.drawer .form-item input, .drawer .form-item select, .drawer .form-item textarea,
.drawer .field input, .drawer .field select, .drawer .field textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--bg); font-weight: 600; font-size: 13px;
  transition: all .14s var(--ease); outline: none; color: var(--ink);
}
.drawer .form-item textarea, .drawer .field textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; min-height: 76px; }
.drawer .form-item input:focus, .drawer .form-item select:focus, .drawer .form-item textarea:focus,
.drawer .field input:focus, .drawer .field select:focus, .drawer .field textarea:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(91,99,240,.12);
}

/* photo grid in detail */
.photogrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pg-cell {
  aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; position: relative; cursor: pointer;
  background: repeating-linear-gradient(135deg, #eceeffe0 0 6px, #e3e6f5 6px 12px);
  border: 1px solid var(--line); display: grid; place-items: center; transition: transform .14s var(--ease);
}
.pg-cell:hover { transform: scale(1.03); }
.pg-cell img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.pg-cell .ph-ico { width: 15px; height: 15px; color: #b8bcd2; }
.pg-cell.more { background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: 13px; }

/* channel manager rows */
.chmgr { display: flex; flex-direction: column; gap: 9px; }
.chrow { display: flex; align-items: center; gap: 10px; }
.chrow .cname { font-weight: 700; font-size: 12.5px; flex: 1; }
.chrow .clogo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 900; font-size: 11px; color: #fff; flex-shrink: 0; }

/* channel pill (filled, combined variant) */
.chpill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 10px; border-radius: 999px;
  font-weight: 700; font-size: 11.5px; white-space: nowrap;
  border: 1.4px solid transparent;
}
.chpill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; box-shadow: none; }
.chpill[data-s="published"] { background: var(--green); color: #fff; }
.chpill[data-s="published"] .dot { background: #fff; }
.chpill[data-s="ready"]     { color: var(--ready); background: transparent; border-color: #6ee7b7; }
.chpill[data-s="hold"]      { color: var(--gray); background: var(--gray-bg); }
.chpill[data-s="republish"] { background: var(--orange); color: #fff; }
.chpill[data-s="republish"] .dot { background: #fff; }
.chpill[data-s="error"]     { color: var(--red); background: var(--red-bg); }
.chpill[data-s="sold"]      { background: var(--purple); color: #fff; }
.chpill[data-s="sold"] .dot { background: #fff; }

.dline { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.dline .dlbl { color: var(--ink-3); font-weight: 700; }
.dline .dval { font-weight: 700; }

.drawer-action-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.drawer-primary-action .btn {
  min-height: 46px;
  font-size: 14px;
  box-shadow: 0 12px 24px -12px rgba(91,99,240,.75);
}
.drawer-quiet-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.btn-quiet {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.btn-quiet svg { width: 15px; height: 15px; }
.btn-quiet.quiet-warn:hover { color: var(--orange); background: var(--orange-bg); }
.btn-quiet.quiet-danger:hover { color: var(--red); background: var(--red-bg); }
.btn-quiet[disabled] { opacity: .5; cursor: not-allowed; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; }
.detail-actions .btn { width: 100%; }
.detail-actions-row { display: flex; gap: 8px; }
.detail-actions-row .btn { flex: 1; }

.drawer-confirm-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(19, 23, 39, .46);
  backdrop-filter: blur(2px);
}
.drawer-confirm {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 18px;
}
.drawer-confirm h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}
.drawer-confirm p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}
.drawer-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.drawer-confirm-actions .btn {
  min-width: 104px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #1c2030; color: #fff; font-weight: 700; font-size: 13px; padding: 11px 18px;
  border-radius: 11px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: toastIn .25s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.toast.toast-success::before { background: var(--green-fill); }
.toast.toast-error::before { background: var(--red); }
.toast.toast-warning::before { background: var(--gold); }

/* ============================================================
   Compat layer
   ============================================================ */
/* marketplace visibility flags (index-page.js applyMarketplaceColumns) */
#inventoryTable.mk-hide-kijiji     [data-ch="kijiji"]     { display: none; }
#inventoryTable.mk-hide-cargurus   [data-ch="cargurus"]   { display: none; }
#inventoryTable.mk-hide-autotrader [data-ch="autotrader"] { display: none; }
#inventoryTable.mk-hide-website    [data-ch="website"]    { display: none; }
/* hide cluster content until per-tenant flags are known (flash prevention) */
#inventoryTable.marketplace-loading .chcluster { visibility: hidden; }

/* skeleton rows injected by showInventorySkeleton() */
.sk-row { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.sk-row span { display: block; height: 12px; border-radius: 4px; }

/* legacy tab panels inside the new canvas */
.tab-panel[hidden] { display: none !important; }
#panel-inventory-controls[hidden] { display: none !important; }

/* footer note inside tablecard */
.tablecard .footer-note { padding: 8px 18px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); }
.tablecard .footer-note:empty { display: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 10px 16px; }
  .sb-brand { padding: 0 8px 0 0; }
  .sb-nav { flex-direction: row; }
  .sb-nav .nav-tab span.label-text { display: none; }
  .sb-foot { display: none; }
  .drawer-confirm-layer { align-items: end; padding: 14px; }
  .drawer-confirm-actions { flex-direction: column-reverse; }
  .drawer-confirm-actions .btn { width: 100%; }
  .key-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-details-grid .key-field-title,
  .key-details-grid .key-field-vin { grid-column: 1 / -1; }
  .drawer .description-field textarea { min-height: 180px; }
}
