:root{
  --bg:#0b0f17;
  --panel:#111827;
  --panel2:#0f172a;
  --card:#0b1220;
  --line:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.60);
  --accent:#60a5fa;
  --danger:#fb7185;
  --ok:#34d399;
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --radius:16px;
}

*{box-sizing:border-box}

a{color:inherit; text-decoration:none}

body{
  margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text); background: radial-gradient(1200px 700px at 20% 0%, #111b33, transparent 50%), var(--bg);
}

.app{display:flex; min-height:100vh}

.sidebar{
  width:280px; padding:22px 16px; border-right:1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,24,39,.92), rgba(15,23,42,.92));
  position:sticky; top:0; height:100vh;
}

.brand{
  display:flex; align-items:center; gap:10px;
  padding:14px 14px; border:1px solid var(--line); border-radius:18px;
  background: rgba(255,255,255,.02);
  margin-bottom:16px;
}

.dot{width:10px; height:10px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px rgba(96,165,250,.12)}

.brand h1{font-size:14px; margin:0; letter-spacing:.6px; font-weight:650}
.brand p{margin:0; font-size:12px; color:var(--muted)}

.nav{display:flex; flex-direction:column; gap:6px; margin-top:10px}

.nav button{
  width:100%;
  background:transparent; border:1px solid transparent; color:var(--text);
  padding:12px 12px; border-radius:14px; text-align:left; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
}

.nav button:hover{background:rgba(255,255,255,.03); border-color:var(--line)}
.nav button.active{background:rgba(96,165,250,.10); border-color:rgba(96,165,250,.35)}

.pill{font-size:12px; color:var(--muted)}

.content{flex:1; padding:22px; max-width:1400px}

.topbar{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:14px;
}

.title h2{margin:0; font-size:18px}
.title p{margin:4px 0 0; font-size:12px; color:var(--muted)}

.actions{display:flex; gap:10px; align-items:center}

.btn{
  border:1px solid var(--line); background:rgba(255,255,255,.02); color:var(--text);
  padding:10px 12px; border-radius:14px; cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.04)}
.btn.primary{border-color:rgba(96,165,250,.45); background:rgba(96,165,250,.12)}
.btn.danger{border-color:rgba(251,113,133,.45); background:rgba(251,113,133,.10)}

.panel{
  border:1px solid var(--line); background:rgba(11,18,32,.55);
  border-radius:var(--radius); box-shadow: var(--shadow);
  padding:14px;
}

.row{display:flex; gap:10px; flex-wrap:wrap}

.field{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--line); background:rgba(255,255,255,.02);
  padding:10px 12px; border-radius:14px;
  min-width:220px; flex:1;
}

.field input, .field select{
  width:100%; background:transparent; border:0; outline:0;
  color:var(--text); font-size:14px;
}

select option{background:#0b0f17; color:#fff}

.hint{font-size:12px; color:var(--muted); margin-top:10px}

.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap:12px;
}

.card{
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  border-radius:18px;
  overflow:hidden;
  position:relative;
  min-height:160px;
}

.thumb{
  height:130px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-bottom:1px solid var(--line);
}

.thumb img{max-width:100%; max-height:100%; display:block}

.meta{padding:10px 10px 12px}

.meta .name{font-size:13px; font-weight:650; margin:0 0 4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.meta .sub{font-size:12px; color:var(--muted); margin:0; display:flex; gap:8px; flex-wrap:wrap}

.badge{
  border:1px solid var(--line);
  padding:2px 8px; border-radius:999px; font-size:12px; color:var(--muted);
  background:rgba(255,255,255,.02);
}

/* hover menu */
.menuBtn{
  position:absolute; top:10px; right:10px;
  width:36px; height:36px; border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.20);
  color:var(--text); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  opacity:0; transform: translateY(-4px); transition: .15s ease;
}

.card:hover .menuBtn{opacity:1; transform: translateY(0)}

.dropdown{
  position:absolute; top:52px; right:10px;
  border:1px solid var(--line); background:rgba(15,23,42,.98);
  border-radius:14px; box-shadow: var(--shadow);
  min-width:160px; padding:6px; display:none;
  z-index:10;
}

.dropdown button{
  width:100%; text-align:left; border:0; cursor:pointer;
  background:transparent; color:var(--text);
  padding:10px 10px; border-radius:12px;
}

.dropdown button:hover{background:rgba(255,255,255,.04)}
.dropdown .danger{color:#fecaca}

/* Modal */
.modalWrap{
  position:fixed; inset:0; background:rgba(0,0,0,.55);
  display:none; align-items:center; justify-content:center;
  padding:18px; z-index:999;
}

.modal{
  width:min(720px, 100%);
  border:1px solid var(--line);
  border-radius:22px;
  background:rgba(15,23,42,.98);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.modalHeader{
  padding:16px 16px 12px;
  border-bottom:1px solid var(--line);
  display:flex; justify-content:space-between; align-items:center;
}

.modalHeader h3{margin:0; font-size:16px}

.modalBody{padding:16px}

.dropzone{
  border:1px dashed rgba(255,255,255,.20);
  border-radius:18px;
  background:rgba(255,255,255,.02);
  padding:18px;
  min-height:160px;
  display:flex; flex-direction:column; gap:10px;
  align-items:center; justify-content:center;
  text-align:center;
}

.dropzone.dragover{
  border-color: rgba(96,165,250,.70);
  background: rgba(96,165,250,.08);
}

.fileList{width:100%; max-height:180px; overflow:auto; border-top:1px solid var(--line); padding-top:10px}
.fileList div{font-size:13px; color:var(--muted); padding:4px 0}

.twoCol{display:grid; grid-template-columns: 1fr 1fr; gap:10px}

@media (max-width: 900px){
  .sidebar{display:none}
  .content{padding:16px}
  .twoCol{grid-template-columns:1fr}
}

/* Login */
.loginWrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:18px;
}
.loginCard{
  width:min(520px, 100%);
  border:1px solid var(--line); border-radius:22px;
  background:rgba(15,23,42,.98); box-shadow: var(--shadow);
  overflow:hidden;
}
.loginCard .head{padding:18px; border-bottom:1px solid var(--line)}
.loginCard h2{margin:0; font-size:18px}
.loginCard p{margin:6px 0 0; color:var(--muted); font-size:13px}
.loginCard .body{padding:18px}

.err{color:#fecaca; font-size:13px; margin-top:10px}


.flash{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  padding:10px 12px;
  border-radius:14px;
  margin-right:12px;
  font-size:13px;
  color:var(--text);
}
.flash.ok{border-color:rgba(52,211,153,.45); background:rgba(52,211,153,.10)}
.flash.err{border-color:rgba(251,113,133,.45); background:rgba(251,113,133,.10); color:#fecaca}
.flash.info{}

/* File input styling */
input[type="file"]{
  width:100%;
  color:var(--muted);
  font-size:13px;
}

/* Open the upload modal without JS */
#uploadModal:target{
  display:flex;
}

#folderModal:target{display:flex;}

#previewModal:target{display:flex;}

.modalWide{width:min(1100px, 100%);}

.previewFrame{
  width:100%;
  height:min(72vh, 820px);
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(2,6,23,.55);
  overflow:hidden;
}
.previewFrame iframe{width:100%; height:100%; border:0; display:block; background:#0b1220;}
.previewFrame img{width:100%; height:100%; object-fit:contain; display:block;}
.previewOther{height:100%; display:flex; align-items:center; justify-content:center; padding:18px; color:var(--muted);}


.folderBar{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;}
.folderChip{
  border:1px solid rgba(148,163,184,.18);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  color:var(--muted);
  background:rgba(2,6,23,.25);
  user-select:none;
}
.folderChip.dropTarget{
  border-color:rgba(96,165,250,.45);
  background:rgba(96,165,250,.08);
  color:var(--text);
}



/* Playlists */
.playlistLayout{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.playlistLeft{flex: 1.4; min-width: 360px;}
.playlistRight{flex: 1; min-width: 320px; display:flex; flex-direction:column; gap:10px;}

.playlistList{
  border:1px solid rgba(148,163,184,.14);
  border-radius:18px;
  background:rgba(2,6,23,.20);
  overflow:hidden;
}
.plRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid rgba(148,163,184,.10);
  cursor:pointer;
}
.plRow:last-child{border-bottom:0}
.plRow:hover{background:rgba(255,255,255,.03)}
.plRow.active{background:rgba(96,165,250,.10); border-bottom-color:rgba(96,165,250,.18)}
.plRow .n{font-weight:750; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.plRow .c{font-size:12px; color:var(--muted);}

.playlistEditor{
  border:1px solid rgba(148,163,184,.14);
  border-radius:18px;
  background:rgba(2,6,23,.20);
  padding:12px;
}
.playlistEditorHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.plTitle{font-size:14px; font-weight:900;}
.plItems{display:flex; flex-direction:column; gap:8px; min-height:80px;}
.plItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border:1px solid rgba(148,163,184,.16);
  border-radius:16px;
  background:rgba(2,6,23,.25);
}
.plItem.dragover{border-color:rgba(96,165,250,.45); background:rgba(96,165,250,.06)}
.plItem .left{display:flex; align-items:center; gap:10px; min-width:0; flex:1;}
.plHandle{
  width:28px; height:28px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.16);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  cursor:grab;
  user-select:none;
}
.plItem .name{font-weight:750; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.plItem .meta{font-size:11px; color:var(--muted); margin-top:2px;}
.plItem .actions{display:flex; gap:8px; align-items:center;}
.plIconBtn{
  width:34px; height:34px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(15,23,42,.55);
  color:var(--text);
  cursor:pointer;
}
.plIconBtn:hover{background:rgba(255,255,255,.05)}

.plAddBtn{
  position:absolute;
  left:10px; top:10px;
  width:36px; height:36px;
  border-radius:14px;
  border:1px solid rgba(96,165,250,.35);
  background:rgba(96,165,250,.12);
  color:var(--text);
  cursor:pointer;
  display:none;
}
.card:hover .plAddBtn{display:inline-flex; align-items:center; justify-content:center;}
.plBadgeWrap{margin-top:8px; display:flex; gap:6px; flex-wrap:wrap;}
.plSmallBadge{
  font-size:10px;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  color:var(--muted);
}

/* Playlist duration input */
.plDurWrap{display:flex; align-items:center; gap:8px;}
.plDurLabel{font-size:11px; color:var(--muted);}
.plDurInput{
  width:88px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(2,6,23,.25);
  color:var(--text);
  outline:none;
}
.plDurInput:focus{border-color:rgba(96,165,250,.45)}

#playlistEditModal:target{display:flex;}
#mediaPickerModal:target{display:flex;}

/* Playlists list (only) */
.plRowActions{display:flex; gap:8px; align-items:center;}
.plEditBtn{
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(15,23,42,.55);
  color:var(--text);
  cursor:pointer;
}
.plEditBtn:hover{background:rgba(255,255,255,.05)}

/* Playlist description textarea */
#plEditDesc{
  width:100%;
  resize:vertical;
  min-height:74px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(2,6,23,.25);
  color:var(--text);
  outline:none;
}
#plEditDesc:focus{border-color:rgba(96,165,250,.45)}
.sepDot{margin:0 8px; color:rgba(148,163,184,.55);}

/* Playlist status badge */
.plStatusBadge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:850;
  padding:3px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(15,23,42,.55);
  color:var(--text);
  letter-spacing:.02em;
  white-space:nowrap;
}
.plStatus-draft{
  border-color:rgba(96,165,250,.35);
  background:rgba(96,165,250,.14);
}
.plStatus-active{
  border-color:rgba(52,211,153,.35);
  background:rgba(52,211,153,.14);
}
.plStatus-archived{
  border-color:rgba(148,163,184,.28);
  background:rgba(148,163,184,.10);
  color:rgba(226,232,240,.88);
}

/* Playlist item mini preview */
.plMiniThumb{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(2,6,23,.25);
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}
.plMiniThumb img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.plMiniIcon{
  font-size:11px;
  font-weight:900;
  color:rgba(148,163,184,.85);
  letter-spacing:.02em;
}

/* Switch (toggle) */
.switch{
  position:relative;
  display:inline-flex;
  width:44px;
  height:24px;
  flex:0 0 auto;
}
.switch input{opacity:0; width:0; height:0}
.switch .slider{
  position:absolute;
  cursor:pointer;
  inset:0;
  background:rgba(148,163,184,.22);
  border:1px solid rgba(148,163,184,.22);
  transition:.18s ease;
  border-radius:999px;
}
.switch .slider:before{
  content:"";
  position:absolute;
  height:18px;
  width:18px;
  left:3px;
  top:2px;
  background:white;
  border-radius:999px;
  transition:.18s ease;
  box-shadow:0 8px 16px rgba(0,0,0,.25);
}
.switch input:checked + .slider{
  background:rgba(52,211,153,.22);
  border-color:rgba(52,211,153,.32);
}
.switch input:checked + .slider:before{transform:translateX(20px);}

/* Schedules list */
.scheduleList{
  border:1px solid rgba(148,163,184,.14);
  border-radius:18px;
  background:rgba(2,6,23,.20);
  overflow:hidden;
}
.scRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid rgba(148,163,184,.10);
}
.scRow:last-child{border-bottom:0}
.scL{display:flex; flex-direction:column; gap:2px; min-width:0}
.scT{font-weight:750; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.scS{font-size:11px; color:rgba(148,163,184,.85); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.scR{display:flex; align-items:center; gap:10px; flex:0 0 auto}
.badge{
  display:inline-flex;
  align-items:center;
  font-size:11px;
  font-weight:850;
  padding:3px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(15,23,42,.55);
  color:var(--text);
}
.badgeActive{border-color:rgba(52,211,153,.35); background:rgba(52,211,153,.14)}
.badgeInactive{border-color:rgba(148,163,184,.28); background:rgba(148,163,184,.10); color:rgba(226,232,240,.88)}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width: 860px){.grid2{grid-template-columns:1fr}}
.cardMini{
  border:1px solid rgba(148,163,184,.14);
  border-radius:18px;
  background:rgba(2,6,23,.20);
  padding:12px;
}
.subHint{font-size:11px; color:rgba(148,163,184,.70); margin-top:2px}
.weekdays{display:flex; flex-wrap:wrap; gap:8px}
.dayBtn{
  border:1px solid rgba(148,163,184,.16);
  background:rgba(2,6,23,.18);
  color:var(--text);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  cursor:pointer;
}
.dayBtn.active{
  border-color:rgba(96,165,250,.45);
  background:rgba(96,165,250,.14);
}

#scEditDesc{
  width:100%;
  resize:vertical;
  min-height:74px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(2,6,23,.25);
  color:var(--text);
  outline:none;
}
#scEditDesc:focus{border-color:rgba(96,165,250,.45)}

/* --- Users module layout fix (v74) --- */
.usersHeader{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:6px 0 14px;}
.usersActions{display:flex;gap:10px;flex-wrap:wrap;}

.usersList{margin-top:10px;}
.usersListHeader,.userRow{display:grid;grid-template-columns:1.2fr 1.7fr 0.9fr 1.0fr 0.6fr 0.9fr;gap:14px;align-items:center;}
.usersListHeader{padding:10px 14px;font-size:12px;letter-spacing:.02em;text-transform:none;opacity:.75;border-bottom:1px solid rgba(255,255,255,.08);}
.userRow{padding:12px 14px;border-bottom:1px solid rgba(255,255,255,.06);}
.userRow:last-child{border-bottom:none;}
.userCell{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.userEdit{display:flex;justify-content:flex-end;}
.userRole .badge{display:inline-flex;align-items:center;gap:6px;}

@media (max-width: 980px){
  .usersListHeader,.userRow{grid-template-columns:1.2fr 1.7fr 0.9fr 0.7fr 0.9fr;}
  .usersListHeader > div:nth-child(4),
  .userRow > .userDate{display:none;}
}
@media (max-width: 720px){
  .usersListHeader,.userRow{grid-template-columns:1.2fr 1.6fr 0.7fr 0.9fr;}
  .usersListHeader > div:nth-child(3),
  .userRow > .userRole{display:none;}
}

/* Hide "bald" badges for implemented modules */
.nav button[data-view="screens"] .pill,
.nav button[data-view="playlists"] .pill,
.nav button[data-view="schedules"] .pill,
.nav button[data-view="users"] .pill {
  display: none;
}



/* ===== Settings / Theme ===== */
html[data-theme="light"] body,
body[data-theme="light"]{
  --bg:#eef2f8;
  --panel:#ffffff;
  --panel2:#f7f9fc;
  --card:#ffffff;
  --line:rgba(15,23,42,.12);
  --text:rgba(15,23,42,.94);
  --muted:rgba(15,23,42,.62);
  --accent:#2563eb;
  --danger:#e11d48;
  --ok:#059669;
  --shadow:0 12px 30px rgba(15,23,42,.08);
  background: radial-gradient(1200px 700px at 20% 0%, #dfeafe, transparent 55%), var(--bg);
}
body[data-theme="light"] .sidebar,
html[data-theme="light"] .sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,249,252,.96));
}
body[data-theme="light"] .brand,
html[data-theme="light"] .brand{
  background: rgba(37,99,235,.03);
}

.settingsWrap{display:grid; gap:12px;}
.settingsCard{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  border-radius:18px;
  padding:14px;
}
.settingsCard h3{margin:0 0 4px; font-size:14px;}
.settingsCard p{margin:0 0 10px; font-size:12px; color:var(--muted);}
.settingsGrid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.settingsActions{display:flex; justify-content:flex-end; gap:10px; margin-top:10px; flex-wrap:wrap;}
.themeChooser{display:flex; gap:8px; flex-wrap:wrap;}
.themeBtn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  min-width:120px;
  text-align:center;
  font-weight:600;
}
.themeBtn.active{
  border-color:rgba(96,165,250,.45);
  background:rgba(96,165,250,.12);
}
.settingsMsg{font-size:12px; color:var(--muted); min-height:18px; margin-top:6px;}
.settingsMsg.ok{color:var(--ok);}
.settingsMsg.err{color:#fecaca;}
@media (max-width: 860px){ .settingsGrid{grid-template-columns:1fr;} }


/* ===== Light Theme refinements (clean) ===== */
html[data-theme="light"] body,
body[data-theme="light"]{
  color: var(--text);
}
html[data-theme="light"] .content,
body[data-theme="light"] .content{
  background: transparent;
}
html[data-theme="light"] .topbar .title h2,
body[data-theme="light"] .topbar .title h2{ color:#0f172a; }
html[data-theme="light"] .nav button:hover,
body[data-theme="light"] .nav button:hover{ background:rgba(37,99,235,.04); border-color:rgba(15,23,42,.08); }
html[data-theme="light"] .nav button.active,
body[data-theme="light"] .nav button.active{ background:rgba(37,99,235,.08); border-color:rgba(37,99,235,.22); }
html[data-theme="light"] .panel,
body[data-theme="light"] .panel{
  background: rgba(255,255,255,.92);
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 14px 35px rgba(15,23,42,.06);
}
html[data-theme="light"] .field,
body[data-theme="light"] .field{
  background:#fff;
  border-color: rgba(15,23,42,.10);
}
html[data-theme="light"] .btn,
body[data-theme="light"] .btn{
  background:#fff;
  border-color: rgba(15,23,42,.10);
}
html[data-theme="light"] .btn:hover,
body[data-theme="light"] .btn:hover{ background:#f8fafc; }
html[data-theme="light"] .btn.primary,
body[data-theme="light"] .btn.primary{
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.28);
  color:#1d4ed8;
}
html[data-theme="light"] .btn.danger,
body[data-theme="light"] .btn.danger{
  background: rgba(225,29,72,.06);
  border-color: rgba(225,29,72,.22);
  color:#be123c;
}
html[data-theme="light"] .modal,
body[data-theme="light"] .modal{ background:#fff; border-color:rgba(15,23,42,.10); box-shadow:0 24px 60px rgba(15,23,42,.14); }
html[data-theme="light"] .dropzone,
body[data-theme="light"] .dropzone{ background:#fff; border-color:rgba(15,23,42,.16); }

/* Settings page polish */
.settingsWrap{display:grid; gap:14px;}
.settingsCard{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border-radius:16px;
  padding:14px;
}
.settingsGridSingle{margin-top:10px;}
.settingsCard h3{margin:0 0 4px; font-size:15px; font-weight:700;}
.settingsCard p{margin:0 0 10px; font-size:12px; color:var(--muted);}
.settingsActions{display:flex; justify-content:flex-end; gap:10px; margin-top:10px; flex-wrap:wrap;}
.themeChooser{display:flex; gap:8px; flex-wrap:wrap;}
.themeBtn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  min-width:110px;
  text-align:center;
  font-weight:600;
}
.themeBtn.active{
  border-color:rgba(96,165,250,.45);
  background:rgba(96,165,250,.12);
}
.settingsMsg{font-size:12px; color:var(--muted); min-height:18px; margin-top:6px;}
.settingsMsg.ok{color:var(--ok);}
.settingsMsg.err{color:#fca5a5;}
html[data-theme="light"] .settingsCard,
body[data-theme="light"] .settingsCard{
  background: #ffffff;
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 6px 18px rgba(15,23,42,.04);
}
html[data-theme="light"] .themeBtn,
body[data-theme="light"] .themeBtn{
  background:#fff;
  border-color: rgba(15,23,42,.10);
}
html[data-theme="light"] .themeBtn.active,
body[data-theme="light"] .themeBtn.active{
  background: rgba(37,99,235,.09);
  border-color: rgba(37,99,235,.26);
  color:#1d4ed8;
}
html[data-theme="light"] .settingsMsg.err,
body[data-theme="light"] .settingsMsg.err{ color:#b91c1c; }

/* ===== Light Theme: Playlist action buttons + badges polish ===== */
html[data-theme="light"] .playlistList,
body[data-theme="light"] .playlistList,
html[data-theme="light"] .playlistEditor,
body[data-theme="light"] .playlistEditor{
  background:#ffffff;
  border-color:rgba(15,23,42,.08);
  box-shadow:0 6px 18px rgba(15,23,42,.04);
}

html[data-theme="light"] .plRow,
body[data-theme="light"] .plRow{
  background:#ffffff;
  border-bottom-color:rgba(15,23,42,.07);
}
html[data-theme="light"] .plRow:hover,
body[data-theme="light"] .plRow:hover{
  background:rgba(37,99,235,.035);
}
html[data-theme="light"] .plRow.active,
body[data-theme="light"] .plRow.active{
  background:rgba(37,99,235,.08);
  border-bottom-color:rgba(37,99,235,.18);
}
html[data-theme="light"] .plRow .n,
body[data-theme="light"] .plRow .n{ color:#0f172a; }
html[data-theme="light"] .plRow .c,
body[data-theme="light"] .plRow .c{ color:#475569; }

html[data-theme="light"] .plEditBtn,
body[data-theme="light"] .plEditBtn{
  background:#ffffff;
  color:#0f172a;
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 1px 1px rgba(15,23,42,.03);
  font-weight:600;
}
html[data-theme="light"] .plEditBtn:hover,
body[data-theme="light"] .plEditBtn:hover{
  background:#f8fafc;
  border-color:rgba(15,23,42,.14);
}
html[data-theme="light"] .plEditBtn:focus-visible,
body[data-theme="light"] .plEditBtn:focus-visible{
  outline:none;
  border-color:rgba(37,99,235,.35);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}

html[data-theme="light"] .plStatusBadge,
body[data-theme="light"] .plStatusBadge{
  background:#f8fafc;
  color:#334155;
  border-color:rgba(15,23,42,.10);
}
html[data-theme="light"] .plStatusBadge.plStatus-draft,
body[data-theme="light"] .plStatusBadge.plStatus-draft{
  background:rgba(37,99,235,.08);
  color:#1d4ed8;
  border-color:rgba(37,99,235,.20);
}
html[data-theme="light"] .plStatusBadge.plStatus-active,
body[data-theme="light"] .plStatusBadge.plStatus-active{
  background:rgba(16,185,129,.08);
  color:#047857;
  border-color:rgba(16,185,129,.22);
}
html[data-theme="light"] .plStatusBadge.plStatus-archived,
body[data-theme="light"] .plStatusBadge.plStatus-archived{
  background:#f8fafc;
  color:#475569;
  border-color:rgba(15,23,42,.10);
}

/* Small helper texts in playlist panels */
html[data-theme="light"] #plListHint,
body[data-theme="light"] #plListHint,
html[data-theme="light"] .playlistEditor .hint,
body[data-theme="light"] .playlistEditor .hint{
  color:#64748b;
}


/* --- Light theme polish: schedules row shadow/gray strip fix --- */
html[data-theme="light"] .scheduleList,
body[data-theme="light"] .scheduleList{
  background:#ffffff !important;
  border-color:rgba(15,23,42,.08) !important;
  box-shadow:none !important;
}

html[data-theme="light"] .scheduleRow,
body[data-theme="light"] .scheduleRow{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.08) !important;
  box-shadow:none !important;
}

html[data-theme="light"] .scheduleRow:hover,
body[data-theme="light"] .scheduleRow:hover{
  background:#f8fbff !important;
  border-color:rgba(37,99,235,.18) !important;
  box-shadow:none !important;
}

/* make schedule text/badge contrast cleaner in light mode */
html[data-theme="light"] .scheduleMeta,
body[data-theme="light"] .scheduleMeta{
  color:#64748b !important;
}
html[data-theme="light"] .scheduleIcon,
body[data-theme="light"] .scheduleIcon{
  background:rgba(59,130,246,.10) !important;
  border-color:rgba(59,130,246,.20) !important;
}
html[data-theme="light"] .scheduleIcon svg,
body[data-theme="light"] .scheduleIcon svg{
  stroke:#2563eb !important;
}
html[data-theme="light"] .scheduleBadge.off,
body[data-theme="light"] .scheduleBadge.off{
  background:#f1f5f9 !important;
  border-color:#e2e8f0 !important;
  color:#475569 !important;
}


/* --- Light theme polish: Schedule edit modal (remove gray blocks) --- */
html[data-theme="light"] #scheduleEditModal.modalWrap,
body[data-theme="light"] #scheduleEditModal.modalWrap{
  background:rgba(15,23,42,.38) !important;
}

html[data-theme="light"] #scheduleEditModal .modal,
body[data-theme="light"] #scheduleEditModal .modal{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.10) !important;
  box-shadow:0 24px 64px rgba(15,23,42,.18) !important;
}

html[data-theme="light"] #scheduleEditModal .modalHeader,
body[data-theme="light"] #scheduleEditModal .modalHeader,
html[data-theme="light"] #scheduleEditModal .modalFooter,
body[data-theme="light"] #scheduleEditModal .modalFooter{
  background:#ffffff !important;
  border-color:rgba(15,23,42,.08) !important;
}

html[data-theme="light"] #scheduleEditModal .modalBody,
body[data-theme="light"] #scheduleEditModal .modalBody{
  background:#ffffff !important;
}

html[data-theme="light"] #scheduleEditModal .cardMini,
body[data-theme="light"] #scheduleEditModal .cardMini{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.08) !important;
  box-shadow:0 2px 10px rgba(15,23,42,.04);
}

html[data-theme="light"] #scheduleEditModal .field,
body[data-theme="light"] #scheduleEditModal .field{
  background:#ffffff !important;
  border-color:rgba(15,23,42,.10) !important;
}

html[data-theme="light"] #scheduleEditModal .field:focus-within,
body[data-theme="light"] #scheduleEditModal .field:focus-within{
  border-color:rgba(37,99,235,.32) !important;
  box-shadow:0 0 0 3px rgba(37,99,235,.10);
}

html[data-theme="light"] #scheduleEditModal .field input,
body[data-theme="light"] #scheduleEditModal .field input,
html[data-theme="light"] #scheduleEditModal .field select,
body[data-theme="light"] #scheduleEditModal .field select,
html[data-theme="light"] #scheduleEditModal #scEditDesc,
body[data-theme="light"] #scheduleEditModal #scEditDesc{
  color:#0f172a !important;
}

html[data-theme="light"] #scheduleEditModal #scEditDesc,
body[data-theme="light"] #scheduleEditModal #scEditDesc{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.10) !important;
}
html[data-theme="light"] #scheduleEditModal #scEditDesc::placeholder,
body[data-theme="light"] #scheduleEditModal #scEditDesc::placeholder,
html[data-theme="light"] #scheduleEditModal input::placeholder,
body[data-theme="light"] #scheduleEditModal input::placeholder{
  color:#94a3b8 !important;
}

html[data-theme="light"] #scheduleEditModal .label,
body[data-theme="light"] #scheduleEditModal .label{
  color:#0f172a !important;
}
html[data-theme="light"] #scheduleEditModal .hint,
body[data-theme="light"] #scheduleEditModal .hint,
html[data-theme="light"] #scheduleEditModal .subHint,
body[data-theme="light"] #scheduleEditModal .subHint{
  color:#64748b !important;
}

html[data-theme="light"] #scheduleEditModal .weekdays,
body[data-theme="light"] #scheduleEditModal .weekdays{
  gap:10px;
}
html[data-theme="light"] #scheduleEditModal .dayBtn,
body[data-theme="light"] #scheduleEditModal .dayBtn{
  background:#f8fafc !important;
  border:1px solid rgba(15,23,42,.08) !important;
  color:#334155 !important;
}
html[data-theme="light"] #scheduleEditModal .dayBtn:hover,
body[data-theme="light"] #scheduleEditModal .dayBtn:hover{
  background:#eff6ff !important;
  border-color:rgba(37,99,235,.18) !important;
}
html[data-theme="light"] #scheduleEditModal .dayBtn.active,
body[data-theme="light"] #scheduleEditModal .dayBtn.active{
  background:rgba(37,99,235,.10) !important;
  border-color:rgba(37,99,235,.24) !important;
  color:#1d4ed8 !important;
}

html[data-theme="light"] #scheduleEditModal .switch .slider,
body[data-theme="light"] #scheduleEditModal .switch .slider{
  background:#e2e8f0 !important;
  border-color:#dbe3ee !important;
}
html[data-theme="light"] #scheduleEditModal .switch input:checked + .slider,
body[data-theme="light"] #scheduleEditModal .switch input:checked + .slider{
  background:rgba(16,185,129,.20) !important;
  border-color:rgba(16,185,129,.28) !important;
}

html[data-theme="light"] #scheduleEditModal .btn,
body[data-theme="light"] #scheduleEditModal .btn{
  background:#ffffff;
  border-color:rgba(15,23,42,.10);
  color:#334155;
}
html[data-theme="light"] #scheduleEditModal .btn:hover,
body[data-theme="light"] #scheduleEditModal .btn:hover{
  background:#f8fafc;
}
html[data-theme="light"] #scheduleEditModal .btn.primary,
body[data-theme="light"] #scheduleEditModal .btn.primary{
  background:rgba(37,99,235,.08);
  border-color:rgba(37,99,235,.24);
  color:#1d4ed8;
}
html[data-theme="light"] #scheduleEditModal .btn.danger,
body[data-theme="light"] #scheduleEditModal .btn.danger{
  background:rgba(239,68,68,.06);
  border-color:rgba(239,68,68,.18);
  color:#dc2626;
}

/* --- Light theme polish: Users module (remove gray rows / improve readability) --- */
html[data-theme="light"] #usersPanelRoot .panelCard,
body[data-theme="light"] #usersPanelRoot .panelCard{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.08) !important;
  border-radius:18px !important;
  box-shadow:0 6px 18px rgba(15,23,42,.04) !important;
}

html[data-theme="light"] #usersPanelRoot .pageHeader h1,
body[data-theme="light"] #usersPanelRoot .pageHeader h1,
html[data-theme="light"] #usersPanelRoot .panelCard h1,
body[data-theme="light"] #usersPanelRoot .panelCard h1{
  color:#0f172a !important;
}

html[data-theme="light"] #usersPanelRoot .pageHeader p,
body[data-theme="light"] #usersPanelRoot .pageHeader p,
html[data-theme="light"] #usersPanelRoot .panelCard p,
body[data-theme="light"] #usersPanelRoot .panelCard p,
html[data-theme="light"] #usersPanelRoot #usersStatus,
body[data-theme="light"] #usersPanelRoot #usersStatus{
  color:#64748b !important;
}

html[data-theme="light"] #usersPanelRoot .usersHead,
body[data-theme="light"] #usersPanelRoot .usersHead{
  background:#f8fafc !important;
  border:1px solid rgba(15,23,42,.06) !important;
  border-radius:14px !important;
  color:#64748b !important;
}

html[data-theme="light"] #usersPanelRoot .usersList,
body[data-theme="light"] #usersPanelRoot .usersList{
  gap:10px !important;
}

html[data-theme="light"] #usersPanelRoot .userRow,
body[data-theme="light"] #usersPanelRoot .userRow{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.08) !important;
  border-radius:16px !important;
  box-shadow:0 2px 10px rgba(15,23,42,.03) !important;
}

html[data-theme="light"] #usersPanelRoot .userRow:hover,
body[data-theme="light"] #usersPanelRoot .userRow:hover{
  background:#fbfdff !important;
  border-color:rgba(37,99,235,.16) !important;
  box-shadow:0 4px 14px rgba(37,99,235,.06) !important;
}

html[data-theme="light"] #usersPanelRoot .userRow .name,
body[data-theme="light"] #usersPanelRoot .userRow .name,
html[data-theme="light"] #usersPanelRoot .userRow .email,
body[data-theme="light"] #usersPanelRoot .userRow .email,
html[data-theme="light"] #usersPanelRoot .userRow .role,
body[data-theme="light"] #usersPanelRoot .userRow .role,
html[data-theme="light"] #usersPanelRoot .userRow .date,
body[data-theme="light"] #usersPanelRoot .userRow .date{
  color:#0f172a !important;
}
html[data-theme="light"] #usersPanelRoot .userRow .email,
body[data-theme="light"] #usersPanelRoot .userRow .email,
html[data-theme="light"] #usersPanelRoot .userRow .date,
body[data-theme="light"] #usersPanelRoot .userRow .date{
  color:#475569 !important;
}

html[data-theme="light"] #usersPanelRoot .emptyState,
body[data-theme="light"] #usersPanelRoot .emptyState{
  background:#ffffff !important;
  border:1px dashed rgba(15,23,42,.12) !important;
  color:#64748b !important;
  border-radius:14px !important;
}

/* Users modal in light mode: override dark inline blocks */
html[data-theme="light"] #usersModal.modalOverlay,
body[data-theme="light"] #usersModal.modalOverlay{
  background:rgba(15,23,42,.40) !important;
}
html[data-theme="light"] #usersModal .modalCard,
body[data-theme="light"] #usersModal .modalCard{
  background:#ffffff !important;
  border:1px solid rgba(15,23,42,.10) !important;
  box-shadow:0 24px 64px rgba(15,23,42,.18) !important;
}
html[data-theme="light"] #usersModal .modalHead,
body[data-theme="light"] #usersModal .modalHead,
html[data-theme="light"] #usersModal .modalBody,
body[data-theme="light"] #usersModal .modalBody,
html[data-theme="light"] #usersModal .modalFoot,
body[data-theme="light"] #usersModal .modalFoot{
  background:#ffffff !important;
  border-color:rgba(15,23,42,.08) !important;
}
html[data-theme="light"] #usersModal label,
body[data-theme="light"] #usersModal label,
html[data-theme="light"] #usersModal h3,
body[data-theme="light"] #usersModal h3{
  color:#0f172a !important;
}
html[data-theme="light"] #usersModal p,
body[data-theme="light"] #usersModal p,
html[data-theme="light"] #usersModal #umState,
body[data-theme="light"] #usersModal #umState{
  color:#64748b !important;
}
html[data-theme="light"] #usersModal input,
body[data-theme="light"] #usersModal input,
html[data-theme="light"] #usersModal select,
body[data-theme="light"] #usersModal select{
  background:#ffffff !important;
  border-color:rgba(15,23,42,.10) !important;
  color:#0f172a !important;
}
html[data-theme="light"] #usersModal input::placeholder,
body[data-theme="light"] #usersModal input::placeholder{
  color:#94a3b8 !important;
}
html[data-theme="light"] #usersModal [style*="background: rgba(255,255,255,0.05)"],
body[data-theme="light"] #usersModal [style*="background: rgba(255,255,255,0.05)"]{
  background:#ffffff !important;
  border-color:rgba(15,23,42,.08) !important;
  box-shadow:0 2px 10px rgba(15,23,42,.04) !important;
}
html[data-theme="light"] #usersModal [style*="color: rgba(255,255,255,0.60)"],
body[data-theme="light"] #usersModal [style*="color: rgba(255,255,255,0.60)"],
html[data-theme="light"] #usersModal [style*="color: rgba(255,255,255,0.70)"],
body[data-theme="light"] #usersModal [style*="color: rgba(255,255,255,0.70)"]{
  color:#64748b !important;
}
