/* =========================================================================
   LITORAL OSCURO RADIO — hoja compartida
   Tokens de diseño + primitivas usadas por /admin y /escuchar
   ========================================================================= */

:root {
  /* paleta */
  --bg: #0a0a0a;
  --bg-2: #121212;
  --panel: #1a1a1a;
  --panel-2: #151515;
  --row: #141414;
  --border: #2a2a2a;
  --border-hi: #3a3a3a;
  --accent: #e11d2e;
  --accent-dark: #8b0f1a;
  --accent-soft: rgba(225, 29, 46, 0.14);
  --text: #e6e6e6;
  --muted: #8a8a8a;
  --ok: #35d07f;
  --warn: #f0b429;

  /* medidas */
  --radius: 10px;
  --radius-lg: 14px;

  /* medidas densas (estilo aplicación de escritorio, las usa /admin) */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --hdr-h: 34px;
  --tp-h: 64px;
  --fs-tiny: 10px;
  --fs-micro: 9.5px;
  --row-dense: 22px;

  /* tipografía */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* sombras */
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --glow: 0 0 18px rgba(225, 29, 46, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 86% -12%, rgba(225, 29, 46, 0.13), transparent 62%),
    radial-gradient(760px 480px at -8% 108%, rgba(139, 15, 26, 0.16), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- marca -- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand b {
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 0 14px rgba(225, 29, 46, 0.55);
}

.brand-logo {
  color: var(--accent);
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(225, 29, 46, 0.6));
}

/* logo "prendido": el círculo abre el panel del operador (no se mueve nada) */
.brand-hit {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.brand-hit:hover {
  filter: brightness(1.35);
  transform: scale(1.06);
}

.brand-home {
  color: inherit;
  text-decoration: none;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-weight: 600;
}

/* -------------------------------------------------------------- botones -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #151515;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.06s ease;
  user-select: none;
}

.btn:hover {
  background: #1f1f1f;
  border-color: var(--border-hi);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: linear-gradient(180deg, #e11d2e, #b8121f);
  border-color: rgba(255, 100, 115, 0.45);
  color: #fff;
  box-shadow: var(--glow);
}

.btn-accent:hover {
  background: linear-gradient(180deg, #f2263a, #c8152a);
  border-color: rgba(255, 130, 143, 0.7);
  box-shadow: 0 0 26px rgba(225, 29, 46, 0.55);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: #1e0f12;
  border-color: #48181f;
  color: #ff8a95;
}

.btn-danger:hover {
  background: #2a1216;
  border-color: var(--accent-dark);
}

.btn-sm {
  padding: 0.32rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 7px;
}

.btn-square {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.05rem;
  border-radius: 11px;
}

.btn-round {
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.2rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #171717;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: #202020;
}

.icon-btn.danger:hover {
  color: #ff8a95;
  border-color: var(--accent-dark);
  background: #201013;
}

/* --------------------------------------------------------------- campos -- */

.input,
input[type="text"],
input[type="password"],
input[type="search"],
input[type="time"] {
  width: 100%;
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f0f0f;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #6c6c6c;
}

.input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="time"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.18);
}

select {
  width: 100%;
  padding: 0.58rem 2rem 0.58rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #0f0f0f;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4.5l4 4 4-4' fill='none' stroke='%238a8a8a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.18);
}

input[type="time"] {
  color-scheme: dark;
}

label.field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* barra de volumen / rangos */
input[type="range"] {
  --fill: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill), #2c2c2c var(--fill));
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 10px rgba(225, 29, 46, 0.7);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 10px rgba(225, 29, 46, 0.7);
  cursor: pointer;
}

/* --------------------------------------------------------------- panels -- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.panel-head h2 {
  position: relative;
  padding-left: 0.72rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0.95em;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(225, 29, 46, 0.7);
}

/* --------------------------------------------------------------- listas -- */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
}

.rows::-webkit-scrollbar {
  width: 8px;
}

.rows::-webkit-scrollbar-thumb {
  background: #303030;
  border-radius: 8px;
}

.rows::-webkit-scrollbar-track {
  background: transparent;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--row);
  border: 1px solid #232323;
  border-radius: 9px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.row:hover {
  border-color: #333;
  background: #171717;
}

.row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.row-title {
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-time {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.empty {
  margin: 0;
  padding: 1rem 0.6rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  border: 1px dashed var(--border);
  border-radius: 9px;
}

.hint {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: italic;
}

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-block;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}

.badge-music {
  background: rgba(225, 29, 46, 0.16);
  color: #ff7b88;
  border-color: rgba(225, 29, 46, 0.4);
}

.badge-jingle {
  background: rgba(240, 180, 41, 0.12);
  color: #f5c95f;
  border-color: rgba(240, 180, 41, 0.35);
}

.badge-ad {
  background: rgba(120, 150, 255, 0.12);
  color: #9db4ff;
  border-color: rgba(120, 150, 255, 0.35);
}

.badge-pisador {
  background: rgba(168, 85, 247, 0.14);
  color: #c9a4ff;
  border-color: rgba(168, 85, 247, 0.4);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-ok {
  background: rgba(53, 208, 127, 0.12);
  color: #5ee39b;
  border-color: rgba(53, 208, 127, 0.35);
}

.pill-bad {
  background: rgba(225, 29, 46, 0.14);
  color: #ff7b88;
  border-color: rgba(225, 29, 46, 0.4);
}

.pill-neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border-color: var(--border);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(225, 29, 46, 0.9);
  animation: pulse 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

/* ------------------------------------------------------ switch (toggle) -- */

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 23px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch .track {
  position: absolute;
  inset: 0;
  background: #262626;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  transition: 0.2s ease;
  pointer-events: none;
}

.switch .track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #777;
  transition: 0.2s ease;
}

.switch input:checked + .track {
  background: rgba(225, 29, 46, 0.32);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(225, 29, 46, 0.45);
}

.switch input:checked + .track::before {
  transform: translateX(18px);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(225, 29, 46, 0.9);
}

.switch input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------- ecualizador -- */

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.eq span {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff4757, var(--accent-dark));
  box-shadow: 0 0 8px rgba(225, 29, 46, 0.6);
  transform-origin: bottom center;
  animation: eq-bounce 0.9s ease-in-out infinite;
}

.eq span:nth-child(1) {
  animation-delay: -0.75s;
}
.eq span:nth-child(2) {
  animation-delay: -0.45s;
}
.eq span:nth-child(3) {
  animation-delay: -0.15s;
}
.eq span:nth-child(4) {
  animation-delay: -0.6s;
}
.eq span:nth-child(5) {
  animation-delay: -0.3s;
}
.eq span:nth-child(6) {
  animation-delay: -0.9s;
}
.eq span:nth-child(7) {
  animation-delay: -0.05s;
}

@keyframes eq-bounce {
  0%,
  100% {
    transform: scaleY(0.22);
  }
  50% {
    transform: scaleY(1);
  }
}

/* ------------------------------------------------------------- toasts -- */

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  padding: 0.68rem 0.9rem;
  border-radius: 9px;
  background: #161616;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  box-shadow: var(--shadow);
  font-size: 0.83rem;
  line-height: 1.35;
  color: var(--text);
  animation: toast-in 0.24s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.ok {
  border-left-color: var(--ok);
}

.toast.err {
  border-left-color: var(--accent);
}

.toast.hide {
  opacity: 0;
  transform: translateX(24px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
