:root {
  --bg: #0b0b0f;
  --panel: #151821;
  --panel-2: #1c2030;
  --panel-3: #252b40;
  --border: rgba(255,255,255,0.1);
  --text: #f5f7fb;
  --muted: rgba(245,247,251,0.68);
  --accent: #6d8cff;
  --accent-2: #4e69d8;
  --danger: #ff6f7f;
  --shadow: 0 14px 40px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 6px;
}
.hidden { display: none !important; }

.control-body { min-height: 100vh; }
.control-shell {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}
.sidebar, .main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sticky-top {
  position: sticky;
  top: 18px;
  z-index: 5;
}
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-head { margin-bottom: 14px; }
.between {
  display: flex;
  justify-content: space-between;
}
.align-center { align-items: center; }
.gap-12 { gap: 12px; }
.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
h1, h2 {
  margin: 0;
  line-height: 1.2;
}
h1 { font-size: 26px; }
h2 { font-size: 22px; }
.muted {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.status-box {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}
.status-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.control-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.main-toolbar { margin-bottom: 14px; }
.control-btn, .primary-btn, .ghost-btn, .small-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 14px;
  transition: 0.18s ease;
}
.control-btn {
  width: 52px;
  height: 52px;
  font-size: 22px;
}
.primary-btn, .ghost-btn, .small-btn {
  padding: 11px 14px;
}
.control-btn:hover, .primary-btn:hover, .ghost-btn:hover, .small-btn:hover {
  transform: translateY(-1px);
  background: var(--panel-3);
}
.control-btn.primary, .primary-btn {
  background: var(--accent);
  border-color: transparent;
}
.control-btn.primary:hover, .primary-btn:hover { background: var(--accent-2); }
.ghost-btn { background: transparent; }
.ghost-btn.danger {
  border-color: rgba(255,111,127,0.35);
  color: #ffd0d6;
}
.playlist-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.toggle-row, .field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}
.field-row {
  flex-direction: column;
  align-items: flex-start;
}
.field-row span, .toggle-row span {
  font-size: 14px;
}
.field-row input[type="time"],
.field-row input[type="search"],
.repeat-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}
.now-box {
  background: rgba(0,0,0,0.24);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}
.now-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.now-meta {
  color: var(--muted);
  font-size: 14px;
}
.upload-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}
.upload-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 12px;
}
.upload-label span {
  color: var(--muted);
  font-size: 14px;
}
.upload-label input { width: 100%; color: var(--text); }
.status-line {
  min-height: 18px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.library-list, .playlist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-item, .playlist-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.list-main, .playlist-main { min-width: 0; }
.list-title, .playlist-title {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-meta, .playlist-meta, .playlist-schedule {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.list-actions, .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.small-btn.secondary { background: rgba(255,255,255,0.05); }
.playlist-item.active {
  border-color: rgba(109,140,255,0.6);
  background: rgba(109,140,255,0.12);
}
.playlist-item.dragging {
  opacity: 0.45;
}
.playlist-item.drop-target {
  outline: 2px dashed rgba(109,140,255,0.7);
  outline-offset: 2px;
}
.playlist-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.drag-handle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.playlist-main {
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 0;
}
.grid-bottom {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: end;
}
.grid-bottom label span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}
.placeholder {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
}

.player-only-body {
  margin: 0;
  background: #000;
  overflow: hidden;
}
.player-only-wrap {
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-only-video {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
}

@media (max-width: 1180px) {
  .control-shell {
    grid-template-columns: 1fr;
  }
  .sticky-top {
    position: static;
  }
}
@media (max-width: 760px) {
  .control-shell {
    padding: 12px;
    gap: 12px;
  }
  .two-cols,
  .status-grid,
  .upload-form,
  .grid-bottom {
    grid-template-columns: 1fr;
  }
  .list-item,
  .between,
  .playlist-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .drag-handle { width: 100%; height: 40px; }
}
