/* ── CueBodas Design System ─────────────────────────────────────────────────
 *
 * Tokens CSS con prefijo --cue-* para los 3 portales:
 *   :root              → Admin + Pareja (light, profesional/cálido)
 *   [data-theme="dj"]  → DJ (dark FORZADO, independiente del SO)
 *
 * NUNCA usar valores de color hardcoded en componentes.
 * Usar siempre: hsl(var(--cue-*))
 * ──────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Marca ──────────────────────────────────────────────────────────── */
  --cue-primary:          195 100% 28%;   /* #008CB6 — ratio 5.8:1 WCAG AA ✓ */
  --cue-primary-hover:    195 100% 22%;   /* #006D8F */
  --cue-primary-light:    195 100% 93%;   /* #E0F5FB */

  /* ── Neutros ────────────────────────────────────────────────────────── */
  --cue-secondary:        335 4% 30%;
  --cue-background:       0 0% 100%;      /* #FFFFFF */
  --cue-surface:          210 30% 96%;    /* #EFF3F8 — delta 4% vs bg ✓ */
  --cue-border:           210 14% 89%;    /* #DEE3E9 */
  --cue-text:             220 13% 15%;    /* #1E2230 */
  --cue-text-muted:       220 9% 46%;     /* #6B7280 */

  /* ── Semánticos ─────────────────────────────────────────────────────── */
  --cue-danger:           0 72% 51%;      /* #DC2626 */
  --cue-danger-light:     0 86% 97%;      /* #FEF2F2 */
  --cue-danger-bg:        0 84% 97%;
  --cue-success:          142 76% 28%;    /* #117A38 — WCAG AA ✓ */
  --cue-success-light:    138 76% 97%;    /* #F0FDF4 */
  --cue-success-bg:       142 76% 96%;
  --cue-warning:          32 100% 35%;    /* #B25800 — ratio 5.5:1 WCAG AA ✓ */
  --cue-warning-light:    38 92% 95%;     /* #FEF3E2 */
  --cue-warning-bg:       38 92% 95%;

  /* ── Prioridades de canciones ───────────────────────────────────────── */
  --cue-must-play:        142 76% 28%;
  --cue-optional:         220 9% 60%;
  --cue-normal:           220 13% 15%;

  /* ── Escala de neutros ──────────────────────────────────────────────── */
  --cue-neutral-100:      220 9% 97%;
  --cue-neutral-200:      220 9% 93%;
  --cue-neutral-300:      210 14% 89%;
  --cue-neutral-400:      220 9% 70%;
  --cue-neutral-600:      220 9% 46%;
  --cue-neutral-700:      220 9% 36%;
  --cue-neutral-900:      220 13% 15%;

  /* ── Aliases semánticos ─────────────────────────────────────────────── */
  --cue-error:              0 72% 51%;
  --cue-primary-foreground: 0 0% 100%;
  --cue-accent:             195 100% 28%;  /* Admin accent = primary */

  /* ── Radios ─────────────────────────────────────────────────────────── */
  --cue-radius:      0.5rem;
  --cue-radius-sm:   0.375rem;
  --cue-radius-md:   0.5rem;
  --cue-radius-lg:   0.75rem;
  --cue-radius-full: 9999px;

  /* ── Sombras ────────────────────────────────────────────────────────── */
  --cue-shadow-sm: 0 1px 2px 0 hsl(220 13% 15% / .05);
  --cue-shadow:    0 4px 12px -2px hsl(220 13% 15% / .08), 0 2px 4px -2px hsl(220 13% 15% / .04);
  --cue-shadow-lg: 0 20px 40px -8px hsl(220 13% 15% / .15), 0 8px 16px -4px hsl(220 13% 15% / .08);

  /* ── Motion ─────────────────────────────────────────────────────────── */
  --cue-ease: cubic-bezier(.4, 0, .2, 1);

  /* ── Focus ring ─────────────────────────────────────────────────────── */
  --cue-ring: 195 100% 60%;

  /* ── Escala tipográfica modular (ratio ~1.25) ───────────────────────── */
  --fs-xs:   0.75rem;    /* 12px */
  --fs-sm:   0.875rem;   /* 14px */
  --fs-base: 1rem;       /* 16px */
  --fs-lg:   1.125rem;   /* 18px */
  --fs-xl:   1.25rem;    /* 20px */
  --fs-2xl:  1.5rem;     /* 24px */
  --fs-3xl:  1.875rem;   /* 30px — H1 admin/dj */
  --fs-4xl:  2.5rem;     /* 40px */

  /* ── Tipografía (legacy aliases) ────────────────────────────────────── */
  --cue-font-size-xs:    0.75rem;
  --cue-font-size-sm:    0.8125rem;
  --cue-font-size-base:  0.9375rem;
  --cue-font-size-lg:    1.0625rem;
  --cue-font-size-xl:    1.125rem;
  --cue-font-size-2xl:   1.375rem;
  --cue-font-weight-normal:   400;
  --cue-font-weight-medium:   500;
  --cue-font-weight-semibold: 600;
  --cue-font-weight-bold:     700;
}

/* ── Tema DJ — Dark FORZADO ─────────────────────────────────────────────────
 * <div data-theme="dj"> en el wrapper del portal DJ.
 * 4 niveles de superficie: background → surface → card → elevated
 * ─────────────────────────────────────────────────────────────────────────── */
[data-theme="dj"] {
  --cue-background:    240 33% 6%;      /* #0B0B18 */
  --cue-surface:       240 28% 10%;     /* #141428 */
  --cue-card:          240 24% 14%;     /* #1C1C32 */
  --cue-elevated:      240 22% 18%;     /* #252540 */
  --cue-border:        240 18% 22%;     /* #2D2D47 */
  --cue-border-strong: 240 16% 30%;     /* #3E3E5A */
  --cue-text:          0 0% 95%;        /* #F2F2F2 */
  --cue-text-muted:    240 10% 65%;     /* #9898B0 */

  --cue-primary:       195 100% 55%;    /* #1AC8F0 */
  --cue-primary-hover: 195 100% 45%;
  --cue-primary-light: 195 100% 10%;

  --cue-danger:         0 84% 60%;
  --cue-danger-light:   0 72% 12%;
  --cue-danger-bg:      0 72% 12%;
  --cue-success:        142 70% 50%;
  --cue-success-light:  142 60% 10%;
  --cue-success-bg:     142 60% 10%;
  --cue-warning:        38 92% 60%;
  --cue-warning-light:  38 80% 12%;
  --cue-warning-bg:     38 80% 12%;

  --cue-must-play:  142 70% 50%;
  --cue-optional:   240 10% 50%;
  --cue-normal:     0 0% 95%;

  --cue-neutral-100: 240 25% 12%;
  --cue-neutral-200: 240 20% 16%;
  --cue-neutral-300: 240 15% 20%;
  --cue-neutral-400: 240 10% 50%;
  --cue-neutral-600: 240 10% 65%;
  --cue-neutral-700: 0 0% 80%;
  --cue-neutral-900: 0 0% 95%;

  --cue-error:              0 84% 60%;
  --cue-primary-foreground: 240 33% 8%;

  /* Sombras con tinte de color para dark mode */
  --cue-shadow-sm: 0 0 0 1px hsl(240 18% 22%), 0 2px 8px hsl(240 33% 4% / .5);
  --cue-shadow:    0 0 0 1px hsl(240 18% 22%), 0 8px 24px hsl(240 33% 4% / .6);
  --cue-shadow-lg: 0 0 0 1px hsl(195 100% 55% / .1), 0 24px 48px hsl(240 33% 4% / .7);

  /* DJ accent — cian neón para glow y SSE */
  --cue-accent: 195 100% 55%;

  color-scheme: dark;
}

/* ── Portal Pareja — accent cálido ──────────────────────────────────────────── */
.cue-portal-pareja {
  --cue-accent: 12 75% 56%;   /* coral / dusty rose */
}

.cue-portal-pareja .cue-btn-primary {
  background: hsl(var(--cue-accent));
  border-color: hsl(var(--cue-accent));
}

.cue-portal-pareja .cue-btn-primary:hover:not(:disabled) {
  background: hsl(12 75% 46%);
  border-color: hsl(12 75% 46%);
}

/* ── Alpine.js x-cloak ──────────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Skeleton loader ─────────────────────────────────────────────────────────── */
.cue-skeleton {
  background: linear-gradient(
    90deg,
    hsl(var(--cue-neutral-200)) 25%,
    hsl(var(--cue-neutral-100)) 50%,
    hsl(var(--cue-neutral-200)) 75%
  );
  background-size: 200% 100%;
  animation: cue-shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes cue-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Reset mínimo compatible con WordPress ──────────────────────────────────── */
.cue-portal *,
.cue-portal *::before,
.cue-portal *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.cue-portal {
  min-height: 100vh;
  background-color: hsl(var(--cue-background));
  color: hsl(var(--cue-text));
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Tipografía ─────────────────────────────────────────────────────────────── */
.cue-portal h1 {
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: hsl(var(--cue-text));
}

.cue-portal h2 {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: hsl(var(--cue-text));
}

.cue-portal h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.3;
  color: hsl(var(--cue-text));
}

.cue-portal h4,
.cue-portal h5,
.cue-portal h6 {
  color: hsl(var(--cue-text));
  line-height: 1.25;
  font-weight: 600;
}

.cue-portal p,
.cue-portal li {
  color: hsl(var(--cue-text));
  line-height: 1.625;
}

.cue-portal a {
  color: hsl(var(--cue-primary-hover));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.cue-portal a:hover {
  color: hsl(var(--cue-primary));
}

/* ── CRÍTICO: fix especificidad — .cue-portal a (0,1,1) vs .cue-btn-primary (0,1,0)
 * Sin esto, los enlaces con clase .cue-btn-primary aparecen con texto azul sobre
 * fondo azul (ratio 1.28:1). Esta regla restaura el color correcto.
 * ─────────────────────────────────────────────────────────────────────────────── */
.cue-portal a.cue-btn-primary,
.cue-portal a.cue-btn-secondary,
.cue-portal a.cue-btn-danger,
.cue-portal a.cue-btn-ghost {
  color: inherit;
  text-decoration: none;
}

.cue-btn-primary,
a.cue-btn-primary {
  color: hsl(var(--cue-primary-foreground)) !important;
}

.cue-btn-primary:hover:not(:disabled),
a.cue-btn-primary:hover {
  color: hsl(var(--cue-primary-foreground)) !important;
}

.cue-portal hr {
  border: none;
  border-top: 1px solid hsl(var(--cue-border));
  margin: 1.5rem 0;
}

/* ── Focus accesible ────────────────────────────────────────────────────────── */
.cue-portal :focus-visible {
  outline: 2px solid hsl(var(--cue-primary));
  outline-offset: 2px;
  border-radius: var(--cue-radius);
  box-shadow: 0 0 0 4px hsl(var(--cue-ring) / .15);
}

.cue-portal :focus:not(:focus-visible) {
  outline: none;
}

/* ── Layout base ────────────────────────────────────────────────────────────── */
.cue-layout {
  display: flex;
  min-height: 100vh;
}

.cue-sidebar {
  width: 240px;
  flex-shrink: 0;
  background-color: hsl(var(--cue-surface));
  border-right: 1px solid hsl(var(--cue-border));
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cue-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* ── Botones ─────────────────────────────────────────────────────────────────── */
.cue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--cue-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    background-color 150ms var(--cue-ease),
    color 150ms var(--cue-ease),
    border-color 150ms var(--cue-ease),
    box-shadow 150ms var(--cue-ease),
    opacity 150ms var(--cue-ease);
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.cue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cue-btn-primary {
  background-color: hsl(var(--cue-primary));
  color: hsl(var(--cue-primary-foreground));
  border: 1px solid hsl(var(--cue-primary));
}

.cue-btn-primary:hover:not(:disabled) {
  background-color: hsl(var(--cue-primary-hover));
  border-color: hsl(var(--cue-primary-hover));
  color: hsl(var(--cue-primary-foreground));
}

.cue-btn-secondary {
  background-color: hsl(var(--cue-neutral-200));
  color: hsl(var(--cue-text));
  border: 1px solid hsl(var(--cue-border));
}

.cue-btn-secondary:hover:not(:disabled) {
  background-color: hsl(var(--cue-neutral-300));
}

.cue-btn-danger {
  background-color: hsl(var(--cue-danger));
  color: white;
  border: 1px solid hsl(var(--cue-danger));
}

.cue-btn-danger:hover:not(:disabled) {
  opacity: 0.9;
}

.cue-btn-ghost {
  background-color: transparent;
  color: hsl(var(--cue-text-muted));
  border: 1px solid transparent;
}

.cue-btn-ghost:hover:not(:disabled) {
  background-color: hsl(var(--cue-neutral-100));
  color: hsl(var(--cue-text));
}

.cue-btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  min-height: 44px;
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.cue-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: cue-spin 0.6s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes cue-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .cue-spinner { animation-duration: 3s; }
}

/* ── Inputs ──────────────────────────────────────────────────────────────────── */
.cue-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--cue-border));
  border-radius: var(--cue-radius);
  background-color: hsl(var(--cue-background));
  color: hsl(var(--cue-text));
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 150ms var(--cue-ease), box-shadow 150ms var(--cue-ease);
  min-height: 44px;
}

.cue-input:focus {
  outline: none;
  border-color: hsl(var(--cue-primary));
  box-shadow: 0 0 0 3px hsl(var(--cue-ring) / .2);
}

.cue-input::placeholder {
  color: hsl(var(--cue-neutral-400));
}

.cue-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--cue-neutral-700));
  margin-bottom: 0.25rem;
}

.cue-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.cue-field-error {
  font-size: 0.75rem;
  color: hsl(var(--cue-error));
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.cue-card {
  background-color: hsl(var(--cue-surface));
  border: 1px solid hsl(var(--cue-border));
  border-radius: var(--cue-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--cue-shadow-sm);
  transition: box-shadow 200ms var(--cue-ease), border-color 200ms var(--cue-ease);
}

.cue-card:hover {
  box-shadow: var(--cue-shadow);
}

.cue-card-sm {
  padding: 1rem;
}

/* DJ dark: cards usan el token --cue-card para una capa distinta del surface */
[data-theme="dj"] .cue-card {
  background-color: hsl(var(--cue-card));
}

/* ── Badges de estado ────────────────────────────────────────────────────────── */
.cue-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--cue-radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cue-badge-success {
  background-color: hsl(var(--cue-success-bg));
  color: hsl(var(--cue-success));
}

.cue-badge-warning {
  background-color: hsl(var(--cue-warning-bg));
  color: hsl(var(--cue-warning));
}

.cue-badge-danger {
  background-color: hsl(var(--cue-danger-bg));
  color: hsl(var(--cue-danger));
}

.cue-badge-neutral {
  background-color: hsl(var(--cue-neutral-200));
  color: hsl(var(--cue-neutral-700));
}

/* Badges de prioridad de canciones */
.cue-priority-must {
  background-color: hsl(var(--cue-success-bg));
  color: hsl(var(--cue-must-play));
}

.cue-priority-normal {
  background-color: hsl(var(--cue-neutral-200));
  color: hsl(var(--cue-normal));
}

.cue-priority-optional {
  background-color: hsl(var(--cue-neutral-100));
  color: hsl(var(--cue-optional));
}

/* ── Badges de acción para audit log ────────────────────────────────────────── */
.cue-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--cue-radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.cue-action-auth   { background: hsl(260 70% 95%); color: hsl(260 70% 32%); }
.cue-action-create { background: hsl(var(--cue-success-bg)); color: hsl(var(--cue-success)); }
.cue-action-update { background: hsl(195 80% 95%); color: hsl(195 100% 26%); }
.cue-action-delete { background: hsl(var(--cue-danger-bg)); color: hsl(var(--cue-danger)); }
.cue-action-other  { background: hsl(var(--cue-neutral-200)); color: hsl(var(--cue-neutral-700)); }

[data-theme="dj"] .cue-action-auth   { background: hsl(260 70% 15%); color: hsl(260 70% 75%); }
[data-theme="dj"] .cue-action-create { background: hsl(142 60% 10%); color: hsl(var(--cue-success)); }
[data-theme="dj"] .cue-action-update { background: hsl(195 80% 10%); color: hsl(195 100% 60%); }
[data-theme="dj"] .cue-action-delete { background: hsl(0 72% 12%);   color: hsl(var(--cue-danger)); }

/* ── Tablas ──────────────────────────────────────────────────────────────────── */
.cue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.cue-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid hsl(var(--cue-border));
  background: hsl(var(--cue-neutral-100));
  color: hsl(var(--cue-neutral-700));
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.cue-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--cue-border));
  color: hsl(var(--cue-text));
  font-weight: 400;
}

.cue-table tbody tr {
  transition: background-color 120ms var(--cue-ease);
}

.cue-table tbody tr:hover td {
  background-color: hsl(var(--cue-surface));
}

.cue-table-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: hsl(var(--cue-text-muted));
  font-size: 0.875rem;
}

/* ── Nav sidebar ─────────────────────────────────────────────────────────────── */
.cue-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--cue-radius);
  color: hsl(var(--cue-text-muted));
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 150ms var(--cue-ease), color 150ms var(--cue-ease);
}

.cue-nav-link:hover {
  background-color: hsl(var(--cue-neutral-100));
  color: hsl(var(--cue-text));
  text-decoration: none;
}

.cue-nav-link.active {
  background-color: hsl(var(--cue-primary) / .08);
  color: hsl(var(--cue-primary));
  font-weight: 600;
  box-shadow: inset 3px 0 0 hsl(var(--cue-primary));
}

/* ── Auth layout centrado ────────────────────────────────────────────────────── */
.cue-auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: hsl(var(--cue-background));
}

.cue-auth-box {
  width: 100%;
  max-width: 400px;
}

/* ── Notificación badge ──────────────────────────────────────────────────────── */
.cue-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--cue-radius-full);
  background-color: hsl(var(--cue-danger));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ── Modal overlay ───────────────────────────────────────────────────────────── */
.cue-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: hsl(220 13% 5% / .5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: cue-fade 180ms var(--cue-ease);
}

.cue-modal {
  background-color: hsl(var(--cue-background));
  border-radius: var(--cue-radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--cue-shadow-lg);
  animation: cue-pop 220ms var(--cue-ease);
}

[data-theme="dj"] .cue-modal {
  background-color: hsl(var(--cue-card));
}

/* Modal responsive */
@media (max-width: 520px) {
  .cue-modal {
    width: calc(100% - 32px);
    max-height: 90dvh;
    overflow-y: auto;
    padding: 1.5rem;
  }
}

/* ── Animaciones de modal ────────────────────────────────────────────────────── */
@keyframes cue-fade {
  from { opacity: 0; }
}

@keyframes cue-pop {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
}

/* ── Alert messages ──────────────────────────────────────────────────────────── */
.cue-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--cue-radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.cue-alert-error {
  background-color: hsl(var(--cue-danger-bg));
  color: hsl(var(--cue-danger));
  border: 1px solid hsl(var(--cue-danger) / 0.3);
}

.cue-alert-success {
  background-color: hsl(var(--cue-success-bg));
  color: hsl(var(--cue-success));
  border: 1px solid hsl(var(--cue-success) / 0.3);
}

.cue-alert-warning {
  background-color: hsl(var(--cue-warning-bg));
  color: hsl(var(--cue-warning));
  border: 1px solid hsl(var(--cue-warning) / 0.3);
}

/* ── SSE indicator (DJ portal) ───────────────────────────────────────────────── */
.cue-sse-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: hsl(var(--cue-text-muted));
}

.cue-sse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: hsl(var(--cue-text-muted));
}

.cue-sse-indicator.is-connected .cue-sse-dot {
  background: hsl(var(--cue-success));
  animation: cue-pulse 1.6s infinite;
}

.cue-sse-indicator.is-connected {
  color: hsl(var(--cue-success));
}

.cue-sse-indicator.is-disconnected .cue-sse-dot {
  background: hsl(var(--cue-danger));
}

@keyframes cue-pulse {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--cue-success) / .6); }
  50%       { box-shadow: 0 0 0 8px hsl(var(--cue-success) / 0); }
}

/* ── Empty states ────────────────────────────────────────────────────────────── */
.cue-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: hsl(var(--cue-text-muted));
}

.cue-empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  flex-shrink: 0;
}

.cue-empty-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: hsl(var(--cue-text));
  margin: 0;
}

.cue-empty-subtitle {
  font-size: var(--fs-sm);
  max-width: 36ch;
  margin: 0;
  color: hsl(var(--cue-text-muted));
}

.cue-empty-state .cue-btn {
  margin-top: 8px;
}

/* ── Phase header (pareja portal) ───────────────────────────────────────────── */
.cue-phase-title {
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: hsl(var(--cue-text));
}

.cue-phase-count {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--cue-text-muted));
  margin-top: 2px;
}

/* .cue-phase-header es el selector real en el HTML */
.cue-phase-header,
.cue-phase-header-inner {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid hsl(var(--cue-border));
}

/* ── Song rows ───────────────────────────────────────────────────────────────── */
.cue-song-title {
  font-weight: 500;
  font-size: 0.9375rem;
}

.cue-table td,
.cue-song-row p,
.cue-song-sub {
  font-weight: 400;
}

/* ── Song row separators (DJ portal) ────────────────────────────────────────────
 * Hallazgo 4.4: filas sin separadores — "no hay sensación de lista"
 * ─────────────────────────────────────────────────────────────────────────────── */
[data-theme="dj"] .cue-song-row + .cue-song-row {
  border-top: 1px solid hsl(var(--cue-border) / .5);
}

/* ── Sticky detail header ─────────────────────────────────────────────────────── */
.cue-detail-sticky {
  position: sticky;
  top: 0;
  background: hsl(var(--cue-background) / .9);
  backdrop-filter: blur(8px);
  z-index: 10;
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
}

/* ── DJ Dark scrollbar ────────────────────────────────────────────────────────── */
[data-theme="dj"] ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

[data-theme="dj"] ::-webkit-scrollbar-track {
  background: hsl(var(--cue-surface));
}

[data-theme="dj"] ::-webkit-scrollbar-thumb {
  background: hsl(var(--cue-border));
  border-radius: var(--cue-radius-full);
}

[data-theme="dj"] ::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--cue-text-muted));
}

/* ── Utilidades ─────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cue-layout {
    flex-direction: column;
  }

  .cue-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid hsl(var(--cue-border));
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .cue-main {
    padding: 1rem;
  }
}

/* ── Animaciones reducidas ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Skip link (accesibilidad WCAG 2.4.1) ─────────────────────────────────── */
.cue-skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  background: hsl(var(--cue-primary));
  color: hsl(var(--cue-primary-foreground));
  padding: 0.5rem 1rem;
  border-radius: var(--cue-radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 150ms var(--cue-ease);
  white-space: nowrap;
}

.cue-skip-link:focus {
  top: 1rem;
  outline: 2px solid hsl(var(--cue-primary-foreground));
  outline-offset: 2px;
}
