/* ============================================ */
/* Modals                                       */
/* ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: backdrop-in 0.15s ease-out;
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.modal--sm { max-width: 380px; }
.modal--lg { max-width: 720px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.modal__body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal__footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-subtle);
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ============================================ */
/* Form fields                                  */
/* ============================================ */
.form-field {
  margin-bottom: 16px;
}
.form-field > label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.1s ease;
  font-family: inherit;
}
.form-input:hover { border-color: var(--border-strong); }
.form-input:focus {
  border-color: var(--elsia-navy);
  box-shadow: 0 0 0 3px rgba(42, 49, 66, 0.08);
}
.form-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Color picker swatches */
.color-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.is-active {
  border-color: var(--bg-surface);
  box-shadow: 0 0 0 2px var(--elsia-navy), 0 0 0 4px var(--bg-surface);
}

/* ============================================ */
/* Media picker (inside modal)                  */
/* ============================================ */
.media-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
  max-height: 60vh;
}
.media-picker__head { display: flex; gap: 8px; }
.media-picker__chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.media-picker__grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px;
}
.media-picker__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: left;
}
.media-picker__item:hover {
  border-color: var(--elsia-navy);
  background: var(--bg-subtle);
}
.media-picker__item > svg {
  color: var(--text-muted);
  transition: color 0.1s ease;
}
.media-picker__item:hover > svg { color: var(--elsia-navy); }
.media-picker__thumb {
  width: 56px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
}
.media-picker__info { flex: 1; min-width: 0; }
.media-picker__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-picker__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  margin-top: 2px;
}
.media-picker__empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================ */
/* Empty state                                  */
/* ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state > svg:first-child { color: var(--text-faint); margin-bottom: 4px; }
.empty-state__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-state__sub {
  font-size: 12px;
  max-width: 280px;
  margin-bottom: 8px;
}

/* Zone items empty */
.zone-items__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
}
.zone-items__empty > svg { color: var(--text-faint); }

/* ============================================ */
/* Toast                                        */
/* ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--elsia-navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 99px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toast-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast > svg { color: var(--elsia-yellow); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Playlist editor title — clickable */
.playlist-editor__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text-primary);
  cursor: text;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: -6px;
  transition: background 0.1s ease;
}
.playlist-editor__title:hover { background: var(--bg-subtle); }

/* Playlist radio list (used in Add to playlist modal) */
.playlist-radio-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}
.playlist-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: left;
  width: 100%;
}
.playlist-radio:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}
.playlist-radio.is-active {
  border-color: var(--elsia-navy);
  background: var(--bg-subtle);
  box-shadow: 0 0 0 1px var(--elsia-navy);
}
.playlist-radio.is-active > svg { color: var(--elsia-navy); }
.playlist-radio__strip {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}

.playlist-radio--new {
  border-style: dashed;
  background: transparent;
}
.playlist-radio--new:hover {
  border-color: var(--elsia-navy);
  background: var(--bg-subtle);
}

/* Day buttons + select dropdown (Schedule modal) */
.day-row {
  display: flex;
  gap: 6px;
}
.day-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.1s ease;
}
.day-btn:hover { background: var(--bg-subtle); }
.day-btn.is-active {
  background: var(--elsia-navy);
  border-color: var(--elsia-navy);
  color: #fff;
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
  cursor: pointer;
}

/* Zone radio (A/B/C/D selector) */
.zone-radio-row {
  display: flex;
  gap: 6px;
}
.zone-radio {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.1s ease;
}
.zone-radio:hover { background: var(--bg-subtle); }
.zone-radio.is-active {
  border-color: currentColor;
  background: var(--bg-subtle);
}
.zone-radio__letter {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.zone-radio__count {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}
