/* ============================================================
   style.css — StreamPro Live Streaming App
   Extracted from index.php
   ============================================================ */

/* ── CSS VARIABLES ── */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --card: #ffffff;
  --card2: #f1f5f9;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.2);
  --accent2: #0ea5e9;
  --gold: #f59e0b;
  --danger: #ef4444;
  --text: #0f172a;
  --text2: #334155;
  --muted: #64748b;
  --muted2: #94a3b8;
  --success: #16a34a;
  --radius: 14px;
  --radius2: 10px;
  --radius3: 18px;
}

/* ── DARK MODE ── */
body.dark-mode {
  --bg: #0c0c0e;
  --surface: #161618;
  --card: #1c1c1e;
  --card2: #252527;
  --border: #2c2c2e;
  --border2: #3a3a3c;
  --accent: #30d158;
  --accent-dim: rgba(48, 209, 88, 0.15);
  --accent-glow: rgba(48, 209, 88, 0.25);
  --text: #ffffff;
  --text2: rgba(235, 235, 245, 0.8);
  --muted: #8e8e93;
  --muted2: #48484a;
  --success: #30d158;
}
body.dark-mode .header        { background: rgba(12, 12, 14, 0.94); }
body.dark-mode .bottom-nav    { background: rgba(12, 12, 14, 0.96); }
body.dark-mode #customControls { background: #161618; }
body.dark-mode .pc-btn        { color: #fff; }
body.dark-mode .pc-title      { color: #fff; }
body.dark-mode .channel-card  { box-shadow: none; }

/* ── RESET ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.splash-logo {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #0f172a;
}
.splash-logo span { -webkit-text-fill-color: var(--accent); }
.splash-tagline {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
  font-weight: 500;
}
.splash-bar {
  width: 140px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.splash-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  animation: fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes fill { to { width: 100%; } }

/* ============================================================
   NOTICE BAR
   ============================================================ */
#noticeBar {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: var(--accent);
  padding: 9px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
#noticeBar .notice-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: npulse 1.4s infinite;
  flex-shrink: 0;
}
@keyframes npulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}
#noticeBar .notice-close {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

/* ============================================================
   TELEGRAM BOTTOM SHEET
   ============================================================ */
#tgOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
#tgOverlay.show { opacity: 1; }

#tgSheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  z-index: 1000;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 520px;
  margin: 0 auto;
}
#tgSheet.show { transform: translateY(0); }

.tg-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 14px auto 0;
}
.tg-body   { padding: 20px 24px 28px; }
.tg-top    { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tg-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0088cc, #00a8e8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tg-avatar svg { width: 28px; height: 28px; fill: #fff; }
.tg-info  { flex: 1; }
.tg-title { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.tg-sub   { font-size: 13px; color: var(--muted); margin-top: 3px; }

.tg-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.tg-feat      { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.tg-feat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 136, 204, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tg-join-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #0088cc, #00a8e8);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tg-join-btn:active { opacity: 0.9; }
.tg-skip {
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

/* ============================================================
   ADMIN LOGIN MODAL
   ============================================================ */
#loginScreen {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(20px);
}
.login-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  position: relative;
  box-shadow: 0 32px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}
.login-logo {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.login-logo span { color: var(--accent); }
.login-subtitle  { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 24px; }

.input-group           { margin-bottom: 12px; }
.input-group label     { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.8px; font-weight: 600; text-transform: uppercase; }
.input-group input     { width: 100%; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); color: var(--text); font-size: 16px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.input-group input:focus { border-color: var(--accent); }

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius2);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: 0.2px;
}
.btn-login:active { opacity: 0.85; }
.login-err {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
  font-weight: 500;
}
.close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   MAIN APP
   ============================================================ */
#app { display: none; flex-direction: column; min-height: 100vh; }

/* ── HEADER ── */
/* ── HEADER — Unique Navy Gradient Style ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #0d1b2e 0%, #0f2545 60%, #0d1b2e 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
/* Subtle glow behind header */
.header::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 50px;
  background: rgba(79,156,249,0.1);
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
}
.header, .header * { color: #ffffff !important; }

/* Logo pill */
.header-logo {
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(26,58,110,0.8), rgba(15,37,69,0.8));
  border: 1px solid rgba(79,156,249,0.35);
  border-radius: 12px;
  padding: 7px 13px;
}
.header-logo .logo-main   { color: #fff; }
.header-logo .logo-accent { color: #4f9cf9; }
.header-logo .logo-dot {
  width: 8px;
  height: 8px;
  background: #4f9cf9;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(79,156,249,0.9);
  animation: dotPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(79,156,249,0.7); }
  50%       { box-shadow: 0 0 14px rgba(79,156,249,1); }
}

.header-actions { display: flex; gap: 7px; align-items: center; }
.icon-btn {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}
.icon-btn:active { background: rgba(255,255,255,0.12); }
#tapHint { font-size: 11px; color: rgba(255,255,255,0.4); min-width: 55px; font-weight: 500; }

/* ── SEARCH BAR ── */
.search-bar  { padding: 10px 16px 12px; }
.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  font-weight: 400;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.search-item {
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.search-item:last-child  { border-bottom: none; border-radius: 0 0 14px 14px; }
.search-item:active      { background: var(--surface); }

/* ── FEATURED SECTION ── */
.featured-section { padding: 0 14px 14px; }

.featured-slider-wrap { position: relative; overflow: hidden; border-radius: 16px; margin-bottom: 10px; }
.featured-slides       { display: flex; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

.featured-slide {
  min-width: 100%;
  background: linear-gradient(135deg, var(--surface), var(--card));
  border: 1px solid rgba(48, 209, 88, 0.2);
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.featured-slide:active        { opacity: 0.9; }
.featured-slide-bg            { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); font-size: 80px; opacity: 0.08; pointer-events: none; }
.featured-slide-label         { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: 1.5px; margin-bottom: 6px; }
.featured-slide-name          { font-size: 19px; font-weight: 900; color: #fff; line-height: 1.2; }
.featured-slide-sub           { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; }
.featured-slide-btn           { margin-top: 14px; background: var(--accent); border-radius: 8px; padding: 8px 18px; display: inline-block; font-size: 12px; font-weight: 800; color: #000; }

/* Slider dots */
.slider-dots { display: flex; justify-content: center; gap: 5px; margin-bottom: 10px; }
.slider-dot  { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.2); transition: all 0.3s; cursor: pointer; }
.slider-dot.active     { background: var(--accent); width: 20px !important; }
.slider-dot:not(.active) { width: 6px; }

/* Featured thumbs row */
.featured-thumbs { display: flex; gap: 7px; }
.featured-thumb {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 0;
}
.featured-thumb.active      { border-color: var(--accent); }
.featured-thumb-icon        { font-size: 18px; flex-shrink: 0; }
.featured-thumb-info        { min-width: 0; }
.featured-thumb-name        { font-size: 10px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-thumb-live        { font-size: 9px; color: var(--accent); font-weight: 600; margin-top: 1px; }

/* ── CATEGORY TABS ── */
.cats { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.cat-btn:active { transform: scale(0.95); }
.cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ============================================================
   CHANNEL GRID & CARDS
   ============================================================ */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 12px 120px;
}

.channel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.2s ease;
  position: relative;
  -webkit-user-select: none;
}
.channel-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  border-color: #3b82f6;
}
.channel-card:active     { transform: scale(0.96); }
.channel-card.live-ch    { border-color: var(--border); }
.channel-card.disabled-ch { opacity: 0.4; cursor: not-allowed; }

/* Play icon overlay on hover */
.channel-card::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: 28px;
  color: white;
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
}
.channel-card:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ch-thumb {
  aspect-ratio: 16 / 9;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}
.channel-card:hover .ch-thumb { transform: scale(1.1); }

.live-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.live-badge::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #16a34a;
  border-radius: 50%;
  animation: liveblink 1.2s infinite;
}
@keyframes liveblink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.disabled-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  background: rgba(0,0,0,0.08);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
}
.phone-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}
.hd-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  background: rgba(255, 214, 10, 0.9);
  color: #000;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.ch-info  { padding: 10px 10px 9px; }
.ch-name  { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); letter-spacing: -0.1px; }
.ch-cat   { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.ch-viewers {
  font-size: 10px;
  color: #ff6b6b;
  margin-top: 3px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.ch-viewers::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #ff6b6b;
  border-radius: 50%;
  animation: liveblink 1.2s infinite;
  display: inline-block;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
/* ── BOTTOM NAV — iOS Glass Style ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: rgba(13,27,46,0.82) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav, .bottom-nav * { color: #ffffff !important; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.2s;
  letter-spacing: 0.2px;
}
/* Icon pill container */
.nav-item .nav-icon {
  width: 46px;
  height: 30px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: all 0.2s;
}
/* Active state */
.nav-item.active { color: #4f9cf9 !important; }
.nav-item.active .nav-icon {
  background: linear-gradient(135deg, rgba(79,156,249,0.25), rgba(79,156,249,0.12));
  border: 1px solid rgba(79,156,249,0.45);
  box-shadow: 0 2px 12px rgba(79,156,249,0.2);
}

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
#pwaBar {
  display: none;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  gap: 10px;
}
.pwa-text    { flex: 1; font-size: 13px; color: var(--text2); font-weight: 500; }
.pwa-text span { color: var(--accent); font-weight: 700; }
.btn-pwa-install {
  padding: 7px 14px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-pwa-dismiss { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 6px; }

/* ============================================================
   PHONE-ONLY ERROR SCREEN
   ============================================================ */
#phoneOnlyScreen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  background: #000;
  text-align: center;
  min-height: 220px;
}
.phone-only-icon  { font-size: 52px; animation: phoneBounce 1.5s ease-in-out infinite alternate; }
@keyframes phoneBounce {
  from { transform: translateY(0) rotate(-8deg); }
  to   { transform: translateY(-10px) rotate(8deg); }
}
.phone-only-title { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.phone-only-sub   { font-size: 13px; color: #8e8e93; line-height: 1.5; }
.phone-only-hint  {
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: #0a84ff;
  font-weight: 600;
}

/* ============================================================
   PLAYER MODAL
   ============================================================ */
#playerModal {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 500;
  flex-direction: column;
  overflow: hidden;
}
#playerVideoWrap {
  position: relative;
  width: 100%;
  background: #000;
  flex-shrink: 0;
}
#videoEl {
  width: 100%;
  display: block;
  background: #000;
  height: 56vw;
  min-height: 200px;
  max-height: 320px;
}
#iframeEl {
  width: 100%;
  border: none;
  background: #000;
  display: block;
  height: 56vw;
  min-height: 200px;
  max-height: 320px;
}

.player-live-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-live-dot::before {
  content: '';
  width: 5px;
  height: 5px;
  background: #000;
  border-radius: 50%;
  animation: liveblink 1.2s infinite;
}

#customControls {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.controls-row { display: flex; align-items: center; gap: 8px; }

.pc-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  opacity: 0.9;
}
.pc-btn:active { opacity: 0.5; }

.pc-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.pc-select {
  background: var(--card2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  border-radius: 7px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
.pc-select option { background: var(--card); }

.progress-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 500; }
.seek-bar  { flex: 1; height: 3px; background: var(--border2); border-radius: 3px; overflow: hidden; cursor: pointer; }
.seek-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0%; transition: width 0.5s linear; }

.vol-wrap   { display: flex; align-items: center; gap: 6px; }
.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 3px;
  border-radius: 3px;
  background: var(--border2);
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

#playerStatus {
  font-size: 11px;
  color: var(--accent);
  text-align: center;
  padding: 1px 0;
  min-height: 16px;
  letter-spacing: 0.3px;
  font-weight: 600;
}

#sleepTimerDisplay {
  font-size: 11px;
  color: var(--gold);
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(255, 214, 10, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 214, 10, 0.25);
  font-weight: 600;
}

.player-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); }

.player-action-btns { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.pab {
  flex: 1;
  min-width: 60px;
  padding: 10px 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.pab:active       { background: var(--card2); }
.pab.active-timer { background: rgba(255, 214, 10, 0.12); border-color: rgba(255, 214, 10, 0.4); color: var(--gold); }

.player-info { background: var(--card); border-radius: 14px; padding: 14px; border: 1px solid var(--border); }
.pi-row      { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pi-row:last-child { border-bottom: none; }
.pi-label    { color: var(--muted); font-weight: 500; }
.pi-val      { font-weight: 600; color: var(--text); }
.swipe-hint  { text-align: center; font-size: 11px; color: var(--muted2); padding: 4px 0; font-weight: 500; }

/* ── Mirror Links ── */
.mirror-links  { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 10px; }
.mirror-title  { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.mirror-btn {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.mirror-btn:last-child      { margin-bottom: 0; }
.mirror-btn.active-mirror   { border-color: var(--accent); color: var(--accent); }

/* ── Chat ── */
.chat-section  { background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-top: 12px; overflow: hidden; }
.chat-header   { padding: 11px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.chat-live-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; animation: liveblink 1.2s infinite; flex-shrink: 0; }

#chatMessages  {
  height: 160px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-msg     { display: flex; gap: 8px; align-items: flex-start; }
.chat-avatar  { width: 26px; height: 26px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.chat-bubble  { background: var(--surface); border-radius: 0 10px 10px 10px; padding: 7px 10px; max-width: 85%; }
.chat-name    { font-size: 10px; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.chat-text    { font-size: 13px; color: var(--text); line-height: 1.4; word-break: break-word; }
.chat-time    { font-size: 10px; color: var(--muted); margin-top: 2px; }
.chat-own     { flex-direction: row-reverse; }
.chat-own .chat-bubble { background: var(--accent-dim); border-radius: 10px 0 10px 10px; border: 1px solid rgba(48,209,88,0.15); }
.chat-own .chat-name   { color: var(--muted); text-align: right; }

.chat-input-row { padding: 9px 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  padding: 9px 16px;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.chat-name-row { padding: 10px 12px; display: flex; gap: 8px; border-top: 1px solid var(--border); }
.chat-name-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.chat-name-input:focus { border-color: var(--accent); }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
#adminPanel { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 600; overflow-y: auto; }

.admin-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-title          { font-size: 18px; font-weight: 800; flex: 1; letter-spacing: -0.3px; }
.admin-title span     { color: var(--accent); }
.back-btn {
  width: 34px;
  height: 34px;
  background: var(--card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  border: none;
  color: var(--text);
  font-family: inherit;
}

.admin-body { padding: 16px; }

/* Tabs */
.tabs                 { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.tab-btn.active       { background: var(--accent); border-color: var(--accent); color: #000; }
.tab-pane             { display: none; }
.tab-pane.active      { display: block; }

.section-title { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card  { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; }
.stat-num   { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 500; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; letter-spacing: 0.3px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 60px; resize: vertical; }

.btn-add {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  letter-spacing: 0.2px;
}
.btn-add:active { opacity: 0.85; }
.btn-danger     { background: var(--danger); color: #fff; }
.btn-success    { background: var(--success); color: #000; }
.btn-neutral    { background: var(--card2); color: var(--text); border: 1px solid var(--border); }

.admin-section {
  margin-bottom: 16px;
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

/* Channel list in admin */
.channel-list-admin { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.admin-ch-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-ch-icon    { font-size: 22px; flex-shrink: 0; }
.admin-ch-info    { flex: 1; min-width: 0; }
.admin-ch-name    { font-weight: 700; font-size: 14px; letter-spacing: -0.1px; }
.admin-ch-url     { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.admin-ch-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-sm {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--border);
  font-weight: 700;
}
.btn-del        { background: rgba(255,69,58,0.12); border-color: rgba(255,69,58,0.3) !important; color: var(--danger); }
.btn-toggle-on  { background: rgba(48,209,88,0.12); color: var(--success); border-color: rgba(48,209,88,0.3) !important; }
.btn-toggle-off { background: var(--card2); color: var(--muted); border-color: var(--border) !important; }

/* Toggle Switch */
.site-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.toggle-switch          { position: relative; width: 50px; height: 28px; flex-shrink: 0; }
.toggle-switch input    { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-slider              { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before      { transform: translateX(22px); }

.toggle-label           { flex: 1; }
.toggle-label-title     { font-weight: 700; font-size: 14px; }
.toggle-label-sub       { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* M3U Import */
.m3u-box {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-family: monospace;
  outline: none;
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* ============================================================
   TELEGRAM BANNER (bottom strip)
   ============================================================ */
#telegramBanner {
  display: none;
  background: linear-gradient(135deg, #0088cc, #006699);
  padding: 11px 16px;
  align-items: center;
  gap: 12px;
  position: relative;
}
.tg-icon  { font-size: 24px; flex-shrink: 0; }
.tg-text  { flex: 1; font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }
.tg-btn {
  padding: 6px 14px;
  background: #fff;
  border: none;
  border-radius: 20px;
  color: #0088cc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.tg-close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 18px; cursor: pointer; flex-shrink: 0; }

/* ============================================================
   WHATSAPP FLOAT BUTTON
   ============================================================ */
#waFloat {
  position: fixed;
  bottom: 82px;
  right: 14px;
  z-index: 200;
  width: 50px;
  height: 50px;
  background: #25d366;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s;
}
#waFloat:active { transform: scale(0.92); }

/* ============================================================
   MATCH HERO BANNER
   ============================================================ */
#matchBanner    { padding: 0 12px 10px; }
.match-hero {
  background: linear-gradient(135deg, rgba(48,209,88,0.12), rgba(10,132,255,0.12));
  border: 1px solid rgba(48, 209, 88, 0.3);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 8px;
  position: relative;
}
.match-hero-live {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.match-hero-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--danger);
  border-radius: 50%;
  animation: liveblink 1.2s infinite;
  display: inline-block;
}
.match-teams    { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 3px; padding-right: 60px; }
.match-meta     { font-size: 11px; color: var(--muted); font-weight: 500; }
.match-time-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.match-time-lbl { font-size: 13px; font-weight: 700; color: var(--accent); }

.countdown-box  { display: flex; gap: 4px; margin-left: auto; }
.cd-unit        { background: rgba(48,209,88,0.1); border: 1px solid rgba(48,209,88,0.2); border-radius: 7px; padding: 4px 7px; text-align: center; min-width: 34px; }
.cd-num         { font-size: 15px; font-weight: 800; color: var(--accent); line-height: 1; display: block; }
.cd-lbl         { font-size: 8px; color: var(--muted); letter-spacing: 0.5px; display: block; }

/* ============================================================
   TOAST & SAVE INDICATOR
   ============================================================ */
#saveIndicator {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px var(--accent-glow);
}
#toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border2);
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (min-width: 480px) { .channels-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .channels-grid { grid-template-columns: repeat(4, 1fr); } }


/* ████████████████████████████████████████████████████████████
   ██                                                        ██
   ██        ADMIN.PHP CSS — START HERE                      ██
   ██                                                        ██
   ██  Search: "ADMIN.PHP CSS — START HERE"                  ██
   ██                                                        ██
   ██  Sections:                                             ██
   ██   1. Admin CSS Variables                               ██
   ██   2. Login Screen                                      ██
   ██   3. Admin Layout & Sidebar                            ██
   ██   4. Main Area & Topbar                                ██
   ██   5. Cards & Content                                   ██
   ██   6. Forms & Buttons                                   ██
   ██   7. Toggles                                           ██
   ██   8. Channel List                                      ██
   ██   9. Modals                                            ██
   ██  10. Online Users & Flags                              ██
   ██  11. Colors, Tags, Test Results, Toast                 ██
   ██  12. Mobile Responsive                                 ██
   ██                                                        ██
   ████████████████████████████████████████████████████████████ */

/* ============================================================
   1. ADMIN CSS VARIABLES
   ============================================================ */
#loginWrap,
#adminWrap {
  --bg:      #080b12;
  --surface: #0d1117;
  --card:    #111827;
  --card2:   #1a2233;
  --border:  #1e2d45;
  --border2: #253554;
  --danger:  #f85149;
  --gold:    #e3b341;
  --blue:    #4f9cf9;
  --purple:  #a78bfa;
  --text:    #e6edf3;
  --muted:   #7d8590;
  --muted2:  #3d444d;
  --success: #3fb950;
  --navy:    #0d1b2e;
  --navy2:   #0a1628;
}

/* Admin body override */
body.admin-body,
body.admin-body #loginWrap,
body.admin-body #adminWrap {
  --bg:         #080b12;
  --surface:    #0d1117;
  --card:       #111827;
  --card2:      #1a2233;
  --border:     #1e2d45;
  --border2:    #253554;
  --accent:     #4f9cf9;
  --accent-dim: rgba(79,156,249,.15);
  --danger:     #f85149;
  --gold:       #e3b341;
  --blue:       #4f9cf9;
  --purple:     #a78bfa;
  --text:       #e6edf3;
  --text2:      #e6edf3;
  --muted:      #7d8590;
  --muted2:     #3d444d;
  --success:    #3fb950;
  --navy:       #0d1b2e;
  --navy2:      #0a1628;
  --radius:     10px;
  --radius2:    8px;
}

body.admin-body {
  background: #080b12 !important;
  color: #e6edf3 !important;
  min-height: 100vh;
}

/* ============================================================
   2. LOGIN SCREEN
   ============================================================ */
#loginWrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #080b12;
  z-index: 100;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(79,156,249,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(167,139,250,0.04) 0%, transparent 60%);
}

.lbox {
  background: #111827;
  border: 1px solid #253554;
  border-radius: 16px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
}

.llogo-wrap { text-align: center; margin-bottom: 24px; }
.llogo-icon {
  width: 56px; height: 56px;
  background: #4f9cf9;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.llogo-icon svg { width: 28px; height: 28px; fill: #fff; }
.llogo          { font-size: 22px; font-weight: 700; color: #e6edf3; letter-spacing: -0.3px; }
.llogo span     { color: #4f9cf9; }
.lsub           { font-size: 13px; color: #7d8590; margin-top: 3px; }

.inp-wrap  { position: relative; margin-bottom: 10px; }
.inp-icon  { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; opacity: 0.4; }
.inp {
  width: 100%;
  padding: 13px 14px 13px 40px;
  background: #0d1117;
  border: 1px solid #1e2d45;
  border-radius: 10px;
  color: #e6edf3;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.inp:focus { border-color: #4f9cf9; }

.inp-plain {
  width: 100%;
  padding: 13px 14px;
  background: #0d1117;
  border: 1px solid #1e2d45;
  border-radius: 10px;
  color: #e6edf3;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 10px;
}
.inp-plain:focus { border-color: #4f9cf9; }

.remember-row {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 14px;
  cursor: pointer;
  font-size: 13px; color: #7d8590;
}
.remember-row input { width: 16px; height: 16px; accent-color: #4f9cf9; cursor: pointer; }

.btn-login {
  width: 100%; padding: 13px;
  background: #4f9cf9; border: none; border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s;
}
.btn-login:active { opacity: 0.85; }
.lerr { color: #f85149; font-size: 13px; text-align: center; margin-top: 10px; min-height: 18px; font-weight: 500; }

/* ============================================================
   3. ADMIN LAYOUT & SIDEBAR
   ============================================================ */
#adminWrap     { display: none; }
.admin-layout  { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: #0d1b2e;
  border-right: 1px solid #1e2d45;
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1e2d45 transparent;
}
.sidebar::-webkit-scrollbar       { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #1e2d45; }

.sb-logo      { padding: 20px 16px; border-bottom: 1px solid #1e2d45; display: flex; align-items: center; gap: 10px; }
.sb-logo-icon { width: 34px; height: 34px; background: #4f9cf9; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-logo-icon svg  { width: 18px; height: 18px; fill: #fff; }
.sb-logo-text      { font-size: 15px; font-weight: 700; color: #e6edf3; letter-spacing: -0.2px; }
.sb-logo-text span { color: #4f9cf9; }
.sb-logo-sub       { font-size: 10px; color: #7d8590; margin-top: 1px; }

.sb-section { padding: 16px 16px 4px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #3d444d; font-weight: 600; }
.sb-nav     { padding: 6px 8px; flex: 1; }

.nav-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: #7d8590; font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  background: none; border: none; text-align: left;
  transition: all 0.15s; margin-bottom: 1px;
}
.nav-btn:hover           { background: rgba(255,255,255,0.04); color: #e6edf3; }
.nav-btn.active          { background: rgba(79,156,249,0.12); color: #4f9cf9; }
.nav-btn .nb-icon        { width: 30px; height: 30px; border-radius: 7px; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.nav-btn .nb-icon svg    { width: 16px; height: 16px; fill: currentColor; }
.nav-btn.active .nb-icon { background: rgba(79,156,249,0.2); }
.nav-btn .nb-label       { flex: 1; }
.nav-btn .nb-badge       { background: #f85149; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }

.sb-footer { padding: 12px 8px; border-top: 1px solid #1e2d45; }
.sb-user   { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.03); margin-bottom: 6px; }
.sb-avatar { width: 28px; height: 28px; background: #4f9cf9; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.sb-uname  { font-size: 12px; font-weight: 600; color: #e6edf3; flex: 1; }
.sb-urole  { font-size: 10px; color: #7d8590; }
.sb-logout { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #f85149; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; background: none; border: none; transition: background 0.15s; }
.sb-logout:hover { background: rgba(248,81,73,0.08); }
.sb-logout svg   { width: 14px; height: 14px; fill: currentColor; }

/* ============================================================
   4. MAIN AREA & TOPBAR
   ============================================================ */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: #0d1117;
  border-bottom: 1px solid #1e2d45;
  padding: 0 24px; height: 54px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; color: #e6edf3; }

.sbadge { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.bon    { background: rgba(63,185,80,0.12); color: #3fb950; border: 1px solid rgba(63,185,80,0.25); }
.boff   { background: rgba(248,81,73,0.1); color: #f85149; border: 1px solid rgba(248,81,73,0.2); }
#savingDot { font-size: 12px; color: #7d8590; display: none; }

.abody { flex: 1; padding: 24px; overflow-x: hidden; }

/* Desktop — tabs hidden */
.tabs         { display: none; }
.tpane        { display: none; }
.tpane.active { display: block; }

/* ============================================================
   5. CARDS & CONTENT
   ============================================================ */
.card {
  background: #111827; border: 1px solid #1e2d45;
  border-radius: 12px; padding: 18px; margin-bottom: 14px;
}
.ctitle { font-size: 11px; color: #7d8590; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ctitle svg { width: 14px; height: 14px; fill: currentColor; opacity: 0.6; }

.sgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.sc    { background: #0d1b2e; border: 1px solid #1e2d45; border-radius: 10px; padding: 16px; }
.sc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sc-icon   { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.snum { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.slbl { font-size: 11px; color: #7d8590; font-weight: 500; margin-top: 2px; }

/* ============================================================
   6. FORMS & BUTTONS
   ============================================================ */
.fg            { margin-bottom: 12px; }
.fg label      { display: block; font-size: 11px; color: #7d8590; margin-bottom: 5px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }
.fg input,
.fg select,
.fg textarea   { width: 100%; padding: 11px 13px; background: #0d1117; border: 1px solid #1e2d45; border-radius: 8px; color: #e6edf3; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.fg input:focus,
.fg select:focus,
.fg textarea:focus { border-color: #4f9cf9; }
.fg textarea   { min-height: 80px; resize: vertical; font-size: 13px; font-family: monospace; line-height: 1.5; }

.tpbox { display: none; margin-top: 8px; width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; border: 1px solid #1e2d45; background: #0d1117; position: relative; }
.tpbox img { width: 100%; height: 100%; object-fit: cover; }
.tpclear   { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.7); border: none; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; cursor: pointer; font-family: inherit; }

.btn        { width: 100%; padding: 12px; border: none; border-radius: 9px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; margin-top: 4px; transition: opacity 0.2s; }
.btn:active { opacity: 0.82; }
.bg         { background: #3fb950; color: #000; }
.br         { background: #f85149; color: #fff; }
.bb         { background: #4f9cf9; color: #fff; }
.bgr        { background: #1a2233; color: #e6edf3; border: 1px solid #253554; }

.bsm        { padding: 5px 10px; border-radius: 7px; font-size: 12px; cursor: pointer; font-family: inherit; font-weight: 700; border: 1px solid; transition: opacity 0.15s; }
.bsm:active { opacity: 0.75; }
.bdel       { background: rgba(248,81,73,0.1); border-color: rgba(248,81,73,0.25); color: #f85149; }
.bon2       { background: rgba(63,185,80,0.1); color: #3fb950; border-color: rgba(63,185,80,0.25); }
.boff2      { background: #1a2233; color: #7d8590; border-color: #253554; }
.bedit      { background: rgba(79,156,249,0.1); color: #4f9cf9; border-color: rgba(79,156,249,0.25); }
.btest      { background: rgba(227,179,65,0.1); color: #e3b341; border-color: rgba(227,179,65,0.25); }

.btn-toggle-on  { background: rgba(79,156,249,0.12); border: 1px solid rgba(79,156,249,0.3); color: #4f9cf9; padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-toggle-off { background: #1a2233; border: 1px solid #253554; color: #7d8590; padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ============================================================
   7. TOGGLES
   ============================================================ */
.trow {
  display: flex; align-items: center; gap: 12px;
  padding: 13px; background: #0d1117;
  border-radius: 10px; border: 1px solid #1e2d45; margin-bottom: 10px;
}
.tsw       { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.tsw input { opacity: 0; width: 0; height: 0; }
.tsl {
  position: absolute; inset: 0;
  background: #3d444d; border-radius: 13px;
  cursor: pointer; transition: 0.25s;
}
.tsl::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.25s; }
.tsw input:checked + .tsl         { background: #3fb950; }
.tsw input:checked + .tsl::before { transform: translateX(20px); }
.tlbl { flex: 1; }
.tlt  { font-weight: 600; font-size: 14px; }
.tls  { font-size: 12px; color: #7d8590; margin-top: 2px; }

.dopt {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; background: #0d1117;
  border-radius: 9px; border: 2px solid #1e2d45;
  flex: 1; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: border-color 0.15s;
}
.dopt.sel { border-color: #4f9cf9; color: #4f9cf9; }

/* ============================================================
   8. CHANNEL LIST
   ============================================================ */
.chlist { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

.chrow { background: #0d1117; border: 1px solid #1e2d45; border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; transition: border-color 0.15s; }
.chrow:hover { border-color: #253554; }

.chtmini { width: 52px; height: 34px; border-radius: 6px; object-fit: cover; background: #1a2233; flex-shrink: 0; border: 1px solid #1e2d45; }
.chemoji { width: 52px; height: 34px; border-radius: 6px; background: #1a2233; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; border: 1px solid #1e2d45; }
.chinfo  { flex: 1; min-width: 0; }
.chname  { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e6edf3; }
.churl   { font-size: 11px; color: #7d8590; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.chmeta  { font-size: 10px; color: #3d444d; margin-top: 2px; }
.chnote  { font-size: 11px; color: #e3b341; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chact   { display: flex; gap: 4px; flex-shrink: 0; flex-direction: column; }

/* ============================================================
   9. MODALS
   ============================================================ */
#editModal,
#urlTestModal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 200;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(8px);
}
.ebox {
  background: #111827; border-radius: 16px 16px 0 0;
  padding: 20px 16px 36px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.etitle       { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.etitle span  { color: #4f9cf9; }
.eclosebtn    { float: right; background: #1a2233; border: none; color: #7d8590; font-size: 13px; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; font-weight: 600; }

/* ============================================================
   10. ONLINE USERS & FLAGS
   ============================================================ */
.urow { background: #0d1117; border: 1px solid #1e2d45; border-radius: 10px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.uflag   { font-size: 22px; flex-shrink: 0; }
.uinfo   { flex: 1; min-width: 0; }
.ubadge  { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.uch     { background: rgba(63,185,80,0.1); color: #3fb950; border: 1px solid rgba(63,185,80,0.2); }
.ubrowse { background: #1a2233; color: #7d8590; border: 1px solid #253554; }

.flag-card    { background: #0d1b2e; border: 1px solid #1e2d45; border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.flag-big     { font-size: 28px; flex-shrink: 0; }
.flag-info    { flex: 1; min-width: 0; }
.flag-country { font-size: 14px; font-weight: 600; color: #e6edf3; }
.flag-count   { font-size: 11px; color: #7d8590; margin-top: 2px; }
.flag-bar     { height: 4px; background: #253554; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.flag-bar-fill { height: 100%; background: #4f9cf9; border-radius: 2px; transition: width 0.5s; }

.logrow { background: #0d1117; border: 1px solid #1e2d45; border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* ============================================================
   11. COLORS, CATEGORY TAGS, TEST RESULTS, TOAST
   ============================================================ */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.swatch         { width: 34px; height: 34px; border-radius: 8px; cursor: pointer; border: 3px solid transparent; transition: border-color 0.15s; flex-shrink: 0; }
.swatch.active  { border-color: #fff; }

.cat-tags  { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cat-tag   { display: flex; align-items: center; gap: 4px; padding: 5px 10px; background: #0d1117; border: 1px solid #1e2d45; border-radius: 20px; font-size: 13px; font-weight: 600; }
.cat-tag button { background: none; border: none; color: #f85149; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; margin-left: 2px; }

.test-result  { padding: 12px; border-radius: 9px; font-size: 13px; font-weight: 600; text-align: center; margin-top: 10px; }
.test-ok      { background: rgba(63,185,80,0.1);  color: #3fb950; border: 1px solid rgba(63,185,80,0.25); }
.test-fail    { background: rgba(255,69,58,0.12);  color: #f85149; border: 1px solid rgba(255,69,58,0.3); }
.test-loading { background: rgba(255,214,10,0.1);  color: #e3b341; border: 1px solid rgba(255,214,10,0.3); }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a2233; color: #e6edf3; border: 1px solid #253554;
  padding: 10px 18px; border-radius: 20px; font-weight: 600; font-size: 13px;
  z-index: 9999; opacity: 0; transition: opacity 0.3s;
  pointer-events: none; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ============================================================
   12. ADMIN MOBILE RESPONSIVE — max-width: 768px
   ============================================================ */
@media (max-width: 768px) {
  html, body    { height: auto; overflow-x: hidden; }
  #adminWrap    { display: block !important; min-height: 100vh; }
  .admin-layout { display: block; min-height: 100vh; }
  .sidebar      { display: none !important; }
  .main-area    { width: 100%; display: block; }
  .tpane.active { display: block; }

  .topbar {
    padding: 0 14px;
    padding-top: env(safe-area-inset-top, 0);
    height: auto; min-height: 48px;
    position: sticky; top: 0; z-index: 40;
  }

  .abody {
    padding: 12px 14px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    overflow-x: hidden;
  }

  .sgrid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Bottom Tab Bar */
  .tabs {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #0d1b2e; border-top: 1px solid #1e2d45;
    z-index: 100; overflow: hidden;
  }

  .tbtn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    padding: 6px 2px; background: none; border: none;
    color: #7d8590; font-size: 9px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    min-width: 0; overflow: hidden;
  }
  .tbtn.active              { color: #4f9cf9; }
  .tbtn .tb-icon            { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; }
  .tbtn .tb-icon svg        { width: 20px; height: 20px; fill: #7d8590; display: block; }
  .tbtn.active .tb-icon svg { fill: #4f9cf9; }
  .tbtn .tb-label           { font-size: 9px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52px; }
}

@media (min-width: 600px) {
  .sgrid { grid-template-columns: repeat(4, 1fr); }
}

/* ████████████████████████████████████████████████████████████
   ██        ADMIN.PHP CSS — END HERE                        ██
   ████████████████████████████████████████████████████████████ */