/* =========================================================
   Brian Vera · Fotografía — gestión de turnos, clientes y presupuestos
   ========================================================= */

:root {
  --brand: #7c9b9e;
  --brand-deep: #5b7b7f;
  --brand-ink: #3f5a5d;
  --brand-soft: #e5eded;
  --brand-tint: #f2f6f6;

  --ink: #1e2829;
  --text: #3a4648;
  --muted: #7c898a;
  --line: #e3e9e9;
  --bg: #ffffff;
  --surface: #f7f9f9;

  --amber: #b98a2f;
  --amber-soft: #fbf3e1;
  --blue: #5a7fb5;
  --blue-soft: #e8eff9;
  --green: #4f8d65;
  --green-soft: #e4f1e8;
  --red: #b95857;
  --red-soft: #f8e7e6;
  --gray: #8e9a9b;
  --gray-soft: #eef1f1;

  --card: #ffffff; /* fondo de tarjetas, campos y ventanas */
  --glass: rgba(255, 255, 255, 0.92); /* barras semitransparentes */
  --faint: #b9c3c4; /* textos y bordes muy tenues */
  --mix: #ffffff; /* base para aclarar los colores de cada tipo */
  --mix-ink: #1e2829; /* base para oscurecer esos colores en el texto */

  --r-xl: 32px;
  --r-lg: 24px;
  --r: 16px;
  --r-sm: 11px;
  --shadow: 0 1px 2px rgba(30, 40, 41, 0.04), 0 10px 30px -14px rgba(30, 40, 41, 0.14);
  --shadow-lg: 0 24px 60px -20px rgba(30, 40, 41, 0.3);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bar: 58px;
}

/* ---------- Modo noche (Ajustes → Pantalla) ----------
   Fondo gris verdoso oscuro y el verde del logo más vivo para que resalte. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --brand: #4f9ea3;
  --brand-deep: #8fd0d4;
  --brand-ink: #b9e6e8;
  --brand-soft: #24413f;
  --brand-tint: #1a2e2f;

  --ink: #eef5f5;
  --text: #cddadb;
  --muted: #8ea2a3;
  --line: #2b3b3d;
  --bg: #111a1b;
  --surface: #162123;
  --card: #1a2729;
  --glass: rgba(26, 39, 41, 0.92);
  --faint: #4f6265;
  --mix: #1a2729;
  --mix-ink: #eef5f5;

  --amber: #d4a548;
  --amber-soft: #3a3020;
  --blue: #7d9fd1;
  --blue-soft: #1f2a3a;
  --green: #5fae7b;
  --green-soft: #1d3326;
  --red: #d27674;
  --red-soft: #3a2222;
  --gray: #8e9a9b;
  --gray-soft: #233032;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}
/* La hoja del presupuesto sigue blanca, como sale impresa */
:root[data-theme='dark'] .doc {
  color-scheme: light;
  --brand: #7c9b9e;
  --brand-deep: #5b7b7f;
  --brand-ink: #3f5a5d;
  --brand-soft: #e5eded;
  --brand-tint: #f2f6f6;
  --ink: #1e2829;
  --text: #3a4648;
  --muted: #7c898a;
  --line: #e3e9e9;
  --surface: #f7f9f9;
  --card: #ffffff;
  --green: #4f8d65;
  --green-soft: #e4f1e8;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 500; line-height: 1.15; }
h1 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
.i { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 40px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 6px;
  font-weight: 500;
}

/* =========================================================
   Pantalla de inicio (splash)
   ========================================================= */
#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--card);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 0.25s ease-out, visibility 0.25s;
}
#splash.out { opacity: 0; visibility: hidden; }
/* Primera pantalla: ocupa todo el alto; abajo sigue la biografía */
.splash-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
}
.splash-stage {
  position: relative;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease-out;
}
#splash.out .splash-stage { transform: scale(1.06); }

.splash-mark {
  --w: min(58vw, 290px);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--w);
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.5s var(--ease);
}
.splash-mark:hover { transform: scale(1.03); }
.splash-mark:active { transform: scale(0.97); }
.splash-mark:focus-visible { outline-offset: 18px; border-radius: 24px; }

.mark-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 259 / 188;
}

/* "BRIAN VERA" y "— FOTOGRAFÍA —" debajo, como en el logo completo */
.mark-name,
.mark-sub {
  display: block;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  animation: text-in 0.9s var(--ease) forwards;
}
.mark-name {
  margin-top: calc(var(--w) * 0.13);
  font-size: calc(var(--w) * 0.083);
  letter-spacing: 0.34em;
  margin-right: -0.34em; /* compensa el tracking del último caracter */
  animation-delay: 1.9s;
}
.mark-sub {
  display: flex;
  align-items: center;
  gap: 1.6em;
  margin-top: calc(var(--w) * 0.055);
  font-size: calc(var(--w) * 0.038);
  letter-spacing: 0.4em;
  animation-delay: 2.15s;
}
.mark-sub::before,
.mark-sub::after {
  content: '';
  width: 3.6em;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}
.mark-sub::after { margin-left: -0.4em; }
@keyframes text-in {
  from { opacity: 0; transform: translateY(8px); letter-spacing: 0.6em; }
  to { opacity: 1; transform: none; }
}

/* El logo se arma, rebota y después queda "respirando" (en un wrapper
   para no pisar el scale del botón en hover) */
.mark-inner {
  position: absolute;
  inset: 0;
  transform-origin: 50% 95%;
  animation: jelly 1s ease-in-out 1.85s both, breathe 4.6s ease-in-out 2.9s infinite;
}

.splash-hint {
  position: absolute;
  top: calc(100% + 26px);
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: hint-in 0.8s var(--ease) 3s forwards, hint-pulse 2.8s ease-in-out 3.8s infinite;
  transition: opacity 0.3s;
  pointer-events: none;
}
#splash.touched .splash-hint { animation: none; opacity: 0; }

/* Contacto al costado: WhatsApp e Instagram */
.splash-social {
  position: absolute;
  right: max(28px, env(safe-area-inset-right));
  top: 50%;
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.splash-social::before,
.splash-social::after {
  content: '';
  width: 1px;
  height: 44px;
  background: var(--line);
  opacity: 0;
  animation: hint-in 0.8s var(--ease) 2.6s forwards;
}
.splash-social a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand-deep);
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  opacity: 0;
  animation: social-in 0.7s var(--ease) forwards;
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.splash-social a:nth-child(1) { animation-delay: 2.4s; }
.splash-social a:nth-child(2) { animation-delay: 2.55s; }
.splash-social a .i { width: 22px; height: 22px; }
.splash-social a:hover,
.splash-social a:focus-visible { background: var(--brand); color: #fff; transform: scale(1.08); }
@keyframes social-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}

/* En celular, más compactos y con el logo un poco más chico para que no se toquen */
@media (max-width: 560px) {
  .splash-mark { --w: min(52vw, 290px); }
  .splash-social { right: max(14px, env(safe-area-inset-right)); gap: 10px; }
  .splash-social a { width: 42px; height: 42px; }
  .splash-social a .i { width: 20px; height: 20px; }
  .splash-social::before,
  .splash-social::after { height: 32px; }
}

/* Menú de la portada: botón al costado izquierdo y panel que se desliza */
.splash-menu {
  position: absolute;
  left: max(28px, env(safe-area-inset-left));
  top: 50%;
  translate: 0 -50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand-deep);
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  opacity: 0;
  animation: menu-in 0.7s var(--ease) 2.4s forwards;
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.splash-menu .i { width: 22px; height: 22px; }
.splash-menu:hover,
.splash-menu:focus-visible { background: var(--brand); color: #fff; transform: scale(1.08); }
@keyframes menu-in {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}

/* "Conocé mi historia": invita a bajar hasta la biografía */
.splash-down {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 0;
  background: none;
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: hint-in 0.8s var(--ease) 3.2s forwards;
  -webkit-tap-highlight-color: transparent;
}
.splash-down .i { width: 20px; height: 20px; color: var(--brand); animation: bajar 2.2s ease-in-out 4s infinite; }
.splash-down:hover { color: var(--brand-deep); }
@keyframes bajar {
  0%, 100% { transform: none; }
  50% { transform: translateY(5px); }
}

/* Biografía: la foto queda fija ocupando toda la pantalla y el texto sube por encima */
.splash-bio { position: relative; }
.bio-photo {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  background: #a9b6ba;
}
.bio-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
/* En pantallas anchas la foto (vertical) no se estira: se muestra entera a lo alto,
   corrida a la derecha para que la biografía (a la izquierda) no la tape,
   y los costados continúan el fondo gris del estudio, fundido con los bordes */
@media (orientation: landscape) {
  .bio-photo {
    display: flex;
    justify-content: flex-end;
    padding-right: 6vw;
    background: linear-gradient(to right, #666b68, #8c9a99 62%, #8fa5a3 78%, #97a6a8);
  }
  .bio-photo img {
    width: auto;
    max-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  }
}
.bio-text {
  position: relative;
  margin-top: -100vh;
  margin-top: -100svh;
  padding: 72vh max(20px, 6vw) 12vh;
}
.bio-card {
  max-width: 560px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--r-xl);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
}
.bio-card h2 {
  margin-bottom: 22px;
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 300;
  letter-spacing: 0.04em;
}
.bio-card p + p { margin-top: 16px; }
.bio-card blockquote {
  margin: 26px 0 0;
  padding-left: 18px;
  border-left: 2px solid var(--brand);
  font-size: 18px;
  font-style: italic;
  color: var(--ink);
}
.bio-card .sp-contacto { justify-content: flex-start; margin-top: 30px; }
.bio-cal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand-deep);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.bio-cal:hover { color: var(--brand-ink); }

.splash-scrim {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: rgba(30, 40, 41, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.splash-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: min(320px, 84vw);
  display: flex;
  flex-direction: column;
  padding: max(34px, env(safe-area-inset-top)) 30px max(30px, env(safe-area-inset-bottom)) max(30px, env(safe-area-inset-left));
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0.45s;
}
#splash.drawer-open .splash-scrim { opacity: 1; visibility: visible; }
#splash.drawer-open .splash-drawer { transform: none; visibility: visible; }

.drawer-brand { display: flex; align-items: center; gap: 12px; color: var(--brand); }
.drawer-brand img { width: 46px; }
.drawer-brand span {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1.3;
}
.drawer-brand small { font-size: 9.5px; letter-spacing: 0.34em; color: var(--muted); }

.drawer-nav { display: flex; flex-direction: column; margin-top: 44px; }
.drawer-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font-size: 22px;
  font-weight: 300;
  text-align: left;
  letter-spacing: 0.01em;
  transition: color 0.2s, padding 0.3s var(--ease);
}
.drawer-nav button::after { content: '→'; color: var(--brand); opacity: 0; transition: opacity 0.2s; }
.drawer-nav button:hover,
.drawer-nav button:focus-visible { color: var(--brand-deep); padding-left: 6px; }
.drawer-nav button:hover::after,
.drawer-nav button:focus-visible::after { opacity: 1; }
.drawer-entrar {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 0;
  border: 0;
  background: none;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer-entrar:hover { color: var(--brand-deep); }
/* Los clientes ven solo la portada: sin invitación a entrar a la app */
body:not(.es-brian) .splash-hint,
body:not(.es-brian) .drawer-entrar { display: none; }
body:not(.es-brian) .splash-mark { cursor: default; }
/* La ventana de acceso de Brian va por encima de la portada */
.modal-backdrop.sobre-portada { z-index: 1100; }
.acceso-error { margin: 0; color: var(--red); font-size: 14px; }
.ajustes-sub { margin-top: 22px; }

/* Páginas del menú (Acerca de mí, Calendario): ocupan toda la pantalla */
.splash-page {
  position: fixed;
  inset: 0;
  z-index: 6;
  overflow-y: auto;
  background: var(--card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease-out, transform 0.4s var(--ease), visibility 0.3s;
}
.splash-page.open { opacity: 1; visibility: visible; transform: none; }
.sp-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  background: var(--glass);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.sp-logo { width: 34px; }
.sp-title { font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--brand-deep); }
.sp-body { max-width: 1280px; margin: 0 auto; padding: 32px 20px 60px; }

.sp-contacto { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }

/* Calendario grande de eventos */
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.cal-head h1 { font-weight: 300; font-size: clamp(30px, 5vw, 48px); }
.cal-head h1 span { color: var(--muted); }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cal-dow {
  padding: 10px 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.cal-day {
  min-height: 150px;
  padding: 8px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.cal-day.fuera { background: var(--surface); }
.cal-day.fuera .cal-num { color: var(--faint); }
.cal-day.con-ev { cursor: pointer; }
.cal-day.con-ev:hover { background: var(--brand-tint); }
.cal-num { padding: 0 10px; font-size: 14px; color: var(--ink); }
.cal-day.hoy .cal-num {
  align-self: flex-start;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.cal-esp {
  padding: 0 10px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--brand-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev {
  margin: 0 -1px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: var(--c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev.ini { margin-left: 6px; border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.cal-ev.fin { margin-right: 6px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
/* Día con foto de evento: la foto de fondo y lo escrito por encima */
.cal-day { position: relative; }
.cal-day > :not(.cal-day-foto) { position: relative; }
.cal-day-foto { position: absolute; inset: 0; background: center / cover no-repeat; }
.cal-day-foto::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.25)); }
.cal-day.con-foto .cal-num,
.cal-day.con-foto .cal-esp { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.cal-day.con-foto .cal-ev { margin-top: auto; }
.cal-day.con-foto:hover .cal-day-foto { filter: brightness(1.08); }

/* Ventana con la información de los eventos del día tocado */
.cal-pop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(30, 40, 41, 0.45);
  animation: fade-in 0.2s ease-out;
}
.cal-pop-box {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  animation: modal-in 0.25s var(--ease);
}
.cal-pop-x { position: sticky; top: 0; float: right; z-index: 1; margin: 0 0 -40px; background: var(--card); }
.cal-card {
  position: relative;
  padding: 18px 20px 18px 24px;
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.cal-card + .cal-card { margin-top: 12px; }
.cal-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.cal-card-foto { margin-bottom: 14px; border-radius: var(--r-sm); overflow: hidden; background: var(--card); }
.cal-card-foto img { display: block; width: 100%; max-height: min(460px, 55svh); object-fit: contain; }
.cal-card-fecha { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cal-card h3 { margin: 4px 0 6px; font-size: 19px; font-weight: 500; }
.cal-card-det { white-space: pre-line; margin-bottom: 12px; }
.cal-card-cta { display: flex; justify-content: center; margin-top: 16px; }

/* Ajustes: lista de eventos del calendario */
.camp-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 18px; }
.camp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  text-align: left;
}
.camp-row:hover { border-color: var(--brand); }
.camp-row.pasado { opacity: 0.55; }
.camp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.camp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.camp-main small { color: var(--muted); }
.camp-row .i { color: var(--muted); }
.acerca-label { display: flex; flex-direction: column; gap: 6px; }
.camp-foto { display: flex; flex-direction: column; gap: 8px; }
.camp-foto-prev { border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.camp-foto-prev img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.camp-foto-btns { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 560px) {
  .splash-menu { left: max(14px, env(safe-area-inset-left)); width: 42px; height: 42px; }
  .splash-menu .i { width: 20px; height: 20px; }
  .sp-body { padding: 22px 12px 48px; }
  .bio-text { padding: 78svh 12px 10svh; }
  .bio-card { padding: 26px 22px; border-radius: var(--r-lg); font-size: 15.5px; line-height: 1.7; }
  .bio-card blockquote { font-size: 16.5px; }
  .cal-head { align-items: center; }
  .cal-dow { padding: 8px 0; text-align: center; font-size: 9.5px; letter-spacing: 0.08em; }
  .cal-day { min-height: 78px; padding: 5px 0; gap: 2px; }
  .cal-num { padding: 0; text-align: center; font-size: 13px; }
  .cal-day.hoy .cal-num { align-self: center; margin: 0; }
  /* En el celu: la fecha especial es un puntito y los eventos, barritas sin texto */
  .cal-esp { align-self: center; width: 5px; height: 5px; padding: 0; border-radius: 50%; background: var(--brand); font-size: 0; }
  .cal-ev { height: 6px; padding: 0; font-size: 0; }
  .cal-ev.ini { margin-left: 3px; }
  .cal-ev.fin { margin-right: 3px; }
}

.piece {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: transform, opacity;
}
.piece-b {
  transform-origin: 26% 96%;
  animation: rise-b 1s cubic-bezier(0.25, 0.9, 0.3, 1.15) 0.2s forwards;
}
.piece-v {
  transform-origin: 73% 92%;
  animation: pop-v 0.95s cubic-bezier(0.25, 0.9, 0.3, 1.15) 0.6s forwards;
}
.piece-dot {
  transform-origin: 93.5% 89%;
  animation: drop-dot 0.85s cubic-bezier(0.33, 0, 0.3, 1) 1.1s forwards,
    hop 3.8s cubic-bezier(0.33, 0, 0.3, 1) 4.2s infinite;
}

@keyframes rise-b {
  0%   { opacity: 0; transform: translateY(14%) scale(0.5, 0.08); }
  30%  { opacity: 1; transform: translateY(0) scale(0.86, 1.16); }
  55%  { transform: scale(1.07, 0.93); }
  78%  { transform: scale(0.98, 1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes pop-v {
  0%   { opacity: 0; transform: scale(0.15) rotate(-16deg); }
  40%  { opacity: 1; transform: scale(1.12, 0.9) rotate(4deg); }
  68%  { transform: scale(0.96, 1.05) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes drop-dot {
  0%   { opacity: 0; transform: translateY(-140%); }
  15%  { opacity: 1; }
  48%  { transform: translateY(0) scale(1.35, 0.62); }
  66%  { transform: translateY(-18%) scale(0.92, 1.08); }
  82%  { transform: translateY(0) scale(1.08, 0.93); }
  100% { opacity: 1; transform: none; }
}
@keyframes jelly {
  0%, 100% { transform: none; }
  25% { transform: scale(1.035, 0.965); }
  50% { transform: scale(0.985, 1.02); }
  75% { transform: scale(1.008, 0.994); }
}
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3%) scale(1.02, 0.99); }
}
@keyframes hop {
  0%, 62%, 100% { transform: none; }
  68% { transform: translateY(0) scale(1.25, 0.75); }
  78% { transform: translateY(-85%) scale(0.9, 1.1); }
  88% { transform: translateY(0) scale(1.15, 0.85); }
  94% { transform: scale(0.97, 1.03); }
}
@keyframes hint-in { to { opacity: 1; } }
@keyframes hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* La app aparece cuando se va el splash */
#app { transition: opacity 0.25s ease-out, transform 0.25s ease-out; }
body.is-loading #app { opacity: 0; transform: translateY(6px); }

/* =========================================================
   Layout
   ========================================================= */
/* Encabezado: logo a la izquierda y saludo a la derecha */
.topbar { background: var(--brand); color: #fff; }
/* Logo y textos en blanco sobre el color de la marca */
.topbar .brand img { filter: brightness(0) invert(1); }
.topbar .brand span,
.topbar .brand small,
.topbar .greet .eyebrow,
.topbar .greet-hi { color: #fff; }
.topbar .brand small,
.topbar .greet .eyebrow { opacity: 0.85; }
.topbar .brand:focus-visible { outline-color: #fff; }
.topbar-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.greet { text-align: right; min-width: 0; }
.greet .eyebrow { margin-bottom: 4px; }
.greet-hi {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand img { width: 46px; }
.brand span {
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brand-deep);
  line-height: 1.3;
  font-weight: 500;
}
.brand small { display: block; font-size: 9.5px; letter-spacing: 0.32em; color: var(--muted); font-weight: 400; }

/* Opciones debajo de una línea, repartidas a lo ancho de toda la pantalla.
   Queda fija arriba al bajar. */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--bar);
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.nav a {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.nav a + a { border-left: 1px solid var(--line); }
.nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.3s var(--ease), left 0.3s var(--ease);
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.active { color: var(--brand-ink); background: var(--brand-tint); }
.nav a.active::after { left: 0; width: 100%; }
.nav a.active .i { color: var(--brand-deep); }

#view {
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 52px) 72px;
  max-width: 1320px;
  min-height: calc(100vh - var(--bar));
}
#view.enter { animation: view-in 0.45s var(--ease); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  margin-left: -4px;
}
.back:hover { color: var(--brand-deep); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* =========================================================
   Controles
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 14.5px;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
/* Secundarios: verdecito con borde del logo (antes blancos, se perdían en el fondo) */
.btn-ghost { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-ink); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand-deep); color: var(--brand-ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }
.btn-danger-ghost { background: none; border: 0; color: var(--red); padding: 0 8px; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 12px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--brand);
  background: var(--brand-tint);
  display: inline-grid;
  place-items: center;
  color: var(--brand-ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex: none;
}
.icon-btn:hover { background: var(--brand-soft); border-color: var(--brand-deep); color: var(--brand-ink); }
.icon-btn.solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-btn.solid:hover { background: var(--brand-deep); color: #fff; }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.icon-btn.sm { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); }
.icon-btn.sm:hover { background: var(--surface); color: var(--red); }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-deep);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.link:hover { color: var(--brand-ink); }
.link .i { width: 16px; height: 16px; }

.seg {
  display: inline-flex;
  background: var(--brand-tint);
  border: 1px solid var(--brand);
  border-radius: 999px;
  padding: 3px;
}
.seg button {
  border: 0;
  background: none;
  padding: 0 16px;
  height: 34px;
  border-radius: 999px;
  color: var(--brand-ink);
  font-weight: 500;
  font-size: 14px;
}
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(30, 40, 41, 0.12); }
.seg-sm button { height: 30px; padding: 0 14px; font-size: 13px; }
.nav-arrows { display: flex; align-items: center; gap: 6px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink);
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.search {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 240px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.search input { border: 0; padding: 0; box-shadow: none !important; background: none; }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -8px 0 22px; }
.filter-chips button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand-tint);
  font-size: 13.5px;
  color: var(--brand-ink);
}
.filter-chips button:hover { color: var(--ink); }
.filter-chips button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Estados */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pill.st-pendiente { background: var(--amber-soft); color: var(--amber); }
.pill.st-confirmado { background: var(--brand-soft); color: var(--brand-ink); }
.pill.st-senado { background: var(--blue-soft); color: var(--blue); }
.pill.st-realizado { background: var(--green-soft); color: var(--green); }
.pill.st-cancelado { background: var(--gray-soft); color: var(--gray); }
.pill.st-borrador { background: var(--gray-soft); color: var(--text); }

.tag {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.count-badge {
  font-size: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 4px;
}

/* =========================================================
   Inicio
   ========================================================= */
.hello {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}
.hello h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 400; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Sesiones y decoraciones ---------- */
/* Selector Sesión / Decoración */
.rubro-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.rubro-toggle label { position: relative; display: block; cursor: pointer; }
.rubro-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.rubro-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: var(--r);
  border: 1.5px solid var(--brand);
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.rubro-toggle .i { width: 20px; height: 20px; }
.rubro-toggle input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.rubro-toggle input:focus-visible + span { outline: 2px solid var(--brand-ink); outline-offset: 2px; }

/* Rayado: así se reconoce una deco en la agenda, sin perder el color del evento */
.chip.is-deco,
.week-ev.is-deco,
.tipo-leyenda span.is-deco,
.checklist li.is-deco {
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--c, var(--brand)) 26%, transparent) 6px 11px);
}
.turno.is-deco::before { background: repeating-linear-gradient(180deg, var(--c, var(--brand)) 0 6px, transparent 6px 9px); }
.dots i.is-deco { border-radius: 2px; transform: rotate(45deg) scale(0.9); }
.tipo-leyenda span.is-deco i { border-radius: 3px; transform: rotate(45deg) scale(0.85); }
.turno-tipo .i { width: 15px; height: 15px; color: var(--c, var(--brand)); }
.turno.is-deco .turno-tipo::before { display: none; }

.rubro-filtro { display: flex; margin: -8px 0 14px; }
/* Aviso de "Todo": liso = sesión, rayado = deco */
.rubro-hint { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 20px; font-size: 13.5px; color: var(--text); }
.rubro-hint span { display: inline-flex; align-items: center; gap: 7px; }
.rubro-hint .i { width: 16px; height: 16px; color: var(--brand-deep); }
.rubro-hint i { width: 34px; height: 16px; border-radius: 5px; border-left: 3px solid var(--brand); background-color: color-mix(in srgb, var(--brand) 22%, var(--mix)); }
.rubro-hint .rh-rayado { background-image: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--brand) 40%, transparent) 5px 9px); }
.ley-titulo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.ley-titulo .i { width: 16px; height: 16px; }
.rubro-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 11.5px;
  font-weight: 500;
}
.rubro-tag .i { width: 13px; height: 13px; }
.doc-tema { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Recordatorios ---------- */
/* Tarjeta "Hoy" de Inicio con checklist */
.hoy-card { margin-top: 22px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li {
  display: grid;
  grid-template-columns: auto 52px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  border-left: 5px solid var(--c, var(--brand));
  transition: opacity 0.2s, background-color 0.2s;
}
.checklist .check {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 2px solid var(--c, var(--brand));
  background: var(--card);
  color: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background-color 0.15s, color 0.15s;
}
.checklist .check .i { width: 18px; height: 18px; stroke-width: 2.6; }
.checklist li.done { opacity: 0.6; background: var(--surface); }
.checklist li.done .check { background: var(--c, var(--brand)); color: #fff; }
.checklist li.done .ck-main b { text-decoration: line-through; }
.ck-hora { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ck-main { display: flex; flex-direction: column; min-width: 0; text-align: left; padding: 0; border: 0; background: none; }
.ck-main b { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-main small { color: var(--muted); font-size: 12.5px; }

/* Avisos flotantes cuando llega la hora */
#avisos {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.aviso {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px 16px;
  border-radius: var(--r);
  background: var(--brand-ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: aviso-in 0.4s var(--ease);
}
.aviso-txt { display: flex; flex-direction: column; gap: 2px; }
.aviso-txt b { font-weight: 500; }
.aviso-txt small { opacity: 0.8; }
.aviso-btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aviso .btn-primary { background: #fff; color: var(--brand-ink); }
.aviso .icon-btn { color: #fff; border-color: rgba(255, 255, 255, 0.35); background: transparent; }
@keyframes aviso-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 560px) {
  #avisos { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Copia de seguridad */
.backup-card { border: 2px solid var(--brand); }
.backup-card.is-vencida { border-color: var(--amber); }
.backup-estado {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--green-soft);
  color: var(--green);
}
.backup-estado .i { width: 22px; height: 22px; flex: none; }
.backup-estado div { display: flex; flex-direction: column; }
.backup-estado b { font-weight: 500; color: var(--ink); }
.backup-estado small { color: var(--muted); font-size: 12.5px; }
.is-vencida .backup-estado { background: var(--amber-soft); color: var(--amber); }
.backup-freq { max-width: 280px; margin-bottom: 10px; }
/* Un <label> con estilo de botón (para elegir archivo) va en fila, como los demás botones */
label.btn { flex-direction: row; gap: 8px; cursor: pointer; }

/* Ajustes */
.notif-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 10px; }
.notif-on { display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.notif-on .i { width: 16px; height: 16px; }

/* Accesos rápidos de Inicio: tarjetas grandes del color del logo */
.quick-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 210px;
  padding: 28px;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--brand);
  color: #fff;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(63, 90, 93, 0.7);
  /* Solo se animan transform/scale (baratos); la sombra queda fija */
  transition: transform 0.3s var(--ease), background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .quick-card:hover { transform: translateY(-4px); background-color: var(--brand-deep); }
}

/* Animación al tocar: la tarjeta se hunde y rebota (con `scale`, que no pisa el
   translate del hover), y sale una onda de luz desde el dedo */
.quick-card.press { animation: card-press 0.3s cubic-bezier(0.3, 1.5, 0.5, 1); }
.quick-card.press .qc-icon { animation: icon-pop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.quick-card.press .qc-plus { background: #fff; color: var(--brand-deep); transform: rotate(90deg); }
.qc-plus { transition: background-color 0.2s, color 0.2s, transform 0.3s var(--ease); }
/* La onda nace con su tamaño final y se escala de 0 a 1: se pinta una sola vez */
.qc-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  transform: scale(0);
  will-change: transform, opacity;
  animation: ripple 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes card-press {
  0%, 100% { scale: 1; }
  40% { scale: 0.96; }
}
@keyframes icon-pop {
  0%, 100% { scale: 1; }
  40% { scale: 0.82; }
}
@keyframes ripple {
  to { transform: scale(1); opacity: 0; }
}
.quick-card:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 3px; }
.qc-icon {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}
.qc-icon .i { width: 30px; height: 30px; }
.qc-text { position: relative; display: flex; flex-direction: column; gap: 6px; }
.qc-text b { font-size: 24px; font-weight: 500; line-height: 1.15; }
.qc-text small { font-size: 14.5px; opacity: 0.85; }
.qc-plus {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  transition: background 0.3s, color 0.3s;
}
.quick-card:hover .qc-plus { background: #fff; color: var(--brand-deep); }
@media (max-width: 900px) {
  .quick-cards { grid-template-columns: 1fr; gap: 12px; }
  .quick-card { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; padding: 22px; }
  .qc-icon { width: 54px; height: 54px; flex: none; }
  .qc-text b { font-size: 20px; }
  .qc-plus { position: static; margin-left: auto; flex: none; }
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s var(--ease), background 0.2s;
}
a.stat:hover { transform: translateY(-2px); background: var(--brand-tint); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat b { font-size: 32px; font-weight: 500; color: var(--ink); line-height: 1.1; }
.stat small { color: var(--muted); font-size: 13px; }
.stat.accent { background: var(--brand); }
.stat.accent .stat-label, .stat.accent small { color: rgba(255, 255, 255, 0.82); }
.stat.accent b { color: #fff; }
a.stat.accent:hover { background: var(--brand-deep); }
.stats-3 .stat b { font-size: 26px; }

.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }

.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 14px;
  justify-content: space-between;
  font-size: 14px;
}
.mini-row + .mini-row { border-top: 1px solid var(--line); }
.mini-row:hover { background: var(--surface); }
.mini-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mini-main b { font-weight: 500; color: var(--ink); }
.mini-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-right { display: flex; align-items: center; gap: 8px; flex: none; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 44% 56% 52% 48% / 55% 45% 55% 45%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

/* =========================================================
   Turnos
   ========================================================= */
.turno-list { display: flex; flex-direction: column; gap: 8px; }
.turno {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.turno::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c, var(--brand));
}
.turno:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.turno-time { display: flex; flex-direction: column; min-width: 50px; font-size: 14px; line-height: 1.25; }
.turno-time b { color: var(--ink); font-weight: 600; }
.turno-time small { color: var(--muted); font-size: 12px; }
.turno-date { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-deep); margin-bottom: 2px; }
.turno-main { display: flex; flex-direction: column; min-width: 0; }
.turno-main strong { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turno-main .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turno::before { width: 5px; }
.turno-tipo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: color-mix(in srgb, var(--c) 70%, var(--mix-ink));
}
.turno-tipo::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.turno.st-cancelado { --c: var(--gray); opacity: 0.65; }
.turno.st-cancelado strong { text-decoration: line-through; }

/* =========================================================
   Agenda
   ========================================================= */
.agenda-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.cal { padding: 10px; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head span {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 0 10px;
}
.cal-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  touch-action: manipulation; /* sin zoom por doble toque: lo usamos para agendar */
  user-select: none;
  min-height: 112px;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: var(--surface);
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
}
.cal-cell:hover { background: var(--brand-tint); }
.cal-cell.out { background: none; }
.cal-cell.out .num { color: var(--faint); }
.cal-cell.sel { border-color: var(--brand); background: var(--card); }
.cal-cell .num {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.cal-cell.today .num { background: var(--brand); color: #fff; }
.chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip {
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  --c: var(--brand);
  background: color-mix(in srgb, var(--c) 20%, var(--mix));
  color: color-mix(in srgb, var(--c) 62%, var(--mix-ink));
  border-left: 3px solid var(--c);
}
.chip b { font-weight: 600; }
.chip.st-cancelado { opacity: 0.55; text-decoration: line-through; }
.more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.dots { display: none; gap: 3px; justify-content: center; margin-top: auto; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--brand)); }
.dots i.st-cancelado { opacity: 0.35; }

.day-panel { position: sticky; top: calc(var(--bar) + 24px); }
.day-panel .turno, .side-stack .turno { grid-template-columns: auto 1fr; }
.day-panel .turno .pill, .side-stack .turno .pill { grid-column: 2; justify-self: start; margin-top: -6px; }
.day-panel .turno-main strong, .side-stack .turno-main strong { white-space: normal; }
.day-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.day-panel-head h3 { font-size: 22px; font-weight: 500; }
.empty-mini {
  padding: 26px 16px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.week { padding: 0; overflow: hidden; }
.week-scroll { max-height: min(72vh, 760px); overflow: auto; }
.week-grid {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(108px, 1fr));
  min-width: 820px;
}
.week-corner, .week-dayhead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.week-dayhead { padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.week-dayhead span { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.week-dayhead b {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.week-dayhead.today b { background: var(--brand); color: #fff; }
.week-hours { display: flex; flex-direction: column; }
.week-hours span {
  height: var(--px);
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  padding-right: 8px;
  transform: translateY(-7px);
}
.week-hours span:first-child { visibility: hidden; }
.week-col { position: relative; border-left: 1px solid var(--line); }
.week-col.today { background: var(--brand-tint); }
.slot { height: var(--px); border-top: 1px solid var(--line); cursor: pointer; transition: background 0.15s; }
.slot:first-child { border-top: 0; }
.slot:hover { background: rgba(124, 155, 158, 0.1); }
.week-ev {
  position: absolute;
  border: 0;
  border-left: 4px solid var(--c, var(--brand));
  background: color-mix(in srgb, var(--c, var(--brand)) 22%, var(--mix));
  border-radius: 9px;
  padding: 5px 8px;
  text-align: left;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(30, 40, 41, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 1;
}
.week-ev:hover { transform: scale(1.02); box-shadow: var(--shadow); z-index: 2; }
.week-ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-ev.st-cancelado { opacity: 0.5; text-decoration: line-through; }

/* Referencia de colores por tipo de evento */
.tipo-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.tipo-leyenda span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: color-mix(in srgb, var(--c) 60%, var(--mix-ink));
  background: color-mix(in srgb, var(--c) 14%, var(--mix));
}
.tipo-leyenda i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
@media (max-width: 560px) {
  .tipo-leyenda { gap: 6px; }
  .tipo-leyenda span { font-size: 12.5px; padding: 5px 11px 5px 8px; gap: 6px; }
  .tipo-leyenda i { width: 11px; height: 11px; }
}
.tipo-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--c);
  vertical-align: middle;
}

.list-tools { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.list-group { margin-bottom: 24px; max-width: 820px; }
.list-group h4 {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}
.list-group h4.is-today { color: var(--brand-deep); }

/* =========================================================
   Clientes
   ========================================================= */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
/* Fichas con borde y fondo del color del logo para que no se pierdan en el blanco */
.client-card {
  border-radius: var(--r-lg);
  background: var(--brand-tint);
  border: 2px solid var(--brand);
  overflow: hidden;
  box-shadow: 0 10px 26px -18px rgba(63, 90, 93, 0.55);
  transition: transform 0.3s var(--ease), border-color 0.2s;
}
.client-card:hover { transform: translateY(-4px); border-color: var(--brand-deep); }
.client-card .cover { position: relative; aspect-ratio: 4 / 3; background: var(--brand-soft); overflow: hidden; border-bottom: 2px solid var(--brand); }
.client-card .cover-empty span { background: var(--brand); color: #fff; }
.client-card .client-info h3 { color: var(--brand-ink); }
.client-card .tag { background: var(--card); border: 1px solid var(--brand-soft); }
.client-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.client-card:hover .cover img { transform: scale(1.05); }
.cover-empty { width: 100%; height: 100%; display: grid; place-items: center; }
.cover-empty span {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 26px;
  font-weight: 500;
  border-radius: 44% 56% 58% 42% / 52% 40% 60% 48%;
}
.count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: blur(6px);
}
.count .i { width: 14px; height: 14px; }
.client-info { padding: 16px 18px 18px; }
.client-info h3 { font-size: 17px; margin-bottom: 2px; }
.client-info p { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-info .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.client-info .meta span { display: inline-flex; align-items: center; gap: 5px; }
.client-info .meta .i { width: 14px; height: 14px; }

.client-hero {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
}
.hero-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--brand-tint);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-info h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 400; }
.lead { font-size: 18px; color: var(--muted); margin-top: 6px; }
.meta-list { list-style: none; padding: 0; margin: 18px 0 22px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.meta-list li { display: inline-flex; align-items: center; gap: 7px; }
.meta-list .i { color: var(--brand-deep); width: 16px; height: 16px; }
.meta-list a:hover { color: var(--brand-deep); text-decoration: underline; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Saldo en la tarjeta de la lista de clientes */
.client-info .meta .saldo { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.saldo.debe { background: var(--amber-soft); color: #8a6519; }
.saldo.al-dia { background: var(--green-soft); color: var(--green); }

/* ---------- Caja del cliente ---------- */
.caja { margin-bottom: 18px; }
.caja-resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 12px; }
.caja-resumen > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface);
}
.caja-resumen span { font-size: 12.5px; color: var(--muted); }
.caja-resumen b { font-size: 24px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.caja-resumen b.ok { color: var(--green); }
.caja-resumen .debe { background: var(--amber-soft); }
.caja-resumen .debe b { color: #8a6519; }
.caja-resumen .al-dia { background: var(--green-soft); }
.caja-resumen .al-dia b { color: var(--green); }

.caja-bar { height: 6px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.caja-bar.big { height: 8px; margin-bottom: 20px; }
.caja-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width 0.5s var(--ease); }
.is-pagado .caja-bar i { background: var(--green); }

.caja-list { display: flex; flex-direction: column; gap: 12px; }
.caja-presu {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.caja-presu.is-pagado { border-color: color-mix(in srgb, var(--green) 35%, var(--mix)); background: color-mix(in srgb, var(--green-soft) 45%, var(--mix)); }
.caja-presu.is-sin-confirmar { border-style: dashed; }
.caja-presu header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.caja-presu-title { color: var(--ink); font-size: 15.5px; }
.caja-presu-title:hover { color: var(--brand-deep); }
.caja-presu-title b { font-weight: 600; margin-right: 4px; }
.caja-presu .pill .i { width: 13px; height: 13px; margin-right: 3px; }
.caja-nums { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--muted); }
.caja-nums b { color: var(--ink); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.caja-movs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.caja-movs li {
  display: grid;
  grid-template-columns: 140px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
}
.mov-fecha { color: var(--muted); white-space: nowrap; }
.mov-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mov-monto { color: var(--green); font-weight: 500; font-variant-numeric: tabular-nums; }
.caja-movs .icon-btn { opacity: 0.5; }
.caja-movs li:hover .icon-btn { opacity: 1; }
.caja-empty { margin: 0; }
.caja-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .caja-resumen { grid-template-columns: 1fr 1fr; }
  .caja-resumen > div:last-child { grid-column: span 2; }
  .caja-resumen b { font-size: 20px; }
  .caja-movs li { grid-template-columns: 1fr auto auto; }
  .mov-fecha { grid-column: 1 / -1; font-size: 12px; margin-bottom: -6px; }
  .caja-actions .btn { flex: 1; }
}

.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 18px; }
.notes { white-space: pre-wrap; font-size: 14px; margin-top: 10px; }

.dropzone {
  border: 1.5px dashed var(--faint);
  border-radius: var(--r-lg);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  background: var(--brand-tint);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
  color: var(--muted);
  font-weight: 400;
  font-size: 13.5px;
}
.dropzone .i { width: 26px; height: 26px; color: var(--brand); margin-bottom: 4px; }
.dropzone strong { color: var(--ink); font-weight: 500; font-size: 15px; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.over { transform: scale(1.01); }

.upload-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.upload-progress .bar { flex: 1; height: 6px; border-radius: 6px; background: var(--brand-soft); overflow: hidden; }
.upload-progress .bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.3s; }

.gallery {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.ph {
  margin: 0;
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.ph:hover img { transform: scale(1.06); }
.ph-actions {
  position: absolute;
  inset: auto 6px 6px auto;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
.ph:hover .ph-actions, .ph:focus-within .ph-actions { opacity: 1; transform: none; }
.ph-actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--glass);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.ph-actions .i { width: 15px; height: 15px; }
.ph-actions button:hover { color: var(--brand-deep); }
.ph-actions button[data-del]:hover { color: var(--red); }
.ph-actions button.on { background: var(--brand); color: #fff; }
.ph-actions button.on .i { fill: currentColor; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(16, 22, 23, 0.94);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: auto 1fr;
  opacity: 0;
  transition: opacity 0.2s;
}
.lightbox.in { opacity: 1; }
.lb-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
.lb-top > div { display: flex; gap: 6px; }
.lb-btn, .lb-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
}
.lb-btn:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lb-nav { align-self: center; justify-self: center; }
.lb-stage { display: grid; place-items: center; padding: 0 0 24px; min-height: 0; min-width: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; border-radius: 6px; }

/* =========================================================
   Presupuestos
   ========================================================= */
.table-card { padding: 6px; }
.presu-table { display: flex; flex-direction: column; }
.pt-row {
  display: grid;
  grid-template-columns: 110px 1.1fr 1.4fr 140px 120px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14.5px;
}
a.pt-row:hover { background: var(--surface); }
.pt-row + .pt-row { border-top: 1px solid var(--line); }
.pt-head { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 10px; padding-bottom: 10px; }
.pt-num { display: flex; flex-direction: column; }
.pt-num b { color: var(--ink); font-weight: 500; }
.pt-num small { color: var(--muted); font-size: 12px; }
.pt-cli { color: var(--ink); font-weight: 500; }
.pt-ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-total { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.status-select { position: relative; }
.status-select select {
  height: 42px;
  border-radius: 999px;
  padding: 0 34px 0 16px;
  font-weight: 500;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--gray-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237c898a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border-color: transparent;
}
.status-select.st-pendiente select { background-color: var(--amber-soft); color: var(--amber); }
.status-select.st-realizado select { background-color: var(--green-soft); color: var(--green); }
.status-select.st-cancelado select { background-color: var(--gray-soft); color: var(--gray); }

.presu-grid { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.05fr); gap: 22px; align-items: start; }
.presu-form { display: flex; flex-direction: column; gap: 14px; }
.presu-form h3 {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-deep);
  font-weight: 500;
  margin-top: 10px;
}
.presu-form h3:first-child { margin-top: 0; }
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: grid;
  grid-template-columns: 84px 1fr 1fr;
  gap: 8px 10px;
  align-items: end;
  padding: 10px;
  border-radius: var(--r);
  background: var(--surface);
  position: relative;
}
.item-row input { padding: 9px 10px; font-size: 14px; }
.item-row .item-desc { grid-column: 1 / -1; padding-right: 40px; font-weight: 500; }
.item-row [data-act='del-item'] { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; }
.item-f { font-size: 11.5px; gap: 4px; }
.item-sub { display: flex; flex-direction: column; align-items: flex-end; padding-bottom: 9px; font-variant-numeric: tabular-nums; }
.item-sub small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.item-sub b { font-weight: 500; color: var(--ink); font-size: 15px; }
.items-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Total editable a mano */
.total-edit {
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
}
.total-edit input { font-size: 20px; font-weight: 500; color: var(--ink); background: var(--card); }
.total-edit p { margin-top: 8px; }
.total-edit .link { font-size: inherit; padding: 0; border: 0; background: none; }

/* Selector de pack */
.pack-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.pack-picker button {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand-tint);
  font-size: 14px;
  color: var(--brand-ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.pack-picker button:hover { border-color: var(--brand); color: var(--ink); }
.pack-picker button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.cat-select { width: auto; flex: 1; min-width: 200px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; color: var(--text); }
.saved-note { display: flex; align-items: center; gap: 6px; }
.saved-note .i { width: 15px; height: 15px; color: var(--green); }

.preview-wrap {
  position: sticky;
  top: calc(var(--bar) + 24px);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
}
.preview-label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px 4px; }

.doc {
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 40px 40px 30px;
  font-size: 13px;
  color: var(--text);
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.doc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.doc-head img { width: 62px; height: auto; flex: none; }
.doc-brand { display: flex; flex-direction: column; line-height: 1.3; }
.doc-brand strong { font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brand-deep); font-size: 13px; }
.doc-brand span { letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); font-size: 9.5px; }
.doc-num { margin-left: auto; text-align: right; display: flex; flex-direction: column; line-height: 1.3; }
.doc-num span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.doc-num b { font-size: 18px; font-weight: 500; color: var(--ink); }
.doc-num small { color: var(--muted); }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.doc-parties > div { display: flex; flex-direction: column; }
.doc-parties strong { color: var(--ink); font-weight: 500; font-size: 14.5px; }
.doc-parties small { color: var(--muted); }
.lbl { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brand-deep); margin-bottom: 4px; font-weight: 500; }
/* ---------- Estado del presupuesto (botón al final del formulario) ---------- */
.est-borrador { --ec: var(--gray); --ecs: var(--gray-soft); }
.est-enviado { --ec: var(--amber); --ecs: var(--amber-soft); }
.est-rechazado { --ec: var(--red); --ecs: var(--red-soft); }
.est-aceptado { --ec: var(--green); --ecs: var(--green-soft); }

/* Etiqueta de arriba (lleva al botón de abajo) */
.estado-pill {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ec);
  background: var(--ecs);
  color: var(--ec);
  font-weight: 600;
  font-size: 14px;
}

.estado-box {
  margin-top: 22px;
  border: 2px solid var(--ec);
  border-radius: var(--r-lg);
  background: var(--ecs);
  overflow: hidden;
}
.estado-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  background: none;
  text-align: left;
}
.et-lbl { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); font-weight: 500; }
.et-val { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; color: var(--ec); }
.et-val i, .estado-opt i { width: 12px; height: 12px; border-radius: 50%; background: var(--ec); flex: none; }
.et-chev { color: var(--ec); transition: transform 0.25s var(--ease); }
.estado-box.open .et-chev { transform: rotate(90deg); }
.estado-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; animation: fade-in 0.2s ease; }
.estado-opt {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--ec);
  background: var(--card);
  text-align: left;
  transition: transform 0.15s var(--ease), background-color 0.15s;
}
.estado-opt b { color: var(--ec); font-weight: 600; font-size: 15px; }
.estado-opt small { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.estado-opt:hover { background: var(--ecs); transform: translateY(-1px); }
.estado-opt.on { outline: 2px solid var(--ec); outline-offset: 1px; }
/* Aceptado: verde lleno */
.estado-opt.est-aceptado { background: var(--green); border-color: var(--green); }
.estado-opt.est-aceptado b, .estado-opt.est-aceptado small { color: #fff; }
.estado-opt.est-aceptado i { background: #fff; }
.estado-opt.est-aceptado:hover { background: #417a55; }
.estado-agenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 18px 16px;
  border-top: 1px solid color-mix(in srgb, var(--ec) 30%, transparent);
  font-size: 14px;
  color: var(--ink);
}
.estado-agenda > .i { color: var(--green); width: 20px; height: 20px; }
.estado-agenda span { flex: 1; min-width: 180px; }
.estado-agenda .link { padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.estado-agenda.falta > .i { color: var(--amber); }
@media (max-width: 560px) {
  .estado-opts { grid-template-columns: 1fr; }
}

/* Opciones de pago en cuotas */
.cuotas-preview {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  gap: 6px;
  font-size: 13px;
  padding-bottom: 8px;
}
.cuotas-preview span:not(.muted) { padding: 4px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-ink); }
.doc-cuotas { margin-top: 22px; display: flex; flex-direction: column; }
.doc-cuotas ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.doc-cuotas li {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.doc-cuotas li span { font-size: 11.5px; color: var(--muted); }
.doc-cuotas li b { font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.doc-cuotas li small { font-size: 10.5px; color: var(--muted); }

/* Pack y lo que incluye, en el presupuesto */
.doc-pack {
  display: flex;
  flex-direction: column;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--brand-tint);
  border-left: 3px solid var(--brand);
}
.doc-pack strong { color: var(--ink); font-weight: 500; font-size: 16px; }
.doc-pack ul { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; column-gap: 24px; }
.doc-pack li { position: relative; padding-left: 18px; margin-bottom: 5px; line-height: 1.45; break-inside: avoid; }
.doc-pack li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid var(--brand-deep);
  border-bottom: 1.5px solid var(--brand-deep);
  transform: rotate(-45deg);
}
@media (max-width: 560px) { .doc-pack ul { columns: 1; } }

.doc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.doc-table th {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.doc-table td { padding: 10px 0; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th:first-child, .doc-table td:first-child { text-align: left; padding-right: 10px; }
.doc-table td:first-child { color: var(--ink); }
.doc-table th:not(:first-child), .doc-table td:not(:first-child) { padding-left: 12px; white-space: nowrap; }
.doc-empty { color: #aab4b5 !important; text-align: center !important; padding: 26px 0 !important; }
.doc-totals { margin: 16px 0 0 auto; width: min(100%, 300px); display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.doc-totals .total {
  font-size: 17px;
  color: #fff;
  background: var(--brand);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  margin-top: 4px;
}
.doc-totals .sena { font-size: 12.5px; color: var(--brand-ink); padding: 0 14px; }
.doc-notes { margin-top: 26px; display: flex; flex-direction: column; }
.doc-notes p { line-height: 1.65; }
.doc-valid { margin-top: 16px; color: var(--muted); font-size: 12px; }
.doc-foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  font-size: 11.5px;
  color: var(--muted);
  position: relative;
  top: 12px;
}
.doc-foot i { font-style: normal; color: var(--brand); }

/* =========================================================
   Ajustes
   ========================================================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-grid h2 { margin-bottom: 4px; }
.settings-grid .form-grid, .settings-grid textarea { margin-top: 16px; }
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 6px; align-items: center; }
.cat-row input { padding: 9px 10px; font-size: 14px; }
.cat-head { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 2px; }

/* ---------- Materiales de deco ---------- */
.mat-search { width: 100%; margin-bottom: 10px; }
.mat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background-color 0.15s, border-color 0.15s;
}
.mat-row.on { border-color: var(--brand); background: var(--brand-tint); }
.mat-row.falta { border-color: var(--red); background: var(--red-soft); }
.mat-info { display: flex; flex-direction: column; min-width: 0; }
.mat-info b { font-weight: 500; color: var(--ink); }
.mat-info small { font-size: 12.5px; color: var(--muted); }
.mat-row.falta small strong { color: var(--red); }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
}
.stepper button:hover { border-color: var(--brand); }
.stepper span { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.mat-resumen { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.mat-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mat-chips li { padding: 4px 10px; border-radius: 999px; background: var(--brand-tint); border: 1px solid var(--brand-soft); font-size: 13px; }
.mat-chips li.falta { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.mat-resumen .link { padding: 0; border: 0; background: none; color: var(--brand-deep); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   Vacíos, modales, toast
   ========================================================= */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 20px;
  gap: 8px;
}
.empty p { color: var(--muted); max-width: 360px; font-size: 14px; margin-bottom: 10px; }
.empty-blob { position: relative; width: 84px; height: 70px; margin-bottom: 10px; }
.empty-blob span {
  position: absolute;
  background: var(--brand-soft);
  border-radius: 46% 54% 60% 40% / 55% 45% 55% 45%;
  animation: float 6s ease-in-out infinite;
}
.empty-blob span:first-child { width: 52px; height: 62px; left: 4px; top: 0; }
.empty-blob span:last-child { width: 30px; height: 30px; right: 4px; bottom: 0; background: var(--brand); opacity: 0.5; animation-delay: -3s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  /* Sin desenfoque: animar un blur de pantalla completa traba la entrada del modal */
  background: rgba(30, 40, 41, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}
.modal-backdrop.closing { animation: fade-out 0.18s ease forwards; }
.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px); /* dvh: descuenta la barra del navegador en el celu */
  overflow: hidden;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.35s var(--ease);
}
.modal.modal-sm { width: min(420px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px 10px; }
.modal-head h2 { font-size: 22px; }
.modal-head .icon-btn { border: 0; }
/* El cuerpo hace scroll y el pie (Guardar / Cancelar) queda siempre a la vista */
.modal-head, .modal-foot { flex: none; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 10px 24px 8px; overflow: auto; overscroll-behavior: contain; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.spacer { flex: 1; }
.confirm-text { font-size: 15px; color: var(--text); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.35s var(--ease);
  transition: opacity 0.3s, transform 0.3s;
}
.toast-item .i { color: #a9c6c8; width: 16px; height: 16px; }
.toast-item.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .presu-grid { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats-3 { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --bar: 60px; }
  .topbar-in { padding: 16px; gap: 12px; }
  .brand span { display: none; }
  .brand img { width: 40px; }
  .greet .eyebrow { font-size: 10.5px; letter-spacing: 0.16em; }
  .greet-hi { font-size: 21px; }
  .nav a { flex-direction: column; gap: 2px; padding: 0 2px; font-size: 10.5px; }
  .nav a + a { border-left: 0; }
  .nav a .i { width: 22px; height: 22px; }
  #view { padding: 20px 16px 48px; min-height: auto; }
  .page-head { margin-bottom: 20px; }
  .head-actions { width: 100%; }
  .agenda-grid, .home-grid, .settings-grid { grid-template-columns: 1fr; }
  .day-panel { position: static; }
  .cal { padding: 6px; }
  .cal-cells { gap: 2px; }
  .cal-cell { min-height: 58px; padding: 5px 2px; align-items: center; border-radius: 10px; }
  .cal-cell .chips { display: none; }
  .cal-cell .dots { display: flex; }
  .cal-head span { font-size: 10.5px; letter-spacing: 0.04em; }
  .client-hero { grid-template-columns: 1fr; gap: 20px; }
  .search { min-width: 0; flex: 1; }
  #toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .ph-actions { opacity: 1; transform: none; }
  .lightbox { grid-template-columns: 0 1fr 0; }
  .lb-nav { display: none; }
  .hint { display: none; }
  .pt-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .pt-head { display: none; }
  .pt-ev { grid-column: 1; grid-row: 2; font-size: 13px; }
  .pt-num { grid-row: 1; }
  .pt-cli { grid-column: 1; grid-row: 3; font-size: 13px; }
  .pt-total { grid-column: 2; grid-row: 1; text-align: right; }
  .pt-row > span:last-child { grid-column: 2; grid-row: 2 / span 2; justify-self: end; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .stats, .stats-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-3 .stat:last-child { grid-column: span 2; }
  .stat { padding: 16px; }
  .stat b { font-size: 26px; }
  .row-3 { grid-template-columns: 1fr 1fr; }
  .row-3 label:last-child { grid-column: span 2; }
  .item-row { grid-template-columns: 70px 1fr; }
  .item-row .item-sub { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; padding: 0 2px; }
  .doc { padding: 24px 20px; min-height: 0; }
  .doc-parties { grid-template-columns: 1fr; gap: 12px; }
  .doc-head img { width: 48px; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; max-height: 92dvh; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .spacer { display: none; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .ph { border-radius: 8px; }
  .ph-actions button { width: 26px; height: 26px; }
  .head-actions .btn { flex: 1; }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .piece, .splash-hint, .mark-name, .mark-sub, .splash-social a, .splash-menu, .splash-down,
  .splash-social::before, .splash-social::after { opacity: 1; }
  .mark-inner, .piece-dot { animation: none; }
}

/* =========================================================
   Impresión / PDF del presupuesto
   ========================================================= */
/* =========================================================
   Galerías online
   ========================================================= */
.gal-aviso, .gal-login { max-width: 560px; display: grid; gap: 10px; }
.gal-login form { margin-top: 6px; }
.gal-codigo { color: var(--ink); font-weight: 500; letter-spacing: 0.08em; }
.gal-estado { display: grid; gap: 12px; margin-bottom: 20px; }
.gal-estado .section-head { margin-bottom: 0; }
.gal-cobro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--amber-soft);
}
.gal-cobro.ok { background: var(--green-soft); display: grid; gap: 2px; }
.gal-cobro b { color: var(--ink); font-weight: 500; }
.gal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gal-grid .ph { aspect-ratio: 7 / 10; cursor: default; }
.gal-num {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 11px;
  color: #fff;
  background: rgba(30, 40, 41, 0.5);
  padding: 1px 8px;
  border-radius: 999px;
}
.gal-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
}
.gal-badge.ok { background: var(--green); color: #fff; }
.gal-badge.sel { background: var(--brand); color: #fff; }
.gal-badge.debe { background: var(--amber); color: #fff; }
@media (max-width: 560px) {
  .nav a { min-width: 0; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .gal-grid .ph-actions { opacity: 1; transform: none; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #splash, .topbar, .nav, #toast, #modal-root, #avisos, .lightbox, .back, .page-head, .presu-form, .preview-label { display: none !important; }
  #app { opacity: 1 !important; transform: none !important; }
  #view { margin: 0; padding: 0; min-height: 0; max-width: none; animation: none; }
  .presu-grid { display: block; }
  .preview-wrap { position: static; padding: 0; background: none; }
  /* Todo en una hoja: sin alto mínimo y con espacios más chicos (también desde el celular) */
  .doc { box-shadow: none; border-radius: 0; padding: 0; min-height: 0; font-size: 11.5px; display: block; }
  .doc-head { padding-bottom: 14px; }
  .doc-head img { width: 56px !important; height: auto; }
  .doc-parties { grid-template-columns: 1fr 1fr; gap: 20px; margin: 14px 0; }
  .doc-pack { margin: 0 0 14px; padding: 10px 14px; break-inside: avoid; }
  .doc-pack strong { font-size: 14px; }
  .doc-pack ul { columns: 2; margin-top: 6px; }
  .doc-pack li { margin-bottom: 3px; }
  .doc-table th { padding: 6px 0; }
  .doc-table td { padding: 6px 0; }
  .doc-table tr { break-inside: avoid; }
  .doc-totals { margin-top: 10px; gap: 4px; break-inside: avoid; }
  .doc-totals .total { font-size: 15px; padding: 7px 12px; }
  .doc-cuotas { margin-top: 14px; break-inside: avoid; }
  .doc-cuotas li { padding: 7px 10px; }
  .doc-cuotas li b { font-size: 14px; }
  .doc-notes { margin-top: 14px; break-inside: avoid; }
  .doc-notes p { line-height: 1.5; }
  .doc-valid { margin-top: 10px; }
  .doc-foot { margin-top: 16px; padding-top: 10px; top: 0; font-size: 10.5px; }
}
