/* ==========================================================================
   Root Harmonic Studio — Column 1 Sticky Root Controller & Category Filters
   Standards: Strict Cascade Specificity | Zero Margin for Component Spacing
   ========================================================================== */

.sidebar-control-card {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.root-panel {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 11px;
  box-shadow: var(--shadow-sm);
}

.root-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.root-badge-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-amber-text);
  text-transform: uppercase;
}

.root-badge-label .material-symbols-outlined {
  font-size: 14px;
}

/* Light / Dark UI Theme Switcher Pill */
.theme-toggle-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-surface-border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn .material-symbols-outlined {
  font-size: 13px;
  color: var(--accent-amber-text);
}

.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  background-color: var(--surface-subtle-hover);
}

.root-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.color-picker-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--text-main);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.color-picker-wrapper input[type="color"] {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  cursor: pointer;
  border: none;
  padding: 0;
}

.color-preview-disc {
  width: 100%;
  height: 100%;
  background-color: #C2B280;
  pointer-events: none;
}

.hex-input-box {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
}

.hex-input-box .hash {
  color: var(--text-dim);
}

.hex-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  width: 58px;
  text-transform: uppercase;
}

/* Search Box & Category Tabs */
.search-box {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  width: 100%;
}

.search-box .material-symbols-outlined {
  font-size: 16px;
  color: var(--text-dim);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.category-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.category-tab {
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.71rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.category-tab .material-symbols-outlined {
  font-size: 13px;
}

.category-tab:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-elevated);
}

.category-tab.active {
  background-color: var(--bg-surface-elevated);
  border-color: var(--bg-surface-border);
  color: var(--text-main);
  font-weight: 700;
}

.category-tab.active .material-symbols-outlined {
  color: var(--accent-emerald-text);
}

/* Section B: Compact Swatch Library List Header */
.sidebar-library-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-library-list .matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 2px;
}

.sidebar-library-list .matrix-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-library-list .matrix-title-wrap h2 {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sidebar-library-list .matrix-counter {
  background-color: var(--bg-surface-elevated);
  color: var(--accent-emerald-text);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--bg-surface-border);
}

.sidebar-library-list .matrix-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-dot.root-dot {
  background-color: #C2B280;
}

.badge-dot.sub-dot {
  background-color: #10B981;
}

.empty-state {
  background-color: var(--bg-surface);
  border: 1px dashed var(--bg-surface-border);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--text-muted);
}
