/* ==========================================================================
   Paneles (cliente y administrador) — usa SOLO los tokens de brand.css
   Desarrollado por analize
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--frambuesa);
  background:
    radial-gradient(circle, var(--palo) 1.4px, transparent 1.9px) 0 0 / 24px 24px fixed,
    var(--blanco);
  -webkit-font-smoothing: antialiased;
}
html.locked { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.i { display: block; width: 100%; height: 100%; }
.ico { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.muted { color: var(--frambuesa-70); }
.eyebrow { color: var(--rosa); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Marca (moño) */
.mark { width: 40px; height: auto; flex: none; }
.mark__loop { fill: var(--rosa); }
.mark__knot { fill: var(--palo); }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s, filter .2s, background .2s, box-shadow .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .tab:focus-visible, .navi:focus-visible { outline: 3px solid var(--rosa-30); outline-offset: 2px; }
.btn--primary { color: var(--blanco); background: var(--rosa); box-shadow: 0 10px 22px -12px var(--rosa); }
.btn--primary:hover:not(:disabled) { filter: brightness(.94); }
.btn--soft { color: var(--frambuesa); background: var(--palo); }
.btn--soft:hover:not(:disabled) { filter: brightness(.97); }
.btn--ghost { color: var(--frambuesa); background: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--rosa-12); }
.btn--line { color: var(--frambuesa); background: var(--blanco); box-shadow: inset 0 0 0 1.5px var(--palo); }
.btn--line:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--rosa-30); }
.btn--light { color: var(--rosa); background: var(--blanco); box-shadow: 0 10px 22px -12px rgba(142, 15, 67, .8); }
.btn--light:hover:not(:disabled) { filter: brightness(.98); }
.btn--danger { color: var(--blanco); background: var(--frambuesa); }
.btn--danger:hover:not(:disabled) { filter: brightness(1.15); }
.btn--sm { min-height: 34px; padding: 7px 13px; font-size: 13.5px; }
.btn--lg { min-height: 50px; padding: 13px 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; min-height: 40px; padding: 0; }
.btn--icon.btn--sm { width: 34px; min-height: 34px; }

/* ---------------- Barra superior ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 max(16px, calc((100% - 1120px) / 2));
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 0 var(--palo);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.topbar__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.topbar__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.topbar__tag { padding: 3px 8px 2px; border-radius: var(--r-pill); color: var(--blanco); background: var(--frambuesa); font-size: 10px; }
.topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topbar__user { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 14px; }
@media (max-width: 560px) {
  .topbar__name { display: none; }
  .topbar__user { display: none; }
}

/* ---------------- Página ---------------- */
.page { width: min(100% - 32px, 1120px); margin: 0 auto; padding: 32px 0 72px; }
.page--narrow { width: min(100% - 32px, 760px); }
.page__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 38px); line-height: 1.05; letter-spacing: -.02em; }
.page__sub { margin-top: 6px; color: var(--frambuesa-70); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--frambuesa-70);
}
.back:hover { color: var(--rosa); background: var(--rosa-12); }

/* ---------------- Tarjetas ---------------- */
.card {
  position: relative;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--blanco);
  box-shadow: 0 0 0 1.5px var(--palo), 0 18px 36px -30px rgba(142, 15, 67, .7);
}
.card + .card { margin-top: 16px; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card__title { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.15; }
.card__sub { margin-top: 2px; font-size: var(--fs-small); color: var(--frambuesa-70); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 > .card + .card { margin-top: 0; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------- Chips de estado ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 3px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--active { color: var(--blanco); background: var(--rosa); }
.chip--pending { color: var(--rosa); background: var(--blanco); box-shadow: inset 0 0 0 1.5px var(--rosa); }
.chip--review { color: var(--frambuesa); background: var(--palo); }
.chip--review::before { background: var(--dorado); box-shadow: 0 0 6px 1px rgba(242, 193, 78, .9); }
.chip--muted { color: var(--frambuesa-70); background: var(--frambuesa-12); }
.chip--plain { color: var(--frambuesa); background: var(--rosa-12); }
.chip--plain::before { display: none; }

/* ---------------- Formularios ---------------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 800; font-size: 13.5px; }
.field__hint { font-size: 12.5px; color: var(--frambuesa-70); }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field__count { font-size: 12px; color: var(--frambuesa-70); font-variant-numeric: tabular-nums; }
.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--r-sm);
  font-weight: 700;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: inset 0 0 0 1.5px var(--palo);
  transition: box-shadow .2s;
  outline: none;
}
.input::placeholder { color: var(--frambuesa-40); font-weight: 600; }
.input:focus { box-shadow: inset 0 0 0 2px var(--rosa), 0 0 0 4px var(--rosa-12); }
.input.is-bad { box-shadow: inset 0 0 0 2px var(--frambuesa); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.affix {
  display: flex;
  align-items: stretch;
  border-radius: var(--r-sm);
  background: var(--blanco);
  box-shadow: inset 0 0 0 1.5px var(--palo);
  overflow: hidden;
}
.affix:focus-within { box-shadow: inset 0 0 0 2px var(--rosa), 0 0 0 4px var(--rosa-12); }
.affix__pre {
  display: flex;
  align-items: center;
  padding: 0 4px 0 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--frambuesa-70);
  white-space: nowrap;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.affix .input { box-shadow: none; padding-left: 2px; }
.affix .input:focus { box-shadow: none; }
.msg { min-height: 1.3em; font-weight: 800; font-size: 13px; color: var(--frambuesa); }
.msg.is-ok { color: var(--rosa); }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Interruptor */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch__text { display: grid; gap: 2px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--palo);
  transition: background .25s;
}
.switch__ui::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blanco);
  box-shadow: 0 2px 6px rgba(142, 15, 67, .3);
  transition: transform .3s var(--ease-spring);
}
.switch input:checked + .switch__ui { background: var(--rosa); }
.switch input:checked + .switch__ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__ui { outline: 3px solid var(--rosa-30); outline-offset: 2px; }

/* Opciones grandes (planes, formas de pago) */
.options { display: grid; gap: 10px; }
.options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .options--3 { grid-template-columns: 1fr; } }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__box {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--blanco);
  box-shadow: inset 0 0 0 1.5px var(--palo);
  transition: box-shadow .2s, background .2s;
}
.option:hover .option__box { box-shadow: inset 0 0 0 1.5px var(--rosa-30); }
.option input:checked + .option__box { background: var(--rosa-12); box-shadow: inset 0 0 0 2.5px var(--rosa); }
.option input:focus-visible + .option__box { outline: 3px solid var(--rosa-30); outline-offset: 2px; }
.option__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.option__title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.option__price { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--rosa); }
.option__text { font-size: 13px; color: var(--frambuesa-70); }

/* Segmentos (filtros) */
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.seg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 0;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: inset 0 0 0 1.5px var(--palo);
  cursor: pointer;
}
.seg__n { min-width: 22px; padding: 1px 6px; border-radius: var(--r-pill); font-size: 12px; text-align: center; background: var(--rosa-12); }
.seg.is-on { color: var(--blanco); background: var(--frambuesa); box-shadow: none; }
.seg.is-on .seg__n { background: var(--blanco-18); }

/* Pestañas */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: var(--blanco);
  box-shadow: inset 0 0 0 1.5px var(--palo);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--frambuesa-70);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--frambuesa); }
.tab.is-on { color: var(--blanco); background: var(--rosa); }
.tab__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dorado); box-shadow: 0 0 6px 1px rgba(242, 193, 78, .9); }

/* Barra de progreso */
.progress { height: 10px; border-radius: var(--r-pill); background: var(--rosa-12); overflow: hidden; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--rosa); transition: width .6s var(--ease-out); }

/* Avisos dentro de la página */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  color: var(--frambuesa);
  background: var(--palo);
}
.notice + .notice, .notice + .card, .card + .notice { margin-top: 16px; }
.notice__icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: var(--rosa); background: var(--blanco); }
.notice__icon .ico { width: 22px; height: 22px; }
.notice__body { flex: 1 1 260px; display: grid; gap: 2px; }
.notice__title { font-weight: 900; }
.notice__text { font-size: 14px; color: var(--frambuesa-70); }
.notice--strong { color: var(--blanco); background: var(--rosa); }
.notice--strong .notice__text { color: var(--blanco-85); }
.notice--dark { color: var(--blanco); background: var(--frambuesa); }
.notice--dark .notice__text { color: var(--blanco-85); }
.notice--dark .notice__icon, .notice--strong .notice__icon { color: var(--frambuesa); }

/* Vacío */
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; }
.empty__art { width: 120px; margin-bottom: 6px; }
.empty__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.empty__text { max-width: 380px; color: var(--frambuesa-70); }

/* Enlace para compartir */
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  background: var(--rosa-12);
}
.share__url {
  flex: 1 1 180px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 14.5px;
}
.share__url b { color: var(--rosa); }
.share__actions { display: flex; gap: 6px; }

/* ---------------- Tablas ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px;
  text-align: left;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--frambuesa-70);
  border-bottom: 1.5px solid var(--palo);
  white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--rosa-12); vertical-align: middle; }
.table td.td-main .cell-main { white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 46, 136, .04); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.cell-main { font-weight: 800; }
.cell-sub { font-size: 12.5px; color: var(--frambuesa-70); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* En celular la tabla se convierte en tarjetas */
@media (max-width: 760px) {
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 0; border-bottom: 1.5px solid var(--palo); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .table td::before { content: attr(data-label); flex: none; font-weight: 900; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--frambuesa-70); text-align: left; padding-top: 3px; }
  .table td.td-main { display: block; text-align: left; }
  .table td.td-main::before { display: none; }
  .table .num { text-align: right; }
  .table tbody tr:hover td { background: none; }
  .row-actions { justify-content: flex-end; flex-wrap: wrap; }
}

/* ---------------- Avisos flotantes ---------------- */
.toasts {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  translate: -50% 0;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  color: var(--blanco);
  background: var(--frambuesa);
  box-shadow: 0 16px 32px -14px rgba(142, 15, 67, .9);
  animation: toast-in .35s var(--ease-spring);
}
.toast--ok { background: var(--rosa); }
.toast--error { color: var(--frambuesa); background: var(--blanco); box-shadow: inset 0 0 0 2px var(--frambuesa), 0 16px 32px -14px rgba(142, 15, 67, .9); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------------- Diálogo ---------------- */
.dialog {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(142, 15, 67, .45);
  animation: fade-in .2s ease-out;
}
.dialog.is-out { opacity: 0; transition: opacity .2s; }
.dialog__card {
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--blanco);
  box-shadow: 0 40px 80px -30px rgba(142, 15, 67, .9);
  animation: pop-in .35s var(--ease-spring);
}
.dialog__text { color: var(--frambuesa-70); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------------- Panel lateral (editor de una ventana) ---------------- */
.drawer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(142, 15, 67, .35);
  animation: fade-in .25s ease-out;
}
.drawer__panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  height: 100%;
  background: var(--blanco);
  box-shadow: -30px 0 60px -30px rgba(142, 15, 67, .8);
  animation: drawer-in .42s var(--ease-out);
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1.5px solid var(--palo);
}
.drawer__title { flex: 1; min-width: 0; }
.drawer__title .t-title { font-size: 22px; }
.drawer__title .muted { font-size: 13.5px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 18px 28px; }
.drawer__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--palo);
}
.drawer__foot .btn--primary { margin-left: auto; }
@media (max-width: 560px) {
  .drawer__panel { width: 100%; animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
}

/* ---------------- Fotos ---------------- */
.photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .5) 0 8px, transparent 8px 18px),
    var(--palo);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__empty { display: grid; justify-items: center; gap: 8px; padding: 20px; text-align: center; font-weight: 800; color: var(--frambuesa-70); }
.photo__empty .ico { width: 34px; height: 34px; color: var(--rosa); }
.photo.is-drop { box-shadow: inset 0 0 0 3px var(--rosa); }
.photo__busy { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; color: var(--blanco); background: rgba(142, 15, 67, .55); }
.photo__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------------- Ventanas del calendario en el editor ---------------- */
.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.dayc {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  text-align: left;
  background: var(--blanco);
  box-shadow: 0 0 0 1.5px var(--palo);
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.dayc:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--rosa-30), 0 16px 30px -18px rgba(142, 15, 67, .7); }
.dayc:focus-visible { outline: 3px solid var(--rosa-30); outline-offset: 2px; }
.dayc__face { position: relative; aspect-ratio: 16 / 10; border-radius: 0; }
.dayc__face .face { border-radius: 0; }
.dayc__face .face__icon { top: 55%; width: 48cqmin; }
.dayc__thumb { position: absolute; inset: 0; z-index: 6; }
.dayc__thumb img { width: 100%; height: 100%; object-fit: cover; }
.dayc__body { display: grid; align-content: start; gap: 3px; padding: 10px 12px 12px; min-height: 74px; }
.dayc__date { font-weight: 900; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--rosa); }
.dayc__title { font-weight: 800; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dayc__title.is-empty { color: var(--frambuesa-40); }
.dayc__flags { position: absolute; z-index: 7; right: 8px; top: 8px; display: flex; gap: 4px; }
.flag {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--rosa);
  background: var(--blanco);
  box-shadow: 0 2px 8px rgba(142, 15, 67, .3);
}
.flag .ico { width: 14px; height: 14px; }
.flag--done { color: var(--blanco); background: var(--rosa); }
.dayc.is-filled { box-shadow: 0 0 0 2px var(--rosa); }

/* ---------------- Tarjetas de calendario (lista) ---------------- */
.cals { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.calc {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--blanco);
  box-shadow: 0 0 0 1.5px var(--palo), 0 18px 36px -30px rgba(142, 15, 67, .7);
  overflow: hidden;
}
.calc__art {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 18px;
  background:
    radial-gradient(circle, var(--blanco-18) 1.6px, transparent 2px) 0 0 / 22px 22px,
    var(--rosa);
}
.calc__art.is-muted { background: radial-gradient(circle, var(--blanco-18) 1.6px, transparent 2px) 0 0 / 22px 22px, var(--frambuesa); }
.calc__tile {
  position: relative;
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--frambuesa), 0 10px 14px -8px rgba(142, 15, 67, .7);
}
.calc__tile:nth-child(2) { width: 48px; height: 48px; }
.calc__tile:nth-child(3) { width: 40px; height: 40px; }
.calc__chip { position: absolute; top: 14px; right: 14px; }
.calc__chip .chip--muted { color: var(--blanco); background: var(--blanco-18); }
.calc__chip .chip--pending { background: var(--blanco); }
.calc__body { display: grid; gap: 12px; padding: 18px; flex: 1; }
.calc__who { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.calc__meta { font-size: 13.5px; color: var(--frambuesa-70); }
.calc__stats { display: grid; gap: 6px; }
.calc__line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; }
.calc__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.calc--new {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 24px;
  border: 0;
  text-align: center;
  color: var(--frambuesa);
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 2px var(--rosa-30);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.calc--new:hover { background: var(--blanco); box-shadow: inset 0 0 0 2px var(--rosa); }
.calc--new .plus { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; color: var(--blanco); background: var(--rosa); }
.calc--new .plus .ico { width: 26px; height: 26px; }

/* ---------------- Ingreso ---------------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}
.auth__art {
  position: relative;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 48px clamp(24px, 5vw, 72px);
  color: var(--blanco);
  background:
    radial-gradient(circle, var(--blanco-18) 2px, transparent 2.5px) 0 0 / 30px 30px,
    var(--rosa);
  overflow: hidden;
}
.auth__title { font-size: clamp(34px, 4.4vw, 52px); }
.auth__text { max-width: 440px; color: var(--blanco-85); font-size: 16px; }
.auth__plan {
  display: grid;
  gap: 4px;
  max-width: 380px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 24px 44px -20px rgba(142, 15, 67, .8);
}
.auth__plan .t-label { color: var(--rosa); }
.auth__plan strong { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.auth__tiles { display: flex; gap: 10px; }
.auth__tiles > span { position: relative; width: 70px; height: 70px; border-radius: 16px; box-shadow: 0 3px 0 var(--frambuesa), 0 12px 18px -10px rgba(142, 15, 67, .8); }
.auth__tiles > span:nth-child(2) { transform: rotate(6deg) translateY(8px); }
.auth__tiles > span:nth-child(3) { transform: rotate(-5deg); }
.auth__side { display: grid; place-items: center; padding: 40px 16px; }
.auth__card { width: min(100%, 420px); }
.auth__card .tabs { margin-bottom: 22px; }
.auth__foot { margin-top: 16px; text-align: center; font-size: 14px; }
.linkbtn { padding: 0; border: 0; font-weight: 800; color: var(--rosa); background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth__art { padding: 32px 20px; }
  .auth__tiles { display: none; }
}

/* ---------------- Pago ---------------- */
.paybox { display: grid; gap: 12px; }
.payopt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-radius: var(--r-md);
  text-align: left;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: inset 0 0 0 1.5px var(--palo);
  cursor: pointer;
  transition: box-shadow .2s, background .2s;
}
.payopt:hover { box-shadow: inset 0 0 0 2px var(--rosa); }
.payopt.is-on { background: var(--rosa-12); box-shadow: inset 0 0 0 2.5px var(--rosa); }
.payopt__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; color: var(--blanco); background: var(--rosa); }
.payopt__icon .ico { width: 22px; height: 22px; }
.payopt__text { display: grid; gap: 1px; }
.payopt__title { font-weight: 900; font-size: 15.5px; }
.payopt__sub { font-size: 13px; color: var(--frambuesa-70); }
.bank { display: grid; gap: 0; margin: 4px 0 6px; border-radius: var(--r-md); background: var(--rosa-12); overflow: hidden; }
.bank__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--blanco); }
.bank__row:last-child { border-bottom: 0; }
.bank__k { font-size: 13px; color: var(--frambuesa-70); }
.bank__v { font-weight: 900; text-align: right; word-break: break-all; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0 4px; border-top: 1.5px dashed var(--palo); }
.total__v { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1; }

/* ---------------- Actividad ---------------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat { padding: 16px 18px; border-radius: var(--r-md); background: var(--rosa-12); }
.stat__v { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; }
.stat__k { font-size: 13px; color: var(--frambuesa-70); }
.list { display: grid; }
.list__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rosa-12); }
.list__row:last-child { border-bottom: 0; }
.list__num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--blanco);
  background: var(--rosa);
}
.list__main { flex: 1; min-width: 0; }

/* ---------------- Vista de la portada ---------------- */
.coverprev {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 24px 18px;
  border-radius: var(--r-md);
  text-align: center;
  color: var(--blanco);
  background:
    radial-gradient(circle, var(--blanco-18) 1.6px, transparent 2px) 0 0 / 22px 22px,
    var(--rosa);
}
.coverprev__kicker { color: var(--blanco-85); font-size: 10.5px; }
.coverprev__title { font-size: clamp(26px, 3.4vw, 34px); max-width: 300px; }
.coverprev__rule { width: 46px; height: 2px; border-radius: 2px; background: var(--dorado); }
.coverprev__sub { color: var(--blanco-85); font-size: 10px; }

/* ---------------- Pie ---------------- */
.foot { display: grid; justify-items: center; gap: 14px; padding: 8px 16px calc(36px + env(safe-area-inset-bottom)); }
.foot a { font-weight: 800; font-size: 13px; color: var(--frambuesa-70); }

/* ---------------- Carga ---------------- */
.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--rosa-12);
  border-top-color: var(--rosa);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Panel de administración
   ========================================================================== */
.login { display: grid; place-items: center; align-content: center; min-height: 100vh; padding: 32px 16px 0; }
.login__card { width: min(100%, 420px); padding: 30px 28px; text-align: center; }
.login__card .form { margin-top: 22px; text-align: left; }
.login__bow { width: 96px; margin: 0 auto 10px; display: block; }
.login__title { margin-top: 4px; font-size: 28px; }
.login__text { margin-top: 6px; }

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
  padding: 28px 0 56px;
}
.side { position: sticky; top: 88px; align-self: start; display: grid; gap: 4px; }
.navi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  color: var(--frambuesa-70);
  transition: background .2s, color .2s;
}
.navi:hover { color: var(--frambuesa); background: var(--rosa-12); }
.navi.is-on { color: var(--blanco); background: var(--frambuesa); }
.navi__i { display: grid; place-items: center; width: 20px; height: 20px; flex: none; }
.navi__badge {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-size: 12px;
  text-align: center;
  color: var(--frambuesa);
  background: var(--dorado);
}
.main { min-width: 0; }
.main .page__head { margin-bottom: 20px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 16px; padding-top: 14px; }
  .side {
    position: sticky;
    top: 64px;
    z-index: 20;
    display: flex;
    gap: 4px;
    margin: 0 -16px;
    padding: 8px 16px;
    overflow-x: auto;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 0 var(--palo);
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .navi { flex: none; padding: 8px 12px; font-size: 14px; }
}

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }
.kpi {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--blanco);
  box-shadow: 0 0 0 1.5px var(--palo), 0 18px 36px -30px rgba(142, 15, 67, .7);
}
.kpi__k { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--frambuesa-70); }
.kpi__k .ico { width: 16px; height: 16px; color: var(--rosa); }
.kpi__v { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3vw, 36px); line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.kpi__sub { font-size: 13px; color: var(--frambuesa-70); }
.kpi--hero { color: var(--blanco); background: radial-gradient(circle, var(--blanco-18) 1.6px, transparent 2px) 0 0 / 22px 22px, var(--rosa); box-shadow: 0 20px 40px -24px var(--rosa); }
.kpi--hero .kpi__k, .kpi--hero .kpi__sub { color: var(--blanco-85); }
.kpi--hero .kpi__k .ico { color: var(--blanco); }

/* Gráfico de barras */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--frambuesa-12); stroke-width: 1; }
.chart .base-line { stroke: var(--frambuesa-40); stroke-width: 1; }
.chart .axis { font-family: var(--font-text); font-weight: 700; font-size: 11px; fill: var(--frambuesa-70); }
.chart .bar { fill: var(--rosa); transition: opacity .15s; }
.chart .bar.is-zero { fill: var(--rosa-12); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:focus-visible + .bar, .chart .hit:hover + .bar { opacity: .72; }
.chart.is-loading { opacity: .5; }
.chart__empty { position: absolute; inset: 0 0 24px; display: grid; place-items: center; font-weight: 800; color: var(--frambuesa-70); pointer-events: none; }

/* Barras horizontales con etiqueta */
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; gap: 6px; outline: none; }
.hbar__top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hbar__name { font-weight: 800; }
.hbar__val { font-weight: 800; font-variant-numeric: tabular-nums; }
.hbar__val span { font-weight: 700; color: var(--frambuesa-70); }
.hbar__track { height: 12px; border-radius: 4px; background: var(--rosa-12); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--rosa); transition: width .6s var(--ease-out); }
.hbar:hover .hbar__fill, .hbar:focus-visible .hbar__fill { opacity: .72; }

/* Tooltip */
.tip {
  position: fixed;
  z-index: 120;
  display: grid;
  gap: 1px;
  min-width: 120px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 0 0 1.5px var(--palo), 0 14px 30px -12px rgba(142, 15, 67, .6);
  pointer-events: none;
  translate: -50% calc(-100% - 10px);
}
.tip__v { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.1; }
.tip__k { font-size: 12.5px; color: var(--frambuesa-70); }

/* Barra de herramientas (filtros y búsqueda) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .segs { flex: 1 1 auto; }
.search { position: relative; flex: 0 1 280px; }
.search .input { min-height: 40px; padding-left: 38px; }
.search .ico { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--frambuesa-70); pointer-events: none; }
@media (max-width: 640px) { .search { flex: 1 1 100%; } }

/* Barra de guardar fija */
.savebar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 12px 12px 20px;
  border-radius: var(--r-pill);
  color: var(--blanco);
  background: var(--frambuesa);
  box-shadow: 0 20px 40px -20px rgba(142, 15, 67, .9);
}
.savebar .btn--primary { box-shadow: none; }
.codebox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  background: var(--rosa-12);
  word-break: break-all;
}
.codebox span { flex: 1; }
.steps-list { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--frambuesa-70); }
.steps-list li + li { margin-top: 4px; }
.sep { height: 1.5px; margin: 18px 0; background: var(--palo); border: 0; }
.grid2 + .card, .card + .grid2, .grid2 + .grid2, .kpis + .card, .card + .savebar { margin-top: 16px; }
