/* =====================================================================
   NEXON INVENTORY — dark/futuristic, matches public site theme
   ===================================================================== */

:root {
  --bg-0: #050a07;
  --bg-1: #0a1410;
  --bg-2: #0f1c15;
  --bg-3: #15281d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.45);
  --green: #193A1E;
  --green-bright: #2A6A3A;
  --green-glow: rgba(42, 106, 58, 0.45);
  --accent: #6fe78b;
  --accent-dim: rgba(111, 231, 139, 0.18);
  --danger: #ef4444;
  --warn: #f59e0b;
  --info: #60a5fa;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --font-display: 'Bebas Neue', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(42, 106, 58, 0.10), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(25, 58, 30, 0.15), transparent 60%),
    var(--bg-0);
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* ===== LOADING STATE ===== */
#app.loading {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}
.spinner {
  width: 32px; height: 32px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== LOGIN ===== */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}
.login-brand {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.login-brand span { color: var(--accent); }
.login-sub {
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 28px;
}
.login-form .field { margin-bottom: 14px; }
.login-form .error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}

/* ===== APP LAYOUT ===== */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100dvh;
}

.sidebar {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.brand {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.08em;
  padding: 4px 8px 24px;
}
.brand span { color: var(--accent); }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  display: block;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 150ms, color 150ms;
}
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav a svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-3);
}
.sidebar-foot .who {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
.sidebar-foot .logout {
  margin-top: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  background: transparent;
  border: 0;
  padding: 0;
}
.sidebar-foot .logout:hover { color: var(--danger); }

.main {
  padding: 32px 40px;
  overflow-x: hidden;
}

/* ===== TOPBAR / MOBILE ===== */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { padding: 0; font-size: 20px; }
.menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
}

/* ===== TYPOGRAPHY ===== */
.page-head { margin-bottom: 24px; }
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 180ms;
}
.btn:hover { background: var(--bg-2); border-color: rgba(255,255,255,0.3); }
.btn-primary {
  background: var(--green);
  border-color: var(--green-bright);
  color: var(--text);
}
.btn-primary:hover {
  background: var(--green-bright);
  box-shadow: 0 0 24px var(--green-glow);
}
.btn-accent {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-accent:hover { background: var(--accent); color: var(--bg-0); }
.btn-danger { color: var(--danger); border-color: rgba(239,68,68,0.4); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== FORMS ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field input,
.field select,
.field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 150ms, background 150ms;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}
.field textarea { min-height: 120px; resize: vertical; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  transition: transform 200ms, border-color 200ms;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.stat-value.sm { font-size: 22px; }
.stat-sub {
  color: var(--text-3);
  font-size: 11px;
  margin-top: 4px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.status-pill-stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.status-pill-stat .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.status-pill-stat .count {
  font-family: var(--font-display);
  font-size: 20px;
}

/* ===== TABLE ===== */
.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
}
th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-2);
  font-weight: 500;
}
tbody tr {
  transition: background 120ms;
  cursor: pointer;
}
tbody tr:hover { background: var(--bg-2); }
tbody tr:last-child td { border-bottom: 0; }
.td-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.td-strong { font-weight: 600; }
.td-money { font-variant-numeric: tabular-nums; }

/* ===== STATUS PILLS ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 4px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid;
}
.pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill-available { color: #6fe78b; border-color: rgba(111,231,139,0.4); background: rgba(111,231,139,0.08); }
.pill-reserved { color: #f59e0b; border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.pill-inquiry { color: #60a5fa; border-color: rgba(96,165,250,0.4); background: rgba(96,165,250,0.08); }
.pill-sold { color: #c084fc; border-color: rgba(192,132,252,0.4); background: rgba(192,132,252,0.08); }
.pill-delivered { color: #a3a3a3; border-color: rgba(163,163,163,0.4); background: rgba(163,163,163,0.08); }
.pill-service_returned, .pill-service_inventory { color: #ef4444; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.08); }
.pill-assembly { color: #38bdf8; border-color: rgba(56,189,248,0.4); background: rgba(56,189,248,0.08); }
.pill-pre-assembly { color: #94a3b8; border-color: rgba(148,163,184,0.4); background: rgba(148,163,184,0.08); }
.pill-demo { color: #f472b6; border-color: rgba(244,114,182,0.4); background: rgba(244,114,182,0.08); }

/* ===== UNIT PHOTO ===== */
.cart-photo {
  margin-top: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
}
.cart-photo h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  font-weight: 500;
}
.cart-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.filters input[type="search"] {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  min-width: 220px;
}
.filters select {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
}
.filters .spacer { flex: 1; }

/* ===== DETAIL VIEW ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.detail-section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  margin-bottom: 16px;
}
.detail-section h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  font-weight: 500;
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.kv-grid .kv .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 3px;
}
.kv-grid .kv .v {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.kv-grid .kv .v.mono { font-family: var(--font-mono); font-size: 13px; }
.kv-grid .kv .v.money { font-variant-numeric: tabular-nums; }

.detail-actions {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-actions .btn { width: 100%; justify-content: center; }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.modal .modal-sub {
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(239,68,68,0.5); }

/* ===== EMPTY ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty p { margin-bottom: 16px; }

/* ===== EDITABLE OPTIONS ===== */
.options-edit {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  min-height: 200px;
  width: 100%;
  resize: vertical;
}
.options-edit:focus { outline: none; border-color: var(--accent); }

/* ===== MOBILE ===== */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 30% 0 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 200ms;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { display: flex; }
  .main { padding: 20px 16px 60px; }
  .page-title { font-size: 28px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-actions { position: static; }
  .kv-grid { grid-template-columns: 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  th, td { padding: 10px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
  .main { padding: 16px 12px 60px; }
}

/* ===== OPTION PILLS ===== */
.opts-toolbar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.opts-toolbar .spacer { flex: 1; }
.opts-total {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.opts-total b {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  margin-left: 8px;
  font-weight: 400;
}

.opts-subhead {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-3);
  text-transform: uppercase;
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.opts-subhead::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.opt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opt-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  transition: border-color 180ms, background 180ms;
  position: relative;
  overflow: hidden;
}
.opt-pill:hover { border-color: var(--border-strong); background: var(--bg-3); }

/* Priced add-on — green accent */
.opt-pill.priced {
  background: rgba(111, 231, 139, 0.06);
  border-color: rgba(111, 231, 139, 0.25);
}
.opt-pill.priced:hover {
  border-color: var(--accent);
  background: rgba(111, 231, 139, 0.10);
}

/* Value-add (no listed retail) — amber dashed */
.opt-pill.value-add {
  border-style: dashed;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.04);
}
.opt-pill.value-add:hover { border-color: var(--warn); }

/* Standard inclusion — muted, no price visible */
.opt-pill.zero {
  background: transparent;
  border-color: var(--border);
  color: var(--text-3);
}

.opt-pill .label {
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
}
.opt-pill.priced .label { padding-right: 4px; color: var(--text); }
.opt-pill .price {
  padding: 8px 14px 8px 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 600;
}
.opt-pill.value-add .price { color: var(--warn); }
/* Hide $0 prices entirely on standard pills */
.opt-pill.zero .price { display: none; }

/* Action buttons hidden until hover (or always on touch) */
.opt-pill .actions {
  display: flex;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition: max-width 200ms, opacity 200ms;
}
.opt-pill:hover .actions {
  max-width: 80px;
  opacity: 1;
}
.opt-pill .actions button {
  background: transparent;
  border: 0;
  color: var(--text-3);
  padding: 0 9px;
  cursor: pointer;
  transition: color 120ms, background 120ms;
  display: grid;
  place-items: center;
  height: 100%;
  align-self: stretch;
}
.opt-pill .actions button:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.opt-pill .actions button.danger:hover { color: var(--danger); background: rgba(239,68,68,0.08); }
.opt-pill .actions svg { width: 12px; height: 12px; }

/* Touch / coarse-pointer: show actions always (no hover state on iOS) */
@media (hover: none) {
  .opt-pill .actions { max-width: 80px; opacity: 1; }
}

.opt-add-input {
  display: inline-flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 0 4px 0 14px;
  margin-top: 10px;
}
.opt-add-input input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  width: 200px;
  padding: 8px 0;
}
.opt-add-input input:focus { outline: none; }
.opt-add-input input.price {
  width: 60px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
  border-left: 1px solid var(--border);
  padding-left: 10px;
  margin-left: 8px;
}
.opt-add-input button {
  background: var(--accent);
  color: var(--bg-0);
  border: 0;
  border-radius: 999px;
  width: 28px; height: 28px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover { color: var(--text); }
th.sortable .arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.5;
}
th.sortable.active .arrow { opacity: 1; color: var(--accent); }

/* ===== REFERENCE SHEET ===== */
.ref-lede {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 28px;
  max-width: 640px;
  line-height: 1.6;
}

.ref-section { margin-bottom: 36px; }

.ref-h {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  color: var(--text);
}
.ref-sub {
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 14px;
  max-width: 720px;
  line-height: 1.5;
}

.ref-table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  overflow-x: auto;
}
.ref-table {
  width: 100%;
  border-collapse: collapse;
}
.ref-table th, .ref-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ref-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-2);
  font-weight: 500;
}
.ref-table tbody tr:last-child td { border-bottom: 0; }
.ref-table tbody tr:hover { background: var(--bg-2); }
.ref-table td.num, .ref-table th.num { text-align: right; }
.ref-table td.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ref-table td.name { font-weight: 500; color: var(--text); }
.ref-table td.note { color: var(--text-3); font-size: 12px; line-height: 1.4; }
.ref-table .note.inline { font-size: 11px; margin-top: 2px; }

.ref-table.compact th, .ref-table.compact td {
  padding: 8px 14px;
  font-size: 12.5px;
}

/* Add-On cards grid */
.ref-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.ref-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.ref-card-h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

/* Standard inclusions list */
.ref-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 22px;
}
.ref-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
}
.ref-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

/* Callout box for ancillary example */
.ref-callout {
  background: var(--bg-1);
  border: 1px dashed rgba(111,231,139,0.3);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

/* ===== COMMITMENT (inquiry / reserved) ===== */
.commit-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.commit-card.has-inquiry { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.04); }
.commit-card.has-reserved { border-color: rgba(192, 132, 252, 0.5); background: rgba(192, 132, 252, 0.05); }

.commit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.commit-card-head h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  margin: 0;
}
.commit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.commit-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.commit-pill.inquiry { color: #f59e0b; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4); }
.commit-pill.reserved { color: #c084fc; background: rgba(192,132,252,0.12); border: 1px solid rgba(192,132,252,0.5); }

.commit-empty {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 12px;
}
.commit-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.commit-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 14px;
}
.commit-details .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 3px;
}
.commit-details .v { font-size: 13.5px; color: var(--text); }
.commit-details .v.mono { font-family: var(--font-mono); }
.commit-details .v a { color: var(--accent); }

@media (max-width: 600px) {
  .commit-details { grid-template-columns: 1fr; }
}

/* Small commitment badge for inventory list */
.commit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.commit-badge.inquiry { color: #f59e0b; background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.35); }
.commit-badge.reserved { color: #c084fc; background: rgba(192,132,252,0.12); border: 1px solid rgba(192,132,252,0.45); }

/* ===== ATTACHMENTS ===== */
.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.attach-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.attach-item a {
  display: block;
  width: 100%;
  height: 100%;
}
.attach-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 200ms;
}
.attach-item:hover img { transform: scale(1.04); }
.attach-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms, background 150ms;
  display: grid;
  place-items: center;
  font-weight: 600;
}
.attach-item:hover .attach-delete { opacity: 1; }
.attach-delete:hover { background: var(--danger); }
@media (hover: none) {
  .attach-delete { opacity: 1; }
}
.attach-empty {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: 13px;
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
}
.attach-toolbar { display: flex; gap: 8px; }
