/* MusicHub - public + admin styles */
:root {
  --accent: #ff9f00;
  --bg: #ffffff;
  --bg-alt: #f6f3ee;
  --bg-row: #fdfdfd;
  --text: #111;
  --muted: #666;
  --line: #e4e0d8;
  --link: #0b3dd6;
  --red: #d40000;
  --green: #0a8a2a;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
:root[data-theme="dark"] {
  --bg: #14161a;
  --bg-alt: #1c1f25;
  --bg-row: #181b20;
  --text: #ececec;
  --muted: #9aa0a6;
  --line: #2b2f36;
  --link: #7aa2ff;
  --red: #ff6b6b;
  --green: #4cd964;
  --card: #1c1f25;
  --shadow: 0 1px 3px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Header ---------- */
.site-head {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 12px 6px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 22%, var(--bg)) 0%, var(--bg) 70%);
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo img { max-height: 70px; width: auto; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 28px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.logo-text { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.tagline { color: var(--red); font-weight: 700; font-size: 13px; margin-top: 6px; }
.theme-btn {
  position: absolute; right: 12px; top: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer;
}

.official-line {
  background: #ececec; color: #111; text-align: center; font-weight: 700;
  font-size: 13px; padding: 8px 10px; margin-top: 8px;
}
:root[data-theme="dark"] .official-line { background: var(--bg-alt); color: var(--text); }
.tg-row { text-align: center; padding: 6px; background: var(--bg-alt); }
.tg-btn {
  display: inline-block; padding: 3px 12px; border: 1px solid #2a74d6; border-radius: 6px;
  background: #eef5ff; color: #0b3dd6; font-weight: 700; font-size: 13px;
}
.welcome { text-align: center; font-weight: 600; padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--line); }

.search-box { display: flex; max-width: 760px; margin: 14px auto 6px; padding: 0 12px; gap: 6px; }
.search-box input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--accent);
  border-radius: 8px; font-size: 15px; background: var(--card); color: var(--text);
}
.search-box button, .btn {
  padding: 10px 18px; border: 0; border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.search-box button:hover, .btn:hover { filter: brightness(.93); }

/* ---------- Chips & quick links ---------- */
.chip-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  background: #ffe9c7; padding: 10px 8px; margin-top: 10px;
}
:root[data-theme="dark"] .chip-row { background: #2a2418; }
.chip {
  display: inline-block; padding: 3px 10px; border: 1px solid; border-radius: 4px;
  background: #fff; font-weight: 700; font-size: 13px;
}
.chip:hover { text-decoration: none; filter: brightness(.95); }
.chip-0 { color: #d40000; border-color: #d40000; }
.chip-1 { color: #0b3dd6; border-color: #0b3dd6; }
.chip-2 { color: #c2007a; border-color: #c2007a; }
.chip-3 { color: #0a8a2a; border-color: #0a8a2a; }
.chip-4 { color: #7a3dd6; border-color: #7a3dd6; }
.chip-5 { color: #b35c00; border-color: #b35c00; }

.quick-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  padding: 10px 12px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line);
}
.quick-label { color: #c2007a; }
.qlink-0 { color: #0a8a2a; } .qlink-1 { color: #111; } .qlink-2 { color: #d40000; }
.qlink-3 { color: #0b3dd6; } .qlink-4 { color: #c2007a; }
:root[data-theme="dark"] .qlink-1 { color: var(--text); }

/* ---------- Layout ---------- */
.wrap { max-width: none; width: 100%; margin: 0; }
.bar {
  background: var(--accent); color: #fff; text-align: center; font-weight: 800;
  padding: 9px 10px; font-size: 14px; margin-top: 0; border-radius: 0;
  text-transform: none; word-break: break-word;
}
.bar h1, .bar h2 { font-size: inherit; margin: 0; }
.subbar { text-align: center; font-size: 12px; color: var(--red); padding: 6px; border-bottom: 1px solid var(--line); }
.subbar a { color: var(--red); }

.crumbs { padding: 10px 10px; font-size: 13px; font-weight: 700; border-top: 1px solid var(--line); }
.crumbs a { color: var(--red); }
.crumbs .sep { margin: 0 6px; color: var(--muted); }

/* ---------- Cover grid ---------- */
.cover-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 160px);
  justify-content: center; gap: 6px; padding: 4px 4px 8px;
}
.cover-card { display: block; color: var(--text); }
.cover-card:hover { text-decoration: none; }
.cover-card .img { position: relative; aspect-ratio: 1 / 1; border-radius: 0; overflow: hidden; background: var(--bg-alt); box-shadow: var(--shadow); }
.cover-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.cover-card:hover img { transform: scale(1.05); }
.cover-card .badge {
  position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.7); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px;
}
.cover-card .cap { margin-top: 6px; font-size: 13px; font-weight: 700; line-height: 1.3; }
.cover-card .sub { font-size: 12px; color: var(--muted); }

/* ---------- Lists ---------- */
.list { background: var(--bg-row); }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px; border-bottom: 1px solid var(--line);
  color: var(--text); font-weight: 700;
}
.row:hover { background: var(--bg-alt); text-decoration: none; }
.row .ico { font-size: 18px; flex: 0 0 22px; text-align: center; color: #1a73e8; }
.row .count { color: var(--muted); font-weight: 600; margin-left: 4px; }
.row .arrow { margin-left: auto; color: var(--muted); }
.row .thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex: 0 0 64px; background: var(--bg-alt); }
.row .meta { min-width: 0; }
.row .meta .t { word-break: break-word; }
.row .meta .s { font-weight: 500; font-size: 12px; color: var(--muted); }
.list-head { padding: 10px; font-weight: 800; background: var(--bg-alt); border-bottom: 1px solid var(--line); font-size: 14px; }

.track-row { background: var(--bg-alt); display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.track-row .thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex: 0 0 56px; }
.track-row .tt { font-weight: 800; word-break: break-word; }
.track-row .meta { font-size: 13px; }
.track-row .meta b { color: var(--red); }
.track-row .dl { color: var(--green); font-weight: 800; }

/* ---------- Detail pages ---------- */
.detail-cover { text-align: center; padding: 14px 10px 6px; }
.detail-cover img { width: 240px; max-width: 70%; border-radius: 8px; border: 2px solid var(--line); box-shadow: var(--shadow); }
.singer-line { text-align: center; padding: 6px 10px 12px; font-weight: 700; }
.singer-line span { color: var(--red); }

.player-box { background: var(--bg-alt); padding: 14px 10px; text-align: center; }
.player-box audio { width: 100%; max-width: 520px; }
.player-box video { width: 100%; max-width: 720px; border-radius: 8px; background: #000; }

.dl-title { text-align: center; padding: 10px; font-weight: 800; background: var(--card); border-bottom: 1px solid var(--line); }
.dl-title a { color: var(--link); }
.dl-buttons { max-width: 330px; margin: 16px auto 8px; display: grid; gap: 7px; padding: 0 10px; }
.dl-btn {
  display: block; text-align: center; padding: 9px 10px; border-radius: 8px;
  color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 1px 1px rgba(0,0,0,.25);
  box-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.dl-btn small { font-weight: 600; opacity: .9; }
.dl-btn:hover { text-decoration: none; filter: brightness(1.07); }
.dl-128 { background: #ff7a1a; } .dl-192 { background: #1e90ff; }
.dl-256 { background: #f0189b; } .dl-320 { background: #3fb8a8; }
.dl-video { background: #e11d2e; }

.info-lines { text-align: center; font-size: 14px; line-height: 1.9; padding: 4px 10px 10px; }
.info-lines .v { color: var(--red); }
.cat-line { text-align: center; padding: 6px 10px 12px; font-size: 14px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 10px 14px; }
.share-btn {
  border: 0; border-radius: 20px; padding: 6px 14px; font-weight: 700; font-size: 13px;
  cursor: pointer; color: #fff; background: #555;
}
.share-btn.wa { background: #25d366; } .share-btn.tg { background: #229ed9; } .share-btn.fb { background: #1877f2; }
.share-btn:hover { text-decoration: none; filter: brightness(1.08); }

.tags { font-size: 12px; color: var(--muted); padding: 10px; border-top: 1px solid var(--line); word-break: break-word; }
.tags b { color: var(--green); }
.desc-box { padding: 10px; font-size: 14px; }

/* ---------- Pager ---------- */
.pager { text-align: center; padding: 14px 6px; background: var(--bg-alt); }
.pager a, .pager .cur, .pager .gap {
  display: inline-block; min-width: 32px; padding: 4px 9px; margin: 2px;
  border-radius: 4px; font-weight: 700; font-size: 14px;
}
.pager a { border: 1px solid var(--line); background: var(--card); }
.pager .cur { background: #ffe44d; color: #111; border: 1px solid #d9b900; }
.pager-info { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Misc ---------- */
.notice { background: #fff6d6; color: #5c4600; border: 1px solid #f0d36b; padding: 10px; margin: 0; text-align: center; font-weight: 600; border-radius: 0; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.sort-line { text-align: center; font-size: 12px; padding: 6px; }
.sort-line a { color: var(--red); font-weight: 700; }
.important-box {
  max-width: none; margin: 14px 0 0; padding: 12px; text-align: center;
  font-size: 13px; color: var(--red); border-top: 1px solid var(--line);
}
.site-foot { background: var(--accent); color: #fff; text-align: center; padding: 14px 10px; margin-top: 0; font-weight: 700; }
.site-foot a { color: #fff; }
.foot-links span { margin: 0 6px; opacity: .7; }
.copy { font-size: 13px; margin-top: 4px; }

.page-text { padding: 16px 12px; white-space: pre-line; max-width: 760px; margin: 0 auto; }

.flash { padding: 10px 14px; border-radius: 6px; margin: 10px 0; font-weight: 600; }
.flash-ok { background: #e3f8e8; color: #0a5c1f; border: 1px solid #a8e2b5; }
.flash-err { background: #fde8e8; color: #8a1111; border: 1px solid #f2b0b0; }
.flash-info { background: #e8f0fe; color: #174ea6; border: 1px solid #b6cdfa; }

@media (max-width: 520px) {
  .cover-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-text { font-size: 24px; }
  .cover-grid { grid-template-columns: repeat(2, 1fr); }
  .row .thumb { width: 56px; height: 56px; flex-basis: 56px; }
}

/* =================================================================
   ADMIN
   ================================================================= */
.admin-body { background: #f1f3f6; color: #1b1f24; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; flex: 0 0 220px; background: #1d2330; color: #cfd6e4; padding: 16px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { padding: 0 18px 14px; font-size: 18px; font-weight: 800; color: #fff; border-bottom: 1px solid #2c3446; margin-bottom: 8px; }
.admin-side a { display: block; padding: 10px 18px; color: #cfd6e4; font-weight: 600; font-size: 14px; }
.admin-side a:hover { background: #2a3245; text-decoration: none; color: #fff; }
.admin-side a.active { background: var(--accent); color: #fff; }
.admin-side .sep { height: 1px; background: #2c3446; margin: 10px 0; }
.admin-main { flex: 1; min-width: 0; padding: 22px; }
.admin-main h1 { margin: 0 0 16px; font-size: 22px; }
.admin-main h2 { font-size: 17px; margin: 0 0 12px; }

.a-card { background: #fff; border-radius: 10px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-left: 5px solid var(--accent); }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { font-size: 12px; color: #667; text-transform: uppercase; letter-spacing: .5px; }

.a-form label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 4px; }
.a-form .hint { font-weight: 400; color: #778; font-size: 12px; }
.a-form input[type=text], .a-form input[type=password], .a-form input[type=number],
.a-form input[type=date], .a-form input[type=url], .a-form select, .a-form textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #c9ced8; border-radius: 6px; font: inherit; background: #fff;
}
.a-form input[type=file] { width: 100%; padding: 6px 0; }
.a-form textarea { min-height: 90px; resize: vertical; }
.a-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.a-form .check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 12px 0; }
.a-form .check input { width: auto; }

.a-btn {
  display: inline-block; padding: 9px 16px; border: 0; border-radius: 6px; font-weight: 700;
  font-size: 14px; cursor: pointer; background: var(--accent); color: #fff;
}
.a-btn:hover { text-decoration: none; filter: brightness(.92); }
.a-btn.gray { background: #6b7280; } .a-btn.red { background: #d93025; } .a-btn.green { background: #188038; }
.a-btn.sm { padding: 5px 10px; font-size: 12px; }

.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th, .a-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e6e9ef; vertical-align: middle; }
.a-table th { font-size: 12px; text-transform: uppercase; color: #667; letter-spacing: .4px; background: #f7f8fa; }
.a-table img.t { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.a-table .acts { white-space: nowrap; }
.a-table .acts form { display: inline; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; background: #e8eaf0; color: #445; }
.pill.on { background: #d7f3de; color: #0a5c1f; } .pill.off { background: #fde1e1; color: #8a1111; }
.pill.audio { background: #fff0d1; color: #8a5a00; } .pill.video { background: #e3e8ff; color: #2b3bb0; }

.track-edit { border: 1px solid #e0e4ec; border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fafbfd; }
.track-edit .head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef1f7; border-radius: 14px; padding: 3px 4px 3px 10px; font-size: 12px; font-weight: 700; }
.file-chip button { border: 0; background: #d93025; color: #fff; border-radius: 50%; width: 18px; height: 18px; line-height: 16px; cursor: pointer; font-size: 12px; padding: 0; }
.upload-note { background: #eef5ff; border: 1px solid #c4d9f5; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
progress { width: 100%; height: 14px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1d2330, #3a2a10); padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; padding: 26px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card p.sub { margin: 0 0 12px; color: #667; font-size: 13px; }

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex: none; height: auto; position: static; display: flex; flex-wrap: wrap; padding: 8px; }
  .admin-side .brand { width: 100%; border: 0; padding: 4px 10px; margin: 0; }
  .admin-side a { padding: 8px 12px; }
  .admin-side .sep { display: none; }
  .admin-main { padding: 14px; }
  .a-form .grid2 { grid-template-columns: 1fr; }
  .a-table { display: block; overflow-x: auto; }
}