/* Contabilidad · usa las variables del panel (--ink, --paper, --line, --mute, --accent, --ok), así respeta los 4 temas */
.ct-root{display:block}
.ct-root .ct-subtabs{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 20px}
.ct-root .ct-sub{background:var(--ink-2);border:1px solid var(--line);color:var(--paper);border-radius:999px;padding:9px 18px;font:inherit;font-size:14px;cursor:pointer}
.ct-root .ct-sub[aria-selected=true]{background:var(--paper);color:var(--ink);border-color:var(--paper)}
.ct-root .ct-period{display:flex;flex-wrap:wrap;gap:12px 14px;align-items:flex-end;margin:0 0 22px}
.ct-root .ct-presets{display:flex;gap:8px;flex-wrap:wrap}
.ct-root .ct-period label.f,.ct-root .ct-filters label.f,.ct-root .ct-form label.f{display:flex;flex-direction:column;gap:4px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--mute)}
.ct-root input,.ct-root select{font:inherit;font-size:16px;color:var(--paper);background:var(--ink-2);border:1px solid var(--line-2);border-radius:8px;padding:9px 11px;min-height:42px;max-width:100%}
.ct-root .btn{width:auto;margin:0}
.ct-root .ct-actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}
.ct-root .ct-card{margin:0 0 16px}
.ct-root .ct-card h3{margin:0 0 12px;font-size:20px}
.ct-root .ct-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:0 0 20px}
.ct-root .ct-kpi{background:var(--ink-2);border:1px solid var(--line);border-radius:14px;padding:16px 18px;display:flex;flex-direction:column;gap:4px;min-width:0}
.ct-root .ct-kpi b{font-family:var(--display);font-size:clamp(22px,3vw,30px);font-weight:500;line-height:1.15;word-break:break-word}
.ct-root .ct-kpi small{color:var(--mute);font-size:13px}
.ct-root .ct-kpi.pos b{color:var(--ok)}.ct-root .ct-kpi.neg b{color:var(--accent)}
.ct-root .ct-grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;margin:0 0 4px}
@media(max-width:860px){.ct-root .ct-grid2{grid-template-columns:1fr}}
.ct-root .ct-chart .ct-cv{position:relative;height:280px}
.ct-root .ct-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.ct-root .ct-tbl{width:100%;border-collapse:collapse;font-size:14.5px}
.ct-root .ct-tbl th{text-align:left;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--mute);font-weight:500;padding:8px 10px;border-bottom:1px solid var(--line-2);white-space:nowrap}
.ct-root .ct-tbl td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
.ct-root .ct-tbl .r{text-align:right;white-space:nowrap}
.ct-root .ct-tbl .ct-empty{text-align:center;color:var(--mute);padding:22px}
.ct-root .ct-tbl tr.ct-void td{color:var(--mute);text-decoration:line-through}
.ct-root .ct-tbl tr.ct-void td small{text-decoration:none}
.ct-root .ct-tbl tr.ct-warn td{background:color-mix(in srgb,var(--accent) 10%,transparent)}
.ct-root .ct-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.ct-root .ct-filters{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 14px}
.ct-root .ct-dayhead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 16px}
.ct-root .ct-dayhead h3{margin:0 0 0 8px;text-transform:capitalize}
.ct-root .ct-cliwrap{display:grid;grid-template-columns:320px 1fr;gap:20px;align-items:start}
@media(max-width:860px){.ct-root .ct-cliwrap{grid-template-columns:1fr}}
.ct-root .ct-clis{margin-top:12px;display:grid;gap:6px;max-height:60vh;overflow:auto}
.ct-root .ct-err{background:color-mix(in srgb,var(--accent) 12%,transparent);border:1px solid var(--accent);border-radius:10px;padding:14px 16px;margin:0 0 16px}

/* cobro con calculadora */
.cb-back{position:fixed;inset:0;z-index:50;background:rgba(20,18,16,.55);display:grid;place-items:start center;padding:5vh 14px;overflow:auto}
.cb-dlg{position:relative;background:var(--ink);color:var(--paper);border:1px solid var(--line-2);border-radius:16px;padding:24px;width:100%;max-width:520px;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.cb-dlg h3{margin:0 0 4px;font-size:24px}
.cb-x{position:absolute;right:12px;top:10px;background:none;border:0;color:var(--mute);font-size:28px;line-height:1;cursor:pointer;padding:6px 10px}
.cb-sub{margin:0 0 16px;color:var(--mute);font-size:14px}
.cb-dlg input,.cb-dlg select{font:inherit;font-size:18px;color:var(--paper);background:var(--ink-2);border:1px solid var(--line-2);border-radius:8px;padding:10px 12px;min-height:46px;width:100%;max-width:100%}
.cb-dlg label.f{display:flex;flex-direction:column;gap:4px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--mute)}
.cb-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.cb-hint{margin:10px 0 0;font-size:13px;color:var(--mute)}
.cb-label{margin:18px 0 8px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--mute)}
.cb-met{display:flex;gap:8px;flex-wrap:wrap}
.cb-m[aria-pressed=true]{background:var(--paper);color:var(--ink);border-color:var(--paper)}
.cb-cash{margin-top:16px;padding:16px;border:1px dashed var(--line-2);border-radius:12px}
.cb-cash[hidden]{display:none}
.cb-quick{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.cb-res{min-height:56px}
.cb-line{margin:6px 0 0;font-size:15px;color:var(--mute)}
.cb-line.pos{color:var(--ok);font-weight:500}.cb-line.neg{color:var(--accent);font-weight:500}
.cb-change{margin:0;font-family:var(--display);font-size:44px;line-height:1.1;color:var(--ok)}
.cb-break{margin:4px 0 0;font-size:14px;color:var(--mute)}
.cb-dlg .btn[disabled]{opacity:.45;cursor:not-allowed}
.cb-dlg .ct-actions{margin-top:20px}
@media(max-width:520px){.cb-dlg{padding:20px 16px}.cb-change{font-size:38px}.cb-back{padding:2vh 8px}}

.ct-rowacts{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

/* productos en el cobro, cobrado y copia */
.cb-prod{margin-top:16px;padding:14px;border:1px dashed var(--line-2);border-radius:12px}
.cb-prod[hidden],.cb-total[hidden]{display:none}
.cb-prod .cb-label{margin-top:0}
.cb-item{display:grid;grid-template-columns:1fr auto auto auto;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.cb-in{min-width:0;overflow-wrap:anywhere}
.cb-qty{display:inline-flex;align-items:center;gap:8px}
.cb-qty .btn{min-width:34px;padding:4px 10px}
.cb-ip{white-space:nowrap;font-variant-numeric:tabular-nums}
.cb-rm{background:none;border:0;color:var(--mute);font-size:22px;cursor:pointer;padding:2px 8px}
.cb-total{margin-top:12px}
.cb-sum{margin:4px 0 0;font-family:var(--display);font-size:26px}
.cobrado{pointer-events:none;border-color:var(--ok);color:var(--ok);background:transparent}

/* aviso de citas por confirmar dentro del cobro */
.cb-pend{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 16px;padding:12px 14px;border-radius:10px;background:#fff4d6;color:#5a4300;border:1px solid #f0d58a;font-size:15px;font-weight:600}
.cb-pend-b{background:#5a4300;color:#fff;border:0;border-radius:8px;padding:10px 16px;font:inherit;font-size:13px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;min-height:40px}

/* móvil y tableta: nada se sale de ancho */
.ct-root,.ct-root *{box-sizing:border-box}
.ct-root .ct-cliwrap{grid-template-columns:minmax(0,320px) minmax(0,1fr)}
.ct-root .ct-grid2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.ct-root .ct-cliwrap>*,.ct-root .ct-grid2>*,.ct-root .ct-card{min-width:0}
.ct-root .ct-card{max-width:100%}
.ct-root .hint,.ct-root .ct-kpi b,.ct-root .ct-kpi small{overflow-wrap:anywhere}
@media(max-width:860px){.ct-root .ct-cliwrap,.ct-root .ct-grid2{grid-template-columns:minmax(0,1fr)}.ct-root .ct-clis{max-height:40vh}}
@media(min-width:521px) and (max-width:860px){.ct-root .ct-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:520px){
.ct-root .ct-kpis{grid-template-columns:1fr 1fr;gap:8px}
.ct-root .ct-kpi{padding:12px 14px}
.ct-root .ct-kpi .eyebrow{letter-spacing:.08em;font-size:10.5px}
.ct-root .ct-kpi b{font-size:22px}
.ct-root .ct-actions{display:flex;flex-wrap:wrap;gap:8px}
.ct-root .ct-actions .btn{flex:1 1 140px;justify-content:center;text-align:center}
}
/* móvil: las tablas se ven como tarjetas, sin moverse de lado */
@media(max-width:640px){
.ct-root .ct-scroll{overflow:visible}
.ct-root .ct-tbl,.ct-root .ct-tbl tbody,.ct-root .ct-tbl tr,.ct-root .ct-tbl td{display:block;width:100%}
.ct-root .ct-tbl thead{display:none}
.ct-root .ct-tbl tr{border:1px solid var(--line);border-radius:12px;padding:6px 14px;margin:0 0 10px;background:var(--ink-2)}
.ct-root .ct-tbl td{display:flex;justify-content:space-between;align-items:center;gap:14px;border:0;padding:7px 0;text-align:right;white-space:normal;overflow-wrap:anywhere}
.ct-root .ct-tbl td+td{border-top:1px dashed var(--line)}
.ct-root .ct-tbl td::before{content:attr(data-l);flex:0 0 auto;max-width:45%;text-align:left;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
.ct-root .ct-tbl td[data-l=""]::before{content:none}
.ct-root .ct-tbl td[data-l=""]{justify-content:flex-end}
.ct-root .ct-tbl td.ct-empty{justify-content:center;border:0}
.ct-root .ct-tbl td.ct-empty::before{content:none}
.ct-root .ct-tbl tr:has(td.ct-empty){border:0;background:none}
}
.ct-root .ct-cliwrap input[type=search]{width:100%}
.ct-root .ct-cliwrap>div{scroll-margin-top:150px}
