/* ═══════════════════════════════════════════════════════════════════════════
   LaPiCam Admin PWA — Styles
   Dark glassmorphism, electric cyan accent, micro-animations
   Font: Inter (UI) + JetBrains Mono (data)
═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg-base:       #060818;
  --bg-deep:       #030510;
  --bg-surface:    rgba(255, 255, 255, 0.04);
  --bg-surface-h:  rgba(255, 255, 255, 0.07);

  --accent:        #00d4ff;
  --accent-glow:   rgba(0, 212, 255, 0.25);
  --accent-dim:    rgba(0, 212, 255, 0.12);

  --success:       #00ff88;
  --success-glow:  rgba(0, 255, 136, 0.2);

  --danger:        #ff4757;
  --danger-glow:   rgba(255, 71, 87, 0.2);

  --warn:          #ffa502;
  --warn-glow:     rgba(255, 165, 2, 0.2);

  --purple:        #a855f7;
  --purple-glow:   rgba(168, 85, 247, 0.2);

  --text-primary:  #e0e6ff;
  --text-sec:      rgba(224, 230, 255, 0.55);
  --text-dim:      rgba(224, 230, 255, 0.3);

  --border:        rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 212, 255, 0.3);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --blur-sm: blur(12px);
  --blur-md: blur(20px);

  --nav-h: 60px;
  --bar-h: 80px;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Screen visibility ────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.screen.active {
  display: flex;
  opacity: 1;
}

/* ── Glass card ───────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.glass-nav {
  background: rgba(6, 8, 24, 0.85);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════ */
#login-screen {
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  overflow: hidden;
}

/* Animated background orbs */
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}
.login-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,212,255,0.15), transparent 70%);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.login-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,255,136,0.1), transparent 70%);
  bottom: -100px; right: -100px;
  animation-delay: -3s;
}
.login-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(168,85,247,0.1), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -6s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

/* Login card */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 36px;
  border: 1px solid var(--border-accent);
  box-shadow:
    0 0 60px rgba(0,212,255,0.08),
    0 32px 80px rgba(0,0,0,0.6);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0,212,255,0.4)); }
  50%       { filter: drop-shadow(0 0 20px rgba(0,212,255,0.8)); }
}
.login-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.login-subtitle {
  color: var(--text-sec);
  font-size: 13px;
  margin-top: 4px;
}

/* Login error */
.login-error {
  background: rgba(255, 71, 87, 0.12);
  border: 1px solid rgba(255, 71, 87, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

/* Input group */
.input-group {
  margin-bottom: 16px;
}
.input-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sec);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.input-wrapper {
  position: relative;
}
.text-input {
  width: 100%;
  padding: 13px 44px 13px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
  transition: var(--transition);
  outline: none;
}
.text-input:focus {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.05);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.text-input::placeholder {
  color: var(--text-dim);
  font-family: "Inter", sans-serif;
  letter-spacing: 0;
}
.input-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
}
.input-eye:hover { color: var(--accent); }
.input-eye svg { width: 16px; height: 16px; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0088cc);
  color: #000;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 212, 255, 0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-glass {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-glass:hover {
  background: var(--bg-surface-h);
  border-color: var(--border-accent);
}

.btn-full { width: 100%; }

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-family: "Inter", sans-serif;
  text-align: center;
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-text:hover { background: var(--accent-dim); }

.btn-text-sm {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  font-family: "Inter", sans-serif;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}
.btn-text-sm:hover { color: var(--danger); }

/* ═══════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════ */
#dashboard {
  flex-direction: column;
  height: 100dvh;
}

/* Navbar */
.navbar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}
.nav-right { justify-content: flex-end; }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-logo-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.6; }
}

/* Live badge */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid rgba(255, 71, 87, 0.35);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.4s;
}
.live-badge.visible { opacity: 1; }
.live-dot {
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Status pills */
.status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
  transition: var(--transition);
}
.status-pill .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-online {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.3);
  color: var(--success);
}
.status-online .status-dot { background: var(--success); }
.status-offline {
  background: rgba(255,71,87,0.1);
  border-color: rgba(255,71,87,0.25);
  color: var(--danger);
}
.status-offline .status-dot { background: var(--danger); }
.status-connecting {
  background: rgba(255,165,2,0.1);
  border-color: rgba(255,165,2,0.3);
  color: var(--warn);
}
.status-connecting .status-dot {
  background: var(--warn);
  animation: blink 0.8s ease-in-out infinite;
}

/* Icon button */
.icon-btn {
  background: none;
  border: none;
  color: var(--text-sec);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bg-surface-h); color: var(--text-primary); }

/* Main content */
.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 12px;
  padding: 12px 12px 0;
  overflow: hidden;
  min-height: 0;
}

/* Video panel */
.video-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.video-container {
  position: relative;
  flex: 1;
  background: #010208;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  min-height: 0;
}

.video-feed {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Offline state */
.video-overlay-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(ellipse at center, rgba(255,71,87,0.05) 0%, transparent 70%);
}
.offline-icon svg { width: 80px; height: 80px; }
.offline-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-sec);
}
.offline-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* Video overlays */
.video-overlay-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}
.video-ts {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}
.video-resolution {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* Stream paused overlay */
.stream-paused-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,8,24,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  backdrop-filter: blur(4px);
}
.paused-icon { font-size: 48px; }
.stream-paused-overlay p {
  color: var(--warn);
  font-size: 16px;
  font-weight: 600;
}

/* Floating buttons on video */
.fullscreen-btn, .snapshot-btn {
  position: absolute;
  bottom: 12px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}
.fullscreen-btn { right: 12px; }
.fullscreen-btn svg, .snapshot-btn svg { width: 16px; height: 16px; }
.snapshot-btn { right: 56px; }
.fullscreen-btn:hover, .snapshot-btn:hover {
  background: rgba(0,212,255,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Stats bar */
.stats-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.stat {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
}
.stat-sep { color: var(--border); }

/* ── Side Panel ────────────────────────────────────────────────────────── */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  min-height: 0;
}

.panel-section {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}

.panel-section:first-child { flex: 1; min-height: 0; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.panel-title svg { width: 14px; height: 14px; }

/* Notification badge row */
.notif-badge-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.notif-count {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--warn-glow);
  color: var(--warn);
  border: 1px solid rgba(255,165,2,0.25);
  font-weight: 600;
}
.notif-count.notif-sound {
  background: var(--purple-glow);
  color: var(--purple);
  border-color: rgba(168,85,247,0.25);
}

/* Notification list */
.notif-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.notif-empty {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  padding: 24px 0;
}

/* Notification item */
.notif-item {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.notif-motion {
  background: rgba(255,165,2,0.08);
  border-color: rgba(255,165,2,0.2);
}
.notif-sound {
  background: rgba(168,85,247,0.08);
  border-color: rgba(168,85,247,0.2);
}
.notif-system {
  background: rgba(0,212,255,0.06);
  border-color: rgba(0,212,255,0.15);
}
.notif-icon {
  font-size: 15px;
  flex-shrink: 0;
  line-height: 1.4;
}
.notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notif-msg {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-dim);
}

/* Info card */
.info-card { flex-shrink: 0; }
.info-rows { display: flex; flex-direction: column; gap: 6px; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.info-key {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.info-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-sec);
}

/* ── Control Bar ───────────────────────────────────────────────────────── */
.control-bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.ctrl-group {
  flex: 1;
  max-width: 110px;
}

.ctrl-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
  font-size: 10px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ctrl-btn svg { width: 20px; height: 20px; }
.ctrl-btn:hover {
  background: var(--bg-surface-h);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.ctrl-btn:active { transform: translateY(0); }

/* Talk button (accent color, hold to talk) */
.ctrl-talk {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.25);
  color: var(--accent);
}
.ctrl-talk:hover, .ctrl-talk.active {
  background: rgba(0,212,255,0.2);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  color: var(--accent);
}
.ctrl-talk.active { animation: talk-pulse 0.8s ease-in-out infinite; }
@keyframes talk-pulse {
  0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
  50%       { box-shadow: 0 0 30px rgba(0,212,255,0.5); }
}

/* Lock button (danger color) */
.ctrl-lock:hover, .ctrl-lock.pressed {
  background: rgba(255,71,87,0.15);
  border-color: rgba(255,71,87,0.35);
  color: var(--danger);
}

/* Stream toggle */
.ctrl-stream.paused {
  background: rgba(255,165,2,0.1);
  border-color: rgba(255,165,2,0.3);
  color: var(--warn);
}

/* Connect button */
.ctrl-connect {
  background: rgba(0,255,136,0.08);
  border-color: rgba(0,255,136,0.2);
  color: var(--success);
}
.ctrl-connect:hover {
  background: rgba(0,255,136,0.15);
  border-color: rgba(0,255,136,0.4);
}

/* ── Toast Notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid;
  animation: toast-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  max-width: 320px;
}
.toast-motion {
  background: rgba(255,165,2,0.15);
  border-color: rgba(255,165,2,0.4);
  color: var(--warn);
}
.toast-sound {
  background: rgba(168,85,247,0.15);
  border-color: rgba(168,85,247,0.4);
  color: var(--purple);
}
.toast-info {
  background: rgba(0,212,255,0.12);
  border-color: rgba(0,212,255,0.35);
  color: var(--accent);
}
.toast-success {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.3);
  color: var(--success);
}
.toast-error {
  background: rgba(255,71,87,0.12);
  border-color: rgba(255,71,87,0.35);
  color: var(--danger);
}
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-out {
  animation: toast-out 0.3s ease forwards;
}
@keyframes toast-out {
  to { transform: translateX(110%); opacity: 0; }
}

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

/* ── Recordings list ────────────────────────────────────────────────────── */
.rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.rec-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.rec-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.rec-label {
  font-size: 12px;
  color: var(--text-primary);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-dim);
}
.rec-download-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
}
.rec-download-btn:hover { color: var(--accent); border-color: var(--border-accent); }
.rec-download-btn svg { width: 16px; height: 16px; }

/* ── Quality selector ───────────────────────────────────────────────────── */
.quality-group {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
}
.quality-btn {
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.quality-btn:hover { color: var(--text-primary); }
.quality-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Settings modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 16, 0.7);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Responsive: Mobile / Phone ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding: 8px 8px 0;
    gap: 8px;
  }

  .side-panel {
    flex-direction: row;
    overflow-x: auto;
    max-height: 200px;
    flex-shrink: 0;
    min-height: unset;
  }

  .panel-section { flex: 0 0 260px; min-height: unset; }
  .panel-section:first-child { flex: 0 0 280px; }

  .video-panel { min-height: 200px; }

  .control-bar { gap: 4px; padding: 0 8px; }
  .ctrl-group { max-width: none; }
  .ctrl-btn { padding: 8px 4px; font-size: 9px; }
  .ctrl-btn svg { width: 18px; height: 18px; }

  .nav-right .status-pill { display: none; }
  #client-status { display: flex !important; }

  .login-card { margin: 16px; padding: 28px 22px; }
}

@media (max-width: 420px) {
  .side-panel { display: none; }
  :root { --bar-h: 70px; }
}

/* ── Fullscreen video ────────────────────────────────────────────────────── */
#video-container:fullscreen,
#video-container:-webkit-full-screen {
  background: #000;
}
#video-container:fullscreen .video-feed,
#video-container:-webkit-full-screen .video-feed {
  object-fit: contain;
}
