/* ===== Tokens de diseño — marca Boosters =====
   Manual de marca v2: tinta #051A0C · blanco crema #FFFEF7 · lima neón #EFFA00 · verde noche #092A14.
   (El verde #0AA338 queda solo en el panel hasta que lo rediseñemos.)
   Tipografías: Unbounded (títulos) + Instrument Sans (textos). */
:root, [data-theme="light"] {
  --font-ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji';
  --font-display: 'Unbounded', 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji';

  --verde: #0AA338;
  --lima: #EFFA00;
  --tinta: #051A0C;
  --crema: #FFFAE3;
  --noche: #092A14;

  --accent: var(--verde);          /* rellenos: barras, línea de tiempo, foco */
  --on-accent: var(--noche);
  --accent-ink: #067A29;           /* verde oscuro legible como texto sobre crema */
  --accent-soft: color-mix(in srgb, var(--verde) 14%, var(--surface));
  --accent-line: color-mix(in srgb, var(--verde) 40%, var(--surface));
  --hl: var(--lima);               /* resaltados tipo etiqueta */
  --on-hl: var(--noche);
  --primary: var(--noche);         /* botón principal: noche + lima */
  --on-primary: var(--lima);
  --primary-hover: #12391F;
  --pop-border: var(--noche);      /* botones "etiqueta": borde + sombra dura */
  --pop-shadow: var(--noche);

  --bg: var(--crema);
  --surface: #FFFEF7;
  --surface-2: #F8F1D3;
  --surface-3: #EEE6C2;
  --border: #EBE3C1;
  --border-strong: #D8CDA0;
  --ink: var(--noche);
  --ink-2: #2E4A36;
  --muted: #5F6F5C;

  --good: var(--verde);
  --good-ink: #067A29;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-ink: #b42b2b;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgb(9 42 20 / 6%);
  --shadow: 0 1px 2px rgb(9 42 20 / 5%), 0 8px 26px rgb(9 42 20 / 8%);
  --shadow-lg: 0 12px 44px rgb(9 42 20 / 20%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

:root[data-theme="dark"], [data-theme="dark"] {
  --bg: #061D0E;
  --surface: #0B2A16;
  --surface-2: #11361D;
  --surface-3: #184226;
  --border: #1B4429;
  --border-strong: #275638;
  --ink: var(--crema);
  --ink-2: #D5DCC0;
  --muted: #9DB099;
  --accent-ink: var(--lima);
  --accent-soft: color-mix(in srgb, var(--verde) 24%, var(--surface));
  --accent-line: color-mix(in srgb, var(--verde) 50%, var(--surface));
  --primary: var(--lima);
  --on-primary: var(--noche);
  --primary-hover: #E6F24A;
  --pop-border: var(--crema);
  --pop-shadow: #010A04;
  --good-ink: #4BD37A;
  --warn-ink: #fab219;
  --critical-ink: #f07171;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 35%);
  --shadow-lg: 0 12px 48px rgb(0 0 0 / 55%);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1, h2, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--lima); color: var(--noche); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 24px; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-good { background: var(--verde); color: var(--noche); border-color: transparent; }
.btn-good:hover { background: color-mix(in srgb, var(--verde) 88%, #000); }
/* Botón "etiqueta": borde + sombra dura, como los stickers de la marca */
.btn-pop { border: 2px solid var(--pop-border); box-shadow: 3px 3px 0 var(--pop-shadow); }
.btn-pop:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--pop-shadow); }
.btn-pop:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop-shadow); }
.btn-lima { background: var(--lima); color: var(--noche); }
.btn-lima:hover { background: #F6FF4D; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--critical-ink); }
.btn-danger:hover { background: color-mix(in srgb, var(--critical) 10%, var(--surface)); border-color: color-mix(in srgb, var(--critical) 40%, var(--surface)); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }

/* ===== Formularios ===== */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 9px 12px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6F5C' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type="color"].input { padding: 4px; height: 40px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== Tarjetas ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.card-body { padding: 16px 20px; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-accent { background: var(--hl); color: var(--on-hl); }
.badge-good { background: var(--accent-soft); color: var(--good-ink); }
.badge-warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn-ink); }
.badge-critical { background: color-mix(in srgb, var(--critical) 12%, var(--surface)); color: var(--critical-ink); }
.badge-plain::before { display: none; }

/* ===== Avatar ===== */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  background: var(--hl); color: var(--on-hl);
}
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ===== Barra de progreso (meter) ===== */
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease); }
.meter.good > i { background: var(--good); }
.meter.good { background: var(--accent-soft); }

/* ===== Reproductor ===== */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.player iframe, .player video, .player > div:not(.player-link-inner) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player video { object-fit: contain; background: #000; }
.player-link { display: grid; place-items: center; background: linear-gradient(135deg, #0B3A1B, #061D0E); color: var(--crema); }
.player-link-inner { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.player-link-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: rgb(255 255 255 / 12%); }

/* ===== Toasts ===== */
#toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast {
  padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 520;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast-good { background: var(--verde); color: var(--noche); }
.toast-critical { background: var(--critical); color: #fff; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px;
  background: rgb(6 29 14 / 50%); backdrop-filter: blur(3px);
  animation: fade .18s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: pop .22s var(--ease);
}
.modal-wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ===== Vacío ===== */
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--surface-2); }
.empty h3 { font-size: 16px; color: var(--ink); }
.empty .sticker { width: 170px; margin-bottom: 4px; }
.empty p { max-width: 380px; font-size: 14px; }

/* ===== Comentarios ===== */
.tc-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 6px; border: 0;
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
  background: var(--hl); color: var(--on-hl); cursor: pointer;
}
.tc-chip:hover { background: var(--accent); color: var(--on-accent); }
/* Triangulito de play (el ▶ de texto se dibuja como emoji en Windows) */
.tri { display: inline-block; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; margin-right: 1px; }

/* ===== Stickers (estilo etiqueta) =====
   Ya vienen inclinados, con borde crema y sombra dura. Máximo 3 por pantalla y nunca encima del video. */
.sticker { display: block; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; animation: sticker-in .55s var(--ease-back) both; }
@keyframes sticker-in { from { opacity: 0; transform: scale(.55); } }

/* Logo "etiqueta doble" en SVG: el giro es parte del logo, no se endereza. */
.logo { display: block; height: 100%; width: auto; overflow: visible; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
[data-theme="dark"] [data-theme="light"] .logo-light { display: block; }
[data-theme="dark"] [data-theme="light"] .logo-dark { display: none; }
.logo-wrap { display: block; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
