/* ============================================ */
/* Playlists                                    */
/* ============================================ */
.playlist-rail {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.playlist-rail__search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.playlist-rail__list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.playlist-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  transition: background 0.08s ease;
  margin-bottom: 2px;
}
.playlist-row:hover { background: var(--bg-subtle); }
.playlist-row.is-selected {
  background: var(--bg-subtle);
  border-color: var(--border);
}
.playlist-row__strip {
  width: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}
.playlist-row__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.playlist-row__meta {
  display: flex;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.playlist-row__schedule {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.playlist-row__schedule svg { color: var(--text-faint); }

.playlist-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-app);
}
.playlist-editor__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.playlist-editor__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text-primary);
}
.playlist-editor__meta {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.playlist-editor__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.playlist-editor__meta svg { color: var(--text-faint); }
.playlist-editor__body {
  flex: 1;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px;
  overflow: auto;
  min-height: 0;
  align-content: start;
}
@media (max-width: 1180px) {
  .playlist-editor__body { grid-template-columns: minmax(0, 1fr); }
}

/* Zone preview (mur de tuiles) */
.zone-preview {
  display: grid;
  aspect-ratio: 16/9;
  background: #0F1419;
  border-radius: var(--r-md);
  overflow: hidden;
  gap: 2px;
  padding: 2px;
}
.zone-preview__zone {
  background: #1E2433;
  border: 2px solid transparent;
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.12s ease;
  color: rgba(255,255,255,0.7);
}
.zone-preview__zone:hover { background: #262E40; }
.zone-preview__zone.is-active {
  background: #262E40;
  box-shadow: inset 0 0 0 2px currentColor;
}
.zone-preview__letter {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.zone-preview__count {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

/* Layout picker */
.layout-picker { margin-top: 16px; }
.layout-picker__label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.layout-picker__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.layout-picker__item {
  padding: 8px 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
  color: var(--text-secondary);
}
.layout-picker__item:hover { background: var(--bg-subtle); }
.layout-picker__item.is-active {
  background: var(--elsia-navy);
  border-color: var(--elsia-navy);
  color: #fff;
}
.layout-picker__mini {
  width: 30px; height: 22px;
  display: grid;
  gap: 1.5px;
}
.layout-picker__mini > div {
  background: currentColor;
  opacity: 0.85;
  border-radius: 1px;
}
.layout-picker__name {
  font-size: 10.5px;
  font-weight: 500;
  text-align: center;
}

/* Zone stats below preview */
.zone-stats {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.zone-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.zone-stat__letter {
  width: 16px; height: 16px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
}

/* Zone items list */
.zone-items {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.zone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  transition: all 0.08s ease;
}
.zone-item:hover {
  background: var(--bg-subtle);
}
.zone-item__num {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.zone-item__handle {
  color: var(--text-faint);
  cursor: grab;
}
.zone-item__handle:hover { color: var(--text-secondary); }
.zone-item__title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zone-item__meta { display: flex; align-items: center; gap: 4px; font-size: 11.5px; margin-top: 2px; }
.zone-item__actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; }
.zone-item:hover .zone-item__actions { opacity: 1; }
.zone-item--add {
  border: 1px dashed var(--border-strong);
  background: transparent;
  cursor: pointer;
  justify-content: center;
  padding: 9px;
}
.zone-item--add:hover { border-color: var(--elsia-navy); background: var(--bg-subtle); }

/* ============================================ */
/* Schedule                                     */
/* ============================================ */
.schedule-grid {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  position: relative;
  box-shadow: var(--shadow-xs);
}
.schedule-cell {
  padding: 0;
  border-right: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
  position: relative;
  min-height: 38px;
  background: var(--bg-surface);
}
.schedule-cell:last-child { border-right: none; }
.schedule-header {
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.schedule-header__sub {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}
.schedule-header--today {
  color: var(--elsia-navy);
}
.schedule-hour {
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.schedule-block {
  position: relative;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px;
}
.schedule-block:hover {
  transform: scale(1.01);
  z-index: 3;
}
.schedule-block__title { font-weight: 600; line-height: 1.2; }
.schedule-block__meta {
  font-size: 10.5px;
  font-family: var(--font-mono);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.schedule-now-line {
  position: absolute;
  left: 60px;
  right: 0;
  height: 1.5px;
  background: var(--live);
  z-index: 4;
  pointer-events: none;
}
.schedule-now-line::before {
  content: "MAINTENANT";
  position: absolute;
  left: 6px;
  top: -7px;
  font-size: 9px;
  font-weight: 700;
  color: var(--live);
  background: var(--bg-app);
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.06em;
}
.schedule-now-line::after {
  content: "";
  position: absolute;
  left: -3px; top: -2.5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
}

.schedule-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.schedule-legend__item { display: flex; align-items: center; gap: 6px; }
.schedule-legend__dot { width: 9px; height: 9px; border-radius: 2px; }

/* ============================================ */
/* Screens                                      */
/* ============================================ */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.screen-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.1s ease;
}
.screen-card:hover { box-shadow: var(--shadow-sm); }
.screen-card__preview {
  aspect-ratio: 16/9;
  background: #0F1419;
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.screen-card__preview--offline {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  background: #1A1F2C;
  color: rgba(255,255,255,0.5);
}
.screen-card__status {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex; align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.95);
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  width: auto;
  z-index: 2;
}
.screen-card__status-dot { width: 5px; height: 5px; border-radius: 50%; }
.screen-card__resolution {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(255,255,255,0.95);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.screen-card__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.screen-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.screen-card__location {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.screen-card__playing {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 6px 8px;
  background: var(--bg-subtle);
  border-radius: 5px;
}
.screen-card__actions {
  display: flex;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-faint);
  margin-top: 4px;
}

/* ============================================ */
/* Stats                                        */
/* ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 24px 8px 8px;
  height: 220px;
  position: relative;
}
.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.bar-chart__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.bar-chart__bar {
  width: 100%;
  background: var(--elsia-navy);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: opacity 0.12s ease;
  min-height: 4px;
}
.bar-chart__bar:hover { opacity: 0.85; }
.bar-chart__bar--muted {
  background: var(--border-strong);
}
.bar-chart__value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.bar-chart__label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.bar-chart__grid {
  position: absolute;
  left: 8px; right: 8px;
  top: 24px; bottom: 28px;
  pointer-events: none;
}
.bar-chart__grid-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed var(--border);
}

.top-list { padding: 10px 16px 16px; }
.top-list__row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-faint);
}
.top-list__row:last-child { border-bottom: none; }
.top-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.top-list__label { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.top-list__value { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-primary); }
.top-list__bar {
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}
.top-list__bar > div {
  height: 100%;
  background: var(--elsia-navy);
  border-radius: 2px;
}
.top-list__share { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Heatmap */
.heatmap {
  display: grid;
  grid-template-columns: 60px repeat(24, 1fr);
  gap: 2px;
  font-family: var(--font-mono);
}
.heatmap__label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 4px;
  display: flex;
  align-items: center;
}
.heatmap__cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--bg-subtle);
}
.heatmap__hour {
  font-size: 9.5px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
}

/* === Page Paramètres === */
.settings-list { padding: 4px 0; }
.settings-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row__label { flex: 1; min-width: 0; }
.settings-row__title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.settings-row__desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.settings-switch {
  width: 38px; height: 22px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}
.settings-switch:hover { border-color: var(--border-strong); }
.settings-switch--on {
  background: var(--elsia-yellow, #F5A623);
  border-color: var(--elsia-yellow, #F5A623);
}
.settings-switch__knob {
  position: absolute;
  top: 1px; left: 1px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.settings-switch--on .settings-switch__knob {
  transform: translateX(16px);
}

.settings-row--block { flex-direction: column; align-items: stretch; gap: 10px; }
.settings-input, .settings-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.settings-textarea { resize: vertical; min-height: 80px; }
