/* ═══════════════════════════════════════════════════════════
   StreamPortal 2.0 - Components
   Modals, toasts, action menus, form extensions
   ═══════════════════════════════════════════════════════════ */

/* ─── Modal Overlay ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Modal Box ─────────────────────────────────────────── */
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform 200ms ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-color);
}

/* ─── Form Extensions ───────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-blue);
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Toast Notifications ───────────────────────────────── */
.toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform 300ms ease, opacity 300ms ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.success .toast-icon {
  color: var(--neon-green);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast.error .toast-icon {
  color: var(--neon-red);
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Action Buttons in Tables ──────────────────────────── */
.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--neon-blue);
}

.btn-icon.danger:hover {
  border-color: var(--neon-red);
  color: var(--neon-red);
}

/* ─── Detail Panels (Node Detail) ───────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
}

.detail-value.mono {
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* ─── Confirmation Modal ────────────────────────────────── */
.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 0;
}

.confirm-warning {
  font-size: 13px;
  color: var(--neon-orange);
  margin-top: 8px;
}

/* ─── Badge Variants ────────────────────────────────────── */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.super-admin {
  background: rgba(139, 92, 246, 0.15);
  color: var(--neon-purple);
}

.role-badge.admin {
  background: rgba(59, 130, 246, 0.15);
  color: var(--neon-blue);
}

.role-badge.operator {
  background: rgba(16, 185, 129, 0.15);
  color: var(--neon-green);
}

.role-badge.viewer {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

/* ─── Loading Spinner ───────────────────────────────────── */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── Responsive Modal ──────────────────────────────────── */
/* Modal & form responsive rules → see responsive.css */

/* ─── Node Card Extensions ──────────────────────────────── */
.node-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.node-heartbeat {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Table Cell Utilities ──────────────────────────────── */
.mono-cell {
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.truncate-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-muted {
  color: var(--text-muted);
}

.card-mb {
  margin-bottom: 24px;
}

/* ─── MFA Setup ─────────────────────────────────────────── */
.mfa-state {
  padding: 4px 0;
}

.mfa-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.mfa-qr-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
  width: fit-content;
  margin: 0 auto 16px;
}

.mfa-qr-image {
  width: 200px;
  height: 200px;
}

.mfa-secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.mfa-secret-code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: var(--bg-input);
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--neon-cyan);
  letter-spacing: 1px;
  user-select: all;
}

.mfa-setup-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* ─── Header Extensions ─────────────────────────────────── */
.user-role-label {
  color: var(--text-muted);
  font-size: 11px;
}

/* ─── Lane Claims ───────────────────────────────────────── */
.claims-list {
  margin-bottom: 20px;
  min-height: 40px;
}

.claim-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 13px;
}

.claim-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.claim-lane {
  font-weight: 600;
  color: var(--neon-cyan);
  min-width: 60px;
}

.claim-node {
  color: var(--text-secondary);
}

.claim-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

.claims-add-section {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ─── Remote Command Panel ──────────────────────────────── */
.command-presets {
  margin-bottom: 8px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.command-input-field {
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.command-output-wrapper {
  margin-top: 12px;
}

.command-output {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #c9d1d9;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.command-output .cmd-error {
  color: var(--neon-red);
}

/* ═══════════════════════════════════════════════════════════
   Public Stream Viewer
   ═══════════════════════════════════════════════════════════ */
.public-page {
  background: #050810;
  min-height: 100vh;
}

.public-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
}

.public-header {
  text-align: center;
  margin-bottom: 48px;
}

.public-brand {
  font-size: 32px;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: -0.5px;
}

.public-tagline {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 15px;
}

.public-footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.public-admin-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.public-admin-link:hover {
  opacity: 1;
}

/* ─── Event Card ────────────────────────────────────────── */
.stream-event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.stream-event-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stream-event-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.stream-event-venue {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stream-no-lanes {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

/* ─── Event Banner ───────────────────────────────────────── */
.stream-event-banner {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
}

.stream-banner-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* ─── Lane Stream Grid ──────────────────────────────────── */
.stream-lanes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.stream-lane-card {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ─── Video Player ──────────────────────────────────────── */
.stream-player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  overflow: hidden;
}

.stream-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.stream-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.stream-waiting-icon {
  font-size: 40px;
  color: var(--text-muted);
  margin-bottom: 8px;
  animation: pulse 2s ease-in-out infinite;
}

.stream-waiting-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Video Player Controls ─────────────────────────────── */
.stream-controls {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 5;
}

.stream-player-wrapper:hover .stream-controls {
  opacity: 1;
}

.stream-ctrl-btn {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e2e8f0;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, border-color 150ms ease;
  padding: 0;
  line-height: 1;
}

.stream-ctrl-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ─── Fullscreen Mode ───────────────────────────────────── */
.stream-lane-card.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  border-radius: 0;
  border: none;
}

.stream-lane-card.is-fullscreen .stream-player-wrapper {
  padding-top: 0;
  height: 100vh;
}

.stream-lane-card.is-fullscreen .stream-video {
  object-fit: contain;
}

.stream-lane-card.is-fullscreen .stream-lane-info {
  display: none;
}

.stream-lane-card.is-fullscreen .stream-controls {
  opacity: 0;
}

.stream-lane-card.is-fullscreen:hover .stream-controls {
  opacity: 1;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ─── Lane Info Bar ─────────────────────────────────────── */
.stream-lane-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.stream-lane-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--neon-cyan);
}

.stream-node-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Empty State ───────────────────────────────────────── */
.stream-empty-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 60px 24px;
}

.stream-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.stream-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.stream-empty-sub {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 14px;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .stream-lanes-grid {
    grid-template-columns: 1fr;
  }

  .public-brand {
    font-size: 24px;
  }

  .stream-banner-img {
    max-height: 140px;
  }

  .stream-controls {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════
   Recordings Browser
   ═══════════════════════════════════════════════════════════ */

/* ─── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  padding: 16px 20px;
}

.filter-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  min-width: 140px;
}

.filter-group-grow {
  flex: 1;
  min-width: 180px;
}

.filter-group-count {
  min-width: auto;
  align-self: center;
  padding-bottom: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.filter-group .form-label {
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Thumbnail Column ──────────────────────────────────── */
.th-thumb {
  width: 80px;
}

.th-check {
  width: 36px;
  text-align: center;
}

.td-check {
  text-align: center;
}

.td-thumb {
  padding: 4px 8px;
}

.rec-thumb {
  width: 72px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-thumb.thumb-missing {
  background: #1a1f2e;
}

.rec-thumb.thumb-missing::after {
  content: '\1F3AC';
  font-size: 18px;
  opacity: 0.3;
}

.rec-thumb.thumb-missing img {
  display: none;
}

/* ─── Filename Link ─────────────────────────────────────── */
.rec-filename-cell {
  max-width: 260px;
}

.rec-filename-link {
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: left;
  word-break: break-all;
  line-height: 1.3;
  transition: color var(--transition);
}

.rec-filename-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ─── YouTube Status Badges ─────────────────────────────── */
.yt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  text-decoration: none;
}

.yt-badge.uploaded {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.yt-badge.uploading {
  background: rgba(59, 130, 246, 0.15);
  color: var(--neon-blue);
  width: auto;
  border-radius: 12px;
  padding: 0 8px;
  font-weight: 600;
}

.yt-badge.queued {
  background: rgba(245, 158, 11, 0.15);
  color: var(--neon-orange);
}

.yt-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--neon-red, #ef4444);
}

/* ─── Recording Detail Preview ──────────────────────────── */
.rec-preview-container {
  margin-bottom: 16px;
  text-align: center;
}

.rec-preview-img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

/* ─── Section Actions (header buttons) ──────────────────── */
.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Recordings responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .filter-row {
    flex-direction: column;
    gap: 10px;
  }

  .filter-group,
  .filter-group-grow {
    min-width: 100%;
  }

  .th-thumb,
  .td-thumb {
    display: none;
  }

  .rec-filename-cell {
    max-width: 160px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Utility Classes (replaces inline styles)
   ═══════════════════════════════════════════════════════════ */

/* ─── Visibility ────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ─── Modal Size Variants ───────────────────────────────── */
.modal-sm,
.modal-narrow {
  max-width: 400px;
}

.modal-md,
.modal-medium {
  max-width: 600px;
}

.modal-wide {
  max-width: 700px;
}

/* ─── Spacing Utilities ─────────────────────────────────── */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin-bottom: 24px; }

/* ─── Width Utilities ───────────────────────────────────── */
.max-w-280 { max-width: 280px; }
.max-w-320 { max-width: 320px; }

/* ─── Text Utilities ────────────────────────────────────── */
.text-center { text-align: center; }

/* ─── Button Utilities ──────────────────────────────────── */
.btn-block {
  width: 100%;
}

/* ─── Upload Filename Label ─────────────────────────────── */
.upload-filename-label {
  margin-bottom: 12px;
}

/* ─── Error Page ────────────────────────────────────────── */
.error-code {
  font-size: 64px;
  font-weight: 700;
  color: var(--neon-blue);
  line-height: 1;
}

.error-title {
  font-size: 18px;
  font-weight: 600;
  margin-top: 12px;
  color: var(--text-primary);
}

.error-message {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 14px;
}

/* ─── Auth Page Extras ──────────────────────────────────── */
.auth-back-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--text-primary);
}

.auth-footer-link {
  text-align: center;
  margin-top: 16px;
}

.auth-submit-btn {
  width: 100%;
  margin-top: 8px;
}

/* ─── Error Page ────────────────────────────────────────── */
.error-card {
  text-align: center;
}

.error-home-btn {
  margin-top: 24px;
  display: inline-block;
}

/* ─── Form Spacing Extras ───────────────────────────────── */
.form-group-mt {
  margin-top: 16px;
}

.form-label-mt {
  margin-top: 16px;
}

/* ─── Breadcrumb ────────────────────────────────────────── */
.section-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--neon-blue);
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 16px;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-muted {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--neon-blue);
}

/* ─── Tab Navigation ────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--neon-blue);
  border-bottom-color: var(--neon-blue);
}

.tab-content {
  display: none;
}

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

/* ─── Lane Pairs Grid ───────────────────────────────────── */
.lane-pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.lane-pair-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color var(--transition);
}

.lane-pair-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.lane-pair-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lane-pair-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--neon-cyan);
}

.lane-pair-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 100px;
}

.lane-pair-status.configured {
  background: rgba(16, 185, 129, 0.15);
  color: var(--neon-green);
}

.lane-pair-status.unconfigured {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.lane-pair-summary {
  margin-bottom: 10px;
}

.lane-pair-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-secondary);
}

.lane-pair-detail .detail-label {
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
}

.lane-pair-detail .detail-value {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── Form Body (used in tab content) ───────────────────── */
.form-body {
  padding: 4px 0;
}

.form-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--neon-cyan);
  margin-top: 20px;
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ─── DHCP Reservations Grid ────────────────────────────── */
.reservations-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.reservation-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
}

.reservation-row .form-input[readonly] {
  background: rgba(100, 116, 139, 0.08);
  color: var(--text-muted);
  cursor: default;
}

/* ─── Table Link ────────────────────────────────────────── */
.table-link {
  color: var(--neon-cyan);
  text-decoration: none;
}

.table-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ─── Monospace Text ────────────────────────────────────── */
.mono-text {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── CUP/TEAM Status Badges ───────────────────────────── */
.status-badge.cup {
  background: rgba(245, 158, 11, 0.15);
  color: var(--neon-orange);
}

.status-badge.team {
  background: rgba(139, 92, 246, 0.15);
  color: var(--neon-purple);
}

/* ─── Responsive Venue Detail ───────────────────────────── */
@media (max-width: 768px) {
  .lane-pairs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reservation-row {
    grid-template-columns: 1fr;
  }

  .section-breadcrumb {
    flex-wrap: wrap;
  }

  .section-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .lane-pairs-grid {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    overflow-x: auto;
  }
}

/* ─── Detail Value Variants ─────────────────────────────── */
.detail-value-error {
  color: var(--neon-red);
}

.detail-value-link {
  color: var(--neon-cyan);
  text-decoration: none;
}

.detail-value-link:hover {
  text-decoration: underline;
}

/* ─── Form Hints ────────────────────────────────────────── */
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ─── Audio Stream Items ────────────────────────────────── */
.audio-stream-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.audio-stream-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.audio-stream-row .btn-remove-audio {
  flex-shrink: 0;
  padding: 0.35rem 0.6rem;
}

.audio-stream-label {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.btn-remove-audio {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* ─── File Upload Row ───────────────────────────────────── */
.file-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.file-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.file-upload-hint {
  display: block;
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.banner-preview {
  max-width: 120px;
  max-height: 60px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  object-fit: contain;
}

.lanedraw-status {
  font-size: 12px;
  color: var(--neon-green);
}

.lanedraw-status.has-data {
  color: var(--neon-green);
}

.lanedraw-status.empty {
  color: var(--text-muted);
}

/* ─── Lane Config Cards ─────────────────────────────────── */
.lane-config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lane-config-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
}

.lane-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lane-config-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.lane-config-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.lane-config-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lane-config-fields .form-group {
  margin-bottom: 0;
}

.lane-config-fields .form-label {
  font-size: 11px;
  margin-bottom: 4px;
}

.lane-config-fields .form-input {
  font-size: 12px;
  padding: 5px 8px;
}

.lane-config-card.disabled .lane-config-fields {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Sync Progress ───────────────────────────────────── */
.sync-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 10px;
}
.sync-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--surface, #2a2d35);
  border-radius: 4px;
  overflow: hidden;
}
.sync-progress-fill {
  height: 100%;
  background: var(--accent, #4a9eff);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}
.sync-progress-fill.complete {
  background: var(--success, #22c55e);
}
.sync-progress-fill.error {
  background: var(--danger, #ef4444);
}
.sync-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  white-space: nowrap;
  min-width: 120px;
}

/* ── Event Ads List ──────────────────────────────────── */
.event-ads-list {
  margin-bottom: 16px;
}
.event-ad-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface, #2a2d35);
  border-radius: 6px;
  margin-bottom: 6px;
}
.event-ad-info {
  flex: 1;
}
.event-ad-name {
  font-weight: 600;
  color: var(--text, #e0e0e0);
}
.event-ad-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
}
.event-ad-priority {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent, #4a9eff);
  color: #fff;
}
.event-ad-synced {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--success, #22c55e);
  color: #fff;
}
.event-ad-unsynced {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--warning, #f59e0b);
  color: #1a1a1a;
}
.event-ads-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #999);
  font-style: italic;
}
.text-sm {
  font-size: 0.8rem;
}
.ad-file-preview {
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
   Advertisement Library
   ═══════════════════════════════════════════════════════════ */

/* ─── Thumbnail column ──────────────────────────────────── */
.col-thumb {
  width: 80px;
  padding: 6px 8px;
}

.ad-thumb {
  width: 72px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  display: block;
}

.ad-thumb-video {
  width: 72px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 20px;
  color: var(--text-muted);
}

/* ─── Upload preview ────────────────────────────────────── */
.ad-thumb-lg {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-top: 10px;
  display: block;
}

.ad-thumb-video-lg {
  margin-top: 10px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* ─── Upload progress ───────────────────────────────────── */
.upload-progress-bar-bg {
  background: var(--bg-input);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.upload-progress-bar {
  height: 100%;
  background: var(--neon-blue, #3b82f6);
  border-radius: 4px;
  width: 0%;
  transition: width 0.2s ease;
}

.upload-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* ─── Ad type badges ────────────────────────────────────── */
.status-badge.image {
  background: rgba(59, 130, 246, 0.15);
  color: var(--neon-blue, #3b82f6);
}

.status-badge.video {
  background: rgba(139, 92, 246, 0.15);
  color: var(--neon-purple, #8b5cf6);
}

/* Spacing when stats grid follows detail grid inside a card */
.detail-grid + .stats-grid {
  margin-top: 16px;
}

/* ═══════════════════════════════════════════════════════
   OBS Lane Status Grid (per-node, in node badges)
   ═══════════════════════════════════════════════════════ */
.node-obs-lanes {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.obs-lane-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.obs-lane-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.obs-lane-name {
  color: var(--text-secondary);
  min-width: 70px;
}

.obs-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.obs-dot-closed {
  background-color: #f44336;
}

.obs-dot-open {
  background-color: #ffc107;
}

.obs-dot-streaming {
  background-color: #4caf50;
  animation: obs-pulse 1.5s ease-in-out infinite;
}

@keyframes obs-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-obs-remote {
  padding: 2px 8px;
  border: none;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background-color: #607d8b;
  color: #fff;
  transition: background-color 0.2s;
}

.btn-obs-remote:hover {
  background-color: #455a64;
}

.btn-obs-remote.is-open {
  background-color: #4caf50;
}

.btn-obs-remote.is-open:hover {
  background-color: #388e3c;
}

.btn-obs-remote:disabled {
  background-color: #555;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Go-Live Progress */
.go-live-progress {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary, #1e1e2e);
  border-radius: 6px;
  border: 1px solid var(--border-color, #333);
}
.go-live-progress-steps {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary, #aaa);
}
.go-live-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.go-live-step-icon {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.go-live-step.pending .go-live-step-icon { color: var(--text-muted, #666); }
.go-live-step.running .go-live-step-icon { color: var(--accent-amber, #f59e0b); }
.go-live-step.done .go-live-step-icon { color: var(--accent-green, #22c55e); }
.go-live-step.error .go-live-step-icon { color: var(--accent-red, #ef4444); }

/* Utility: hidden by default - toggled by JS */
.hidden {
  display: none;
}

/* ─── Device Enumeration ──────────────────────────── */
.btn-refresh-devices {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  vertical-align: middle;
}
.btn-refresh-devices:hover {
  color: var(--accent-hover, #6ee7b7);
}
.btn-refresh-devices.spinning {
  animation: spin-refresh 0.8s linear infinite;
}
@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.device-no-node {
  color: var(--text-muted, #888);
  font-size: 0.85rem;
  padding: 0.25rem 0;
}
.node-selector {
  background: var(--bg-input, #1a1a2e);
  color: var(--text-primary, #e0e0e0);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: var(--radius, 6px);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.node-selector:focus {
  outline: none;
  border-color: var(--neon-cyan, #00d4ff);
}
