/* ===== Invitaciones Plus — base visual ===== */
:root {
  /* Accent (el valor real lo emite head.php/index.php desde la config; este es el de marca) */
  --accent: #0c2039;
  --accent-hover: #20395a;
  --accent-soft: #fbf3ef;
  --accent-soft-2: #f2ddd4;

  /* Marca Invitaciones Plus (fijos: son la identidad del sitio público, no cambian con el acento).
     Los nombres --hp-* se conservan de la base: --hp-blue = azul marino, --hp-yellow = durazno, --hp-rosa = rosa. */
  --hp-blue: #0c2039;
  --hp-blue-deep: #081628;
  --hp-yellow: #f2c4b4;
  --hp-yellow-soft: #fbf3ef;
  --hp-rosa: #d99a88;
  --hp-ink: #0c2039;

  /* Neutrals (grises con un toque frío para armonizar con el azul de marca) */
  --bg: #ffffff;
  --surface: #ffffff;
  --bg-sidebar: #f8f9fc;
  --bg-subtle: #f4f6fa;
  --bg-hover: #eef1f7;
  --bg-active: #e7ebf3;
  --track: #eceff5;

  --border: #e4e8f0;
  --border-strong: #d6dbe6;

  --text: #14161c;
  --text-2: #4f5563;
  --text-3: #7d8392;
  --text-4: #aab0be;

  /* Status / priority colors */
  --green: #15a565;
  --green-soft: #e6f6ee;
  --orange: #e8870c;
  --orange-soft: #fcefd9;
  --red: #e03131;
  --red-soft: #fbe6e6;
  --over: #9b1c1c;        /* rack sobrecargado (más piezas que su capacidad) */
  --blue: #3b5bdb;
  --purple: #7048e8;
  --gray: #b4b4bd;

  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16,24,48,.05), 0 1px 3px rgba(16,24,48,.04);
  --shadow-md: 0 6px 18px rgba(16,24,48,.08), 0 1px 4px rgba(16,24,48,.05);
  --shadow-lg: 0 14px 44px rgba(16,24,48,.15), 0 2px 8px rgba(16,24,48,.06);

  --sidebar-w: 264px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ===== Dark theme ===== */
[data-theme="dark"] {
  --bg: #0f0f12;
  --surface: #1a1a1e;
  --bg-sidebar: #141417;
  --bg-subtle: #202024;
  --bg-hover: #26262b;
  --bg-active: #2d2d33;
  --track: #2d2d33;

  --border: #2a2a30;
  --border-strong: #3a3a42;

  --text: #ededf0;
  --text-2: #b2b2bc;
  --text-3: #8a8a94;
  --text-4: #62626b;

  /* En oscuro el acento se aclara (el azul de marca puro no contrasta sobre fondo negro). */
  --accent: #4d74b0;
  --accent-hover: #6286bd;
  --accent-soft: rgba(77,116,176,.17);
  --accent-soft-2: rgba(77,116,176,.30);

  --green-soft: rgba(21,165,101,.16);
  --orange-soft: rgba(232,135,12,.16);
  --red-soft: rgba(224,49,49,.16);
  --over: #c92a2a;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.4);
  --shadow-lg: 0 14px 44px rgba(0,0,0,.6), 0 2px 10px rgba(0,0,0,.5);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a3a42; background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a4a54; background-clip: padding-box; }
[data-theme="dark"] .doc-body mark { color: #1c1c1f; }
[data-theme="dark"] img.avatar-photo { filter: none; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  font-size: 14px;
  line-height: 1.45;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft-2); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dadade; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c4c4ca; background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== generic ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.14); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input {
  width: 100%; height: 40px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 14px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-4); }

.label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 12px; font-weight: 500; background: var(--bg-subtle); color: var(--text-2);
  border: 1px solid var(--border); white-space: nowrap; max-width: 100%; overflow: hidden;
}
.chip > span:not(.dot) { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.fade-in { animation: fadeIn .22s ease; }
@keyframes fadeIn { from { transform: translateY(5px);} to {transform:none;} }
.scale-in { animation: scaleIn .16s cubic-bezier(.2,.7,.3,1); }
@keyframes scaleIn { from { transform: scale(.975);} to {transform:none;} }
/* slide-in for secondary menus / dropdowns */
.dv-pop { animation: dvPop .19s cubic-bezier(.22,.68,.32,1); transform-origin: top; }
@keyframes dvPop { from { opacity:0; transform: translateY(-7px) scale(.985); } to { opacity:1; transform:none; } }
.dv-fly { animation: dvFly .17s cubic-bezier(.22,.68,.32,1); }
@keyframes dvFly { from { opacity:0; transform: translateX(-8px); } to { opacity:1; transform:none; } }

/* avatar */
.avatar { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; color:#fff; font-weight:600; flex:none; }

.area-card:hover, .client-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.hover-row { border-radius: 7px; transition: background .1s; }
.hover-row:hover { background: var(--bg-subtle); }

.ai-dot { width:6px; height:6px; border-radius:50%; background:var(--text-4); display:inline-block; animation: aiPulse 1s infinite ease-in-out; }
@keyframes aiPulse { 0%,60%,100% { opacity:.3; transform:translateY(0);} 30% { opacity:1; transform:translateY(-3px);} }

.pp-spinner { border-radius:50%; border:2px solid var(--border); border-top-color:var(--accent); animation: ppSpin .7s linear infinite; }
@keyframes ppSpin { to { transform:rotate(360deg); } }

/* drawer */
.drawer-bg { position:fixed; inset:0; background:rgba(20,20,30,.28); z-index:150; animation: fadeIn .18s ease; }
.drawer-bg.closing { animation: bgFadeOut .26s ease forwards; }
.drawer { position:fixed; top:0; right:0; bottom:0; width:480px; max-width:92vw; background:var(--surface); z-index:151; box-shadow:var(--shadow-lg); display:flex; flex-direction:column; animation: slideIn .26s cubic-bezier(.4,0,.2,1); }
.drawer.closing { animation: slideOut .26s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes slideIn { from { transform:translateX(100%);} to { transform:none;} }
@keyframes slideOut { from { transform:none;} to { transform:translateX(100%);} }
@keyframes bgFadeOut { from { opacity:1;} to { opacity:0;} }

/* table rows */
.task-row:hover { background: var(--bg-subtle); }
.cell-edit { height: 100%; display:flex; }
.cell-edit:hover { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--border); border-radius: 6px; }

.shimmer { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.sel-compact { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 8px; border:1px solid transparent; background:transparent; border-radius:6px; font-size:13px; font-weight:450; color:var(--text); max-width:100%; cursor:pointer; transition:background .1s; }
.sel-compact:hover { background: var(--bg-hover); }
.sel-compact .muted-ph { color: var(--text-4); }
.date-subtle { height:30px; font-size:13px; border:1px solid transparent; background:transparent; border-radius:6px; padding:0 6px; color:var(--text); transition:background .1s; }
.date-subtle:hover { background: var(--bg-hover); }
.date-subtle:focus { background:var(--surface); border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }

/* document editor body */
.doc-body h1 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 22px 0 8px; }
.doc-body h2 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin: 20px 0 6px; }
.doc-body h3 { font-size: 17px; font-weight: 600; margin: 16px 0 4px; }
.doc-body p { margin: 8px 0; }
.doc-body ul, .doc-body ol { margin: 8px 0; padding-left: 26px; }
.doc-body li { margin: 3px 0; }
.doc-body blockquote { margin: 12px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--text-2); }
.doc-body hr { border: none; border-top: 1px solid var(--border-strong); margin: 22px 0; }
.doc-body pre { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; overflow-x: auto; margin: 12px 0; }
.doc-body mark { background: #fff3bf; padding: 1px 2px; border-radius: 3px; }
.doc-body:empty::before { content: "Empieza a escribir, o pulsa / para insertar bloques..."; color: var(--text-4); }

/* tooltip-ish muted */
.muted { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* ===== Base móvil (Fase 0) =====
   Solo toca las pocas clases reales — el interior de cada sección se adapta con
   JS (usePlIsMobile) en su propia tanda. */
@media (max-width: 768px) {
  /* La página nunca hace scroll horizontal (red de seguridad ante hijos anchos). */
  body { overflow-x: hidden; }

  /* Drawers de detalle (tarea, publicación, finanzas) a pantalla completa. */
  .drawer { width: 100vw; max-width: 100vw; }

  /* Menús / popovers flotantes (<Menu> compartido): que no se desborden. */
  .dv-pop { max-width: calc(100vw - 16px); }
}

/* "Ver como" (Super Usuario): barra amarilla fija arriba mientras se ve el sistema como otro usuario */
.hp-vercomo { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: var(--hp-yellow); color: var(--hp-ink);
  font-size: 13px; line-height: 1.35; z-index: 150; }
.hp-vercomo span { flex: 1; min-width: 200px; }
.hp-vercomo button { flex: none; height: 30px; padding: 0 14px; border: none; border-radius: 999px; background: var(--hp-ink); color: #fff;
  font-size: 12.5px; font-weight: 700; cursor: pointer; }

/* ===== Invitaciones Plus — marca e Inicio ===== */
.hp-display { font-family: var(--font-display); letter-spacing: -.02em; }
.hp-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px;
  border-radius: 999px; background: var(--hp-yellow); color: var(--hp-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}

/* Navegación lateral: item activo con indicador amarillo de marca */
.hp-nav {
  display: flex; align-items: center; gap: 9px; width: 100%; position: relative;
  padding: 7px 9px; border: none; border-radius: 9px; background: transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 450; text-align: left;
  transition: background .12s, color .12s;
}
.hp-nav:hover { background: var(--bg-hover); color: var(--text); }
.hp-nav.indent { padding-left: 30px; }
.hp-nav.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.hp-nav.active::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--hp-yellow);
}

/* Hero de Inicio — azul plano del logo, sin degradados */
.hp-hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #fff;
  padding: 30px 32px; min-height: 168px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--hp-blue);
  box-shadow: var(--shadow-sm);
}
.hp-hero-copy { position: relative; z-index: 1; min-width: 0; }
.hp-hero-date { font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.78); margin-bottom: 6px; }
.hp-hero-date::first-letter { text-transform: uppercase; }
.hp-hero h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.hp-hero p { margin: 8px 0 16px; color: rgba(255,255,255,.82); font-size: 14px; }
.hp-hero-mark {
  position: relative; z-index: 1; flex: none; height: 132px; width: auto;
  transform: rotate(-6deg); filter: drop-shadow(0 14px 18px rgba(2,20,70,.35));
  animation: hpFloat 5s ease-in-out infinite;
}
@keyframes hpFloat { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-7px); } }

/* Tarjetas de acceso rápido */
.hp-card {
  display: flex; align-items: center; gap: 13px; padding: 15px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.hp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-soft-2); }
.hp-card:active { transform: translateY(0); }
.hp-card .tile {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); transition: background .15s;
}
.hp-card:hover .tile { background: var(--accent); }
.hp-card:hover .tile svg { stroke: #fff; }

.hp-empty {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 16px;
  background: var(--surface); border: 1px dashed var(--border-strong); color: var(--text-3); font-size: 13.5px;
}
.hp-empty img { height: 44px; width: auto; flex: none; opacity: .95; }

@media (max-width: 768px) {
  .hp-hero { padding: 22px 20px; min-height: 0; border-radius: 18px; }
  .hp-hero h1 { font-size: 22px; }
  .hp-hero-mark { height: 84px; }
}
@media (prefers-reduced-motion: reduce) { .hp-hero-mark { animation: none; } }

/* ── Inicio: semana en el saludo, flujo de la mercancía, pendientes, ventas, procesos y novedades ── */
.hp-h { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
.hp-hero-color { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; margin-left: 2px; }
.hp-hero-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hp-hero-pos { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border: none; border-radius: 999px;
  background: var(--hp-yellow); color: var(--hp-ink); font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s; }
.hp-hero-pos:hover { transform: translateY(-1px); }

.hp-flow { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 14px; }
.hp-step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px 15px; min-width: 0;
  text-align: left; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  transition: box-shadow .15s, border-color .15s; }
.hp-step:hover { box-shadow: var(--shadow-md); border-color: var(--accent-soft-2); }
.hp-step-top { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 4px; }
.hp-step-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); }
.hp-step[data-verde="1"] .hp-step-ico { background: var(--green-soft); }
.hp-step-lbl { font-size: 12.5px; font-weight: 650; color: var(--text-2); line-height: 1.25; min-width: 0; }
.hp-step b { font-family: var(--font-display); font-size: 28px; line-height: 1.05; font-weight: 750; letter-spacing: -.02em; }
.hp-step[data-verde="1"] b { color: var(--green); }
.hp-step-sub { font-size: 12px; color: var(--text-3); line-height: 1.3; max-width: 100%; }
.hp-step-arrow { position: absolute; right: -14px; top: 50%; transform: translateY(-50%); z-index: 1; width: 14px; display: flex; justify-content: center; }

.hp-duo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; margin-top: 26px; align-items: start; }
.hp-duo[data-uno="1"] { grid-template-columns: minmax(0, 1fr); }
.hp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.hp-panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
  font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.hp-panel-h > span:first-child { flex: 1; min-width: 0; }
.hp-count { flex: none !important; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--orange-soft); color: var(--orange);
  font-family: var(--font); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.hp-panel-vacio { font-size: 13px; color: var(--text-3); padding: 6px 0 4px; }
.hp-link { flex: none; display: inline-flex; align-items: center; gap: 5px; border: none; background: none; padding: 0; cursor: pointer;
  font-family: var(--font); font-size: 12.5px; font-weight: 650; color: var(--accent); }
.hp-ok { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px; background: var(--green-soft); font-size: 13px; color: var(--text-2); line-height: 1.4; }
.hp-ok b { color: var(--green); }

.hp-todo { display: flex; flex-direction: column; gap: 8px; }
.hp-todo-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer; color: var(--text);
  background: var(--bg-subtle); border: 1px solid transparent; border-radius: 11px; transition: border-color .15s, background .15s; }
.hp-todo-row:hover { border-color: var(--border-strong); background: var(--surface); }
.hp-todo-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.hp-todo-row[data-tono="rojo"] .hp-todo-ico { background: var(--red-soft); color: var(--red); }
.hp-todo-row[data-tono="naranja"] .hp-todo-ico { background: var(--orange-soft); color: var(--orange); }
.hp-todo-row[data-tono="azul"] .hp-todo-ico { background: var(--accent-soft); color: var(--accent); }
.hp-todo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hp-todo-txt b { font-size: 13.5px; font-weight: 650; }
.hp-todo-txt span { font-size: 12px; color: var(--text-3); }

.hp-ventas { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.hp-ventas:hover { box-shadow: var(--shadow-md); border-color: var(--accent-soft-2); }
.hp-ventas-big { font-family: var(--font-display); font-size: 34px; line-height: 1.05; font-weight: 750; letter-spacing: -.02em; color: var(--green); }
.hp-ventas-d { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.hp-ventas-d b { color: var(--text); font-weight: 700; }
.hp-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 104px; margin-top: 16px; }
.hp-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.hp-bar i { display: block; width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: var(--accent-soft-2); }
.hp-bar[data-hoy="1"] i { background: var(--accent); }
.hp-bar span { font-size: 11px; font-weight: 600; color: var(--text-4); }
.hp-bar[data-hoy="1"] span { color: var(--accent); }
.hp-ventas-pie { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.hp-ventas-pie b { color: var(--text); }

.hp-proc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hp-proc li { display: flex; align-items: flex-start; gap: 11px; }
.hp-proc-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--hp-yellow); color: var(--hp-ink);
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.hp-proc li > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-top: 2px; }
.hp-proc b { font-size: 13.5px; font-weight: 650; }
.hp-proc li > span:last-child > span { font-size: 12.5px; color: var(--text-3); }
.hp-nuevo-t { font-size: 14px; font-weight: 650; }
.hp-nuevo-f { font-size: 12px; color: var(--text-4); margin-top: 2px; }
.hp-nuevo { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

.hp-mapa-wrap { overflow-x: auto; padding: 12px; background: var(--bg-subtle); border-radius: 12px; }
.hp-mapa { display: grid; gap: 8px; min-width: min-content; }
.hp-mapa .inv-shelf:hover { transform: none; }
.hp-mapa .inv-shelf[data-solo="1"] { cursor: default; }
.hp-mapa .inv-shelf[data-solo="1"]:hover { box-shadow: none; }
.hp-mapa-cap { font-family: var(--font); font-size: 11px; font-weight: 600; opacity: .7; margin-left: 1px; }
@media (max-width: 900px) {
  .hp-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-step-arrow { display: none; }
  .hp-duo { grid-template-columns: minmax(0, 1fr); }
}

/* Miembros: avatar editable (foto/color) y nombre editable en la ficha */
.avatar-edit { border: none; background: transparent; padding: 0; border-radius: 50%; cursor: pointer; flex: none;
  display: inline-flex; transition: box-shadow .12s; }
.avatar-edit:hover, .avatar-edit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft-2); }
.mb-name-input { font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: transparent;
  border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; max-width: 100%; outline: none;
  transition: border-color .12s, background .12s; }
.mb-name-input:hover { border-color: var(--border-strong); }
.mb-name-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== Eventos e invitaciones (eventos.jsx) ===== */
.ev-cabeza { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ev-h1 { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; line-height: 1.2; }
.ev-sub { margin: 0; color: var(--text-3); font-size: 13.5px; line-height: 1.5; }
.ev-sub b { color: var(--text-2); font-weight: 600; }
.ev-opc { font-size: 12px; color: var(--text-4); font-weight: 450; }
.ev-buscar { position: relative; display: flex; align-items: center; min-width: 200px; flex: 1 1 320px; }
.ev-buscar > svg { position: absolute; left: 10px; pointer-events: none; }
.ev-buscar .input { padding-left: 32px; width: 100%; }
.ev-seccion { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .05em; margin: 22px 0 10px; }
.ev-seccion-btn { border: none; background: transparent; padding: 0; cursor: pointer; }
/* Debajo de las pestañas: buscador (ocupa lo que sobre) y "Mostrar pasados" a la derecha */
.ev-barra-filtros { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin: 0 0 8px; }
.ev-switch-pasados { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; user-select: none; }
.ev-switch-pasados > span { cursor: pointer; }
.ev-separador { border: none; border-top: 1px dashed var(--border-strong); margin: 28px 0 22px; }
/* Pestañas cuadradas por tipo de evento (Eventos) */
/* Se reparten todo el ancho, igual que las 3 fichas de abajo (mismo gap; el margen negativo compensa el padding para la sombra/hover) */
.ev-tabs { display: flex; gap: 12px; margin: 0 -2px 16px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.ev-tab { position: relative; flex: 1 1 0; min-width: 100px; height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 8px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, color .15s, transform .15s; }
.ev-tab:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.ev-tab-l { font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; }
.ev-tab-n { position: absolute; top: 7px; right: 7px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-soft-2); }
.ev-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-tab[aria-selected="true"] .ev-tab-n { background: var(--hp-yellow); color: var(--hp-ink); border-color: var(--hp-yellow); }
.ev-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .ev-tabs { gap: 8px; margin-bottom: 12px; } .ev-tab { flex: none; width: 96px; min-width: 0; height: 92px; gap: 7px; } .ev-tab-l { font-size: 12px; }
  .ev-switch-pasados { margin-left: auto; } }
.ev-tipos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
@media (max-width: 520px) { .ev-tipos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ev-tipo-op { position: relative; min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 10px 6px;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; transition: border-color .15s, background .15s, color .15s; }
.ev-tipo-op:hover { border-color: var(--border-strong); color: var(--text); }
.ev-tipo-op[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ev-tipo-op[aria-checked="true"]::after { content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.ev-tipo-op:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="dark"] .ev-tipo-op[aria-checked="true"] { color: #fff; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ev-vacio { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 20px; color: var(--text-3); font-size: 13.5px; }
.ev-vacio b { color: var(--text); font-size: 15px; }

.ev-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px 18px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer; color: inherit; font: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ev-card:hover { border-color: var(--accent-soft-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ev-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ev-card-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.ev-card-tipo { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-card-faltan { flex: none; font-size: 11.5px; font-weight: 650; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-soft-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.ev-card-faltan[data-pronto="1"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-card-nombre { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-card-fecha { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.ev-card-avance { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 2px; padding-top: 12px; border-top: 1px solid var(--border); }
.ev-card-nums { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.ev-card-nums b { font-size: 20px; color: var(--green); font-weight: 700; margin-right: 3px; }
.ev-card-pct { font-size: 12.5px; font-weight: 650; color: var(--text-3); }
.ev-card-sub { font-size: 11.5px; color: var(--text-4); }
.ev-card-pie { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ev-card-pie > span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-width: 0;
  padding: 8px 4px; border-radius: 10px; background: var(--bg-subtle); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-3); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-card-pie b { font-size: 15px; font-weight: 700; color: var(--text); }
.ev-barra-tres { display: flex; }
.ev-barra-tres > i { border-radius: 0; transition: width .4s ease; }
.ev-barra-tres > i:first-child { border-radius: 999px 0 0 999px; }
.ev-barra-tres > i[data-no="1"] { background: var(--red); opacity: .75; }
.ev-card-no { font-size: 12.5px; color: var(--text-3); }
.ev-card-abierta { display: inline-block; font-weight: 650; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 7px; margin-right: 3px; }
.ev-card[data-pasado="1"] .ev-card-ico { background: var(--bg-subtle); color: var(--text-3); }
.ev-card[data-pasado="1"] .ev-card-nums b { color: var(--text-2); }
.ev-card[data-pasado="1"] .ev-barra > i { background: var(--text-4); }
.ev-card[data-pasado="1"] .ev-barra > i[data-no="1"] { background: var(--text-4); opacity: .4; }
.ev-card-caja { position: relative; display: flex; flex-direction: column; min-width: 0; }
.ev-card-caja > .ev-card { flex: 1; }
.ev-card[data-demo="1"] .ev-card-top { padding-right: 38px; }
.ev-card-demo { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.ev-barra { height: 7px; border-radius: 999px; background: var(--track, var(--bg-subtle)); overflow: hidden; }
.ev-barra > i { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .4s ease; }

.ev-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .ev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ev-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer; color: var(--text); min-width: 0; }
.ev-tile:disabled { cursor: default; }
.ev-tile[data-activo="1"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ev-tile-l { font-size: 12px; color: var(--text-3); font-weight: 550; }
.ev-tile b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.ev-tile[data-tono="verde"] b { color: var(--green); }
.ev-tile[data-tono="rojo"] b { color: var(--red); }
.ev-tile[data-tono="naranja"] b { color: var(--orange); }
.ev-tile-s { font-size: 11.5px; color: var(--text-4); }
.ev-avance { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.ev-avance .ev-barra { flex: 1; }

.ev-filtros { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 20px 0 12px; }
.ev-lista { display: flex; flex-direction: column; gap: 8px; }
.ev-filtros .ev-buscar { flex: 1 1 260px; }
/* Invitaciones en tabla (escritorio; en celular siguen las tarjetas) */
.ev-tabla-caja { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ev-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.ev-tabla th { position: sticky; top: 0; z-index: 1; background: var(--bg-subtle); text-align: left; font-size: 11.5px; font-weight: 650; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 12px; height: 36px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ev-tabla th button { border: none; background: transparent; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ev-tabla th button:hover, .ev-tabla th[aria-sort] button { color: var(--text); }
.ev-tabla-flecha { display: inline-block; min-width: 9px; }
.ev-tabla td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.ev-tabla tbody tr { cursor: pointer; transition: background .12s; }
.ev-tabla tbody tr:hover { background: var(--bg-subtle); }
.ev-tabla tbody tr[data-demo="1"] { opacity: .65; }
.ev-tabla tbody tr:last-child td { border-bottom: none; }
.ev-tabla .num { text-align: right; }
.ev-tabla th.num button { flex-direction: row-reverse; }
.ev-tabla .acc { width: 1%; white-space: nowrap; padding-right: 8px; }
.ev-tabla td.num b { color: var(--text); font-weight: 650; }
.ev-tabla-nombre { min-width: 220px; }
.ev-tabla-nombre > b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 620; color: var(--text); }
.ev-tabla-nombre .ev-inv-gente { margin-top: 5px; }
.ev-tabla-nombre .ev-inv-gente > span { font-size: 11.5px; padding: 1px 7px; }
.ev-tabla-tel { white-space: nowrap; }
.ev-tabla-pie { padding: 9px 14px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); background: var(--bg-subtle); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ev-inv { display: flex; align-items: stretch; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.ev-inv[data-demo="1"] { opacity: .7; }
.ev-inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; border: none; background: transparent; padding: 0; cursor: pointer; color: var(--text); }
.ev-inv-nombre { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.ev-inv-meta { font-size: 12.5px; color: var(--text-3); }
.ev-inv-gente { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ev-inv-gente > span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-2); }
.ev-inv-gente > span[data-a="1"] { background: var(--green-soft); color: var(--green); }
.ev-inv-gente > span[data-a="2"] { background: var(--red-soft); color: var(--red); text-decoration: line-through; }
.ev-inv-lado { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.ev-inv-nums { font-size: 12px; color: var(--text-3); }
.ev-inv-acc { display: flex; align-items: center; gap: 4px; }
@media (max-width: 640px) {
  .ev-inv { flex-direction: column; }
  .ev-inv-lado { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .ev-inv-acc { margin-left: auto; }
}
.ev-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap;
  background: var(--bg-subtle); color: var(--text-3); }
.ev-pill[data-tono="verde"] { background: var(--green-soft); color: var(--green); }
.ev-pill[data-tono="rojo"] { background: var(--red-soft); color: var(--red); }
.btn.ev-btn-wa, a.ev-btn-wa { background: #1fa855; border-color: #1fa855; color: #fff; font-weight: 600; text-decoration: none; }
/* Sorteo */
.so-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .so-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .so-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.so-selects { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.so-mes { width: auto; max-width: 100%; height: 34px; }
.so-ganador { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 14px 16px;
  border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent); }
.so-ganador > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.so-ganador b { font-size: 17px; }
.so-sin-grupo { height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; cursor: pointer;
  border: 1px dashed var(--orange); background: transparent; color: var(--orange); }
/* Sorteo → Por estado */
.so-estados { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.so-estado { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: none; background: transparent; text-align: left; cursor: pointer; color: var(--text); }
.so-estado + .so-estado { border-top: 1px solid var(--border); }
.so-estado:hover { background: var(--bg-hover); }
.so-estado-pos { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.so-estado[data-sin="1"] .so-estado-pos { background: var(--bg-subtle); color: var(--text-4); }
.so-estado-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.so-estado-txt b { font-size: 14px; font-weight: 600; }
.so-estado-barra { display: block; height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.so-estado-barra > i { display: block; height: 100%; border-radius: 999px; background: var(--hp-rosa); }
.so-estado-n { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--text-3); }
.so-estado-n b { font-size: 17px; color: var(--text); font-weight: 700; }
.so-link { overflow-wrap: anywhere; font-family: var(--font-mono, monospace); font-size: 12px; }
.btn.ev-btn-wa:hover { background: #188a45; border-color: #188a45; }

.ev-form .label { margin-top: 14px; }
.ev-form > .label:first-child { margin-top: 0; }
.ev-form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .ev-form-2 { grid-template-columns: 1fr; } }
.ev-textarea { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; line-height: 1.45; font-family: inherit; }
.ev-form-gente-h { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.ev-form-persona { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: center; gap: 6px; margin-bottom: 6px; }
.ev-form-resp { width: 10px; height: 10px; border-radius: 50%; background: var(--text-4); }
.ev-form-resp[data-a="1"] { background: var(--green); }
.ev-form-resp[data-a="2"] { background: var(--red); }
.ev-form-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-subtle); font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.ev-error { padding: 9px 12px; border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 550; }
.ev-wa-burbuja { white-space: pre-wrap; background: #dcf8c6; color: #111b21; border-radius: 10px 10px 10px 2px; padding: 12px 14px; font-size: 13.5px;
  line-height: 1.5; margin: 14px 0; box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-wrap: anywhere; }
.ev-wa-link { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.ev-wa-link > span { flex: 1 1 100%; overflow-wrap: anywhere; margin-bottom: 4px; }

/* ── Alta/edición del evento y clientes ── */
.ev-cabeza-acc { display: flex; gap: 8px; flex-wrap: wrap; }
/* Detalle del evento: quién entra al panel por este evento (clientes) */
.ev-acceso { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; padding: 9px 10px 9px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); }
.ev-acceso-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.ev-acceso-nadie { font-size: 13px; color: var(--text-3); }
.ev-acceso-c { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); font-size: 13px; }
.ev-acceso-c b { font-weight: 600; color: var(--text); }
.ev-acceso-c small { font-size: 11.5px; color: var(--green, #15a565); }
.ev-acceso-c[data-entro="0"] small { color: var(--orange, #e8870c); }
.ev-acceso-btn { margin-left: auto; }
.ev-form-sec { font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em;
  margin: 26px 0 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.ev-form > .ev-form-sec:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.ev-form-fijo { height: 36px; display: flex; align-items: center; font-size: 13.5px; color: var(--text-2); }
.ev-form-fest { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin: 10px 0 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle); }
.ev-form-fest-h { display: flex; gap: 6px; align-items: center; }
.ev-form-fest-h .input { flex: 1; font-weight: 600; }
.ev-form-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0 2px; }
.ev-form-switch > div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ev-form-switch span { font-size: 12.5px; color: var(--text-3); }
.ev-paletas { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.ev-paleta { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 6px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.ev-paleta:hover { border-color: var(--accent); }
.ev-paleta > span { display: inline-flex; }
.ev-paleta > span > i { width: 14px; height: 14px; border-radius: 50%; margin-left: -4px; border: 2px solid var(--surface); }
.ev-paleta > span > i:first-child { margin-left: 0; }
.ev-colores { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 2px; }
.ev-color { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ev-color input[type="color"] { width: 30px; height: 30px; padding: 0; border: none; border-radius: 7px; background: none; cursor: pointer; }
.ev-color span { font-size: 12px; color: var(--text-3); }
.ev-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); align-self: end; height: 36px; }
.ev-girar { display: inline-flex; transform: rotate(180deg); }
.ev-slider { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.ev-slide { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-subtle); }
.ev-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-slide[data-nueva="1"] { border-color: var(--accent); }
.ev-slide-acc { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; justify-content: center; gap: 4px; }
.ev-slide-acc .btn { background: var(--surface); box-shadow: var(--shadow-sm); }
.ev-slide-mas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border-style: dashed; font-size: 12.5px; color: var(--text-3); }
.ev-slide-mas:hover { border-color: var(--accent-soft-2); color: var(--text-2); }
.ev-arch { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ev-arch-thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ev-arch-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ev-arch-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.ev-arch-txt span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-cliente { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ev-cliente > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.ev-cliente span { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.ev-form-pass { display: flex; gap: 6px; }
.ev-form-pass .input { flex: 1; font-family: var(--font-mono, monospace); }
.ev-creado { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; padding: 14px; border-radius: 12px; background: var(--green-soft); }

/* ===== Finanzas ===== */
.fi-aviso { display: flex; align-items: flex-start; gap: 8px; padding: 11px 14px; margin: 0 0 16px; border-radius: 10px; background: var(--orange-soft); color: var(--text-2); font-size: 13px; line-height: 1.45; }
.fi-aviso svg { flex: none; margin-top: 2px; }
.fi-anios, .fi-vistas { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.fi-vistas { margin: 0; }
.fi-anio { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer; }
.fi-anio:hover { border-color: var(--border-strong); color: var(--text); }
.fi-anio[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.fi-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
@media (max-width: 900px) { .fi-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fi-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: 12px; text-align: left;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); font: inherit; color: inherit; min-width: 0; }
button.fi-kpi { cursor: pointer; }
button.fi-kpi:disabled { cursor: default; }
.fi-kpi[data-activo="1"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fi-kpi > span { font-size: 12px; color: var(--text-3); font-weight: 550; }
.fi-kpi > b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-kpi > b[data-tono="naranja"] { color: var(--orange); }
.fi-kpi > small { font-size: 12px; color: var(--text-3); }
.fi-kpi-gan { background: var(--accent); border-color: var(--accent); color: #fff; }
.fi-kpi-gan > span, .fi-kpi-gan > small { color: rgba(255,255,255,.78); }
.fi-grupos { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 0 6px; margin-bottom: 24px; }
.fi-grupo { display: grid; grid-template-columns: 100px minmax(60px, 1fr) 105px 105px 110px; align-items: center; gap: 12px; padding: 8px 16px; font-size: 13px; }
.fi-grupo + .fi-grupo { border-top: 1px solid var(--border); }
.fi-grupo-cab { font-size: 11px; font-weight: 600; color: var(--text-4); padding-bottom: 4px; }
.fi-grupo-cab > span { text-align: right; }
.fi-grupo-n { font-weight: 600; text-transform: capitalize; }
.fi-grupo-barra { display: flex; flex-direction: column; gap: 3px; }
.fi-grupo-barra > i { display: block; height: 6px; min-width: 0; border-radius: 3px; background: var(--hp-yellow); }
.fi-grupo-barra > i[data-gasto="1"] { background: var(--text-4); opacity: .55; }
.fi-grupo-v { color: var(--text-2); text-align: right; }
.fi-grupo-g { text-align: right; }
.fi-grupo-g[data-tono="rojo"] { color: var(--red); }
@media (max-width: 640px) { .fi-grupo { grid-template-columns: 1fr auto; row-gap: 4px; }
  .fi-grupo-barra { grid-column: 1 / -1; grid-row: 2; } .fi-grupo-v, .fi-grupo-cab { display: none; } }
.fi-lista-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fi-lista { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.fi-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 14px; }
.fi-fila + .fi-fila, .fi-gasto + .fi-gasto { border-top: 1px solid var(--border); }
.fi-estado { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fi-ev { display: flex; align-items: center; gap: 10px; min-width: 0; border: none; background: transparent; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.fi-ev-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.fi-ev-ico[data-gasto="1"] { background: var(--bg-subtle); color: var(--text-2); }
.fi-ev-txt { display: flex; flex-direction: column; min-width: 0; }
.fi-ev-txt b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-ev:hover .fi-ev-txt b { text-decoration: underline; }
.fi-ev-txt span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-campo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fi-campo > span { font-size: 11px; color: var(--text-3); font-weight: 550; }
.fi-input { position: relative; display: flex; align-items: center; }
.fi-input > i { position: absolute; left: 10px; font-style: normal; color: var(--text-4); font-size: 13px; pointer-events: none; }
.fi-input .input { padding-left: 22px; width: 100%; }
.fi-fila .fi-input .input { height: 34px; text-align: right; }
.fi-venta-der { display: flex; align-items: flex-end; gap: 4px; }
.fi-venta-der .fi-campo { width: 160px; }
.fi-regalar { height: 34px; width: 34px; }
.fi-anio { display: inline-flex; align-items: center; gap: 5px; }
.fi-gasto { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; }
.fi-gasto > .fi-ev { flex: 1; }
.fi-gasto-m { flex: none; font-size: 14px; font-weight: 700; color: var(--text); }
.fi-cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.fi-cat-op { min-height: 72px; font-size: 11.5px; }
@media (max-width: 520px) { .fi-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .fi-fila { grid-template-columns: 1fr auto; row-gap: 6px; } .fi-venta-der .fi-campo { width: 130px; } .fi-estado { grid-column: 1 / -1; grid-row: 2; } .fi-estado:empty { display: none; } }

/* Miembros → Clientes (solo consulta; se administran dentro de cada evento) */
.mb-aviso { display: flex; align-items: flex-start; gap: 9px; padding: 10px 13px; margin-bottom: 14px; border-radius: 11px; background: var(--bg-subtle);
  border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.mb-aviso > svg { flex: none; margin-top: 2px; }
.mb-clientes { display: flex; flex-direction: column; gap: 8px; }
.mb-cliente { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.mb-cliente[data-estado="suspendido"] { opacity: .72; }
.mb-cliente-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mb-cliente-nombre { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 14px; }
.mb-cliente-nombre b { font-weight: 620; }
.mb-cliente-sub { font-size: 12.5px; color: var(--text-4); overflow-wrap: anywhere; }
.mb-cliente-evs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.mb-ev-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-subtle);
  color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: border-color .15s, color .15s; }
.mb-ev-chip:hover { border-color: var(--accent); color: var(--accent); }
.mb-cliente > .btn { flex: none; }

/* ═══════════════════════════ Celular tipo app ═══════════════════════════
   Pestañas abajo, barra de arriba con ‹ regresar, botón flotante para la acción principal,
   hojas que suben desde abajo (menús, modales y paneles) y controles del tamaño del dedo. */
:root { --pl-tabbar-h: 58px; }
@keyframes plSube { from { transform: translateY(100%); } to { transform: none; } }
@keyframes plBaja { from { transform: none; } to { transform: translateY(100%); } }
@keyframes plFondo { from { opacity: 0; } to { opacity: 1; } }

/* Pantalla "Más" (lista estilo Ajustes del teléfono) */
.pl-mas { flex: 1; overflow-y: auto; padding: 18px 16px 34px; background: var(--bg-subtle); }
.pl-mas-perfil { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.pl-mas-perfil:active { background: var(--bg-hover); }
.pl-mas-perfil-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-mas-perfil-t b { font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-mas-perfil-t span { font-size: 13.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-grupo-t { font-size: 12.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 24px 8px 8px; }
.pl-grupo { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pl-grupo + .pl-grupo { margin-top: 16px; }
.pl-fila { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 14px; border: none; background: transparent;
  color: var(--text); font-size: 15.5px; text-align: left; cursor: pointer; }
.pl-fila + .pl-fila::before { content: ''; position: absolute; top: 0; left: 58px; right: 0; border-top: 1px solid var(--border); }
.pl-fila:active { background: var(--bg-hover); }
.pl-fila-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.pl-fila[data-danger="1"] { color: var(--red); }
.pl-fila[data-danger="1"] .pl-fila-ico { background: var(--red-soft); }
.pl-fila-l { flex: 1; min-width: 0; font-weight: 500; }
.pl-fila-d { font-size: 14px; color: var(--text-3); white-space: nowrap; }
.pl-fila-badge { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--bg-subtle); color: var(--text-3); font-size: 12.5px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; }
.pl-mas-pie { text-align: center; font-size: 12px; color: var(--text-4); margin-top: 28px; }
.pl-mas-pie a { color: var(--text-3); }

/* Menús "⋯" en celular: hoja de acciones */
.pl-hoja-fondo { position: fixed; inset: 0; z-index: 400; background: rgba(15, 18, 28, .42); display: flex; align-items: flex-end; animation: plFondo .18s ease; }
.pl-hoja { width: 100%; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); animation: plSube .26s cubic-bezier(.2, .8, .2, 1); }
.pl-hoja-grupo { background: var(--surface); border-radius: 16px; overflow: hidden; padding: 4px 0; max-height: 70vh; overflow-y: auto; }
.pl-hoja-grupo .pl-menu-item { min-height: 54px; padding: 0 18px !important; font-size: 16.5px !important; border-radius: 0 !important; gap: 14px !important; }
.pl-hoja-grupo .pl-menu-item + .pl-menu-item { border-top: 1px solid var(--border); }
.pl-hoja-grupo .pl-menu-item svg { width: 20px; height: 20px; }
.pl-hoja-grupo .pl-menu-item:active { background: var(--bg-hover) !important; }
.pl-hoja-cancelar { width: 100%; margin-top: 8px; height: 56px; border: none; border-radius: 16px; background: var(--surface); font-size: 17px; font-weight: 650; color: var(--accent); cursor: pointer; }

@media (max-width: 768px) {
  html, body { overscroll-behavior-y: none; }
  body { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
  button, a, label, [role="button"], [role="tab"] { touch-action: manipulation; }

  /* El contenido deja libre el espacio de las pestañas */
  .pl-main-movil { padding-bottom: calc(var(--pl-tabbar-h) + env(safe-area-inset-bottom)); background: var(--bg-subtle); }

  /* Pestañas de abajo */
  .pl-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; height: calc(var(--pl-tabbar-h) + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom); background: var(--surface); background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--border); }
  .pl-tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 0 0;
    border: none; background: transparent; color: var(--text-4); font-size: 10.5px; font-weight: 600; cursor: pointer; }
  .pl-tab[aria-current="page"] { color: var(--accent); }
  .pl-tab-ico { position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 30px; border-radius: 15px; transition: background .2s, transform .12s; }
  .pl-tab[aria-current="page"] .pl-tab-ico { background: var(--accent-soft); }
  .pl-tab:active .pl-tab-ico { transform: scale(.9); }
  .pl-tab-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pl-tab-punto { position: absolute; top: 3px; right: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--green, #15a565); border: 2px solid var(--surface); }

  /* Barra de arriba */
  .pl-topbar { flex: none; position: relative; z-index: 20; display: flex; align-items: center; gap: 4px; min-height: 54px; padding: env(safe-area-inset-top) 6px 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--border); }   /* sin backdrop-filter: atraparía al botón flotante (position: fixed) */
  .pl-topbar[data-atras="1"] { padding-left: 0; }
  .pl-topbar-atras { flex: none; display: inline-flex; align-items: center; height: 44px; max-width: 42%; padding: 0 6px 0 4px; border: none; background: transparent;
    color: var(--accent); font-size: 16px; font-weight: 500; cursor: pointer; }
  .pl-topbar-atras span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pl-topbar-atras:active { opacity: .55; }
  .pl-topbar-t { flex: 1; min-width: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
  .pl-topbar-acc { flex: none; display: flex; align-items: center; gap: 2px; }
  .pl-topbar-acc .btn:not(.primary) { font-size: 0; gap: 0; width: 42px; height: 42px; padding: 0; border: none; border-radius: 50%; background: transparent; justify-content: center; }
  .pl-topbar-acc .btn:not(.primary) svg { width: 22px; height: 22px; }
  .pl-topbar-acc .btn:not(.primary):active { background: var(--bg-hover); }
  /* Acción principal = botón flotante sobre las pestañas */
  .pl-topbar-acc .btn.primary { position: fixed; right: 16px; bottom: calc(var(--pl-tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 90;
    height: 54px; padding: 0 22px 0 18px; border-radius: 27px; font-size: 15.5px; font-weight: 650; gap: 8px;
    box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 70%, transparent), 0 3px 8px rgba(0, 0, 0, .14); }
  .pl-topbar-acc .btn.primary svg { width: 21px; height: 21px; }
  .pl-topbar-acc .btn.primary:active { transform: scale(.96); }
  .pl-main-movil:has(.pl-topbar-acc .btn.primary) > .pl-topbar + div { padding-bottom: 80px; }

  /* Controles del tamaño del dedo (y 16px en campos: iOS ya no hace zoom al escribir) */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea { font-size: 16px !important; }
  .input { height: 46px; border-radius: 11px; }
  textarea.input { height: auto; min-height: 96px; padding-top: 11px; }
  .label { font-size: 13.5px; }
  .btn { height: 44px; padding: 0 16px; font-size: 15px; border-radius: 11px; }
  .btn.sm { height: 38px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
  .btn.icon { width: 44px; }
  .btn.icon.sm { width: 38px; }
  .btn:active { transform: scale(.97); }
  .pl-toggle { width: 51px !important; height: 31px !important; border-radius: 16px !important; flex: none; }
  .pl-toggle-bola { width: 27px !important; height: 27px !important; }
  .pl-seg { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; border-radius: 11px !important; padding: 3px !important; max-width: 100%; }
  .pl-seg::-webkit-scrollbar { display: none; }
  .pl-seg > button { flex: 1 0 auto !important; height: 36px !important; padding: 0 14px !important; font-size: 14px !important; border-radius: 8px !important; }
  .dv-pop { max-width: calc(100vw - 16px); }

  /* Modales → hoja que sube desde abajo */
  .pl-modal-fondo { align-items: flex-end !important; padding: 0 !important; animation: plFondo .18s ease; }
  .pl-modal { max-width: none !important; max-height: 92vh !important; border-radius: 22px 22px 0 0 !important;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom)) !important; animation: plSube .3s cubic-bezier(.2, .8, .2, 1) !important; }
  .pl-modal::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 14px; }
  .pl-kbd { display: none !important; }
  .pl-confirm-acc { flex-direction: column-reverse; align-items: stretch !important; gap: 8px !important; }
  .pl-confirm-acc .btn { height: 52px; justify-content: center; font-size: 16px; border-radius: 14px; }

  /* Paneles laterales → pantalla que sube, con pie fijo y botones grandes */
  .drawer { top: calc(env(safe-area-inset-top) + 8px); left: 0; width: 100% !important; max-width: none; border-radius: 18px 18px 0 0;
    animation: plSube .32s cubic-bezier(.2, .8, .2, 1); }
  .drawer.closing { animation: plBaja .24s ease forwards; }
  .drawer-bg { background: rgba(15, 18, 28, .42); }
  .drawer-cab { padding: 14px 10px 14px 18px !important; }
  .drawer-cab h2 { font-size: 17px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drawer-cab .btn.icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-subtle); }
  .drawer-cuerpo { padding: 16px 16px 24px !important; -webkit-overflow-scrolling: touch; }
  .drawer-pie-acc { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)) !important; flex-wrap: wrap; }
  .drawer-pie-acc > .btn, .drawer-pie-acc > a.btn { flex: 1 1 0; height: 50px; justify-content: center; font-size: 16px; border-radius: 13px; }

  /* Eventos: tipos como chips que se deslizan */
  .pl-main-movil .ev-cabeza { margin-bottom: 14px; }
  .pl-main-movil .ev-cabeza:not(:has(.ev-card-tipo)) .ev-h1 { display: none; }
  .ev-tabs { gap: 8px; margin: 0 -12px 12px; padding: 2px 12px 6px; scrollbar-width: none; }
  .ev-tabs::-webkit-scrollbar { display: none; }
  .ev-tab { flex: none; width: auto; min-width: 0; height: 40px; flex-direction: row; gap: 7px; padding: 0 12px 0 11px; border-radius: 20px; box-shadow: none; }
  .ev-tab:hover { transform: none; }
  .ev-tab svg { width: 18px; height: 18px; }
  .ev-tab-l { font-size: 14px; white-space: nowrap; }
  .ev-tab-n { position: static; order: 3; min-width: 22px; height: 20px; }
  .ev-barra-filtros { gap: 10px; }
  .ev-barra-filtros .ev-buscar { flex: 1 1 100%; }
  .ev-switch-pasados { margin-left: 0; width: 100%; justify-content: space-between; flex-direction: row-reverse; font-size: 15px; font-weight: 550;
    padding: 6px 4px; }

  /* Detalle del evento */
  .ev-cabeza-acc { width: 100%; }
  .ev-cabeza-acc > .btn { flex: 1 1 0; justify-content: center; }
  .ev-acceso { padding: 10px 12px; }
  .ev-acceso-btn { margin-left: 0; width: 100%; justify-content: center; }
  .ev-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -12px; padding: 2px 12px 6px; scrollbar-width: none; }
  .ev-tiles::-webkit-scrollbar { display: none; }
  .ev-tile { flex: 0 0 auto; min-width: 132px; scroll-snap-align: start; border-radius: 14px; }
  .ev-tiles { scroll-padding-inline: 12px; }
  .so-selects { width: 100%; flex-wrap: wrap; }
  .so-selects .so-mes { flex: 1 1 140px; min-width: 0; height: 46px; }
  .fi-anios, .fi-vistas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px 2px; }
  .fi-anios::-webkit-scrollbar, .fi-vistas::-webkit-scrollbar { display: none; }
  .fi-anio { flex: none; height: 38px; padding: 0 16px; font-size: 14px; }
  .fi-lista-cab { flex-direction: column; align-items: stretch; }
  .fi-fila { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  .fi-fila > .fi-ev { grid-column: 1 / -1; }
  .fi-ev-txt b { font-size: 15px; white-space: normal; }
  .fi-gasto { padding: 12px 14px; }
  .ev-filtros { gap: 10px; margin-top: 16px; }
  .ev-filtros > .pl-seg { width: 100%; }
  .ev-filtros .ev-buscar { flex: 1 1 100%; }
  .ev-filtros > .btn { width: 100%; justify-content: center; }
  .ev-inv { border-radius: 14px; padding: 14px; gap: 10px; }
  .ev-inv:active { background: var(--bg-hover); }
  .ev-inv-nombre { font-size: 16px; }
  .ev-inv-meta { font-size: 13px; }
  .ev-inv-gente > span { font-size: 12.5px; padding: 3px 9px; }
  .ev-inv-lado { padding-top: 10px; border-top: 1px solid var(--border); }
  .ev-inv-nums { font-size: 13px; }
  .ev-inv-acc .ev-btn-wa { height: 40px; padding: 0 16px; border-radius: 20px; }
}

/* ═══════════════ Color por tipo de evento (fichas, pestañas y detalle) ═══════════════ */
[data-tipo] { --tipo: var(--accent); }
[data-tipo="1"] { --tipo: #e0607e; }   /* Boda */
[data-tipo="2"] { --tipo: #8b5cf6; }   /* XV años */
[data-tipo="3"] { --tipo: #2f9bd6; }   /* Bautizo */
[data-tipo="4"] { --tipo: #4f62d9; }   /* Graduación */
[data-tipo="5"] { --tipo: #e39a0b; }   /* Cumpleaños */
[data-tipo="6"] { --tipo: #64748b; }   /* Aniversario luctuoso */
[data-tipo="7"] { --tipo: #23a983; }   /* Baby shower */
[data-tipo="8"] { --tipo: #a874d8; }   /* Revelación de género */
[data-tipo] { --tipo-soft: color-mix(in srgb, var(--tipo) 13%, transparent); }

.ev-card[data-tipo] { position: relative; overflow: hidden; border-radius: 16px; }
.ev-card[data-tipo]::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tipo); }
.ev-card[data-tipo] .ev-card-ico { background: var(--tipo-soft); color: var(--tipo); }
.ev-card[data-tipo] .ev-card-tipo { color: var(--tipo); }
.ev-card[data-pasado="1"]::before { background: var(--border-strong); }
.ev-card[data-pasado="1"] .ev-card-tipo { color: var(--text-3); }
.ev-card-nums b { font-size: 24px; letter-spacing: -.02em; }
.ev-card .ev-barra { height: 9px; }
.ev-card:active { transform: scale(.985); }

.ev-tab[data-tipo] svg { color: var(--tipo); }
.ev-tab[data-tipo][aria-selected="true"] { background: var(--tipo); border-color: var(--tipo); color: #fff; }
.ev-tab[data-tipo][aria-selected="true"] svg { color: #fff; }
.ev-tab[data-tipo] .ev-tab-n { background: var(--tipo-soft); color: var(--tipo); border-color: transparent; }
.ev-tab[data-tipo][aria-selected="true"] .ev-tab-n { background: rgba(255,255,255,.24); color: #fff; border-color: transparent; }

.ev-det-tipo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--tipo-soft); color: var(--tipo) !important; flex: none; }

/* Números del evento con fondo de color */
.ev-tile { border-radius: 14px; }
.ev-tile[data-tono="verde"] { background: var(--green-soft); border-color: transparent; }
.ev-tile[data-tono="rojo"] { background: var(--red-soft); border-color: transparent; }
.ev-tile[data-tono="naranja"] { background: var(--orange-soft); border-color: transparent; }
.ev-tile[data-tono="verde"] .ev-tile-l, .ev-tile[data-tono="verde"] .ev-tile-s { color: var(--green); }
.ev-tile[data-tono="rojo"] .ev-tile-l, .ev-tile[data-tono="rojo"] .ev-tile-s { color: var(--red); }
.ev-tile[data-tono="naranja"] .ev-tile-l, .ev-tile[data-tono="naranja"] .ev-tile-s { color: var(--orange); }
.ev-tile[data-tono] .ev-tile-s { opacity: .8; }
.ev-tile[data-tono="verde"][data-activo="1"] { box-shadow: 0 0 0 2px var(--green); }
.ev-tile[data-tono="rojo"][data-activo="1"] { box-shadow: 0 0 0 2px var(--red); }
.ev-tile[data-tono="naranja"][data-activo="1"] { box-shadow: 0 0 0 2px var(--orange); }
.ev-tile b { font-size: 28px; }
.ev-avance .ev-barra { height: 10px; }

/* "Más": cuadritos de color como Ajustes del teléfono */
.pl-fila-ico { background: var(--fila, var(--accent)) !important; border-radius: 9px; box-shadow: inset 0 -1px 0 rgba(0,0,0,.12); }
.pl-mas-perfil { background: linear-gradient(135deg, var(--hp-blue) 0%, #1d3a60 100%); border-color: transparent; color: #fff;
  box-shadow: 0 12px 28px -14px rgba(12,32,57,.7); padding: 18px 16px; }
.pl-mas-perfil-t b { color: #fff; }
.pl-mas-perfil-t span { color: var(--hp-yellow); }
.pl-mas-perfil svg { color: rgba(255,255,255,.6); stroke: rgba(255,255,255,.6); }
.pl-mas-perfil .avatar, .pl-mas-perfil > :first-child { box-shadow: 0 0 0 3px rgba(242,196,180,.55); border-radius: 50%; }

/* ═══════════════ Celular: más marca y más app ═══════════════ */
@media (max-width: 768px) {
  /* Fondo durazno suave (solo en claro) */
  :root:not([data-theme="dark"]) .pl-main-movil, :root:not([data-theme="dark"]) .pl-hoja-fondo ~ * { --bg-subtle: #fbf3ef; --bg-hover: #f5e7e0; }
  :root:not([data-theme="dark"]) .pl-main-movil { --border: #f0e3dc; }

  /* Barra de arriba marino con título grande */
  .pl-topbar { background: var(--hp-blue); border-bottom: none; min-height: 58px; padding-right: 8px; }
  .pl-topbar-t { color: #fff; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
  .pl-topbar-atras { color: var(--hp-yellow); }
  .pl-topbar-acc .btn:not(.primary) { color: #fff; }
  .pl-topbar-acc .btn:not(.primary) svg { stroke: #fff; }
  .pl-topbar-acc .btn:not(.primary):active { background: rgba(255,255,255,.14); }
  .pl-topbar-acc > span { color: var(--hp-yellow) !important; }
  .pl-topbar-acc > span svg { stroke: var(--hp-yellow); }

  /* Inicio: el saludo de orilla a orilla, pegado arriba */
  .pl-main-movil[data-vista="home"] .hp-hero { margin: calc(-1 * (env(safe-area-inset-top) + 16px)) -16px 4px; padding: calc(env(safe-area-inset-top) + 28px) 22px 26px;
    border-radius: 0 0 28px 28px; box-shadow: 0 16px 30px -22px rgba(12,32,57,.8); }

  /* Pestaña activa en marino sólido */
  .pl-tab[aria-current="page"] { color: var(--accent); }
  .pl-tab[aria-current="page"] .pl-tab-ico { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
  .pl-tab[aria-current="page"] .pl-tab-l { font-weight: 700; }

  /* Botón flotante con círculo durazno detrás del + */
  .pl-topbar-acc .btn.primary { padding-left: 10px; background: var(--hp-blue); border-color: var(--hp-blue); }
  .pl-topbar-acc .btn.primary svg { box-sizing: content-box; width: 18px; height: 18px; padding: 7px; border-radius: 50%; background: var(--hp-yellow); stroke: var(--hp-blue); stroke-width: 2.6; }

  /* Tarjetas más suaves y redondas */
  .ev-card, .ev-inv, .mb-cliente, .ev-acceso, .fi-lista, .fi-grupos, .fi-kpi, .pl-grupo { border-radius: 16px; }
  .ev-card, .ev-inv, .ev-acceso, .fi-lista, .fi-grupos, .fi-kpi { box-shadow: 0 1px 2px rgba(12,32,57,.04), 0 6px 18px -10px rgba(12,32,57,.16); }
  .ev-inv:active, .ev-card:active, .pl-fila:active, .pl-mas-perfil:active { transform: scale(.985); transition: transform .08s; }
  .ev-tab { box-shadow: 0 1px 2px rgba(12,32,57,.05); }
  .ev-tab:not([data-tipo])[aria-selected="true"] { box-shadow: 0 6px 14px -8px var(--accent); }
}
