:root {
  --bg: #18191c;
  --panel: #202125;
  --card: #26272c;
  --card2: #2f3036;
  --line: #36373e;
  --text: #ececef;
  --muted: #9a9ba3;
  --dim: #6c6d75;
  --accent: #f4574e;
  --accent-2: #ff7b72;
  --accent-soft: rgba(244, 87, 78, .14);
  --ok: #3fbf86;
  --warn: #f0b443;
  --radius: 12px;
  --side: 236px;
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---- shell ---------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.brand img { height: 34px; }
.brand b { font-size: 13px; letter-spacing: .14em; color: var(--accent); font-weight: 700; line-height: 1.1; }
.brand b span { display: block; color: var(--muted); font-weight: 500; letter-spacing: .08em; font-size: 11px; }
.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav .label { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--muted); position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 16px 20px; color: var(--dim); font-size: 12px; border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .burger { display: none; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 0 14px; height: 38px; width: min(320px, 40vw); }
.search input { background: none; border: 0; outline: 0; width: 100%; }
.search svg { color: var(--muted); width: 16px; }
.iconbtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: none; border: 0; color: var(--muted); cursor: pointer; position: relative; }
.iconbtn:hover { background: var(--card); color: var(--text); }
.iconbtn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #b9372f); font-weight: 600; font-size: 13px; cursor: pointer; border: 2px solid var(--line); }
.view { padding: 24px; display: flex; flex-direction: column; gap: 22px; }

/* ---- cards ---------------------------------------------------------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.card-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.card-h .sub { color: var(--muted); font-size: 12px; }
.card-h .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 0 20px 20px; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: 22px; font-weight: 600; }
.pagehead .sub { color: var(--muted); }
.pagehead .acts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #4a4b53; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: none; }
.btn.danger { color: var(--accent); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn svg { width: 16px; height: 16px; }
.round { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; border: 0; cursor: pointer; }
.round:hover { background: var(--accent-2); }
.round.soft { background: var(--card2); color: var(--text); }
.round svg { width: 16px; height: 16px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile .ic svg { width: 22px; height: 22px; }
.tile b { font-size: 22px; font-weight: 600; display: block; line-height: 1.2; }
.tile span { color: var(--muted); font-size: 12px; }

/* now playing hero */
.hero { display: grid; grid-template-columns: minmax(280px, 42%) 1fr; min-height: 300px; }
.hero-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; background: #111; }
.hero-art .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(1.1); }
.hero-art .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.85) 100%); }
.hero-art > *:not(.bg) { position: relative; }
.hero-art .zone-tag { position: absolute; top: 18px; left: 20px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); border-radius: 20px; padding: 4px 12px; font-size: 12px; backdrop-filter: blur(6px); }
.hero-art h3 { margin: 0; font-size: 22px; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hero-art .meta { color: #cfd0d6; font-size: 13px; }
.transport { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.transport .play { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #111; border: 0; display: grid; place-items: center; cursor: pointer; }
.transport .play svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.transport .tb { background: none; border: 0; color: #fff; cursor: pointer; opacity: .9; }
.transport .tb:hover { opacity: 1; }
.transport .vol { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #ddd; font-size: 12px; }
.progress { height: 4px; background: rgba(255,255,255,.18); border-radius: 2px; margin-top: 14px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width 1s linear; }
.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; margin-right: 8px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; } .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 16px; } }
.eq.off i { animation: none; height: 4px; background: var(--dim); }

.zlist { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 60%); }
.zrow { display: grid; grid-template-columns: 44px 1fr 120px 70px 34px 34px; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.zrow:hover, .zrow.on { background: rgba(255,255,255,.05); }
.zrow .thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; }
.zrow b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zrow small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.zrow .t { color: var(--muted); font-size: 12px; text-align: right; }

/* art */
.art { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.85); font-weight: 600; background-size: cover; background-position: center; }
.art svg { width: 40%; height: 40%; opacity: .9; }

/* media grid (album cards) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.mcard { background: var(--card2); border-radius: 10px; padding: 10px; position: relative; transition: transform .15s, background .15s; }
.mcard:hover { transform: translateY(-2px); background: #34353c; }
.mcard .cover { aspect-ratio: 1; border-radius: 8px; overflow: hidden; position: relative; }
.mcard .cover .hov { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; padding: 8px; opacity: 0; transition: opacity .15s; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.6)); }
.mcard:hover .cover .hov, .mcard .cover .hov.show { opacity: 1; }
.mcard h4 { margin: 10px 2px 0; font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard p { margin: 2px; font-size: 12px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .kind { position: absolute; top: 16px; left: 16px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; background: rgba(0,0,0,.55); border-radius: 10px; padding: 2px 8px; }
.mcard.sel { outline: 2px solid var(--accent); }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: 16px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }

/* box cards */
.boxcard { background: var(--card2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.boxcard .row1 { display: flex; align-items: center; gap: 10px; }
.boxcard .spk { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #3a3b42; color: var(--muted); }
.boxcard b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boxcard small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* status */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.st.on { color: var(--ok); } .st.on::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(63,191,134,.18); }
.st.off { color: var(--accent); } .st.off::before { background: var(--accent); }
.st.wait { color: var(--warn); } .st.wait::before { background: var(--warn); }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl .mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .mini .thumb { width: 38px; height: 38px; border-radius: 6px; overflow: hidden; flex: none; }
.tbl .mini b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.tbl .mini small { color: var(--muted); display: block; font-size: 12px; }
.tablewrap { overflow-x: auto; }
.tbl .iconbtn { display: inline-grid; vertical-align: middle; width: 34px; height: 34px; }
.tbl .iconbtn:disabled { opacity: .3; cursor: default; }
#boxscroll { grid-auto-columns: 260px; }
.hscroll { grid-auto-columns: 180px; }

/* form controls */
.inp, select.inp { height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card2); padding: 0 12px; outline: none; min-width: 0; }
.inp:focus { border-color: var(--accent); }
select.inp { padding-right: 28px; }
textarea.inp { height: auto; padding: 10px 12px; }
input[type=range] { accent-color: var(--accent); width: 110px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { display: none; }
.days span { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); font-size: 12px; }
.days input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 19px; }
.chips { display: flex; gap: 8px; }
.chip { padding: 6px 14px; border-radius: 18px; background: var(--card2); border: 1px solid var(--line); cursor: pointer; font-size: 12px; color: var(--muted); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 100; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal.wide { width: min(760px, 100%); }
.modal-h { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-h .iconbtn { margin-left: auto; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--ok); padding: 12px 16px; border-radius: 10px; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--accent); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* misc */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--dim); margin-bottom: 8px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.pick { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.pick label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pick label:hover { background: var(--card2); }
.pick input { accent-color: var(--accent); }
.pick .thumb { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; flex: none; }
.pl-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; }
.pl-item:hover { background: var(--card2); }
.pl-item.on { background: var(--accent-soft); }
.pl-item .thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; }
.pl-item b { display: block; font-weight: 500; }
.pl-item small { color: var(--muted); font-size: 12px; }
.outlet { margin-bottom: 4px; }
.zgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.zcard { background: var(--card2); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.zcard .h { display: flex; align-items: center; gap: 10px; }
.zcard .h b { font-size: 15px; font-weight: 600; }
.zcard .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; align-items: center; }
.zcard .kv span { color: var(--muted); font-size: 12px; }

/* schedule week grid */
.week { display: grid; grid-template-columns: 56px repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.week .dh { text-align: center; padding: 10px 0; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--card2); }
.week .dh.today { color: var(--accent); font-weight: 600; }
.week .hours, .week .day { position: relative; height: calc(24 * 26px); }
.week .hours div { height: 26px; font-size: 10px; color: var(--dim); text-align: right; padding-right: 8px; transform: translateY(-6px); }
.week .day { border-left: 1px solid var(--line); background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(255,255,255,.04) 25px 26px); cursor: crosshair; }
.week .slot { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 4px 6px; font-size: 11px; overflow: hidden; cursor: pointer; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.week .slot b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 2; }
.week .nowline::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% 10%, rgba(244,87,78,.18), transparent 60%), var(--bg); }
.login .card { width: min(380px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.login img { height: 64px; align-self: center; }
.login h1 { margin: 0; text-align: center; font-size: 18px; font-weight: 600; }
.login p { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.login .err { color: var(--accent); font-size: 13px; text-align: center; min-height: 18px; }

.menu { position: absolute; right: 24px; top: 64px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 180px; box-shadow: 0 12px 30px rgba(0,0,0,.4); z-index: 50; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; background: none; border: 0; border-radius: 7px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--card); }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 260px; }
  .pl-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .top { padding: 0 16px; }
  .top .burger { display: grid; }
  .view { padding: 16px; }
  .zrow { grid-template-columns: 44px 1fr 34px; }
  .zrow .t, .zrow .zn, .zrow .more { display: none; }
  .form .two { grid-template-columns: 1fr; }
  .search { width: auto; flex: 1; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; }
}

/* ---- management additions ---------------------------------------------- */
.badge.ok { background: rgba(63,191,134,.14); color: var(--ok); border-color: transparent; }
.badge.warn { background: rgba(240,180,67,.14); color: var(--warn); border-color: transparent; }
.side-foot code { font-size: 11px; color: var(--muted); }
