/* ═══════════════════════════════════════════════════════════════
   WCW ADMIN — Full dark Studio-style CMS
   Fully responsive, mobile-first drawer, all screens
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg:        #0e0f11;
  --bg-1:      #161719;
  --bg-2:      #1c1d20;
  --bg-3:      #24262a;
  --bg-4:      #2b2d32;
  --hair:      #28292e;
  --hair-2:    #34363c;
  --ink:       #e8e9ec;
  --ink-2:     #a8abb3;
  --ink-3:     #6a6e78;
  --ink-4:     #4a4d55;
  --accent:    #2276fc;
  --accent-2:  #5596fe;
  --accent-soft: rgba(34, 118, 252, 0.14);
  --good:      #46c56b;
  --good-soft: rgba(70, 197, 107, 0.14);
  --warn:      #f0a93f;
  --warn-soft: rgba(240, 169, 63, 0.14);
  --bad:       #ef5555;
  --bad-soft:  rgba(239, 85, 85, 0.14);
  --draft:     #b372ff;
  --draft-soft: rgba(179, 114, 255, 0.14);
  --f:         'Inter', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, monospace;
  --topbar-h:  52px;
  --sidebar-w: 240px;
  --doclist-w: 340px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hair-2); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #44474e; background-clip: padding-box; border: 2px solid transparent; }

/* ── LOGIN ───────────────────────────────────────── */
.login {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(34, 118, 252, 0.12), transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(192, 82, 33, 0.10), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(179, 114, 255, 0.05), transparent 70%);
  padding: 20px;
  overflow-y: auto;
}
.login::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 70%);
}
.login.hidden { display: none; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--bg-1); border: 1px solid var(--hair);
  border-radius: 12px; padding: 36px 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.login-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #c05221, #8a3412);
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 14px;
}
.login-brand-t {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
}
.login-brand-sub {
  font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em;
  margin-top: 2px;
}
.login-h {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 24px;
  text-align: center;
}
.login-sub {
  font-size: 13px; color: var(--ink-2); margin: 0 0 24px;
}
.login-field { margin-bottom: 14px; }
.login-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--ink-2); margin-bottom: 6px;
}
.login-input {
  width: 100%; padding: 11px 12px;
  box-sizing: border-box;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--hair-2); border-radius: 6px;
  font: 400 14px var(--f);
  outline: none; transition: border-color .12s;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-btn {
  width: 100%; padding: 12px;
  margin-top: 8px;
  background: var(--accent); color: white;
  border: none; border-radius: 6px;
  font: 600 14px var(--f); cursor: pointer;
  margin-top: 10px;
  transition: background .12s;
}
.login-btn:hover { background: var(--accent-2); }
.login-foot {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hair);
  font-size: 11px; color: var(--ink-3); text-align: center;
}
.login-hint {
  margin-top: 14px; padding: 10px 12px;
  background: var(--bg); border: 1px dashed var(--hair-2); border-radius: 6px;
  font-size: 11px; color: var(--ink-3); line-height: 1.5;
}
.login-hint b { color: var(--ink-2); }

/* ── TOP BAR ─────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 14px; gap: 12px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--hair);
}
.tb-hamburger {
  display: none;
  width: 34px; height: 34px; border: 1px solid var(--hair-2);
  background: var(--bg-2); border-radius: 5px;
  color: var(--ink-2);
  align-items: center; justify-content: center; cursor: pointer;
  flex: none;
}
.tb-hamburger svg { display: block; }
.tb-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 13px;
  flex: none;
}
.bold-w { font-weight: 800; }
.tb-logomark {
  width: 26px; height: 26px; border-radius: 5px;
  background: var(--ink-1, #111);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; letter-spacing: -0.02em;
  flex: none;
}
.tb-logo-t {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.tb-logo-t b { font-size: 13px; letter-spacing: -0.005em; font-weight: 600; }
.tb-logo-t span { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; }
.tb-divider { width: 1px; height: 22px; background: var(--hair); flex: none; }
.tb-section-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 8px; border-radius: 5px;
  background: var(--bg-2); border: 1px solid var(--hair);
  font-size: 12px; font-weight: 500;
  min-width: 0;
}
.tb-section-badge svg { flex: none; opacity: .7; }
.tb-section-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-r { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.tb-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--hair);
  padding: 6px 10px; border-radius: 5px; min-width: 240px;
  color: var(--ink-3); font-size: 12px;
  cursor: pointer;
}
.tb-search:hover { border-color: var(--hair-2); color: var(--ink-2); }
.tb-search kbd {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-3); border: 1px solid var(--hair-2);
  color: var(--ink-3); margin-left: auto;
}
.tb-view {
  background: none; border: 1px solid var(--hair); color: var(--ink-2);
  padding: 6px 11px; font-size: 12px; border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.tb-view:hover { color: var(--ink); border-color: var(--hair-2); }
.tb-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #e9815a, #c05221);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: white;
  cursor: pointer; border: 2px solid var(--bg-1);
}

/* ── SHELL ───────────────────────────────────────── */
.shell {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--doclist-w) 1fr;
  min-width: 0;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  background: var(--bg-1); border-right: 1px solid var(--hair);
  overflow-y: auto; padding: 10px 0 20px;
  min-height: 0;
}
.sidebar-h {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-3); font-weight: 600;
  padding: 14px 18px 6px;
}
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 18px; cursor: pointer;
  font-size: 13px; color: var(--ink-2);
  position: relative; transition: color .1s;
}
.side-item:hover { background: var(--bg-2); color: var(--ink); }
.side-item.on { background: var(--bg-2); color: var(--ink); font-weight: 500; }
.side-item.on::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.side-item svg { flex: none; opacity: .75; }
.side-item.on svg { opacity: 1; color: var(--accent); }
.side-count {
  margin-left: auto; font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.sidebar-foot {
  margin-top: auto; padding: 16px 18px 10px;
  border-top: 1px solid var(--hair);
  font-size: 11px; color: var(--ink-3);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-foot a { color: var(--ink-2); }
.sidebar-foot a:hover { color: var(--ink); }

/* ── DOCLIST ─────────────────────────────────────── */
.doclist {
  background: var(--bg);
  border-right: 1px solid var(--hair);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0; min-width: 0;
}
.doclist-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--hair);
  min-height: 52px; flex: none;
}
.doclist-title {
  font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.doclist-count {
  font-size: 11px; color: var(--ink-3);
  background: var(--bg-2); padding: 2px 7px; border-radius: 10px;
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.doclist-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.ic-btn {
  width: 30px; height: 30px; border: none; background: transparent;
  color: var(--ink-2); border-radius: 5px; cursor: pointer;
  display: grid; place-items: center;
}
.ic-btn:hover { background: var(--bg-2); color: var(--ink); }
.btn-new {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border-radius: 5px;
  background: var(--accent); color: white;
  font-size: 12px; font-weight: 500; border: none; cursor: pointer;
  transition: background .12s;
}
.btn-new:hover { background: var(--accent-2); }
.doclist-filters {
  display: flex; gap: 5px; padding: 10px 12px;
  border-bottom: 1px solid var(--hair);
  overflow-x: auto; flex: none;
  scrollbar-width: none;
}
.doclist-filters::-webkit-scrollbar { display: none; }
.chip {
  padding: 4px 10px; border-radius: 12px;
  background: transparent; border: 1px solid var(--hair-2);
  color: var(--ink-2); font-size: 11px; cursor: pointer;
  white-space: nowrap; font-weight: 500;
  transition: all .1s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-4); }
.chip.on { background: var(--bg-3); color: var(--ink); border-color: var(--hair-2); }
.chip-count { opacity: .6; margin-left: 3px; font-weight: 400; }

.docs { flex: 1; overflow-y: auto; }
.doc {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--hair);
  align-items: center;
  position: relative;
  transition: background .08s;
}
.doc:hover { background: var(--bg-1); }
.doc.on { background: var(--bg-2); }
.doc.on::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
}
.doc-thumb {
  width: 52px; height: 52px; border-radius: 5px; overflow: hidden;
  background: linear-gradient(135deg, #2a2e38, #171920);
  position: relative; flex: none;
}
.doc-thumb::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.07), transparent 40%),
    linear-gradient(45deg, transparent 47%, rgba(255,255,255,.05) 50%, transparent 53%);
}
.doc-thumb .init {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: serif; font-size: 18px; font-weight: 300; font-style: italic;
  color: rgba(255,255,255,.55); letter-spacing: .04em;
}
.doc-body { min-width: 0; }
.doc-title {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-sub {
  font-size: 11px; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-meta-r {
  font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex: none;
}
.doc-price { color: var(--ink); font-weight: 500; font-size: 12px; }
.status-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 500;
}
.status-dot i {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.status-dot.available i { background: var(--good); }
.status-dot.pending   i { background: var(--warn); }
.status-dot.reserved  i { background: var(--draft); }
.status-dot.sold      i { background: var(--ink-3); }
.draft-mark {
  position: absolute; left: 6px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--draft); box-shadow: 0 0 0 2px var(--bg);
  z-index: 2;
}

/* ── MAIN PANE ────────────────────────────────── */
.main {
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
  height: 100%;
}
.main-hd {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
  padding: 10px 22px;
  display: flex; align-items: center; gap: 14px;
  min-height: 52px;
  flex-wrap: wrap;
}
.crumb {
  font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
  min-width: 0; flex: 1 1 auto;
}
.crumb em { font-style: normal; color: var(--ink); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb .sep { opacity: .4; flex: none; }

.review-mark {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 4px;
  background: var(--draft-soft); color: var(--draft);
  font-size: 11px; font-weight: 500;
}
.review-mark i { width: 6px; height: 6px; border-radius: 50%; background: var(--draft); }

.hd-btns { display: flex; gap: 6px; flex: none; }
.btn {
  padding: 7px 13px; border-radius: 5px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--hair-2); background: var(--bg-2); color: var(--ink);
  cursor: pointer; transition: all .12s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-bad { color: var(--bad); border-color: var(--hair-2); }
.btn-bad:hover { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* Main body grid with optional inspector */
.main-body {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1; min-height: 0; overflow: hidden;
  height: 100%;
}
.main-body.with-insp { grid-template-columns: 1fr 300px; }
.main-scroll {
  padding: 26px 28px 100px;
  max-width: 820px; width: 100%; margin: 0 auto;
  overflow-y: auto;
  height: 100%;
}
.main-scroll--wide { max-width: 100%; margin: 0; }

/* ── FIELDS ──────────────────────────────────── */
.field { margin-bottom: 22px; }
.field-hd {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 7px;
}
.field-label {
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.field-req { color: var(--bad); font-weight: 500; }
.field-hint {
  font-size: 11px; color: var(--ink-3);
  margin-left: auto;
}
.field-help {
  font-size: 11px; color: var(--ink-3);
  margin-top: 6px; line-height: 1.5;
}
.field-help svg { opacity: .7; vertical-align: -1px; margin-right: 3px; }
.field-help.good { color: var(--good); }

.inp, .sel, .txt {
  width: 100%; padding: 9px 12px;
  background: var(--bg-1); color: var(--ink);
  border: 1px solid var(--hair-2); border-radius: 6px;
  font: 400 13px var(--f);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.inp:focus, .sel:focus, .txt:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.txt { min-height: 88px; resize: vertical; line-height: 1.5; font-family: var(--f); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.sel-wrap { position: relative; }
.sel { appearance: none; padding-right: 32px; cursor: pointer; }
.sel-wrap::after {
  content: ''; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.num-wrap { position: relative; }
.num-wrap .unit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--ink-3); pointer-events: none;
  font-weight: 500;
}
.num-wrap .inp { padding-right: 38px; font-variant-numeric: tabular-nums; }

/* Segmented */
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--bg-1); border: 1px solid var(--hair-2); border-radius: 7px;
  flex-wrap: wrap;
}
.seg button {
  padding: 6px 12px; border: none; background: transparent;
  color: var(--ink-2); font: 500 12px var(--f);
  border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--bg-3); color: var(--ink); }
.seg button i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
}
.seg button.on.av i { background: var(--good); }
.seg button.on.pn i { background: var(--warn); }
.seg button.on.rs i { background: var(--draft); }
.seg button.on.sd i { background: var(--ink-3); }

/* Photos */
.photos {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.photo {
  position: relative; aspect-ratio: 4/3; border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, #2a2e38, #161820);
  cursor: grab; border: 1px solid var(--hair);
}
.photo::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), transparent 50%),
    linear-gradient(45deg, transparent 45%, rgba(255,255,255,.05) 50%, transparent 55%);
}
.photo .pi {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: serif; font-size: 20px; font-weight: 300; font-style: italic;
  color: rgba(255,255,255,.5); pointer-events: none;
}
.photo .badge {
  position: absolute; left: 7px; top: 7px;
  background: rgba(0,0,0,.75); color: white;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 3px 7px; border-radius: 3px; letter-spacing: .06em;
  z-index: 2;
}
.photo .phactions {
  position: absolute; right: 6px; bottom: 6px;
  display: flex; gap: 4px; z-index: 2;
  opacity: 0; transition: opacity .15s;
}
.photo:hover .phactions { opacity: 1; }
@media (pointer: coarse) { .photo .phactions { opacity: 1; } } /* always visible on touch */
.photo .hbtn {
  width: 24px; height: 24px; border-radius: 4px;
  background: rgba(0,0,0,.75); color: white;
  display: grid; place-items: center; cursor: pointer;
  border: none;
}
.photo-add {
  aspect-ratio: 4/3; border-radius: 6px;
  border: 1.5px dashed var(--hair-2);
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer;
  font-size: 12px; transition: all .15s;
  background: var(--bg);
}
.photo-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Tag chips */
.tagbox {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  background: var(--bg-1); border: 1px solid var(--hair-2); border-radius: 6px;
  min-height: 42px;
}
.tagbox:focus-within { border-color: var(--accent); }
.tag {
  display: inline-flex; gap: 5px; align-items: center;
  padding: 4px 4px 4px 10px;
  background: var(--bg-3); border-radius: 4px;
  font-size: 12px;
}
.tag button {
  border: none; background: transparent; color: var(--ink-3);
  cursor: pointer; font-size: 14px; padding: 0 5px; line-height: 1;
}
.tag button:hover { color: var(--bad); }
.tagbox input {
  flex: 1; min-width: 120px;
  border: none; background: transparent; outline: none;
  color: var(--ink); font: 400 12px var(--f); padding: 4px;
}

/* Toggle */
.toggle-row {
  display: flex; gap: 12px; align-items: center; cursor: pointer;
  padding: 8px 10px; border-radius: 6px;
  transition: background .1s;
}
.toggle-row:hover { background: var(--bg-1); }
.toggle {
  width: 34px; height: 20px; border-radius: 10px;
  background: var(--hair-2); position: relative; flex: none;
  transition: background .15s;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-3); transition: all .15s;
}
.toggle.on { background: var(--good); }
.toggle.on::after { left: 16px; background: white; }
.toggle-label {
  flex: 1; font-size: 13px;
}
.toggle-sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; font-weight: 400; }

/* ── INSPECTOR ─────────────────────────────────── */
.inspector {
  border-left: 1px solid var(--hair);
  background: var(--bg);
  padding: 22px 20px;
  overflow-y: auto;
  min-height: 0;
}
.insp-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); font-weight: 600;
  margin: 0 0 10px;
}
.insp-h:not(:first-child) { margin-top: 26px; }
.insp-row {
  display: flex; justify-content: space-between; padding: 7px 0; gap: 10px;
  border-bottom: 1px solid var(--hair);
  font-size: 12px;
}
.insp-row:last-child { border-bottom: none; }
.insp-row span:first-child { color: var(--ink-3); flex: none; }
.insp-row span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }

.activity { list-style: none; padding: 0; margin: 0; }
.activity li {
  display: grid; grid-template-columns: 20px 1fr; gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 12px;
}
.activity li:last-child { border: none; }
.act-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-top: 5px;
}
.act-dot.publish { background: var(--good); }
.act-dot.edit { background: var(--accent); }
.act-dot.create { background: var(--draft); }
.act-dot.delete { background: var(--bad); }
.act-body { color: var(--ink-2); line-height: 1.45; }
.act-body em { font-style: normal; color: var(--ink); font-weight: 500; }
.act-body b { display: block; font-size: 10px; color: var(--ink-3); font-weight: 400; text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }

.insp-avs { display: flex; gap: 6px; margin-top: 6px; }
.insp-av {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: white;
  border: 2px solid var(--bg);
  margin-left: -4px;
}
.insp-av:first-child { margin-left: 0; }
.insp-av.r { background: linear-gradient(135deg, #e9815a, #c05221); }
.insp-av.a { background: linear-gradient(135deg, #5596fe, #2276fc); }
.insp-presence {
  margin-top: 10px; font-size: 11px; color: var(--good);
  display: flex; align-items: center; gap: 6px;
}
.insp-presence::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
  animation: livepulse 2s ease-in-out infinite;
}
@keyframes livepulse {
  50% { box-shadow: 0 0 0 6px rgba(70,197,107,0); }
}

/* ── TOAST ─────────────────────────────────────── */
.toast-host {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.toast-host.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast {
  background: #2b2e34; border: 1px solid var(--hair-2);
  padding: 11px 16px; border-radius: 7px;
  font-size: 13px; color: var(--ink);
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.toast.bad i { background: var(--bad); }

/* ── DASHBOARD ─────────────────────────────────── */
.dash-h {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px;
}
.dash-sub {
  font-size: 13px; color: var(--ink-2); margin: 0 0 26px;
}
.stat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 30px;
}
.stat {
  background: var(--bg-1); border: 1px solid var(--hair);
  border-radius: 8px; padding: 16px 18px;
}
.stat-l {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); font-weight: 600; margin-bottom: 6px;
}
.stat-v {
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-d {
  font-size: 11px; color: var(--ink-3); margin-top: 4px;
}
.stat-d .up { color: var(--good); }
.stat-d .dn { color: var(--bad); }

.dash-section-h {
  font-size: 14px; font-weight: 600; margin: 28px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.dash-section-h .count {
  font-size: 11px; color: var(--ink-3);
  background: var(--bg-2); padding: 2px 7px; border-radius: 10px; font-weight: 500;
}
.dash-section-h a {
  margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 500;
}

.log-list {
  background: var(--bg-1); border: 1px solid var(--hair); border-radius: 8px;
  overflow: hidden;
}
.log-row {
  display: grid; grid-template-columns: 80px 80px 1fr 100px;
  gap: 14px; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hair); font-size: 12px;
}
.log-row:last-child { border: none; }
.log-t { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log-a {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  padding: 2px 7px; border-radius: 3px; justify-self: start;
  background: var(--accent-soft); color: var(--accent);
}
.log-a.publish { background: var(--good-soft); color: var(--good); }
.log-a.create  { background: var(--draft-soft); color: var(--draft); }
.log-a.delete  { background: var(--bad-soft); color: var(--bad); }
.log-body { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-body em { color: var(--ink-2); font-style: normal; }
.log-u { color: var(--ink-3); text-align: right; }

/* ── HOURS EDITOR ──────────────────────────────── */
.hours-grid {
  display: grid;
  grid-template-columns: 100px 1fr 1fr auto;
  gap: 8px 14px; align-items: center;
}
.hours-grid .hday { font-size: 13px; color: var(--ink); font-weight: 500; }
.hours-grid .htime {
  padding: 7px 10px; background: var(--bg-1); border: 1px solid var(--hair-2);
  border-radius: 5px; color: var(--ink); font-size: 12px;
  font-variant-numeric: tabular-nums; outline: none;
}
.hours-grid .hclose {
  font-size: 11px; color: var(--ink-3);
  display: flex; gap: 6px; align-items: center; cursor: pointer;
  white-space: nowrap;
}

/* ── TEAM GRID ─────────────────────────────────── */
.team-list { display: grid; gap: 14px; }
.team-card {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 16px; align-items: center;
  padding: 16px; background: var(--bg-1); border: 1px solid var(--hair); border-radius: 8px;
}
.team-av {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: white;
}
.team-av.r { background: linear-gradient(135deg, #e9815a, #c05221); }
.team-av.a { background: linear-gradient(135deg, #5596fe, #2276fc); }
.team-body { min-width: 0; }
.team-name { font-size: 16px; font-weight: 600; }
.team-role { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ── SOLD EDITOR ───────────────────────────────── */
.sold-list { display: grid; gap: 10px; }
.sold-row {
  display: grid;
  grid-template-columns: 16px 80px 1fr auto;
  gap: 14px; align-items: center;
  padding: 10px 12px 10px 8px;
  background: var(--bg-1); border: 1px solid var(--hair); border-radius: 6px;
  cursor: default;
  transition: background .15s, border-color .15s;
}
.sold-row.dragging { opacity: .4; }
.sold-row.row-drag-over { border-color: var(--accent); background: var(--accent-soft); }
.sold-handle {
  color: var(--ink-3); cursor: grab;
  display: flex; align-items: center; justify-content: center;
}
.sold-handle:active { cursor: grabbing; }
.sold-photo {
  width: 80px; height: 60px; border-radius: 4px;
  border: 1px dashed var(--hair-2); background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer; position: relative;
  transition: border-color .15s, background .15s, color .15s;
}
.sold-photo:hover { border-color: var(--accent); color: var(--accent); background: var(--bg); }
.sold-photo.drag-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sold-photo.has-photo {
  border-style: solid; cursor: default;
  align-items: flex-end; justify-content: flex-end; padding: 4px;
}
.sold-photo.has-photo:hover { border-color: var(--hair-2); color: var(--ink-3); background: var(--bg-2); }
.sold-photo-init {
  font-family: serif; font-size: 12px; color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.35); padding: 1px 5px; border-radius: 2px; font-style: italic;
}
.sold-photo-x {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 3px;
  background: rgba(0,0,0,.6); color: white; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  padding: 0;
}
.sold-photo-x:hover { background: var(--bad); }
.sold-name-wrap { min-width: 0; display: flex; align-items: center; gap: 10px; }
.sold-name-inp { flex: 1; font-size: 14px; }
.sold-idx { font-family: var(--mono); font-size: 11px; color: var(--ink-3); flex: none; }
.sold-actions { flex: none; }

@media (max-width: 680px) {
  .sold-row { grid-template-columns: 16px 64px 1fr; gap: 10px; }
  .sold-photo { width: 64px; height: 48px; }
  .sold-actions { grid-column: 1 / -1; justify-self: end; }
  .sold-idx { display: none; }
}
.team-phone { font-size: 12px; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.team-actions { display: flex; gap: 6px; }

/* ── MOBILE ───────────────────────────────────── */
.scrim {
  display: none;
  position: fixed; inset: 0; z-index: 25;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}
.scrim.on { display: block; }

@media (max-width: 1200px) {
  .main-body.with-insp { grid-template-columns: 1fr; }
  .inspector { border-left: none; border-top: 1px solid var(--hair); }
  .tb-search { min-width: 180px; }
}
@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: 260px; z-index: 26;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.22,1,.36,1);
  }
  .sidebar.open { transform: translateX(0); }
  .shell { grid-template-columns: var(--doclist-w) 1fr; }
  .tb-hamburger { display: flex; }
  .tb-search { display: none; }
}
@media (max-width: 760px) {
  :root { --doclist-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .doclist {
    position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
    z-index: 22; transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.22,1,.36,1);
  }
  .doclist.open { transform: translateX(0); }
  .main-hd { padding: 10px 14px; }
  .main-scroll { padding: 22px 16px 120px; }
  .tb-section-badge { display: none; }
  .tb-view { display: none; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .hours-grid { grid-template-columns: 80px 1fr 1fr; }
  .hours-grid .hclose { grid-column: 1 / -1; justify-self: start; margin-top: -4px; }
  .log-row { grid-template-columns: 70px 1fr; }
  .log-row .log-a, .log-row .log-u { display: none; }
  .team-card { grid-template-columns: 50px 1fr; }
  .team-av { width: 50px; height: 50px; font-size: 18px; }
  .team-actions { grid-column: 1 / -1; }
  /* Doc list cards - bigger touch targets */
  .doc { padding: 12px 14px; min-height: 70px; }
  .doc-title { font-size: 13px; }
  /* Stat grid on mobile */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  /* Inspector below editor on mobile */
  .main-body.with-insp { grid-template-columns: 1fr; }
  .inspector { border-left: none; border-top: 1px solid var(--hair); }
}
@media (max-width: 480px) {
  .tb-logo-t span { display: none; }
  .main-hd { gap: 6px; flex-wrap: wrap; }
  .main-hd .crumb { font-size: 12px; }
  /* Hide ghost buttons on tiny screens, keep Save & Delete */
  .hd-btns .btn-ghost { display: none; }
  .hd-btns .btn-bad { padding: 7px 10px; font-size: 11px; }
  .hd-btns .btn-primary { padding: 7px 12px; font-size: 11px; }
  .stat-v { font-size: 22px; }
  /* Photos grid on small screens */
  .photos { grid-template-columns: repeat(2, 1fr); }
  /* AI tools wrap */
  .ai-btn { padding: 6px 10px; font-size: 11px; }
  .ai-btn span { font-size: 11px; }
  /* Inspector on mobile */
  .inspector { padding: 14px; }
  .insp-row { font-size: 11px; }
  /* Seg control wraps */
  .seg { flex-wrap: wrap; gap: 4px; }
  .seg button { flex: 1 1 auto; min-width: 70px; justify-content: center; font-size: 11px; }
  /* Stats */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  /* Field groups */
  .field { padding: 14px 12px; }
  .field-group { padding: 14px 12px; }
  /* Sold rows */
  .sold-actions { display: flex; gap: 6px; }
  .sold-actions .btn { padding: 5px 8px; font-size: 11px; }
}

/* Topbar list button - only on mobile vehicles section */
@media (max-width: 760px) {
  #tb-list-btn { display: flex !important; }
  /* Vehicle editor scroll padding for bottom buttons */
  .main-scroll { padding-bottom: 120px; }
  /* Doclist full width on mobile */
  .doclist { width: 100%; }
  /* AI tools section wraps */
  div[style*="display:flex;gap:8px"] { flex-wrap: wrap; }
}
@media (min-width: 761px) {
  #tb-list-btn { display: none !important; }
}

/* ── BACKLINK ──────────────────────────────────── */
.backlink {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  padding: 8px 12px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--hair-2);
  color: var(--ink-2); font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .12s;
}
.backlink:hover { color: var(--ink); border-color: var(--accent); background: var(--bg-3); }
@media (max-width: 600px) { .backlink { display: none; } }

/* Utility */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--ink-3); font-size: 13px;
}
.hidden { display: none !important; }

/* ── AI ───────────────────────────────────────── */
.ai-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: linear-gradient(135deg, rgba(179,114,255,0.15), rgba(85,150,254,0.15));
  border: 1px solid rgba(179,114,255,0.35);
  color: #cfb1ff;
  border-radius: 5px;
  font: 500 11px var(--f);
  cursor: pointer;
  transition: all .15s;
}
.ai-btn:hover {
  background: linear-gradient(135deg, rgba(179,114,255,0.25), rgba(85,150,254,0.25));
  border-color: rgba(179,114,255,0.6);
  color: #e0c9ff;
}
.ai-btn:disabled { opacity: .55; cursor: wait; }
.ai-btn .sparkle {
  display: inline-block;
  width: 11px; height: 11px;
}
.ai-btn.lg { padding: 7px 14px; font-size: 12px; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: 3px;
  background: rgba(179,114,255,0.14);
  color: #cfb1ff;
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.ai-thinking {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: #cfb1ff;
  padding: 5px 10px;
  background: rgba(179,114,255,0.08);
  border-radius: 5px;
  margin-left: 8px;
}
.ai-thinking::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #cfb1ff;
  animation: ai-pulse 1s ease-in-out infinite;
}
@keyframes ai-pulse { 50% { opacity: .3; transform: scale(.7); } }
.ai-hint {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(179,114,255,0.05);
  border-left: 2px solid rgba(179,114,255,0.4);
  border-radius: 4px;
  font-size: 11px; color: var(--ink-2); line-height: 1.5;
}
.ai-hint b { color: #cfb1ff; font-weight: 600; }

/* Modal for autofill */
.modal-back {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-back.on { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 460px;
  background: var(--bg-1); border: 1px solid var(--hair-2);
  border-radius: 10px; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal-h { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.modal-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 18px; }
.modal-steps { list-style: none; padding: 0; margin: 0 0 22px; }
.modal-steps li {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center;
  padding: 8px 0;
  font-size: 13px; color: var(--ink-3);
  transition: color .2s;
}
.modal-steps li.active { color: var(--ink); }
.modal-steps li.done { color: var(--good); }
.modal-steps i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--hair-2);
  display: grid; place-items: center;
}
.modal-steps li.active i {
  border-color: #cfb1ff;
  animation: ai-pulse 1s ease-in-out infinite;
}
.modal-steps li.done i {
  border-color: var(--good); background: var(--good);
}
.modal-steps li.done i::after {
  content: ''; width: 4px; height: 7px;
  border-right: 1.5px solid white; border-bottom: 1.5px solid white;
  transform: rotate(45deg) translate(-1px,-1px);
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ═══ INQUIRIES INBOX ═══════════════════════════════════════ */
.inq-wrap {
  display: grid; grid-template-columns: 340px 1fr;
  height: 100%; gap: 0;
  border-top: 1px solid var(--hair);
}
.inq-list {
  border-right: 1px solid var(--hair);
  overflow-y: auto;
  background: var(--bg-2);
}
.inq-list-head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--hair);
  position: sticky; top: 0; background: var(--bg-2); z-index: 2;
}
.inq-count {
  display: block; margin-top: 4px;
  font-size: 11px; color: var(--ink-3);
  letter-spacing: .04em; text-transform: uppercase;
}
.inq-empty {
  padding: 40px 24px; color: var(--ink-3); font-size: 13px;
  text-align: center; font-style: italic;
}
.inq-row {
  position: relative;
  padding: 14px 20px; border-bottom: 1px solid var(--hair);
  cursor: pointer; transition: background .12s;
}
.inq-row:hover { background: var(--bg); }
.inq-row.is-sel { background: var(--bg); box-shadow: inset 3px 0 0 var(--ink); }
.inq-row.is-new .inq-row-name { font-weight: 700; }
.inq-row-top {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.inq-row-name { font-size: 14px; color: var(--ink); }
.inq-row-t { font-size: 11px; color: var(--ink-4); flex: none; }
.inq-row-mid { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.inq-row-topic {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 8px; border: 1px solid var(--hair);
  color: var(--ink-3); font-weight: 500;
}
.inq-topic-wholesale { color: #8a4617; border-color: #e6c7a8; background: #fbf3e8; }
.inq-topic-financing { color: #1e5a8a; border-color: #b8d4ea; background: #eff6fb; }
.inq-topic-general   { color: var(--ink-3); }
.inq-row-veh { font-size: 12px; color: var(--ink-2); font-style: italic; }
.inq-row-preview {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.inq-dot {
  position: absolute; top: 18px; right: 14px;
  width: 7px; height: 7px; border-radius: 50%; background: #c05221;
}

.inq-detail {
  overflow-y: auto; padding: 28px 32px;
}
.inq-detail-head {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: start; padding-bottom: 20px;
  border-bottom: 1px solid var(--hair); margin-bottom: 20px;
}
.inq-detail-name { font-size: 22px; font-weight: 600; color: var(--ink); }
.inq-detail-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: .02em; }
.inq-detail-acts { display: flex; gap: 8px; flex-wrap: wrap; }

.inq-contact {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px; margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 4px;
}
.inq-kv { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.inq-kv-k {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); flex: none; min-width: 55px;
}
.inq-kv-v { color: var(--ink); font-weight: 500; flex: 1; word-break: break-word; }
.inq-kv-copy {
  background: none; border: none; color: var(--ink-4);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; padding: 2px 6px;
}
.inq-kv-copy:hover { color: var(--ink-2); text-decoration: underline; }

.inq-msg-label {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 8px;
}
.inq-msg-body {
  font-size: 14px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; padding: 14px 16px;
  background: var(--bg-2); border-left: 3px solid var(--ink);
  border-radius: 0 4px 4px 0;
}
.inq-reply {
  padding: 12px 14px; margin-bottom: 8px;
  background: #fbf7f0; border: 1px solid #e6ddc9;
  border-radius: 4px;
}
.inq-reply-meta {
  font-size: 10px; color: var(--ink-4);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px;
}
.inq-reply-body { font-size: 13px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }
.inq-reply-area {
  width: 100%; min-height: 90px;
  font-family: inherit; font-size: 14px; line-height: 1.5;
  resize: vertical;
}
.inq-foot-acts {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
@media (max-width: 900px) {
  .inq-wrap { grid-template-columns: 1fr; }
  .inq-list { max-height: 40vh; border-right: none; border-bottom: 1px solid var(--hair); }
}
