/* CRM · Brillo 23 — se apoya en styles.css (tokens, botones, campos, login, toast) */

[hidden] { display: none !important; }
textarea {
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 10px 12px;
  width: 100%; min-width: 0; resize: vertical; line-height: 1.4;
}
textarea:focus, .f input[type=search]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun-soft); }
.view-title { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.02; letter-spacing: -.035em; margin: 0; }
.warn { margin: 0; font-size: 13.5px; color: #8A5200; background: #FFF1D6; border-radius: var(--r-sm); padding: 8px 12px; }
.spacer { flex: 1; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin: -6px 0 20px; flex-wrap: wrap; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 14px; color: var(--ink-2);
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.tabs button:hover { background: var(--panel); border-color: var(--line); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.tabs button[aria-selected="true"] .ic { color: var(--sun); }

/* ---------- Agenda ---------- */
.ag-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ag-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-nav h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.03em; margin: 0 6px 0 10px; line-height: 1; }
.ag-date { height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: 0 12px; font-size: 13.5px; }
.ag-kpis { margin: 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-kpis b { color: var(--ink); font-size: 15px; margin-right: 4px; }
.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ag-card { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.ag-scroll { overflow: auto; max-height: calc(100vh - 230px); min-height: 420px; }
.ag-grid { --ppm: 1.5px; display: grid; position: relative; min-width: 100%; }
.ag-corner, .ag-colhead {
  position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line);
  height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 700; font-size: 14px;
}
.ag-corner { left: 0; z-index: 4; }
.ag-colhead i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(12,12,11,.15); }
.ag-colhead span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-colhead small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; font-variant-numeric: tabular-nums; }
.ag-times { position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--line); }
.ag-time { height: calc(var(--ppm) * 30); font-size: 11.5px; color: var(--muted); padding: 3px 8px 0; text-align: right; font-variant-numeric: tabular-nums; }
.ag-col { position: relative; border-left: 1px solid var(--line); }
.ag-slot { display: block; width: 100%; height: calc(var(--ppm) * 30); border: 0; border-top: 1px solid var(--panel-2); background: transparent; padding: 0; }
.ag-slot:nth-child(2n+1) { border-top-color: var(--line); }
.ag-slot:hover { background: var(--sun-wash); }
.ag-slot:focus-visible { outline-offset: -2px; }
.ag-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.ag-now::before { content: ''; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.ag-col ~ .ag-col .ag-now::before { display: none; } /* un solo punto, al inicio de la línea */
.cita {
  position: absolute; left: 4px; right: 4px; z-index: 1; border: 0; text-align: left; overflow: hidden;
  background: var(--sun-wash); border-left: 4px solid var(--c, var(--sun)); border-radius: 10px;
  padding: 5px 8px; font-size: 12.5px; line-height: 1.25; box-shadow: 0 1px 2px rgba(12,12,11,.08);
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  transition: box-shadow .15s var(--ease), transform .15s var(--ease);
}
.cita:hover { box-shadow: 0 6px 16px -6px rgba(12,12,11,.3); z-index: 2; }
.cita b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cita span { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cita em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.cita.st-confirmada { background: #FFF6B0; }
.cita.st-atendida { background: #E3F1E8; }
.cita.st-no_vino { background: #FBE4E2; }
.cita.st-no_vino b { text-decoration: line-through; }
.cita.st-cancelada { background: var(--panel-2); opacity: .7; }
.cita.st-cancelada b { text-decoration: line-through; color: var(--muted); }
.cita.has-st b { padding-right: 78px; }
.cita .cita-st { position: absolute; top: 6px; right: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); }
.ag-empty { grid-column: 1 / -1; padding: 60px 24px; text-align: center; color: var(--muted); }
.ag-empty h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--ink); margin: 0 0 8px; letter-spacing: -.02em; }

.ag-side { display: grid; gap: 14px; position: sticky; top: 20px; }
.side-card { background: var(--panel-2); border-radius: var(--r-lg); padding: 18px 16px 14px; }
.side-card h3 { font-family: var(--serif); font-weight: 400; font-size: 23px; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.side-card .hint { margin: 6px 0 10px; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mini li { background: var(--panel); border-radius: var(--r-md); padding: 10px 10px 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; font-size: 13.5px; }
.mini li > div { min-width: 0; }
.mini b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini small { display: block; color: var(--muted); font-size: 12px; }
.mini .mini-act { display: flex; gap: 4px; }
.mini .mini-empty { background: transparent; padding: 4px 2px; color: var(--muted); display: block; }
.mini input { height: 34px; width: 92px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; font-variant-numeric: tabular-nums; }
.mini input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun-soft); }
.btn-wa { background: #E3F1E8; color: #1F5E3A; border-color: transparent; }
.btn-wa:hover { background: #CFE8D8; }

/* ---------- Clientas ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 42px; margin: 0 2px 10px; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun-soft); }
.search .ic { color: var(--muted); }
.search input { border: 0; background: transparent; height: 100%; flex: 1; min-width: 0; outline: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 2px 10px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--sun); border-color: var(--sun-deep); color: var(--ink); }
/* Barra de búsqueda, filtros y orden */
.cl-card { padding: 18px 20px 10px; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.cl-filters .search { margin: 0; height: 38px; flex: 1 1 220px; max-width: 300px; }
.cl-filters .cl-sel { height: 38px; max-width: none; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cl-filters .cl-sel:hover { border-color: var(--ink); }
.cl-filters .cl-sel.is-on { background-color: var(--sun); border-color: var(--sun-deep); color: var(--ink); }
.cl-filters .chip { height: 38px; padding: 0 14px; font-size: 13px; }
.chip-clear { border: 0; background: none; padding: 0 4px; height: 38px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.chip-clear:hover { color: var(--ink); }
.cl-sort { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cl-sort label { font-size: 12.5px; font-weight: 700; color: var(--muted); flex: none; }
.cl-dir { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.cl-dir .ic { width: 14px; height: 14px; color: var(--muted); }
.list-empty #clEmptyClear { margin-top: 10px; }
/* Tabla de clientas */
.cl-tbl { font-size: 14px; }
.cl-tbl th, .cl-tbl td { padding-left: 10px; }
.cl-tbl td { vertical-align: middle; }
.cl-tbl td:not(:first-child) { white-space: nowrap; }
.cl-tbl td:first-child { min-width: 190px; }
.cl-tbl .num { font-weight: 400; }
.cl-tbl .num + td, .cl-tbl .num + th { padding-left: 28px; }
.cl-tbl tr.is-active td { background: var(--sun-soft); }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.th-sort:hover, .th-sort.is-on { color: var(--ink); }
.th-sort.is-on { font-weight: 700; }
.th-sort .ic { width: 13px; height: 13px; }
.cl-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.cl-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.cl-nil { color: var(--muted); }
.cl-tbl td.cl-tags-col { white-space: nowrap; text-align: right; }
.cl-tags-col .witem-badge + .witem-badge { margin-left: 4px; }
.cl-tags-m { display: none; }
.cl-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 14px 0 6px; border-top: 1px solid var(--line); }
.cl-pager p { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-pager p b { color: var(--ink); }
.cl-pager-btns { display: flex; align-items: center; gap: 6px; }
.cl-pager-btns .btn:disabled { opacity: .4; cursor: default; }
#clPages { display: inline-flex; align-items: center; gap: 4px; }
.cl-pg { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 999px; border: 1px solid transparent; background: none; font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; cursor: pointer; }
.cl-pg:hover { border-color: var(--line); background: var(--panel-2); }
.cl-pg[aria-current="page"] { background: var(--ink); color: var(--sun); }
.cl-gap { color: var(--muted); padding: 0 2px; }
@media (max-width: 820px) {
  .cl-card { padding: 16px 14px 8px; }
  .cl-filters .search { flex: 1 1 100%; max-width: none; height: 42px; }
  .cl-filters .cl-sel { flex: 1 1 calc(50% - 4px); min-width: 0; height: 40px; }
  .cl-sort { margin-left: 0; flex: 1 1 100%; }
  .cl-sort .cl-sel { flex: 1; }
  .cl-tbl .m-hide { display: none; }
  .cl-tbl td:first-child { min-width: 0; }
  .cl-tags-m { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
  .cl-pager { justify-content: center; }
  .cl-pager-btns { width: 100%; justify-content: space-between; }
}
/* Ficha de la clienta: panel lateral */
.cl-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(820px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; padding: 0; background: var(--panel); color: var(--ink); border-radius: var(--r-lg) 0 0 var(--r-lg); box-shadow: -24px 0 60px -30px rgba(12,12,11,.45); overflow-y: auto; overscroll-behavior: contain; }
.cl-drawer::backdrop { background: rgba(12,12,11,.32); }
.cl-drawer[open] { animation: drawer-in .34s cubic-bezier(.16, 1, .3, 1); }
.cl-drawer[open]::backdrop { animation: backdrop-in .34s ease-out; }
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0; } }
@keyframes backdrop-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cl-drawer[open], .cl-drawer[open]::backdrop { animation: none; } }
.cl-drawer-bar { position: sticky; top: 0; height: 0; z-index: 2; }
.cl-drawer-bar .btn-icon { position: absolute; top: 18px; right: 18px; }
.cl-drawer .ficha { box-shadow: none; border-radius: 0; background: transparent; padding: 30px 32px 40px; }
.cl-drawer .ficha-head { padding-right: 58px; }
@media (max-width: 820px) {
  .cl-drawer { border-radius: 0; }
  .cl-drawer .ficha { padding: 22px 16px 28px; }
  .cl-drawer-bar .btn-icon { top: 12px; right: 12px; }
}
.cl-detail { min-width: 0; }
.ficha { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 26px 28px 28px; }
.ficha-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ficha-head h2 { font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1.02; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
.ficha-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.ficha-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.stat { background: var(--panel-2); border-radius: var(--r-md); padding: 12px 14px; min-width: 0; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.is-alert { background: #FFF1D6; }
.notas { background: var(--sun-wash); border: 1px solid var(--sun-soft); border-radius: var(--r-md); padding: 14px 16px; white-space: pre-wrap; font-size: 14.5px; margin: 0 0 22px; }
.notas-lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); display: block; margin-bottom: 4px; }
.ficha h3 { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -.02em; margin: 0 0 10px; }
.witem-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #FFF1D6; color: #8A5200; white-space: nowrap; }

/* ---------- Ventas Susii ---------- */
.vs-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.vs-bar .hint { margin-top: 8px; }
.vs-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.range { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; height: 44px; }
.range input { border: 0; background: transparent; height: 36px; font-size: 13.5px; padding: 0 4px; }
.range span { color: var(--muted); }
.vs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); }
.kpi b { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.is-alert { background: #FFF1D6; box-shadow: none; }
.vs-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.vs-tbl td { vertical-align: middle; }
.vs-tbl tr.is-anulada td { color: var(--muted); }
.vs-tbl tr.is-anulada td b { text-decoration: line-through; }
.vs-tbl select { height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 0 8px; max-width: 220px; font-size: 13px; }
.doc { font-size: 12px; color: var(--muted); display: block; }
.empty-row td { color: var(--muted); text-align: center; padding: 30px 10px !important; }

/* ---------- Ajustes ---------- */
.aj-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.aj-side { display: grid; gap: 16px; }
.aj-side .dash-card > .f + .f { margin-top: 12px; }
.ed-tbl input:not([type=checkbox]), .ed-tbl select {
  height: 36px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; padding: 0 8px; width: 100%; min-width: 0; font-size: 14px;
}
.ed-tbl input:not([type=checkbox]):hover, .ed-tbl select:hover { border-color: var(--line); }
.ed-tbl input:not([type=checkbox]):focus, .ed-tbl select:focus { outline: none; border-color: var(--ink); background: var(--panel); box-shadow: 0 0 0 3px var(--sun-soft); }
.ed-tbl input[type=number] { text-align: right; }
.ed-tbl input[type=color] { width: 36px; padding: 2px; cursor: pointer; }
.ed-tbl td { padding: 4px 6px 4px 0 !important; vertical-align: middle !important; }
.ed-tbl tr.is-off input:not([type=checkbox]) { color: var(--muted); }
.ed-tbl .code { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ed-tbl .chk input { width: 20px; height: 20px; border-radius: 6px; }

/* ---------- Diálogos ---------- */
.dlg { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 24px); color: var(--ink); }
.dlg::backdrop { background: rgba(12,12,11,.32); }
.dlg-box { background: var(--ground); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgba(12,12,11,.45); display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px 8px; }
.dlg-head h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.035em; margin: 0; line-height: 1.05; }
.dlg-body { overflow-y: auto; padding: 8px 24px 16px; display: grid; gap: 14px; }
.dlg-foot { display: flex; gap: 8px; align-items: center; padding: 14px 24px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg .f input, .dlg .f select { background-color: var(--panel); }

.pick { position: relative; }
.pick input[type=search] { height: 42px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 0 12px; width: 100%; }
.pick-list {
  position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 6px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); max-height: 260px; overflow-y: auto;
}
.pick-list li { padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pick-list li small { color: var(--muted); white-space: nowrap; }
.pick-list li:hover, .pick-list li[aria-selected="true"] { background: var(--sun-wash); }
.pick-list li.pick-new { font-weight: 700; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); margin-top: 4px; }
.pick-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel); border: 1px solid var(--ink); border-radius: var(--r-sm); padding: 8px 8px 8px 12px; }
.pick-chosen b { display: block; }
.pick-chosen small { color: var(--muted); }
.pick-chosen .pick-notes { display: block; color: #8A5200; font-size: 12.5px; margin-top: 2px; }

.serv-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.serv-chosen:empty { display: none; }
.serv-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--sun-soft); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 13px; font-weight: 700; }
.serv-tag em { font-style: normal; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.serv-tag button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(12,12,11,.08); display: grid; place-items: center; padding: 0; }
.serv-tag button .ic { width: 12px; height: 12px; }
.serv-price { display: inline-flex; align-items: center; gap: 2px; font-weight: 400; color: var(--ink-2); }
.serv-price input { width: 64px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font: inherit; font-variant-numeric: tabular-nums; text-align: right; }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pick-head .link { font-size: 13px; font-weight: 700; }

.seg-pick { display: flex; flex-wrap: wrap; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.seg-pick button { flex: 1; min-width: 88px; height: 36px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.seg-pick button:hover { background: var(--panel-2); }
.seg-pick button[aria-checked="true"] { background: var(--ink); color: #fff; }
.seg-pick button[data-v="atendida"][aria-checked="true"] { background: #1F5E3A; }
.seg-pick button[data-v="no_vino"][aria-checked="true"], .seg-pick button[data-v="cancelada"][aria-checked="true"] { background: #9A1F18; }
.dlg-links { display: flex; gap: 8px; flex-wrap: wrap; }
.dlg-links:empty { display: none; }
.dlg .chk { font-size: 14px; }
.dlg .hint { margin: -6px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .ag-layout, .vs-grid, .aj-grid { grid-template-columns: 1fr; }
  .ag-side { position: static; grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .tabs { margin-top: 0; overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { flex: none; }
  .top-actions #btnNewCita { flex: 1; }
  .ag-nav h2 { font-size: 26px; flex: 1 1 100%; margin: 6px 0 0; order: 5; }
  .ag-side { grid-template-columns: 1fr; }
  .ag-scroll { max-height: 70vh; }
  /* columnas angostas: el estado baja debajo del nombre para no cortarlo */
  .cita.has-st b { padding-right: 0; }
  .cita .cita-st { position: static; order: 9; margin-top: 2px; }
  .ficha { padding: 20px 16px 22px; }
  .ficha-head h2 { font-size: 32px; }
  .stats, .stats.stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view-title { font-size: 32px; }
  .vs-actions, .range { width: 100%; }
  .range input { flex: 1; min-width: 0; }
  .vs-actions .btn { flex: 1; }
  .kpi b { font-size: 26px; }
  .dlg-head h2 { font-size: 28px; }
  .dlg-head, .dlg-body, .dlg-foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .vs-kpis { grid-template-columns: 1fr 1fr; }
  .seg-pick button { min-width: 30%; }
}
a.btn { text-decoration: none; color: inherit; }
a.btn-wa { color: #1F5E3A; }

/* ---------- Usuarios y auditoría ---------- */
.users { list-style: none; margin: 0; padding: 0; display: grid; }
.users li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.users li:first-child { border-top: 0; }
.users li > div { min-width: 0; }
.users b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.users small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.users .u-act { display: flex; gap: 6px; align-items: center; }
.users .is-me { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--sun); margin-left: 6px; vertical-align: 1px; }
.users .mini-empty { color: var(--muted); display: block; border: 0; }
.dlg-sm { max-width: min(520px, calc(100vw - 24px)); }
.pass-row { display: flex; gap: 8px; }
.pass-row input { flex: 1; font-family: ui-monospace, Menlo, monospace; }
.audit { margin: 0; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.audit b { color: var(--ink-2); font-weight: 700; }
.by { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Importar / exportar clientas ---------- */
.imp-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.imp-sum div { background: var(--panel); border-radius: var(--r-md); padding: 10px 12px; }
.imp-sum span { display: block; font-size: 12px; color: var(--muted); }
.imp-sum b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.imp-cols { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.imp-cols li { font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.imp-cols li b { font-weight: 700; }
.imp-cols li.is-off { color: var(--muted); border-style: dashed; }
.imp-tbl { font-size: 13px; }
@media (max-width: 480px) { .imp-sum { grid-template-columns: 1fr 1fr; } }

/* ---------- Alergias ---------- */
.alerg { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: #9A1F18; background: #FBE4E2; border-radius: 999px; padding: 2px 10px 2px 8px; margin-top: 4px; }
.alerg .ic { width: 15px; height: 15px; }
.alerta { display: flex; gap: 10px; align-items: flex-start; background: #FBE4E2; color: #7A1812; border-radius: var(--r-md); padding: 12px 16px; margin: 0 0 14px; font-size: 14.5px; }
.alerta .ic { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alerta b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.pick-chosen .alerg { display: flex; width: fit-content; }

/* ---------- Secciones de la ficha de clienta ---------- */
.sec { margin: 0 0 24px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.sec-head h3 { margin: 0 !important; }
.sec-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sec-empty { color: var(--muted); font-size: 14px; margin: 0; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
li.sec-empty { list-style: none; }

/* Ficha técnica */
.ft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ft-item { background: var(--panel-2); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 8px; }
.ft-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ft-top b { display: block; font-size: 15px; }
.ft-top span { display: block; color: var(--muted); font-size: 13px; }
.ft-formula { margin: 0; background: var(--panel); border-radius: var(--r-sm); padding: 9px 12px; font-size: 14.5px; white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.ft-formula span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.ft-notas { margin: 0; font-size: 14px; white-space: pre-wrap; }
.ft-fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.ft-fotos:empty { display: none; }
.ph { position: relative; width: 104px; height: 104px; border-radius: var(--r-sm); overflow: hidden; background: var(--panel-3); border: 0; padding: 0; display: block; flex: none; }
button.ph { cursor: zoom-in; }
button.ph:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph img:not([src]) { visibility: hidden; }
.ph > span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.9); color: var(--ink); border-radius: 999px; padding: 1px 8px; }
.ph.is-missing::after { content: 'Sin foto'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.ph-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 999px; border: 0; background: rgba(12,12,11,.72); color: #fff; display: grid; place-items: center; padding: 0; }
.ph-x .ic { width: 15px; height: 15px; }
.ft-who { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ft-up { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ft-drop { display: grid; justify-items: center; gap: 2px; padding: 14px 10px; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); background: var(--panel); cursor: pointer; text-align: center; }
.ft-drop:hover { border-color: var(--ink); }
.ft-drop:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun-soft); }
.ft-drop .ic { width: 24px; height: 24px; }
.ft-drop small { color: var(--muted); font-size: 12px; }
.ft-drop.is-off { opacity: .45; pointer-events: none; }
#ftFotos { margin-top: 8px; }

/* Visor de foto */
.dlg-foto { max-width: min(960px, calc(100vw - 24px)); }
.foto-box { background: var(--ink); border-radius: var(--r-lg); overflow: hidden; display: grid; }
.foto-box img { width: 100%; max-height: calc(100vh - 110px); object-fit: contain; display: block; min-height: 200px; }
.foto-cap { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; font-weight: 700; background: var(--ink); }
.foto-cap .btn { background: #fff; color: var(--ink); }

/* Paquetes */
.bn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.bn { text-align: left; border: 1px solid var(--sun-soft); background: var(--sun-wash); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 6px; font: inherit; color: inherit; }
button.bn { cursor: pointer; }
button.bn:hover { border-color: var(--sun-deep); }
.bn.is-off { background: var(--panel-2); border-color: transparent; color: var(--muted); }
.bn.is-soon { border-color: #E9B44C; }
.bn-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bn-top b { font-size: 15px; }
.bn-saldo { font-size: 14px; font-variant-numeric: tabular-nums; }
.bn-bar { height: 6px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.bn-bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.bn.is-off .bn-bar i { background: var(--line-2); }
.bn small { color: var(--muted); font-size: 12.5px; }
.bn-old { margin-top: 10px; }
.bn-old summary { cursor: pointer; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.witem-badge.is-sun { background: var(--sun-soft); color: var(--ink-2); }
.witem-badge.is-vip { background: var(--ink); color: var(--sun); letter-spacing: .04em; }
.ficha-vip { font-family: var(--sans); font-size: 12px; vertical-align: 10px; margin-left: 6px; }
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bono-field { background: var(--sun-wash); border: 1px solid var(--sun-soft); border-radius: var(--r-md); padding: 10px 12px; }
.bono-field select { height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; width: 100%; background: var(--panel); }
.bono-monto { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; margin-top: 6px; }
.bono-monto input { width: 110px; height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; background: var(--panel); }
#bonoInfo { margin: 6px 0 0 !important; }
#bonoInfo:empty { display: none; }
#bonoInfo.is-warn { color: #8A5200; font-weight: 700; }

/* ---------- Panel ---------- */
.pn-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pn-wide { grid-column: 1 / -1; }
.pn-days { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.pn-axis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; padding-bottom: 0; }
.pn-axis span { transform: translateY(-50%); }
.pn-axis span:first-child { transform: none; }
.pn-axis span:last-child { transform: translateY(0); }
.pn-cols { display: flex; align-items: flex-end; gap: 2px; height: 200px; padding-bottom: 20px; position: relative;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 90px; background-repeat: repeat-y; background-size: 100% 90px; }
.pn-col { position: relative; flex: 1; height: 180px; display: flex; align-items: flex-end; outline: none; cursor: default; }
.pn-col i { display: block; width: 100%; background: var(--ink-2); border-radius: 4px 4px 0 0; }
.pn-col:hover i, .pn-col:focus i { background: var(--ink); }
.pn-col.is-today i { background: var(--sun-deep); }
.pn-col > span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pn-col::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  white-space: nowrap; padding: 5px 9px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.pn-col.tip-l::after { left: auto; right: 0; transform: none; }
.pn-col:nth-child(-n+4)::after { left: 0; transform: none; }
.pn-col:hover::after, .pn-col:focus::after { opacity: 1; }
.pn-col:focus-visible { box-shadow: 0 0 0 2px var(--ink); border-radius: 4px; }
.pn-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pn-bars li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.pn-bars li.sec-empty { display: block; }
.pn-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-track { height: 10px; }
.pn-track i { display: block; height: 100%; min-width: 3px; background: var(--ink-2); border-radius: 0 4px 4px 0; }
.pn-val { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.pn-val small { font-weight: 400; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.oc { display: block; width: 72px; margin-left: auto; height: 4px; background: var(--panel-2); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.oc i { display: block; height: 100%; background: var(--ink-2); }
.pn-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; }
.pn-sub { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

/* Ajustes: espacio de fotos */
.meter-bar { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.meter p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.meter b { color: var(--ink); }
.ed-tbl select:disabled, .ed-tbl input:disabled { opacity: .35; }

@media (max-width: 1180px) {
  .pn-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .pn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pn-grid { grid-template-columns: 1fr; }
  .pn-stats { grid-template-columns: 1fr 1fr 1fr; }
  .ph { width: 88px; height: 88px; }
  .pn-bars li { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; }
}
@media (max-width: 480px) {
  .pn-stats { grid-template-columns: 1fr; }
  .pn-axis { display: none; }
  .pn-days { grid-template-columns: 1fr; }
}
.aj-full { margin-top: 16px; }
#paqTable { min-width: 820px; }
#paqTable td:nth-child(1) { width: 26%; }
#paqTable td:nth-child(2) select { min-width: 118px; }
#paqTable td:nth-child(3) select { min-width: 160px; }

/* ---------- Gastos ---------- */
.kpi b.kpi-txt { font-size: 24px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-xs { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.ga-tbl td small { display: block; color: var(--muted); font-size: 12.5px; }
.ga-tbl tr.is-click, .cl-tbl tr.is-click { cursor: pointer; }
.ga-tbl tr.is-click:hover td, .cl-tbl tr.is-click:hover td { background: var(--sun-wash); }
.ga-tbl tr.is-click:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ga-drop { max-width: 220px; }
.ga-foto .ph { width: 120px; height: 120px; }
.ph-open { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; }

/* ---------- Historial ---------- */
.hi-filters { gap: 8px; }
.pill-select { height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5l3-3' fill='none' stroke='%232B2B28' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px; padding: 0 36px 0 14px; font-size: 13.5px; max-width: 240px; appearance: none; -webkit-appearance: none; }
.hx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hx { padding: 12px 0 12px 16px; border-left: 2px solid var(--line); position: relative; }
.hx::before { content: ''; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 999px; background: var(--panel); border: 2px solid var(--ink-2); }
.hx-crear::before { background: #1F5E3A; border-color: #1F5E3A; }
.hx-eliminar::before { background: #9A1F18; border-color: #9A1F18; }
.hx-top { display: flex; justify-content: space-between; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.hx-top time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-acc { color: var(--muted); }
.hx-eliminar .hx-acc { color: #9A1F18; font-weight: 700; }
.hx-res { color: var(--ink-2); font-weight: 700; }
.hx-ch { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.hx-ch li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 13.5px; background: var(--panel-2); border-radius: var(--r-sm); padding: 6px 10px; }
.hx-f { font-weight: 700; color: var(--ink-2); min-width: 120px; }
.hx-ch s { color: var(--muted); text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.hx-ch b { overflow-wrap: anywhere; }
.hx-arrow { color: var(--muted); }
.hx-snap { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.hx-snap b { color: var(--ink-2); font-weight: 700; }
.hx-snap span { font-weight: 700; color: #9A1F18; }
.hx-day { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 0 6px; }
.hx-day:first-child { padding-top: 0; }
.hx-go { font-size: 12.5px; margin-top: 4px; }
.hi-more { display: flex; justify-content: center; padding-top: 12px; }
.hi-more:has(> [hidden]) { display: none; }
#dlgHist .dlg-head .hint { margin: 4px 0 0; }
#dlgHist .hx-list > .sec-empty { margin: 0; }
@media (max-width: 820px) {
  .pill-select { flex: 1; max-width: none; }
  .hx-f { min-width: 0; width: 100%; }
}

.ga-tbl td:first-child { white-space: nowrap; }

/* ---------- Productos y packs ---------- */
.head-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ed-tbl td .code { display: block; padding: 0 8px; }
.serv-tag.is-prod { background: var(--panel); border: 1px dashed var(--line-2); }
.serv-tag.is-pack { background: var(--sun-soft); border-color: var(--sun-deep); align-items: center; gap: 8px; }
.serv-tag.is-pack > .ic { width: 14px; height: 14px; color: #B89F00; flex: none; }
.serv-tag.is-pack > span { display: grid; line-height: 1.2; }
.serv-tag.is-pack small { font-size: 11.5px; color: var(--ink-2); font-weight: 400; }
.serv-tag.is-pack em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }

.pk-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pk-list > .sec-empty { grid-column: 1 / -1; }
.pk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; background: var(--panel-2); border-radius: var(--r-md); padding: 12px 12px 12px 14px; }
.pk.is-live { background: var(--sun-wash); box-shadow: inset 0 0 0 1px var(--sun-soft); }
.pk-main { text-align: left; border: 0; background: none; padding: 0; display: grid; gap: 4px; min-width: 0; color: inherit; }
.pk-main:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.pk-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pk-top b { font-size: 15.5px; }
.pk-inc { font-size: 13.5px; color: var(--ink-2); }
.pk-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--muted); align-items: baseline; }
.pk-price { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pk-price s { color: var(--muted); font-size: 13px; }

.pk-items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.pk-items li { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px auto; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 4px 4px 12px; font-size: 14px; }
.pk-items li.sec-empty { display: block; border-style: dashed; padding: 12px; }
.pk-items small { color: var(--muted); font-size: 11.5px; }
.pk-qty input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; text-align: right; }
.pk-it-price { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pk-items.is-ro li { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; }
.pk-items.is-ro b { font-variant-numeric: tabular-nums; }
.pk-precio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; background: var(--sun-wash); border: 1px solid var(--sun-soft); border-radius: var(--r-md); padding: 12px; }
.pk-precio > div span { display: block; font-size: 12.5px; color: var(--muted); }
.pk-precio > div b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; padding-bottom: 8px; }
.pk-fechas { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pk-fechas input { width: auto !important; flex: 0 1 170px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; background: var(--panel); }
@media (max-width: 560px) {
  .pk-precio { grid-template-columns: 1fr 1fr; }
  .pk-precio label { grid-column: 1 / -1; order: -1; }
  .pk-items li { grid-template-columns: minmax(0, 1fr) 60px auto; }
  .pk-it-price { display: none; }
}

/* Tablas dentro de diálogos: que no se aplasten cuando el diálogo tiene poco alto */
.dlg-body > .tbl-wrap { min-height: max-content; }

/* ---------- Buscador de servicios / productos / packs ---------- */
.srch input[type=search] { height: 42px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 0 12px 0 38px; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F5F59' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: 12px center; }
.srch input[type=search]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun-soft); }
.srch input[type=search]:disabled { background-color: var(--panel-2); }
.srch-list { max-height: 300px; }
.srch-list li.srch-group { cursor: default; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; background: none !important; }
.srch-list li.srch-group:first-child { padding-top: 4px; }
.srch-list li.srch-empty { cursor: default; color: var(--muted); background: none !important; }
.srch-list mark { background: var(--sun-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.srch-list li[aria-selected="true"] { background: var(--sun-wash); box-shadow: inset 0 0 0 1px var(--sun-deep); }

.ed-tbl .td-cod input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; min-width: 96px; }

/* ---------- Agenda: vista, horarios, bloqueos y arrastre ---------- */
.ag-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-mini { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-mini button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.seg-mini button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ag-tools .pill-select { height: 38px; }

/* Fuera de horario, refrigerio y bloqueos: debajo de las citas, encima de la cuadrícula */
.ag-zone { position: absolute; left: 0; right: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ag-zone.is-off { background: repeating-linear-gradient(135deg, rgba(12,12,11,.035) 0 6px, rgba(12,12,11,.065) 6px 12px); }
.ag-zone.is-refri { background: rgba(12,12,11,.06); }
.ag-zone.is-blq { pointer-events: auto; border: 0; padding: 0; text-align: left; cursor: pointer;
  background: repeating-linear-gradient(135deg, rgba(154,31,24,.06) 0 6px, rgba(154,31,24,.11) 6px 12px); box-shadow: inset 3px 0 0 #C9827D; }
.ag-zone.is-blq:hover { background: repeating-linear-gradient(135deg, rgba(154,31,24,.1) 0 6px, rgba(154,31,24,.16) 6px 12px); }
.ag-zone span { display: block; padding: 4px 8px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ag-zone.is-blq span { color: #7A1812; text-transform: none; letter-spacing: 0; font-size: 12px; }
.cita { z-index: 1; }

/* Semana */
.ag-grid.is-week .ag-colhead { justify-content: space-between; }
.ag-dayjump { font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink); }
.ag-dayjump:hover { text-decoration: underline; }
.ag-colhead.is-today { box-shadow: inset 0 -3px 0 var(--sun); }
.ag-col.is-today { background: rgba(255, 229, 0, .05); }
.ag-grid.is-week .cita { padding: 4px 6px; }
.ag-grid.is-week .cita b { font-size: 12px; }

/* Arrastrar y soltar */
.cita { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cita-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.cita-rs::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: rgba(12,12,11,.18); opacity: 0; transition: opacity .15s; }
.cita:hover .cita-rs::after { opacity: 1; }
.cita.is-drag { z-index: 5; box-shadow: 0 14px 30px -10px rgba(12,12,11,.45); opacity: .95; transition: none; cursor: grabbing; }
.cita.is-drag::after { content: attr(data-tip); position: absolute; right: 6px; bottom: 6px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cita.is-armed { transform: scale(1.03); box-shadow: 0 0 0 3px var(--sun); }
body.ag-dragging, body.ag-dragging * { cursor: grabbing !important; }
@media (hover: hover) { .ag-grid .cita { cursor: grab; } }

/* Horario semanal */
.hor-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hor-days li { display: grid; grid-template-columns: 130px 1fr auto 1fr; gap: 8px; align-items: center; }
.hor-days input[type=time], .hor-refri input { height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; background: var(--panel); width: 100%; min-width: 0; }
.hor-days input:disabled { opacity: .4; }
.hor-refri { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.hor-btn { white-space: nowrap; font-weight: 400; }
#dlgBlq .seg-pick button { min-width: 0; }
@media (max-width: 480px) { .hor-days li { grid-template-columns: 1fr 1fr auto 1fr; } .hor-days .chk { grid-column: 1 / -1; } }

/* ---------- Clientas duplicadas ---------- */
.dup-box { display: grid; gap: 8px; }
.dup-box p { margin: 0; }
.dup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dup-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel); border-radius: var(--r-sm); padding: 8px 10px; color: var(--ink); }
.dup-list li > span { min-width: 0; }
.dup-list b, .dup-list small, .dup-list em { display: block; }
.dup-list small { color: var(--muted); }
.dup-list em { font-style: normal; font-size: 12px; font-weight: 700; color: #8A5200; }
.dup-list .btn { flex: none; }
.dup-box .link { font-weight: 700; color: inherit; }
.un-sug { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.un-sug:empty { display: none; }
.un-sug .hint { width: 100%; margin: 0; }
.un-sug .btn small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.un-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.un-card { position: relative; display: block; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--panel); cursor: pointer; }
.un-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun-soft); }
.un-card:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.un-card input { position: absolute; opacity: 0; pointer-events: none; }
.un-name { display: block; font-weight: 700; font-size: 15px; padding-right: 4px; }
.un-tag { display: inline-block; margin: 4px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.un-card:has(input:checked) .un-tag { color: var(--ink); background: var(--sun); border-radius: 999px; padding: 1px 8px; }
.un-card dl { margin: 0; display: grid; gap: 3px; font-size: 13px; }
.un-card dl div { display: flex; justify-content: space-between; gap: 10px; }
.un-card dt { color: var(--muted); }
.un-card dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* ---------- Puntos y ventas del día (v7) ---------- */
.pick-head-acts { display: inline-flex; gap: 14px; }
.pts-field { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.pts-field select { height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; width: 100%; background: var(--panel); }
#ptsInfo { margin: 6px 0 0 !important; }
#ptsInfo:empty { display: none; }
#ptsInfo.is-warn { color: #8A5200; font-weight: 700; }
.pts-card { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; background: var(--sun-wash); border: 1px solid var(--sun-soft); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 10px; }
.pts-card b { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pts-card span { font-size: 13.5px; color: var(--ink-2); }
.pts-tbl td.num { font-variant-numeric: tabular-nums; }
.pts-tbl .pts-mas { color: #1F7A45; font-weight: 700; }
.pts-tbl .pts-menos { color: var(--ink-2); }
.pts-tbl td.act, .vs-tbl td.act { width: 1%; white-space: nowrap; }
#dlgPts .seg-pick { margin-bottom: 12px; }
#dlgPts .chips { padding: 0; }
#ptsCfg .grid { margin-top: 10px; }
#ptsResumen { margin-top: 10px !important; }
.dy-main { display: grid; gap: 16px; min-width: 0; }
.dy-month tr.is-sel td { background: var(--sun-wash); }
.dy-month td .link { font-weight: 700; }

/* ---------- «Ver como» (solo gerencia) ---------- */
.vc-pick { display: inline-flex; align-items: center; gap: 8px; }
.vc-pick span { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.vc-pick .pill-select { max-width: 200px; }
.vc-banner { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; background: var(--sun); border: 1px solid var(--sun-deep); border-radius: var(--r-md); padding: 10px 12px 10px 16px; margin: 0 0 16px; box-shadow: 0 8px 20px -14px rgba(12,12,11,.4); }
.vc-banner p { margin: 0; font-size: 14px; color: var(--ink); }
body.is-vercomo .vc-pick .pill-select { background-color: var(--sun); border-color: var(--sun-deep); }
@media (max-width: 820px) {
  .vc-pick { flex: 1 1 100%; }
  .vc-pick .pill-select { flex: 1; max-width: none; }
  .vc-banner .btn { flex: 1 1 100%; }
}
