/* Ventea Marketing — app de gestión. Mobile-first, sin dependencias.
   Identidad Ventea (TASK-047): isotipo y logotipos vectoriales en static/brand/ (design/brand/build_brand.py),
   azul marino #0B1E3A, turquesa #03ADAE y gris #5F6670. Contraste AA: texto blanco solo sobre navy o turquesa
   oscurecido (--vt-primary #007F80 o más oscuro); sobre --vt-teal solo texto navy. Sin estilos inline (CSP).
   No renombrar ni borrar clases: las usan todas las pantallas. */
:root {
  /* marca */
  --vt-navy: #0b1e3a;
  --vt-navy-2: #14315c;
  --vt-teal: #03adae; /* acento: indicadores, bordes, fondos con texto navy (6.0:1); nunca texto sobre blanco */
  --vt-primary: #007f80; /* botones/CTA con texto blanco (4.8:1) */
  --vt-primary-dark: #00696b; /* hover; texto turquesa sobre claro */
  --vt-primary-soft: #e2f4f4;
  --vt-teal-ink: #00696b; /* texto turquesa (6.5:1 sobre blanco, 5.7:1 sobre --vt-primary-soft) */
  --vt-link: #00696b;
  --vt-focus: #008f90; /* anillo de foco: 3.9:1 sobre blanco, 4.2:1 sobre navy */
  --vt-gray: #5f6670;
  /* estado (semántico, no de marca) */
  --ok: #4e9a2a;
  --ok-dark: #3e7212;
  --ok-soft: #eef7e5;
  /* superficies y texto */
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #14202e;
  --heading: var(--vt-navy);
  --muted: #5f6670;
  --border: #e3e7ec;
  --border-strong: #c5d0dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #9a5b00;
  /* forma */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 30, 58, 0.06);
  --shadow: 0 1px 2px rgba(11, 30, 58, 0.05), 0 4px 14px rgba(11, 30, 58, 0.06);
  --shadow-lg: 0 18px 48px rgba(11, 30, 58, 0.22);
  --focus: 0 0 0 3px rgba(0, 143, 144, 0.35);
  --font: "Montserrat", "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Roboto, Arial, system-ui,
    sans-serif;
  --nav-w: 252px;
  --ease: 160ms ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--vt-link);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--vt-primary-dark);
}

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

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.55rem;
  font-weight: 800;
}

h2 {
  font-size: 1.12rem;
  font-weight: 700;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 0.75rem;
}

img {
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--surface);
  color: var(--vt-link);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 100;
}

.skip-link:focus {
  top: 0.5rem;
}

/* ------------------------------------------------------------------ estructura */

.layout {
  display: block;
}

.sidebar {
  background: linear-gradient(180deg, var(--vt-navy) 0%, var(--vt-navy-2) 100%);
  color: #fff;
  padding: 0.75rem 0.75rem 0.5rem;
}

.sidebar :focus-visible {
  outline-color: #fff;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-sm);
}

.brandmark:hover {
  color: #fff;
}

.brandmark svg,
.brandmark img {
  flex: none;
}

.brand-logo {
  display: block;
  width: 150px;
  height: auto;
}

.brand-iso {
  display: inline-block;
  height: auto;
}

/* compatibilidad: marcado anterior del encabezado */
.brandmark-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brandmark-text strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brandmark-text small {
  font-size: 0.75rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidenav {
  margin-top: 0.5rem;
}

.sidenav ul {
  list-style: none;
  margin: 0;
  padding: 0 1.75rem 0.35rem 0;
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  /* en móvil: el borde derecho se desvanece para indicar que el menú se desliza */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}

.sidenav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    background var(--ease),
    color var(--ease);
}

.sidenav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidenav a[aria-current="page"] {
  background: var(--vt-primary);
  color: #fff;
  box-shadow:
    inset 3px 0 0 var(--vt-teal),
    0 6px 16px rgba(0, 0, 0, 0.18);
}

.sidenav svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.sidebar-foot {
  display: none;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.org {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.org small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.org strong {
  color: var(--heading);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userbox {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  flex: none;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vt-primary) 0%, var(--vt-teal-ink) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  flex: none;
}

.userbox .who {
  display: none;
  text-align: left;
  line-height: 1.2;
  color: var(--heading);
  font-weight: 700;
}

.userbox .who small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.userbox form {
  margin: 0;
}

.btn-logout {
  background: var(--surface);
  color: var(--vt-link);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--ease),
    border-color var(--ease);
}

.btn-logout:hover {
  background: var(--vt-primary-soft);
  border-color: var(--vt-link);
}

main {
  padding: 1.1rem 1rem;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.page-head p {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vt-teal-ink);
  margin-bottom: 0.2rem;
}

/* encabezado destacado (inicio) */
.page-head.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--vt-navy) 0%, var(--vt-primary) 70%, var(--vt-teal-ink) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.25rem;
  box-shadow: var(--shadow);
}

.page-head.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 210px;
  height: 210px;
  background: url("brand/isotipo-white.svg") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.page-head.hero > * {
  position: relative;
  z-index: 1;
}

.page-head.hero h1 {
  color: #fff;
}

.page-head.hero p {
  color: rgba(255, 255, 255, 0.86);
}

.page-head.hero .eyebrow {
  color: #7fe0e0;
}

.footer {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}

.footer a {
  color: var(--muted);
}

@media (min-width: 900px) {
  .userbox .who {
    display: block;
  }

  .layout {
    display: grid;
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.4rem 0.9rem 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  }

  .brandmark {
    padding: 0.25rem 0.5rem 0.5rem;
  }

  .brand-logo {
    width: 196px;
  }

  .sidenav {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidenav ul {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .sidenav a {
    gap: 0.6rem;
    padding: 0.62rem 0.85rem;
    font-size: 0.92rem;
  }

  .sidebar-foot {
    display: block;
    margin: auto 0 0;
    padding: 1rem 0.5rem 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
  }

  .topbar {
    position: sticky;
    top: 0;
    padding: 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(1.4) blur(8px);
  }

  main {
    padding: 1.75rem 2.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .page-head.hero {
    padding: 1.75rem 2rem;
  }
}

/* ------------------------------------------------------------------ componentes */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.card > h2:first-child,
.card > h3:first-child {
  margin-top: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.card-head h2 {
  margin: 0;
}

.card-head a {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.card-head a:hover {
  text-decoration: underline;
}

.error-card {
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 700px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .grid-detail {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  }
}

.stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

@media (min-width: 900px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--vt-primary);
}

.stat.accent::before {
  background: var(--vt-teal);
}

.stat .label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--heading);
  display: block;
  line-height: 1.2;
  margin: 0.2rem 0 0.1rem;
  letter-spacing: -0.02em;
}

.stat .hint {
  font-size: 0.8rem;
  color: var(--muted);
}

meter.budget {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 0.5rem;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.list li:first-child {
  border-top: 0;
}

.list .main {
  min-width: 0;
}

.list .main > a {
  font-weight: 700;
  text-decoration: none;
}

.list .main > a:hover {
  text-decoration: underline;
}

.list .meta,
.meta,
.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.empty {
  color: var(--muted);
  padding: 1.25rem 1rem;
  margin: 0.25rem 0;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  padding: 0.14rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  background: #e9eef4;
  color: #33404f;
  border: 1px solid rgba(11, 30, 58, 0.06);
  letter-spacing: 0.01em;
}

.badge.s-PENDING_REVIEW {
  background: #fff1d6;
  color: #7a4a00;
}

.badge.s-REVISION_REQUESTED {
  background: #ffe4dc;
  color: #8a2a10;
}

.badge.s-APPROVED,
.badge.s-SCHEDULED {
  background: #e2f2d3;
  color: var(--ok-dark);
}

.badge.s-PUBLISHED {
  background: #ddf2f2;
  color: var(--vt-primary-dark);
}

.badge.s-REJECTED,
.badge.s-FAILED {
  background: #fde2e0;
  color: var(--danger);
}

.badge.s-AI_GENERATED {
  background: #e2f4f4;
  color: var(--vt-teal-ink);
}

/* Campañas Meta Ads (TASK-040) */
.badge.s-PENDING_APPROVAL {
  background: #fff1d6;
  color: #7a4a00;
}

.badge.s-ACTIVE,
.badge.s-COMPLETED {
  background: #e2f2d3;
  color: var(--ok-dark);
}

.badge.s-PAUSED,
.badge.s-CANCELLED,
.badge.s-DRAFT {
  background: #e9eef4;
  color: #33404f;
}

.reach-estimate {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0.2rem 0;
  color: var(--vt-primary-dark);
}

.ad-targeting td code {
  font-size: 0.8rem;
  color: var(--muted);
}

.ad-warning {
  background: #fff1d6;
  border: 1px solid #f3d38a;
  border-left: 4px solid #d99a00;
  color: #5c3a00;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  margin: 0.75rem 0 0;
}

.badge.ch {
  background: var(--vt-primary-soft);
  color: var(--vt-primary-dark);
}

/* tablas: en móvil cada fila es una tarjeta */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th {
  text-align: left;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem;
}

.table th:first-child {
  border-top-left-radius: var(--radius-sm);
}

.table th:last-child {
  border-top-right-radius: var(--radius-sm);
}

.table td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.6rem;
  vertical-align: top;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

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

.table td a {
  font-weight: 700;
}

@media (max-width: 699px) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
  }

  .table tbody tr:last-child {
    border-bottom: 0;
  }

  .table td {
    border: 0;
    padding: 0.15rem 0;
  }

  .table tbody tr:hover td {
    background: transparent;
  }

  .table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 0.8rem;
  }
}

/* ------------------------------------------------------------------ formularios */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: var(--vt-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 30, 58, 0.18);
  transition:
    background var(--ease),
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}

.btn:hover {
  background: var(--vt-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 127, 128, 0.28);
}

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

.btn.secondary {
  background: var(--surface);
  color: var(--vt-link);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  background: var(--vt-primary-soft);
  border-color: var(--vt-link);
}

.btn.success {
  background: var(--ok-dark);
}

.btn.success:hover {
  background: #2f5a0c;
  box-shadow: 0 4px 12px rgba(62, 114, 18, 0.3);
}

.btn.danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #efb3ad;
  box-shadow: var(--shadow-sm);
}

.btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn.small {
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.actions + .form-grid {
  margin-top: 1rem;
}

/* Segunda fila de acciones (Quitar; Probar/Desactivar) separada del formulario de arriba. */
fieldset > form.form-grid + form,
details.disclosure form.form-grid + .actions {
  margin-top: 0.9rem;
}

/* Botón junto a un campo sin ayuda: centrado con el input, no con etiqueta + input. */
.form-grid > .actions.align-end {
  align-self: end;
  min-height: 42px;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 700px) {
  .form-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid .span-2 {
    grid-column: span 2;
  }
}

.field label,
.field legend {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
  color: #243241;
}

.field .help,
.help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: #9fb0c3;
}

/* foco: outline sólido (≥3:1) en todos los controles; el halo es un extra en los campos de texto */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--vt-primary);
  outline-offset: 2px;
}

input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--vt-link);
  box-shadow: var(--focus);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--vt-link);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
  min-width: 0;
  background: var(--surface-2);
}

legend {
  padding: 0 0.4rem;
  font-weight: 700;
  color: var(--vt-teal-ink);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
}

.check input {
  width: 20px;
  height: 20px;
}

.filters {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.filters .span-2 {
  grid-column: span 2;
}

@media (min-width: 800px) {
  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.flash {
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid;
  border-left-width: 4px;
  box-shadow: var(--shadow-sm);
}

.flash.ok {
  background: var(--ok-soft);
  border-color: #b6dc94;
  border-left-color: var(--ok);
  color: #264a0b;
}

.flash.error {
  background: var(--danger-soft);
  border-color: #f2b8b2;
  border-left-color: var(--danger);
  color: #7a1a12;
}

.flash a {
  color: inherit;
  font-weight: 700;
}

details.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

details.disclosure > summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: var(--vt-link);
  border-radius: var(--radius);
}

details.disclosure > summary:hover {
  background: var(--surface-2);
}

details.disclosure[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0.75rem;
}

details.disclosure > div {
  padding: 0 1.1rem 1rem;
}

/* ------------------------------------------------------------------ contenido */

.preview {
  background: var(--vt-navy);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.preview img {
  display: block;
  width: 100%;
  height: auto;
}

.preview .no-image {
  color: #c9d6e4;
  padding: 2rem;
  text-align: center;
}

.copy-block {
  white-space: pre-wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.kv {
  display: grid;
  grid-template-columns: fit-content(60%) minmax(0, 1fr);
  gap: 0.45rem 1rem;
  margin: 0;
  font-size: 0.92rem;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tags li {
  background: var(--vt-primary-soft);
  color: var(--vt-primary-dark);
  border-radius: 999px;
  padding: 0.12rem 0.65rem;
  font-size: 0.82rem;
}

.findings li {
  margin-bottom: 0.3rem;
}

.score {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--vt-teal-ink);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 0.8rem 0.5rem;
  font-size: 0.9rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--vt-teal);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--vt-teal);
}

.swatches {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-block;
}

/* ------------------------------------------------------------------ calendario */

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}

.calendar th {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem;
}

.calendar td {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  vertical-align: top;
  height: 110px;
  padding: 0.35rem;
  min-width: 0;
  overflow: hidden;
}

.calendar td.out {
  background: transparent;
  border-color: transparent;
}

.calendar td.today {
  border-color: var(--vt-link);
  box-shadow: inset 0 0 0 1px var(--vt-primary);
  background: #f6fbfb;
}

.calendar .daynum {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.calendar td.today .daynum {
  color: var(--vt-link);
}

.calendar .ev {
  display: block;
  font-size: 0.75rem;
  line-height: 1.25;
  padding: 0.22rem 0.35rem;
  margin-top: 0.2rem;
  border-radius: 6px;
  background: var(--vt-primary-soft);
  color: var(--vt-primary-dark);
  border-left: 3px solid var(--vt-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar .ev.idea {
  background: var(--ok-soft);
  color: var(--ok-dark);
  border-left-color: var(--ok);
}

.calendar .ev.PUBLISHED {
  background: #ddf2f2;
}

.cal-list {
  display: none;
}

@media (max-width: 699px) {
  .calendar {
    display: none;
  }

  .cal-list {
    display: block;
  }
}

.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 0.3rem;
  background: var(--vt-primary-soft);
  border: 1px solid #a9bfd6;
}

.dot.idea {
  background: var(--ok-soft);
  border-color: #a6d27d;
}

/* ------------------------------------------------------------------ login */

.auth-wrap {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(3, 173, 174, 0.3) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 127, 128, 0.6) 0%, transparent 60%),
    var(--vt-navy);
}

.auth-wrap::before {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 520px;
  height: 520px;
  background: url("brand/isotipo-white.svg") center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}

.auth-card {
  position: relative;
  flex: none;
  margin: 0;
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem 1.6rem 1.75rem;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--vt-teal);
}

.auth-card .logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.auth-card .brand-logo.vertical {
  width: 220px;
}

.auth-card .logo strong {
  color: var(--vt-link);
  font-size: 1.1rem;
  display: block;
}

.auth-card .logo small {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-card h1 {
  font-size: 1.4rem;
}

.auth-card .btn {
  width: 100%;
  margin-top: 0.75rem;
}

.auth-foot {
  position: relative;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  margin-top: 1.25rem;
  text-align: center;
}

.auth-foot a {
  color: #fff;
}

.htmx-request .btn,
.btn.htmx-request {
  opacity: 0.7;
}

a.stat,
a.brand-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}

a.stat:hover,
a.brand-card:hover {
  border-color: #a9bfd6;
  color: inherit;
  box-shadow: 0 8px 24px rgba(11, 30, 58, 0.1);
  transform: translateY(-1px);
}

.h3 {
  font-size: 1rem;
  margin-top: 1rem;
}

.card h3 {
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }

  a.stat:hover,
  a.brand-card:hover,
  .btn:active {
    transform: none;
  }
}

/* ------------------------------------------------------------------ referencias visuales (TASK-027) */

.ref-grid {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 700px) {
  .ref-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ref-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ref-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--vt-navy);
}

.ref-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.85rem;
}

.ref-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.ref-item form {
  margin-top: auto;
}

/* ------------------------------------------------------------------ variantes de logo (TASK-038) */

/* Logo principal sobre fondo claro: un logo oscuro (el caso más común) no se pierde en el azul de .preview. */
.preview.logo-preview {
  background: #ffffff;
  border: 1px solid var(--border);
  min-height: 0;
  max-width: 28rem;
  padding: 1rem;
}

.preview.logo-preview img {
  width: auto;
  max-width: 100%;
  max-height: 10rem;
}

.logo-tile img,
.logo-tile .logo-empty {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 0.6rem;
}

.logo-tile.on-light img,
.logo-tile.on-light .logo-empty {
  background: #ffffff;
  border: 1px solid var(--border);
}

.logo-tile.on-dark img,
.logo-tile.on-dark .logo-empty {
  background: var(--vt-navy);
}

.logo-tile .logo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.85rem;
}

.logo-tile.on-dark .logo-empty {
  color: #c9d6e4;
}

.logo-upload {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.logo-upload input[type="file"] {
  max-width: 100%;
  font-size: 0.8rem;
}

/* Texto gris de ejemplo en los campos (TASK-038): distinguible del texto escrito. */
input::placeholder,
textarea::placeholder {
  color: #7a8594;
  opacity: 1;
}

.ref-mark {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  max-width: 10rem;
}

.ref-mark select {
  max-width: 9rem;
}

.ref-mark .btn {
  white-space: normal;
  text-align: left;
}

/* TASK-025: insignias de redes sociales por marca (lista y detalle) */
.network-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

/* TASK-028: embudo de mensajes — aire entre bloques del horario, días en fila y aviso bajo el texto de TikTok */
.funnel-hours > .form-grid,
.funnel-hours > .funnel-days,
.funnel-hours > .field {
  margin-top: 0.75rem;
}

.funnel-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
}

.funnel-days .help {
  flex-basis: 100%;
}

.field + .flash {
  margin-top: 0.75rem;
}

/* TASK-029: radar — selector de confianza compacto en la fila de cada fuente; aire antes del alta */
.trust-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
}

.trust-form select {
  width: auto;
  min-height: 34px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

.list + .form-grid {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.list .actions {
  justify-content: flex-end;
}

.trust-form .btn {
  white-space: nowrap;
}

/* Filas con muchas acciones (fuentes y sugeridas del radar): en móvil, acciones debajo del texto. */
@media (max-width: 699px) {
  .list.stack-sm li {
    flex-direction: column;
    align-items: stretch;
  }

  .list.stack-sm .actions {
    justify-content: flex-start;
  }

  .list.stack-sm .main a {
    overflow-wrap: anywhere;
  }
}

/* TASK-029: aviso informativo (pregunta de confirmación), ni éxito ni error */
.flash.info {
  background: var(--surface-2);
  border-color: var(--border-strong);
  border-left-color: var(--vt-link);
  color: var(--text);
}

/* ===== TASK-033: animaciones del panel (motion.js + GSAP autoalojado) ===== */
/* motion-boot.js marca <html class="js-motion"> (salvo prefers-reduced-motion). Hasta que motion.js anima,
   el contenido de <main> queda oculto; si motion.js no corre, se revela solo a los 1.2 s (respaldo). */
.js-motion:not(.motion-ready) main > * {
  opacity: 0;
  animation: motion-reveal 0s linear 1.2s forwards;
}
@keyframes motion-reveal { to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  /* GSAP anima transform/opacity de bloques, filas y tarjetas durante la entrada: una transition CSS sobre
     transform en esos elementos re-transicionaría cada tick. La transición de transform vive solo en los
     estados :hover/:active/:focus-visible (al salir del estado vuelve sin transición). */
  .card, .stat {
    transition: box-shadow .18s ease;
  }
  a.stat:hover, a.stat:focus-visible, .card:hover {
    transition: transform .18s ease, box-shadow .18s ease;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(11, 30, 58, .10);
  }
  .btn, .btn-logout, button {
    transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
  }
  .btn:active, .btn-logout:active, button:active {
    transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
    transform: scale(.97);
  }
  .sidenav a:hover > span, .sidenav a:focus-visible > span {
    transition: transform .18s ease;
    transform: translateX(3px);
  }
  .list > li {
    transition: background-color .15s ease;
  }
  .list > li:hover {
    background-color: var(--surface-2);
  }
  .badge:hover {
    transition: transform .15s ease;
    transform: scale(1.04);
  }
}

/* ------------------------------------------------------------------ loader de carga (TASK-030) */
/* Overlay que muestra static/loader.js al hacer clic en una acción; video renderizado con HyperFrames. */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 30, 58, 0.28);
  opacity: 0;
  transition: opacity 0.18s ease-out;
  cursor: progress;
}

.page-loader[hidden] {
  display: none;
}

.page-loader.is-visible {
  opacity: 1;
}

.page-loader-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  background: #ffffff; /* = fondo del MP4 (blanco puro), sin bordes visibles */
  box-shadow: 0 10px 30px rgba(11, 30, 58, 0.25);
  overflow: hidden;
}

.page-loader-video {
  display: block;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  width: 7.5rem;
  height: 7.5rem;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
}

@media (max-width: 699px) {
  .page-loader-card {
    width: 8rem;
    height: 8rem;
  }

  .page-loader-video {
    width: 6.25rem;
    height: 6.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader {
    transition: none;
  }
}

/* TASK-031: paginación de listas (macro `pagination` de _macros.html). En móvil solo Anterior · actual · Siguiente
   (los números completos y el rango quedan para pantallas anchas); nunca desborda: envuelve. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.pager-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pager ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager a,
.pager [aria-current="page"],
.pager .disabled,
.pager-gap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--vt-link);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}

.pager a:hover {
  background: var(--vt-primary-soft);
  border-color: var(--border-strong);
}

.pager a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.pager [aria-current="page"] {
  background: var(--vt-primary);
  border-color: var(--vt-link);
  color: #fff;
}

.pager .disabled {
  color: var(--muted);
  background: var(--surface-2);
  cursor: not-allowed;
  opacity: 0.7;
}

.pager-gap span {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  min-width: 1.25rem;
  padding: 0;
}

.pager + .form-grid {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.flash.section-flash {
  margin: 0.5rem 0 1rem;
}

@media (max-width: 559px) {
  .pager {
    justify-content: center;
  }

  .pager-range,
  .pager-num:not(.current),
  .pager-gap {
    display: none;
  }
}

/* TASK-032: marca desactivada en la lista: atenuada (la insignia «Inactiva» lleva el texto) */
a.brand-card.brand-inactive {
  background: var(--surface-2);
  border-style: dashed;
}

a.brand-card.brand-inactive .swatches {
  opacity: 0.55;
}

/* Integración TASK-031/033: el ancla del paginado (#tendencias, #fuentes…) no queda bajo la topbar sticky. */
@media (min-width: 900px) {
  main section[id],
  main details[id] {
    scroll-margin-top: 5rem;
  }
}

/* ------------------------------------------------------------------ TASK-034: recepcionista de voz (/app/voz) */
/* Estados por atributos/clases que pone static/voice.js (sin estilos en línea: CSP style-src 'self'). */
.voice-card [hidden] {
  display: none !important;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.voice-controls .field {
  flex: 1 1 16rem;
  margin: 0;
}

.voice-buttons {
  display: flex;
  gap: 0.5rem;
}

.voice-buttons .btn {
  min-width: 8.5rem;
}

.voice-buttons .btn svg {
  width: 18px;
  height: 18px;
}

.voice-privacy {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--vt-teal);
  border-radius: var(--radius-sm);
  background: var(--vt-primary-soft);
  font-size: 0.92rem;
}

.voice-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 1rem 0 0.5rem;
  font-weight: 700;
  color: var(--heading);
}

.voice-indicator {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(197, 208, 220, 0.35);
}

.voice-indicator[data-state="connecting"],
.voice-indicator[data-state="transcribing"],
.voice-indicator[data-state="thinking"] {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(154, 91, 0, 0.18);
}

.voice-indicator[data-state="listening"] {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(78, 154, 42, 0.25);
}

.voice-indicator[data-state="speaking"] {
  background: var(--vt-teal);
  box-shadow: 0 0 0 4px rgba(3, 173, 174, 0.25);
}

.voice-indicator[data-state="ending"],
.voice-indicator[data-state="ended"] {
  background: var(--vt-gray);
}

.voice-timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.voice-transcript {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.voice-line {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  padding: 0.6rem 0.25rem;
  border-top: 1px solid var(--border);
}

.voice-line:first-child {
  border-top: 0;
}

.voice-role {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.voice-line.role-agent .voice-role {
  color: var(--vt-link);
}

.voice-text {
  overflow-wrap: anywhere;
}

.voice-line.is-pending .voice-text {
  color: var(--muted);
}

.voice-cut {
  background: var(--danger-soft);
  color: var(--danger);
}

.voice-brand-list li > span:first-child {
  flex: 1;
  font-weight: 700;
}

@media (max-width: 559px) {
  .voice-buttons,
  .voice-buttons .btn {
    width: 100%;
  }

  .voice-line {
    grid-template-columns: 1fr auto;
  }

  .voice-text {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .voice-brand-list li {
    flex-wrap: wrap;
  }
}

/* Prospectos: el botón «Descartar» no se parte en dos líneas en la tabla de escritorio. */
.voice-leads .btn {
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .voice-indicator[data-state="listening"],
  .voice-indicator[data-state="speaking"] {
    animation: voice-pulse 1.4s ease-in-out infinite;
  }
}

@keyframes voice-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(3, 173, 174, 0);
  }
}

/* ------------------------------------------------------------------ SaaS: registro, precios, facturación (TASK-041) */

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.center-text {
  text-align: center;
  margin-top: 1rem;
}

.signup-form .check {
  margin: 0.5rem 0;
}

.pricing-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 1.5rem;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(3, 173, 174, 0.3) 0%, transparent 60%),
    var(--vt-navy);
}

.pricing-top {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pricing-top .brand-logo {
  width: 160px;
  height: auto;
}

.pricing-top nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pricing-top nav > a:not(.btn) {
  color: #fff;
}

.pricing-main {
  width: 100%;
  max-width: 1180px;
}

.pricing-intro {
  color: #fff;
  text-align: center;
  max-width: 760px;
  margin: 2rem auto 1.5rem;
}

.pricing-intro h1 {
  color: #fff;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.pricing-intro p {
  color: rgba(255, 255, 255, 0.85);
}

.pricing-trial {
  font-weight: 700;
  color: #a6ecec !important;
}

.pricing-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 700px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .pricing-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.25rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--vt-primary);
}

.plan-card.featured {
  border-top-color: var(--vt-teal);
  box-shadow: var(--shadow-lg);
}

.plan-card .btn {
  margin-top: auto;
  width: 100%;
}

.plan-badge {
  position: absolute;
  top: -0.8rem;
  right: 1rem;
  margin: 0;
  background: var(--vt-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.plan-tagline,
.plan-alt {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-price {
  margin: 0.5rem 0 0;
}

.plan-price strong {
  font-size: 1.9rem;
  color: var(--heading);
}

.plan-price span {
  color: var(--muted);
}

.plan-limits,
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.plan-limits li,
.plan-features li {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.plan-features li::before {
  content: "✓ ";
  color: var(--vt-teal-ink);
  font-weight: 700;
}

.pricing-note {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  text-align: center;
  margin: 1.5rem auto 0;
  max-width: 760px;
}

.billing-price strong {
  font-size: 1.5rem;
  color: var(--heading);
}

.billing-dates {
  margin: 0.5rem 0 1rem;
}

.billing-dates div {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.billing-dates dt {
  color: var(--muted);
}

.billing-dates dd {
  margin: 0;
  font-weight: 700;
}

.badge.billing-active,
.badge.billing-trialing {
  background: var(--ok-soft);
  color: var(--ok-dark);
}

.badge.billing-past_due {
  background: #fff4e0;
  color: var(--warning);
}

.badge.billing-suspended,
.badge.billing-canceled {
  background: var(--danger-soft);
  color: var(--danger);
}

.usage-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.usage-row progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  accent-color: var(--vt-link);
}

.usage-row.over progress {
  accent-color: var(--danger);
}

.usage-value {
  font-weight: 700;
  text-align: right;
}

.plan-option {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.plan-option.current {
  border-color: var(--vt-link);
  background: var(--vt-primary-soft);
}

.plan-option h3 {
  margin: 0;
}

.plan-option .btn {
  margin-top: auto;
  align-self: flex-start;
}

.card-narrow {
  max-width: 560px;
}

.microform-field {
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  background: var(--surface);
}

.microform-short {
  max-width: 160px;
}

/* ------------------------------------------------------------------ videos con IA (TASK-039) */

.preview video.video-player {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  background: #000;
}

.video-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.5rem 0 0.75rem;
  padding: 0;
}

.video-steps li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted, #5b6b7d);
}

.video-steps li.done {
  background: var(--surface-2);
  color: inherit;
}

.video-steps li.now {
  border-color: currentColor;
  font-weight: 600;
  color: inherit;
}

/* TASK-035: aprobación por lotes */
.batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.8rem;
}

.batch-bar .check {
  margin: 0;
}

.batch-bar .check[hidden] {
  display: none;
}

.batch-cell {
  width: 2.2rem;
}

.batch-cell input {
  width: 20px;
  height: 20px;
}

.batch-result p {
  margin: 0 0 0.4rem;
}

.batch-result ul {
  margin: 0 0 0.4rem;
  padding-left: 1.2rem;
}

.home-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.home-filter .field {
  margin: 0;
  flex: 1 1 12rem;
}

/* TASK-036: calendario por marca y modal del día */
.cal-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
}

.cal-filter .field {
  margin: 0;
  flex: 1 1 14rem;
  max-width: 24rem;
}

.cal-hint {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
}

.calendar a.daynum {
  display: inline-block;
  min-width: 1.8rem;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  text-decoration: none;
}

.calendar a.daynum:hover,
.calendar a.daynum:focus-visible {
  background: var(--vt-primary-soft);
  color: var(--vt-primary-dark);
}

.calendar .cal-more {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.day-dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow-sm);
  color: inherit;
  background: var(--surface);
}

.day-dialog::backdrop {
  background: rgb(11 30 58 / 55%);
}

.day-dialog-bar {
  display: flex;
  justify-content: flex-end;
}

.day-dialog-bar form {
  margin: 0;
}

.day-title {
  margin: 0 0 0.3rem;
}

.day-title:focus {
  outline: none;
}

.day-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.day-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.day-item .main {
  min-width: 0;
  flex: 1;
}

.day-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.day-copy {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Dominio de la organización (TASK-042) */
.site-org {
  margin: -0.25rem 0 0.75rem;
  color: var(--muted);
}

.domain-address {
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.domain-host {
  overflow-wrap: anywhere;
}

.domain-dns code,
.domain-card code {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.badge.domain-active {
  background: var(--ok-soft);
  color: var(--ok-dark);
}

.badge.domain-pending,
.badge.domain-verifying {
  background: #fff4e0;
  color: var(--warning);
}

.badge.domain-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.domain-yaml {
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
}
