/* Clientes y cartera — ficha nueva (29-sep-2026, Claude). */
.cl-status:empty { display: none; }
.cl-status { padding: .6rem .9rem; border-radius: var(--ag-r); background: var(--ag-info-bg); color: var(--ag-info); }
.cl-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1rem; }
.cl-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 992px) { .cl-layout { grid-template-columns: 340px minmax(0, 1fr); } .cl-list-panel { position: sticky; top: calc(var(--ag-topbar, 60px) + 1rem); max-height: calc(100vh - 120px); display: flex; flex-direction: column; } .cl-list { overflow: auto; } }
.cl-list-panel { padding: .9rem; }
.cl-search input { min-height: 46px; }
.cl-filters { display: flex; gap: .35rem; flex-wrap: wrap; margin: .6rem 0; }
.cl-chip { border: 1px solid var(--ag-line-strong); background: var(--ag-surface); color: var(--ag-ink-2); border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; font-weight: 600; min-height: 34px; }
.cl-chip[aria-pressed="true"] { background: var(--ag-primary); border-color: var(--ag-primary); color: #fff; }
.cl-list { display: grid; gap: .35rem; }
.cl-row { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; padding: .6rem .7rem; border-radius: 12px; border: 1px solid transparent; background: transparent; color: inherit; font: inherit; }
.cl-row:hover { background: var(--ag-surface-2); }
.cl-row[aria-current="true"] { background: var(--ag-primary-subtle); border-color: var(--ag-primary-border); }
.cl-row-main { flex: 1; min-width: 0; }
.cl-row-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-row-main small { color: var(--ag-muted); font-size: .78rem; }
.cl-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-content: center; flex: none; background: linear-gradient(135deg, var(--ag-primary-subtle), var(--ag-surface-2)); color: var(--ag-primary-text); font-weight: 800; font-size: .85rem; }
.cl-avatar-lg { width: 60px; height: 60px; font-size: 1.15rem; }
.cl-owe { font-size: .78rem; font-weight: 800; color: var(--ag-danger); background: var(--ag-danger-bg); padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.cl-credit { font-size: .75rem; font-weight: 700; color: var(--ag-success); background: var(--ag-success-bg); padding: .15rem .5rem; border-radius: 999px; }
.cl-empty-list { color: var(--ag-muted); font-size: .9rem; padding: .5rem; }
.cl-ficha { overflow: hidden; }
.cl-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 1.25rem; background: linear-gradient(135deg, var(--ag-primary-subtle), var(--ag-surface) 70%); border-bottom: 1px solid var(--ag-line); }
.cl-head-main { flex: 1; min-width: 200px; }
.cl-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.cl-head p { margin: .2rem 0 0; color: var(--ag-ink-2); font-size: .9rem; }
.cl-ok { color: var(--ag-success); font-weight: 600; }
.cl-warn { color: var(--ag-warning); font-weight: 600; }
.cl-head-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.cl-head-actions .btn { min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; }
.cl-balance { padding: .45rem .9rem; border-radius: 14px; background: var(--ag-surface); border: 1px solid var(--ag-line); text-align: right; }
.cl-balance small { display: block; font-size: .72rem; font-weight: 700; color: var(--ag-muted); text-transform: uppercase; letter-spacing: .04em; }
.cl-balance strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.cl-balance.is-owe strong { color: var(--ag-danger); }
.cl-balance.is-credit strong { color: var(--ag-success); }
.cl-tabs { display: flex; gap: .25rem; padding: .5rem 1rem 0; border-bottom: 1px solid var(--ag-line); overflow-x: auto; }
.cl-tab { display: inline-flex; align-items: center; gap: .4rem; border: 0; background: transparent; padding: .7rem .9rem; font-weight: 700; color: var(--ag-muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.cl-tab[aria-selected="true"] { color: var(--ag-primary-text); border-bottom-color: var(--ag-primary); }
.cl-body { padding: 1.25rem; }
.cl-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.1rem; }
.cl-actions .btn { min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; }
.cl-hint { color: var(--ag-muted); font-size: .85rem; }
.cl-compare { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; max-width: 560px; }
.cl-compare figure { margin: 0; border-radius: 16px; overflow: hidden; background: var(--ag-surface-2); position: relative; aspect-ratio: 1 / 1; }
.cl-compare img { width: 100%; height: 100%; object-fit: cover; }
.cl-compare figcaption { position: absolute; left: .6rem; bottom: .6rem; padding: .25rem .6rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .78rem; font-weight: 600; }
.cl-timeline { list-style: none; margin: 0; padding: 0; }
.cl-timeline li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: .8rem; position: relative; padding-bottom: 1.1rem; }
.cl-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--ag-line); }
.cl-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; background: var(--ag-primary); color: #fff; font-weight: 800; font-size: .85rem; }
.cl-visit { background: var(--ag-bg); border: 1px solid var(--ag-line); border-radius: 14px; padding: .8rem .9rem; }
.cl-visit-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.cl-visit-top time { color: var(--ag-muted); font-size: .82rem; }
.cl-visit p { margin: .5rem 0; white-space: pre-line; color: var(--ag-ink-2); }
.cl-thumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0; }
.cl-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--ag-line); }
.cl-moves { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.cl-move { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: .7rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--ag-line); border-radius: 12px; background: var(--ag-surface); }
.cl-move-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-content: center; background: var(--ag-surface-2); }
.cl-move.payment .cl-move-ico { background: var(--ag-success-bg); color: var(--ag-success); }
.cl-move.charge .cl-move-ico { background: var(--ag-warning-bg); color: var(--ag-warning); }
.cl-move small { display: block; color: var(--ag-muted); font-size: .8rem; }
.cl-move b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-move.payment b { color: var(--ag-success); }
.cl-muted-tag { font-size: .75rem; color: var(--ag-muted); }
@media (max-width: 575.98px) { .cl-move { grid-template-columns: 38px minmax(0, 1fr) auto; } .cl-move .btn, .cl-move .cl-muted-tag { grid-column: 2 / -1; justify-self: start; } }
.cl-cards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cl-card { border: 1px solid var(--ag-line); border-radius: 16px; padding: 1rem; background: var(--ag-surface); display: grid; gap: .5rem; align-content: start; }
.cl-card h3 { display: flex; align-items: center; gap: .45rem; font-size: 1rem; margin: 0; }
.cl-card p { margin: 0; color: var(--ag-ink-2); font-size: .9rem; }
.cl-card .btn { justify-self: start; min-height: 42px; }
.cl-foot { color: var(--ag-muted); font-size: .8rem; margin: 1rem 0 0; }
.cl-dialog { width: min(600px, calc(100vw - 2rem)); }
.cl-error { color: var(--ag-danger); font-size: .875rem; margin: .75rem 0 0; }
.cl-error:empty { display: none; }

/* Planes de pago */
.cl-sub { font-size: .95rem; font-weight: 700; margin: 1.1rem 0 .5rem; }
.cl-plans { display: grid; gap: .75rem; }
.cl-plan { border: 1px solid var(--ag-border, #e3e7eb); border-radius: 16px; padding: .9rem 1rem; background: var(--ag-surface, #fff); }
.cl-plan.is-late { border-color: #f3c3bd; background: #fff8f7; }
.cl-plan.is-done { opacity: .8; }
.cl-plan-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.cl-plan-top small { display: block; color: var(--ag-muted, #667085); }
.cl-pill { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; background: #eef2f5; white-space: nowrap; }
.cl-pill.is-late { background: #fde2df; color: #a1261a; }
.cl-pill.is-paid, .cl-pill.is-next { background: #dff5ec; color: #0e6b52; }
.cl-plan progress { width: 100%; height: 8px; margin: .7rem 0 .3rem; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: #eef2f5; }
.cl-plan progress::-webkit-progress-bar { background: #eef2f5; border-radius: 99px; }
.cl-plan progress::-webkit-progress-value { background: linear-gradient(90deg, #14857f, #3cc4a0); border-radius: 99px; }
.cl-plan progress::-moz-progress-bar { background: linear-gradient(90deg, #14857f, #3cc4a0); border-radius: 99px; }
.cl-plan-sum { font-size: .85rem; margin: 0 0 .6rem; }
.cl-cuotas { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; gap: .4rem; overflow-x: auto; }
.cl-cuotas li { flex: 0 0 auto; min-width: 74px; display: grid; gap: 1px; padding: .45rem .55rem; border-radius: 12px; background: #f5f7f9; font-size: .75rem; }
.cl-cuotas li span { font-weight: 700; }
.cl-cuotas li b { font-size: .8rem; }
.cl-cuotas li em { font-style: normal; color: var(--ag-muted, #667085); }
.cl-cuotas li.is-paid { background: #e3f6ee; }
.cl-cuotas li.is-late { background: #fde8e5; }
.cl-cuotas li.is-late em { color: #a1261a; font-weight: 700; }
.cl-cuotas li.is-next { outline: 2px solid #14857f; outline-offset: -2px; background: #fff; }
.cl-plan-preview { font-weight: 600; margin: 0; }
.cl-plans { grid-template-columns: minmax(0, 1fr); }
.cl-plan, .cl-plan-top > div { min-width: 0; }
.cl-body { min-width: 0; }

/* Fotos por sesión y autorización guiada (30-sep-2026) */
.cl-consent { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 16px; background: #fff8e6; border: 1px solid #f3dca6; margin-bottom: 1rem; }
.cl-consent > .ico { width: 1.6rem; height: 1.6rem; color: #9a6b00; flex: 0 0 auto; }
.cl-consent p { margin: .2rem 0 .6rem; font-size: .9rem; }
.cl-pics { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.cl-pics figure { margin: 0; width: 92px; }
.cl-pics img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; display: block; }
.cl-pics figcaption { font-size: .72rem; text-align: center; color: var(--ag-muted, #667085); }
.cl-pics figure.is-over { opacity: .4; }
.cl-thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; }

.cl-card-access { border-color: var(--ag-primary-border, #b7e4d8); }
.cl-code { font-size: 2.4rem; font-weight: 800; letter-spacing: .15em; text-align: center; padding: 1rem; margin: .75rem 0 1rem; border-radius: 16px; background: var(--ag-primary-subtle, #e8f5f2); color: var(--ag-primary-text, #0e6b66); font-variant-numeric: tabular-nums; }

/* Ficha estética (30-sep-2026) */
.cl-alert-pill { display: inline-flex; gap: .35rem; align-items: center; margin: .15rem 0 .3rem; padding: .25rem .7rem; border-radius: 999px; background: #fde8e5; color: #a1261a; font-weight: 700; font-size: .82rem; }
.cl-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cl-fgrid h3 { font-size: .95rem; font-weight: 800; margin: 0 0 .5rem; }
.cl-fi { padding: .55rem .75rem; border-radius: 12px; background: var(--ag-surface-2, #f7f8fa); margin-bottom: .4rem; }
.cl-fi small { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ag-muted, #667085); }
.cl-fi p { margin: .1rem 0 0; }
.cl-fi.is-warn { background: #fde8e5; } .cl-fi.is-warn p { color: #a1261a; font-weight: 700; }

/* Firma en pantalla (30-sep-2026) */
.cl-sign-dialog { width: min(760px, 100% - 16px); }
.cl-sign-text { white-space: pre-line; max-height: 34vh; overflow: auto; padding: .9rem 1rem; border-radius: 14px; background: var(--ag-surface-2, #f7f8fa); font-size: .9rem; line-height: 1.5; }
.cl-pad { position: relative; border: 2px dashed var(--ag-line-strong, #cfd6dd); border-radius: 16px; background: #fff; }
.cl-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.cl-pad [data-clear] { position: absolute; right: .4rem; top: .4rem; }
.cl-sign-err { min-height: 1.2em; color: #a1261a; font-weight: 600; margin: .4rem 0 0; }
.cl-signs { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .3rem; }
.cl-signs li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .85rem; padding: .35rem .6rem; border-radius: 10px; background: var(--ag-surface-2, #f7f8fa); }

/* Publicar resultado (30-sep-2026) */
.cl-publish { margin: -.5rem 0 1.25rem; }
.cl-publish small { display: inline-flex; gap: .35rem; align-items: center; }
.cl-pub-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.cl-pub-pick label { display: grid; gap: .35rem; }
.cl-pub-pick img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--ag-surface-2); }

/* Tratamientos en la ficha (1-oct-2026) */
.cl-treats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.cl-treat { border: 1px solid var(--ag-line); border-radius: 16px; padding: .9rem 1rem; background: var(--ag-surface); display: grid; gap: .35rem; }
.cl-treat.is-late { border-color: var(--ag-danger-line); background: linear-gradient(135deg, #fff5f5, var(--ag-surface) 60%); }
.cl-treat.is-due { border-color: var(--ag-warning-line); }
.cl-treat-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.cl-treat-count { display: flex; align-items: baseline; gap: .35rem; } .cl-treat-count b { font-size: 1.6rem; font-weight: 800; line-height: 1; } .cl-treat-count span { color: var(--ag-muted); font-size: .85rem; }
.cl-treat-bar { height: 8px; border-radius: 99px; background: var(--ag-surface-2); overflow: hidden; } .cl-treat-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #14b8a6, var(--ag-primary)); transition: width .6s ease; }
.cl-treat p { margin: 0; font-weight: 600; font-size: .9rem; } .cl-treat.is-late p { color: var(--ag-danger); }

/* Tiquete (1-oct-2026) */
.cl-ticket { max-width: 340px; margin: 0 auto; padding: 1.1rem 1.2rem; background: #fff; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); font-family: ui-monospace, Menlo, Consolas, monospace; position: relative; }
.cl-ticket::before, .cl-ticket::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background: radial-gradient(circle at 6px -2px, transparent 6px, #fff 6.5px) repeat-x; background-size: 12px 10px; }
.cl-ticket::before { top: -9px; transform: rotate(180deg); } .cl-ticket::after { bottom: -9px; }
.cl-ticket header { text-align: center; display: grid; gap: .1rem; padding-bottom: .6rem; border-bottom: 2px dashed var(--ag-line-strong); }
.cl-ticket header strong { font-size: 1rem; } .cl-ticket header span { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; } .cl-ticket header small { color: var(--ag-muted); }
.cl-ticket dl { margin: .5rem 0; } .cl-ticket dl div { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem 0; border-bottom: 1px dashed var(--ag-line); font-size: .86rem; }
.cl-ticket dt { color: var(--ag-muted); font-weight: 500; } .cl-ticket dd { margin: 0; text-align: right; font-weight: 700; }
.cl-ticket footer { text-align: center; font-size: .85rem; padding-top: .4rem; } .cl-ticket footer small { display: block; color: var(--ag-muted); font-size: .7rem; margin-top: .2rem; }
.cl-ticket.is-void { opacity: .75; } .cl-ticket-void { text-align: center; color: var(--ag-danger); font-weight: 700; margin: .3rem 0; }
.cl-ticket-dialog .ag-dialog-body { background: var(--ag-surface-2); }
.cl-move .btn-sm { white-space: nowrap; }
