/* === Sidebar & Main Layout === */
#app-screen {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}

.logo-small { font-size: 24px; }

.sidebar-title {
  font-weight: 700;
  font-size: 18px;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-details { display: none; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: rgba(99, 102, 241, 0.15); color: var(--primary); }

.nav-icon { font-size: 18px; min-width: 24px; text-align: center; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 14px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 4px 14px;
  letter-spacing: 1px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  min-width: 34px;
}

.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-dim); text-transform: capitalize; }

.user-details { display: flex; flex-direction: column; overflow: hidden; }

/* === Main Content === */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-left h2 { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background .3s, box-shadow .3s;
}

.live-indicator.is-live .live-dot {
  background: var(--success);
  animation: pulse 2s infinite;
  box-shadow: 0 0 6px var(--success);
}

.live-indicator.is-offline .live-dot {
  background: var(--text-muted);
  animation: none;
  box-shadow: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.station-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.on-air-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #f59e0b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-width: 0;
}

/* === Page Sections === */
.page-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 200;
    transition: left 0.3s ease;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }
  .sidebar.collapsed { width: var(--sidebar-width); min-width: var(--sidebar-width); }
  .sidebar.open { left: 0; }
  .topbar { padding: 0 16px; }
  .page-container { padding: 16px; }
  .topbar-mobile-toggle { display: block; }
}

/* Mobile hamburger in topbar (hidden on desktop) */
.topbar-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 12px;
  border-radius: var(--radius);
}
.topbar-mobile-toggle:hover { background: var(--surface-2); }

.topbar-left {
  display: flex;
  align-items: center;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }
