/* PachBae Studi-OS — Inventory module styles */

.inventory {
  padding: 36px 36px 80px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Page head ──────────────────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  height: 1px; width: 180px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 8px var(--accent);
}

.page-head-l { max-width: 760px; }

.page-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0 4px;
}
.crumb-glyph { color: var(--accent); font-size: 12px; margin-right: 2px; }
.crumb-sep { color: var(--text-faint); margin: 0 2px; }
.crumb-current { color: var(--text-primary); }
.crumb-accent { color: var(--accent); }

.page-title {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
  margin: 14px 0 4px;
  text-wrap: balance;
  font-feature-settings: "ss01" on, "cv11" on;
}
.page-title-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.015em;
}

.page-meter {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: color-mix(in oklab, var(--accent) 4%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--border));
  border-radius: 100px;
  font-size: 12px;
}
.meter-item { display: inline-flex; align-items: baseline; gap: 7px; }
.meter-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.meter-value { color: var(--text-primary); font-size: 11.5px; letter-spacing: -0.005em; }
.meter-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.page-head-r {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 280px;
  box-shadow: var(--shadow-card);
}
.phr-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 16px;
  white-space: nowrap;
}
.phr-row > :first-child { color: var(--text-muted); letter-spacing: 0.02em; }
.phr-row > :last-child { color: var(--text-primary); text-align: right; }
.phr-divider { height: 1px; background: var(--border); margin: 3px -16px 3px; }
.phr-ok { color: oklch(0.80 0.14 145); }

/* ─── Stat strip ─────────────────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s, transform 0.18s;
}
.stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.stat::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, oklch(0.42 0.012 65), transparent);
}
html[data-theme="light"] .stat::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.38), transparent);
}
.stat.accent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.stat.accent {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 6%, var(--surface-2)),
    var(--surface));
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.stat-label::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.stat.accent .stat-label::before { background: var(--accent); box-shadow: 0 0 4px var(--accent); }
.stat.warn .stat-label::before { background: var(--red); box-shadow: 0 0 4px var(--red); }

.stat-value {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-feature-settings: "ss01" on;
}
.stat.accent .stat-value { color: var(--accent); }
.stat.warn .stat-value { color: var(--red); }
.stat-kicker {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─── Inventory search (module scope, not global top bar) ─────────────── */
.inv-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  height: 34px;
  margin-bottom: 16px;
  padding: 0 10px 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.inv-search-bar:focus-within {
  border-color: var(--accent);
  background: var(--surface-2);
}
.inv-search-bar .kbd-glyph { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.inv-search-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
}
.inv-search-bar input::placeholder { color: var(--text-muted); }
.inv-search-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.inv-search-clear:hover {
  color: var(--text-primary);
  background: var(--surface-3);
}

/* ─── Filter bar ─────────────────────────────────────────────────────── */
.filter-bar-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.filter-bar-stack > .filter-bar { margin-bottom: 0; }

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-bar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.filter-bar-stack .filter-bar--locations { margin-bottom: 0; }
.filter-bar-label {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.location-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 8px;
}
.loc-chip .loc-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.loc-chip-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-left: 1px;
  padding-left: 5px;
  border-left: 1px solid var(--border);
}

.cat-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  max-width: 50%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, var(--border)) transparent;
}
.cat-tabs::-webkit-scrollbar { height: 6px; }
.cat-tabs::-webkit-scrollbar-track { background: transparent; }
.cat-tabs::-webkit-scrollbar-thumb {
  background: var(--border-strong, var(--border));
  border-radius: 3px;
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 11px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.cat-tab:hover { color: var(--text-primary); background: var(--surface-2); }
.cat-tab.active {
  background: var(--surface-3);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 0 0 1px var(--border-strong) inset;
}
.cat-glyph { color: var(--text-muted); font-size: 12px; }
.cat-tab.active .cat-glyph { color: var(--accent); }
.cat-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  padding-left: 4px;
  border-left: 1px solid var(--border);
  margin-left: 2px;
}

.status-pills { display: flex; gap: 6px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px 0 9px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  transition: all 0.15s;
}
.status-pill:hover { color: var(--text-primary); border-color: var(--border-strong); }
.status-pill.active { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-2); }
.status-pill.all { padding: 0 12px; }
.status-pill-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  padding-left: 4px;
}

/* ─── Toolbar ────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.toolbar-l, .toolbar-r { display: flex; gap: 8px; align-items: center; }

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 30px;
  padding: 0 14px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 96%, white),
    var(--accent));
  color: oklch(0.18 0.05 60);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  transition: filter 0.15s, transform 0.05s;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 1px 2px rgba(0,0,0,0.3),
    0 0 0 0.5px color-mix(in oklab, var(--accent) 80%, black);
}
.tb-btn:hover { filter: brightness(1.08); }
.tb-btn:active { transform: translateY(0.5px); }
.tb-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tb-btn.ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-weight: 500;
  box-shadow: none;
}
.tb-btn.ghost:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-2); }
.tb-btn.ghost.tb-btn--active {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
}
.tb-btn.ghost.tb-btn--active:hover {
  background: color-mix(in oklab, var(--accent) 16%, var(--surface-2));
}

.tb-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-secondary);
}
.tb-select > span { color: var(--text-muted); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.tb-select select {
  border: 0;
  background-color: transparent;
  background-image: none;
  height: 28px;
  padding: 0 4px 0 0;
  font-size: 12.5px;
}

.tb-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.tb-toggle button {
  width: 28px; height: 24px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
}
.tb-toggle button:hover { color: var(--text-primary); }
.tb-toggle button.active {
  background: var(--surface-3);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* ─── Inventory body / list ─────────────────────────────────────────── */
.inv-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  overflow: clip;
}
.inv-main { flex: 1; min-width: 0; }

.list-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.list-header {
  display: grid;
  grid-template-columns: 54px minmax(180px, 1.4fr) 1fr 1fr 1.1fr 1.4fr 110px 50px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.list-row {
  display: grid;
  grid-template-columns: 54px minmax(180px, 1.4fr) 1fr 1fr 1.1fr 1.4fr 110px 50px;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  position: relative;
  cursor: default;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-2); }
.list-row.selected {
  background: color-mix(in oklab, var(--accent) 9%, var(--surface));
}
.list-row.selected::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.list-row.cozy { padding: 7px 16px; }

.thumb {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 50%);
  pointer-events: none;
}
.thumb-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  background: oklch(0.18 0.005 65 / 0.55);
  padding: 1px 5px;
  border-radius: 2px;
  position: relative; z-index: 1;
}

.lr-name .lr-brand {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 1px;
}
.lr-name .lr-model {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.lr-subcat-l {
  font-size: 12.5px;
  color: var(--text-primary);
}
.lr-id {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.lr-serial { font-size: 11.5px; color: var(--text-secondary); }
.lr-loc { font-size: 12px; color: var(--text-primary); }
.lr-room { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.lr-value { font-size: 12.5px; text-align: right; color: var(--text-primary); font-feature-settings: "tnum" on; }
.lr-cond { text-align: center; }

.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── Spreadsheet (Excel-style) list ─────────────────────────────────── */
.sheet-wrap {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 1px 0 oklch(0.32 0.008 65 / 0.5) inset,
    0 1px 2px rgba(0,0,0,0.3),
    0 20px 50px -30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  position: relative;
}
.sheet-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, oklch(0.45 0.012 65 / 0.6), transparent);
  z-index: 4;
  pointer-events: none;
}
html[data-theme="light"] .sheet-wrap::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.38), transparent);
}

.sheet-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box;
}

.sheet-head {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface-2);
}

.sheet-letter-row,
.sheet-label-row,
.sheet-row {
  display: flex;
  width: max-content;
  min-width: 100%;
}

.sheet-letter-row {
  height: 18px;
  background: linear-gradient(180deg, oklch(0.255 0.008 65), oklch(0.225 0.007 65));
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .sheet-letter-row {
  background: linear-gradient(180deg, oklch(0.90 0.005 80), oklch(0.875 0.005 80));
}

.sheet-gutter-letter,
.sheet-gutter-label,
.sheet-gutter {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky; left: 0; z-index: 2;
}

.sheet-letter-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  border-right: 1px solid var(--border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sheet-letter-cell:last-child { border-right: none; }

.sheet-label-row {
  height: 30px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border);
}

.sheet-gutter-label {
  font-size: 11px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border-bottom: 1px solid var(--border-strong);
}

.sheet-label-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  position: relative;
  gap: 4px;
}
.sheet-label-cell[style*="right"] { justify-content: flex-end; }
.sheet-label-cell[style*="center"] { justify-content: center; }
.sheet-label-cell:last-child { border-right: none; }
.sheet-label-cell.sortable { cursor: default; }
.sheet-label-cell.sortable:hover { color: var(--text-primary); background: var(--surface-3); }
.sheet-label-cell.active {
  color: var(--accent);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 14%, var(--surface-3)),
    color-mix(in oklab, var(--accent) 8%, var(--surface-2)));
}
.sheet-sort-glyph { font-size: 10px; opacity: 0.8; }

/* Resize handle decoration */
.sheet-label-cell::after {
  content: ""; position: absolute; right: -1px; top: 4px; bottom: 4px; width: 1px;
  background: var(--border-strong);
  opacity: 0.5;
}
.sheet-label-cell:last-child::after { display: none; }

/* ─── Sheet rows ─────────────────────────────────────────────────────── */
.sheet-rows {
  background:
    repeating-linear-gradient(
      180deg,
      var(--surface) 0,
      var(--surface) 28px,
      var(--surface-2) 28px,
      var(--surface-2) 56px
    );
}

.sheet-row {
  height: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  position: relative;
  cursor: default;
  transition: background 0.08s;
}
.sheet-row:hover:not(.empty-row):not(.selected) {
  background: color-mix(in oklab, var(--accent) 5%, transparent);
}
.sheet-row.selected {
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--accent) 22%, transparent),
    color-mix(in oklab, var(--accent) 10%, transparent));
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 1px var(--accent),
    0 0 24px color-mix(in oklab, var(--accent) 25%, transparent);
  z-index: 1;
}
.sheet-row.selected .sheet-gutter {
  background: var(--accent);
  color: oklch(0.18 0.05 60);
  font-weight: 700;
  box-shadow: 1px 0 4px color-mix(in oklab, var(--accent) 40%, transparent);
}
.sheet-row.selected .sheet-cell {
  color: var(--text-primary);
}

.sheet-gutter {
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-faint);
  font-feature-settings: "tnum" on;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-strong);
}

.sheet-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-primary);
  border-right: 1px solid var(--border);
  letter-spacing: -0.005em;
  overflow: hidden;
  white-space: nowrap;
}
.sheet-cell:last-child { border-right: none; }
.sheet-cell.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-feature-settings: "tnum" on;
  color: var(--text-secondary);
}
.sheet-cell-inner {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-cell[style*="right"] .sheet-cell-inner { text-align: right; }
.sheet-cell[style*="center"] .sheet-cell-inner { text-align: center; }
.cell-dim { color: var(--text-faint); }

/* Bulk edit — inline editable cells */
.sheet-row.bulk-editable { cursor: default; }
.bulk-edit-input {
  width: 100%;
  height: 22px;
  padding: 0 4px;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  font-feature-settings: inherit;
  border-radius: 2px;
  transition: border-color 0.1s, background 0.1s;
}
.bulk-edit-input:hover { border-color: var(--border); background: var(--surface); }
.bulk-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
.bulk-edit-input[type="checkbox"] {
  width: 14px; height: 14px; padding: 0;
}
.bulk-edit-input[type="date"] { font-family: var(--font-mono); }
.sheet-cell.mono .bulk-edit-input { font-family: var(--font-mono); }

.empty-row { background: transparent; }
.empty-row .sheet-gutter { color: var(--text-faint); opacity: 0.55; }

/* ─── Sheet tabs (bottom — like Excel workbook tabs) ─────────────────── */
.sheet-tabs {
  display: flex;
  align-items: stretch;
  height: 28px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-strong);
}
.sheet-tab {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 11px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  letter-spacing: 0.005em;
  cursor: default;
  position: relative;
}
.sheet-tab:hover { color: var(--text-primary); background: var(--surface); }
.sheet-tab.active {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 500;
}
.sheet-tab.active::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent);
}
.sheet-tab.plus {
  width: 28px;
  padding: 0;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
}
.sheet-tab-spacer { flex: 1; }
.sheet-status {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.sheet-status strong { color: var(--text-primary); font-weight: 600; padding: 0 2px; }

/* ─── Tags ───────────────────────────────────────────────────────────── */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px 0 7px;
  border-radius: 11px;
  font-size: 11px;
  letter-spacing: 0.005em;
  background: color-mix(in oklab, currentColor 10%, var(--surface));
  border: 1px solid;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-tag.compact {
  height: 18px;
  padding: 0 7px 0 6px;
  border-radius: 9px;
  font-size: 10.5px;
  gap: 5px;
}
.status-tag-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.status-tag-session {
  font-size: 10.5px;
  opacity: 0.85;
  margin-left: 2px;
  font-family: var(--font-mono);
}

.cond-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px 0 7px;
  border-radius: 11px;
  border: 1px solid;
  background: color-mix(in oklab, currentColor 8%, var(--surface));
  font-size: 11px;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.cond-badge.compact {
  height: 18px;
  padding: 0 7px 0 6px;
  border-radius: 9px;
  font-size: 10.5px;
  gap: 5px;
}
.cond-badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Status / condition tags — semantic colors (dark: bright ink on dim surface) */
.status-tag.status-tag--available {
  color: oklch(0.85 0.12 145);
  border-color: color-mix(in oklab, oklch(0.85 0.12 145) 35%, var(--border));
}
.status-tag.status-tag--in-session {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
}
.status-tag.status-tag--unavailable {
  color: oklch(0.75 0.14 5);
  border-color: color-mix(in oklab, oklch(0.75 0.14 5) 35%, var(--border));
}
.status-tag.status-tag--available .status-tag-dot { background: oklch(0.72 0.14 145); }
.status-tag.status-tag--in-session .status-tag-dot { background: var(--accent); }
.status-tag.status-tag--unavailable .status-tag-dot { background: oklch(0.65 0.18 5); }
.status-tag.status-tag--in-session .status-tag-dot.status-tag-dot--glow {
  box-shadow: 0 0 6px var(--accent);
}

.cond-badge.cond-badge--working {
  color: oklch(0.85 0.12 145);
  border-color: color-mix(in oklab, oklch(0.85 0.12 145) 30%, var(--border));
}
.cond-badge.cond-badge--attention {
  color: oklch(0.88 0.14 80);
  border-color: color-mix(in oklab, oklch(0.88 0.14 80) 30%, var(--border));
}
.cond-badge.cond-badge--maintenance {
  color: oklch(0.82 0.10 250);
  border-color: color-mix(in oklab, oklch(0.82 0.10 250) 30%, var(--border));
}
.cond-badge.cond-badge--testing {
  color: oklch(0.84 0.12 300);
  border-color: color-mix(in oklab, oklch(0.84 0.12 300) 30%, var(--border));
}
.cond-badge.cond-badge--faulty {
  color: oklch(0.78 0.16 25);
  border-color: color-mix(in oklab, oklch(0.78 0.16 25) 30%, var(--border));
}
.cond-badge.cond-badge--working::before { background: oklch(0.72 0.14 145); }
.cond-badge.cond-badge--attention::before { background: oklch(0.82 0.16 80); }
.cond-badge.cond-badge--maintenance::before { background: oklch(0.74 0.12 250); }
.cond-badge.cond-badge--testing::before { background: oklch(0.78 0.14 300); }
.cond-badge.cond-badge--faulty::before { background: oklch(0.68 0.18 25); }

html[data-theme="light"] .status-tag { font-weight: 500; }
html[data-theme="light"] .status-tag.status-tag--available {
  color: oklch(0.38 0.12 145);
  border-color: color-mix(in oklab, oklch(0.42 0.12 145) 55%, var(--border));
  background: color-mix(in oklab, oklch(0.42 0.12 145) 14%, var(--surface));
}
html[data-theme="light"] .status-tag.status-tag--in-session {
  color: oklch(0.44 0.11 58);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  background: color-mix(in oklab, var(--accent) 18%, var(--surface));
}
html[data-theme="light"] .status-tag.status-tag--unavailable {
  color: oklch(0.43 0.15 25);
  border-color: color-mix(in oklab, oklch(0.50 0.14 25) 50%, var(--border));
  background: color-mix(in oklab, oklch(0.52 0.12 25) 12%, var(--surface));
}
html[data-theme="light"] .status-tag.status-tag--available .status-tag-dot { background: oklch(0.48 0.14 145); }
html[data-theme="light"] .status-tag.status-tag--in-session .status-tag-dot { background: oklch(0.52 0.11 58); }
html[data-theme="light"] .status-tag.status-tag--in-session .status-tag-dot.status-tag-dot--glow {
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 65%, transparent);
}
html[data-theme="light"] .status-tag.status-tag--unavailable .status-tag-dot { background: oklch(0.52 0.16 25); }

html[data-theme="light"] .cond-badge { font-weight: 500; }
html[data-theme="light"] .cond-badge.cond-badge--working {
  color: oklch(0.38 0.12 145);
  border-color: color-mix(in oklab, oklch(0.42 0.12 145) 50%, var(--border));
  background: color-mix(in oklab, oklch(0.42 0.12 145) 14%, var(--surface));
}
html[data-theme="light"] .cond-badge.cond-badge--attention {
  color: oklch(0.40 0.13 75);
  border-color: color-mix(in oklab, oklch(0.55 0.12 75) 45%, var(--border));
  background: color-mix(in oklab, oklch(0.70 0.12 80) 14%, var(--surface));
}
html[data-theme="light"] .cond-badge.cond-badge--maintenance {
  color: oklch(0.40 0.10 250);
  border-color: color-mix(in oklab, oklch(0.48 0.10 250) 45%, var(--border));
  background: color-mix(in oklab, oklch(0.55 0.08 250) 12%, var(--surface));
}
html[data-theme="light"] .cond-badge.cond-badge--testing {
  color: oklch(0.42 0.11 300);
  border-color: color-mix(in oklab, oklch(0.50 0.10 300) 45%, var(--border));
  background: color-mix(in oklab, oklch(0.58 0.10 300) 12%, var(--surface));
}
html[data-theme="light"] .cond-badge.cond-badge--faulty {
  color: oklch(0.42 0.15 25);
  border-color: color-mix(in oklab, oklch(0.52 0.14 25) 48%, var(--border));
  background: color-mix(in oklab, oklch(0.55 0.12 25) 12%, var(--surface));
}
html[data-theme="light"] .cond-badge.cond-badge--working::before { background: oklch(0.45 0.13 145); }
html[data-theme="light"] .cond-badge.cond-badge--attention::before { background: oklch(0.55 0.12 75); }
html[data-theme="light"] .cond-badge.cond-badge--maintenance::before { background: oklch(0.48 0.10 250); }
html[data-theme="light"] .cond-badge.cond-badge--testing::before { background: oklch(0.52 0.11 300); }
html[data-theme="light"] .cond-badge.cond-badge--faulty::before { background: oklch(0.52 0.15 25); }

html[data-theme="light"] .status-pill:not(.active) {
  color: var(--text-primary);
  background: color-mix(in oklab, var(--surface-2) 55%, var(--surface));
  border-color: var(--border-strong);
}
html[data-theme="light"] .status-pill:not(.active) .status-pill-count {
  color: var(--text-muted);
}
html[data-theme="light"] .status-pill.active .status-pill-count {
  color: var(--text-muted);
}
.grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.grid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.12s, transform 0.12s;
  cursor: default;
}
.grid-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.grid-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px color-mix(in oklab, var(--accent) 15%, transparent);
}
.gc-thumb { display: flex; align-items: center; justify-content: space-between; }
.gc-id { font-size: 10px; color: var(--text-faint); letter-spacing: 0.02em; }
.gc-brand { font-size: 11px; color: var(--text-muted); }
.gc-model { font-size: 14px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; }
.gc-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.gc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.gc-val { font-size: 12px; color: var(--text-primary); font-feature-settings: "tnum" on; }

/* ─── Bulk selection ─────────────────────────────────────────────────── */
.sheet-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px; height: 14px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  position: relative;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  display: grid;
  place-items: center;
}
.sheet-checkbox:hover {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--surface));
}
.sheet-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px color-mix(in oklab, var(--accent) 50%, transparent);
}
.sheet-checkbox:checked::after {
  content: "";
  display: block;
  width: 4px; height: 7px;
  border: 1.5px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-0.5px, -1px);
}
.sheet-checkbox:indeterminate {
  background: color-mix(in oklab, var(--accent) 30%, var(--surface));
  border-color: var(--accent);
}
.sheet-checkbox:indeterminate::after {
  content: "";
  display: block;
  width: 7px; height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
}
html[data-theme="light"] .sheet-checkbox {
  background: #fff;
  border-color: var(--border-strong);
}
html[data-theme="light"] .sheet-checkbox:hover {
  background: color-mix(in oklab, var(--accent) 6%, #fff);
}
html[data-theme="light"] .sheet-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.sheet-check-letter { width: 28px; flex-shrink: 0; border-right: 1px solid var(--border); }
.sheet-check-label {
  width: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
}
.sheet-check-cell {
  width: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border);
}
.sheet-row.bulk-checked {
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
}
.sheet-row.bulk-checked .sheet-gutter {
  background: color-mix(in oklab, var(--accent) 20%, var(--surface-2));
}
.gc-check-wrap { position: absolute; top: 8px; right: 8px; z-index: 2; }
.grid-card { position: relative; }
.grid-card.bulk-checked {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--surface));
}
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: color-mix(in oklab, var(--accent) 8%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--border));
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.bulk-bar-l { display: flex; align-items: center; gap: 8px; }
.bulk-bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bulk-clear {
  width: 22px; height: 22px; border-radius: 4px; font-size: 11px;
  color: var(--text-muted); display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
}
.bulk-clear:hover { background: var(--surface-3); color: var(--text-primary); }
.bulk-count { font-size: 12.5px; font-weight: 500; color: var(--text-primary); }
.bulk-edit-group { display: flex; align-items: center; gap: 6px; }
.bulk-delete-btn { color: var(--red) !important; }
.bulk-delete-confirm { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }

/* ─── Add Gear Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 0 oklch(0.32 0.008 65 / 0.5) inset,
    0 32px 80px -20px rgba(0,0,0,0.7),
    0 2px 4px rgba(0,0,0,0.4);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text-primary); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-grid { display: flex; flex-direction: column; gap: 14px; }

.mf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mf-span2 { grid-column: span 2; }

.mf-field { display: flex; flex-direction: column; gap: 5px; }
.mf-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.mf-hint {
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 4px;
}
.mf-req { color: var(--accent); }

.mf-input {
  height: 32px;
  padding: 0 10px;
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.15s, background-color 0.15s;
}
select.mf-input { padding-right: 28px; }
.mf-input:hover { border-color: var(--border-strong); }
.mf-input:focus {
  border-color: var(--accent);
  background-color: var(--surface-2);
  outline: none;
}
.mf-input::placeholder { color: var(--text-faint); }
.mf-textarea { height: auto; padding: 8px 10px; resize: vertical; }
.mf-mono { font-family: var(--font-mono); font-size: 12px; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Settings module ────────────────────────────────────────────────── */
.settings-wrap {
  padding: 36px 36px 80px;
  width: 100%;
}
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1040px;
}
.settings-section {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-section-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.settings-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.settings-section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 56ch;
}
.settings-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-input {
  flex: 1;
  min-width: 200px;
  height: 32px;
  padding: 0 10px;
}
select.settings-input { padding-right: 28px; }
.settings-input:focus { border-color: var(--accent); }
.settings-input::placeholder { color: var(--text-faint); }
.settings-color-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.color-swatch {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.12s, transform 0.12s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}
.color-swatch.sm { width: 13px; height: 13px; }

.settings-list {
  list-style: none;
}
.settings-empty {
  padding: 20px;
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.settings-item:last-child { border-bottom: 0; }
.settings-item:hover { background: var(--surface-2); }

.settings-item-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.settings-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
}
.settings-inline-input {
  flex: 1;
  height: 26px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.settings-item-colors {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Per-room day rate (inline in the room row) */
.settings-room-rate {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  flex-shrink: 0;
}
.settings-room-rate:focus-within { border-color: var(--accent); }
.settings-room-rate-cur { color: var(--text-faint); font-size: 12px; }
.settings-room-rate-input {
  width: 56px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  text-align: right;
  padding: 0;
  -moz-appearance: textfield;
}
.settings-room-rate-input::-webkit-outer-spin-button,
.settings-room-rate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.settings-room-rate-input::placeholder { color: var(--text-faint); }
.settings-room-rate-unit { color: var(--text-faint); font-size: 10px; }

/* Currency-prefixed numeric input (settings + modals) */
.mf-input-prefix { position: relative; display: flex; align-items: center; }
.mf-input-prefix-sym {
  position: absolute;
  left: 10px;
  color: var(--text-faint);
  font-size: 12.5px;
  pointer-events: none;
}
.mf-input-prefix .mf-input { padding-left: 22px; width: 100%; }
.settings-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}
.settings-item:hover .settings-item-actions { opacity: 1; }
.settings-edit-btn, .settings-del-btn {
  width: 24px; height: 24px;
  border-radius: var(--radius);
  font-size: 12px;
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}
.settings-edit-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.settings-del-btn:hover { background: color-mix(in oklab, var(--red) 15%, var(--surface-3)); color: var(--red); }

/* ─── Inventory Settings Modal ───────────────────────────────────────── */
.is-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
}
.is-tab {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.is-tab:hover { color: var(--text-primary); }
.is-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

.is-body { flex: 1; overflow-y: auto; padding: 20px; }

.is-section { display: flex; flex-direction: column; gap: 0; }
.is-section-head { margin-bottom: 14px; }
.is-section-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.is-section-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

.is-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.is-col-form { flex-direction: column; align-items: stretch; }
.is-col-row { display: flex; align-items: center; gap: 8px; }
.is-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color 0.15s;
}
select.is-input { padding-right: 28px; }
.is-input:focus { border-color: var(--accent); outline: none; }
.is-input::placeholder { color: var(--text-faint); }
.is-textarea { height: auto; padding: 8px 10px; resize: vertical; }

.is-glyph-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.is-glyph-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  font-size: 14px;
  display: grid; place-items: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.is-glyph-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.is-glyph-btn.active { background: color-mix(in oklab, var(--accent) 14%, var(--surface)); border-color: color-mix(in oklab, var(--accent) 40%, var(--border)); color: var(--accent); }

.is-list { list-style: none; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.is-empty { padding: 24px; text-align: center; font-size: 12.5px; color: var(--text-faint); }
.is-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.is-item:last-child { border-bottom: 0; }
.is-item:hover { background: var(--surface-2); }
.is-item:hover .is-item-actions { opacity: 1; }

.is-item-glyph { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; color: var(--text-muted); }
.is-item-name { flex: 1; font-size: 13px; color: var(--text-primary); }
.is-item-type {
  font-size: 10.5px;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.is-item-opts { font-size: 11.5px; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-item-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.is-inline-input {
  flex: 1; height: 26px; padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text-primary); outline: none;
}

.mf-custom-divider {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.mf-checkbox-row { display: flex; align-items: center; gap: 8px; height: 32px; }
.mf-checkbox-row input { width: 16px; height: 16px; }

/* ─── Add Gear — image upload ────────────────────────────────────────── */
.mf-image-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.mf-image-preview {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.mf-image-placeholder {
  font-size: 11px;
  color: var(--text-faint);
}
.mf-image-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 2px;
}

/* ─── Column right-click context menu ───────────────────────────────── */
.col-ctx-menu {
  position: fixed;
  z-index: 2000;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  padding: 4px;
  min-width: 180px;
}
.col-ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: calc(var(--radius) - 1px);
  font-size: 12.5px;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.1s;
}
.col-ctx-item:hover { background: var(--surface-3); }
.col-ctx-item strong { color: var(--text-primary); font-weight: 500; }
.col-ctx-show-all { color: var(--text-secondary); border-top: 1px solid var(--border); margin-top: 3px; padding-top: 9px; border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
.col-ctx-show-all:hover { background: var(--surface-3); color: var(--text-primary); }
.col-ctx-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 6px;
  color: var(--text-muted);
}

/* ─── Import modal ───────────────────────────────────────────────────────── */
.modal--import { max-width: 760px; }

/* ─── Print modal ──────────────────────────────────────────────────────── */
.modal--print { max-width: 520px; }
.modal--print-wide {
  max-width: 860px;
  width: 100%;
  height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
}
.modal--room-onboard { max-width: 880px; }
.room-ob-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}
.room-ob-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.room-ob-step span {
  color: var(--text-faint);
  font-size: 9.5px;
}
.room-ob-step.active {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
  color: var(--text-primary);
}
.room-ob-step.active span,
.room-ob-step.done span { color: var(--accent); }
.room-ob-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.room-ob-presets .tb-btn {
  height: 24px;
  padding: 0 7px;
  font-size: 10.5px;
  min-width: 0;
}
.room-ob-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 10px;
}
.room-ob-panel-head {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 72px auto;
  gap: 8px;
  align-items: center;
}
.room-ob-lines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.room-ob-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.room-ob-line span {
  min-width: 18px;
  color: var(--text-faint);
  font-size: 9.5px;
}
.room-ob-line .mf-input {
  height: 26px;
  min-width: 0;
  font-size: 11.5px;
}

/* Step 1 — category picker */
.print-cat-list { display: flex; flex-direction: column; gap: 2px; }
.print-cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.print-cat-row:hover { background: var(--surface-2); }
.print-cat-name { flex: 1; font-size: 13px; color: var(--text-primary); }
.print-cat-count { font-size: 11.5px; color: var(--text-muted); }
.print-opt-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-secondary);
  cursor: pointer;
}

/* Step 2 — sidebar + white page */
.print-wide-body {
  flex: 1; min-height: 0;
  display: flex;
  overflow: hidden;
}
.print-sidebar {
  width: 190px;
  flex-shrink: 0;
  padding: 18px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.print-sidebar-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.print-preview-scroll {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  padding: 24px 28px;
}
.print-preview-page {
  background: #fff;
  color: #111;
  border-radius: 3px;
  padding: 40px 44px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.22);
  min-height: 500px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Page header */
.pp-head { text-align: center; margin-bottom: 36px; }
.pp-logo-img { max-height: 80px; max-width: 220px; object-fit: contain; display: block; margin: 0 auto 12px; }
.pp-logo-text { font-size: 24px; font-weight: 700; color: #000; margin-bottom: 8px; letter-spacing: -0.02em; }
.pp-doc-title { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #666; }
.pp-doc-date { font-size: 10.5px; color: #999; margin-top: 3px; }

/* Two-column content */
.pp-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; align-items: start; }
.pp-section { margin-bottom: 20px; }
.pp-cat-head {
  font-weight: 700; font-size: 12px;
  text-decoration: underline; text-transform: uppercase;
  letter-spacing: 0.04em; color: #000;
  margin-bottom: 5px; margin-top: 4px;
}
.pp-subcat-head { font-weight: 600; font-size: 11.5px; color: #222; margin-top: 8px; margin-bottom: 2px; }
.pp-item-row { display: flex; align-items: baseline; gap: 4px; padding: 1px 0; }
.pp-item-label { font-size: 12px; color: #111; flex: 1; line-height: 1.5; }
.pp-qty { color: #666; }
.pp-edit, .pp-remove {
  opacity: 0;
  font-size: 11px; color: #999;
  flex-shrink: 0; padding: 1px 3px;
  line-height: 1; background: none; border: none; cursor: pointer;
  transition: opacity 0.1s, color 0.1s;
  border-radius: 2px;
}
.pp-item-row:hover .pp-edit,
.pp-item-row:hover .pp-remove { opacity: 1; }
.pp-edit:hover { color: #555; background: #eee; }
.pp-remove:hover { color: #c00; background: #fee; }
.pp-label-input {
  flex: 1;
  font-size: 12px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #111 !important;
  background: #fff !important;
  border: none !important;
  border-bottom: 1.5px solid #bbb !important;
  outline: none !important;
  padding: 0 2px;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  box-shadow: none !important;
  color-scheme: light;
}
.pp-label-input:focus,
.pp-label-input:hover {
  color: #111 !important;
  background: #fff !important;
  border-color: transparent !important;
  border-bottom-color: #333 !important;
}

.imp-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.imp-step {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.imp-step.active { color: var(--text-primary); font-weight: 500; }
.imp-step.done   { color: var(--accent); }
.imp-step-sep    { color: var(--text-faint); font-size: 10px; }

/* Upload step */
.imp-drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.imp-drop-zone:hover,
.imp-drop-zone--over {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 5%, var(--surface));
}
.imp-drop-icon  { font-size: 28px; color: var(--text-faint); }
.imp-drop-label { font-size: 14px; color: var(--text-secondary); }
.imp-drop-or    { font-size: 12px; color: var(--text-faint); }

.imp-file-loaded {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in oklab, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--border));
  border-radius: var(--radius);
}
.imp-file-icon  { color: var(--accent); font-size: 14px; flex-shrink: 0; }

.imp-header-row-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.imp-header-row-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.imp-header-row-hint {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}
.imp-file-name  { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-file-rows  { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }

/* Map step — spreadsheet preview */
.imp-map-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.5;
}
.imp-fuzzy-notice {
  font-size: 12px;
  color: oklch(0.82 0.16 80);
  padding: 7px 10px;
  background: color-mix(in oklab, oklch(0.82 0.16 80) 8%, var(--surface));
  border: 1px solid color-mix(in oklab, oklch(0.82 0.16 80) 25%, var(--border));
  border-radius: var(--radius);
}

.imp-sheet-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.imp-sheet-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

/* Header row — dropdowns + original column name */
.imp-sheet-th {
  padding: 0;
  min-width: 148px;
  max-width: 200px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border-strong);
  vertical-align: top;
  position: relative;
}
.imp-sheet-th:last-child { border-right: 0; }
.imp-sheet-th--fuzzy {
  background: color-mix(in oklab, oklch(0.82 0.16 80) 8%, var(--surface-2));
  border-top: 2px solid oklch(0.82 0.16 80);
}

.imp-sheet-select {
  width: 100%;
  padding: 7px 22px 5px 9px;
  background: transparent;
  border: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.imp-sheet-select:focus { background-color: color-mix(in oklab, var(--accent) 8%, var(--surface-2)); }
.imp-sheet-select option { font-weight: 400; }

.imp-sheet-orig {
  padding: 0 9px 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sample data rows */
.imp-sheet-td {
  padding: 5px 9px;
  font-size: 12px;
  color: var(--text-primary);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.imp-sheet-td:last-child { border-right: 0; }
.imp-sheet-row--alt .imp-sheet-td { background: var(--surface-2); }
.imp-sheet-empty { color: var(--text-faint); }

/* Match badges */
.imp-match-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 8px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.imp-match-badge--fuzzy {
  background: color-mix(in oklab, oklch(0.82 0.16 80) 15%, var(--surface));
  color: oklch(0.82 0.16 80);
  border: 1px solid color-mix(in oklab, oklch(0.82 0.16 80) 30%, var(--border));
}
.imp-match-badge--norm {
  background: var(--surface-2);
  color: var(--text-faint);
  border: 1px solid var(--border);
}

/* Preview step */
.imp-preview-scroll {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.imp-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.imp-preview-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 7px 10px;
  text-align: left;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  position: sticky; top: 0; z-index: 1;
}
.imp-preview-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
.imp-preview-table tr:last-child td { border-bottom: 0; }

.imp-row--error td:first-child { border-left: 2px solid var(--red); }
.imp-row--error { background: color-mix(in oklab, var(--red) 6%, transparent); }
.imp-row--warn  td:first-child { border-left: 2px solid oklch(0.82 0.16 80); }
.imp-row--warn  { background: color-mix(in oklab, oklch(0.82 0.16 80) 5%, transparent); }

.imp-err-text  { font-size: 11px; color: var(--red); font-family: var(--font-mono); }
.imp-warn-text { font-size: 11px; color: oklch(0.82 0.16 80); font-family: var(--font-mono); }

.imp-fix-mapping-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--red) 8%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--red) 25%, var(--border));
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.imp-preview-src {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.imp-preview-src--missing { color: var(--red); opacity: 0.7; }

.imp-summary-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  font-family: var(--font-mono);
}
.imp-summary-ok   { color: oklch(0.85 0.12 145); }
.imp-summary-warn { color: oklch(0.82 0.16 80); }
.imp-summary-err  { color: var(--red); }

.imp-dupe-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.imp-dupe-check input { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--accent); }

.imp-page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Inline session picker (inside drawer) ──────────────────────── */
.drawer-scroll--hidden { display: none; }

.co-picker {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--border);
}

.co-picker-label {
  padding: 10px 16px 6px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.co-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin: 0 10px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.co-search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.co-search-input::placeholder { color: var(--text-faint); }

.co-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.co-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: calc(var(--radius) - 2px);
  text-align: left;
  border: 1px solid transparent;
  transition: background 0.1s, border-color 0.1s;
  width: 100%;
}
.co-item:hover {
  background: color-mix(in oklab, var(--accent) 5%, var(--surface));
}
.co-item.active {
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
  border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
}

.co-item-text { flex: 1; min-width: 0; }

.co-item-main {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.co-item-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.co-item-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.co-empty {
  padding: 20px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}

.co-picker-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.co-picker-foot .tb-btn { flex: 1; justify-content: center; }

/* ─── Bulk checkout floating picker ─────────────────────────────── */
.bulk-co-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 32px -4px rgba(0,0,0,0.5), 0 2px 8px -2px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.bulk-co-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border);
}
.bulk-co-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}
.bulk-co-close {
  font-size: 11px;
  color: var(--text-faint);
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}
.bulk-co-close:hover { color: var(--text-primary); background: var(--surface-3, var(--surface)); }

.bulk-co-list {
  max-height: 220px;
}

.bulk-co-foot {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}
