/* Sama admin — crema, terracota y blush (muestra GlowStudio) */
:root {
  --noir: #2b2329;
  --noir-2: #362e34;
  --noir-3: #55423f;
  --noir-line: #efe4de;
  --paper: #fff7f9;
  --card: #ffffff;
  --ink: #21191f;
  --muted: #88726e;
  --line: #efe4de;
  --gold: #d97762;
  --gold-soft: #ffb4a4;
  --gold-deep: #994533;
  --gold-grad: #d97762;
  --blush: #fff0f8;
  --danger: #ba1a1a;
  --ok: #116c4a;
  --info: #874e58;
  --warn: #994533;
  --shadow: 0 4px 20px -2px rgba(43, 35, 41, 0.05), 0 2px 6px -1px rgba(217, 119, 98, 0.04);
  --radius: 16px;
  --radius-sm: 16px;
  --tap: 44px;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-script: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --nav-w: 248px;
  --top-h: 58px;
  --cursor-mano: url("../icons/cursor-mano.png") 12 8, pointer;
  --cursor-arrastre: url("../icons/cursor-mano.png") 12 8, grab;
  --cursor-arrastre-activo: url("../icons/cursor-mano-cerrada.png") 12 12, grabbing;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
#app { height: 100%; }
body {
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0.01em;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(255, 182, 193, .35) 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.01em;
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(217, 119, 98, .28);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.5) 50%, transparent 62%);
  transform: translateX(-130%);
}
.btn-primary:hover:not(:disabled)::after {
  transform: translateX(130%);
  transition: transform .7s ease;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--gold-soft);
  background: #f7efea;
  color: var(--gold-deep);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: #f7efea;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(217, 119, 98, .16);
}
textarea { min-height: 90px; resize: vertical; }
.form-error { color: var(--danger); font-size: 13px; margin: 0; }

/* Login */
.view-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 460px at 85% -8%, rgba(217, 119, 98, .2) 0%, transparent 62%),
    var(--paper);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 30px 34px;
  color: var(--ink);
  animation: riseIn .5s ease;
  box-shadow: 0 12px 32px -4px rgba(43, 35, 41, .1);
}
.login-card .brand { text-align: center; margin-bottom: 28px; display: grid; justify-items: center; line-height: 1; }
.login-card .brand strong {
  font-family: var(--font-ui);
  font-size: 36px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.03em;
  text-indent: 0;
  color: var(--ink);
  line-height: 1;
}
.login-card .brand span {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.login-card p { margin: 14px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 0; }
.login-card form { display: grid; gap: 14px; }
.login-card input { background: #f7efea; border-color: transparent; color: var(--ink); }
.login-card .btn-primary { width: 100%; margin-top: 8px; }

/* App shell: menú fijo a la izquierda; solo el contenido scrollea */
.view-app {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}
.sidenav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff7f9;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidenav .nav-title {
  display: grid;
  padding: 4px 12px 16px;
  line-height: 1;
}
.sidenav .nav-title strong {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.sidenav .nav-title span {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.sidenav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  opacity: 1;
  color: var(--noir-3);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: background .22s ease, color .22s ease, box-shadow .22s ease;
}
.sidenav a.active, .sidenav a:hover {
  background: #fff;
  color: var(--gold-deep);
  opacity: 1;
  transform: none;
  box-shadow: 0 4px 16px rgba(43, 35, 41, .06);
}
.nav-end {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.nav-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #fde8e4;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.nav-user b, .nav-user small { display: block; }
.nav-user b { font-size: 13px; line-height: 1.2; }
.nav-user small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.nav-grupo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-grupo + .nav-grupo {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.nav-section {
  margin: 14px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidenav a.nav-web { opacity: 1; color: var(--muted); }
.nav-ext { margin-left: auto; opacity: .7; letter-spacing: 0; text-transform: none; }
.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, .16), 0 5px 14px rgba(217, 45, 32, .32);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  animation: countPulse 2s ease infinite;
}
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.app-body {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: var(--top-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 249, .88);
  backdrop-filter: blur(16px);
}
.topbar-brand {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nav-toggle {
  display: none;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.nav-scrim { display: none; }
.topbar-accesos {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.top-acceso {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--noir-3);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.top-acceso:hover,
.top-acceso.active,
body.notas-abiertas .top-acceso[data-open-notas] {
  background: #fff;
  color: var(--gold-deep);
  box-shadow: 0 4px 16px rgba(43, 35, 41, .06);
}
.top-acceso .nav-count { margin-left: 0; }
.topbar-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; min-width: 0; }
.main {
  padding: 16px 20px 20px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
}
.loading-page { color: var(--muted); padding: 24px; text-align: center; animation: softPulse 1.4s ease infinite; }
@keyframes softPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.page-head h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.page-head h2::after { content: none; }
.page-lead { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.badge-pendiente { background: #fff0e6; color: var(--gold-deep); }
.badge-confirmada { background: #fde8ef; color: #b84f66; }
.badge-atendida { background: #e8f4ee; color: var(--ok); }
.badge-cancelada { background: var(--error, #ffdad6); background: #ffdad6; color: #93000a; }
.badge-no_show { background: #f3e4ec; color: #55423f; }
.badge-bloqueo { background: #f7efea; color: #55423f; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f2eae5; font-size: 13px; }
table.data th { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nombre { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }

/* Agenda */
.cal-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.cal-grid { display: grid; min-width: 640px; }
.cal-head, .cal-row { display: contents; }
.cal-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #f0ece6;
  height: 48px;
  min-height: 48px;
  position: relative;
}
.cal-time {
  font-size: 11px; color: var(--muted);
  padding: 4px 6px; background: #faf8f5;
  position: sticky; left: 0; z-index: 2;
  height: 48px;
  min-height: 48px;
  overflow: hidden;
  line-height: 40px;
}
.cal-col-title {
  position: sticky; top: 0; z-index: 3;
  background: #fff; padding: 10px 8px;
  font-weight: 500; border-bottom: 1px solid var(--line);
  text-align: center;
  height: 42px;
  box-sizing: border-box;
}
.cal-track { position: relative; }
.cal-event {
  position: absolute; left: 4px; right: 4px;
  border-radius: 10px; padding: 4px 6px;
  font-size: 12px; color: #fff; overflow: hidden;
  cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.14);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.cal-event:hover { transform: translateY(-2px) scale(1.01); filter: brightness(1.06); box-shadow: 0 10px 22px rgba(0,0,0,.2); }
.cal-event.pendiente { background: #d97762; }
.cal-event.confirmada { background: #874e58; }
.cal-event.atendida { background: #40916c; }
.cal-event.cancelada { background: #888; opacity: .55; }
.cal-event.no_show { background: #555; opacity: .55; }
.cal-event.bloqueo { background: repeating-linear-gradient(45deg, #4a4a4e, #4a4a4e 6px, #2e2e32 6px, #2e2e32 12px); }
.cal-event strong { display: block; font-weight: 500; }
.cal-event span { opacity: .9; }

.mes-cal { padding: 12px 12px 16px; background: var(--paper); }
.mes-titulo {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--gold-deep);
  text-transform: capitalize;
}
.mes-head, .mes-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mes-head span {
  text-align: center;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted, #7a6a62);
  padding-bottom: 4px;
}
.mes-dia {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.mes-dia.fuera { opacity: .45; background: #f7f4f2; }
.mes-dia.hoy { outline: 2px solid var(--gold-deep); }
.mes-dia.sel { background: #fff8f3; }
.mes-num { font-weight: 600; font-size: 13px; }
.mes-chip {
  display: block;
  border-radius: 8px;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1.25;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mes-chip.pendiente { background: #d97762; }
.mes-chip.confirmada { background: #874e58; }
.mes-chip.atendida { background: #40916c; }
.mes-mas { font-size: 11px; color: var(--gold-deep); }
@media (max-width: 760px) {
  .mes-dia { min-height: 64px; padding: 4px; }
  .mes-chip { font-size: 10px; }
}

.week-list { display: grid; gap: 12px; }
.week-day h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--gold-deep);
}

.agenda-dia-wrap { overflow: auto; background: var(--paper); }
.agenda-dia {
  display: grid;
  min-width: 280px;
  min-height: 420px;
  align-items: stretch;
}
.agenda-col {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.agenda-col-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.agenda-col-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.agenda-col-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.agenda-col-items {
  display: grid;
  gap: 8px;
  padding: 12px;
  align-content: start;
  flex: 1;
}
.agenda-vacia {
  margin: 24px 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
}
.agenda-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: var(--cursor-mano);
  box-shadow: 0 6px 14px rgba(10, 10, 12, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.agenda-item:hover {
  transform: translateY(-2px);
  border-color: var(--gold-soft);
  box-shadow: 0 12px 22px rgba(143, 113, 36, .12);
}
.agenda-item-hora {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
}
.agenda-item .nombre { font-size: 14px; }
.agenda-item-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.agenda-item .badge { justify-self: start; margin-top: 4px; }
.agenda-item.pendiente { border-left-color: var(--warn); }
.agenda-item.confirmada { border-left-color: var(--info); }
.agenda-item.atendida { border-left-color: var(--ok); }
.agenda-item.cancelada,
.agenda-item.no_show { border-left-color: #888; opacity: .78; }
.agenda-item.bloqueo {
  border-left-color: var(--noir-3);
  background: #f4f3f1;
}
.agenda-col-add {
  margin: 0 12px 14px;
  align-self: stretch;
}

@media (max-width: 1024px) {
  .agenda-dia { min-width: 0; }
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  display: grid; place-items: center; padding: 16px; z-index: 65;
  isolation: isolate;
  background: transparent;
  animation: fadeIn .2s ease;
}
.modal-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(43, 35, 41, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-backdrop.pin-stack { z-index: 70; }
.modal-backdrop.pin-stack::before { background: rgba(10,10,12,.55); }
html.dlg-nativo .modal-backdrop::before {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.modal {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: #fff; border-radius: 18px;
  padding: 16px 16px 12px; max-height: 90dvh; overflow: auto;
  animation: riseIn .32s ease;
  box-shadow: 0 24px 60px rgba(10,10,12,.18);
}
.modal.wide { width: min(820px, 100%); }
.modal h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
}
.modal.modal-dev h3 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.modal .form-error { color: var(--danger); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; margin-top: 12px; }
.form-grid { display: grid; gap: 8px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.servicios-rows { display: grid; gap: 8px; }
.servicio-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pago-servicios { display: grid; gap: 10px; margin: 8px 0; }
.pago-servicio {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.pago-servicio-head { display: flex; gap: 10px; align-items: flex-start; }
.pago-servicio-head label { display: flex; gap: 8px; align-items: flex-start; margin: 0; cursor: pointer; }
.pago-servicio .descuento-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pago-total { font-weight: 700; margin: 4px 0 0; }
.suggest { border: 1px solid var(--line); border-radius: 10px; max-height: 160px; overflow: auto; }
.suggest button {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; cursor: pointer;
}
.suggest button:hover { background: #f7f5f2; }

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 200;
  display: grid; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--noir); color: #fff; padding: 10px 14px;
  border-radius: 14px; min-width: 220px; font-size: 14px;
  animation: riseIn .28s ease;
  box-shadow: 0 12px 30px rgba(10,10,12,.22);
}
.toast.error { background: var(--danger); }

.soon { color: var(--muted); padding: 12px; font-size: 13px; }

.flags { display: flex; flex-wrap: wrap; gap: 8px; align-items: start; }
.flag {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 12px; cursor: pointer;
}
.flag.on { background: #d7eee3; border-color: #b7dcc8; }

.lead-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.lead-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.lead-stat:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(143, 113, 36, .10); border-color: var(--gold-soft); }
.lead-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
}
.lead-stat span { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.lead-stat.warn b { color: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.dev-form-card { margin-bottom: 16px; }
.dev-lead { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.dev-form-card .form-error { color: var(--danger); }
.notas-layer {
  position: fixed !important;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}
body.notas-abiertas .sidenav {
  z-index: 56;
}
.notas-panel {
  position: fixed;
  left: auto;
  top: auto;
  right: 20px;
  bottom: 20px;
  width: min(476px, calc(100vw - 24px));
  max-height: min(62dvh, 560px);
  overflow: auto;
  pointer-events: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 12px 14px;
  box-shadow: 0 18px 48px rgba(10, 10, 12, .28);
  animation: riseIn .28s ease;
}
.notas-panel.is-dragging {
  box-shadow: 0 22px 56px rgba(10, 10, 12, .38);
  user-select: none;
}
.notas-drag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -12px 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
  cursor: var(--cursor-arrastre);
  touch-action: none;
  background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.notas-drag:active { cursor: var(--cursor-arrastre-activo); }
.notas-drag-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
}
.notas-panel .page-head {
  position: static;
  background: none;
  padding-bottom: 0;
  margin-bottom: 6px;
}
.notas-panel .page-head h2 {
  font-size: 20px !important;
  margin: 0;
}
.notas-panel .toolbar { gap: 6px; }
.notas-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--gold-deep);
}
.notas-panel .dev-form-card {
  margin-bottom: 10px;
  padding: 10px 12px;
}
.notas-panel .dev-lead { margin: 0 0 8px; font-size: 12px; line-height: 1.45; }
.notas-panel textarea { min-height: 64px; }
.sidenav .nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: 999px;
  opacity: 1;
  color: var(--noir-3);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: background .22s ease, color .22s ease, box-shadow .22s ease;
}
.sidenav .nav-btn:hover,
.sidenav .nav-btn.active,
body.notas-abiertas .sidenav .nav-btn[data-open-notas] {
  background: #fff;
  color: var(--gold-deep);
  opacity: 1;
  transform: none;
  box-shadow: 0 4px 16px rgba(43, 35, 41, .06);
}
.page-dev .page-head h2,
.page-dev h2,
.page-dev h3,
.page-dev .dev-body h3,
.page-dev .dev-lead,
.page-dev label {
  font-family: var(--font-ui);
  font-style: normal;
  letter-spacing: 0.01em;
}
.page-dev .page-head h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}
.page-dev .dev-body h3 {
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
}
.dev-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
}
.dev-note.done { opacity: .72; }
.dev-note.done h3 { text-decoration: line-through; color: var(--muted); }
.dev-check {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 72px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.dev-check input { width: 22px; min-height: 22px; accent-color: var(--ok); cursor: pointer; }
.dev-body h3 { margin: 0 0 6px; font-size: 22px; }
.dev-body p { margin: 0 0 8px; line-height: 1.55; white-space: pre-wrap; }
.dev-body small { color: var(--muted); }
.dev-body .row-actions { margin-top: 10px; }
.dev-attach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dev-attach .btn { margin: 0; }
.dev-attach-hint { color: var(--muted); font-size: 12px; }
.dev-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dev-preview img,
.dev-shot img {
  display: block;
  max-width: min(280px, 100%);
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.dev-shot {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  display: inline-block;
  margin: 0 0 8px;
}

.cat-subtitle {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--gold-deep);
}
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 22px; }
.cat-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 22px; }
.cat-card {
  transition: box-shadow .22s ease, border-color .22s ease;
}
.cat-card:hover {
  box-shadow: 0 14px 28px rgba(143, 113, 36, .12);
  border-color: var(--gold-soft);
}
.cat-card.is-dragging,
.cat-svc.is-dragging { opacity: .4; }
.cat-card h3 { margin: 0 0 4px; font-size: 22px; }
.cat-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.cat-head-txt { min-width: 0; flex: 1; }
.cat-head-txt p { margin: 0; }
.cat-grip {
  flex-shrink: 0;
  width: 28px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: var(--cursor-arrastre);
  letter-spacing: -2px;
  font-size: 15px;
  line-height: 1;
}
.cat-grip:active { cursor: var(--cursor-arrastre-activo); }
.cat-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cat-tools .icon-btn { width: 32px; height: 32px; min-height: 32px; }
.icon-btn.cat-on { color: var(--gold-deep); border-color: var(--gold); background: #faf6ea; }
.icon-btn.cat-off-btn { color: var(--muted); }
.icon-btn.cat-del { color: var(--danger); }
.icon-btn.cat-del:hover {
  border-color: var(--danger);
  background: #fdf2f1;
  color: var(--danger);
}
.icon-btn.cat-del svg { display: block; }
.icon-btn.cat-lock { color: var(--muted); }
.icon-btn.cat-lock.on { color: var(--gold-deep); border-color: var(--gold); background: #faf6ea; }
.icon-btn.cat-lock svg { display: block; }
.cat-card.cat-off,
.cat-svc.cat-off { opacity: .7; }
.cat-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f4f0e8;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.cat-badge-lock {
  background: #faf6ea;
  color: var(--gold-deep);
}
.cat-add-svc {
  width: 100%;
  margin-top: 10px;
  border-style: dashed;
}
.cat-svc-list { display: grid; }
.cat-svc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.cat-svc-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.cat-svc-main strong { display: block; }
.cat-svc-meta { color: var(--muted); font-size: 12px; }
.cat-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cat-card ul { margin: 0; padding-left: 18px; color: var(--muted); }
.cat-price { color: var(--gold-deep) !important; font-family: var(--font-ui); font-size: 16px !important; font-weight: 600; }
.ciclo-campos {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ciclo-campos input { width: 72px; }
.ciclo-campos select { width: auto; min-width: 110px; min-height: 34px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-group { margin: 0 0 8px; }
.chip-group b {
  display: block; margin: 0 0 5px;
  font-size: 10px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-deep);
}
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.chip input:checked ~ span,
.chip:has(input:checked) {
  /* el label entero se pinta abajo */
}
.chip:has(input:checked) {
  background: var(--noir);
  border-color: var(--noir);
  color: var(--gold-soft);
}

.ficha { display: grid; gap: 12px; }
.ficha-top { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.ficha-avatar {
  width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, #1b1b20, #0a0a0c);
  color: var(--gold-soft);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 36px; font-style: normal; font-weight: 600;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold-soft);
}
.ficha-avatar img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ficha-meta { display: grid; gap: 2px; font-size: 13px; }
.ficha-meta small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ficha-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ficha-kpis div {
  border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ficha-kpis div:hover {
  transform: translateY(-2px);
  border-color: var(--gold-soft);
  box-shadow: 0 10px 20px rgba(143, 113, 36, .08);
}
.ficha-kpis b { display: block; font-family: var(--font-display); font-size: 26px; font-style: normal; font-weight: 600; color: var(--gold-deep); }
.ficha-kpis span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.foto-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.foto-item { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; }
.foto-item img { width: 100%; height: 100%; object-fit: cover; }
.foto-item button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border: 0; border-radius: 50%; background: rgba(10,10,12,.7); color: #fff;
  font-size: 11px; cursor: pointer;
}
.foto-add {
  width: 72px; height: 72px; margin: 0;
  display: grid; place-items: center; text-align: center;
  border: 1px dashed var(--line); border-radius: 8px;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  cursor: pointer;
}
.foto-add input { display: none; }
.hist { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.hist article { border-bottom: 1px solid var(--line); padding: 4px 0; font-size: 12px; }
.hist small { color: var(--muted); }
.hist-completo { max-height: 320px; }
.hist-item { display: grid; gap: 2px; }
.hist-item strong { font-size: 12px; color: var(--ink); }
.hist-pago strong { color: var(--gold-deep); }
.hist-cita strong { color: #5a4a3a; }
.fila-apagada { opacity: .55; }
.pipe-hist-cliente { display: grid; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.flag-cell { display: grid; gap: 4px; min-width: 140px; }
.flag-cell textarea {
  min-height: 52px; font-size: 12px; padding: 6px 8px;
}
.flag-cell .btn { min-height: 28px; font-size: 11px; }

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.perm-role {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: #fff;
}
.perm-role h3 { margin: 0 0 2px; font-size: 20px; }
.perm-role > p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.perm-mod { padding: 8px 0; border-top: 1px solid var(--line); }
.perm-mod h4 {
  margin: 0 0 6px; font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep);
}
.perm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-sw, .perm-pin {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; color: var(--ink); cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.perm-sw input, .perm-pin input { width: 14px; min-height: 14px; accent-color: var(--noir); }
.perm-sw:has(input:checked) { background: var(--noir); color: var(--gold-soft); border-color: var(--noir); }
.perm-pin:has(input:checked) { background: #f3ead2; border-color: var(--gold); }
.perm-save { margin-top: 10px; }

.agenda-bar {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr auto;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.agenda-bar-main { display: flex; align-items: center; gap: 12px; }
.agenda-bar-main h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  font-style: normal;
  color: var(--gold-deep);
  line-height: 1;
}
.seg-toggle {
  display: inline-flex;
  padding: 2px;
  background: #f3f1ec;
  border-radius: 999px;
}
.seg-opt {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
}
.seg-opt.on { background: var(--noir); color: var(--gold-soft); box-shadow: 0 6px 16px rgba(10,10,12,.18); }
.seg-opt { transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.agenda-nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; min-height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1;
  transition: border-color .2s ease, background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.icon-btn:hover { border-color: var(--gold); background: #faf6ea; transform: scale(1.06); box-shadow: 0 6px 14px rgba(143, 113, 36, .12); }
.agenda-nav input[type=date] {
  width: auto; min-height: 28px; padding: 2px 8px; font-size: 13px;
}
.btn-hoy {
  min-height: 28px; padding: 0 10px; border: 0; background: transparent;
  color: var(--gold-deep); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.agenda-actions { display: flex; align-items: flex-end; gap: 8px; }
.agenda-filter { margin: 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.agenda-filter select { min-height: 32px; min-width: 160px; }
.agenda-bar .btn-sm { min-height: 32px; font-size: 12px; padding: 0 12px; }

.outline {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.outline + .outline { margin-top: 8px; }
.outline summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none;
  font-size: 13px; letter-spacing: .04em;
}
.outline summary::-webkit-details-marker { display: none; }
.outline summary::before {
  content: "▸"; color: var(--gold-deep); margin-right: 6px;
}
.outline[open] summary::before { content: "▾"; }
.outline summary b {
  min-width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: #f3ead2; color: var(--gold-deep);
  font-size: 11px; font-weight: 600;
}
.outline-body { padding: 0 12px 12px; }
.seg-box small { display: block; margin-bottom: 6px; }
.seg-help { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.seg-estado {
  margin: 0 0 8px; font-size: 12px; color: var(--gold-deep);
  letter-spacing: .04em;
}
.seg-box textarea { min-height: 64px; font-size: 13px; }
.seg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seg-btn {
  min-height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 12px; cursor: pointer;
}
.seg-btn:hover { border-color: var(--gold); background: #faf6ea; }
.foto-unica { align-items: center; }
.foto-perfil { width: 96px; height: 96px; border-radius: 50%; }
.ficha-pro .pro-hero {
  display: grid; justify-items: center; text-align: center; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.pro-photo {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, #1b1b20, #0a0a0c);
  color: var(--gold-soft);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 48px; font-style: normal; font-weight: 600;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--gold-soft);
}
.pro-photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pro-id h3 { margin: 0; font-size: 22px; }
.pro-id p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.perm-intro {
  margin: 0 0 12px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; line-height: 1.5; color: var(--ink);
}
.perm-intro p { margin: 0 0 8px; }
.perm-intro ul { margin: 0; padding-left: 18px; color: var(--muted); }
.perm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.foto-hit {
  position: relative;
  cursor: pointer;
}
.foto-hit:hover, .foto-hit:focus-visible {
  box-shadow: 0 0 0 2px var(--gold);
  outline: none;
}
.foto-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 5px 6px;
  background: rgba(10, 10, 12, .78);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
}
.badge-recurrente { background: #efe6c9; color: var(--gold-deep); }
.cat-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px;
}
.cat-edit label { margin: 0; font-size: 11px; }
.cat-edit input { min-height: 34px; width: 92px; padding: 4px 8px; }
.cat-edit input.ciclo { width: 64px; }
.cat-edit .ciclo-campos select { min-height: 34px; font-size: 13px; }
.alerta-lista { display: grid; gap: 8px; }
.alerta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  background: #fff;
  animation: fadeUp .35s ease both;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.alerta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(143, 113, 36, .12);
  border-color: var(--gold-soft);
}
.alerta p { margin: 6px 0 4px; font-size: 13px; line-height: 1.45; }
.alerta small { color: var(--muted); font-size: 12px; }
.alerta .row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.alerta-ciclo_por_vencer { border-left-color: #c45c26; }

.pipe {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: stretch;
  min-height: min(62dvh, 640px);
}
.pipe-col {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  background: linear-gradient(180deg, #fff 0%, #f7efe8 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  min-height: 280px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.pipe-col:hover { box-shadow: 0 16px 36px rgba(143, 113, 36, .08); }
.pipe-col.over { outline: 2px dashed var(--gold); background: #faf6ea; transform: scale(1.01); }
.pipe-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.pipe-n {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--noir); color: var(--gold-soft);
  font-family: var(--font-display); font-size: 16px; font-weight: 600; flex: none;
}
.pipe-card:nth-child(1) { animation-delay: .02s; }
.pipe-card:nth-child(2) { animation-delay: .06s; }
.pipe-card:nth-child(3) { animation-delay: .1s; }
.pipe-card:nth-child(4) { animation-delay: .14s; }
.pipe-card:nth-child(5) { animation-delay: .18s; }
.pipe-card:nth-child(6) { animation-delay: .22s; }
.pipe-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-deep);
  line-height: 1.1;
}
.pipe-head small { color: var(--muted); font-size: 11px; }
.pipe-drop { flex: 1; min-height: 120px; }
.pipe-empty { margin: 18px 8px; color: var(--muted); font-size: 13px; font-style: italic; text-align: center; }
.pipe-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10,10,12,.05);
  animation: fadeUp .4s ease both;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pipe-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(143, 113, 36, .14); border-color: var(--gold-soft); }
.pipe-card a,
.pipe-card button {
  cursor: pointer;
}
.pipe-card.dragging { cursor: grabbing; }
.pipe-card.dragging { opacity: .4; transform: rotate(-2deg) scale(.98); }
.pipe-card p { margin: 4px 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
.pipe-card small { color: var(--muted); font-size: 11px; }
.pipe-datos {
  display: grid;
  gap: 6px;
  margin: 8px 0 2px;
}
.pipe-dato {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}
.pipe-dato span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1px;
}
.pipe-contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pipe-contact a {
  font-size: 11px; color: var(--gold-deep); text-decoration: none;
  letter-spacing: .04em; text-transform: uppercase;
}
.pipe-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: 6px;
}

@media (max-width: 1024px) {
  .view-app { grid-template-columns: 1fr; }
  .nav-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidenav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    height: 100dvh;
    z-index: 45;
    transform: translateX(-105%);
    transition: transform .24s ease;
    padding-top: max(18px, env(safe-area-inset-top));
  }
  body.nav-abierto .sidenav {
    transform: none;
    box-shadow: 18px 0 50px rgba(0, 0, 0, .28);
  }
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(43, 35, 41, .4);
  backdrop-filter: blur(6px);
  }
  .nav-scrim:not([hidden]) { display: block; }
  .app-body { height: 100dvh; }
  .topbar {
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    height: calc(var(--top-h) + env(safe-area-inset-top));
  }
  .topbar-user span {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-acceso { min-height: 34px; padding: 0 10px; font-size: 13px; }
  .topbar-brand { font-size: 28px; }
  .page-head h2 { font-size: 32px; }
  .agenda-bar-main h2 { font-size: 30px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .pago-servicio .descuento-grid { grid-template-columns: 1fr; }
  .servicio-row { grid-template-columns: 1fr auto; }
  .lead-stats { grid-template-columns: 1fr 1fr; }
  .dev-note { grid-template-columns: 1fr; }
  .ficha-top, .perm-grid, .ficha-kpis, .perm-grid-3, .agenda-bar { grid-template-columns: 1fr; }
  .alerta { grid-template-columns: 1fr; }
  .caja-layout { grid-template-columns: 1fr; }
  .caja-ticket { position: static; }
  .caja-alta { grid-template-columns: 1fr 1fr; }
  .caja-alta button { grid-column: 1 / -1; }
  .agenda-nav, .agenda-actions { justify-content: flex-start; }
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chat-shell { grid-template-columns: 1fr; }
  .chat-shell.abierto .chat-sidebar { display: none; }
  .chat-shell:not(.abierto) .chat-thread { display: none; }
  .chat-back { display: inline-flex; }
  .chat-burbuja { max-width: 88%; }
  .chat-thread-actions .btn { min-height: 36px; padding: 0 10px; font-size: 12px; }

  body.layout-pro-movil .sidenav {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: auto;
    transform: none;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    overflow: hidden;
    box-shadow: 0 -10px 28px rgba(10, 10, 12, .12);
    border-top: 1px solid rgba(201, 169, 81, .22);
  }
  body.layout-pro-movil .sidenav a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    font-size: 12px;
    letter-spacing: .04em;
    text-align: center;
    transform: none !important;
    box-shadow: none !important;
    border-radius: 12px;
    min-height: 48px;
  }
  body.layout-pro-movil .sidenav a.active {
    background: rgba(201, 169, 81, .22);
    opacity: 1;
  }
  body.layout-pro-movil .nav-count { margin-left: 0; }
  body.layout-pro-movil .app-body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  body.layout-pro-movil .nav-scrim { display: none !important; }
  body.layout-pro-movil .topbar-brand { display: block; }
}

@media (max-width: 860px) {
  .sidenav .nav-title strong { font-size: 30px; }
  .sidenav a { font-size: 13px; padding: 9px 10px; letter-spacing: .02em; }
  .nav-count { min-width: 18px; height: 18px; font-size: 9px; }
  .topbar-brand { display: none; }
  body.layout-pro-movil .topbar-brand { display: block; }
}

@media (max-width: 640px) {
  .login-card { padding: 28px 20px 24px; }
  .login-card .brand strong { font-size: 48px; }
  .main { padding: 10px 10px; }
  .page-head h2 { font-size: 26px; }
  .agenda-bar-main h2 { font-size: 26px; }
  .btn { min-height: 44px; }
  .modal { width: min(520px, 100%); padding: 14px 12px 10px; }
  .caja-alta { grid-template-columns: 1fr; }
  .caja-alta button { grid-column: auto; }
}

/* Chat interno */
.main:has(.chat-shell) {
  padding: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.chat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fbf6f2 100%);
}
.chat-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 6px;
}
.chat-side-head h2 {
  margin: 0;
  font-size: 32px;
}
.chat-side-head h2::after { display: none; }
.chat-hint {
  margin: 0 14px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.chat-buscar {
  margin: 0 12px 10px;
  min-height: 38px;
  width: calc(100% - 24px);
}
.chat-lista {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 12px;
}
.chat-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 14px;
  padding: 10px 8px;
  cursor: pointer;
  color: inherit;
  min-height: 58px;
}
.chat-item:hover { background: rgba(201, 169, 81, .10); }
.chat-item.active {
  background: rgba(201, 169, 81, .18);
  box-shadow: inset 3px 0 0 var(--gold);
}
.chat-avatar {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold-grad);
  color: var(--noir);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.chat-item-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chat-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.chat-item-top strong {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-time, .chat-preview, .chat-empty {
  color: var(--muted);
  font-size: 12px;
}
.chat-preview {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.chat-thread {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(720px 280px at 100% 0%, rgba(232, 217, 169, .18), transparent 55%), #faf7f3;
}
.chat-thread-vacio, .chat-solo-lectura {
  margin: auto;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  max-width: 340px;
}
.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.chat-thread-who { min-width: 0; flex: 1; }
.chat-thread-who strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-thread-who small { color: var(--muted); font-size: 12px; }
.chat-thread-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-back { display: none; }
.chat-mensajes {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-dia {
  align-self: center;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 6px 0;
}
.chat-burbuja {
  max-width: min(78%, 520px);
  padding: 8px 10px 6px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(10,10,12,.04);
  display: grid;
  gap: 4px;
}
.chat-burbuja.mia {
  align-self: flex-end;
  background: #f6edda;
  border-color: var(--gold-soft);
}
.chat-burbuja.suya { align-self: flex-start; }
.chat-burbuja.sistema {
  align-self: center;
  max-width: 90%;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.chat-autor { font-size: 11px; font-weight: 600; color: var(--gold-deep); }
.chat-burbuja p { margin: 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.chat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.chat-del {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.chat-del:hover { color: var(--danger); }
.chat-shot {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  display: block;
}
.chat-shot img, .chat-preview-adjunto img {
  display: block;
  max-width: 260px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 12px;
}
.chat-audio audio { width: min(240px, 100%); height: 36px; }
.chat-composer {
  flex-shrink: 0;
  padding: 8px 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 8px;
}
.chat-composer .form-error { color: var(--danger); }
.chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-composer textarea {
  min-height: 42px;
  max-height: 120px;
  resize: none;
}
.chat-icon-btn {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  margin: 0;
}
.chat-icon-btn:hover { border-color: var(--gold); background: #faf6ea; }
.chat-preview-adjunto, .chat-grabando {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px dashed var(--gold-soft);
  border-radius: 12px;
  background: #fffdf8;
}
.chat-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: countPulse 1s ease infinite;
}
.chat-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.chat-pick {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.chat-pick-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
}
.chat-pick-item small { color: var(--muted); }
.chat-modal-lead { margin: 0; color: var(--muted); font-size: 13px; }
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 10, 12, .82);
  display: grid;
  place-items: center;
  padding: 24px;
  gap: 12px;
}
.chat-lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

@media (max-width: 720px) {
  .notas-panel {
    width: min(476px, calc(100vw - 16px));
    max-height: min(58dvh, 520px);
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

.dash-recall { margin-bottom: 14px; }
.dash-recall-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.dash-recall h3 { margin: 0 0 4px; }
.dash-recall-lead {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 13px;
}
.dash-recall-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-recall-counts span {
  background: var(--blush);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--gold-deep);
}
.dash-recall-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  align-items: center;
}
.dash-recall-tools input { max-width: 280px; min-height: 40px; }
.dash-recall-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-recall-filters .is-on {
  background: var(--gold);
  color: #fff;
  border-color: transparent;
}
.dash-recall-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 640px);
  overflow: auto;
  padding-right: 4px;
}
.recall-group h4 {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.recall-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.recall-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.recall-who strong { font-size: 15px; }
.recall-svc, .recall-meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.recall-svc { color: var(--ink); }
.recall-track {
  margin-top: 10px;
  height: 12px;
  border-radius: 999px;
  background: #efe6d8;
  overflow: hidden;
}
.recall-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
}
.recall-row.recall-caliente .recall-track span,
.recall-row[data-estado="pronto"] .recall-track span,
.recall-row[data-estado="hoy"] .recall-track span { background: var(--gold); }
.recall-row[data-estado="vencido"] .recall-track span,
.recall-row[data-estado="llamar_ahora"] .recall-track span { background: var(--danger); }
.recall-row[data-estado="agendada"] .recall-track span { background: var(--info); }
.recall-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.recall-foot b { font-size: 14px; }
.recall-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-meta { margin-bottom: 14px; }
.dash-meta-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.dash-meta-top small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dash-meta-top strong {
  font-size: 20px;
  color: var(--gold-deep);
}
.dash-bar {
  height: 10px;
  border-radius: 999px;
  background: #efe6d8;
  overflow: hidden;
}
.dash-bar span {
  display: block;
  height: 100%;
  background: var(--gold-grad);
  border-radius: inherit;
  transition: width .35s ease;
}
.dash-kpis { margin-bottom: 14px; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.dash-grid .card h3,
.dash-citas h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-family: var(--font-ui);
  font-weight: 700;
}
.dash-spark {
  width: 100%;
  height: 120px;
  display: block;
}
.dash-spark-line {
  stroke: var(--gold-deep);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.dash-spark-fill { fill: rgba(201, 169, 81, .18); }
.dash-serie-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.dash-legend { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.dash-medios, .dash-top {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.dash-medios li, .dash-top li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.dash-medios li { grid-template-columns: 1fr auto; }
.dash-top b { color: var(--gold-deep); }
.dash-top small { color: var(--muted); }
.dash-citas { margin-bottom: 18px; }
.dash-equipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.dash-member h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: var(--font-ui);
}
.dash-member p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.dash-member-kpis {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
}
.dash-member-kpis b { color: var(--ink); }
.dash-perfil h4 {
  margin: 12px 0 6px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.dash-perfil-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.dash-perfil-list li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
}
.dash-perfil-list li.done { opacity: .65; }
.dash-perfil-list small { color: var(--muted); font-size: 11px; }

.cfg-cal-card { padding: 18px 18px 16px; }
.cfg-cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cfg-cal-nav h3 {
  margin: 0;
  min-width: 180px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--gold-deep);
}
.cfg-weekdays,
.cfg-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cfg-weekdays {
  margin-bottom: 6px;
}
.cfg-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cfg-day {
  position: relative;
  min-height: 44px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.cfg-day:hover:not(:disabled) {
  border-color: var(--gold);
  background: #faf6ea;
}
.cfg-day-empty { border: 0; background: transparent; min-height: 44px; cursor: default; }
.cfg-day-hoy { box-shadow: inset 0 0 0 1.5px var(--gold); font-weight: 600; }
.cfg-day-past { opacity: .4; cursor: default; }
.cfg-day-off {
  background: repeating-linear-gradient(-45deg, #faf6ea, #faf6ea 6px, #fff 6px, #fff 12px);
  border-color: var(--gold);
  color: var(--gold-deep);
}
.cfg-day-hover,
.cfg-grid[data-modo="mes"]:hover .cfg-day:not(:disabled):not(.cfg-day-empty) {
  border-color: var(--gold);
  background: #faf6ea;
}
.cfg-day-lock {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  color: var(--gold-deep);
}
.cfg-day-dot,
.cfg-swatch-citas {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-deep);
}
.cfg-day-dot {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
}
.cfg-leyenda {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.cfg-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  vertical-align: -2px;
}
.cfg-swatch-off {
  background: repeating-linear-gradient(-45deg, #faf6ea, #faf6ea 4px, #fff 4px, #fff 8px);
  border-color: var(--gold);
}
.cfg-grupos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.cfg-grupo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cfg-grupo div { display: grid; gap: 2px; min-width: 0; }
.cfg-grupo span { color: var(--muted); font-size: 12px; }

.caja-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.caja-catalogo { min-width: 0; }
.caja-alta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 110px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.caja-grupo { margin-bottom: 14px; }
.caja-grupo h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.caja-prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}
.caja-prod {
  display: grid;
  gap: 4px;
}
.caja-prod-btn {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(10, 10, 12, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.caja-prod-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold-soft);
  box-shadow: 0 12px 22px rgba(143, 113, 36, .12);
}
.caja-prod-btn:disabled { opacity: .7; cursor: default; }
.caja-prod-btn strong { font-size: 14px; line-height: 1.25; }
.caja-prod-btn span { color: var(--gold-deep); font-weight: 600; font-size: 13px; }
.caja-prod-tools { display: flex; gap: 4px; justify-content: flex-end; }
.caja-ticket {
  position: sticky;
  top: 8px;
  padding: 12px;
}
.caja-ticket h3,
.caja-historial h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--gold-deep);
}
.caja-ticket-body {
  display: grid;
  gap: 8px;
  min-height: 88px;
  margin-bottom: 12px;
}
.caja-ticket-vacio {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
}
.caja-linea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.caja-linea-info { display: grid; gap: 1px; min-width: 0; }
.caja-linea-info strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.caja-linea-info span { font-size: 11px; color: var(--muted); }
.caja-qty { display: inline-flex; align-items: center; gap: 4px; }
.caja-qty b { min-width: 18px; text-align: center; font-size: 13px; }
.caja-qty-btn { min-height: 28px; min-width: 28px; padding: 0; }
.caja-linea-sub { font-size: 13px; font-weight: 600; white-space: nowrap; }
.caja-ticket-foot { display: grid; gap: 8px; }
.caja-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.caja-total b {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--gold-deep);
}
.caja-ticket-actions { display: flex; gap: 8px; }
.caja-ticket-actions .btn { flex: 1; }
.caja-historial { margin-bottom: 16px; }
.historial-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.caja-historial .historial-head h3 { margin: 0; }
.caja-historial .historial-sub { margin: 18px 0 8px; }
.filtro-fecha {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.filtro-fecha input { min-height: 36px; width: 11rem; max-width: 100%; }
.filtro-periodo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.filtro-periodo select {
  min-height: 36px;
  min-width: 8.5rem;
  max-width: 100%;
}
.historial-resumen { margin: 0 0 8px; color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
  .dash-recall-tools input { max-width: none; flex: 1 1 100%; }
  .recall-actions { width: 100%; }
  .recall-actions .btn { flex: 1; }
}
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-meta-top { grid-template-columns: 1fr; }
  .cfg-cal-nav h3 { font-size: 22px; min-width: 0; }
  .cfg-day { min-height: 40px; font-size: 12px; padding: 6px 2px; }
  .caja-layout { grid-template-columns: 1fr; }
  .caja-ticket { position: static; }
  .caja-alta { grid-template-columns: 1fr 1fr; }
  .caja-alta button { grid-column: 1 / -1; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.contable-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.contable-kpis .lead-stat b { font-size: 26px; overflow-wrap: anywhere; }
.contable-kpi-block { margin: 0 0 14px; }
.contable-kpi-title {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.contable-kpi-anio { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--line); }
.contable-head .toolbar { flex: 1 1 280px; justify-content: flex-end; }
.contable-mes input { width: 11rem; max-width: 100%; }
.lead-stat.ok b { color: var(--ok); }
.lead-stat.egreso b { color: var(--danger); }
.mov-card.egreso strong,
.monto-egreso,
.mov-card.egreso .mov-top strong { color: var(--danger); }
.monto-ingreso { color: var(--ok); }
table.data tr.mov-egreso td { background: #ffecec; }
.mov-card.egreso { background: #ffecec; }
.contable-mes { display: flex; align-items: center; gap: 8px; margin: 0; }
.contable-mes input { min-height: 36px; }
.contable-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, .85fr);
  gap: 12px;
  margin: 0 0 12px;
}
.contable-egresos { margin-top: 18px; }
.contable-egresos-head { margin-bottom: 10px; align-items: center; }
.contable-egresos-head h2 { font-size: 1.15rem; margin: 0; }
.contable-layout h3,
.contable-detalle h3 { margin: 0 0 10px; font-size: 16px; }
.contable-tabla { overflow-x: auto; }
.contable-nota { display: block; color: var(--muted); margin-top: 2px; max-width: 280px; }
.contable-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contable-cats li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  font-size: 14px;
}
.contable-cats small { color: var(--muted); }

@media (max-width: 1024px) {
  .lead-stats.contable-kpis { grid-template-columns: 1fr 1fr; }
  .contable-kpis .lead-stat.liquido { grid-column: 1 / -1; }
  .contable-layout { grid-template-columns: 1fr; }
}

.tabbar { display: none; }
.tabbar a, .tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
}
.tabbar svg { width: 20px; height: 20px; }
.tabbar a.active, .tabbar button:hover {
  background: #fff;
  color: var(--gold-deep);
  box-shadow: 0 4px 14px rgba(43, 35, 41, .06);
}

@media (max-width: 1024px) {
  body.layout-compacto .nav-toggle { display: none !important; }
  body.layout-compacto .topbar-brand { display: block; }
  body.layout-compacto #lbl-usuario { display: none; }
  body.layout-compacto .main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .tabbar:not([hidden]) {
    display: flex;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 35;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 247, 249, .92);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 32px -4px rgba(43, 35, 41, .12);
  }
}

@media (min-width: 1025px) {
  .topbar-brand { display: none; }
}

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

.agenda-dias {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.agenda-dia-chip {
  min-width: 56px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 8px 6px 7px;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.agenda-dia-chip span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.agenda-dia-chip b { font-size: 16px; font-weight: 700; }
.agenda-dia-chip.on {
  background: #2b2329;
  border-color: #2b2329;
  color: #fff;
}
.agenda-dia-chip.on span { color: #f4acb7; }
.agenda-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.agenda-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.agenda-chip.on {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.cita-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(43, 35, 41, .04);
}
.cita-card-time b { display: block; font-size: 15px; letter-spacing: -.02em; }
.cita-card-time small { color: var(--muted); font-size: 11px; }
.cita-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.cita-card p { margin: 2px 0 0; font-size: 13px; color: #55423f; }
.cita-card small { color: var(--muted); font-size: 12px; }
.cita-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cita-card.pendiente { box-shadow: inset 3px 0 0 #d97762, 0 8px 20px rgba(43, 35, 41, .04); }
.cita-card.confirmada { box-shadow: inset 3px 0 0 #40916c, 0 8px 20px rgba(43, 35, 41, .04); }
.cita-card.atendida { box-shadow: inset 3px 0 0 #116c4a, 0 8px 20px rgba(43, 35, 41, .04); }
.cita-card.cancelada,
.cita-card.no_show { opacity: .72; }
.cita-card.bloqueo { background: #f7efea; cursor: pointer; }
.agenda-dia-movil { grid-template-columns: 1fr !important; }
.agenda-dia-movil .agenda-col { min-height: 0; border-right: 0; }
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 8px 24px rgba(43, 35, 41, .04);
  display: grid;
  gap: 6px;
  align-content: start;
}
.kpi-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-card b {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.kpi-card.sage { background: linear-gradient(180deg, #f3fbf6, #fff); }
.kpi-card.sage b { color: #116c4a; }
.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .7fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}
.aviso-panel h3 small { color: var(--muted); font-weight: 600; font-size: 13px; }
.aviso {
  background: #fff4ee;
  border: 1px solid #f3d2c4;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 6px;
}
.aviso-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.aviso-tipo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #994533;
}
.aviso-fecha { font-size: 12px; color: var(--muted); }
.aviso p { margin: 0; font-size: 13px; line-height: 1.4; color: #55423f; }
.aviso .nombre { font-size: 16px; }
.aviso-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.aviso-ciclo_por_vencer,
.aviso-cita_sin_confirmar { background: #fff0e6; }
.aviso-cumpleanos,
.aviso-lead_sin_respuesta { background: #fff5f7; border-color: #f4d0d8; }
.aviso-no_show { background: #fff1f0; border-color: #f5c2be; }
.pipe-head-row { display: flex; align-items: center; gap: 10px; }
.pipe-head-row .nombre { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.pipe-card-mini {
  padding: 10px 12px;
}
.pipe-card-mini .pipe-head-row > div {
  min-width: 0;
}
.chip-codigo {
  margin-top: 4px;
  cursor: default;
  pointer-events: none;
  font-size: 11px;
  padding: 3px 10px;
}
.chip-codigo:hover {
  border-color: var(--line);
  transform: none;
}
.pipe-ficha { display: grid; gap: 12px; }
.pipe-ficha-head { margin-bottom: 0; }
.pipe-ficha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.pipe-ficha-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.pipe-quote {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fff7f9;
  border-radius: 12px;
  font-size: 13px;
  color: #55423f;
  font-style: italic;
}
.pipe-interes { margin: 6px 0 0; font-size: 13px; color: var(--ink); }
.pipe-contact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mov-lista { display: none; }
.mov-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.mov-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mov-card p { margin: 0; font-size: 14px; }
.mov-card small { color: var(--muted); }
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-split { grid-template-columns: 1fr; }
  .mov-lista { display: grid; gap: 8px; }
  .caja-historial .contable-tabla,
  #lista-pagos .contable-tabla { display: none; }
}
@media (max-width: 640px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .cita-card { grid-template-columns: 64px minmax(0, 1fr); }
}
.sidenav .nav-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--noir-3);
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
  opacity: .72;
}
.sidenav .nav-lock:hover { background: transparent; color: var(--noir-3); }
.nav-candado { margin-left: auto; font-size: 14px; }
#finanzas-body .page-head h2 { display: none; }
#finanzas-body .page-head { margin-bottom: 8px; }
.hist-fila { cursor: pointer; }
.hist-fila.on { background: #fff7f9; }
.hist-detalle td { background: #faf7f4; padding-top: 8px; padding-bottom: 12px; }
.hist-servicios { width: 100%; }
.hist-estado { display: inline-block; margin-left: 6px; color: var(--muted); font-weight: 600; }
.hist-bloque { margin-bottom: 18px; }
.hist-bloque > h3 { margin: 0 0 6px; font-size: 1.05rem; }
.hist-bloque-lead { margin: 0 0 12px; }
.hist-mov-tabla { width: 100%; }
.hist-cuando { white-space: nowrap; }
.hist-cuando small { display: block; color: var(--muted); font-size: 12px; }
.hist-tipo {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
}
.hist-mov.ingreso .hist-monto { color: #116c4a; font-weight: 700; }
.hist-mov.egreso .hist-monto { color: #93000a; font-weight: 700; }
.hist-tipo-gasto { color: #93000a; }
.hist-tipo-venta_servicio,
.hist-tipo-venta_caja { color: #116c4a; }
@media (max-width: 720px) {
  .hist-mov-tabla th:nth-child(4),
  .hist-mov-tabla td:nth-child(4) { display: none; }
}

.inv-acciones, .inv-fila-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-acciones { margin: 0 0 14px; }
.inv-acciones .btn, .inv-fila-acciones .btn { min-height: 44px; }
.inv-filtros { display: grid; gap: 8px; margin-bottom: 14px; }
.inv-nota { color: var(--muted); font-size: 14px; margin: 4px 0; }
.inv-preview {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--blush);
  font-weight: 600;
}
.inv-preview-error { background: #ffdad6; color: #93000a; }
.inv-estado { font-weight: 700; }
.inv-ok { color: #116c4a; }
.inv-bajo { color: #8a5a00; }
.inv-agotado { color: #93000a; }
.inv-estado::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
.inv-mas { margin-top: 4px; }
.inv-mas summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.inv-mas label { margin-top: 8px; }
.inv-historial { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inv-historial li { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.inv-anulado { opacity: .72; text-decoration: line-through; }
.inv-anulado .btn, .inv-anulado .inv-nota { text-decoration: none; }
.modal-inv { max-width: 520px; }
@media (min-width: 800px) {
  .inv-filtros { grid-template-columns: 1.4fr 1fr .8fr .9fr; align-items: end; }
}
@media (max-width: 800px) {
  .inv-tabla thead { display: none; }
  .inv-tabla, .inv-tabla tbody, .inv-tabla tr, .inv-tabla td { display: block; width: 100%; }
  .inv-tabla tr {
    margin-bottom: 12px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
  }
  .inv-tabla td { border: 0; padding: 6px 10px; }
  .inv-tabla td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}
html[data-tema="noche"] .inv-ok { color: #b7ebc9; }
html[data-tema="noche"] .inv-bajo { color: #ffe08a; }
html[data-tema="noche"] .inv-agotado { color: #ffc7c2; }
html[data-tema="noche"] .inv-preview-error { background: #4a1c1c; color: #ffc7c2; }

@media print {
  .sidenav, .topbar, .tabbar, .no-print { display: none !important; }
  .main { padding: 0 !important; }
}

html[data-tema="noche"] {
  color-scheme: dark;
  --paper: #161216;
  --card: #241c22;
  --ink: #f8f1ef;
  --muted: #c9b4ae;
  --line: #3d3238;
  --noir-line: #3d3238;
  --blush: #2c2228;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
html[data-tema="noche"] body {
  background: var(--paper);
  color: var(--ink);
}
html[data-tema="noche"] input,
html[data-tema="noche"] select,
html[data-tema="noche"] textarea {
  background: #1c161a;
  color: var(--ink);
  border-color: var(--line);
}
html[data-tema="noche"] input:focus,
html[data-tema="noche"] select:focus,
html[data-tema="noche"] textarea:focus { background: #2a2226; }
html[data-tema="noche"] .btn-ghost:hover:not(:disabled) { background: #2a2226; color: var(--gold-soft); }
html[data-tema="noche"] table.data th,
html[data-tema="noche"] table.data td { border-bottom-color: var(--line); }
html[data-tema="noche"] .sidenav,
html[data-tema="noche"] .topbar { background: #1c161a; }
html[data-tema="noche"] .top-acceso:hover,
html[data-tema="noche"] .top-acceso.active,
html[data-tema="noche"] body.notas-abiertas .top-acceso[data-open-notas] {
  background: #2a2226;
  color: var(--gold-soft);
}
