:root {
    color-scheme: light;

    /* fondo y superficies */
    --bg: #F8F9FA;
    --card: #FFFFFF;

    /* marca */
    --brand: #3D1414;
    --brand-hover: #2A0D0D;
    --cream: #D1BCA9;        /* solo botones secundarios */
    --cream-hover: #C2A891;

    /* texto: un solo tono de tinta (marrón), variando opacidad para jerarquía */
    --text: #3D1414;
    --muted: rgba(61, 20, 20, 0.58);
    --placeholder: #999999;

    /* inputs y líneas divisorias */
    --input-bg: rgba(187, 187, 187, 0.15);
    --hairline: rgba(61, 20, 20, 0.14);

    /* semántico (estados) */
    --ok: #4D6B2F;
    --danger: #A13D3D;
    --danger-hover: #7F2F2F;
    --badge-pendiente: #A3A3A3;
    --badge-enviada: #C7AB8F;
    --badge-recordatorio1: #B08560;
    --badge-recordatorio2: #8A5A3A;

    --radius: 10px;
    --shadow-card: 0 1px 2px rgba(30,15,10,0.04), 0 6px 16px rgba(30,15,10,0.05);
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    /* La ventana NO scrollea: solo el área de contenido (.content-scroll).
       100dvh evita que la barra de direcciones móvil corte el fondo. */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .brand-header {
    background: var(--card);
    border-bottom: 0.5px solid var(--hairline);
    padding: 18px 16px;
    text-align: center;
    flex-shrink: 0;
    z-index: 50;
  }
  .brand-header img { max-width: 220px; width: 100%; height: auto; }
  /* El scroller a todo lo ancho — único elemento que se desplaza */
  .content-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px 48px; width: 100%; }
  h1 {
    font-family: 'EB Garamond', serif;
    font-weight: 600;
    font-size: 2.1rem;
    color: var(--brand);
    margin: 0 0 2px;
    letter-spacing: 0.01em;
    text-align: center;
  }
  .sub { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; text-align: center; }
  .rule { border: none; border-top: 0.5px solid var(--hairline); margin: 0 0 28px; }
  .rule.rule-card { margin: 0 0 14px; }
  h2 {
    font-family: 'EB Garamond', serif;
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--brand);
    margin: 0 0 14px;
  }
  .card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .card-header h2 { margin: 0; }
  .card {
    background: var(--card);
    border: 0.5px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 20px;
  }
  label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
  }
  input[type="password"], input[type="text"], select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: none;
    background: var(--input-bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 12px;
  }
  select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233D1414' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
  }
  input::placeholder { color: var(--placeholder); }
  /* Foco: borde interior fino (inside border) en vez de anillo exterior */
  input:focus, select:focus { outline: none; box-shadow: inset 0 0 0 0.5px var(--brand); }
  select option { background: #fff; color: var(--text); font-family: 'Poppins', sans-serif; }
  select:hover { background-color: rgba(187, 187, 187, 0.22); }
  button {
    border: none;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    color: #fff;
    background: var(--brand);
    white-space: nowrap;
  }
  button:hover { background: var(--brand-hover); }
  button:disabled { opacity: 0.5; cursor: not-allowed; }
  button.secondary { background: #fff; color: var(--brand); border: 0.5px solid var(--brand); }
  button.secondary:hover { background: rgba(61, 20, 20, 0.05); }
  button.danger { background: var(--danger); }
  button.danger:hover { background: var(--danger-hover); }
  button.outline { background: #fff; color: var(--brand); border: 0.5px solid var(--brand); }
  button.outline:hover { background: rgba(61, 20, 20, 0.05); }
  .row { display: flex; gap: 8px; align-items: flex-start; }
  .row button { flex-shrink: 0; width: fit-content; }
  .row button.secondary { padding: 12px 16px; }
  .acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
  .acciones button { flex: 1; text-align: center; min-width: 160px; }
  /* Cuadrícula regular para todos los bloques de contadores (Estado de
     clientes, Retorno de inversión, Reporte mensual, Actividad, etc.):
     cada celda tiene el mismo ancho/alto de columna y el mismo padding, en
     vez de que cada número ocupe solo lo que su contenido necesita. Una
     barra vertical delgada separa cada contador del anterior. */
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 16px 8px; }
  .stat { text-align: center; min-width: 0; padding: 6px 4px; border-left: 0.5px solid var(--hairline); }
  .stat:first-child { border-left: none; }
  .stat .num { font-family: 'Poppins', sans-serif; font-weight: 400; font-size: 1.4rem; color: rgba(61, 20, 20, 0.72); }
  .stat .lbl { font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.02em; }
  .stats .v-sep { display: none; }
  @media (max-width: 860px) {
    .stats { grid-template-columns: repeat(4, 1fr); gap: 18px 8px; }
  }
  /* Contador de días al evento — mismo lenguaje visual que los botones de acción */
  .chip-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: var(--muted);
    border: 0.5px solid var(--hairline);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
  }
  .chip-text svg { width: 13px; height: 13px; flex-shrink: 0; }
  .acciones-fila { display: flex; gap: 5px; flex-wrap: nowrap; }
  button.mini, a.mini {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    border: 0.5px solid var(--hairline);
    text-decoration: none;
    flex-shrink: 0;
  }
  button.mini svg, a.mini svg { width: 15px; height: 15px; }
  button.mini:hover, a.mini:hover { background: var(--input-bg); color: var(--text); }
  /* Variante con texto del botón "mini" — mismo lenguaje visual que los
     botones de acciones por contacto de la tabla (transparente, borde
     hairline, tinta muted), pero con espacio para una etiqueta. */
  button.mini-text {
    background: transparent;
    color: var(--muted);
    border: 0.5px solid var(--hairline);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }
  button.mini-text svg { width: 13px; height: 13px; flex-shrink: 0; }
  button.mini-text:hover { background: var(--input-bg); color: var(--text); }
  button.eye-btn {
    background: transparent;
    color: var(--muted);
    border: 0.5px solid var(--hairline);
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  button.eye-btn svg { width: 18px; height: 18px; }
  button.eye-btn:hover, button.eye-btn:active { background: var(--input-bg); color: var(--text); }
  button.mini[data-estado="confirmado"]:hover { color: var(--ok); border-color: var(--ok); }
  button.mini[data-estado="no confirmado"]:hover { color: var(--danger); border-color: var(--danger); }
  button.mini[data-estado="pendiente"]:hover { color: var(--brand); border-color: var(--brand); }
  button.mini[data-action="enviar"]:hover { color: var(--brand); border-color: var(--brand); }
  .live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--cream); margin-left: 8px; vertical-align: middle;
    animation: pulse 2s infinite;
  }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
  .table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
  /* max-content: cada columna ajusta a su contenido (fit content);
     min-width 100%: si sobra espacio, la tabla no se ve flotando angosta. */
  table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 0.88rem; font-family: 'Poppins', sans-serif; }
  th, td {
    text-align: center;
    vertical-align: middle;
    width: 1%; /* junto con white-space:nowrap hace que cada columna ajuste a su contenido */
    padding: 10px 20px;
    border-bottom: 0.5px solid var(--hairline);
    white-space: nowrap;
  }
  th { color: var(--muted); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.03em; text-transform: uppercase; }
  /* Encabezados fijos al hacer scroll dentro de la lista */
  thead th { position: sticky; top: 0; background: var(--card); z-index: 5; }
  /* Contenido alineado a la izquierda solo en: ID, Nombre, Estado, Teléfono,
     Notas y Confirmados — los encabezados (th) se quedan todos centrados.
     Orden de columnas: 1 Selección, 2 ID (con punto de estado), 3 Nombre,
     4 Lugares, 5 Estado, 6 Recordatorios, 7 Teléfono, 8 Notas, 9 Confirmados,
     10 Platillo, 11 Alergias. */
  td:nth-child(2), td:nth-child(3), td:nth-child(5), td:nth-child(7), td:nth-child(8), td:nth-child(9) { text-align: left; }
  /* Teléfono clicable: abre chat de WhatsApp (wa.me) con mensaje prellenado */
  .tel-link { color: var(--text); text-decoration: none; border-bottom: 0.5px solid var(--hairline); }
  .tel-link:hover { color: var(--brand); border-bottom-color: var(--brand); }
  /* Encabezados de columna ordenables (clic = asc, otro clic = desc, otro clic = sin orden) */
  th[data-sort] { cursor: pointer; user-select: none; }
  th[data-sort]:hover { color: var(--text); }
  th[data-sort]::after { content: ''; display: inline-block; width: 0.6em; margin-left: 3px; opacity: 0.35; }
  th[data-sort].sort-asc::after { content: '▲'; opacity: 1; }
  th[data-sort].sort-desc::after { content: '▼'; opacity: 1; }
  /* Centrar el contenido de las celdas que usan contenedores flex propios */
  td .acciones-fila { justify-content: center; }
  /* Casilla de selección (fill / not fill) por contacto + seleccionar-todo */
  input.sel-check {
    appearance: none;
    -webkit-appearance: none;
    width: 16px; height: 16px;
    padding: 0; margin: 0;
    border: 0.5px solid var(--brand);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
  }
  input.sel-check:checked, input.sel-check:indeterminate {
    background-color: var(--brand);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
  }
  input.sel-check:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  }
  input.sel-check:indeterminate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  }
  input.sel-check:focus { box-shadow: none; }
  .sel-contador { font-family: 'Poppins', sans-serif; font-size: 0.78rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
  .header-acciones { display: flex; align-items: center; gap: 10px; }
  .v-sep { width: 0.5px; height: 18px; background: var(--hairline); margin: 0 4px; flex-shrink: 0; align-self: center; }
  /* Sección de envíos masivos al final de la tarjeta de invitados */
  .envios-masivos { margin-top: 20px; padding-top: 14px; border-top: 0.5px solid var(--hairline); }
  .envios-masivos .acciones-fila { flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  /* Punto de color de estado, a la izquierda del ID de cada invitado */
  .estado-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    margin-right: 10px; vertical-align: middle;
  }
  .estado-dot.dot-pendiente { background: var(--cream); }         /* beige/dorado */
  .estado-dot.dot-seguimiento { background: #F4C91A; }            /* amarillo: enviada / recordatorio 1 / recordatorio 2 */
  .estado-dot.dot-confirmado { background: #19F682; }             /* verde */
  .estado-dot.dot-no-confirmado { background: #F71819; }          /* rojo */
  .estado-dot.dot-seguimiento-completo { background: #1881F4; }   /* azul */
  /* Punto de estado del EVENTO, dentro del chip de calendario */
  .evento-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    margin-left: 2px; animation: pulse 2s infinite;
  }
  .evento-dot.evento-verde { background: #19F682; }
  .evento-dot.evento-beige { background: var(--cream); }
  /* Valor fijo de Lugares cuando el invitado ya confirmó (no editable) */
  .lugares-fijo {
    display: inline-block;
    background: var(--input-bg);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: default;
    white-space: nowrap;
  }
  td select {
    width: auto;
    padding: 6px 26px 6px 10px;
    margin-bottom: 0;
    font-size: 0.85rem;
    background-position: right 8px center;
    background-size: 12px;
  }
  .badge {
    display: inline-block; padding: 4px 12px; border-radius: var(--radius);
    font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 0.72rem; color: #fff; white-space: nowrap;
  }
  .badge.pendiente { background: var(--badge-pendiente); }
  .badge.enviada { background: var(--badge-enviada); }
  .badge.recordatorio1 { background: var(--badge-recordatorio1); }
  .badge.recordatorio2 { background: var(--badge-recordatorio2); }
  .badge.confirmado { background: var(--ok); }
  .badge.no-confirmado { background: var(--danger); }
  .badge.seguimiento-completo { background: var(--brand); }
  #log, #respuestas, #confirmModalLista {
    background: var(--input-bg);
    border-radius: var(--radius);
    padding: 4px 14px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.88rem;
    font-family: 'Poppins', sans-serif;
  }
  .log-line { padding: 9px 0; border-bottom: 0.5px solid var(--hairline); }
  .log-line:last-child { border-bottom: none; }
  .log-line .meta { color: var(--muted); font-size: 0.75rem; }
  .ok-text { color: var(--ok); }
  .fail-text { color: var(--danger); }
  .empty { color: var(--muted); font-style: italic; padding: 12px 0; }
  [hidden] { display: none !important; }
  .modal-overlay {
    position: fixed; inset: 0;
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; z-index: 100;
  }
  .modal-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 28px;
    width: 100%;
    max-width: 420px;
    animation: modalIn 0.18s ease-out;
  }
  /* Botones centrados y con más aire respecto a la lista del preview */
  .modal-actions { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 24px; }
  .modal-actions button { display: inline-flex; align-items: center; gap: 7px; }
  .modal-actions button svg { width: 14px; height: 14px; flex-shrink: 0; }
  /* Jerarquía "details": descripciones de los modales de confirmación */
  .modal-details { text-align: left; font-size: 0.82rem; color: var(--muted); margin: 0 0 14px; }
  .modal-details strong { color: var(--text); font-weight: 600; }
  .spinner {
    width: 16px; height: 16px; flex-shrink: 0;
    border: 2px solid rgba(61, 20, 20, 0.15);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes modalIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  .card { animation: fadeUp 0.25s ease-out; }
  /* Transiciones sutiles en elementos interactivos */
  button, a.mini, .chip-text, .tel-link, input, select {
    transition: background-color 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s, box-shadow 0.18s;
  }
  tbody tr { transition: background-color 0.15s; }
  tbody tr:hover { background: rgba(187, 187, 187, 0.08); }
  /* Mini-popover del menú ⋮ */
  .menu-wrap { position: relative; display: inline-flex; }
  .menu-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card);
    border: 0.5px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
    z-index: 60;
    animation: modalIn 0.14s ease-out;
  }
  .menu-pop button {
    display: flex; align-items: center; gap: 8px;
    background: transparent;
    color: var(--text);
    border: none;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    border-radius: 6px;
  }
  .menu-pop button svg { width: 13px; height: 13px; flex-shrink: 0; }
  .menu-pop button:hover { background: var(--input-bg); color: var(--text); }
  .menu-pop button:disabled:hover { background: transparent; }
  #menuEliminar:not(:disabled):hover { color: var(--danger); }
  /* Preview de la invitación como si fuera un móvil */
  .phone-frame {
    position: relative;
    width: 375px;
    max-width: 92vw;
    height: 82vh;
    background: #fff;
    border: 0.5px solid var(--hairline);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: modalIn 0.18s ease-out;
  }
  .phone-frame iframe { width: 100%; height: 100%; border: none; }
  .phone-cerrar { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--card); }

/* ===== Shell de navegación (18JUL) ===== */
/* Región entre el header y el fondo; no scrollea (el scroll vive dentro de
   .content-scroll). El sidebar y el contenido son sus hijos flex. */
.app-shell { display: flex; flex: 1 1 auto; align-items: stretch; min-height: 0; overflow: hidden; }
#menuLateral {
  width: 224px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 0.5px solid var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Columna fija en el flujo: el shell (align-items:stretch) le da el alto
     completo, así que queda pegada a la izquierda sin moverse con el scroll.
     Si el menú excede el alto en pantallas cortas, scrollea internamente. */
  padding: 18px 12px;
  overflow-y: auto;
  transition: width 0.2s ease;
  z-index: 40;
}
#menuLateral.colapsado { width: 64px; }
#menuLateral.colapsado .nav-txt,
#menuLateral.colapsado .menu-pie-info { display: none; }
.menu-logo { width: 44px; height: auto; display: block; margin: 0 auto 18px; }
.menu-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--input-bg); color: var(--text); }
.nav-item.activo { background: rgba(61, 20, 20, 0.06); color: var(--brand); }
.menu-pie { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 0.5px solid var(--hairline); }
.pfp { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 0.5px solid var(--hairline); flex-shrink: 0; }
.menu-pie-info { min-width: 0; font-size: 0.8rem; font-weight: 500; color: var(--text); }
.menu-pie-info > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-rol { font-size: 0.68rem; color: var(--muted); text-transform: capitalize; }
#menuOverlay {
  position: fixed; inset: 0;
  z-index: 59;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(61, 20, 20, 0.08);
}
#btnHamburguesa { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }
.brand-header { position: relative; }
/* Login centrado vertical y horizontalmente */
.wrap.login-mode {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 14vh;
  align-items: center;
}
.wrap.login-mode #auth { width: 100%; max-width: 460px; }
/* Kanban de eventos */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kanban-col h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  text-align: center;
}
.kanban-card {
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  background: var(--card);
}
.kanban-card h4 { font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.05rem; color: var(--brand); margin: 0 0 4px; }
.kanban-card .meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; }
.kanban-card .acciones-fila { justify-content: space-between; align-items: center; }
/* Off-canvas en móvil/tablet */
@media (max-width: 860px) {
  #menuLateral {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    border-right: 0.5px solid var(--hairline);
    box-shadow: var(--shadow-card);
  }
  #menuLateral.abierto { transform: translateX(0); }
  #menuLateral.colapsado { width: 224px; } /* colapsado no aplica en off-canvas */
  #menuLateral.colapsado .nav-txt, #menuLateral.colapsado .menu-pie-info { display: block; }
  .kanban { grid-template-columns: 1fr; }
}

/* Vista Usuarios */
.clave-oculta { filter: blur(4px); cursor: pointer; transition: filter 0.15s; font-family: 'Poppins', sans-serif; }
.clave-oculta.revelada { filter: none; }
.perfil-card { display: flex; gap: 18px; align-items: center; }
.pfp-grande { width: 84px; height: 84px; cursor: pointer; }
.perfil-nombre { font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.3rem; color: var(--brand); margin-bottom: 4px; }
.perfil-card .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }

/* Registro y Actividad */
#registroTabs .activo { background: var(--input-bg); color: var(--text); border-color: var(--brand); }
#actividadLog .estado-dot { margin-right: 8px; }

/* Observaciones post-18JUL */
.menu-pie-grupo { border-top: 0.5px solid var(--hairline); padding-top: 10px; }
.menu-pie { border-top: none; padding-top: 0; }
.link-btn {
  background: transparent; border: none; padding: 6px 6px 0;
  color: var(--muted); font-size: 0.78rem; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-btn:hover { color: var(--brand); background: transparent; }
#menuLateral.colapsado .link-btn { display: none; }
/* Kanban: imagen social preview arriba de la tarjeta (proporción OG 1.91:1) */
.kanban-card { padding: 0; overflow: hidden; }
.kanban-card .og-img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; display: block; border-bottom: 0.5px solid var(--hairline); }
.kanban-card .kanban-body { padding: 12px 14px 14px; }
.kanban-card h4 { margin: 0 0 2px; }
.kanban-card .meta { margin: 0 0 4px; }
.kanban-card .acciones-fila { margin-top: 10px; }
/* Punto de estado con texto envolvente: la 2a línea alinea con el texto */
.linea-con-dot { display: flex; align-items: flex-start; gap: 8px; }
.linea-con-dot .estado-dot { flex-shrink: 0; margin: 7px 0 0; }
.linea-con-dot .linea-texto { min-width: 0; }
/* Registro: tabla alta (~20 filas) */
#registroTabla { max-height: 760px; min-height: 400px; overflow: auto; }
/* Respaldos: más aire entre elementos */
#respaldosLista .log-line { padding: 12px 0; }
/* Lista de eventos con checkbox en el modal de usuario */
.check-lista { background: var(--input-bg); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; max-height: 180px; overflow-y: auto; }
.check-item { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.85rem; margin-bottom: 8px; }
.check-item:last-child { margin-bottom: 0; }
.filtro-fechas { align-items: center; gap: 8px; margin-bottom: 14px; }
/* Los sub-grupos del filtro también centran verticalmente sus hijos, para
   que las etiquetas "Desde"/"Hasta" queden a la misma altura que los
   recuadros de fecha y el botón de calendario. */
.filtro-fechas .acciones-fila { align-items: center; }
.filtro-fechas input[type="date"] { width: auto; margin-bottom: 0; padding: 8px 12px; font-size: 0.82rem; }
.filtro-fechas label { font-size: 0.78rem; color: var(--muted); margin-bottom: 0; line-height: 1; }
/* Filtros de categoría (Ediciones/Mensajería) van al mismo nivel del
   filtro de fechas, pero pegados a la izquierda — el filtro de fechas
   se queda a la derecha. */
.envios-masivos .filtro-fechas { justify-content: space-between; }
#actFiltroEdiciones.activo, #actFiltroMensajeria.activo { background: var(--input-bg); color: var(--text); border-color: var(--brand); }
.clave-txt { letter-spacing: 1px; }


/* Pulido UI (2a ronda) */
/* Kanban: nombre + dot de estado en la misma línea */
.kanban-card h4 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kanban-card h4 .estado-dot { margin: 0; }
/* Actividad: stats en grid con contenido centrado */
#actividadStats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; justify-items: center; }
@media (max-width: 860px) { #actividadStats { grid-template-columns: repeat(2, 1fr); } }
/* Inputs de fecha con el design system (igual que text/password/select) */
input[type="date"] {
  appearance: none; -webkit-appearance: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg); border: none; border-radius: var(--radius);
  color: var(--text); font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55; cursor: pointer;
  filter: invert(12%) sepia(28%) saturate(1600%) hue-rotate(-12deg);
}
/* Usuarios: clave con texto a la izquierda y ojo al final, sin saltos de ancho */
.clave-celda { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.clave-txt { display: inline-block; text-align: left; }
button[data-ojo] svg { animation: ojoPop 0.18s ease; }
@keyframes ojoPop { from { transform: scale(0.7); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
/* Usuarios: filas responsivas y eventos en lista vertical */
.tabla-usuarios td { white-space: normal; }
.eventos-lista { text-align: left; }
.eventos-lista div { white-space: nowrap; }

/* ===== Cambios 18JUL (2a ronda) ===== */
/* Campanita de notificaciones (header, lado derecho) */
.notif-wrap { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
#btnCampana { position: relative; }
.notif-dot, .nav-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); flex-shrink: 0;
}
.notif-dot { position: absolute; top: 5px; right: 5px; }
.nav-dot { margin-left: auto; }
/* Sidebar colapsado (solo íconos): el puntito se recorre a la esquina
   superior derecha del botón en vez de quedar pegado al texto oculto. */
#menuLateral.colapsado .nav-item { position: relative; }
#menuLateral.colapsado .nav-dot { position: absolute; top: 6px; right: 6px; margin-left: 0; }
.notif-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: 86vw;
  background: var(--card);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  z-index: 70;
  text-align: left;
  animation: modalIn 0.14s ease-out;
  max-height: 380px;
  overflow-y: auto;
}
.notif-pop-head { font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.05rem; color: var(--brand); margin-bottom: 6px; }
.notif-cat {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--muted); margin: 10px 0 2px;
}
.notif-item { padding: 7px 0; border-bottom: 0.5px solid var(--hairline); font-size: 0.82rem; }
.notif-item:last-child { border-bottom: none; }
.notif-item .meta { color: var(--muted); font-size: 0.72rem; }

/* Pie del menú como botón (abre mi perfil) */
button.menu-pie {
  background: transparent; border: none; width: 100%;
  padding: 10px 6px 0; text-align: left; cursor: pointer;
  border-radius: var(--radius); color: var(--text);
  font-family: 'Poppins', sans-serif;
}
button.menu-pie:hover { background: var(--input-bg); }

/* Modal de cerrar sesión: orden de botones invertido */
.modal-actions.acciones-invertidas { flex-direction: row-reverse; }

/* Loading dentro del botón de confirmar (reemplaza al ícono, mismo ancho) */
#confirmModalEnviar .spinner {
  width: 14px; height: 14px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}
#confirmModalIcono { display: inline-flex; align-items: center; }
#confirmModalIcono svg { width: 14px; height: 14px; }

/* Kanban: más aire entre el título de columna y las tarjetas */
.kanban-col h3 { margin-bottom: 16px; }

/* Botones de envío con el mismo ancho, ocupando el espacio uniforme */
.envios-fila { display: flex; }
.envios-fila > button.mini-text { flex: 1 1 0; justify-content: center; min-width: 0; }
.envios-fila .v-sep { align-self: center; }
@media (max-width: 860px) { .envios-fila { flex-wrap: wrap; } .envios-fila > button.mini-text { min-width: 44%; } }

/* Preview del mensaje real (burbuja estilo WhatsApp) */
.msg-preview { padding: 10px 0 6px; }
.msg-preview-titulo { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.msg-burbuja {
  background: #fff;
  border: 0.5px solid var(--hairline);
  border-radius: 12px 12px 12px 4px;
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  box-shadow: var(--shadow-card);
}
.msg-boton {
  margin-top: 10px; padding-top: 8px;
  border-top: 0.5px solid var(--hairline);
  color: #1881F4; text-align: center; font-weight: 500;
}

/* Grupos del estado del evento: clicables para filtrar la lista */
.stat-clic { cursor: pointer; border-radius: var(--radius); padding: 6px 8px; transition: background-color 0.15s; }
.stat-clic:hover { background: var(--input-bg); }
.stat-clic.stat-activo { background: rgba(61, 20, 20, 0.06); }
.stat-clic.stat-activo .num { color: var(--brand); }

/* Llenado rápido: celdas capturables con doble clic */
.qf-vacio { color: var(--placeholder); font-style: italic; font-size: 0.8rem; }
.qf-cell { display: inline-block; min-width: 120px; cursor: text; vertical-align: middle; }
/* Al capturar, la celda se vuelve flex para centrar el input vertical y horizontalmente */
.qf-cell.qf-editando { display: flex; align-items: center; justify-content: center; }
.qf-input { width: 180px; max-width: 100%; padding: 8px 12px; margin: 0; font-size: 0.85rem; text-align: center; vertical-align: middle; }

/* Actividad: más padding vertical en los contenedores de métricas */
#actividadStats { padding: 18px 0; }
#actividadStats .stat { padding: 10px 0; }

/* Solicitudes (admin y actividad): info a la izquierda, íconos a la derecha */
.solicitud-linea { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.solicitud-info { min-width: 0; font-size: 0.88rem; }
.solicitud-info > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solicitud-botones { flex-shrink: 0; }

/* Registro: tabs de vista pegados a las acciones, separados con barra */
.registro-header-acciones { align-items: center; flex-wrap: wrap; }

/* Shift+clic para seleccionar rangos: evita que se seleccione texto */
.table-wrap td, .table-wrap th { user-select: none; }
.table-wrap td:nth-child(n+3) { user-select: text; }

/* Modal de nuevo evento: clave de acceso editable + ojo + copiar.
   La fila no traía el margen inferior que sí tienen los inputs sueltos;
   se lo damos explícitamente. La nota de requisitos va debajo, más pegada. */
#modalEventoOverlay .campo-clave-evento { align-items: center; margin-bottom: 10px; }
#modalEventoOverlay #evNuevoIdNota { margin-top: 4px; margin-bottom: 12px; }
#modalEventoOverlay .campo-clave-evento input { margin-bottom: 0; }
#modalEventoOverlay .campo-clave-evento button { align-self: center; }

/* Modal de edición de fila del registro: 2 columnas para que no sea tan largo */
#modalRegistroOverlay .modal-card { max-width: 560px; }
#modalRegistroCampos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: end; }
@media (max-width: 560px) { #modalRegistroCampos { grid-template-columns: 1fr; } }

/* ===================================================================== */
/* Ronda 18JUL-3: perfil arriba, ajustes, soporte, tabla usuarios, kanban */
/* ===================================================================== */

/* Grupo de perfil arriba del menú (sustituye al favicon) */
.menu-perfil {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: transparent; border: none; cursor: pointer;
  padding: 8px 6px; border-radius: var(--radius); text-align: left;
  color: var(--text); font-family: 'Poppins', sans-serif;
}
.menu-perfil:hover { background: var(--input-bg); }
.menu-sep { height: 0; border-top: 0.5px solid var(--hairline); margin: 12px 4px; }
#menuLateral.colapsado .menu-perfil { justify-content: center; padding: 8px 0; }
/* El grupo inferior (soporte/ajustes/cerrar sesión) ya no lleva su borde viejo */
.menu-pie-grupo { border-top: none; padding-top: 0; }

/* Tabla de usuarios: nombre en una línea, eventos verticales fit-content */
.tabla-usuarios .td-usuario { white-space: nowrap; }
.tabla-usuarios td { vertical-align: top; }
.link-evento {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: var(--brand); font: inherit; text-align: left;
  text-decoration: underline; text-decoration-color: var(--hairline);
}
.link-evento:hover { text-decoration-color: var(--brand); }
.link-evento:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* Kanban: botón "Acceder" siempre a la derecha (eliminar queda a la izquierda) */
.kanban-card .acciones-fila { justify-content: flex-end; }
.kanban-card [data-eliminar-evento] { margin-right: auto; }

/* Ajustes: toggles con switch */
.ajustes-toggles { display: flex; flex-direction: column; margin-top: 14px; }
.toggle-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 4px; border-top: 0.5px solid var(--hairline);
}
.toggle-info { display: flex; flex-direction: column; gap: 2px; }
.toggle-info .meta { font-size: 0.75rem; color: var(--muted); }
.switch {
  width: 42px; height: 24px; -webkit-appearance: none; appearance: none;
  background: var(--hairline); border-radius: 999px; position: relative;
  cursor: pointer; transition: background 0.15s; flex-shrink: 0; margin: 0;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }

/* Widget de soporte flotante (esquina inferior derecha) */
.soporte-widget {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  width: 340px; max-width: calc(100vw - 32px); max-height: 72vh;
  background: var(--card); border: 0.5px solid var(--hairline);
  border-radius: 14px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; overflow: hidden;
}
.soporte-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; background: var(--brand); color: #fff; font-weight: 600;
}
.soporte-cerrar { background: none; border: none; color: #fff; font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.soporte-body { padding: 18px 20px; overflow-y: auto; }
.soporte-intro { font-size: 0.78rem; color: var(--muted); margin: 0 0 14px; }
.soporte-faqs { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.soporte-faq { border: 0.5px solid var(--hairline); border-radius: 8px; padding: 12px 14px; }
.soporte-faq summary { cursor: pointer; font-size: 0.82rem; font-weight: 500; color: var(--text); }
.soporte-faq[open] summary { margin-bottom: 4px; }
.soporte-faq-a { font-size: 0.78rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.soporte-label { display: block; font-size: 0.78rem; margin-bottom: 8px; }
.soporte-widget textarea {
  width: 100%; resize: vertical; border: 0.5px solid var(--hairline);
  border-radius: 8px; padding: 11px 12px; font: inherit; background: var(--input-bg); color: var(--text);
}
.soporte-enviar { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; }
.soporte-enviar svg { width: 16px; height: 16px; }
@media (max-width: 860px) { .soporte-widget { right: 12px; left: 12px; bottom: 12px; width: auto; } }

/* Modo oscuro */
:root[data-tema="oscuro"] {
  color-scheme: dark;
  --bg: #1A1414;
  --card: #241C1C;
  --text: #F3E9E3;
  --muted: rgba(243, 233, 227, 0.6);
  --placeholder: #8a807b;
  --input-bg: rgba(255, 255, 255, 0.06);
  --hairline: rgba(243, 233, 227, 0.16);
}
/* Los textos/acentos que en claro son marrón (var(--brand)) pasan a claros.
   Los fondos/botones/badges que usan --brand como relleno se conservan. */
:root[data-tema="oscuro"] h1,
:root[data-tema="oscuro"] h2,
:root[data-tema="oscuro"] .kanban-card h4,
:root[data-tema="oscuro"] .perfil-nombre,
:root[data-tema="oscuro"] .notif-pop-head,
:root[data-tema="oscuro"] .stat-clic.stat-activo .num,
:root[data-tema="oscuro"] .nav-item.activo,
:root[data-tema="oscuro"] .link-evento { color: var(--text); }
:root[data-tema="oscuro"] .nav-item.activo,
:root[data-tema="oscuro"] .stat-clic.stat-activo,
:root[data-tema="oscuro"] #registroTabs .activo,
:root[data-tema="oscuro"] #actFiltroEdiciones.activo,
:root[data-tema="oscuro"] #actFiltroMensajeria.activo { background: rgba(255, 255, 255, 0.08); }
:root[data-tema="oscuro"] button.secondary,
:root[data-tema="oscuro"] button.outline {
  background: transparent; color: var(--text); border-color: var(--hairline);
}
:root[data-tema="oscuro"] button.secondary:hover,
:root[data-tema="oscuro"] button.outline:hover { background: rgba(255, 255, 255, 0.06); }
/* El wordmark de la cabecera (marrón) se vuelve legible sobre fondo oscuro */
:root[data-tema="oscuro"] .brand-header img { filter: brightness(0) invert(1); opacity: 0.92; }

/* ===================================================================== */
/* Pulido de microanimaciones y transiciones (navegación smooth)         */
/* ===================================================================== */
.nav-item, .mini, .mini-text, button.mini, .switch, .stat-clic, summary,
.link-evento, .link-btn, .menu-perfil, .toggle-fila,
.registro-header-acciones button, .soporte-faq, .badge, .sel-check {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
/* Feedback táctil al presionar */
button:active:not(:disabled), .nav-item:active, .mini:active, .mini-text:active { transform: translateY(1px); }
/* Tarjetas de evento: leve elevación al pasar el cursor */
.kanban-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(30, 15, 10, 0.10); }
/* Foto de perfil: pequeño realce */
.pfp { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.menu-perfil:hover .pfp { transform: scale(1.04); }
.pfp-grande:hover { box-shadow: 0 0 0 3px var(--input-bg); }

/* Entrada suave y escalonada de las tarjetas al cambiar de vista */
.card { animation: fadeUp 0.30s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.16s; }
.kanban-card { animation: fadeUp 0.28s ease-out both; }

/* Widget de soporte con entrada suave */
.soporte-widget:not([hidden]) { animation: soporteIn 0.22s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes soporteIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ===================================================================== */
/* Paneles admin del Master Doc: Seguimiento, Tráfico y Finanzas          */
/* ===================================================================== */

/* Seguimiento: fila de búsqueda + filtro rápido de 3 meses */
.seg-filtros { margin-bottom: 10px; align-items: center; }
.seg-filtros #segBuscar { flex: 1; margin-bottom: 0; }
#segFiltro3m { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
#segFiltro3m svg { width: 13px; height: 13px; }
#segFiltro3m.activo { background: var(--input-bg); color: var(--text); border-color: var(--brand); }

/* Celdas de las tablas nuevas */
.td-nowrap { white-space: nowrap; }
.td-monto { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-detalles { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-carpeta { text-align: center; }
.monto-negativo { color: #B3402A; }
.fila-total td { border-top: 1px solid var(--hairline); }
/* Tráfico: todo el contenido a la izquierda (los encabezados se quedan
   centrados, como el resto de las tablas del panel). */
#traficoTabla td { text-align: left; }
/* Finanzas: mismo criterio en todas sus tablas (Balance anual, Registro
   contable) — datos a la izquierda, encabezados centrados. */
#vistaFinanzas td { text-align: left; }
.stat-negativo .num { color: #B3402A; }
.stat-positivo .num { color: #2E7D32; }

/* Modal de cliente: dos columnas en campos cortos */
.modal-cliente { max-height: 88vh; overflow-y: auto; }
.modal-cliente input[readonly] { background: var(--input-bg); color: var(--muted); cursor: default; }
.modal-dos-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.modal-cliente textarea {
  width: 100%; resize: vertical; border: 0.5px solid var(--hairline); border-radius: 8px;
  padding: 12px 16px; font: inherit; background: var(--input-bg); color: var(--text); margin-bottom: 12px;
}
.toggle-modal { margin: 4px 0 14px; }
@media (max-width: 560px) { .modal-dos-cols { grid-template-columns: 1fr; gap: 0; } }

/* Tráfico: barra proporcional por canal */
.th-barra, .td-barra { width: 26%; min-width: 120px; }
.barra-canal {
  height: 8px; border-radius: 999px; background: var(--brand); width: var(--w, 0%);
  animation: crecerX 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  transform-origin: left center;
}
@keyframes crecerX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Finanzas: gráfica de barras mensual (registrado + proyectado apilados) */
.fin-leyenda { display: inline-flex; gap: 14px; align-items: center; font-size: 0.78rem; color: var(--muted); }
.leyenda-item { display: inline-flex; align-items: center; gap: 6px; }
.leyenda-cuadro { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.leyenda-cuadro.registrado { background: var(--brand); }
.leyenda-cuadro.proyectado { background: rgba(61, 20, 20, 0.28); outline: 1px dashed var(--brand); outline-offset: -1px; }
.fin-grafica-wrap { overflow-x: auto; padding-bottom: 4px; }
/* Finanzas: edición de precios de paquetes */
#finRetProyeccionToggle { margin-top: 10px; }
#finRetProyeccion { margin-top: 10px; }
.precios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .precios-grid { grid-template-columns: repeat(2, 1fr); } }
.precio-campo label { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; }
.precio-campo input { width: 100%; }
.fin-grafica { display: flex; align-items: flex-end; gap: 8px; min-height: 190px; min-width: 560px; }
.barra-mes { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 24px; }
.barra-pila { display: flex; flex-direction: column; justify-content: flex-end; height: 150px; width: 100%; max-width: 34px; }
.barra {
  width: 100%; height: var(--h, 0%); border-radius: 4px 4px 0 0;
  animation: crecerY 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both; animation-delay: var(--delay, 0s);
  transform-origin: bottom center;
}
.barra.registrado { background: var(--brand); }
.barra.proyectado { background: rgba(61, 20, 20, 0.28); border: 1px dashed var(--brand); border-bottom: 0; }
.barra.proyectado + .barra.registrado { border-radius: 0; }
@keyframes crecerY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.barra-label { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.barra-anio { opacity: 0.65; margin-left: 2px; }
.barra-mes.mes-actual .barra-label { color: var(--text); font-weight: 600; }

/* Finanzas: años del balance anual */
#finAnios .mini-text.activo { background: var(--input-bg); color: var(--text); border-color: var(--brand); }
#finRetVistaMensual.activo, #finRetVistaHistorico.activo { background: var(--input-bg); color: var(--text); border-color: var(--brand); }
#finRetProyeccionToggle.activo { color: var(--brand); border-color: var(--brand); background: var(--input-bg); }

/* Finanzas: recordatorios de pago */
.recordatorio-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 0.5px solid var(--hairline); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px;
}
.rec-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recordatorio-fila.rec-por-vencer { border-left: 3px solid #C98A2B; }
.recordatorio-fila.rec-vencido { border-left: 3px solid #B3402A; }
.rec-badge { font-size: 0.68rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; color: #fff; }
.rec-badge.vencido { background: #B3402A; }
.rec-badge.por-vencer { background: #C98A2B; }

/* Modo oscuro para los paneles nuevos */
:root[data-tema="oscuro"] .monto-negativo { color: #E08C74; }
:root[data-tema="oscuro"] .stat-negativo .num { color: #E08C74; }
:root[data-tema="oscuro"] .stat-positivo .num { color: #8FCB94; }
:root[data-tema="oscuro"] .barra-canal,
:root[data-tema="oscuro"] .barra.registrado,
:root[data-tema="oscuro"] .leyenda-cuadro.registrado { background: #D8B9A5; }
:root[data-tema="oscuro"] .barra.proyectado,
:root[data-tema="oscuro"] .leyenda-cuadro.proyectado {
  background: rgba(216, 185, 165, 0.25); outline-color: #D8B9A5; border-color: #D8B9A5;
}

/* Respeta la preferencia de "menos movimiento" del sistema */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0 !important;
    transition-duration: 0.001ms !important;
  }
}
