/* =====================================================================
   SOUNDVAULT — Inventory Page Styles (Integration Build)
   =====================================================================
   Font: Inter (primary), JetBrains Mono (monospace accents)
   Colors: Purple #8b5cf6, Red #dc2626, Gold #facc15, Green #22c55e
   Background: #0a0a0a (body), #1a1a1a (cards), #121212 (panels)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ========== INVENTORY BAR ========== */
.inventory-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 24px;
}

/* ========== WAREHOUSE METER ========== */
.warehouse-tier {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.warehouse-tier-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wh-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

.wh-usage {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.wh-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.wh-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ========== TAB TOGGLE ========== */
.inventory-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.06);
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.toggle-btn:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.04);
}

.toggle-btn.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-btn svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.toggle-btn.active svg {
  opacity: 1;
}

.review-badge {
  background: rgba(220, 38, 38, 0.2);
  color: #ef4444;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.inventory-count {
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  font-weight: 400;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ========== SECTION HEADERS ========== */
.samples-header,
.projects-header,
.review-bay-header {
  padding: 28px 32px 0;
}

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.section-title svg {
  opacity: 0.6;
  color: #8b5cf6;
}

.section-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  margin: 4px 0 0;
}

/* ========== FILTER BAR ========== */
.filters-section {
  padding: 20px 32px;
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-select:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.06);
  color: rgba(255,255,255,0.8);
}

/* Custom Select Dropdowns */
.custom-select-wrap {
  position: relative;
  display: inline-block;
}

.custom-select-trigger {
  user-select: none;
}

.custom-select-arrow {
  flex-shrink: 0;
  transition: transform 0.2s;
  opacity: 0.5;
}

.custom-select-wrap.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 4px 0;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: 280px;
  overflow-y: auto;
}

.custom-select-wrap.open .custom-select-dropdown {
  display: block;
}

.custom-select-option {
  padding: 8px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.1s ease;
}

.custom-select-option:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #fff;
}

.custom-select-option.selected {
  color: #a78bfa;
  font-weight: 500;
}

.custom-select-optgroup-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.25);
  pointer-events: none;
}

/* BPM Slider */
.bpm-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.bpm-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}

.bpm-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #a78bfa;
  min-width: 30px;
}

.bpm-range {
  -webkit-appearance: none;
  width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.bpm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #8b5cf6;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}

.bpm-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ========== BULK ACTIONS BAR ========== */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  background: rgba(139, 92, 246, 0.06);
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.bulk-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.bulk-count {
  font-size: 13px;
  color: #a78bfa;
  font-weight: 500;
}

.bulk-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bulk-action-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: #fff;
}

/* ========== CHECKBOXES ========== */
.row-checkbox-wrap,
.bulk-checkbox-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-checkbox-wrap input[type="checkbox"],
.bulk-checkbox-wrap input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.row-checkmark,
.bulk-checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.row-checkbox-wrap input:checked ~ .row-checkmark,
.bulk-checkbox-wrap input:checked ~ .bulk-checkmark {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

.row-checkbox-wrap input:checked ~ .row-checkmark::after,
.bulk-checkbox-wrap input:checked ~ .bulk-checkmark::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.row-checkmark:hover,
.bulk-checkmark:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

/* ========== TRACKLIST ========== */
.tracklist-section {
  padding: 0 32px 32px;
}

.tracklist-header {
  display: grid;
  grid-template-columns: 36px 50px 1fr auto;
  gap: 0;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tracklist {
  display: flex;
  flex-direction: column;
}

/* Track Row Base (sv-track-row is the required class, track-row is kept for compat) */
.sv-track-row,
.track-row {
  display: grid;
  grid-template-columns: 36px 50px 1fr auto;
  gap: 0;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s ease;
  position: relative;
}

.sv-track-row:hover,
.track-row:hover {
  background: rgba(255,255,255,0.03);
}

.sv-track-row.playing,
.track-row.playing {
  background: rgba(139, 92, 246, 0.08);
}

.sv-track-row.selected,
.track-row.selected {
  background: rgba(139, 92, 246, 0.06);
}

.track-select {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Play Button */
.sv-play-btn,
.play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.sv-play-btn:hover,
.play-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  transform: scale(1.05);
}

/* Track Info */
.track-title,
.track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sv-track-thumb,
.track-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.track-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sv-track-name,
.track-name {
  font-size: 14px;
  font-weight: 500;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sv-track-pack,
.track-pack {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #777;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.track-meta .meta-dot {
  color: rgba(255,255,255,0.15);
  font-size: 10px;
}

.track-meta .type-badge {
  font-size: 10px;
  padding: 1px 8px;
}

.playing .sv-track-name,
.playing .track-name {
  color: #a78bfa;
}

/* BPM / Key / Type */
.track-bpm, .track-key {
  font-size: 13px;
  color: #888;
  font-variant-numeric: tabular-nums;
}

.type-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

.type-badge.loop {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.type-badge.oneshot {
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
}

.type-badge.midi {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* Track Action Buttons */
.track-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.action-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

/* ========== 3-DOT OPTIONS MENU ========== */
.track-options-wrap {
  position: relative;
}

.options-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.options-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

.options-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 4px 0;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.options-menu.open {
  display: block;
}

.options-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.options-menu-item:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #fff;
}

/* ========== REVIEW STATES ON TRACK ROWS ========== */
.review-bpm {
  border-left: 3px solid rgba(220, 38, 38, 0.6);
}

.review-key {
  border-left: 3px solid rgba(250, 204, 21, 0.5);
}

.bpm-empty, .key-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bpm-empty {
  border: 1px dashed rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.06);
  color: rgba(220, 38, 38, 0.7);
  animation: bpmEmptyPulse 3s ease-in-out infinite;
}

.bpm-empty:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.7);
  color: rgba(220, 38, 38, 0.95);
  animation: none;
}

.key-empty {
  border: 1px dashed rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.04);
  color: rgba(250, 204, 21, 0.6);
  animation: keyEmptyPulse 3s ease-in-out infinite;
}

.key-empty:hover {
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.6);
  color: rgba(250, 204, 21, 0.9);
  animation: none;
}

@keyframes bpmEmptyPulse {
  0%, 100% { border-color: rgba(220, 38, 38, 0.3); }
  50% { border-color: rgba(220, 38, 38, 0.6); }
}

@keyframes keyEmptyPulse {
  0%, 100% { border-color: rgba(250, 204, 21, 0.25); }
  50% { border-color: rgba(250, 204, 21, 0.5); }
}

.bpm-input-wrap {
  display: none;
}

.bpm-input-wrap.visible {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bpm-input {
  width: 56px;
  padding: 4px 8px;
  border: 1.5px solid rgba(220, 38, 38, 0.6);
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.08);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  text-align: center;
}

.bpm-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.bpm-confirm {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bpm-confirm:hover {
  background: rgba(34, 197, 94, 0.25);
}

/* ========== PROJECTS VIEW ========== */
.projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 20px;
}

.projects-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cargo-view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.cargo-toggle-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 8px 16px;
  background: transparent;
  color: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.cargo-toggle-btn:hover {
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.03);
}

.cargo-toggle-btn.cargo-toggle-active {
  background: rgba(167, 139, 250, 0.12);
  color: #a78bfa;
  border-bottom: 2px solid #a78bfa;
}

.new-project-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 6px;
  color: #a78bfa;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.new-project-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

/* Project Card Grid */
.cargo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 32px 32px;
}

/* Crate Card */
.crate-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: visible;
  position: relative;
  transition: all 0.2s;
}

.crate-card:hover {
  border-color: rgba(167, 139, 250, 0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.crate-card-top {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
}

.crate-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crate-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.crate-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  margin: 0;
}

.crate-meta-pills {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.crate-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
}

.crate-options-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}

.crate-card:hover .crate-options-btn {
  opacity: 1;
}

/* Manifest Section */
.crate-manifest {
  padding: 12px 16px 14px;
}

.manifest-rule {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 6px 0;
}

.crate-section-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.2);
  padding: 0 12px;
  margin-bottom: 2px;
}


.manifest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}

.manifest-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.25);
  width: 70px;
  flex-shrink: 0;
}

.manifest-filled .manifest-label {
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}

.manifest-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.manifest-bar-fill {
  height: 100%;
  background: #8b5cf6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.manifest-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  width: 20px;
  text-align: right;
}

.manifest-filled .manifest-count {
  color: rgba(255,255,255,0.6);
}

/* Shop Dots */
.crate-shops {
  display: flex;
  gap: 12px;
  padding: 10px 16px 14px;
  justify-content: center;
}

.shop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.shop-dot.active {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

/* ========== CARGO DRAWER ========== */
.cargo-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cargo-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cargo-drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 440px;
  height: 100vh;
  background: #121218;
  border-left: 1px solid rgba(255,255,255,0.06);
  z-index: 950;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.cargo-drawer.open {
  right: 0;
}

.cargo-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cargo-drawer-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  margin: 0;
}

.cargo-drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.cargo-drawer-close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.cargo-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* ========== REVIEW BAY ========== */
.review-bay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 20px;
}

.review-bay-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}

.review-bay-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(220, 38, 38, 0.8);
}

.review-bay-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 32px 32px;
}

/* Review Bay Item */
.review-bay-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: background 0.15s;
  gap: 12px;
}

.review-bay-item:hover {
  background: rgba(255,255,255,0.04);
}

.rbi-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* State Colors */
.state-red .rbi-status-indicator { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.state-red { border-left-color: #ef4444; }
.state-red .rbi-state { color: #ef4444; }

.state-amber .rbi-status-indicator { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.state-amber { border-left-color: #f59e0b; }
.state-amber .rbi-state { color: #f59e0b; }

.state-cleared .rbi-status-indicator { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.3); }
.state-cleared { border-left-color: #22c55e; }
.state-cleared .rbi-state { color: #22c55e; }

.rbi-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rbi-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rbi-state {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.rbi-field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}

.rbi-bpm-input {
  width: 80px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
}

.rbi-bpm-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.rbi-key-select, .rbi-key-type-select {
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.rbi-key-select:focus, .rbi-key-type-select:focus {
  border-color: #8b5cf6;
}

.rbi-bpm-confirm-btn,
.rbi-key-confirm-btn {
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 4px;
  color: #a78bfa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}

.rbi-bpm-confirm-btn:hover,
.rbi-key-confirm-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

/* ========== ACTION PANELS ========== */
.action-panel {
  position: fixed;
  bottom: 80px;
  right: -320px;
  width: 300px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 300;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.action-panel.open {
  right: 32px;
}

.action-panel-header {
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Pack Panel */
.pack-list {
  max-height: 200px;
  overflow-y: auto;
}

.pack-list-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.1s;
}

.pack-list-item:hover {
  background: rgba(139, 92, 246, 0.08);
  color: #fff;
}

.pack-new-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: none;
  color: #8b5cf6;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.pack-new-btn:hover {
  background: rgba(139, 92, 246, 0.08);
}

/* Tags Panel */
.tags-current {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  min-height: 20px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  color: #a78bfa;
  font-size: 12px;
}

.tag-pill-remove {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.tag-pill-remove:hover {
  opacity: 1;
}

.tags-input-wrap {
  padding: 0 16px 10px;
}

.tags-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #e0e0e0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
}

.tags-input:focus {
  border-color: rgba(139, 92, 246, 0.4);
}

.tags-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.tags-suggestions {
  padding: 0 12px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-suggestion {
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-suggestion:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: rgba(255,255,255,0.9);
}

/* Instrument Panel */
.instrument-group {
  padding: 8px 14px;
}

.instrument-group + .instrument-group {
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.instrument-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 6px;
}

.instrument-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.instrument-btn {
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.instrument-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: #fff;
}

.instrument-btn.selected {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: #a78bfa;
}

/* ========== INTAKE OVERLAY ========== */
.intake-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.intake-overlay.open {
  display: flex;
}

.intake-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.intake-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.intake-modal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}

.intake-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.intake-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.intake-modal-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}

.intake-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intake-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: inherit;
}

.intake-option:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateX(4px);
}

.intake-option-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.08);
  border-radius: 10px;
  color: #8b5cf6;
  flex-shrink: 0;
}

.intake-option-label {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: block;
}

.intake-option-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 2px;
}

/* ========== LOADING & EMPTY STATES ========== */
.sv-loading-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.sv-skeleton-row {
  height: 56px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s infinite ease-in-out;
}

.sv-skeleton-card {
  height: 320px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  border-radius: 10px;
  animation: shimmer 1.5s infinite ease-in-out;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sv-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  margin: 0;
}

.empty-state-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.2);
  margin: 6px 0 0;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .tracklist-header,
  .sv-track-row,
  .track-row {
    grid-template-columns: 36px 40px 1fr auto;
  }
  .inventory-bar {
    padding: 12px 20px;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .tracklist-header,
  .sv-track-row,
  .track-row {
    grid-template-columns: 40px 1fr auto;
  }
  .th-select, .track-select {
    display: none;
  }
  .tracklist-header {
    display: none;
  }
  .filters-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .inventory-bar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  .samples-header, .projects-header, .review-bay-header {
    padding: 0 16px;
  }
  .filters-section, .tracklist-section, .review-bay-list {
    padding: 0;
  }
  .cargo-grid {
    gap: 8px;
    grid-template-columns: 1fr;
  }
  .cargo-drawer {
    width: 95vw;
    max-width: 95vw;
  }
}

/* Patch selectors for WP backend compatibility */
.sv-play-icon {
  pointer-events: none;
}
.sv-stack-btn {
  /* backend may target this class directly */
}

/* =====================================================================
   SECTION 1 & 2: COMPACT MANIFEST INDICATORS (Hold + Ledger)
   ===================================================================== */

.manifest-indicator,
.shops-indicator .shops-left {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 8px;
}

.manifest-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.manifest-pill.present {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34,197,94,0.4);
}

.manifest-pill.absent {
  color: rgba(255,255,255,0.12);
}

.shops-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 12px 6px;
}

.shops-left {
  display: flex;
  gap: 10px;
  padding: 0;
}

/* Remove old manifest row styles from cards */
.crate-manifest .manifest-row,
.crate-manifest .manifest-bar-track,
.crate-manifest .manifest-bar-fill,
.crate-manifest .manifest-count,
.crate-manifest .manifest-label {
  display: none;
}

/* Create Loopables Button */
.create-loopables-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.create-loopables-btn.active {
  color: #22c55e;
}

.create-loopables-btn.active:hover {
  background: rgba(34,197,94,0.12);
  text-shadow: 0 0 8px rgba(34,197,94,0.5);
}

.create-loopables-btn.locked {
  color: rgba(255,255,255,0.12);
  cursor: not-allowed;
}

.create-loopables-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 50;
  pointer-events: none;
}

.create-loopables-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 10px;
  border: 5px solid transparent;
  border-top-color: #1a1a2e;
}

.create-loopables-btn:hover .create-loopables-tooltip {
  display: block;
}

.create-loopables-btn.locked .create-loopables-tooltip::before {
  content: 'TRACKOUT & BPM REQUIRED';
  display: block;
  color: rgba(255,255,255,0.35);
  font-size: 9px;
  margin-top: 2px;
}


/* =====================================================================
   SECTION 2: LEDGER VIEW
   ===================================================================== */

.ledger-view {
  padding: 0 32px;
}

.ledger-header-row {
  display: grid;
  grid-template-columns: 4px 24px 40px 36px 1fr 60px 60px 180px 110px 36px;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ledger-hdr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ledger-row {
  display: grid;
  grid-template-columns: 4px 24px 40px 36px 1fr 60px 60px 180px 110px 36px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s ease;
}

.ledger-row:hover {
  background: rgba(255,255,255,0.02);
}

.ledger-border {
  width: 4px;
  height: 32px;
  background: #8b5cf6;
  border-radius: 2px;
}

.ledger-crate-icon {
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ledger-cover {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
}

.ledger-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ledger-play-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
}

.ledger-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-bpm,
.ledger-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.ledger-manifest,
.ledger-shops {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ledger-actions {
  position: relative;
}

.ledger-options-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}

.ledger-options-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.ledger-options-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.ledger-options-menu.open {
  display: block;
}

.options-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

.create-loopables-menu-item.active {
  color: #22c55e;
}

.create-loopables-menu-item.disabled {
  color: rgba(255,255,255,0.2);
  cursor: not-allowed;
}

.create-loopables-menu-item.disabled:hover {
  background: transparent;
}


/* =====================================================================
   SECTION 3: SELL / DON'T SELL SYSTEM
   ===================================================================== */

.sell-indicator {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-left: 6px;
}

.sell-toggle-btn {
  position: relative;
}

.sell-toggle-btn.selling {
  color: #a78bfa;
}

.sell-toggle-btn.selling:hover {
  color: #8b5cf6;
}

.sell-toggle-btn:not(.selling) {
  color: rgba(255,255,255,0.3);
}

/* Sell toggle tooltip */
.sell-toggle-btn::after {
  content: 'SELL THIS SAMPLE';
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 50;
  pointer-events: none;
}

.sell-toggle-btn.selling::after {
  content: 'STOP SELLING';
}

.sell-toggle-btn:hover::after {
  display: block;
}

/* Don't Sell gating on Add to Pack */
.add-to-pack-item.gated {
  color: rgba(255,255,255,0.2);
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
}

.add-to-pack-item.gated::after {
  content: '(not for sale)';
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-left: 6px;
}

/* Bulk sell/don't sell buttons */
.bulk-sell-btn,
.bulk-dontsell-btn {
  font-family: 'JetBrains Mono', monospace;
}


/* =====================================================================
   ICON PILLS — Manifest & Shop indicators
   ===================================================================== */

.manifest-pill.icon-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  cursor: default;
}

.manifest-pill.icon-pill svg {
  width: 14px;
  height: 14px;
}

.manifest-pill.icon-pill.present svg {
  stroke: #22c55e;
  filter: drop-shadow(0 0 6px rgba(34,197,94,0.35));
}

.manifest-pill.icon-pill.absent svg {
  stroke: rgba(255,255,255,0.12);
}

/* Tooltip on hover */
.manifest-pill.icon-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.manifest-pill.icon-pill::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1a1a2e;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.manifest-pill.icon-pill:hover::after,
.manifest-pill.icon-pill:hover::before {
  opacity: 1;
}

/* Ledger view icon pills */
.ledger-manifest .manifest-pill.icon-pill {
  width: 14px;
  height: 14px;
}

.ledger-manifest .manifest-pill.icon-pill svg {
  width: 12px;
  height: 12px;
}


/* =====================================================================
   CREATE LOOPABLES OVERLAY
   ===================================================================== */

.loopables-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.loopables-overlay.open {
  display: flex;
}

.loopables-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px;
  max-width: 580px;
  width: 92%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: loopablesSlideIn 0.25s ease;
}

@keyframes loopablesSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.loopables-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.loopables-modal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}

.loopables-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.loopables-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.loopables-modal-sub {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Waveform viewer */
.loopables-waveform-wrap {
  margin-bottom: 24px;
}

.loopables-bar-labels {
  display: flex;
  justify-content: space-around;
  padding: 0 1px;
  margin-bottom: 6px;
}

.loopables-bar-labels span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.5px;
  width: 12.5%;
  text-align: center;
}

.loopables-waveform {
  position: relative;
  height: 120px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
}

.loopables-waveform canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.loopables-playhead {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(139,92,246,0.5);
  pointer-events: none;
  transition: left 0.05s linear;
  opacity: 0;
}

.loopables-bar-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0;
  margin-top: 4px;
}

.loopables-bar-ticks span {
  width: 1px;
  height: 6px;
  background: rgba(255,255,255,0.1);
}

/* Downbeat slider */
.loopables-slider-section {
  margin-bottom: 28px;
}

.loopables-slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.loopables-slider-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 1.2px;
}

.loopables-slider-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.5px;
}

.loopables-slider-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  cursor: pointer;
}

.loopables-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 3px;
  width: 0%;
  pointer-events: none;
}

.loopables-slider-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #a78bfa;
  border: 2px solid #1a1a2e;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(139,92,246,0.4), 0 2px 6px rgba(0,0,0,0.4);
  cursor: grab;
  transition: box-shadow 0.15s;
  z-index: 2;
}

.loopables-slider-thumb:hover {
  box-shadow: 0 0 16px rgba(139,92,246,0.6), 0 2px 8px rgba(0,0,0,0.5);
}

.loopables-slider-thumb:active {
  cursor: grabbing;
  box-shadow: 0 0 20px rgba(139,92,246,0.7), 0 2px 10px rgba(0,0,0,0.5);
}

/* Confirm button */
.loopables-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #a78bfa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.loopables-confirm-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
  color: #c4b5fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139,92,246,0.2);
}

.loopables-confirm-btn:active {
  transform: translateY(0);
}

/* ============ LOOPABLES PLAYBACK CONTROLS ============ */
.loopables-playback-controls {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
}

.loopables-play-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.loopables-play-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}

.loopables-play-btn.playing {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.loopables-play-btn.playing .play-icon { display: none; }
.loopables-play-btn.playing .stop-icon { display: inline !important; }

/* ============ LOOPABLES CONFIRM BUTTON STATES ============ */
.loopables-confirm-btn .confirm-default-state,
.loopables-confirm-btn .confirm-processing-state,
.loopables-confirm-btn .confirm-success-state,
.loopables-confirm-btn .confirm-error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loopables-confirm-btn.processing {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

.loopables-confirm-btn.success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
  pointer-events: none;
}

.loopables-confirm-btn.error {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #f87171;
  cursor: pointer;
}

.confirm-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(167, 139, 250, 0.3);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: confirmSpin 0.8s linear infinite;
}

@keyframes confirmSpin {
  to { transform: rotate(360deg); }
}


/* ============ SHOP CONDITIONAL VISIBILITY ============ */
/* Sell button and shop-related elements are hidden by default.
   Backend adds .sv-shop-active to .app when sampleShopActive: true */
.sell-toggle-btn,
.sell-indicator {
  display: none;
}
.sv-shop-active .sell-toggle-btn {
  display: inline-flex;
}
.sv-shop-active .sell-indicator {
  display: inline;
}

/* ============ TRACK ROW FILTER TRANSITIONS ============ */
/* Smooth appear/disappear when client-side filters hide/show rows */
.sv-track-row {
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.3s ease;
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  overflow: hidden;
}
.sv-track-row.sv-filtered-out {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}

/* ============ PROJECTS GRID SCROLL CONTAINMENT ============ */
/* Scrollable after ~3 rows visible to handle power users with 30+ projects */
#projectsGrid {
  max-height: 1100px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,0.3) transparent;
}
#projectsGrid::-webkit-scrollbar {
  width: 6px;
}
#projectsGrid::-webkit-scrollbar-track {
  background: transparent;
}
#projectsGrid::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.3);
  border-radius: 3px;
}
#projectsGrid::-webkit-scrollbar-thumb:hover {
  background: rgba(139,92,246,0.5);
}

/* ============ REVIEW BAY EXIT ANIMATION ============ */
/* Brief "Confirmed" flash state before row animates out */
.review-bay-item.sv-confirming {
  background: rgba(34,197,94,0.08);
  border-left-color: #22c55e;
  transition: background 0.3s ease;
}
.review-bay-item.sv-confirming .rbi-state {
  color: #22c55e;
}
.review-bay-item.sv-confirming .rbi-actions::after {
  content: "✓ Confirmed";
  color: #22c55e;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-left: 12px;
}
.review-bay-item.sv-exit {
  opacity: 0;
  transform: translateY(-16px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-color: transparent;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.4s ease 0.1s, padding 0.4s ease 0.1s, margin 0.4s ease 0.1s, border-color 0.3s ease;
  pointer-events: none;
  overflow: hidden;
}


/* ============ HOLD VIEW CARD 3-DOT MENU ============ */
.crate-card-menu-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.crate-card:hover .crate-card-menu-wrap {
  opacity: 1;
}
.crate-dots-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #e0e0e0;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.crate-dots-btn:hover {
  background: rgba(0,0,0,0.8);
}
.crate-card-menu-wrap .crate-dots-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
}