/* ============================================================
   PIPERNET STUDIO // WORKBENCH LAYOUT & STRUCTURAL COMPONENTS
   Sidebar (280px), Sticky Topbar (56px), Telemetry HUD, Buttons
   ============================================================ */

.studio-layout {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  background: var(--void);
  overflow: hidden;
}

/* ==========================================
   LEFT SIDEBAR (280px Enterprise Fixed Dock)
   ========================================== */
.studio-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  z-index: 100;
  user-select: none;
}

.sidebar-top {
  padding: 12px 14px 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-group {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-logo-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-brand-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-subtitle-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--platinum-muted);
  padding: 0 4px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.sidebar-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}

.sidebar-badges-row .pill-tag {
  font-size: 9px;
  padding: 1px 5px;
}

/* Sidebar Navigation Menu */
.sidebar-nav-section {
  padding: 10px 8px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--platinum-muted);
  padding: 8px 8px 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--platinum-body);
  background: transparent;
  border: 1px solid transparent;
  border-left: 2.5px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  width: 100%;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: var(--card);
  color: var(--platinum-high);
  border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.14);
  border-left: 2.5px solid #ffffff;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 7.5px;
  min-width: 0;
  overflow: hidden;
}

.nav-icon {
  width: 13.5px;
  height: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--platinum-muted);
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-nav-item:hover .nav-icon,
.sidebar-nav-item.active .nav-icon {
  color: #ffffff;
}

.nav-item-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  color: var(--platinum-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  line-height: 1.3;
}

.sidebar-nav-item.active .nav-badge {
  background: #ffffff;
  color: #000000;
  font-weight: 800;
  border-color: #ffffff;
}

/* Sidebar Footer Operations */
.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--sidebar);
}

.sidebar-btn-row {
  display: flex;
  gap: 6px;
}

.sidebar-btn-row .hub-btn {
  flex: 1;
  justify-content: center;
  font-size: 11px;
  height: 28px;
  padding: 0 6px;
}

/* ==========================================
   MAIN CONTENT AREA (Fluid Workbench)
   ========================================== */
.studio-main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--void);
  overflow: hidden;
}

/* Sticky Topbar */
.studio-topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(5, 5, 7, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--platinum-muted);
  white-space: nowrap;
}

.topbar-breadcrumb strong {
  color: var(--platinum-high);
  font-weight: 700;
}

.topbar-center {
  flex: 1;
  max-width: 480px;
}

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

/* Studio Content Body */
.studio-content-body {
  padding: 12px 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ==========================================
   TELEMETRY HUD CARDS
   ========================================== */
.hud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 1200px) {
  .hud-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hud-grid {
    grid-template-columns: 1fr;
  }
}

.hud-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  box-shadow: none !important;
}

.hud-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-accent, #ffffff);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.hud-card:hover {
  border-color: var(--border-medium);
  background: #12121b;
  transform: translateY(-2px);
}

.hud-card:hover::before {
  opacity: 0.9;
}

.hud-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hud-card-index {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--platinum-muted);
}

.hud-card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--platinum-medium);
}

.hud-card-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.hud-big-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--platinum-high);
}

.hud-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  color: var(--platinum-body);
}

.hud-card-footer .dim {
  font-family: var(--font-mono);
  color: var(--platinum-muted);
  font-size: 10.5px;
}

.hud-activity-bar {
  margin-top: 6px;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1px;
  overflow: hidden;
}

.hud-activity-progress {
  height: 100%;
  background: #ffffff;
}

/* ==========================================
   BUTTONS, BADGES & SEARCH BAR
   ========================================== */
.hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--platinum-medium);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: none !important;
}

.hub-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-medium);
  color: #ffffff;
}

.hub-btn-active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
  color: #ffffff;
}

.hub-btn-cyan {
  color: #000000 !important;
  border-color: #ffffff !important;
  background: #ffffff !important;
  font-weight: 700 !important;
}

.hub-btn-cyan:hover {
  background: #e2e8f0 !important;
  border-color: #e2e8f0 !important;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-high {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  border-color: #ffffff;
}

.pill-medium {
  background: rgba(255, 255, 255, 0.08);
  color: var(--platinum-medium);
  border-color: var(--border-subtle);
}

.pill-muted {
  background: transparent;
  color: var(--platinum-muted);
  border-color: var(--border-subtle);
}

/* Global Search Input Field */
.search-field {
  position: relative;
  width: 100%;
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--platinum-dim);
}

.search-field input {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 36px 7px 34px;
  color: var(--platinum-high);
  font-family: var(--font-sans);
  font-size: 12.5px;
  transition: border-color 0.15s ease;
}

.search-field input:focus {
  outline: none;
  border-color: var(--border-strong);
}

.search-field .shortcut-key {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--platinum-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: tabFadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: none !important;
}

.modal-dismiss-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--platinum-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-dismiss-btn:hover {
  color: var(--platinum-high);
}

/* Toast Pill */
.toast-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-sans);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 2000;
  box-shadow: none !important;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 900px) {
  .studio-layout {
    flex-direction: column;
  }
  .studio-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    position: relative;
  }
  .studio-topbar {
    position: relative;
  }
}
