/* ===== Variables ===== */
/* ZYNTRA Systems: un acento azul y superficies neutras. El color fuerte queda para las cifras y lo que significa algo. */
:root {
  --primary: #087CF0;        /* azul ZYNTRA Systems (botones, selección) */
  --primary-600: #0663C9;    /* azul para texto sobre claro (contraste 8:1) */
  --primary-50: #e4e8ff;
  --grad-primary: linear-gradient(135deg, #087CF0, #0663C9);
  --brand-solid: #0663C9;    /* fondo azul fijo (hero, hover, avatar): no cambia en oscuro */
  --accent: #dc2626;         /* rojo de "borrar" y alertas */
  --accent-600: #b91c1c;
  --bg: #F4F7FB;            /* misma paleta que ZYNTRA Entradas (plataforma.css: --papel) */
  --panel: #ffffff;
  --raised: #e6e8f7;
  --ink: #0f172a;            /* texto principal */
  --ink-2: #475569;          /* texto secundario */
  --ink-soft: #526075;       /* texto tenue (meta, ayudas): ≥ 4.5 también sobre --raised y --primary-50 */
  --line: #e2e8f0;
  --line-strong: rgba(15,23,42,.16);
  --green-bg: #cbf9e9; --green-ink: #11713a;
  --yellow-bg: #f9e9cb; --yellow-ink: #8a5300;
  --red-bg: #fde7ec; --red-ink: #c81e1e;
  --blue-bg: #e4e8ff; --blue-ink: #0663C9;
  --gray-bg: #e6e8f7; --gray-ink: #475569;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 20px rgba(15,23,42,.08);
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* Noche ZYNTRA Systems (barra lateral) */
  --night: radial-gradient(120% 60% at 0% 0%, rgba(6,99,201,.45), transparent 60%), linear-gradient(180deg, #0B1326 0%, #070D1B 100%);
  --n-ink: #eef0f5; --n-ink-2: #a3a9b8; --n-ink-3: #7a8296;
  --n-line: rgba(255,255,255,.08); --n-raised: rgba(255,255,255,.06); --n-active: rgba(255,255,255,.11);
}

/* Oscuro igual que ZYNTRA Entradas (plataforma.css): sigue el modo del equipo. Al imprimir, siempre claro (más abajo). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070D1B; --panel: #12131f; --raised: #1a1c2b;
    --ink: #F4F7FB; --ink-2: #d3d4de; --ink-soft: #9a9bab;
    --line: #1f202a; --line-strong: rgba(241,242,252,.16);
    --primary-600: #a5b8ff; --primary-50: #131c45;
    --green-bg: #0f2a22; --green-ink: #5fd39a;
    --yellow-bg: #3a2c12; --yellow-ink: #f2b95b;
    --red-bg: #3d1b19; --red-ink: #ff8a80;
    --blue-bg: #131c45; --blue-ink: #a5b8ff;
    --gray-bg: #1a1c2b; --gray-ink: #d3d4de;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
@media print {
  :root {
    --bg: #ffffff; --panel: #ffffff; --raised: #e6e8f7; --ink: #0f172a; --ink-2: #475569; --ink-soft: #64748b;
    --line: #e2e8f0; --line-strong: rgba(15,23,42,.16); --primary-600: #0663C9; --primary-50: #e4e8ff; color-scheme: light;
  }
}

* { box-sizing: border-box; }
/* El atributo hidden SIEMPRE oculta. Antes, ".tab { display:inline-flex }" le
   ganaba y los roles Admin1/Contaduría veían pestañas que no les corresponden. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout general: barra lateral + área principal ===== */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.app[hidden] { display: none; }

/* ===== Barra lateral ===== */
/* Toda la barra se desplaza junta (antes el menú tenía su propio scroll y los botones de abajo lo aplastaban). */
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 16px; padding: 16px 12px;
  background: var(--night);
  color: var(--n-ink-2);
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em; flex-shrink: 0;
}
.brand-text { min-width: 0; }
.sidebar .brand-text h1 { font-size: 16px; line-height: 20px; margin: 0; font-weight: 600; color: var(--n-ink); }
.sidebar .brand-text p { margin: 0; font-size: 12px; line-height: 16px; color: var(--n-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Selector de etapa del evento (las etapas de ⚙️ Mi evento) */
.evento-switch { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.evento-switch[hidden] { display: none; }
.evento-switch label { font-size: 12px; font-weight: 400; color: var(--n-ink-3); padding-left: 4px; }
.evento-switch select {
  width: 100%; height: 36px; border: 1px solid var(--n-line); background: var(--n-raised);
  color: var(--n-ink); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 0 12px; border-radius: 8px; cursor: pointer;
}
.evento-switch select:focus { outline: none; border-color: rgba(255,255,255,.28); }
.evento-switch select option { color: var(--ink); }

/* Selector de modo (Panel / Inscripción) */
.mode-switch { display: flex; background: var(--n-raised); border: 1px solid var(--n-line); border-radius: 8px; padding: 2px; gap: 2px; margin: 0 4px; }
.mode-switch button {
  flex: 1; justify-content: center; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 500; font-size: 13px; color: var(--n-ink-2);
  height: 32px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.mode-switch button:hover { color: var(--n-ink); }
.mode-switch button.active { background: var(--n-active); color: #fff; }

/* Navegación vertical: filas de 36, ícono en una columna, separación de 2 */
.tabs { display: flex; flex-direction: column; gap: 2px; flex: none; }
.tabs[hidden] { display: none; }
.tab {
  border: 0; background: transparent; cursor: pointer; font-family: inherit; width: 100%;
  min-height: 36px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--n-ink-2);
  display: flex; align-items: center; gap: 12px; text-align: left;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.tab .ic { color: var(--n-ink-3); transition: color .15s var(--ease); }
.tab:hover { background: var(--n-raised); color: var(--n-ink); }
.tab:hover .ic { color: var(--n-ink-2); }
.tab.active { background: var(--n-active); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.tab.active .ic { color: #fff; }

/* Pie de la barra: usuario, ajustes y cerrar sesión */
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--n-line); display: flex; flex-direction: column; gap: 2px; }
.admin { display: flex; align-items: center; gap: 12px; padding: 4px 8px 8px; }
.admin-text { line-height: 1.3; min-width: 0; }
.admin-text strong { display: block; font-size: 13px; font-weight: 500; color: var(--n-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-text span { display: block; font-size: 12px; color: var(--n-ink-3); }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-solid); color: #fff; font-weight: 500; font-size: 12px;
}
.logout-btn {
  border: 0; background: transparent; color: var(--n-ink-2); width: 100%;
  min-height: 36px; padding: 0 12px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left; margin-top: 4px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.logout-btn .ic { color: var(--n-ink-3); }
.logout-btn:hover { background: var(--n-raised); color: var(--n-ink); }

/* ===== Área principal ===== */
.main-area { min-width: 0; padding: 0 32px 64px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: var(--bg); min-height: 72px; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; }
.topbar-title h2 { margin: 0; font-size: 24px; line-height: 28px; font-weight: 500; }
.topbar-sub { margin: 4px 0 0; font-size: 13px; line-height: 16px; color: var(--ink-soft); }
.topbar-user { font-size: 13px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.view { padding-top: 24px; }

/* ===== Pantalla de acceso (login) ===== */
.login-screen {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto;
  background: var(--night);
}
.login-screen[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 384px; background: var(--panel); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.32); padding: 32px;
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .brand-logo.lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; margin: 0 auto 16px; }
.login-brand h1 { margin: 0; font-size: 20px; line-height: 24px; font-weight: 600; }
.login-brand p { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .field { margin-bottom: 0; }
.login-form .input { height: 44px; padding: 0 12px; }
.login-btn { justify-content: center; height: 44px; padding: 0 16px; font-size: 15px; }
.login-error { background: var(--red-bg); color: var(--red-ink); font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: 8px; text-align: center; }
.login-error[hidden] { display: none; }
/* Equipo cifrado: confirmar con otra persona / empezar de cero */
.login-aviso { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-2); background: var(--raised); padding: 12px; border-radius: 8px; }
#confirmarForm .btn-ghost, #confirmarForm .btn-danger { width: 100%; justify-content: center; text-align: center; }
.cf-cero { font-size: 13px; color: var(--ink-soft); }
.cf-cero summary { cursor: pointer; padding: 4px 0; }
.cf-cero p { margin: 8px 0 12px; line-height: 1.5; }
.btn-danger { background: var(--red-bg); color: var(--red-ink); white-space: normal; line-height: 1.35; padding-left: 12px; padding-right: 12px; }
.btn-danger:hover { background: color-mix(in srgb, var(--red-ink) 18%, var(--red-bg)); }
.login-hint { margin: 24px 0 0; text-align: center; font-size: 12px; color: var(--ink-soft); line-height: 18px; }
.login-hint .ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }

/* ===== Panel / view ===== */
.panel {
  background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 500; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== Inputs ===== */
.input, .select {
  font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 8px; padding: 8px 12px; min-height: 36px;
  outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input::placeholder { color: var(--ink-soft); }
.search { min-width: 200px; }
.select { cursor: pointer; padding-right: 32px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }

/* ===== Buttons ===== */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  border: 0; border-radius: 8px; min-height: 36px; padding: 8px 16px; display: inline-flex; align-items: center; gap: 8px;
  transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
  white-space: nowrap; text-decoration: none;
}
.btn:active:not([disabled]) { transform: scale(.98); }
.btn .ic { width: 16px; height: 16px; }
/* Botón principal: degradé ZYNTRA Systems (pedido de la marca) */
.btn-primary { background: var(--primary-600) var(--grad-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-solid); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-600); }
.btn-ghost { background: var(--panel); color: var(--ink); font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 34%, transparent); } /* borde marcado: que se vea que es botón */
.btn-ghost:hover { background: var(--raised); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 55%, transparent); }
.btn-link { background: transparent; min-height: 0; padding: 4px 8px; font-size: 13px; font-weight: 600; }
.btn-link.edit { color: var(--primary-600); }
.btn-link.del { color: var(--red-ink); }
.btn-link.pay { color: var(--green-ink); }
.btn-link:hover { text-decoration: underline; }

/* ===== Cifras (stat cards) =====
   Son números: etiqueta, cifra grande con números tabulares y una línea de contexto.
   Sin íconos de colores: el color queda para lo que significa algo (balance en rojo, tareas esperando). */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
}
.stat .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat .stat-label { font-size: 13px; line-height: 16px; color: var(--ink-2); font-weight: 400; }
.stat .stat-icon { display: none; }
.stat .stat-value { font-size: 32px; line-height: 40px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .stat-value.neg { color: var(--red-ink); }
.stat .stat-sub { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.stat .stat-sub.up { color: var(--ink-soft); }
.stat .stat-sub.warn { color: var(--yellow-ink); font-weight: 500; }

/* ===== Acciones rápidas ===== */
.panel-quick { margin-top: 16px; }
.section-title { font-size: 15px; line-height: 20px; font-weight: 500; margin: 0 0 12px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-btn {
  border: 1px solid var(--line-strong); border-radius: 8px; min-height: 44px; padding: 8px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; background: var(--panel); text-align: left;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.quick-btn .ic { color: var(--ink-soft); }
.quick-btn:hover { background: var(--raised); }
.quick-btn:hover .ic { color: var(--primary-600); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-size: 12px; line-height: 16px; color: var(--ink-2); font-weight: 500;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: transparent;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 500; font-size: 12px; flex: none;
}
.cell-name { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--ink-soft); font-weight: 400; margin-top: 2px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.muted { color: var(--ink-soft); }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 0; font-size: 14px; }

/* ===== Badges ===== */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
}
.badge .ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.b-green { background: var(--green-bg); color: var(--green-ink); }
.b-yellow { background: var(--yellow-bg); color: var(--yellow-ink); }
.b-red { background: var(--red-bg); color: var(--red-ink); }
.b-blue { background: var(--blue-bg); color: var(--blue-ink); }
.b-gray { background: var(--gray-bg); color: var(--gray-ink); }
.b-lead { background: var(--primary-50); color: var(--primary-600); }

/* ===== Kanban (Tareas) ===== */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kcol { background: var(--gray-bg); border-radius: 12px; padding: 12px; }
.kcol.pend, .kcol.prog, .kcol.done { background: var(--raised); }
.kcol-head h3::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--ink-soft); }
.kcol.pend .kcol-head h3::before { background: var(--yellow-ink); }
.kcol.prog .kcol-head h3::before { background: var(--blue-ink); }
.kcol.done .kcol-head h3::before { background: var(--green-ink); }
.tcard .meta .ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kcol-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.kcol-count { font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--panel); border-radius: 999px; padding: 1px 8px; }
.tcard { background: var(--panel); border-radius: 8px; padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.tcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tcard h4 { margin: 0; font-size: 14px; font-weight: 600; }
.tcard .meta { font-size: 12px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.tcard .tcard-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tcard .tcard-actions button { font-size: 12px; }

/* ===== Áreas y Equipos ===== */
.area-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.area-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--panel);
  display: flex; flex-direction: column; gap: 12px;
}
.area-card-head { display: flex; align-items: center; gap: 12px; }
.area-del {
  margin-left: auto; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 1;
  flex: none; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.area-del:hover { background: var(--red-bg); color: var(--red-ink); border-color: var(--red-ink); }
.area-ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px;
  background: var(--primary-50); flex: none;
}
.area-card-head h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.2; }
.area-count { font-size: 12px; color: var(--ink-soft); }
.area-lider { border-bottom: 1px dashed var(--line); padding-bottom: 12px; }
.area-vols { display: flex; flex-direction: column; gap: 8px; min-height: 24px; }

.person {
  display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.person:hover { background: var(--gray-bg); }
.person.is-lead { background: var(--primary-50); }
.person.is-lead:hover { background: #e4e8ff; }
.person .cell-avatar { width: 32px; height: 32px; font-size: 12px; }
.person-info { min-width: 0; }
.person-info .cell-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.person-info .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.area-empty { font-size: 12px; color: var(--ink-soft); padding: 4px 8px; font-style: italic; }
.area-assign {
  width: 100%; border: 1px dashed var(--line-strong); background: var(--primary-50); color: var(--primary-600);
  border-radius: 8px; padding: 8px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 13px; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.area-assign:hover { background: #e4e8ff; }
.area-add {
  margin-top: auto; border: 0; background: var(--gray-bg); color: var(--ink); border-radius: 8px;
  padding: 8px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 13px; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.area-add:hover { background: #e2e8f0; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
/* El atributo HTML [hidden] debe ganarle al display:grid de arriba,
   si no, el overlay queda SIEMPRE encima. */
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--panel); border-radius: 16px; width: 100%; max-width: 460px; box-shadow: 0 16px 48px rgba(15,23,42,.2);
  max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.modal-head h3 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 500; }
.modal-close { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--ink-soft); flex: none; display: inline-grid; place-items: center; padding: 0;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.modal-close:hover { background: var(--raised); color: var(--ink); }
.modal-body { padding: 16px 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--ink); }
.field .input, .field .select { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 4px 24px 24px; }

/* ===== Inscripción pública (Primera Etapa) ===== */
.hero {
  background: var(--brand-solid) var(--grad-primary);
  color: #fff; border-radius: 16px; padding: 32px 28px;
  margin-bottom: 20px;
}
.hero h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }
.hero p { margin: 0; font-size: 14px; opacity: .92; max-width: 640px; line-height: 1.55; }
.hero .badge-step { display: inline-block; background: rgba(255,255,255,.18); border-radius: 999px;
  font-size: 12px; font-weight: 600; padding: 4px 12px; margin-bottom: 12px; }

.form-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); text-align: left;
  font-family: inherit; display: flex; flex-direction: column; gap: 8px; color: var(--ink);
}
.fcard:hover { border-color: var(--primary); }
.fcard .fc-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--blue-bg); color: var(--blue-ink); }
.fcard .fc-icon .ic { width: 24px; height: 24px; }
.fcard .fc-cta .ic { width: 16px; height: 16px; vertical-align: -3px; }
.fcard h3 { margin: 0; font-size: 16px; font-weight: 600; }
.fcard p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.fcard .fc-cta { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--primary-600); }

.portal-note {
  margin-top: 16px; font-size: 13px; color: var(--ink-2); background: var(--primary-50);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
}

/* Formulario público */
.pubform { max-width: 680px; margin: 0 auto; }
.backlink {
  background: transparent; border: 0; cursor: pointer; font-family: inherit; font-weight: 600;
  font-size: 14px; color: var(--primary-600); padding: 8px 0; min-height: 44px; margin-bottom: 4px; display: inline-flex; gap: 8px; align-items: center;
}
.backlink:hover { text-decoration: underline; }
.form-intro { margin: 0 0 16px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.form-section { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.form-section > legend, .form-section > .fs-title {
  font-size: 14px; font-weight: 600; color: var(--primary-600); padding: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.req-note { font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); user-select: none;
}
.radio-pill:hover { border-color: var(--primary-600); }
.radio-pill input { accent-color: var(--primary); }
.radio-pill.checked { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
textarea.input { width: 100%; resize: vertical; min-height: 80px; font-family: inherit; }
.form-submit { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Pantalla de gracias */
.gracias { max-width: 540px; margin: 32px auto; text-align: center; }
.gracias .check {
  width: 78px; height: 78px; border-radius: 50%; background: var(--green-bg); color: var(--green-ink);
  display: grid; place-items: center; font-size: 38px; margin: 0 auto 16px;
}
.gracias .check .ic { width: 40px; height: 40px; }
.gracias h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }
.gracias p { margin: 0 0 24px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

/* ===== Toast ===== */
.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 80; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(15,23,42,.18); animation: slidein .3s var(--ease); display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: #15803d; }
.toast.del { background: #b91c1c; }
.toast .ic { width: 16px; height: 16px; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Nota de responsable de un módulo / avisos ===== */
.owner-note {
  display: block; margin: 12px 0 4px; line-height: 20px;
  background: var(--primary-50); color: var(--ink); border: 1px solid #dfe5ff;
  border-radius: 8px; padding: 12px 16px; font-size: 13px; font-weight: 400;
}
.owner-note > .ic { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; color: var(--primary-600); }
.owner-note strong { font-weight: 500; }

/* ===== Suplente (botón asignar) ===== */
.area-assign.sup { color: var(--blue-ink); }

/* ===== Contaduría: submenú ===== */
.subtabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.subtab {
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); background: var(--panel); cursor: pointer;
  padding: 8px 16px; border-radius: 999px; font-family: inherit; font-size: 14px;
  font-weight: 600; color: var(--ink-2); transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.subtab:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 55%, transparent); }
.subtab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.subtab .ic { width: 16px; height: 16px; }
.subtab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Contaduría: montos con signo ===== */
.amount { font-weight: 600; white-space: nowrap; }
.amount-in { color: var(--green-ink); }
.amount-out { color: var(--red-ink); }

/* ===== Datos de cobro ===== */
.cobro-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.cobro-preview { display: flex; flex-direction: column; gap: 8px; }
.cobro-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.cobro-card {
  border: 1px dashed #c3cdfb; background: var(--primary-50); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.cobro-titular { font-size: 16px; font-weight: 600; color: var(--primary-600); }
.cobro-dato { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid #dfe5ff; padding-bottom: 8px; }
.cobro-dato span { color: var(--ink-soft); }
.cobro-dato strong { color: var(--ink); word-break: break-all; text-align: right; }
.cobro-qr { width: 170px; height: 170px; object-fit: contain; align-self: center; background: #fff; border-radius: 8px; padding: 8px; margin-top: 8px; }
.cobro-qr-empty { align-self: center; color: var(--ink-soft); font-size: 13px; padding: 24px 0; }

/* ===== Modo público (link de formulario, sin barra lateral) ===== */
.app.public { grid-template-columns: 1fr; }
.app.public .sidebar { display: none; }
.app.public .topbar-user { display: none; }
.app.public .main-area { max-width: 760px; margin: 0 auto; }

/* ===== Formularios: tarjetas para compartir (link + QR) ===== */
.form-share { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.share-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; text-align: center;
}
.share-head { display: flex; align-items: center; gap: 8px; justify-content: center; }
.share-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.share-head .fc-icon { width: 38px; height: 38px; font-size: 18px; border-radius: 8px; display: grid; place-items: center; }
.share-label { font-size: 12px; font-weight: 500; color: var(--ink-2); text-align: left; margin-top: 4px; }
.share-link { display: flex; gap: 8px; }
.share-link .input { flex: 1; font-size: 12px; min-width: 0; }
.share-open { justify-content: center; }
.share-qr { width: 170px; height: 170px; align-self: center; background: #fff; border-radius: 8px; padding: 8px; border: 1px solid var(--line); }

/* Contacto al pie de los formularios públicos */
.form-contact { margin: 16px 0 0; font-size: 13px; color: var(--ink-soft); }

/* ===== Elementos nuevos: conexión, respaldo, barra móvil ===== */
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.net-pill {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; line-height: 16px; font-weight: 500; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--panel); color: var(--ink-2); border: 1px solid var(--line);
}
.net-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #16a34a; flex: none; }
.net-pill.off { color: var(--yellow-ink); }
.net-pill.off::before { background: #ea580c; }
.net-pill.err { color: var(--red-ink); }
.net-pill.err::before { background: var(--red-ink); }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.net-dot.off { background: #f97316; }
.net-dot.err { background: #ef4444; }
/* Ajustes del pie: misma fila que el menú, más tenue */
.side-btn {
  border: 0; background: transparent; color: var(--n-ink-2); cursor: pointer; width: 100%;
  font-family: inherit; font-size: 13px; font-weight: 400; min-height: 32px; padding: 0 12px; border-radius: 8px; text-align: left;
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.side-btn .ic { color: var(--n-ink-3); width: 16px; height: 16px; margin: 0 1px; }
.side-btn:hover { background: var(--n-raised); color: var(--n-ink); }
.side-btn[hidden] { display: none; }
.backup-intro { font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
.backup-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft);
  background: var(--gray-bg); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.backup-action { width: 100%; justify-content: center; margin-top: 8px; padding: 12px 16px; }
.backup-help { font-size: 12px; line-height: 1.5; margin: 8px 2px 4px; }
.danger-outline { color: var(--red-ink); }

.mobile-bar { display: none; }
.nav-backdrop { display: none; }

/* Botones de iconos que no tenían foco visible */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== Responsive · tablet y celular ===== */
/* Notebooks con pantalla baja: el menú entra completo sin cortar opciones */
@media (max-height: 820px) and (min-width: 981px) {
  .sidebar { gap: 12px; }
  .tab { min-height: 32px; }
}
@media (max-width: 1180px) and (min-width: 981px) {
  .app { grid-template-columns: 240px 1fr; }
  .main-area { padding: 0 24px 64px; }
  .form-share { grid-template-columns: repeat(2, 1fr); }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .form-share { grid-template-columns: repeat(2, 1fr); }

  /* Barra superior fija con botón de menú */
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
    padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
    background: var(--night); color: #fff;
  }
  .menu-btn {
    width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer; flex: none;
    background: rgba(255,255,255,.1); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  }
  .menu-btn span { display: block; width: 20px; height: 2px; border-radius: 4px; background: #fff; transition: transform .2s var(--ease), opacity .2s var(--ease); }
  .nav-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-btn span:nth-child(2) { opacity: 0; }
  .nav-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mobile-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .mobile-title strong { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-title span { font-size: 12px; color: #c3c6dc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Menú lateral desplegable (drawer) */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; height: 100%; height: 100dvh;
    width: min(86vw, 304px); transform: translateX(-105%); transition: transform .3s var(--ease);
    padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom));
    box-shadow: 8px 0 30px rgba(0,0,0,.35); overscroll-behavior: contain;
  }
  .nav-open .sidebar { transform: none; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(15,23,42,.5); }
  .nav-backdrop[hidden] { display: none; }
  .tabs { overflow: visible; flex: none; }
  .tab { min-height: 44px; font-size: 15px; }
  .side-btn, .logout-btn { min-height: 44px; font-size: 14px; }
  .mode-switch button { height: 44px; }
  .evento-switch select { min-height: 44px; }
  /* B11: la barra móvil ya dice dónde estás */
  .topbar-title h2 { display: none; }
  .sidebar-foot { margin-top: 8px; }

  /* La barra móvil ya muestra el título: la cabecera queda más compacta */
  .topbar { position: static; min-height: 0; padding: 16px 0 12px; }
  .topbar-title h2 { font-size: 20px; line-height: 24px; }
  .topbar-user { display: none; }
  .net-pill { display: none; } /* en pantallas chicas lo indica el punto de la barra superior */
  .main-area { padding: 0 16px 48px; padding-bottom: max(48px, env(safe-area-inset-bottom)); }

  .quick, .area-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban, .form-cards, .cobro-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px 16px; }

  /* Herramientas de cada panel: el buscador ocupa todo el ancho */
  .panel-head { align-items: stretch; }
  .panel-tools { width: 100%; }
  .panel-tools .search { flex: 1 1 100%; min-width: 0; }
  .panel-tools .select { flex: 1 1 140px; }
  .panel-tools .btn { flex: 1 1 auto; justify-content: center; }

  /* Las notificaciones abajo, a lo ancho */
  /* Arriba, para no tapar los botones Guardar/Crear de los formularios */
  .toast-host { left: 12px; right: 12px; top: max(10px, env(safe-area-inset-top)); bottom: auto; align-items: stretch; }
  .toast { text-align: center; justify-content: center; }

  /* Modo público: no hay menú */
  .app.public .mobile-bar { display: none; }
  .app.public .main-area { padding: 0 12px 40px; }
}

/* Celular: tablas como tarjetas apiladas */
@media (max-width: 700px) {
  table.stackable, table.stackable tbody, table.stackable tr, table.stackable td { display: block; width: 100%; }
  table.stackable thead { display: none; }
  table.stackable tbody tr {
    border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: var(--panel);
  }
  table.stackable tbody tr:hover { background: var(--panel); }
  table.stackable tbody td {
    border: 0; padding: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    text-align: right; min-height: 0;
  }
  table.stackable tbody td + td { border-top: 1px dashed var(--line); }
  table.stackable tbody td[data-label] { flex-wrap: wrap; }
  table.stackable tbody td[data-label] > .cell-sub { flex-basis: 100%; text-align: right; }
  table.stackable tbody td[data-label]::before {
    content: attr(data-label); font-size: 12px; font-weight: 500; color: var(--ink-2);
    text-align: left; flex: none; max-width: 45%;
  }
  table.stackable tbody td:first-child { justify-content: flex-start; text-align: left; }
  table.stackable tbody td:first-child::before { display: none; }
  table.stackable tbody td.full, table.stackable tbody td.no-label { justify-content: center; }
  table.stackable tbody td .row-actions, table.stackable tbody td.row-actions { justify-content: flex-end; flex-wrap: wrap; }
  table.stackable .stock-group-row { border: 0; background: transparent; padding: 0; margin: 12px 0 8px; }
  table.stackable .stock-group-row td { background: transparent; padding: 0 2px; }
  .table-wrap { overflow: visible; }
  .stock-qty { justify-content: flex-end; }
}

@media (max-width: 560px) {
  .quick { grid-template-columns: 1fr; gap: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px 16px; }
  .stat .stat-value { font-size: 24px; line-height: 32px; word-break: break-word; }
  .area-grid, .form-share { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .hero { padding: 24px 16px; }
  .hero h2 { font-size: 20px; }

  /* Formularios en hoja inferior, cómodos con una mano */
  .modal-overlay { place-items: end stretch; padding: 0; }
  .modal {
    max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-foot {
    position: sticky; bottom: 0; background: var(--panel); padding: 12px 16px 16px; border-top: 1px solid var(--line);
  }
  .modal-foot .btn { flex: 1; justify-content: center; min-height: 44px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .subtabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); padding-right: 32px; }
  .subtab { flex: none; }
}

/* Pantallas táctiles: botones y campos más grandes; 16px evita el zoom de iOS */
@media (pointer: coarse) {
  .input, .select, textarea.input { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-link { min-height: 44px; padding: 8px 12px; }
  .btn-icono { min-width: 44px; }
  .qty-btn { width: 44px; height: 44px; font-size: 18px; }
  .modal-close { width: 44px; height: 44px; }
  .subtab, .side-btn, .logout-btn, .tab, .mode-switch button { min-height: 44px; }
  .login-otros a { min-height: 44px; }
  .radio-pill { min-height: 44px; }
}

/* ===== Brazaletes ===== */
.braz-stats { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.braz-stat {
  flex: 1 1 120px; background: var(--raised); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px;
}
.braz-stat .bs-num { font-size: 24px; font-weight: 600; color: var(--ink); }
.braz-stat .bs-lbl { font-size: 12px; color: var(--ink-2); }

.braz-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
.braz-leg-item { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.braz-leg-item input[type=color] {
  width: 26px; height: 26px; border: none; background: none; padding: 0; cursor: pointer;
  position: absolute; opacity: 0; /* el swatch hace de visual; el input queda invisible encima */
}
.braz-leg-item { position: relative; }
.braz-swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); flex: 0 0 auto; }
.braz-leg-name { color: var(--ink); }

.braz-group-head { align-items: center; }
.braz-group-head h2 { display: flex; align-items: center; gap: 8px; }
.braz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.braz-card {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel);
  display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.braz-card.is-void { opacity: .55; }
.braz-band { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.braz-band .braz-code { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.braz-band .braz-grp { font-size: 12px; opacity: .9; }
.braz-qr { display: flex; justify-content: center; padding: 12px; }
.braz-qr img { width: 130px; height: 130px; }
.braz-persona { text-align: center; font-size: 14px; font-weight: 600; padding: 0 8px 4px; min-height: 20px; }
.braz-estado { text-align: center; padding-bottom: 8px; }
.braz-actions { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 8px 4px; gap: 4px; }
.braz-actions .danger { color: var(--accent); }

@media (max-width: 1100px) { .braz-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .braz-grid { grid-template-columns: repeat(2, 1fr); } .braz-legend { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .braz-grid { grid-template-columns: 1fr; } .braz-legend { grid-template-columns: 1fr; } }

/* ===== Stock ===== */
.stock-qty { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer;
  line-height: 1; display: inline-grid; place-items: center; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.qty-btn:hover { background: var(--primary-50); border-color: var(--primary-600); color: var(--primary-600); }
.qty-num { min-width: 30px; text-align: center; font-weight: 600; font-size: 15px; color: var(--ink); }
.qty-num.zero { color: var(--ink-soft); }
.stock-group-row td {
  background: var(--raised); font-weight: 500; font-size: 13px; color: var(--ink-2);
  padding-top: 8px; padding-bottom: 8px;
}


/* ===== Entradas ===== */
.venta-link-grid { display: grid; grid-template-columns: 1fr 190px; gap: 16px; align-items: start; }
.venta-acciones, .venta-compartir { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.venta-compartir { justify-content: center; margin-top: 16px; }
.cfg-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto; gap: 8px; align-items: end;
  background: var(--gray-bg); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px;
}
.cfg-row .field { margin: 0; }
.cfg-check, .cfg-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; padding-bottom: 8px; }
.cfg-switch { padding: 8px 12px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); }
.cfg-check input, .cfg-switch input { width: 18px; height: 18px; accent-color: var(--primary); }

.tickets { display: grid; gap: 12px; }
/* Troquel: perforación a los dos lados, como una entrada de papel. Sólo en entradas y credenciales. */
.ticket, .cred-card {
  --troquel: radial-gradient(circle 4px at 0 50%, #0000 97%, #000) 0 0 / 51% 16px repeat-y,
             radial-gradient(circle 4px at 100% 50%, #0000 97%, #000) 100% 0 / 51% 16px repeat-y;
  -webkit-mask: var(--troquel); mask: var(--troquel);
}
.ticket { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 20px; background: var(--panel); }
.ticket.is-void { opacity: .5; }
.ticket-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px;
  border-bottom: 1px dashed var(--line-strong); padding-bottom: 8px; margin-bottom: 8px; color: var(--ink-soft); }
.ticket-head strong { color: var(--ink); }
.ticket-body { display: flex; gap: 12px; align-items: center; }
.ticket-body img { width: 132px; height: 132px; flex: none; box-sizing: content-box; }
/* D5: todo QR va sobre blanco con margen (zona de silencio), también en oscuro: si no, no escanea */
.ticket-body img, .cred-body img, .braz-qr img, .ga-qr-img img, img[alt^="QR"] { background: #fff; padding: 8px; border-radius: 8px; }
.ticket-info { display: flex; flex-direction: column; gap: 4px; font-size: 14px; min-width: 0; }
.ticket-tipo { font-size: 16px; font-weight: 600; }
.ticket-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; font-weight: 600; letter-spacing: .5px; }

.puerta-contador { font-size: 15px; margin: -4px 0 12px; }
.puerta-resultado {
  border-radius: 16px; padding: 24px 16px; text-align: center; background: var(--gray-bg); margin-bottom: 12px; min-height: 96px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.puerta-resultado .pr-titulo { font-size: 28px; font-weight: 600; }
.puerta-resultado .pr-detalle { font-size: 15px; }
.puerta-resultado.r-verde { background: #15803d; color: #fff; }
.puerta-resultado.r-rojo { background: #b91c1c; color: #fff; }
.puerta-resultado .pr-titulo .ic { width: 32px; height: 32px; vertical-align: -5px; margin-right: 8px; }
.puerta-resultado.r-naranja { background: #f59e0b; color: #1a1a2e; }
.pr-acciones { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.puerta-form { display: flex; gap: 8px; }
.puerta-form .input { flex: 1; min-width: 0; font-size: 16px; text-transform: uppercase; }
.puerta-form .input::placeholder { text-transform: none; }
.puerta-camara { width: 100%; justify-content: center; margin-top: 8px; padding: 12px; font-size: 15px; }
.puerta-video { margin-top: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.puerta-video video { width: 100%; max-height: 60vh; display: block; object-fit: cover; }

.venta-hero h2 { font-size: 28px; }
.venta-hero a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.opciones { display: grid; gap: 8px; }
.opcion {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px;
  cursor: pointer; background: var(--panel); transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.opcion:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 2px var(--primary-50); }
.opcion input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.opcion > span:nth-of-type(1) { flex: 1; }
.opcion-precio { font-weight: 600; font-size: 15px; white-space: nowrap; }
.opcion.agotada { opacity: .55; cursor: not-allowed; }
.venta-total { text-align: right; font-size: 18px; margin: 8px 0 4px; }
.btn-grande { padding: 12px 24px; font-size: 16px; }

@media (max-width: 700px) {
  .venta-link-grid { grid-template-columns: 1fr; }
  .venta-link-grid .share-qr { justify-self: center; }
  .cfg-row { grid-template-columns: 1fr 1fr; }
  .ticket-body img { width: 110px; height: 110px; }
  .form-submit .btn-grande { width: 100%; justify-content: center; }
}

/* ===== Impresión: solo las manillas, sin menús ni botones ===== */
@media print {
  .mobile-bar, .nav-backdrop, .net-pill,
  .sidebar, .topbar, .panel-tools, .braz-stats, .braz-legend-panel,
  .braz-actions, #toastHost, .modal-overlay, .owner-note { display: none !important; }
  body, .app, .main-area, #view { background: #fff !important; margin: 0; padding: 0; }
  .panel { box-shadow: none; border: none; padding: 0; margin: 0 0 8px; }
  .braz-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .braz-card { break-inside: avoid; box-shadow: none; border: 1px solid #999; }
}
/* ===== Seguridad ===== */
.aviso-seguridad { margin-bottom: 12px; background: #fff7ed; border-color: #fed7aa; }
.aviso-seguridad .btn-link { padding: 0 2px; font-weight: 600; }

/* ===== Entradas: venta rápida ===== */
.rapida-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.rapida-btn {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  border: 2px solid var(--line); border-radius: 16px; background: var(--panel); padding: 16px; cursor: pointer;
  font-family: inherit; color: var(--ink); min-height: 104px; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); touch-action: manipulation;
}
.rapida-btn:hover:not([disabled]) { border-color: var(--primary-600); background: var(--primary-50); }
.rapida-btn:active:not([disabled]) { transform: scale(.98); }
.rapida-btn[disabled] { opacity: .5; cursor: not-allowed; }
.rb-nombre { font-size: 16px; font-weight: 600; }
.rb-precio { font-size: 20px; font-weight: 600; color: var(--primary-600); }
.rb-quedan { font-size: 12px; color: var(--ink-soft); }
.rb-cant {
  position: absolute; top: 10px; right: 10px; min-width: 34px; height: 34px; border-radius: 999px; padding: 0 8px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 16px; display: grid; place-items: center;
}
.rapida-pie { border-top: 1px solid var(--line); padding-top: 12px; }
.rapida-total { font-size: 20px; margin-bottom: 8px; }
.rapida-acciones { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.rapida-ultima { margin-top: 12px; }

/* ===== Entradas: tablero en vivo ===== */
.vivo-grande { font-size: 15px; margin: 4px 0 8px; }
.vivo-grande strong { font-size: 44px; font-weight: 600; color: var(--primary-600); line-height: 1; }
.vivo-barra { height: 14px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; }
.vivo-barra span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
/* Aforo en vivo (entradas.js): verde normal, ámbar al 90 %, rojo con el aforo completo */
.aforo { border-radius: 12px; padding: 8px 12px; margin: 0 0 12px; background: var(--gray-bg); display: grid; gap: 8px; }
.aforo-alerta { background: var(--yellow-bg); color: var(--yellow-ink); }
.aforo-alerta .vivo-barra span { background: var(--yellow-ink); }
.aforo-lleno { background: var(--red-bg); color: var(--red-ink); }
.aforo-lleno .vivo-barra span { background: var(--red-ink); }
.aforo-msg { font-weight: 600; }
.puerta-salida { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.vivo-datos, .vivo-tipos, .informe-datos { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
.vivo-datos strong, .vivo-tipos strong, .informe-datos strong { color: var(--ink); }
.vivo-tipos { font-size: 13px; }

/* ===== Entradas: comprador ===== */
.comprador { margin: 4px 0 12px; }
.recuperar { margin-top: 16px; }

/* ===== Turnos ===== */
.turnos-lista { display: grid; gap: 8px; }
.turno { border: 1px solid var(--line); border-left: 6px solid var(--primary); border-radius: 12px; padding: 12px 12px; background: var(--panel); }
.turno-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.turno-personas { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 999px; background: var(--gray-bg); font-size: 13px; font-weight: 600; max-width: 100%; }
.chip-alerta { background: #fef3c7; color: #92400e; }
.chip-wa { text-decoration: none; }
.sin-turno { margin-top: 12px; font-size: 14px; }
.sin-turno summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.personas-lista { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px; }
.persona-check { display: flex; align-items: center; gap: 8px; padding: 8px 2px; font-size: 14px; cursor: pointer; }
.persona-check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.persona-grupo { font-size: 12px; font-weight: 500; color: var(--ink-2); margin: 8px 0 4px; }

/* ===== Credenciales ===== */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cred-card { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
.cred-band { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 12px; font-weight: 600; letter-spacing: .4px; }
.cred-body { display: flex; gap: 12px; align-items: center; padding: 12px; }
.cred-body img { width: 104px; height: 104px; flex: none; }
.cred-info { min-width: 0; }
.cred-nombre { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.cred-card .btn-link { align-self: center; margin-bottom: 8px; }
/* Certificados de participación (Credenciales → 🎓): uno por hoja A4 apaisada al imprimir */
.cert-lista { display: grid; gap: 16px; }
.cert-hoja { page: certificado; background: var(--panel); color: var(--ink); border: 3px double var(--primary); border-radius: var(--radius);
  padding: 36px 28px 20px; text-align: center; box-shadow: var(--shadow); }
.cert-titulo { font-size: clamp(22px, 3.6vw, 34px); font-weight: 600; color: var(--primary-600); margin: 0 0 16px; }
.cert-linea { color: var(--ink-soft); margin: 4px 0; font-size: 16px; }
.cert-persona { font-size: clamp(24px, 4vw, 38px); font-weight: 600; margin: 8px auto 8px; padding: 0 16px 8px; border-bottom: 1px solid var(--line);
  display: inline-block; overflow-wrap: anywhere; }
.cert-evento { font-size: clamp(19px, 3vw, 26px); font-weight: 600; margin: 8px 0; }
.cert-firmas { display: flex; justify-content: space-around; gap: 24px; margin: 40px 0 8px; flex-wrap: wrap; }
.cert-firmas div { display: grid; gap: 8px; min-width: 180px; font-size: 13px; color: var(--ink-soft); }
.cert-firmas span { display: block; border-top: 1px solid var(--ink-soft); }
.cert-fecha { font-size: 12px; margin: 8px 0 0; }
@page certificado { size: A4 landscape; margin: 12mm; }
@media print {
  .cert-lista { display: block; }
  .cert-hoja { box-shadow: none; break-after: page; break-inside: avoid; margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert-hoja:last-child { break-after: auto; }
  body.imprimiendo-uno .cert-hoja:not(.imprimir-solo) { display: none !important; }
}

/* ===== Plano de stands ===== */
.plano-num { width: 70px; }
.plano-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.plano { display: grid; gap: 8px; min-width: min-content; }
.celda {
  position: relative; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  min-height: 64px; border-radius: 8px; border: 1px dashed var(--line-strong); background: var(--panel); padding: 8px 8px; cursor: pointer;
  font-family: inherit; color: var(--ink); overflow: hidden;
}
.celda-cod { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.celda-nom { font-size: 13px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.celda-stand .celda-nom { color: var(--ink-soft); font-weight: 500; }
.celda.ocupada { border: 1px solid var(--green-ink); background: var(--green-bg); }
.celda.ocupada .celda-nom { color: var(--green-ink); font-weight: 600; }
.celda-pasillo { background: var(--gray-bg); border-style: solid; border-color: transparent; }
.celda-escenario { background: var(--primary-50); border: 1px solid var(--line-strong); }
.celda-bloqueado { background: repeating-linear-gradient(45deg, var(--raised), var(--raised) 6px, var(--line) 6px, var(--line) 12px); border-style: solid; border-color: transparent; }
.celda-luz { position: absolute; top: 4px; right: 6px; font-size: 13px; }

/* ===== Ingreso: ver contraseña, Mayúsculas, fuerza y recuperación (seguridad.js) ===== */
.pass-wrap { position: relative; display: block; }
.pass-wrap .input { padding-right: 48px; width: 100%; }
.pass-ojo { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 18px; opacity: .55; }
.pass-ojo:hover, .pass-ojo.activo { opacity: 1; background: var(--primary-50); }
.pass-mayus { margin-top: 8px; font-size: 13px; color: var(--yellow-ink); background: var(--yellow-bg); padding: 4px 8px; border-radius: 8px; }
.pass-fuerza { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 18px; }
.pf-barra { flex: 1; height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.pf-barra span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.pass-fuerza[data-nivel="1"] .pf-barra span { width: 25%; background: var(--accent); }
.pass-fuerza[data-nivel="2"] .pf-barra span { width: 50%; background: #f59e0b; }
.pass-fuerza[data-nivel="3"] .pf-barra span { width: 75%; background: #22c55e; }
.pass-fuerza[data-nivel="4"] .pf-barra span { width: 100%; background: var(--green-ink); }
.pf-texto { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.login-olvido { display: block; margin: 8px auto 0; }
.login-ok { background: var(--green-bg); color: var(--green-ink); padding: 8px 12px; border-radius: 8px; font-size: 14px; line-height: 1.45; }
.login-nota { font-size: 13px; text-align: center; margin: 4px 0 0; }

/* ===== ⚙️ Mi evento (organizacion.js) ===== */
.me-etapas { display: grid; gap: 8px; margin-bottom: 12px; }
.me-etapa { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.me-fila { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.me-fila .input { flex: 1 1 160px; min-width: 0; }
.me-fila .me-mes { flex: 0 1 170px; }
.me-icono { width: 64px; flex: none; }
.me-botones { display: flex; gap: 4px; flex: none; }
.me-botones .btn { padding: 8px 8px; }
.me-ocultas { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 8px; font-size: 13px; }

/* ===== Gastronomía (gastronomia.js) ===== */
.ga-venta { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ga-pedido { position: sticky; top: 12px; }
.ga-cat { font-size: 15px; margin: 12px 0 0; color: var(--ink-soft); }
.ga-btn { min-height: 104px; }
.ga-punto { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ga-lineas { list-style: none; margin: 0 0 12px; padding: 0; }
.ga-lineas li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ga-l-cant { font-weight: 600; min-width: 22px; text-align: center; }
.ga-l-nom { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ga-l-sub { font-weight: 600; }
.ga-nada { margin: 8px 0 12px; }
.ga-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; margin: 4px 0 12px; }
.ga-total strong { font-size: 28px; color: var(--primary-600); }
.ga-medios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ga-medio { padding: 12px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; min-height: 52px; }
.ga-medio.activo { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.ga-billetes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ga-billetes .btn { padding: 8px 8px; }
.ga-vuelto { font-size: 20px; margin: 8px 0; color: var(--green-ink); min-height: 4px; }
.ga-vuelto.falta { color: var(--accent-600); }
.ga-cobrar { width: 100%; justify-content: center; font-size: 18px; padding: 16px; margin-top: 8px; }
.ga-ultima { margin-top: 12px; }
.ga-vacio { text-align: center; padding: 32px 16px; }
.ga-pasos { text-align: left; max-width: 460px; margin: 16px auto; padding: 0; list-style: none; }
.ga-pasos li { display: block; position: relative; padding-left: 40px; min-height: 28px; margin: 8px 0; line-height: 1.5; }
.ga-pasos li > span:first-child { position: absolute; left: 0; top: -1px; }
.ga-pasos li span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.ga-tabla-carta .input { max-width: 120px; }
.ga-comp { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; max-height: 50vh; overflow: auto; }
.ga-comp-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ga-comp-fila .input { width: 80px; }
.ga-detalle summary { cursor: pointer; margin: 8px 0; font-weight: 600; }
/* Cobro con QR de Mercado Pago y cashless */
.ga-medio:disabled { opacity: .5; cursor: not-allowed; }
.ga-medio .ic { width: 16px; height: 16px; }
.ga-medio-nota { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; line-height: 1.5; }
.ga-medio-nota .ic { width: 16px; height: 16px; margin-top: 2px; }
.ga-opcion { display: flex; align-items: flex-start; font-weight: 400; line-height: 1.5; padding-bottom: 12px; }
.ga-opcion input { flex: none; margin-top: 2px; }
.ga-qr { text-align: center; }
.ga-qr-monto { font-size: 32px; font-weight: 600; color: var(--primary-600); margin: 0 0 8px; }
.ga-qr-img { display: flex; justify-content: center; min-height: 120px; align-items: center; }
.ga-qr-img img { width: min(70vw, 280px); height: auto; image-rendering: pixelated; }
.ga-qr-estado { font-size: 15px; margin: 12px 0 0; }
.ga-qr-estado.mal { color: var(--red-ink); }
.ga-aviso { border-color: var(--yellow-ink); background: var(--yellow-bg); color: var(--yellow-ink); margin: 0 0 12px; }
.ga-aviso > .ic { color: var(--yellow-ink); }
.ga-cam video { width: 100%; max-height: 45vh; border-radius: 12px; background: var(--ink); margin-bottom: 12px; }
.ga-cod { margin-top: 12px; }
.ga-cod-fila { display: flex; gap: 8px; }
.ga-cod-fila .input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 1px; }
.ga-cash-ficha { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; margin: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ga-cash-saldo { text-align: right; }
.ga-cash-saldo span { display: block; font-size: 12px; color: var(--ink-soft); }
.ga-cash-saldo strong { font-size: 28px; font-weight: 600; color: var(--green-ink); }
.ga-cash-saldo.mal strong, .ga-neg { color: var(--red-ink); }
.ga-cash-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.ga-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ga-tarjeta { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }
@media (max-width: 980px) {
  .ga-venta { grid-template-columns: 1fr; }
  .ga-pedido { position: static; }
}

/* ===== Informes ===== */
.informe-cab h2 { margin: 0 0 4px; }
.informe-sec h4 { margin: 12px 0 8px; font-size: 14px; }
.informe-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.informe tr.fila-total td { border-top: 2px solid var(--line); font-weight: 600; }

@media (max-width: 700px) {
  .informe-dos { grid-template-columns: 1fr; }
  .rapida-tipos { grid-template-columns: 1fr 1fr; }
  .rapida-acciones .btn { flex: 1; justify-content: center; }
  .cred-grid { grid-template-columns: 1fr; }
}

@media print {
  .no-print, .subtabs, .recuperar { display: none !important; }
  .cred-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cred-card { break-inside: avoid; box-shadow: none; border: 1px solid #999; }
  .cred-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .plano-scroll { overflow: visible; }
  .celda { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .informe .panel { border: 1px solid #ddd; padding: 12px; break-inside: avoid; }
}

/* Ventana de usuarios: más ancha (la tabla tiene acciones) */
.modal:has(.tabla-usuarios) { max-width: 760px; }
.tabla-usuarios .row-actions { flex-wrap: wrap; }
.modal:has(.tabla-permisos) { max-width: 760px; }
.tabla-permisos .perm-celda { text-align: center; }
.tabla-permisos input[type=checkbox] { width: 20px; height: 20px; cursor: pointer; }
.cred-info .muted { font-size: 13px; }

/* ===== ⭐ Tu plan (planes.js) ===== */
.tab.bloqueada { opacity: .62; }
.tab.bloqueada::after { content: ''; margin-left: auto; width: 14px; height: 14px; flex: none; background: currentColor; opacity: .8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat; }
.plan-bloqueo { max-width: 560px; margin: 40px auto; text-align: center; background: var(--panel); border: 1px solid var(--line, #e8eaf0);
  border-radius: 16px; padding: 32px 24px; }
.plan-bloqueo h3 { margin: 0 0 8px; }
.plan-bloqueo-acciones { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.plan-aviso { cursor: pointer; }
.plan-actual { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
  border-radius: 12px; background: var(--primary-50); margin-bottom: 12px; }
.plan-actual-nombre { font-size: 20px; font-weight: 600; color: var(--primary-600); }
.plan-uso { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.plan-uso > div { border: 1px solid var(--line, #e8eaf0); border-radius: 8px; padding: 8px 12px; display: grid; gap: 2px; }
.plan-uso .muted { font-size: 12px; }
.plan-sub { margin: 16px 0 8px; font-size: 14px; }
.plan-ops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.plan-op { border: 1px solid var(--line, #e8eaf0); border-radius: 12px; padding: 12px 12px; display: grid; gap: 4px; align-content: start; }
.plan-op.es-actual { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.plan-op .muted { font-size: 13px; }
.plan-op-incluye { margin: 2px 0 4px; padding: 0; list-style: none; font-size: 13px; display: grid; gap: 2px; }
.plan-op-incluye li { display: flex; gap: 8px; align-items: flex-start; }
.plan-op-incluye li .ic { width: 14px; height: 14px; margin-top: 2px; color: var(--primary-600); }
.plan-op-precio { font-weight: 600; font-size: 14px; }
.plan-op .btn, .plan-op .badge { justify-self: start; }
.plan-lic textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.plan-lic-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 560px) {
  .plan-uso, .plan-ops { grid-template-columns: 1fr; }
}

/* ===== Invitación con confirmación de asistencia (entradas.js) ===== */
.invitacion .invitacion-head { text-align: center; margin-bottom: 12px; }
.invitacion .invitacion-ic .ic { width: 40px; height: 40px; }
.invitacion h2 { margin: 8px 0 4px; }
.invitacion-rsvp { text-align: center; background: var(--primary-50); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.invitacion-rsvp p { margin: 0 0 8px; }
.invitacion-botones { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.invitacion-resp { font-weight: 600; color: var(--primary-600); }

/* ===== Todos mis eventos (reportes.js · plan Productora) ===== */
.ev-grilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ev-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.ev-dato { background: var(--raised); border-radius: 8px; padding: 8px 12px; display: grid; gap: 2px; }
.ev-dato strong { font-size: 18px; }
.ev-dato span { font-size: 12px; color: var(--ink-soft); }
.ev-card.ev-activo { box-shadow: 0 0 0 2px var(--primary) inset; }

/* ===== Login: atajos para quien no es del equipo ===== */
.login-otros { display: flex; flex-direction: column; gap: 0; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.login-otros a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; font-size: 13px; font-weight: 500; color: var(--primary-600); text-decoration: none; }
.login-otros a .ic { width: 16px; height: 16px; }
.login-otros a:hover { text-decoration: underline; }
.login-otros[hidden] { display: none; }

/* Aviso: aparato de un rol (Puerta, Barra, Contaduría) conectado con la cuenta "equipo" de la nube */
.aviso-aparato { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9000; display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap; padding: 12px 12px; border-radius: 12px; background: #fff7ed; color: #7c2d12; border: 1px solid #fed7aa;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); font-size: 14px; line-height: 1.4; }
.aviso-aparato span { flex: 1 1 260px; }

/* Íconos de línea (iconos.svg): <svg class="ic"><use href="iconos.svg#ticket"/></svg> */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }

/* Ajustes del pulido del panel (unslop): aviso pegado arriba, foco de campos sin doble anillo, cifra sola a lo ancho en celular */
.view > .owner-note:first-child { margin-top: 0; }
.view > .owner-note + .stats { margin-top: 12px; }
.input:focus-visible, .select:focus-visible { outline: none; }
@media (max-width: 560px) {
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ===== Plano de mesas (mesas.js) · sólo variables existentes ===== */
.invitacion-mesa { margin: 8px 0 0; font-size: 16px; color: var(--primary-600); }
.mesas-vistas { display: inline-flex; gap: 4px; }
.mesas-agregar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.mesas-agregar label { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.mesas-num { width: 76px; }
.mesas-forma { width: auto; }
.mesas-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mesas-sin { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.mesas-filtros { display: grid; gap: 8px; margin-bottom: 8px; }
.mesas-filtros .search { width: 100%; }
.mesas-invitados { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.mesa-inv { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; user-select: none; }
.mesa-inv:hover { border-color: var(--primary); }
.mesa-inv.elegido { background: var(--primary-50); border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.mesas-eligiendo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; margin-bottom: 12px;
  background: var(--primary-50); color: var(--ink); position: sticky; top: 0; z-index: 2; }
.mesas-plano-scroll { overflow: auto; -webkit-overflow-scrolling: touch; max-height: 75vh; border-radius: 12px; background: var(--gray-bg); }
.mesas-plano { position: relative; min-width: 100%; }
.mesa { position: absolute; width: 116px; height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; padding: 8px;
  box-shadow: var(--shadow); touch-action: manipulation; user-select: none; }
.mesa-redonda { border-radius: 50%; }
.mesa-rectangular { height: 84px; margin-top: 16px; border-radius: 12px; }
.mesa:hover, .mesa-destino { border-color: var(--primary); }
.mesa-moviendo { z-index: 5; opacity: .85; cursor: grabbing; }
.mesa-nombre { font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mesa-ocup { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.mesa-aviso { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.mesa-llena { border-color: var(--yellow-ink); background: var(--yellow-bg); }
.mesa-llena .mesa-aviso { color: var(--yellow-ink); }
.mesa-excedida { border-color: var(--red-ink); background: var(--red-bg); }
.mesa-excedida .mesa-aviso { color: var(--red-ink); }
.mesas-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mesa-card { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--panel); cursor: pointer; }
.mesa-card.mesa-destino { border-color: var(--primary); }
.mesa-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mesa-card-gente { display: flex; flex-wrap: wrap; gap: 8px; }
.mesa-card-gente .btn-link { padding: 0 2px; }
.mesa-detalle { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mesa-detalle li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .mesas-grid { grid-template-columns: minmax(0, 1fr); }
  .mesas-sin { position: static; max-height: none; }
  .mesas-invitados { max-height: 40vh; }
}

/* ===== Trámites y permisos (tramites.js) ===== */
.tabla-tramites tr.tr-vencido td:first-child { box-shadow: inset 3px 0 0 var(--red-ink); }
.tabla-tramites tr.tr-pronto td:first-child { box-shadow: inset 3px 0 0 var(--yellow-ink); }
.tabla-tramites tr.tr-vencido td { background: var(--red-bg); }
.tr-dias { font-size: 12px; margin-top: 4px; }
.tr-dias-vencido { color: var(--red-ink); font-weight: 500; }
.tr-dias-pronto { color: var(--yellow-ink); font-weight: 500; }
.tr-notas { font-size: 12px; margin-top: 4px; white-space: normal; }
.tr-acciones { white-space: nowrap; }
.tr-sugeridos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tr-sugeridos label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.tr-sugeridos input { margin-top: 4px; }
.tr-dash {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 16px; padding: 12px 16px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer;
}
.tr-dash > span { flex: 1; }
.tr-dash strong { font-weight: 600; }
.tr-dash .ic { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.tr-dash:hover { border-color: var(--line-strong); }
.tr-dash-vencido { border-color: var(--red-bg); }
.tr-dash-vencido > .ic:first-child { color: var(--red-ink); }
.tr-dash-pronto > .ic:first-child { color: var(--yellow-ink); }

/* ===== Sponsors y auspiciantes (sponsors.js) ===== */
.tabla-sponsors td { vertical-align: top; }
.sp-notas { font-size: 12px; margin-top: 4px; white-space: normal; }
.sp-cuenta { font-size: 12px; margin-bottom: 4px; }
.sp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sp-checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; white-space: normal; }
.sp-checks input { margin-top: 2px; flex: none; }
.sp-hecho { color: var(--ink-soft); text-decoration: line-through; }
.sp-acciones { white-space: nowrap; }
.sp-cp-lista { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.sp-cp-fila { display: flex; gap: 8px; align-items: center; }
.sp-cp-fila .sp-cp-texto { flex: 1; min-width: 0; }
.sp-cp-fila .sp-cp-hecho { flex: none; width: 18px; height: 18px; }

/* Ajustes del modo oscuro que pisan reglas de arriba (por eso van al final) */
@media (prefers-color-scheme: dark) {
  .aviso-seguridad { background: #3a2c12; border-color: #5c4519; color: #f9e9cb; }
  .aviso-aparato { background: #3a2c12 !important; color: #f9e9cb !important; border-color: #5c4519 !important; }
  .chip-alerta { background: #3a2c12; color: #f2b95b; }
  input, select, textarea { color-scheme: dark; }
}

/* Invitaciones por WhatsApp: lista para mandar a mano a los que no respondieron (entradas.js) */
.lista-invitar { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.lista-invitar li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; padding: 8px 0; border-bottom: 1px solid var(--line, #e2e8f0); }
.lista-invitar li .btn { margin-left: auto; }
#resumenInvitados #invitarSinRespuesta { margin-left: 8px; }

/* ===== Auditoría 13/11: piezas comunes para reemplazar emojis ===== */
/* Estado vacío o tarjeta con ícono grande: <div class="vacio-ic">${ic('utensils')}</div> */
.vacio-ic { width: 56px; height: 56px; border-radius: 12px; background: var(--raised); color: var(--ink-soft); display: grid; place-items: center; margin: 0 auto 12px; }
.vacio-ic .ic { width: 28px; height: 28px; }
.ic-lg { width: 32px; height: 32px; }
/* Botón sólo con ícono (borrar, editar, subir/bajar): siempre con aria-label */
.btn-icono { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 4px; }
.btn-icono .ic { width: 16px; height: 16px; }

/* ===== Auditoría 13/11: links, modo oscuro y tamaños táctiles ===== */
/* D6: links con el azul de la marca (sin el violeta de "visitado"). :where() no suma especificidad: cualquier clase gana. */
:where(a) { color: var(--primary-600); text-underline-offset: 2px; }
:where(a:visited) { color: var(--primary-600); }
/* Toast siempre oscuro (en oscuro --ink es claro y el texto blanco no se leía) */
.toast { background: #0f172a; }
@media (prefers-color-scheme: dark) { .toast { background: #26283a; box-shadow: 0 8px 24px rgba(0,0,0,.5); } }
/* B12: el estado de la conexión es del equipo, no del público */
.app.public .net-pill, .app.public #netPill { display: none !important; }
/* G12: sin doble espacio antes del botón en línea del aviso de seguridad */
#avisoUsuarios { margin: 0 2px; }
/* F1: las fechas no se parten en dos líneas */
td.muted, .cell-sub { font-variant-numeric: tabular-nums; }
.fecha, td.fecha { white-space: nowrap; }
/* B6: sin cifras huérfanas: 3 columnas en pc cuando hay 6 tarjetas, y en el celular la última impar ocupa el ancho */
@media (min-width: 981px) { .stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* M1: en el celular todo lo que se toca mide 44px o más */
@media (max-width: 700px) {
  .btn, .subtab, .side-btn, .logout-btn, .mode-switch button { min-height: 44px; }
  .btn-link { min-height: 44px; padding: 8px 12px; }
  .btn-icono { min-width: 44px; }
  .modal-close { width: 44px; height: 44px; }
  .input, .select, textarea.input { min-height: 44px; }
  .login-otros a { min-height: 44px; }
}
/* Títulos con ícono (Informes, Gastronomía) y la Carta en el celular: dos columnas por producto en vez de seis filas */
.panel-head h2 .ic, .section-title .ic { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; color: var(--ink-soft); }
@media (max-width: 700px) {
  table.stackable.ga-tabla-carta tbody tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  table.stackable.ga-tabla-carta tbody td { padding: 4px 0; border-top: 0; }
  table.stackable.ga-tabla-carta tbody td:first-child { grid-column: 1 / -1; }
}
/* Puerta, entradas y modales (auditoría 13/11) */
.puerta-resultado .pr-titulo { display: flex; align-items: center; justify-content: center; gap: 8px; }
.puerta-resultado .pr-titulo .ic { margin-right: 0; }
.ticket-info .badge { align-self: flex-start; }
.mesas-vistas.subtabs { margin: 0; }
.modal-foot { position: sticky; bottom: 0; background: var(--panel); }
.puerta-ayuda, .puerta-form + .muted { font-size: 13px; color: var(--ink-2); }
/* Organización, seguridad y nube (auditoría 13/11) */
.me-ocultas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.me-ocultas > .muted { grid-column: 1 / -1; }
.pass-ojo { display: inline-flex; align-items: center; justify-content: center; }
.celda-luz { font-size: 0; color: var(--yellow-ink); }
.celda-luz .ic, .plano-luz-ayuda .ic { width: 14px; height: 14px; color: var(--yellow-ink); vertical-align: -2px; }
.chip-wa { display: inline-flex; align-items: center; color: var(--primary-600); }
.chip-wa .ic { width: 16px; height: 16px; }
.cred-band { letter-spacing: 0; }
.chip .badge .ic { width: 12px; height: 12px; }
@media (max-width: 700px), (pointer: coarse) {
  .btn-icono { min-width: 44px; min-height: 44px; }
  .pass-ojo { width: 44px; height: 44px; }
  .chip-wa { min-width: 44px; min-height: 44px; justify-content: center; }
}
/* Re-recorrido 13/11: Tareas no se sale a lo ancho en el celular y lo que se toca llega a 44px */
.kanban > .kcol { min-width: 0; }
@media (max-width: 700px) {
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .qty-btn { width: 44px; height: 44px; }
  .area-assign, .area-add, .mesa-inv { min-height: 44px; }
}

/* ---------- Boliche: consumiciones, happy hour, botellas (gastronomia.js / entradas.js) ---------- */
.ticket-consu { font-weight: 600; font-size: 13px; color: var(--green-ink); background: var(--green-bg); border-radius: 6px; padding: 2px 8px; margin-top: 4px; }
.ga-consu .btn-grande { width: 100%; margin: 8px 0; }
.ga-consu-res { display: flex; flex-direction: column; gap: 4px; border-radius: var(--radius); padding: 16px; margin: 12px 0; font-size: 15px; animation: ep-llega .5s var(--ease) both; }
.ga-consu-res strong { font-size: 22px; font-weight: 600; }
.ga-consu-res.ok { background: var(--green-bg); color: var(--green-ink); }
.ga-consu-res.mal { background: var(--red-bg); color: var(--red-ink); }
.ga-happy-aviso { display: flex; align-items: center; gap: 8px; background: var(--yellow-bg); color: var(--yellow-ink); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.ga-happy-aviso .ic { width: 18px; height: 18px; }
.ga-happy .rb-precio s { color: var(--ink-soft); font-weight: 400; font-size: .85em; }
.ga-comp-input { display: inline-flex; align-items: center; gap: 6px; }
.ga-botellas { margin: 8px 0 16px; }
.ga-dif-mal { color: var(--red-ink); font-weight: 600; }
/* Movimiento tranquilo (llega desde 12 px con una curva larga) — se apaga con "reducir movimiento" */
@keyframes ep-llega { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ga-consu-res { animation: none; } }

/* ---------- Tablero de la noche (noche.js) ---------- */
:root { --ease-lenta: cubic-bezier(.16, 1, .3, 1); }
.noche-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.noche-titulo { font-size: 28px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.noche-cab .muted { margin: 4px 0 0; }
.noche-acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.noche-fecha .input { min-height: 44px; }
.noche-kpis .stat-value small { font-size: .5em; color: var(--ink-soft); font-weight: 500; }
.noche-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.noche-grid .panel { margin: 0; }
.noche-procesos { grid-row: span 2; }
.noche-pasos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.noche-pasos li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.noche-pasos li:first-child { border-top: 0; }
.np-marca { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; transition: background .4s var(--ease-lenta), border-color .4s var(--ease-lenta); }
.np-marca .ic { width: 16px; height: 16px; }
.noche-pasos li.ok .np-marca { background: var(--green-bg); border-color: var(--green-ink); color: var(--green-ink); }
.noche-pasos li.aviso .np-marca { background: var(--yellow-bg); border-color: var(--yellow-ink); color: var(--yellow-ink); }
.np-texto { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-texto span { font-size: 13px; color: var(--ink-soft); }
.noche-barras { display: flex; flex-direction: column; gap: 8px; }
.nb-fila { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; font-size: 14px; }
.nb-k { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nb-v { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.nb-bar { height: 12px; background: var(--raised); border-radius: 6px; overflow: hidden; }
.nb-bar span { display: block; height: 100%; background: var(--primary); border-radius: 6px; transform-origin: left; animation: ep-crece 1.2s var(--ease-lenta) both; }
@keyframes ep-crece { from { transform: scaleX(0); } to { transform: none; } }
/* Llegada escalonada de los paneles: lenta y corta (12 px), como un oleaje suave */
.noche-kpis .stat, .noche-grid .panel { animation: ep-llega 1.2s var(--ease-lenta) both; }
.noche-kpis .stat:nth-child(2) { animation-delay: .06s; } .noche-kpis .stat:nth-child(3) { animation-delay: .12s; } .noche-kpis .stat:nth-child(4) { animation-delay: .18s; }
.noche-grid .panel:nth-child(2) { animation-delay: .16s; } .noche-grid .panel:nth-child(3) { animation-delay: .22s; } .noche-grid .panel:nth-child(n+4) { animation-delay: .28s; }
/* Al refrescarse solo (cada 10 s) no vuelve a animar: sólo la primera vez */
.noche.sin-anim .stat, .noche.sin-anim .panel, .noche.sin-anim .nb-bar span { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .noche-kpis .stat, .noche-grid .panel, .nb-bar span { animation: none; }
  .np-marca { transition: none; }
}
@media print {
  .noche-acciones { display: none; }
  .noche-grid { display: block; }
  .noche-grid .panel { break-inside: avoid; margin-bottom: 12px; }
  .noche-kpis .stat, .noche-grid .panel, .nb-bar span { animation: none; }
}

/* ---------- Movimiento de toda la app (referencia: oleaje lento) ----------
   Una sola curva larga (--ease-lenta) y recorridos cortos: las cosas "llegan", no saltan.
   - Al cambiar de pantalla, sus bloques entran escalonados (app.js pone .vista-llega sólo al cambiar de vista,
     no en cada redibujo, para no marear al vender o escanear).
   - El fondo nocturno del ingreso respira muy despacio (escala 1,02 → 1,04 en 18 s).
   - Tarjetas: se elevan 2 px al pasar el mouse.
   Todo se apaga con "reducir movimiento" del sistema. */
.vista-llega > * { animation: ep-llega 1s var(--ease-lenta) both; }
.vista-llega > *:nth-child(2) { animation-delay: .07s; }
.vista-llega > *:nth-child(3) { animation-delay: .14s; }
.vista-llega > *:nth-child(n+4) { animation-delay: .2s; }
.vista-llega .stats .stat { animation: ep-llega 1s var(--ease-lenta) both; }
.vista-llega .stats .stat:nth-child(2) { animation-delay: .05s; }
.vista-llega .stats .stat:nth-child(3) { animation-delay: .1s; }
.vista-llega .stats .stat:nth-child(n+4) { animation-delay: .15s; }
.login-card { animation: ep-llega 1.4s var(--ease-lenta) both; }
.login-screen { isolation: isolate; }
.login-screen::before { content: ''; position: fixed; inset: -4%; pointer-events: none; z-index: -1; background: inherit; animation: ep-marea 18s ease-in-out infinite alternate; }
@keyframes ep-marea { from { transform: scale(1.02) translate(-.2%, .2%); } to { transform: scale(1.04) translate(.3%, -.3%); } }
@media (hover: hover) {
  .stat, .rapida-btn { transition: transform .5s var(--ease-lenta), box-shadow .5s var(--ease-lenta), background-color .15s var(--ease), border-color .15s var(--ease); }
  .stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,23,42,.06), 0 12px 28px rgba(15,23,42,.1); }
}
.toast { animation-duration: .6s; animation-timing-function: var(--ease-lenta); }
@media (prefers-reduced-motion: reduce) {
  .vista-llega > *, .vista-llega .stats .stat, .login-card, .login-screen::before { animation: none; }
  .stat:hover { transform: none; }
}
