/* ---------- Dashboard ---------- */

.attention-card .card-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.attention-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--bg-card-alt);
  text-align: left;
}

.attention-chip:hover { border-color: var(--border); background: var(--bg-hover); }

.attention-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.attention-icon svg { width: 17px; height: 17px; }

.attention-chip-text { display: flex; flex-direction: column; }
.attention-chip-text .num { font-family: var(--font-heading); font-weight: 800; font-size: 14.5px; }
.attention-chip-text .label { font-size: 11.5px; color: var(--text-secondary); }
.attention-chip .chevron { margin-left: auto; color: var(--text-muted); width: 15px; height: 15px; }

.dash-grid,
.dash-grid-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
  align-items: start;
}

/* Large desktop — wider primary column (≈62/38) */
@media (min-width: 1500px) {
  .dash-grid,
  .dash-grid-bottom {
    grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1fr);
  }
}

.schedule-date { color: var(--text-muted); font-weight: 500; font-size: 12.5px; }

.parts-check { color: var(--tone-green); width: 17px; height: 17px; }
.parts-dash { color: var(--text-muted); }

.followup-list { display: flex; flex-direction: column; }

.followup-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}
.followup-row:first-child { border-top: none; }

.followup-mid { flex: 1; min-width: 0; }
.followup-mid .interest { font-weight: 700; font-size: 13px; }
.followup-mid .budget { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.followup-name .cell-primary { font-size: 13px; }
.followup-name .cell-muted { font-size: 11.5px; }

.followup-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.followup-action .cap { font-size: 10.5px; color: var(--text-muted); }

.week-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.week-tile {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--border);
}

.week-tile.tone-blue { background: var(--tone-blue-bg); }
.week-tile.tone-amber { background: var(--tone-amber-bg); }
.week-tile.tone-purple { background: var(--tone-purple-bg); }
.week-tile.tone-teal { background: var(--tone-teal-bg); }

.week-tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.week-tile-head svg { width: 15px; height: 15px; }
.week-tile .value { font-family: var(--font-heading); font-weight: 800; font-size: 22px; }
.week-tile .delta { font-size: 11px; color: var(--tone-green); margin-top: 4px; font-weight: 600; }

.activity-list { display: flex; flex-direction: column; }

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}
.activity-row:first-child { border-top: none; }

.activity-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.activity-icon svg { width: 14px; height: 14px; }
.activity-row p { margin: 0; font-size: 13px; flex: 1; }
.activity-row time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

@media (max-width: 1180px) {
  .dash-grid, .dash-grid-bottom { grid-template-columns: minmax(0, 1fr); }
  .attention-card .card-body { grid-template-columns: repeat(2, 1fr); }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .attention-card .card-body { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
}

/* ---------- Customer profile ---------- */

.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.profile-card { text-align: center; padding: var(--space-6) var(--space-5); }
.profile-card .avatar-lg { margin: 0 auto var(--space-3); }
.profile-card h2 { font-size: 17px; margin-bottom: 2px; }
.profile-card .sub { color: var(--text-secondary); font-size: 12.5px; margin-bottom: var(--space-4); }

.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-5); }
.profile-stat { padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-card-alt); border: 1px solid var(--border); }
.profile-stat .value { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.profile-stat .label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.vehicle-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius-md); background: var(--bg-card-alt); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; margin-bottom: 6px;
}
.vehicle-chip svg { width: 15px; height: 15px; color: var(--accent); }

.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.photo-slot {
  aspect-ratio: 1; border-radius: var(--radius-md); border: 1.5px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  background: var(--bg-card-alt);
}
.photo-slot svg { width: 18px; height: 18px; }

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

/* ============================================================= */
/* PRODUCTS — redesigned catalog experience                       */
/* ============================================================= */

/* ---------- Secondary nav (scoped to Products) ---------- */

.subnav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
  overflow-x: auto;
}
.subnav-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px var(--space-3); margin-bottom: -1px;
  font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  color: var(--text-muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.subnav-btn:hover { color: var(--text-primary); }
.subnav-btn.is-active { color: var(--accent-strong); border-bottom-color: var(--accent); }
:root[data-theme="dark"] .subnav-btn.is-active { color: var(--accent-soft-text); }
.subnav-badge {
  background: var(--tone-amber-bg); color: var(--tone-amber);
  font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-pill);
}

.ptab-panel { display: none; }
.ptab-panel.is-active { display: block; }

.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.panel-hint { margin: 0; color: var(--text-secondary); font-size: 13px; }

/* ---------- Saved views ---------- */

.saved-views { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.view-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--bg-card);
  font-family: var(--font-heading); font-weight: 700; font-size: 12.5px; color: var(--text-secondary);
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.view-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.view-pill .vp-count {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  background: var(--tone-gray-bg); padding: 1px 7px; border-radius: var(--radius-pill);
}
.view-pill.is-active { background: var(--accent-soft-bg); border-color: transparent; color: var(--accent-strong); }
:root[data-theme="dark"] .view-pill.is-active { color: var(--accent-soft-text); }
.view-pill.is-active .vp-count { background: rgba(168,101,47,.16); color: var(--accent-strong); }
:root[data-theme="dark"] .view-pill.is-active .vp-count { color: var(--accent-soft-text); }

/* ---------- Catalog toolbar ---------- */

.catalog-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); flex-wrap: wrap;
}
.tb-search { position: relative; flex: 1; min-width: 240px; max-width: 380px; }
.tb-search input { width: 100%; padding: 9px 12px 9px 34px; border-radius: var(--radius-md); font-size: 13px; }
.tb-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); }
.tb-filters { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.tb-select {
  padding: 8px 30px 8px 12px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); background: var(--bg-card);
  border: 1px solid var(--border); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23918F88' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.tb-select:hover { border-color: var(--border-strong); }

/* ---------- Compact product table ---------- */

.catalog-card { overflow: hidden; }

table.product-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.product-table thead th {
  text-align: left; font-family: var(--font-heading);
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); padding: 12px var(--space-4); white-space: nowrap;
  background: var(--bg-card-alt); border-bottom: 1px solid var(--border);
}
.product-table tbody tr { border-bottom: 1px solid var(--border); transition: background-color .1s ease; }
.product-table tbody tr:last-child { border-bottom: none; }
.product-table tbody td { padding: 11px var(--space-4); vertical-align: middle; }
.product-table thead th:first-child, .product-table tbody td:first-child { padding-left: var(--space-5); }
.product-table thead th:last-child, .product-table tbody td:last-child { padding-right: var(--space-5); }

.prod-row { cursor: pointer; }
.prod-row:hover { background: var(--bg-hover); }
.prod-row.is-selected { background: var(--accent-soft-bg); }
.prod-row.is-new { animation: rowFlash 1.2s ease; }
.prod-row.is-updated { animation: rowFlashSoft 1.2s ease; }
@keyframes rowFlash { 0% { background: var(--tone-green-bg); } 100% { background: transparent; } }
@keyframes rowFlashSoft { 0% { background: var(--accent-soft-bg); } 100% { background: transparent; } }

.col-check { width: 20px; }
.col-price { white-space: nowrap; }
.col-center { text-align: center; }
.col-actions { width: 44px; text-align: right; }

.cell-secondary { color: var(--text-secondary); }
.cell-primary { font-weight: 700; }
.cell-muted { color: var(--text-muted); font-size: 12.5px; }

/* checkbox */
.checkbox { position: relative; display: inline-flex; cursor: pointer; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox span {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  background: var(--bg-input); display: inline-block; transition: all .12s ease;
}
.checkbox input:checked + span { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked + span::after {
  content: ''; position: absolute; left: 5.5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkbox input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* product cell w/ real thumbnail glyph */
.prod-cell { display: flex; align-items: center; gap: var(--space-3); }
.prod-thumb {
  width: 42px; height: 42px; border-radius: var(--radius-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-alt); border: 1px solid var(--border);
  color: var(--text-secondary); overflow: hidden;
}
.prod-thumb svg { width: 26px; height: 26px; }
:root[data-theme="dark"] .prod-thumb { background: #14171d; }
.prod-thumb-img { padding: 3px; background: #fff; border-color: var(--border); }
.prod-thumb-img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 2px; }
.prod-cell-text { display: flex; flex-direction: column; min-width: 0; }
.prod-title { font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.prod-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* collection chips */
.col-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip-mini {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--bg-card-alt); border: 1px solid var(--border); color: var(--text-secondary);
}
.chip-mini.chip-more { color: var(--text-muted); }

/* price */
.price-retail { font-weight: 700; }
.price-compare { color: var(--text-muted); text-decoration: line-through; font-size: 11.5px; margin-left: 6px; }

/* inventory state */
.inv-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.inv-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.inv-green { color: var(--tone-green); }
.inv-amber { color: var(--tone-amber); }
.inv-red { color: var(--tone-red); }

/* featured star */
.star-toggle {
  background: none; border: none; padding: 4px; border-radius: var(--radius-sm);
  color: var(--text-muted); display: inline-flex; transition: color .12s ease, transform .1s ease;
}
.star-toggle:hover { color: var(--tone-amber); background: var(--bg-hover); }
.star-toggle:active { transform: scale(.9); }
.star-toggle.is-on { color: var(--tone-amber); }
.star-toggle.is-on svg { fill: var(--tone-amber); }

/* row three-dot menu */
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-md); border: 1px solid transparent;
  background: none; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn .dots { font-size: 20px; line-height: 1; letter-spacing: 1px; }

.row-menu { position: relative; display: inline-block; }
.row-menu-list {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 190px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown); padding: 6px; z-index: 70; display: none;
}
.row-menu.is-open .row-menu-list { display: block; }
.row-menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.row-menu-list button:hover { background: var(--bg-hover); }
.row-menu-list button svg { width: 15px; height: 15px; color: var(--text-muted); }
.row-menu-list .rm-danger { color: var(--tone-red); }
.row-menu-list .rm-danger svg { color: var(--tone-red); }
.rm-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* table empty state */
.table-empty { text-align: center; padding: var(--space-8) var(--space-4); color: var(--text-muted); }
.table-empty svg { width: 30px; height: 30px; opacity: .5; margin-bottom: var(--space-3); }
.table-empty p { margin: 0 0 var(--space-3); font-size: 13px; }

/* ---------- Bulk action bar ---------- */

.bulk-bar {
  position: sticky; bottom: var(--space-5); z-index: 40;
  display: flex; align-items: center; gap: var(--space-2);
  margin: var(--space-4) auto 0; max-width: max-content;
  padding: 8px 10px 8px var(--space-4);
  background: var(--text-primary); color: var(--bg);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-dropdown);
  animation: bulkUp .18s ease;
}
@keyframes bulkUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.bulk-count { font-family: var(--font-heading); font-weight: 800; font-size: 13px; }
.bulk-sep { width: 1px; height: 20px; background: rgba(255,255,255,.25); }
:root[data-theme="dark"] .bulk-sep { background: rgba(0,0,0,.2); }
.bulk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: inherit; font-family: var(--font-heading); font-weight: 700; font-size: 12.5px;
}
.bulk-btn:hover { background: rgba(255,255,255,.14); }
:root[data-theme="dark"] .bulk-btn:hover { background: rgba(0,0,0,.18); }
.bulk-btn svg { width: 15px; height: 15px; }
#bulkClear { opacity: .75; }

/* ---------- Inventory tab ---------- */

.qty-input {
  width: 68px; padding: 6px 8px; border-radius: var(--radius-md);
  text-align: center; font-size: 13px; font-weight: 600; font-family: var(--font-mono);
}

/* ---------- Collections / promotions icons ---------- */

.col-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft-bg); color: var(--accent-strong);
}
:root[data-theme="dark"] .col-icon { color: var(--accent-soft-text); }
.col-icon svg { width: 18px; height: 18px; }
.col-icon.promo { background: var(--tone-purple-bg); color: var(--tone-purple); }

/* ---------- Brands grid ---------- */

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.brand-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-card); box-shadow: var(--shadow-card);
  transition: border-color .12s ease, transform .08s ease;
}
.brand-card:hover { border-color: var(--border-strong); }
.brand-logo {
  width: 44px; height: 44px; border-radius: var(--radius-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-alt); border: 1px solid var(--border);
  font-family: var(--font-heading); font-weight: 800; font-size: 14px; color: var(--text-secondary);
}
.brand-meta { flex: 1; min-width: 0; }
.brand-name { font-weight: 700; font-size: 14px; }
.brand-count { color: var(--text-muted); font-size: 12px; margin-top: 1px; }

/* ============================================================= */
/* PRODUCT DRAWER (Add / Edit slide-over)                         */
/* ============================================================= */

.product-drawer { width: 800px; max-width: 100vw; display: flex; flex-direction: column; padding: 0; }

.pd-header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border); background: var(--bg-card);
  position: sticky; top: 0; z-index: 5;
}
.pd-header-main { flex: 1; min-width: 0; }
.pd-header-main h2 { font-size: 18px; }
.pd-header-main p { margin: 2px 0 0; color: var(--text-secondary); font-size: 12.5px; }
.pd-header-actions { display: flex; align-items: center; gap: var(--space-2); }
.pd-close { flex-shrink: 0; }

.pd-body {
  flex: 1; overflow-y: auto; padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-5);
}

.pd-section { display: flex; flex-direction: column; gap: var(--space-3); }
.pd-section-head { display: flex; align-items: center; gap: var(--space-2); }
.pd-section-head h3 {
  font-size: 13px; font-weight: 800; color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 7px;
}
.pd-section-head h3 svg { color: var(--accent); }

.pd-section-accent {
  background: var(--accent-soft-bg); border: 1px solid rgba(168,101,47,.18);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
:root[data-theme="dark"] .pd-section-accent { border-color: rgba(224,160,107,.2); }
.pd-badge {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--accent); color: #fff;
}

.pd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.pd-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); }

/* rich text editor */
.rte { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-input); }
.rte-toolbar { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--border); background: var(--bg-card-alt); flex-wrap: wrap; }
.rte-toolbar button {
  min-width: 28px; height: 28px; padding: 0 6px; border: none; background: none; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.rte-toolbar button:hover { background: var(--bg-hover); color: var(--text-primary); }
.rte-toolbar button svg { width: 15px; height: 15px; }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-area { min-height: 110px; padding: var(--space-3); font-size: 13.5px; line-height: 1.6; outline: none; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.rte-area h3 { font-size: 15px; margin: 8px 0 4px; }
.rte-area ul, .rte-area ol { margin: 6px 0; padding-left: 20px; }
.rte-area p { margin: 0 0 8px; }
.rte-area a { color: var(--accent-strong); text-decoration: underline; }

/* media */
.media-drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: var(--space-5); text-align: center; color: var(--text-muted);
  cursor: pointer; transition: border-color .12s ease, background-color .12s ease;
}
.media-drop:hover, .media-drop.is-hover { border-color: var(--accent); background: var(--accent-soft-bg); }
.media-drop svg { color: var(--text-muted); margin-bottom: 6px; }
.media-drop p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.media-drop .link-accent { color: var(--accent-strong); font-weight: 700; }
:root[data-theme="dark"] .media-drop .link-accent { color: var(--accent-soft-text); }
.media-hint { display: block; font-size: 11.5px; margin-top: 4px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
.media-cell {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-card-alt); cursor: grab;
  display: flex; align-items: center; justify-content: center;
}
.media-cell.is-primary { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.media-cell.dragging { opacity: .4; }
.media-cell img { width: 100%; height: 100%; object-fit: cover; }
.media-cell .media-glyph { color: var(--text-secondary); }
.media-cell .media-glyph svg { width: 42px; height: 42px; }
.media-badge {
  position: absolute; left: 5px; bottom: 5px; font-size: 9.5px; font-weight: 800;
  padding: 2px 6px; border-radius: var(--radius-pill); background: var(--accent); color: #fff;
}
.media-remove {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: none;
  border-radius: 50%; background: rgba(10,10,9,.62); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s ease;
}
.media-star {
  position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; border: none;
  border-radius: 50%; background: rgba(10,10,9,.62); color: #fff;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s ease;
}
.media-cell:hover .media-remove, .media-cell:hover .media-star { opacity: 1; }

/* pricing */
.money-input { position: relative; display: flex; align-items: center; }
.money-input span { position: absolute; left: 11px; color: var(--text-muted); font-size: 13px; pointer-events: none; }
.money-input input { width: 100%; padding: 9px 12px 9px 24px; border-radius: var(--radius-md); font-size: 13.5px; }
.margin-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-4); border-radius: var(--radius-md);
  background: var(--bg-card-alt); border: 1px solid var(--border);
}
.margin-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.margin-value { font-family: var(--font-heading); font-weight: 800; font-size: 16px; color: var(--tone-green); }
.margin-profit { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* toggle rows */
.toggle-row { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.toggle-row .switch { margin: 0; }

/* multiselect + tags */
.multiselect { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chip {
  padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--bg-card); font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  transition: all .12s ease;
}
.ms-chip:hover { border-color: var(--border-strong); }
.ms-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ms-chip.is-on::before { content: '✓ '; }

.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-input);
}
.tag-input input { border: none; background: none; flex: 1; min-width: 120px; padding: 3px; font-size: 13px; outline: none; }
.tag-chips { display: contents; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 9px;
  border-radius: var(--radius-pill); background: var(--accent-soft-bg); color: var(--accent-strong);
  font-size: 12px; font-weight: 600;
}
:root[data-theme="dark"] .tag-chip { color: var(--accent-soft-text); }
.tag-chip button { border: none; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; padding: 0 3px; opacity: .7; }
.tag-chip button:hover { opacity: 1; }

/* collapsible advanced sections */
.adv-section { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); overflow: hidden; }
.adv-section > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-3);
  padding: 13px var(--space-4); font-family: var(--font-heading); font-weight: 700; font-size: 13.5px;
}
.adv-section > summary::-webkit-details-marker { display: none; }
.adv-section > summary > span:first-child { display: inline-flex; align-items: center; gap: 9px; }
.adv-section > summary > span:first-child svg { color: var(--text-muted); }
.adv-section > summary .adv-meta { margin-left: auto; font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--text-muted); }
.adv-section > summary > svg:last-child { color: var(--text-muted); transition: transform .18s ease; }
.adv-section[open] > summary > svg:last-child { transform: rotate(180deg); }
.adv-section[open] > summary { border-bottom: 1px solid var(--border); }
.adv-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.adv-hint { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.spec-rows, .variant-rows { display: flex; flex-direction: column; gap: 8px; }
.spec-row { display: grid; grid-template-columns: 1fr 1.4fr 32px; gap: 8px; align-items: center; }
.spec-row input { padding: 8px 10px; border-radius: var(--radius-md); font-size: 13px; }
.variant-row { display: grid; grid-template-columns: 1fr 1fr 1fr 90px 70px 32px; gap: 6px; align-items: center; }
.variant-row input { padding: 7px 9px; border-radius: var(--radius-md); font-size: 12.5px; }
.spec-del { width: 30px; height: 30px; font-size: 17px; color: var(--text-muted); }
.spec-del:hover { color: var(--tone-red); }

/* SEO preview */
.seo-preview {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  background: var(--bg-card-alt);
}
.seo-url { font-size: 12px; color: var(--tone-green); margin-bottom: 3px; }
:root[data-theme="dark"] .seo-url { color: var(--tone-green); }
.seo-title { font-size: 16px; color: #1a0dab; line-height: 1.3; margin-bottom: 2px; }
:root[data-theme="dark"] .seo-title { color: #8ab4f8; }
.seo-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }

.handle-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-input); }
.handle-input span { padding: 9px 4px 9px 12px; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.handle-input input { border: none; background: none; flex: 1; padding: 9px 12px 9px 2px; font-size: 13px; outline: none; }

/* status */
.pd-status { padding-top: var(--space-2); border-top: 1px solid var(--border); }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.segmented .seg {
  border: none; background: var(--bg-card); padding: 8px 18px;
  font-family: var(--font-heading); font-weight: 700; font-size: 12.5px; color: var(--text-secondary);
  border-right: 1px solid var(--border);
}
.segmented .seg:last-child { border-right: none; }
.segmented .seg:hover { background: var(--bg-hover); }
.segmented .seg.is-on { background: var(--accent); color: #fff; }

/* footer */
.pd-footer {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border); background: var(--bg-card);
  position: sticky; bottom: 0;
}
.pd-dirty { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--tone-amber); }
.pd-dirty svg { width: 14px; height: 14px; }
.pd-footer-actions { margin-left: auto; display: flex; gap: var(--space-2); }

@media (max-width: 860px) {
  .product-drawer { width: 100vw; }
  .pd-grid-3 { grid-template-columns: 1fr; }
  .pd-grid-2 { grid-template-columns: 1fr; }
  .variant-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .catalog-toolbar { flex-direction: column; align-items: stretch; }
  .tb-search { max-width: none; }
  .product-table thead { display: none; }
  .bulk-bar { flex-wrap: wrap; border-radius: var(--radius-lg); }
}

/* ---------- Schedule ---------- */

.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.view-toggle button {
  border: none; background: var(--bg-card); padding: 8px 16px; font-family: var(--font-heading);
  font-weight: 700; font-size: 12.5px; color: var(--text-secondary);
}
.view-toggle button.is-active { background: var(--accent); color: #fff; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.calendar-weekday { background: var(--bg-card-alt); padding: 8px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.calendar-day { background: var(--bg-card); min-height: 118px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.calendar-day.is-today { background: var(--accent-soft-bg); }
.calendar-day .day-num { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.calendar-day.is-today .day-num { color: var(--accent-strong); }
:root[data-theme="dark"] .calendar-day.is-today .day-num { color: var(--accent-soft-text); }

.calendar-appt {
  font-size: 10.5px; padding: 3px 6px; border-radius: 4px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}

@media (max-width: 900px) {
  .calendar-grid { grid-template-columns: 1fr; }
  .calendar-weekday:nth-child(n+2) { display: none; }
  .calendar-day { min-height: auto; }
}

/* ---------- Website content ---------- */

.section-list { display: flex; flex-direction: column; gap: var(--space-2); }
.section-row {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card-alt);
}
.section-row .drag-handle { color: var(--text-muted); cursor: grab; }
.section-row .sec-name { font-weight: 700; font-size: 13.5px; flex: 1; }
.section-row.is-hidden { opacity: 0.55; }
.section-row .sec-actions { display: flex; gap: 6px; }

.content-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-4); }
.content-card { padding: var(--space-5); text-align: left; }
.content-card .cc-icon { width: 38px; height: 38px; border-radius: var(--radius-md); background: var(--accent-soft-bg); color: var(--accent-strong); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-3); }
:root[data-theme="dark"] .content-card .cc-icon { color: var(--accent-soft-text); }
.content-card h3 { font-size: 14.5px; margin-bottom: 4px; }
.content-card p { margin: 0; font-size: 12.5px; color: var(--text-secondary); }

/* ---------- Reports ---------- */

.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5); }
.report-kpi { padding: var(--space-4); }
.report-kpi .label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.report-kpi .value { font-family: var(--font-heading); font-size: 22px; font-weight: 800; margin-top: 4px; }
.report-kpi .delta { font-size: 11.5px; color: var(--tone-green); margin-top: 4px; }

.chart-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-5); margin-bottom: var(--space-5); }

.bar-chart { display: flex; align-items: flex-end; gap: var(--space-3); height: 200px; padding: var(--space-4) var(--space-5) 0; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart-col .bar { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: var(--accent); }
.bar-chart-col .bar-label { font-size: 10.5px; color: var(--text-muted); }

.top-list { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); }
.top-list-row { display: flex; align-items: center; gap: var(--space-3); }
.top-list-row .rank { width: 20px; font-family: var(--font-heading); font-weight: 800; color: var(--text-muted); font-size: 12.5px; }
.top-list-row .name { flex: 1; font-size: 12.5px; font-weight: 600; }
.top-list-row .bar-track { flex: 1.4; height: 6px; border-radius: 3px; background: var(--tone-gray-bg); overflow: hidden; }
.top-list-row .bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.top-list-row .amt { font-size: 12px; color: var(--text-secondary); width: 62px; text-align: right; }

@media (max-width: 1000px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
}

/* ---------- Settings ---------- */

.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-5); align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav button {
  text-align: left; background: none; border: none; padding: 9px var(--space-3); border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.settings-nav button.is-active { background: var(--accent-soft-bg); color: var(--accent-strong); }
:root[data-theme="dark"] .settings-nav button.is-active { color: var(--accent-soft-text); }
.settings-panel { display: none; }
.settings-panel.is-active { display: block; }

.demo-note {
  margin-top: var(--space-6);
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

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

/* ---------- Quote builder ---------- */

.quote-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-5); align-items: start; }
.quote-items { display: flex; flex-direction: column; gap: var(--space-2); }
.quote-item-row { display: grid; grid-template-columns: 1fr 70px 90px 90px 32px; gap: var(--space-2); align-items: center; }
.quote-item-row input[type="number"] { text-align: right; }
.quote-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; }
.quote-summary-row.total { font-weight: 800; font-size: 15.5px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; }
.quote-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }

@media (max-width: 1000px) {
  .quote-layout { grid-template-columns: 1fr; }
  .quote-item-row { grid-template-columns: 1fr 60px 80px 80px 28px; }
}
