/* =============================================================================
   O³ Engine™: T-Box Schema Studio Stylesheet
   Dedicated to Ontological Metamodel Engineering, Scopes, Classes & Rules
   ============================================================================= */

:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-hover: rgba(255, 255, 255, 0.05);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-magenta: #d946ef;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------------- Header ---------------- */
.tbox-header {
  height: 56px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 50;
}

.tbox-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.3);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.tbox-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.tbox-logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0ea5e9, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.tbox-title-wrap {
  display: flex;
  flex-direction: column;
}

.tbox-title-main {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #f8fafc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tbox-title-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* Compact O³ Studio App Switcher */
.studio-switcher-wrap {
  position: relative;
}

.studio-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.studio-switcher-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(192, 132, 252, 0.5);
  color: #fff;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.25);
}

.studio-switcher-btn .switcher-icon {
  font-size: 1rem;
  color: #c084fc;
}

.studio-switcher-btn .switcher-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.studio-switcher-btn.open .switcher-chevron {
  transform: rotate(180deg);
}

/* Studio Dropdown Menu */
.studio-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: #090e18;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  z-index: 1000;
  overflow: hidden;
  animation: studioMenuFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-dropdown.show {
  display: block;
}

@keyframes studioMenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.studio-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-hub-link {
  color: #c084fc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.72rem;
  transition: color 0.15s ease;
}
.studio-hub-link:hover {
  color: #fff;
}

.studio-grid-menu {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.15s ease;
  position: relative;
}

.studio-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.studio-menu-item.active {
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.studio-menu-item .item-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
}

.studio-menu-item .item-text {
  display: flex;
  flex-direction: column;
}

.studio-menu-item .item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.studio-menu-item .item-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.studio-menu-item .active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 6px #c084fc;
  margin-left: auto;
}

/* Header Right Actions */
.tbox-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-micro {
  padding: 3px 8px;
  font-size: 0.7rem;
}

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 600;
  cursor: pointer;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* ---------------- Context Ribbon ---------------- */
.tbox-ribbon {
  height: 48px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.tbox-ribbon-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tbox-scope-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbox-scope-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tbox-select {
  background: #0f172a;
  border: 1px solid var(--border-medium);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.tbox-select:focus {
  border-color: var(--accent-cyan);
}

.tbox-stat-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbox-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tbox-stat-chip strong {
  color: #fff;
  font-family: var(--font-mono);
}

/* ---------------- Main Layout ---------------- */
.tbox-main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.tbox-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Sub-toolbar with tabs and search */
.tbox-sub-toolbar {
  height: 44px;
  background: rgba(10, 15, 29, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.tbox-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tbox-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tbox-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tbox-tab-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
}

.tbox-tab-count {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
}

.tbox-filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tbox-search-input {
  background: #0f172a;
  border: 1px solid var(--border-medium);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  width: 220px;
  outline: none;
}

.tbox-search-input:focus {
  border-color: var(--accent-cyan);
}

/* Views Container */
.tbox-views-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
}

#view-classes,
#view-relationships,
#view-domains,
#view-cypher {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------------- Table Styles & Alphabet Scrubber ---------------- */
.tbox-classes-wrap {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
}

.tbox-alphabet-strip {
  width: 28px;
  background: rgba(10, 16, 30, 0.98);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 6px 0;
  user-select: none;
  z-index: 20;
  flex-shrink: 0;
  position: relative;
  left: 0;
  top: 0;
  height: 100%;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
}

.tbox-alpha-btn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.60rem;
  font-weight: 700;
  color: #475569;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 1px 0;
  width: 100%;
  text-align: center;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.1;
  border-radius: 2px;
}

.tbox-alpha-btn.has-items {
  color: #94a3b8;
}

.tbox-alpha-btn.has-items:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  transform: scale(1.3);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  z-index: 2;
}

.tbox-alpha-btn.active {
  color: #38bdf8;
  font-weight: 900;
  background: rgba(56, 189, 248, 0.2);
  box-shadow: inset 0 0 4px rgba(56, 189, 248, 0.4);
}

.tbox-alpha-btn.disabled {
  color: #334155;
  cursor: not-allowed;
  opacity: 0.3;
}

@keyframes tboxRowPulse {
  0% { background: rgba(56, 189, 248, 0.35); }
  100% { background: transparent; }
}

.tbox-row-pulse {
  animation: tboxRowPulse 1.2s ease-out;
}

.tbox-table-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: auto;
  flex: 1;
  min-width: 0;
}

.tbox-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.tbox-table th {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-medium);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tbox-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.tbox-table tr:hover td {
  background: var(--bg-hover);
}

.tbox-class-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  cursor: pointer;
}

.tbox-class-id:hover {
  text-decoration: underline;
  color: #fff;
}

.tbox-table tbody tr {
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tbox-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.tbox-table tbody tr.tbox-row-selected {
  background: rgba(56, 189, 248, 0.16) !important;
}

.tbox-table tbody tr.tbox-row-selected td {
  border-top: 1px solid rgba(56, 189, 248, 0.45) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.45) !important;
}

.tbox-table tbody tr.tbox-row-selected td:first-child {
  border-left: 3px solid var(--accent-cyan) !important;
}

.tbox-table tbody tr.tbox-row-selected td:last-child {
  border-right: 1px solid rgba(56, 189, 248, 0.45) !important;
}

.tbox-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.tbox-alias-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  margin: 1px;
}

.tbox-prop-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  margin: 1px;
}

/* ---------------- Floating Docked Tab for Re-opening ---------------- */
.drawer-docked-tab {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 45;
  background: #0b1324;
  border: 1px solid #38bdf8;
  border-right: none;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 12px 7px;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  user-select: none;
}

.drawer-docked-tab:hover {
  background: #0284c7;
  color: #ffffff;
  padding-left: 11px;
  box-shadow: -6px 0 20px rgba(56, 189, 248, 0.4);
}

/* ---------------- Inspector Drawer ---------------- */
.tbox-drawer {
  width: 440px;
  min-width: 440px;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), padding 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  position: relative;
}

.tbox-drawer.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-left: none !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}

.tbox-drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6), transparent);
}

.tbox-drawer-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.tbox-card-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
}

.tbox-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ---------------- Modal ---------------- */
.tbox-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.tbox-modal {
  width: 680px;
  max-width: 90vw;
  max-height: 85vh;
  background: #0f172a;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tbox-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.tbox-preset-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.tbox-preset-card:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.03);
}

/* ---------------- Floating Docked Tab for Re-opening Left Groups Sidebar ---------------- */
.sidebar-docked-tab {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 45;
  background: #0b1324;
  border: 1px solid #a855f7;
  border-left: none;
  color: #c084fc;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 12px 7px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-docked-tab:hover {
  background: #7e22ce;
  color: #ffffff;
  padding-right: 11px;
  box-shadow: 6px 0 20px rgba(168, 85, 247, 0.4);
}

/* ---------------- Left Groups Sidebar ---------------- */
.tbox-sidebar {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
  background: rgba(13, 20, 36, 0.98);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), padding 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  position: relative;
}

.tbox-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-right: none !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}

.tbox-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tbox-sidebar-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tbox-sidebar-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

.tbox-sidebar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tbox-sidebar-search-wrap .search-icon {
  position: absolute;
  left: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  pointer-events: none;
}

.tbox-sidebar-search-wrap .search-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-medium);
  color: #f8fafc;
  border-radius: 6px;
  padding: 5px 8px 5px 26px;
  font-size: 0.72rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.tbox-sidebar-search-wrap .search-input:focus {
  border-color: #a855f7;
}

.tbox-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tbox-sidebar-all-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tbox-sidebar-all-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.tbox-sidebar-all-item.active {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.4);
}

.tbox-domain-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tbox-domain-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.15s ease;
}

.tbox-domain-group-title:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tbox-domain-group-title.active {
  background: rgba(255, 255, 255, 0.08);
  outline: 1px solid rgba(255, 255, 255, 0.16);
}

.tbox-domain-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.tbox-domain-badge-pill {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid;
}

.tbox-domain-classes-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 6px;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
  margin-left: 4px;
}

.tbox-class-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.tbox-class-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.tbox-class-nav-item.active {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-cyan);
  font-weight: 600;
}

.tbox-class-nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 175px;
}

.tbox-class-nav-tier {
  font-size: 0.58rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  opacity: 0.75;
}

