/* =============================================================
   Elegance LIVE – app.css v3
   Design: Clean Professional – topbar verde, sidebar, cards
   ============================================================= */

/* ── Google Fonts import ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand */
  --green:       #1a7a4a;
  --green-d:     #145f39;
  --green-l:     #22a362;
  --green-dim:   rgba(26,122,74,0.10);
  --green-glow:  rgba(26,122,74,0.18);
  /* Neutrals */
  --bg:          #f0f2f5;
  --bg-s:        #ffffff;
  --sidebar-bg:  #ffffff;
  --topbar-bg:   #1a7a4a;
  --text:        #111827;
  --text-s:      #4b5563;
  --text-m:      #9ca3af;
  --border:      #e5e7eb;
  --border-s:    #d1d5db;
  /* Red */
  --red:         #dc2626;
  --red-dim:     rgba(220,38,38,0.09);
  --red-glow:    rgba(220,38,38,0.20);
  /* Radius */
  --r:           8px;
  --r-lg:        12px;
  --r-xl:        16px;
  /* Shadow */
  --shadow:      0 2px 8px rgba(0,0,0,0.06);
  --shadow-m:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-l:    0 8px 32px rgba(0,0,0,0.13);
  /* Transitions */
  --tr:          0.18s cubic-bezier(0.4,0,0.2,1);
  /* Layout */
  --topbar-h:    60px;
  --sidebar-w:   240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--green-l); }
textarea { resize: vertical; }
img { max-width: 100%; }

/* ══════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════ */
.glass-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem; font-weight: 700;
  color: #fff; text-decoration: none; flex-shrink: 0;
  letter-spacing: -0.01em;
}
.topbar-brand-icon {
  width: 32px; height: 32px; border-radius: var(--r);
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}
.topbar-brand span { color: #fff; }
.topbar-brand em { color: #a7f3d0; font-style: normal; }

.topbar-spacer { flex: 1; }

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px; padding: 4px 12px 4px 4px;
  color: #fff; cursor: pointer; font-size: 0.875rem; font-weight: 500;
  transition: background var(--tr);
}
.topbar-user:hover { background: rgba(255,255,255,0.22); }
.topbar-user .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.topbar-hamburger {
  width: 36px; height: 36px; border-radius: var(--r);
  background: rgba(255,255,255,0.15); border: none;
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--tr);
}
.topbar-hamburger:hover { background: rgba(255,255,255,0.25); }

/* Dropdown topbar */
.topbar-dropdown { position: relative; }
.topbar-dropdown .dropdown-menu {
  top: calc(100% + 8px); right: 0; left: auto;
  min-width: 200px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 6px;
  box-shadow: var(--shadow-l);
}
.topbar-dropdown .dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--r);
  color: var(--text-s); font-size: 0.875rem;
  transition: all var(--tr); cursor: pointer;
}
.topbar-dropdown .dropdown-item:hover { background: var(--bg); color: var(--text); }
.topbar-dropdown .dropdown-item.danger:hover { background: var(--red-dim); color: var(--red); }
.topbar-dropdown .dropdown-sep {
  height: 1px; background: var(--border); margin: 4px 0;
}
.topbar-dropdown .dropdown-label {
  padding: 6px 12px; font-size: 0.75rem; color: var(--text-m);
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.glass-sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); z-index: 900;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform var(--tr);
  /* custom scrollbar */
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.glass-sidebar::-webkit-scrollbar { width: 4px; }
.glass-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-m);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 12px 8px 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r);
  color: var(--text-s); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: all var(--tr);
}
.sidebar-link i { font-size: 16px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active {
  background: var(--green-dim); color: var(--green);
  font-weight: 600;
}
.sidebar-link.active i { color: var(--green); }
.sidebar-link-live {
  background: var(--red-dim); color: var(--red) !important;
  font-weight: 600;
}
.sidebar-link-live i { color: var(--red) !important; }
.sidebar-link-live:hover { background: rgba(220,38,38,0.15) !important; }

.sidebar-footer {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
.glass-content {
  margin-top: var(--topbar-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100dvh - var(--topbar-h));
  padding: 28px 28px 48px;
  transition: margin-left var(--tr);
}

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.card-pad { padding: 24px; }
.card-header-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header-row h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); }

/* ══════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════ */
.page-head { margin-bottom: 24px; }
.page-title {
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.page-title i { color: var(--green); }
.page-sub { color: var(--text-m); font-size: 0.875rem; }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff;
  border: none; border-radius: var(--r-lg);
  padding: 10px 20px; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--tr); text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { background: var(--green-d); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px var(--green-glow); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--r-lg);
  padding: 10px 20px; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--tr); text-decoration: none;
}
.btn-danger:hover { background: #b91c1c; color: #fff; transform: translateY(-1px); }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1.5px solid var(--border-s);
  color: var(--text-s); border-radius: var(--r-lg);
  padding: 9px 18px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all var(--tr); text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-outline:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }

.btn-live-big {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--r-xl);
  padding: 13px 28px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all var(--tr); text-decoration: none;
  box-shadow: 0 4px 16px var(--red-glow);
  font-family: 'Inter', sans-serif;
}
.btn-live-big:hover { background: #b91c1c; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px var(--red-glow); }
.btn-live-big:disabled, .btn-live-big.disabled { opacity: 0.45; pointer-events: none; }

.btn-stop {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red-dim); border: 1.5px solid rgba(220,38,38,0.35);
  color: var(--red); border-radius: var(--r-lg);
  padding: 9px 18px; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--tr); font-family: 'Inter', sans-serif;
}
.btn-stop:hover { background: rgba(220,38,38,0.18); border-color: var(--red); }

.btn-icon {
  width: 34px; height: 34px; border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-s); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--tr);
  text-decoration: none; font-size: 15px; flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.btn-icon.danger:hover { border-color: var(--red) !important; color: var(--red) !important; background: var(--red-dim) !important; }

/* Varianta mică pentru tabele */
.btn-icon-sm {
  width: 30px; height: 30px; border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-s); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--tr);
  text-decoration: none; font-size: 13px; flex-shrink: 0;
}
.btn-icon-sm:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.btn-icon-danger:hover { border-color: var(--red) !important; color: var(--red) !important; background: var(--red-dim) !important; }

/* Badge comprimat */
.badge-compressed {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(26,122,74,0.25);
  border-radius: 99px; padding: 7px 14px;
  font-size: 0.82rem; font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════ */
.field-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--text-s); margin-bottom: 6px; letter-spacing: 0.02em;
}
.field-wrap { margin-bottom: 16px; }
.field-icon-wrap { position: relative; }
.field-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-m); pointer-events: none; font-size: 15px;
}
.field-input {
  width: 100%; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--r-lg); color: var(--text);
  padding: 10px 14px 10px 38px;
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
  transition: border-color var(--tr), box-shadow var(--tr); outline: none;
}
textarea.field-input { padding-left: 14px; min-height: 80px; }
.field-input::placeholder { color: var(--text-m); }
.field-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,122,74,0.12);
}

/* ══════════════════════════════════════════════════════════
   AUTH PAGE
══════════════════════════════════════════════════════════ */
.auth-page {
  background: linear-gradient(135deg, #f0f7f3 0%, #e8f4ec 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 2rem 1rem;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand {
  text-align: center; margin-bottom: 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.auth-brand-icon {
  width: 56px; height: 56px; border-radius: var(--r-xl);
  background: var(--green); display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 26px;
  box-shadow: 0 4px 16px var(--green-glow);
}
.auth-brand-name { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.auth-brand-name em { color: var(--green); font-style: normal; }
.auth-tagline { color: var(--text-m); font-size: 0.8rem; }
.auth-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 2rem;
  box-shadow: var(--shadow-l);
}
.auth-title { font-size: 1.35rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-sub   { color: var(--text-m); font-size: 0.875rem; margin-bottom: 1.5rem; }
.auth-switch { color: var(--text-m); text-align: center; font-size: 0.875rem; margin-top: 1.25rem; }
.auth-switch a { color: var(--green); font-weight: 600; }

/* Role cards */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 1rem 0.75rem; border: 1.5px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; text-align: center;
  transition: all var(--tr);
}
.role-card input { display: none; }
.role-card i { font-size: 1.5rem; color: var(--text-m); transition: color var(--tr); }
.role-card strong { font-size: 0.875rem; color: var(--text-s); }
.role-card small { font-size: 0.72rem; color: var(--text-m); line-height: 1.3; }
.role-card.selected, .role-card:hover { border-color: var(--green); background: var(--green-dim); }
.role-card.selected i, .role-card.selected strong { color: var(--green); }

/* ══════════════════════════════════════════════════════════
   HERO / DASHBOARD
══════════════════════════════════════════════════════════ */
.hero-card {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-d) 100%);
  border-radius: var(--r-xl); padding: 28px 32px;
  color: #fff; margin-bottom: 28px;
  box-shadow: 0 4px 20px var(--green-glow);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.hero-card h1 { font-size: 1.6rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.hero-card p { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-top: 4px; }
.hero-greeting { font-size: 0.78rem; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }

/* Stats bar */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.stat-card {
  flex: 1; min-width: 120px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card-icon {
  width: 38px; height: 38px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.stat-card-icon.green { background: var(--green-dim); color: var(--green); }
.stat-card-icon.red   { background: var(--red-dim);   color: var(--red); }
.stat-card-icon.blue  { background: rgba(59,130,246,0.10); color: #3b82f6; }
.stat-val { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-m); margin-top: 2px; }

/* Section headers */
.section-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.section-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-count {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 99px; padding: 2px 10px;
  font-size: 0.75rem; color: var(--text-m); font-weight: 600;
}
.section-link { margin-left: auto; font-size: 0.84rem; color: var(--text-m); display: flex; align-items: center; gap: 4px; }
.section-link:hover { color: var(--green); }

/* ══════════════════════════════════════════════════════════
   STREAM CARDS GRID
══════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 16px;
}
.stream-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column;
  transition: all var(--tr); box-shadow: var(--shadow);
}
.stream-card:hover {
  border-color: var(--green); transform: translateY(-3px); box-shadow: var(--shadow-m);
}
.stream-card-thumb {
  position: relative; aspect-ratio: 16/9;
  background: var(--bg); overflow: hidden;
}
.stream-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.stream-card:hover .stream-card-thumb img { transform: scale(1.04); }
.thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-m); font-size: 2rem;
  background: linear-gradient(135deg, #f0f7f3, #e8f4ec);
}
.badge-live {
  position: absolute; top: 8px; left: 8px;
  display: flex; align-items: center; gap: 5px;
  background: var(--red); color: #fff;
  padding: 3px 9px; border-radius: 99px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
}
.badge-viewers {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.55); color: #fff;
  padding: 3px 8px; border-radius: 99px; font-size: 0.72rem;
}
.badge-dur {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.65); color: #fff;
  padding: 2px 7px; border-radius: var(--r); font-size: 0.7rem;
}
.stream-card-body { padding: 12px 14px; flex: 1; }
.stream-title {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
  margin-bottom: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stream-meta { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-s); margin-bottom: 2px; }
.stream-time { font-size: 0.72rem; color: var(--text-m); }
.av-xs {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-dim); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 700; color: var(--green); flex-shrink: 0;
}
.av-md {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--green-dim); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: var(--green); flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   EMPTY BLOCK
══════════════════════════════════════════════════════════ */
.empty-block {
  text-align: center; padding: 48px 24px; color: var(--text-m);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; border-radius: var(--r-xl);
  border: 1px dashed var(--border-s);
}
.empty-block i { font-size: 2.5rem; opacity: 0.3; color: var(--green); }
.empty-block p { font-size: 0.95rem; }

/* ══════════════════════════════════════════════════════════
   LIVE DOT / PILL
══════════════════════════════════════════════════════════ */
.live-dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 var(--red-glow); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red-dim); border: 1px solid rgba(220,38,38,0.2);
  border-radius: 99px; padding: 3px 10px;
  font-size: 0.72rem; font-weight: 700; color: var(--red); letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--r-xl); box-shadow: var(--shadow); }
.data-tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden;
}
.data-tbl th {
  padding: 12px 16px; background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem; font-weight: 700; color: var(--text-m);
  text-transform: uppercase; letter-spacing: 0.07em; text-align: left;
}
.data-tbl td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.875rem; color: var(--text-s); vertical-align: middle;
}
.data-tbl tr:last-child td { border-bottom: none; }
.data-tbl tbody tr { transition: background var(--tr); }
.data-tbl tbody tr:hover td { background: #f6fbf8; color: var(--text); }
.tbl-media { display: flex; align-items: center; gap: 10px; }
.tbl-thumb {
  width: 58px; height: 36px; border-radius: var(--r);
  background: var(--bg); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-m); font-size: 1rem; border: 1px solid var(--border);
}
.tbl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tbl-title { font-size: 0.875rem; font-weight: 600; color: var(--text); margin: 0; }

/* ══════════════════════════════════════════════════════════
   VIDEO WRAP
══════════════════════════════════════════════════════════ */
.video-wrap {
  position: relative; aspect-ratio: 16/9;
  background: #000; border-radius: var(--r-xl);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-m);
}
.video-el {
  width: 100%; height: 100%; object-fit: cover; display: block;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: optimizeQuality;
}
.video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: #fff; text-align: center; padding: 1rem;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}
.video-placeholder i { font-size: 2.8rem; opacity: 0.4; }
.video-placeholder p  { font-size: 0.95rem; }
.video-placeholder small { font-size: 0.8rem; opacity: 0.6; }
.video-rec-badge {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 6px;
  background: var(--red); color: #fff;
  padding: 5px 12px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
}
.video-viewers {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.6); color: #fff;
  padding: 5px 12px; border-radius: 99px; font-size: 0.8rem;
  backdrop-filter: blur(4px);
}
.btn-fullscreen {
  position: absolute; bottom: 12px; right: 12px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.55); border: none; border-radius: var(--r);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--tr); z-index: 10;
  font-size: 16px; opacity: 0.7;
}
.btn-fullscreen:hover { background: rgba(0,0,0,0.85); opacity: 1; }
.video-wrap:hover .btn-fullscreen { opacity: 1; }
:fullscreen .video-wrap, :-webkit-full-screen .video-wrap { border-radius: 0; border: none; aspect-ratio: unset; width: 100vw; height: 100vh; }
:fullscreen #liveVideo, :-webkit-full-screen #liveVideo { width: 100vw; height: 100vh; object-fit: contain; }
:fullscreen .live-controls-overlay, :-webkit-full-screen .live-controls-overlay { display: flex !important; }
.live-controls-overlay {
  display: none; position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  flex-direction: row; align-items: center; gap: 12px; z-index: 20;
}

/* ══════════════════════════════════════════════════════════
   SETUP / LIVE PAGE
══════════════════════════════════════════════════════════ */
.setup-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 24px; height: 100%;
  box-shadow: var(--shadow);
}
.setup-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.setup-hint  { font-size: 0.78rem; color: var(--text-m); }
.quality-row { display: flex; gap: 6px; flex-wrap: wrap; }
.quality-opt {
  flex: 1; min-width: 56px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 9px 4px;
  border: 1.5px solid var(--border); border-radius: var(--r);
  cursor: pointer; text-align: center; font-size: 0.82rem;
  font-weight: 600; color: var(--text-s); transition: all var(--tr);
}
.quality-opt input { display: none; }
.quality-opt small { font-size: 0.66rem; font-weight: 400; color: var(--text-m); }
.quality-opt.selected, .quality-opt:has(input:checked) {
  border-color: var(--green); background: var(--green-dim); color: var(--green);
}
.cam-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* Upload progress */
.upload-bar { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.upload-fill { height: 100%; background: var(--green); border-radius: 2px; width: 0%; transition: width 0.3s; }

/* Done panel */
.done-icon { font-size: 4rem; color: var(--green); }

/* ══════════════════════════════════════════════════════════
   CHAT
══════════════════════════════════════════════════════════ */
.chat-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-xl); display: flex; flex-direction: column;
  height: 480px; overflow: hidden; box-shadow: var(--shadow);
}
.chat-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 700; color: var(--text-s);
  display: flex; align-items: center;
  text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0;
  background: #f8fafc;
}
.chat-count {
  background: var(--bg); border-radius: 99px;
  padding: 2px 8px; font-size: 0.72rem; color: var(--text-m);
}
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chat-msgs::-webkit-scrollbar { width: 3px; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.chat-welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-m); gap: 6px; text-align: center; }
.chat-welcome i { font-size: 2rem; opacity: 0.3; color: var(--green); }
.chat-welcome p { font-size: 0.84rem; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-av { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: var(--green-dim); display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: var(--green); }
.chat-name { font-size: 0.72rem; font-weight: 600; color: var(--green); margin: 0 0 2px; }
.chat-time { color: var(--text-m); font-weight: 400; margin-left: 4px; }
.chat-text { font-size: 0.84rem; color: var(--text); line-height: 1.4; margin: 0; }
.chat-inp-row { padding: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }
.chat-inp { flex: 1; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-lg); color: var(--text); padding: 8px 12px; font-size: 0.875rem; outline: none; transition: border-color var(--tr); font-family: 'Inter', sans-serif; }
.chat-inp::placeholder { color: var(--text-m); }
.chat-inp:focus { border-color: var(--green); }
.chat-send-btn { width: 36px; height: 36px; flex-shrink: 0; background: var(--green); border: none; border-radius: var(--r-lg); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--tr); }
.chat-send-btn:hover { background: var(--green-d); }
.chat-closed { padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; font-size: 0.8rem; color: var(--text-m); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   WATCH PAGE
══════════════════════════════════════════════════════════ */
.watch-meta { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.watch-title { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem; }
.watch-info  { display: flex; align-items: center; gap: 10px; }
.watch-agent { font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 0; }
.watch-time  { font-size: 0.78rem; color: var(--text-m); margin: 0; }
.watch-desc  { font-size: 0.875rem; color: var(--text-s); max-width: 600px; margin-top: 8px; }
.alert-info-bar { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: #2563eb; border-radius: var(--r-lg); padding: 10px 16px; font-size: 0.84rem; }

/* ══════════════════════════════════════════════════════════
   FLASH / TOAST
══════════════════════════════════════════════════════════ */
.flash-bar { padding: 12px 20px; font-size: 0.875rem; font-weight: 500; border-bottom: 1px solid; display: flex; align-items: center; }
.flash-danger  { background: rgba(220,38,38,0.08);  border-color: rgba(220,38,38,0.2);  color: #b91c1c; }
.flash-success { background: rgba(26,122,74,0.08);  border-color: rgba(26,122,74,0.2);  color: var(--green-d); }
.toast-notif {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  padding: 12px 18px; border-radius: var(--r-lg);
  font-size: 0.875rem; font-weight: 500; max-width: 340px;
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none; box-shadow: var(--shadow-l);
}
.toast-notif.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-success { background: #fff; border-left: 4px solid var(--green); color: var(--text); }
.toast-danger  { background: #fff; border-left: 4px solid var(--red);   color: var(--text); }
.toast-info    { background: #fff; border-left: 4px solid #3b82f6;      color: var(--text); }

/* ══════════════════════════════════════════════════════════
   MISC
══════════════════════════════════════════════════════════ */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 2rem; }
.error-code { font-size: 7rem; line-height: 1; font-weight: 800; color: var(--green); opacity: 0.15; }
.error-title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.error-desc  { color: var(--text-m); max-width: 380px; margin-top: 6px; }
.breadcrumb-link { color: var(--text-m); font-size: 0.875rem; display: inline-flex; align-items: center; gap: 4px; transition: color var(--tr); }
.breadcrumb-link:hover { color: var(--green); }

/* ══════════════════════════════════════════════════════════
   MOBILE LIVE BAR
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mobile-live-bar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
    background: rgba(255,255,255,0.97);
    border-top: 1px solid var(--border);
    padding: 10px 16px 18px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
    gap: 10px; backdrop-filter: blur(8px);
  }
  #livePanel { padding-bottom: 80px; }
}
.mobile-live-bar { display: none; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  :root { --sidebar-w: 0px; }
  .glass-sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-l);
    z-index: 1050;
  }
  .glass-sidebar.open { transform: translateX(0); }
  .glass-content { margin-left: 0; padding: 20px 16px 48px; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 1040;
    background: rgba(0,0,0,0.35); backdrop-filter: blur(2px);
  }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 768px) {
  .glass-content { padding: 16px 12px 48px; }
  .hero-card { flex-direction: column; text-align: center; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap: 12px; }
  .chat-box { height: 340px; }
  .watch-meta { flex-direction: column; }
  .watch-title { font-size: 1.15rem; }
  .data-tbl td, .data-tbl th { padding: 10px 12px; }
  .stats-row { gap: 10px; }
  .stat-card { min-width: 100px; }
  .mobile-live-bar { display: flex; }
}
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .role-grid  { grid-template-columns: 1fr 1fr; }
  .quality-row { gap: 6px; }
}

/* ══════════════════════════════════════════════════════════
   EXTRA STYLES – FamilyStream
══════════════════════════════════════════════════════════ */

/* Layout */
.main-content {
  margin-top: calc(var(--topbar-h) + 24px);
  padding: 0 24px 40px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 600px) { .main-content { padding: 0 12px 40px; } }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.section-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

/* Cards */
.card { background: var(--bg-s); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--r); font-size: 14px; font-weight: 500; border: none; cursor: pointer; transition: all var(--tr); text-decoration: none; }
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-s); margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; background: var(--bg-s); color: var(--text); transition: border-color var(--tr); }
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.form-control-lg { padding: 12px 14px; font-size: 15px; }
select.form-control { 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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Dropdown */
.dropdown-menu { position: absolute; top: calc(var(--topbar-h) + 4px); right: 16px; background: var(--bg-s); border-radius: var(--r-lg); box-shadow: var(--shadow-l); min-width: 200px; border: 1px solid var(--border); z-index: 2000; display: none; }
.dropdown-menu.open { display: block; }
.dropdown-header { padding: 10px 14px; font-size: 12px; color: var(--text-m); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-item { display: block; padding: 9px 14px; font-size: 14px; color: var(--text); text-decoration: none; transition: background var(--tr); }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.text-danger { color: var(--red); }

/* Auth */
.auth-body { background: var(--bg); min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.auth-wrap { width: 100%; max-width: 420px; padding: 24px; }
.auth-card { background: var(--bg-s); border-radius: var(--r-xl); box-shadow: var(--shadow-l); padding: 36px 32px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: 1.6rem; font-weight: 700; margin: 8px 0 4px; }
.auth-logo p { color: var(--text-s); font-size: 14px; }
.auth-form .btn { margin-top: 8px; }

/* Stream grid */
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.stream-card { background: var(--bg-s); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; transition: transform var(--tr), box-shadow var(--tr); }
.stream-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.stream-thumb { position: relative; aspect-ratio: 16/9; background: #0f172a; overflow: hidden; }
.stream-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stream-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #334155; }
.badge-live { position: absolute; top: 8px; left: 8px; background: var(--red); color: #fff; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; animation: pulse 1.5s infinite; }
.badge-viewers { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; padding: 3px 8px; border-radius: 99px; font-size: 11px; }
.stream-info { padding: 12px; }
.stream-title { font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-meta { font-size: 12px; color: var(--text-s); }

/* Recordings grid */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rec-card-wrap { display: flex; flex-direction: column; }
.rec-card { background: var(--bg-s); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; transition: transform var(--tr), box-shadow var(--tr); flex: 1; }
.rec-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.rec-thumb { position: relative; aspect-ratio: 16/9; background: #0f172a; overflow: hidden; }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #334155; }
.badge-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.75); color: #fff; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.rec-info { padding: 12px; }
.rec-title { font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: 12px; color: var(--text-s); }
.rec-actions { display: flex; gap: 6px; padding: 8px 0 0; flex-wrap: wrap; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; background: var(--bg-s); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.empty-state p { color: var(--text-s); margin: 12px 0 20px; }

/* Topbar avatar */
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--green-l); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* text helpers */
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }

