/* ============================================================
   Pelucrm · Estilos
   Dirección "poste de barbería": grafito, concreto, rojo y azul poste.
   Elemento distintivo: las rayas del poste (sección activa, logo, énfasis).
   Tipografías: Big Shoulders Display (títulos), Figtree (texto),
   JetBrains Mono (horarios y montos).
   ============================================================ */

:root {
  --bg: #EDEFF3;
  --surface: #FFFFFF;
  --ink: #15171D;
  --muted: #5F6470;
  --line: #D7DBE4;
  --accent: #D63A2D;          /* rojo de botones: texto blanco encima con contraste AA */
  --accent-strong: #B32F23;
  --accent-ink: #B8322A;      /* rojo para textos y links (más oscuro, legible sobre blanco y gris) */
  --accent-soft: #FCE6E3;
  --plum: #3557D6;
  --green: #3E7C59;
  --gold: #C99B4A;
  --side: #15171D;
  --side-ink: #C9CFDA;
  --side-active: #262B36;
  --danger: #C9372B;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 23, 29, .05), 0 6px 20px -12px rgba(21, 23, 29, .18);
  --font-display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
  --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --blue: #3557D6;
  --blue-soft: #E5EAFA;
  --bone: #F1EEE8;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  /* Las rayas del poste: rojo, hueso, azul, hueso. */
  --poste: repeating-linear-gradient(-45deg, #E5483B 0 7px, #F1EEE8 7px 11px, #3557D6 11px 18px, #F1EEE8 18px 22px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: .01em; }
h1 { font-size: 26px; }
h2 { font-size: 16px; font-family: var(--font-body); font-weight: 700; }
h3 { font-size: 15px; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-strong); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ta-r { text-align: right; }
.pad { padding: 14px 16px; }
.mt-8 { margin-top: 8px; }
.h-count {
  display: inline-block; background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; padding: 1px 10px; font-size: 13px; margin-left: 6px;
}

/* ---------- Layout ---------- */
/* minmax(0, 1fr): el contenido ancho (calendario, tablas) se desplaza dentro de su
   tarjeta en lugar de ensanchar toda la página. */
#app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; }

.sidebar {
  background: var(--side);
  color: var(--side-ink);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
  z-index: 20;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 12px;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #F0695B);
  color: #fff; display: grid; place-items: center; flex: none;
}
.brand strong { color: #F1EEE8; font-family: var(--font-display); font-size: 17px; display: block; line-height: 1.2; }
.brand small { color: var(--side-ink); opacity: .65; font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  color: var(--side-ink); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.nav-item svg { flex: none; opacity: .85; }
.nav-badge {
  font-style: normal; margin-left: auto;
  background: var(--accent); color: #fff;
  font-size: 11px; border-radius: 999px;
  min-width: 20px; height: 20px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 6px;
}

.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.type-chip {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--side-ink);
  background: rgba(255, 255, 255, .06);
  border-radius: 9px; padding: 7px 10px;
}
.side-profile {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 4px 2px;
}
.side-profile .avatar { width: 30px; height: 30px; font-size: 12px; }
.side-profile strong { color: #F1EEE8; font-size: 12.5px; display: block; line-height: 1.25; }
.side-profile small { color: var(--side-ink); opacity: .6; font-size: 11px; }

.main { padding: 26px 34px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Encabezado de página ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head p { margin: 3px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 15px; font-size: 13.5px; font-weight: 600;
  font-family: var(--font-body); cursor: pointer; line-height: 1.2;
  transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px -4px rgba(229, 72, 59, .5); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #BCC1CE; background: #F5F6F9; }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-soft:hover { background: #F8D5D0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A72E24; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-strong); }
.icon-btn.wa:hover { background: #E4F2E7; color: #2E7D4F; }
.icon-btn.danger:hover { background: #FBE4E1; color: var(--danger); }

.link { font-weight: 600; font-size: 13px; color: var(--accent-ink); }
.link-btn { background: none; border: none; cursor: pointer; padding: 0; font-family: var(--font-body); }

/* ---------- Tarjetas y KPI ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.card-list { padding: 8px 10px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card-head h2 { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.card-head h2 svg { color: var(--accent-ink); flex: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }

.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi-ico {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; margin-bottom: 10px;
}
.kpi-num { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; }
.kpi-lbl { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi-warn .kpi-ico { background: #FDF0DC; color: #9A5A1F; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; }

/* ---------- Listas ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 10px;
  border-top: 1px solid #E6E9EF;
}
.list-row:first-child { border-top: none; }
.list-row:hover { background: #F4F5F8; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-main strong { font-size: 13.5px; }
.list-main .muted { line-height: 1.4; }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%; color: #fff; font-weight: 700;
  display: inline-grid; place-items: center; flex: none;
  letter-spacing: .02em; box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .12);
}

/* ---------- Pills, chips, etiquetas ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: #E2E5EC; color: #535865;
  border-radius: 999px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill-cumple { background: #FBE4E1; color: #A9302A; }
.pill-ok { background: #E3EFE6; color: #2E6B45; }
.pill-warn { background: #FDF0DC; color: #8A5216; }
.pill-info { background: #E5EAFA; color: #2F4BB8; }
.pill-danger { background: #FBE4E1; color: #A9302A; }
.pill-neutral { background: #E2E5EC; color: #535865; }

.tag {
  display: inline-block; background: #E9EBF1; color: #5A6172;
  border-radius: 6px; padding: 1px 8px; font-size: 11px; font-weight: 600;
}
.tags { display: inline-flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body);
  transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: #BCC1CE; color: var(--ink); }
.chip-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px; height: 38px;
  color: var(--muted); min-width: 240px;
}
.search-box input {
  border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 13.5px; width: 100%; color: var(--ink);
}

/* Acciones de cada turno en Inicio: en pantallas angostas bajan a su propia línea. */
.turno-acc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
html.vw-chico .turno-dash { flex-wrap: wrap; }
html.vw-chico .turno-dash .turno-acc { flex-basis: 100%; justify-content: flex-start; padding-left: 70px; }

/* Servicios y precios (Configuración) */
.svc-head, .svc-fila { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.svc-head { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 10px 0 6px; }
.svc-lista { display: flex; flex-direction: column; gap: 6px; }
.svc-fila input, .svc-fila select { padding: 7px 9px; }
.svc-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
html.vw-chico .svc-head span:nth-child(3) { visibility: hidden; }

.drawer-ctas-main { margin-bottom: 6px; }
.proximo-check { justify-self: start; }

.ventas-head { flex-wrap: wrap; gap: 10px; }
.ventas-head .search-box { flex: 1 1 260px; max-width: 460px; }
.ventas-resumen { padding: 0 4px 8px; }
.ta-c { text-align: center; }
.rank-nota { margin: -4px 0 8px; }

/* Caja del día (Ventas) */
.caja-dia .caja-total { font-family: var(--font-display, inherit); font-size: 28px; font-weight: 700; }
.caja-metodos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.caja-metodos > div { background: #EFF1F5; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.caja-metodos strong { font-size: 16px; }
.caja-nav { display: flex; align-items: center; gap: 6px; }
.caja-nav input { width: auto; padding: 6px 8px; }
html.vw-chico .caja-metodos { grid-template-columns: 1fr; }

/* Buscador de la Agenda */
.agenda-toolbar .search-box { flex: 1 1 320px; max-width: 520px; }
.agenda-sub {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 10px 16px 4px;
}
.cita-cli { font-weight: 600; color: var(--ink); }
/* Aviso de cliente con el mismo nombre */
.cli-dup {
  background: #FFF6E0; border: 1px solid #EBCB7A; border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.cli-dup[hidden] { display: none; }
.cli-dup label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.cli-dup input { accent-color: var(--accent); margin-top: 3px; }

/* ---------- Tabla ---------- */
.tbl-wrap { overflow-x: auto; border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid #E6E9EF; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #F4F5F8; }
.cli-cell { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.cli-cell strong { display: block; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

.contacto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ct-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; }
.ct-ico.wa { background: #E4F2E7; color: #2E7D4F; }
.ct-ico.ig { background: #FCE6E3; color: #C93A2E; }
.ct-ico.tel { background: #E5EAFA; color: #3557D6; }
.ct-ico.mail { background: #FDF0DC; color: #9A5A1F; }
.ct-ico.pre { background: #E2E5EC; color: #535865; }

.estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--green); box-shadow: 0 0 0 3px rgba(62, 124, 89, .15); }
.dot-off { background: #9FA4AF; box-shadow: 0 0 0 3px rgba(150, 158, 172, .18); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: #4C5059; }

.input, input:not([type]), input[type="text"], input[type="search"], input[type="tel"], input[type="email"], input[type="url"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="number"], select, textarea {
  font-family: var(--font-body); font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; background: #FFFDFB; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
select { appearance: auto; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 72, 59, .13);
}
.sel { width: auto; }

.checks { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.check {
  display: inline-flex; align-items: center; gap: 5px;
  background: #EFF1F5; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer;
}
.check input { accent-color: var(--accent); margin: 0; }

/* Cliente nuevo / de paso dentro de venta y turno */
.cliente-nuevo {
  background: #F1F2F6; border: 1px dashed #E2C9B0; border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.cliente-nuevo[hidden] { display: none; }
.cliente-nuevo p { margin: 0; color: #4C5059; }
.cn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.cn-grid .cn-tel { grid-column: span 2; }
html.vw-chico .cn-grid { grid-template-columns: 1fr; }
html.vw-chico .cn-grid .cn-tel { grid-column: span 1; }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #F5F6F9;
  border-radius: 10px; padding: 9px 14px; font-size: 13px;
  cursor: pointer; font-weight: 600;
}
.radio input { accent-color: var(--accent); margin: 0; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
code { background: #E6E9EF; border-radius: 5px; padding: 1px 6px; font-size: 12px; }

/* ---------- Chart ---------- */
.chart { display: flex; gap: 12px; align-items: stretch; height: 210px; padding: 6px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.chart-val { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bar {
  width: 100%; max-width: 48px; min-height: 4px;
  background: linear-gradient(180deg, #F0695B, var(--accent));
  border-radius: 8px 8px 3px 3px;
  transition: height .4s;
}
.chart-lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid #E6E9EF; }
.rank-row:first-of-type { border-top: none; }
.rank-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rank-bar { height: 5px; background: #E6E9EF; border-radius: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- Citas ---------- */
.cita-row { align-items: center; flex-wrap: wrap; }
.cita-row .list-main { min-width: 180px; }
.cita-row .row-actions { flex-wrap: wrap; gap: 4px; }
.date-badge {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: var(--accent-soft); color: var(--accent-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.1;
}
.date-badge strong { font-family: var(--font-display); font-size: 18px; }
.date-badge small { font-size: 11px; text-transform: uppercase; font-weight: 700; }

/* ---------- Ideas ---------- */
.ideas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.idea-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.idea-card .pill { align-self: flex-start; }
.idea-card p { margin: 0; font-size: 13.5px; flex: 1; }
.idea-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: linear-gradient(135deg, #FDEFED, #E5EAFA);
  border: 1px solid #F3DDD9; border-radius: var(--radius);
  padding: 14px 18px; color: #6B4A33; font-size: 13.5px;
}
.banner svg { flex: none; margin-top: 2px; }
.muted-banner { background: #E7EAF0; border-color: var(--line); color: var(--muted); }

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(21, 23, 29, .4);
  z-index: 40; animation: fadeIn .18s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 94vw;
  background: var(--surface); z-index: 50;
  box-shadow: -18px 0 50px -20px rgba(21, 23, 29, .4);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; gap: 13px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #F3F5F8, #FFFFFF);
}
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { font-family: var(--font-display); font-size: 19px; }
.drawer-sub { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.drawer-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
}
.drawer-stats > div {
  background: #F4F5F8; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 8px; text-align: center;
}
.drawer-stats strong { display: block; font-family: var(--font-display); font-size: 16px; }
.drawer-stats small { color: var(--muted); font-size: 11px; }

.drawer-ctas { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.drawer-sec { padding: 14px 0; border-top: 1px solid #E6E9EF; }
.drawer-sec h3 { font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.drawer-sec p { margin: 4px 0 10px; font-size: 13.5px; }
.notas { background: #FFF9F0; border: 1px solid #DADEE8; border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; }

.alert-sec { background: #F0F2F6; border: 1px solid #CED3E0; border-radius: 12px; padding: 14px; margin-top: 12px; }

.drawer-contacts { list-style: none; margin: 0; padding: 0; }
.drawer-contacts li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 13px; border-top: 1px solid #ECEEF3;
}
.drawer-contacts li:first-child { border-top: none; }
.drawer-contacts li svg { color: var(--accent-ink); flex: none; }
.drawer-contacts li span { color: var(--muted); width: 108px; flex: none; font-size: 12.5px; }
.drawer-contacts li strong { font-weight: 600; overflow-wrap: anywhere; }

.hist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-top: 1px solid #ECEEF3;
}
.hist-row:first-of-type { border-top: none; }
.hist-row strong { display: block; font-size: 13.5px; }
.hist-right { display: flex; align-items: center; gap: 8px; }

/* Ficha: resumen del historial y desglose por servicio */
.hist-resumen li span { width: 150px; }
.txt-warn { color: #C93A2E; font-weight: 700; }
.hist-tabla { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
.hist-tabla th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px;
  padding: 6px 4px; border-bottom: 1px solid var(--line);
}
.hist-tabla td { padding: 6px 4px; border-bottom: 1px solid #ECEEF3; }
.hist-tabla th:nth-child(n+2), .hist-tabla td:nth-child(n+2) { text-align: right; white-space: nowrap; }

/* Inicio: turno de hoy desplegable (historial + campañas) */
.turno-cliente {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; margin: 0;
  background: none; border: 0; cursor: pointer; color: var(--ink); font: inherit; text-align: left;
}
.turno-cliente strong { font-size: 13.5px; }
.turno-cliente svg { color: var(--accent-ink); flex: none; }
.turno-cliente:hover strong { color: var(--accent-ink); text-decoration: underline; }
.turno-cliente:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pot-dot { font-size: 12px; }
.turno-abierto { background: #F4F5F8; border-radius: 10px 10px 0 0; }
.turno-detalle {
  background: #F4F5F8; border-radius: 0 0 12px 12px; padding: 4px 14px 14px;
  margin-bottom: 6px;
}
.td-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.td-stats > div {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 6px; text-align: center; min-width: 0;
}
.td-stats strong { display: block; font-family: var(--font-display); font-size: 14px; overflow-wrap: anywhere; }
.td-stats small { color: var(--muted); font-size: 11px; }
.td-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; margin-bottom: 10px; }
.td-cols h4 { margin: 0 0 6px; font-size: 13px; }
.td-venta {
  display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px;
  padding: 5px 0; border-top: 1px solid #E1E4EC;
}
.td-venta:first-of-type { border-top: none; }
.td-nota { font-size: 12.5px; margin: 8px 0 0; color: var(--muted); }
.camp-cli {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.camp-cli > div { flex: 1; min-width: 180px; }
.camp-cli strong { font-size: 13px; }
.camp-cli .muted { display: block; margin-top: 3px; line-height: 1.4; }
.camp-cli-pot { border-color: #F5C77E; background: #FFFBF2; }
@media (max-width: 900px) {
  .td-stats { grid-template-columns: repeat(3, 1fr); }
  .td-cols { grid-template-columns: 1fr; }
}
.vista-movil .td-stats { grid-template-columns: repeat(3, 1fr); }
.vista-movil .td-cols { grid-template-columns: 1fr; }

/* Ideas: guía "¿De qué se trata y cómo funciona?" */
.guia-box {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: #F4F5F8; padding: 10px 14px;
}
.guia-box > summary {
  cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--accent-strong, var(--accent));
  list-style-position: inside;
}
.guia-box[open] > summary { margin-bottom: 8px; }
.guia-camp { padding: 14px 18px; }
.guia { font-size: 13px; line-height: 1.5; }
.guia-que { margin: 0 0 10px; }
.guia h4 { margin: 12px 0 6px; font-size: 13px; }
.guia-pasos, .guia-reg { margin: 0; padding-left: 20px; }
.guia-pasos li, .guia-reg li { margin-bottom: 4px; }
.guia-ejemplo, .guia-consejo, .guia-reglas {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line);
}
.guia-consejo { background: #FFFBF2; border-color: #F5C77E; }
.guia-reglas { margin: 0 0 10px; background: var(--accent-soft); border-color: transparent; }
.idea-btns { margin-top: auto; gap: 6px; flex-wrap: wrap; }

/* Agenda: bloque "Turnos de hoy" para recordar */
.recordar-hoy { border-color: var(--accent-soft); }
.recordar-intro { margin: -6px 0 6px; }

.drawer-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: #F5F6F9;
}

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(21, 23, 29, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(21, 23, 29, .5);
  animation: popIn .18s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-head strong { font-family: var(--font-display); font-size: 16.5px; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: var(--surface);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #15171D; color: #F1EEE8; font-size: 13.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 12px;
  box-shadow: 0 10px 30px -8px rgba(21, 23, 29, .5);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: #A72E24; }

/* ---------- Onboarding ---------- */
.onboard {
  min-height: 100vh; display: grid; place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(900px 500px at 85% -10%, #F8D5D0 0%, transparent 60%),
    radial-gradient(700px 500px at -10% 110%, #DFE5F7 0%, transparent 55%),
    var(--bg);
}
.onboard-inner { width: 100%; max-width: 760px; }
.onboard-inner.narrow { max-width: 560px; }
.onboard-brand { text-align: center; margin-bottom: 34px; }
.logo-lg {
  width: 66px; height: 66px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #F0695B);
  color: #fff; display: inline-grid; place-items: center;
  box-shadow: 0 14px 30px -10px rgba(229, 72, 59, .55);
  margin-bottom: 14px;
}
.onboard-brand h1 { font-size: 40px; margin: 0 0 4px; }
.onboard-brand p { color: var(--muted); margin: 0; font-size: 15px; }
.onboard-q { text-align: center; font-size: 20px; margin: 0 0 20px; }

.onboard-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.onboard-card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 18px; padding: 26px 24px; text-align: left;
  cursor: pointer; font-family: var(--font-body); color: var(--ink);
  transition: border-color .18s, transform .18s, box-shadow .18s;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.onboard-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 20px 40px -18px rgba(229, 72, 59, .35);
}
.ob-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; margin-bottom: 4px;
}
.onboard-card strong { font-family: var(--font-display); font-size: 19px; }
.onboard-card p { color: var(--muted); margin: 0; font-size: 13.5px; }
.ob-tag { font-size: 11.5px; font-weight: 700; color: #5D677F; background: #EAEDF2; border-radius: 7px; padding: 3px 9px; }

.onboard-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.onboard-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- Vacío ---------- */
.empty { text-align: center; padding: 44px 20px; }
.empty-icon {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 12px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center;
}
.empty strong { font-family: var(--font-display); font-size: 16px; display: block; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 13px; }

/* ---------- Banner de errores ---------- */
#err-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  background: #A72E24; color: #fff;
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

/* ---------- Validación de campos ---------- */
.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(163, 59, 46, .15) !important;
}

/* ---------- Equipo / liquidaciones ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.prof-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 12px; }
.prof-head { display: flex; align-items: center; gap: 11px; }
.prof-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prof-title strong { font-size: 15px; }
.prof-title .pill { align-self: flex-start; }
.prof-desc { margin: 0; }
.prof-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: #F4F5F8; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.prof-stats strong { display: block; font-family: var(--font-display); font-size: 15px; }
.prof-stats small { color: var(--muted); font-size: 11px; }

.liq-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.liq-custom { display: flex; align-items: center; gap: 8px; }
.liq-custom input { width: auto; padding: 7px 10px; }

.tbl .total-row td {
  background: #F4F5F8; border-top: 2px solid var(--line);
  font-weight: 700; padding-top: 13px;
}

.modo-campos {
  background: #F4F5F8; border: 1px dashed #C3C8D3;
  border-radius: 12px; padding: 14px;
}
.modo-desc { margin: 0; }

/* ---------- WhatsApp: botones, ventana de mensaje y cola ---------- */
.btn-wa { background: #16834A; color: #fff; box-shadow: 0 4px 12px -4px rgba(31, 157, 85, .5); }
.btn-wa:hover { background: #106B3C; color: #fff; }
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-block { width: 100%; margin-bottom: 10px; }
.modal-foot { flex-wrap: wrap; }

.msg-body { display: flex; flex-direction: column; gap: 10px; }
.msg-body p { margin: 0; }
.msg-resumen {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-strong);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600;
}
.msg-resumen svg { flex: none; }
.msg-para { display: flex; align-items: center; gap: 10px; }
.msg-para strong { display: block; font-size: 14px; }
.msg-label { font-size: 12.5px; font-weight: 600; color: #4C5059; }

.cola-progreso { height: 6px; background: #E6E9EF; border-radius: 4px; overflow: hidden; }
.cola-progreso i { display: block; height: 100%; background: #1F9D55; border-radius: 4px; transition: width .3s; }

/* ---------- Calendario ---------- */
.cal-toolbar { align-items: center; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-rango { font-family: var(--font-display); font-size: 16px; margin-left: 6px; display: inline-block; }
.cal-rango::first-letter { text-transform: uppercase; }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
}
.cal-legend .lg {
  display: inline-block; width: 16px; height: 11px; border-radius: 3px;
  vertical-align: -1px; margin-right: 6px; background: #E1E4EB; border-left: 3px solid #747985;
}
.cal-legend .lg-libre { background: #fff; border: 1px solid var(--line); }
.cal-legend .lg-pend { outline: 1.5px dashed #747985; outline-offset: -1.5px; }
.cal-legend .lg-comp { opacity: .5; }
.cal-legend .lg-fuera { border: none; background: repeating-linear-gradient(135deg, #E6E8EE 0 4px, #D4D8E1 4px 8px); }

.cal-card { padding: 0; overflow: hidden; }
.cal-wrap { max-height: 72vh; overflow: auto; position: relative; }
.cal-grid { display: grid; width: 100%; }
.cal-head { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-corner { position: sticky; left: 0; z-index: 7; background: var(--surface); border-right: 1px solid var(--line); }
.cal-colhead {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px; text-align: center; min-width: 0;
  background: var(--surface); color: var(--ink); font-family: var(--font-body);
  border: none; border-left: 1px solid #E6E9EF;
}
button.cal-colhead { cursor: pointer; }
button.cal-colhead:hover { background: #F4F5F8; }
.cal-colhead strong { font-size: 13px; text-transform: capitalize; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-colhead .dot { margin-bottom: 2px; }
.cal-colhead.hoy { box-shadow: inset 0 -3px 0 var(--accent); }
.cal-colhead.hoy strong { color: var(--accent-ink); }
.cal-libre { font-size: 11px; font-weight: 700; color: #2E6B45; }
.cal-libre.lleno { color: var(--danger); }
.cal-libre.neutro { color: var(--muted); font-weight: 600; }
.cal-alerta { font-size: 11px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 999px; padding: 1px 8px; margin-top: 2px; }

.cal-times { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); }
.cal-time { height: var(--cal-slot, 26px); font-size: 11.5px; color: var(--muted); text-align: right; padding-right: 7px; line-height: 1; transform: translateY(-5px); }
.cal-time:first-child { transform: none; padding-top: 2px; }
.cal-col { position: relative; border-left: 1px solid #E6E9EF; min-width: 0; }
.cal-col.hoy { background: #FFFBF6; }

.cal-slot {
  display: block; width: 100%; height: var(--cal-slot, 26px); padding: 0; margin: 0;
  border: 0; border-top: 1px dashed #E2E5ED; background: transparent; cursor: pointer;
}
.cal-slot.en-hora { border-top: 1px solid #D7DBE5; }
.cal-slot:hover { background: #E3EFE6; box-shadow: inset 0 0 0 1px #9CC7AB; }
.cal-slot.fuera { background: repeating-linear-gradient(135deg, #EFF1F5 0 6px, #E4E7EE 6px 12px); }
.cal-slot.pasado { cursor: default; opacity: .55; }
.cal-slot.pasado:hover { background: transparent; box-shadow: none; }
.cal-slot.fuera.pasado:hover { background: repeating-linear-gradient(135deg, #EFF1F5 0 6px, #E4E7EE 6px 12px); }

.cal-turno {
  position: absolute; z-index: 2; display: flex; flex-direction: column; justify-content: flex-start;
  padding: 3px 6px; overflow: hidden; text-align: left; line-height: 1.25; cursor: pointer;
  font-family: var(--font-body); color: var(--ink);
  border: 0; border-left: 4px solid var(--c); border-radius: 7px;
  background: #EAEDF2; background: color-mix(in srgb, var(--c) 15%, #fff);
  box-shadow: 0 1px 2px rgba(21, 23, 29, .08);
}
.cal-turno strong, .cal-turno span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-turno strong { font-size: 11.5px; }
.cal-turno span { font-size: 11px; color: #535865; }
.cal-turno:hover { z-index: 3; box-shadow: 0 6px 16px -6px rgba(21, 23, 29, .35); }
.cal-turno.est-pendiente { outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.cal-turno.est-completada { opacity: .5; }
.cal-turno.est-ausente { opacity: .45; }
.cal-turno.est-ausente strong { text-decoration: line-through; }
.cal-legend .lg-aus { opacity: .45; background: #D2D6E1; }
.cal-tip { margin: -4px 0 10px; }
.td-aviso { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: #FDEBE8; color: #A72E24; font-size: 12.5px; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---------- Seguimiento de campañas (Ideas) ---------- */
.camp-seccion { margin-bottom: 22px; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.camp-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 8px; }
.camp-card p { margin: 0; }
.camp-card .btn { align-self: flex-start; }
.camp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.camp-head strong { font-family: var(--font-display); font-size: 15.5px; line-height: 1.25; }
.camp-avance { font-size: 14px; }
.camp-avance > strong { font-family: var(--font-display); font-size: 26px; }
.camp-progreso { height: 8px; background: #E6E9EF; border-radius: 5px; overflow: hidden; }
.camp-progreso i { display: block; height: 100%; background: linear-gradient(90deg, #F0695B, var(--accent)); border-radius: 5px; transition: width .4s; }
.kpi .camp-progreso { margin-top: 8px; }
.camp-ver { font-weight: 600; }
.camp-ver-ok { color: #2E6B45; }
.camp-ver-warn { color: #9A5A1F; }
.camp-ver-neutro { color: var(--muted); }
.camp-veredicto { margin-bottom: 18px; }
.camp-veredicto.camp-ver-ok { background: linear-gradient(135deg, #E9F4EC, #F3F8F0); border-color: #CFE5D6; color: #2E5E40; }
.camp-veredicto.camp-ver-warn { background: linear-gradient(135deg, #FDF1E2, #F0F1F5); border-color: #CED3E0; color: #7A4A1C; }
.camp-veredicto.camp-ver-neutro { background: #E7EAF0; border-color: var(--line); color: #535865; }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
html.vw-tablet .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
.kpi-de { font-size: 15px; color: var(--muted); font-weight: 600; }
.camp-bar { background: #D7DBE5; display: flex; align-items: flex-end; overflow: hidden; }
.camp-bar i { display: block; width: 100%; background: var(--accent); }
.camp-leyenda { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.camp-leyenda i { display: inline-block; width: 12px; height: 10px; border-radius: 3px; }
.camp-leyenda .lg-total { background: #D7DBE5; }
.camp-leyenda .lg-meta { background: var(--accent); margin-left: 8px; }
.camp-notas { margin: 12px 0 0; font-size: 13px; }
.idea-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.idea-card .btn { align-self: flex-start; }
.idea-en-marcha { border-color: #CFE5D6; box-shadow: 0 0 0 1px #CFE5D6, var(--shadow); }

/* ---------- Inicio: turnos del día ---------- */
.turnos-dash-head { flex-wrap: wrap; }
.turnos-dash-head h2 { margin-right: auto; }
.hora-badge { width: 58px; }
.hora-badge strong { font-size: 15px; }
.turno-hecho { opacity: .55; }
.msg-extra { font-weight: 500; opacity: .85; }

/* ---------- Última visita "hace N días" ---------- */
.hace-dias { font-size: 12px; color: var(--muted); }
.hace-dias-alerta { color: #9A5A1F; font-weight: 700; }

/* ---------- Métodos de pago ---------- */
.pago {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600;
}
.pago-efectivo { background: #E3EFE6; color: #2E6B45; }
.pago-tarjeta { background: #E5EAFA; color: #3557D6; }
.pago-transferencia { background: #E5EAFA; color: #2F4BB8; }

.pago-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pago-card {
  display: flex; align-items: center; gap: 12px;
  background: #F4F5F8; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.pago-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: #E2E5EC; color: #535865; }
.pago-card-efectivo .pago-ico { background: #E3EFE6; color: #2E6B45; }
.pago-card-tarjeta .pago-ico { background: #E5EAFA; color: #3557D6; }
.pago-card-transferencia .pago-ico { background: #E5EAFA; color: #2F4BB8; }
.pago-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pago-info strong { font-family: var(--font-display); font-size: 17px; }
.pago-pct { font-weight: 700; color: var(--muted); font-size: 13px; }
.pago-opciones .radio { flex: 1; justify-content: center; min-width: 110px; }

/* ---------- Botón rápido de vista (barra lateral) ---------- */
.vista-btn {
  width: 100%; background: none; border: none; text-align: left;
  font-family: var(--font-body); cursor: pointer;
}

/* El onboarding ocupa todo el ancho aunque #app tenga dos columnas */
.onboard { grid-column: 1 / -1; }

/* ---------- Responsive ----------
   El diseño responde a clases en <html> que pone aplicarVista() (app.js):
   vw-tablet (≤1120px), vw-movil (≤900px) y vw-chico (≤640px).
   Vista "Automática": dependen del ancho de la ventana.
   Vista "Celular": están siempre puestas. Vista "PC": nunca. */
html.vw-tablet .kpi-grid { grid-template-columns: repeat(3, 1fr); }
html.vw-tablet .ideas-grid { grid-template-columns: repeat(2, 1fr); }

/* minmax(0, 1fr): sin esto la columna se estira al ancho mínimo del menú horizontal
   y toda la página queda más ancha que la pantalla del celular. */
html.vw-movil #app { grid-template-columns: minmax(0, 1fr); align-content: start; }
/* Celular: barra de arriba con botón ☰; el menú completo se despliega desde la izquierda. */
html.vw-movil .sidebar {
  position: sticky; top: 0; height: auto; flex-direction: row;
  align-items: center; padding: 10px 14px; gap: 12px; min-width: 0;
}
html.vw-movil .main { min-width: 0; }
html.vw-movil .brand { border: none; padding: 0; margin: 0; flex: none; }
html.vw-movil .brand small { display: none; }
html.vw-movil .brand strong { font-size: 22px; }
html.vw-movil .menu-btn { display: inline-flex; }
html.vw-movil .top-seccion { display: block; }
html.vw-movil .side-panel {
  display: flex; flex-direction: column; gap: 4px;
  position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw);
  padding: 14px 14px 18px; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #171A21 0%, #12141A 100%);
  box-shadow: 18px 0 40px -18px rgba(0, 0, 0, .6);
  transform: translateX(-104%); visibility: hidden;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .26s;
  z-index: 310;
}
html.vw-movil.menu-abierto .side-panel { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
html.vw-movil .side-panel-head { display: flex; }
html.vw-movil .menu-fondo { display: block; }
html.vw-movil.menu-abierto .menu-fondo { opacity: 1; pointer-events: auto; }
html.vw-movil.menu-abierto body { overflow: hidden; }
html.vw-movil .nav-item { padding: 11px 12px; font-size: 15px; }
html.vw-movil .side-foot { flex: none; margin-top: 12px; }
html.vw-movil .main { padding: 18px 16px 50px; }
html.vw-movil .grid-2 { grid-template-columns: 1fr; }
html.vw-movil .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }

html.vw-chico .kpi-grid, html.vw-chico .kpi-grid-3 { grid-template-columns: repeat(2, 1fr); }
html.vw-chico .onboard-options { grid-template-columns: 1fr; }
html.vw-chico .ideas-grid { grid-template-columns: 1fr; }
html.vw-chico .form-grid { grid-template-columns: 1fr; }
html.vw-chico .span2 { grid-column: span 1; }
html.vw-chico .page-head { align-items: flex-start; flex-direction: column; }
html.vw-chico .drawer { width: 100%; max-width: 100%; }
html.vw-chico .search-box { min-width: 0; flex: 1; }

/* Vista PC forzada: siempre con barra lateral; en pantallas angostas la página
   se desplaza en horizontal (en el celular, el viewport pasa a 1200px). */
html.vista-pc #app { min-width: 1100px; }

/* Vista celular forzada en una pantalla ancha: la app se muestra dentro de un
   marco del ancho de un teléfono. En un celular real no hace falta el marco. */
@media (min-width: 521px) {
  html.vista-movil { background: #CFD4DF; }
  html.vista-movil body {
    max-width: 440px; height: 100vh; margin: 0 auto; overflow: hidden;
    transform: translateZ(0); /* ficha, modales y avisos quedan dentro del marco */
    box-shadow: 0 0 0 1px var(--line), 0 24px 70px -24px rgba(21, 23, 29, .45);
  }
  html.vista-movil #app { height: 100vh; min-height: 0; overflow-y: auto; }
}


/* ============================================================
   Rediseño "poste de barbería" (capa final: gana la cascada)
   ============================================================ */

/* Tipografía */
h1, .page-head h1 {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: 40px; line-height: .95; letter-spacing: .01em;
}
h2 { font-family: var(--font-body); font-weight: 700; letter-spacing: -.005em; }
.page-head p.muted { font-size: 14px; }
.kpi-num, .date-badge strong, .caja-dia .caja-total, .onboard-brand h1 {
  font-family: var(--font-display); font-weight: 900; letter-spacing: .01em;
}
.kpi-num { font-size: 34px; line-height: 1; }
.caja-dia .caja-total { font-size: 40px; line-height: 1; }
.kpi-num, .caja-total { white-space: nowrap; }   /* un monto nunca se parte en dos líneas; si no entra, app.js achica la letra */
.hora-badge strong, .h-count, .nav-badge, .tbl td.ta-r strong, .td-venta strong,
.hist-right strong, .rank-row > strong, .caja-metodos strong, .cal-time, .kpi-lbl + .mono {
  font-family: var(--font-mono); font-weight: 500; letter-spacing: -.01em;
}
.hora-badge strong { font-size: 14px; }
.h-count { background: var(--ink); color: var(--bone); font-size: 12px; padding: 1px 9px; }

/* Menú lateral: grafito, rayas del poste en la sección activa */
.sidebar { background: linear-gradient(180deg, #171A21 0%, #12141A 100%); }
.brand strong { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: .03em; text-transform: uppercase; color: var(--bone); }
.brand .logo { background: #232833; position: relative; overflow: hidden; }
.brand .logo svg { display: none; }
.brand .logo::before {
  content: ''; position: absolute; left: 13px; right: 13px; top: 6px; bottom: 6px;
  border-radius: 8px; background: var(--poste); background-size: 31.12px 31.12px;
  box-shadow: 0 0 14px rgba(229, 72, 59, .35);
  animation: poste-gira 5s linear infinite;
}
@keyframes poste-gira { to { background-position: 0 31.12px; } }
.nav-item { border-radius: 9px; }
.nav-item.active { background: #232833; color: #fff; }
.nav-item.active::before {
  left: -14px; top: 6px; bottom: 6px; width: 5px; border-radius: 0 4px 4px 0;
  background: var(--poste); background-size: 31.12px 31.12px;
  animation: poste-gira 5s linear infinite;
}
.nav-badge { background: var(--accent); }

/* Botones: el rojo queda solo para la acción principal */
.btn { border-radius: 9px; font-weight: 600; transition: background .18s var(--ease-soft), border-color .18s var(--ease-soft), transform .08s var(--ease-soft), box-shadow .18s var(--ease-soft); }
.btn-primary { background: var(--accent); box-shadow: 0 6px 16px -8px rgba(229, 72, 59, .7); }
.btn-primary:hover { background: #F25C4F; }
.btn-soft { background: #E6E9EF; color: var(--ink); }
.btn-soft:hover { background: #DADEE6; color: var(--ink); }
.btn-ghost { background: #FFFFFF; border-color: #D3D8E1; }
.btn-ghost:hover { background: #F4F6F9; border-color: #BFC5D1; }
.icon-btn:hover { background: #E6E9EF; color: var(--ink); }
.link { color: var(--blue); }
a { color: var(--blue); }
a:hover { color: #2443B5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tarjetas y KPI */
.card, .kpi { border-color: #DCE0E8; box-shadow: 0 1px 0 rgba(21, 23, 29, .03), 0 10px 24px -18px rgba(21, 23, 29, .28); }
.kpi { padding-top: 18px; }
.kpi::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--poste); background-size: 31.12px 31.12px; opacity: 0;
  transition: opacity .25s var(--ease-soft);
}
.kpi:hover::after { opacity: 1; }
.kpi-ico { background: #EEF0F4; color: var(--ink); }
.kpi-lbl { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; font-weight: 600; }
.card-head h2 svg { color: var(--blue); }

/* Chips, píldoras, insignias */
.chip { border-radius: 999px; }
.chip-on { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.date-badge { background: #EEF0F4; color: var(--ink); }
.pill-info { background: var(--blue-soft); color: #2443B5; }

/* Encabezado de página: una raya de poste corta bajo el título */
.page-head h1 { position: relative; padding-bottom: 10px; }
.page-head h1::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 56px; height: 5px; border-radius: 3px;
  background: var(--poste); background-size: 31.12px 31.12px;
}

/* Onboarding */
.logo-lg { background: #232833 !important; position: relative; overflow: hidden; }
.logo-lg svg { display: none; }
.logo-lg::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: 10px; bottom: 10px; border-radius: 12px;
  background: var(--poste); background-size: 31.12px 31.12px; animation: poste-gira 5s linear infinite;
}
.onboard-brand h1 { font-size: 64px; text-transform: uppercase; }

/* Marca propia del cliente (config.js → marca.logo): el logo reemplaza al poste */
.logo.con-marca::before, .logo-lg.con-marca::before { display: none; }
.logo.con-marca img, .logo-lg.con-marca img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Movimiento reducido: el poste queda quieto */
@media (prefers-reduced-motion: reduce) {
  .brand .logo::before, .nav-item.active::before, .logo-lg::before { animation: none; }
  .btn, .kpi::after { transition: none; }
}
html.vw-chico h1, html.vw-chico .page-head h1 { font-size: 32px; }
/* Gráficos: grafito y azul; el rojo queda reservado para la acción principal */
.bar { background: linear-gradient(180deg, #3557D6, #26326B) !important; box-shadow: none !important; }
.chart-col:last-child .bar { background: linear-gradient(180deg, #E5483B, #B5352A) !important; }
.rank-bar i { background: #3557D6; }
.pago-card-transferencia .pago-ico { background: #EEF0F4; color: var(--ink); }
/* ---------- Cuentas en la nube (js/nube.js) ---------- */
.auth-card { padding: 22px 24px 18px; }
.auth-card .card-head { margin-bottom: 6px; }
.auth-card .form-grid { margin-top: 14px; }
.auth-card .btn-primary.span2 { min-height: 46px; font-size: 15px; }
.auth-card input[type="password"], .auth-clave input[type="text"] {
  font-family: var(--font-body); font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  background: #FFFDFB; outline: none; width: 100%;
}
.auth-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 87, 214, .15); }
.auth-clave { display: flex; gap: 8px; align-items: stretch; }
.auth-clave .btn { flex: none; min-width: 74px; }
.auth-msg { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.auth-msg.error { background: #FCE6E3; color: #A3271D; }
.auth-msg.ok { background: #E4F2E7; color: #2E7D4F; }
.auth-alt { text-align: center; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.auth-alt a, .auth-pie a { color: var(--blue); font-weight: 600; }
.auth-pie { text-align: center; margin-top: 18px; font-size: 13.5px; }
.auth-cargando { text-align: center; color: var(--muted); }
.auth-cargando p { margin: 6px 0 0; }
@media (max-width: 560px) {
  .auth .form-grid { grid-template-columns: 1fr; }
  .auth .span2 { grid-column: auto; }
  .auth-card { padding: 18px 16px 14px; }
  .auth .onboard-brand { margin-bottom: 20px; }
  .auth .onboard-brand h1 { font-size: 32px; }
}

/* ---------- Guía paso a paso (js/guia.js) ---------- */
/* Ojo: la clase se llama "guia-tour" y no "guia" a propósito. El recuadro de
   "¿Cómo funciona?" dentro del modal de Ideas usa <div class="guia">, y esta
   regla (que va después) lo sacaba del modal y lo pegaba sobre toda la
   pantalla con position:fixed. Son dos cosas distintas con nombre parecido. */
.guia-tour { position: fixed; inset: 0; z-index: 1000; }
.guia-foco {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(12, 14, 19, .7), 0 0 0 3px var(--accent);
  transition: left .28s cubic-bezier(.2, .8, .2, 1), top .28s cubic-bezier(.2, .8, .2, 1), width .28s cubic-bezier(.2, .8, .2, 1), height .28s cubic-bezier(.2, .8, .2, 1);
}
.guia-tour.sin-foco { background: rgba(12, 14, 19, .7); }
.guia-tour.sin-foco .guia-foco { display: none; }
.guia-card {
  position: fixed; background: var(--surface, #fff); color: var(--ink);
  border-radius: 16px; padding: 18px 18px 14px; outline: none;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45), 0 0 0 1px rgba(21, 23, 29, .06);
  transition: left .28s cubic-bezier(.2, .8, .2, 1), top .28s cubic-bezier(.2, .8, .2, 1);
}
.guia-card.centrada { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); }
.guia-paso { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.guia-card h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.05; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .01em; }
.guia-texto { margin: 0; font-size: 14.5px; line-height: 1.5; color: #3A3E47; }
.guia-texto b { color: var(--ink); }
.guia-puntos { display: flex; gap: 5px; margin: 14px 0 12px; }
.guia-puntos i { height: 4px; flex: 1; border-radius: 4px; background: #E2E5EC; transition: background .2s; }
.guia-puntos i.ya { background: #F2B7B0; }
.guia-puntos i.on { background: var(--accent); }
.guia-btns { display: flex; align-items: center; gap: 8px; }
.guia-esp { flex: 1; }
.guia-btns .btn { min-height: 40px; }
.guia-btns [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .guia-foco, .guia-card { transition: none; } }
.guia-btn { width: 100%; background: none; border: none; text-align: left; font-family: var(--font-body); cursor: pointer; }
html.vw-movil .guia-btn { width: auto; }

/* ---------- Menú desplegable del celular (botón ☰) ---------- */
.menu-btn, .top-seccion, .side-panel-head, .menu-fondo { display: none; }
.side-panel { display: contents; }
.menu-btn {
  flex: none; width: 42px; height: 42px; border-radius: 11px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .07); flex-direction: column; align-items: center; justify-content: center; gap: 4.5px;
}
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #F1EEE8; transition: transform .22s, opacity .22s; }
html.menu-abierto .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
html.menu-abierto .menu-btn span:nth-child(2) { opacity: 0; }
html.menu-abierto .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.top-seccion { margin-left: auto; color: var(--side-ink); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.side-panel-head { align-items: center; justify-content: space-between; padding: 4px 4px 14px 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side-panel-head strong { color: #F1EEE8; font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.menu-cerrar { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .07); color: #F1EEE8; display: grid; place-items: center; cursor: pointer; }
.menu-fondo {
  position: fixed; inset: 0; z-index: 300; background: rgba(12, 14, 19, .55);
  opacity: 0; pointer-events: none; transition: opacity .26s;
}
.menu-btn:focus-visible, .menu-cerrar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .side-panel, .menu-fondo, .menu-btn span { transition: none !important; } }
html.vw-movil.menu-abierto .sidebar { z-index: 320; }

/* ---------- Lugar para el cartel del hosting (abajo a la derecha) ----------
   --cartel lo mide app.js; vale 0px si el cartel no está (local o con plan pago). */
:root { --cartel: 0px; }
.main { padding-bottom: calc(50px + var(--cartel)); }
#toast-root { bottom: calc(22px + var(--cartel)); }
.overlay { padding-bottom: calc(20px + var(--cartel)); }
.modal { max-height: calc(92vh - var(--cartel)); }
.drawer { padding-bottom: var(--cartel); }
html.vw-movil .side-panel { padding-bottom: calc(18px + var(--cartel)); }
.onboard { padding-bottom: calc(40px + var(--cartel)); }
html.vw-movil .main { padding-bottom: calc(50px + var(--cartel)); }
/* El encabezado del menú (con la X) queda fijo arriba aunque el menú se desplace. */
html.vw-movil .side-panel-head { position: sticky; top: -14px; margin-top: -14px; padding-top: 18px; background: #171A21; z-index: 2; }

/* ---------- Pantallas angostas: nada se sale ni se aplasta ---------- */
/* Las columnas de la grilla pueden achicarse (si no, una palabra larga empuja la tarjeta afuera). */
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
html.vw-movil .grid-2 { grid-template-columns: minmax(0, 1fr); }
.grid-2 > * { min-width: 0; }
/* En el celular, si una fila de lista no entra, los botones y etiquetas bajan a otro renglón
   en vez de aplastar el nombre en una columnita. */
html.vw-chico .list-row { flex-wrap: wrap; row-gap: 8px; }
html.vw-chico .list-main { flex: 1 1 150px; }

/* ---------- Pantallas táctiles: todo lo que se toca mide al menos ~40px ---------- */
@media (pointer: coarse) {
  .btn-sm, .chip { min-height: 40px; }
  .btn-sm { padding-top: 8px; padding-bottom: 8px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  /* Links sueltos ("Ver todos →"): área de toque más alta sin cambiar cómo se ven. */
  a.link, button.link-btn { display: inline-flex; align-items: center; min-height: 40px; }
}
/* Aviso de cliente con el mismo nombre (ficha de cliente). */
.cli-aviso { margin: -4px 0 0; padding: 9px 12px; border-radius: 10px; background: #FDF0DC; color: #7A4A12; font-size: 13px; line-height: 1.45; }
/* El buscador: el recuadro lo pone .search-box; el campo de adentro va sin borde ni fondo propio. */
.search-box input[type="search"] { border: 0; background: transparent; padding: 0; height: 100%; box-shadow: none; border-radius: 0; }

/* Clientes en el celular: cada cliente es una tarjeta (sin tabla que haya que deslizar de costado). */
html.vw-chico .tbl-clientes thead { display: none; }
html.vw-chico .tbl-clientes, html.vw-chico .tbl-clientes tbody { display: block; width: 100%; }
html.vw-chico .tbl-clientes tr {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
html.vw-chico .tbl-clientes tr:last-child { border-bottom: 0; }
html.vw-chico .tbl-clientes td { display: block; padding: 0; border: 0; min-width: 0; }
html.vw-chico .tbl-clientes td:first-child { grid-column: 1; grid-row: 1; }
html.vw-chico .tbl-clientes td.row-actions { grid-column: 2; grid-row: 1; display: flex; gap: 4px; align-items: flex-start; }
html.vw-chico .tbl-clientes td[data-label] {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13px; padding-left: 52px; text-align: right;
}
html.vw-chico .tbl-clientes td[data-label]::before {
  content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none;
}
html.vw-chico .tbl-clientes td[data-label] > * { min-width: 0; }
html.vw-chico .tbl-clientes .tbl-wrap, html.vw-chico #clientes-list .tbl-wrap { overflow: visible; }
html.vw-chico .tbl-clientes tbody tr:hover td { background: transparent; }
html.vw-chico .tbl-clientes td[data-label] { justify-content: flex-end; flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
html.vw-chico .tbl-clientes td[data-label]::before { margin-right: auto; }
html.vw-chico .tbl-clientes td[data-label] .muted.small { font-size: 12px; }
html.vw-chico .tbl-clientes tbody tr td { border: 0; }

/* Tarjeta de fidelidad web (ficha del cliente y vista previa del mensaje) */
.sellos-mini { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.sellos-mini i { width: 14px; height: 14px; border-radius: 50%; border: 2px dashed var(--line-strong, #C5CAD3); }
.sellos-mini i.on { border: 0; background: var(--accent); }
.sellos-mini i.premio { border-style: solid; }
.sellos-mini i.premio.on { background: var(--green); }
.tarjeta-fila { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 6px; }
.tarjeta-lista { box-shadow: inset 3px 0 0 var(--green); padding-left: 12px; }
.txt-ok { color: var(--green); font-weight: 700; }
.msg-resumen .sellos-mini { margin-right: 8px; }
