:root {
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#5b667a;
  --link:#0b6bff;
  --brand:#0f8a4c; /* green */
  --brand2:#0b6bff; /* blue */
  --danger:#d64040;
  --ok:#0f8a4c;
  --warn:#c08900;
  --border:rgba(11,18,32,0.10);
}
* { box-sizing:border-box; }
body { margin:0; font-family:'Hind Siliguri', system-ui,-apple-system,Segoe UI,Roboto,Arial; background:var(--bg); color:var(--text); }
a { color:var(--link); text-decoration:none; }
a:hover { text-decoration:underline; }
.container { max-width:1100px; margin:0 auto; padding:18px; }
.nav { display:flex; gap:14px; align-items:center; justify-content:space-between; padding:14px 18px; background:rgba(255,255,255,0.9); border-bottom:1px solid var(--border); backdrop-filter: blur(10px); position:sticky; top:0; z-index:20; }
.nav .brand { font-weight:700; letter-spacing:0.4px; }
.nav .links { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; box-shadow:0 10px 20px rgba(11,18,32,0.08); }
.grid { display:grid; gap:14px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width:900px){ .grid.cols-3 { grid-template-columns: 1fr; } }
h1,h2,h3 { margin:0 0 10px; }
p { color:var(--muted); line-height:1.6; }
input, select, textarea { width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background:#fff; color:var(--text); outline:none; }
label { display:block; margin:12px 0 6px; color:var(--muted); font-size:14px; }
button, .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 14px; border-radius:10px; border:1px solid var(--border); background:rgba(11,107,255,0.08); color:var(--text); cursor:pointer; }
button:hover, .btn:hover { background:rgba(122,176,255,0.2); }
.btn.primary { background:rgba(15,138,76,0.12); border-color:rgba(15,138,76,0.25); color:var(--text); }
.btn.primary:hover { background:rgba(68,209,139,0.26); }
.btn.danger { background:rgba(255,107,107,0.12); border-color:rgba(255,107,107,0.3); }
.badge { display:inline-block; padding:4px 10px; border-radius:999px; border:1px solid rgba(255,255,255,0.12); font-size:12px; color:var(--muted); }
.badge.ok { color:var(--ok); border-color:rgba(68,209,139,0.3); }
.badge.danger { color:var(--danger); border-color:rgba(255,107,107,0.3); }
.badge.warn { color:var(--warn); border-color:rgba(255,209,102,0.3); }
.table { width:100%; border-collapse:collapse; overflow:hidden; border-radius:12px; }
.table th, .table td { padding:10px; border-bottom:1px solid rgba(255,255,255,0.06); text-align:left; vertical-align:top; }
.table th { color:var(--muted); font-weight:600; font-size:13px; }
.footer { padding:24px 18px; color:var(--muted); font-size:13px; }
.notice { padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,0.10); margin:10px 0; }
.notice.ok { border-color:rgba(68,209,139,0.35); color:var(--ok); }
.notice.err { border-color:rgba(255,107,107,0.35); color:var(--danger); }
.notice.warn { border-color:rgba(255,209,102,0.35); color:var(--warn); }
.small { font-size:12px; color:var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; }

/* --- Admin layout (sidebar, no header) --- */
.admin-layout { display:flex; min-height:100vh; }
.admin-sidebar {
  width:260px;
  background:var(--card);
  border-right:1px solid var(--border);
  position:fixed;
  left:0; top:0;
  height:100vh;
  padding:18px 14px;
  transform: translateX(-110%);
  transition: transform .22s ease;
  z-index: 2000;
}
.admin-brand a { display:flex; gap:10px; align-items:center; font-weight:800; color:var(--text); }
.admin-nav { display:flex; flex-direction:column; gap:6px; margin-top:14px; }
.admin-nav a { padding:10px 12px; border-radius:12px; border:1px solid transparent; color:var(--text); background:transparent; }
.admin-nav a:hover { background:rgba(11,107,255,0.08); text-decoration:none; }
.admin-nav a.active { background:rgba(15,138,76,0.12); border-color:rgba(15,138,76,0.25); }
.admin-main { flex:1; width:100%; }
.admin-topline { padding:18px 18px 0; }
.admin-title { font-size:18px; font-weight:800; }
.admin-topline{ display:flex; align-items:center; gap:12px; padding:14px 18px 0; }
.admin-menu-btn{ width:40px; height:40px; border-radius:14px; border:1px solid var(--border); background:rgba(255,255,255,0.75); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.admin-menu-btn svg{ width:22px; height:22px; fill: currentColor; color: var(--brand2); }
.admin-overlay{ position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:1990; opacity:0; pointer-events:none; transition: opacity .22s ease; }
body.admin-sidebar-open .admin-sidebar{ transform: translateX(0); }
body.admin-sidebar-open .admin-overlay{ opacity:1; pointer-events:auto; }


@media (max-width: 900px) {
  .admin-layout { flex-direction:column; }
  .admin-topline{ padding-top:10px; }
}

/* thumbnails */
.thumb { width:44px; height:44px; border-radius:12px; border:1px solid var(--border); object-fit:cover; background:rgba(11,18,32,0.04); }

/* --- Home (app-like) --- */
.home-header { position:sticky; top:0; z-index:30; background:rgba(255,255,255,0.92); backdrop-filter: blur(10px); border-bottom:1px solid var(--border); }
.home-header .inner { max-width:1100px; margin:0 auto; padding:12px 18px; display:flex; gap:12px; align-items:center; }
.site-logo { display:flex; align-items:center; gap:10px; font-weight:800; color:var(--text); }
.site-logo img { height:34px; width:auto; }
.home-search { flex:1; display:flex; gap:10px; align-items:center; }
.home-search input { height:40px; }
.home-player { position:relative; top:auto; z-index:1; }
.player-wrap { max-width:1100px; margin:0 auto; padding:10px 18px; }
.player-card { background:var(--card); border:1px solid var(--border); border-radius:16px; overflow:hidden; box-shadow:0 10px 20px rgba(11,18,32,0.08); }
.player-video { width:100%; background:#000; max-height:42vh; }
.player-bar { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; align-items:center; }
.tabs { max-width:1100px; margin:0 auto; padding:8px 18px; display:flex; gap:8px; overflow:auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar{ display:none; }
.tab { white-space:nowrap; padding:8px 12px; border-radius:999px; border:1px solid var(--border); background:#fff; cursor:pointer; font-weight:600; }
.tab.active { background:rgba(15,138,76,0.12); border-color:rgba(15,138,76,0.25); }
.channels-grid { display:grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap:10px; padding-bottom:30px; }
.channel-tile { background:#fff; border:1px solid var(--border); border-radius:16px; padding:10px; display:flex; flex-direction:column; align-items:center; gap:8px; cursor:pointer; }
.channel-tile:hover { background:rgba(11,107,255,0.04); }
.channel-tile img { width:54px; height:54px; border-radius:14px; border:1px solid var(--border); object-fit:cover; }
.channel-name { font-size:12px; text-align:center; line-height:1.2; color:var(--text); }
@media (max-width:1100px){ .channels-grid{ grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width:900px){ .channels-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width:520px){ .channels-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); } .home-search{ display:none; } }

/* --- Mobile bottom navigation --- */
.mobile-nav{ display:none; }
@media (max-width: 720px){
  body{ padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-nav{
    display:flex;
    position:fixed;
    left:0; right:0; bottom:0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background:rgba(255,255,255,0.96);
    border-top:1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 999;
    justify-content:space-around;
  }
  .mn-item{
    flex:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    padding:8px 4px;
    border-radius:14px;
    color: var(--muted);
    text-decoration:none;
    font-weight:700;
  }
  .mn-item:hover{ text-decoration:none; background:rgba(11,107,255,0.06); }
  .mn-item.active{ color: var(--text); background:rgba(15,138,76,0.10); border:1px solid rgba(15,138,76,0.20); }
  .mn-ico{ font-size:18px; line-height:1; }
  .mn-txt{ font-size:12px; line-height:1.1; }
}


/* Mobile header (minimal) */
.mobile-topbar{ display:none; }
@media (max-width: 720px){
  .nav{ display:none !important; } /* hide full header on mobile */
  .mobile-topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 12px;
    position:sticky;
    top:0;
    z-index: 1000;
    background: rgba(255,255,255,0.70);
    border-bottom:1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .mt-avatar{
    width:40px; height:40px;
    border-radius:14px;
    overflow:hidden;
    display:flex; align-items:center; justify-content:center;
    border:1px solid var(--border);
    background: rgba(11,18,32,0.04);
    text-decoration:none;
  }
  .mt-avatar img{ width:100%; height:100%; object-fit:cover; }
  .mt-initial{ font-weight:800; color:var(--text); }
  .mt-spacer{ flex:1; }
  .mt-icon{
    width:40px; height:40px;
    border-radius:14px;
    display:flex; align-items:center; justify-content:center;
    border:1px solid var(--border);
    background: rgba(255,255,255,0.65);
    color: var(--brand2);
    text-decoration:none;
  }
  .mt-icon svg{ width:22px; height:22px; fill: currentColor; }
}

/* Mobile bottom nav: glass + single-color dynamic icons */
@media (max-width: 720px){
  .mobile-nav{
    background: rgba(255,255,255,0.62);
    border-top: 1px solid rgba(11,18,32,0.10);
    box-shadow: 0 -10px 30px rgba(11,18,32,0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .mn-item{ color: var(--muted); }
  .mn-item.active{
    color: var(--brand2);
    background: rgba(11,107,255,0.10);
    border: 1px solid rgba(11,107,255,0.18);
  }
  .mn-ico{ display:flex; }
  .mn-ico svg{ width:20px; height:20px; fill: currentColor; display:block; }
}

/* Utility: allow sections to span full viewport width even inside .container */
.full-bleed{
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
@media (max-width: 900px){.grid2{grid-template-columns:1fr;}}
