/* Consultorio de la Dra. Nicolle Anco. Blanco y negro; rojo y azul solo donde significan algo. */
:root {
  --n: #1d1d1f; --t: #1d1d1f; --t2: #6e6e73; --t3: #8e8e93; --b: #fff; --f: #f5f5f7; --f2: #ececf0; --l: #e5e5ea; --l2: #d2d2d7;
  --rojo: #d70015; --rojo-f: #fdecee; --azul: #0a5fd6; --azul-f: #e8f0fc;
  --r: 18px; --r2: 11px; --ease: cubic-bezier(.2, .8, .2, 1); --lado: 236px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--f); color: var(--t); font: 400 14.5px/1.45 "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-feature-settings: "tnum"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: default; opacity: .4; }
h1, h2, h3, p, ol, blockquote { margin: 0; padding: 0; }
ol { list-style: none; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
svg { display: block; }
small { font-size: 12.5px; color: var(--t2); }
.tenue { color: var(--t2); font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.txt-rojo { color: var(--rojo) !important; }

/* Armazón */
.app { display: flex; min-height: 100vh; }
.lado { position: fixed; inset: 0 auto 0 0; width: var(--lado); background: var(--b); border-right: 1px solid var(--l); display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 20; }
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.mono { width: 36px; height: 36px; flex: none; border-radius: 12px 12px 12px 3px; background: var(--n); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.marca b { display: block; font-weight: 600; font-size: 14px; line-height: 1.2; }
.marca small { font-size: 12px; }
.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: #424245; font-weight: 500; transition: background .15s; }
.menu a svg { width: 19px; height: 19px; flex: none; }
.menu a span { flex: 1; }
.menu a:hover { background: var(--f); }
.menu a.on { background: var(--n); color: #fff; }
.menu em, .abajo em { font-style: normal; font-size: 11px; font-weight: 600; background: var(--rojo); color: #fff; border-radius: 20px; padding: 0 6px; line-height: 17px; min-width: 17px; text-align: center; }
.lado-pie { font-size: 12px; color: var(--t2); padding: 12px 8px 0; border-top: 1px solid var(--l); }
.lado-pie button { margin-top: 6px; color: var(--t); font-size: 12px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.principal { flex: 1; min-width: 0; margin-left: var(--lado); padding: 26px 32px 60px; max-width: 1280px; }
.abajo { display: none; }

/* Encabezados */
.cab-pant h1, .saludo h1, .fi-cab h1 { font-size: 27px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.cab-pant { margin-bottom: 16px; }
.saludo { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.saludo p { color: var(--t2); margin-top: 2px; }
.saludo p::first-letter { text-transform: uppercase; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: 22px; background: var(--b); border: 1px solid var(--l2); font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s, transform .15s var(--ease); min-height: 38px; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--f2); }
.btn:active { transform: scale(.98); }
.btn.prim { background: var(--n); border-color: var(--n); color: #fff; }
.btn.prim:hover { background: #000; }
.btn.blanco { background: #fff; border-color: #fff; color: var(--n); }
.btn.fantasma { background: transparent; border-color: rgb(255 255 255 / .35); color: #fff; }
.btn.fantasma:hover { background: rgb(255 255 255 / .12); }
.btn.peq { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.btn.mas { display: flex; margin: 12px auto; }
.ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--l2); background: var(--b); transition: background .15s; }
.ico svg { width: 16px; height: 16px; }
.ico:hover { background: var(--f2); }
.enlace { color: var(--azul); font-weight: 500; font-size: 13.5px; display: inline-block; }
.enlace:hover { text-decoration: underline; }
.enlace.rojo { color: var(--rojo); }

/* Tarjetas y KPI */
.tarjeta { background: var(--b); border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px; min-width: 0; }
.tarjeta.sin-p { padding: 4px 0; overflow: hidden; }
.tj-t { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 8px; }
.tj-fila { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tj-fila .tj-t { margin-bottom: 2px; }
.tj-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--b); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi-e { font-size: 12.5px; color: var(--t2); }
.kpi-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.25; }
.kpi-n { font-size: 12px; color: var(--t2); }
.kpi.marcado .kpi-v { color: var(--rojo); }
.kpi.negro { background: var(--n); color: #fff; }
.kpi.negro .kpi-e, .kpi.negro .kpi-n { color: #c7c7cc; }
.dos { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }

/* Ahora */
.ahora { background: var(--n); color: #fff; border-radius: var(--r) var(--r) var(--r) 5px; padding: 20px 22px; margin-bottom: 14px; }
.ah-e { font-size: 13px; color: #c7c7cc; }
.ahora h2 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.ahora p { color: #e5e5ea; margin-top: 2px; }
.ah-avisos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ah-avisos:empty { display: none; }
.ah-avisos span { display: inline-flex; align-items: center; gap: 5px; background: rgb(255 255 255 / .14); padding: 3px 10px; border-radius: 14px; font-size: 12.5px; }
.ah-avisos .ah-alerta { background: var(--rojo); font-weight: 600; }
.ah-alerta svg { width: 14px; height: 14px; }
.ah-acc { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Chips */
.chip { display: inline-block; padding: 2px 9px; border-radius: 12px; background: var(--f2); color: var(--t); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.rojo { background: var(--rojo-f); color: #b00012; }
.chip.azul { background: var(--azul-f); color: #084cab; }
.chip.negro { background: var(--n); color: #fff; }
.chip.tenue { background: var(--f); color: var(--t2); }

/* Filas */
.pend { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--f2); min-width: 0; }
.tj-t + .pend, .tj-fila + .pend, .cuenta + .pend { border-top: 0; }
.pend > :first-child { min-width: 0; }
.pend b { display: block; font-weight: 500; }
.pend small { display: block; }
.pend-acc { display: flex; align-items: center; gap: 8px; flex: none; }
.pend-btn { width: 100%; }
.pend-btn:hover b { text-decoration: underline; }
.pend a:hover b { text-decoration: underline; }
.total { display: flex; justify-content: space-between; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--l); font-size: 15px; }
.total b { font-weight: 600; }
.vacio { color: var(--t2); padding: 14px 0; text-align: center; font-size: 13.5px; }
.tarjeta.sin-p .vacio { padding: 24px 16px; }
.lista-citas { display: flex; flex-direction: column; }
.fila-cita { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 8px; margin: 0 -8px; border-radius: 12px; border-top: 1px solid var(--f2); transition: background .15s; }
.fila-cita:first-child { border-top: 0; }
.fila-cita:hover { background: var(--f); }
.fc-h { font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-h small { display: block; font-weight: 400; }
.fc-c b { display: block; font-weight: 500; }
.fc-c small { display: block; }
.fila-cita.est-atendida .fc-c b, .fila-cita.est-no_vino .fc-c b, .fila-cita.est-atendida .fc-h, .fila-cita.est-no_vino .fc-h { color: var(--t3); font-weight: 400; }
.fila-cita.est-en_atencion { background: var(--f); }

/* Barra de herramientas */
.barra { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.bar-nav, .bar-der { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bar-t { font-size: 17px; font-weight: 600; margin-left: 6px; }
.bar-t::first-letter { text-transform: uppercase; }
.seg { display: inline-flex; background: var(--f2); border-radius: 12px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--t2); white-space: nowrap; }
.seg button.on { background: var(--b); color: var(--t); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.buscador { display: flex; align-items: center; gap: 8px; background: var(--b); border-radius: 22px; padding: 0 14px; flex: 1 1 260px; max-width: 400px; min-height: 40px; }
.buscador svg { width: 16px; height: 16px; color: var(--t2); flex: none; }
.buscador input { border: 0; background: none; outline: 0; width: 100%; padding: 9px 0; font-size: 16px; border-radius: 0; }

/* Agenda: día */
.dia { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-auto-rows: minmax(44px, auto); column-gap: 10px; }
.dia-h { grid-column: 1; font-size: 12.5px; color: var(--t2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.dia-libre, .dia-vacio, .dia-cita, .dia-pausa { grid-column: 2; }
.dia-libre { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--f2); padding: 0 10px; color: #c7c7cc; font-size: 13px; border-radius: 0; transition: background .15s, color .15s; }
.dia-libre svg { width: 14px; height: 14px; }
.dia-libre:hover, .dia-libre:focus-visible { background: var(--f); color: var(--t2); border-radius: 10px; }
.dia-vacio { border-top: 1px solid var(--f2); }
.dia-pausa { background: repeating-linear-gradient(135deg, var(--f), var(--f) 6px, #fff 6px, #fff 12px); border-radius: 10px; font-size: 12.5px; color: var(--t2); display: flex; align-items: center; padding: 0 12px; margin: 2px 0; }
.dia-cita { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; background: var(--f); border-left: 3px solid var(--n); border-radius: 4px 12px 12px 4px; padding: 8px 12px; margin: 2px 0; min-width: 0; transition: background .15s; }
.dia-cita:hover { background: var(--f2); }
.dc-t { min-width: 0; }
.dc-t b { display: block; font-weight: 500; }
.dc-t small { display: block; }
.dia-cita.est-en_atencion { background: var(--n); color: #fff; }
.dia-cita.est-en_atencion small { color: #c7c7cc; }
.dia-cita.est-en_atencion .chip { background: #fff; color: var(--n); }
.dia-cita.est-pendiente { border-left-color: var(--l2); }
.dia-cita.est-atendida, .dia-cita.est-no_vino { border-left-color: var(--l2); background: #fafafb; }
.dia-cita.est-atendida b, .dia-cita.est-no_vino b { color: var(--t2); }

/* Agenda: semana */
.semana { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: start; }
.sem-dia { background: var(--b); border-radius: var(--r); padding: 10px; min-width: 0; }
.sem-dia.hoy { box-shadow: inset 0 0 0 2px var(--n); }
.sem-cab { display: block; width: 100%; padding: 2px 4px 8px; }
.sem-cab span { font-size: 12.5px; color: var(--t2); display: block; text-transform: capitalize; }
.sem-cab b { font-size: 20px; font-weight: 600; display: block; line-height: 1.2; }
.sem-cab:hover b { text-decoration: underline; }
.sem-cita { display: block; width: 100%; padding: 7px 8px; border-radius: 9px; background: var(--f); margin-top: 5px; font-size: 12.5px; min-width: 0; transition: background .15s; }
.sem-cita:hover { background: var(--f2); }
.sem-cita b { display: block; font-weight: 600; }
.sem-cita span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sem-cita.est-atendida, .sem-cita.est-no_vino { color: var(--t3); background: #fafafb; }
.sem-dia .vacio { padding: 8px 0; font-size: 12.5px; }

/* Pacientes */
.fila-pac { display: grid; grid-template-columns: 38px minmax(0, 1.7fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--f2); transition: background .15s; }
.fila-pac:first-child { border-top: 0; }
.fila-pac:hover { background: #fafafb; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--f2); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; }
.fp-n b { display: block; font-weight: 500; }
.fp-n small { display: block; }
.fp-d { font-size: 13px; }
.fp-d small { display: block; font-size: 11.5px; }
.fp-c { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* Ficha */
.volver { display: inline-flex; align-items: center; gap: 5px; color: var(--t2); font-size: 13.5px; margin-bottom: 8px; }
.volver svg { width: 15px; height: 15px; }
.volver:hover { color: var(--t); }
.fi-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.fi-acc { display: flex; gap: 8px; }
.aviso-rojo, .aviso { padding: 7px 12px; border-radius: 10px; font-size: 13.5px; }
.aviso-rojo { background: var(--rojo-f); color: #b00012; font-weight: 600; }
.aviso { background: var(--f); }
.grande { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.grande svg { width: 16px; height: 16px; flex: none; }
.aviso.grande { background: var(--b); }
.pestanas { display: flex; gap: 2px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--l); }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas button { padding: 9px 13px; font-weight: 500; color: var(--t2); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestanas button.on { color: var(--t); border-color: var(--n); }
.cuenta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--f); border-radius: 12px; padding: 12px 14px; margin-bottom: 6px; }
.cuenta small { display: block; }
.cuenta b { font-weight: 600; font-size: 16px; }
.nota-nueva { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.linea li { padding: 10px 0 10px 16px; border-left: 2px solid var(--f2); position: relative; }
.linea li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; background: var(--n); border-radius: 50%; }

/* Odontograma */
.odonto { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 0; margin: 14px 0 12px; }
.cuad { display: flex; gap: 2px; min-width: 0; padding: 0 6px; }
.cuad-d { justify-content: flex-end; border-right: 1px solid var(--l2); }
.cuad-i { justify-content: flex-start; }
.pieza { flex: 0 1 50px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 1px; border-radius: 8px; position: relative; transition: background .15s; }
.pieza:hover { background: var(--f); }
.pieza-n { font-size: 11.5px; color: var(--t2); font-variant-numeric: tabular-nums; }
.pieza-svg { width: 100%; max-width: 44px; height: auto; overflow: visible; }
.pieza.con-plan::after, .punto-plan { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--n); display: inline-block; }
.pieza.con-plan::after { position: absolute; top: 3px; right: 3px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--t2); padding-top: 12px; border-top: 1px solid var(--f2); }
.leyenda > span { display: inline-flex; align-items: center; gap: 5px; }
.leyenda i:not(.punto-plan) { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ley-mini { width: 16px; display: inline-block; }
.ley-mini svg { width: 16px; height: 16px; }
.cara { cursor: pointer; transition: opacity .15s; }
.cara:hover { opacity: .7; }
.cara:focus-visible { outline: none; stroke: var(--n); stroke-width: 2.4; }

/* Panel de la pieza */
.pz { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; }
.pz h3 { font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
.pz-der h3:first-child { margin-top: 0; }
.pz-grande { max-width: 170px; margin: 0 auto; }
.pz-grande .pieza-svg { max-width: 170px; }
.pz-estado { text-align: center; font-size: 13px; color: var(--t2); margin-top: 8px; }
.pz-estado::first-letter { text-transform: uppercase; }
.pz-herr { display: flex; flex-wrap: wrap; gap: 6px; }
.herr { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--l2); border-radius: 18px; font-size: 13px; font-weight: 500; }
.herr i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.herr-sano { border: 1px solid var(--t3); background: #fff; }
.herr:hover { background: var(--f); }
.herr.on { background: var(--n); border-color: var(--n); color: #fff; }
.pz-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; }
.pz-sumar { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.pz-sumar .campo { flex: 1; min-width: 0; }
.pz-sumar .btn { min-height: 42px; }

/* Leads */
.fila-lead { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 18px; border-top: 1px solid var(--f2); transition: background .15s; }
.fila-lead:first-child { border-top: 0; }
.fila-lead:hover { background: #fafafb; }
.fl-c { min-width: 0; }
.fl-c b { display: block; font-weight: 500; }
.fl-c small { display: block; }
.fl-nota { color: var(--t) !important; margin-top: 2px; }
.fl-d { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.cita-lead { background: var(--f); border-radius: 12px 12px 12px 3px; padding: 10px 13px; }

/* Caja */
.tabla-c { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: right; font-size: 12.5px; font-weight: 500; color: var(--t2); padding: 8px 8px; }
.tabla td { text-align: right; padding: 10px 8px; border-top: 1px solid var(--f2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla th:first-child, .tabla td:first-child { text-align: left; text-transform: capitalize; padding-left: 0; }
.tabla b { font-weight: 600; }
.nota { margin-top: 8px; }

/* Gastos */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.filtros .buscador { flex: 1 1 180px; max-width: none; }
.filtros .ctl { flex: 1 1 160px; width: auto; }
.buscador.gris { background: var(--f); }
.fijo-n { flex: 1; min-width: 0; }
.fijo-n:hover b { text-decoration: underline; }
.m-pie .txt-rojo { margin-right: auto; }

/* Insumos y precios */
.fila-ins { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--f2); }
.fila-ins:first-child { border-top: 0; }
.fi-n { flex: 1; min-width: 0; }
.fi-n b { display: block; font-weight: 500; }
.fi-n small { display: block; }
.stepper { display: inline-flex; align-items: center; background: var(--f); border-radius: 18px; flex: none; }
.stepper button { width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; border-radius: 50%; }
.stepper button:hover:not(:disabled) { background: var(--f2); }
.stepper .num { min-width: 22px; text-align: center; }
.precios { columns: 2; column-gap: 14px; }
.precios .tarjeta { break-inside: avoid; }
.precio { display: flex; align-items: center; gap: 5px; background: var(--f); border-radius: 10px; padding: 0 9px; flex: none; }
.precio span { font-size: 13px; color: var(--t2); }
.precio input { width: 58px; border: 0; background: none; padding: 7px 0; text-align: right; font-weight: 500; font-size: 16px; outline-offset: 3px; }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 12px; }
.form h3 { font-size: 13.5px; font-weight: 600; }
.form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo > span { font-size: 12.5px; font-weight: 500; color: var(--t2); }
.ctl { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--l2); border-radius: var(--r2); background: var(--b); font-size: 16px; min-height: 42px; }
textarea.ctl { resize: vertical; font-size: 15px; }
.ctl:focus { outline: 2px solid var(--azul); outline-offset: -1px; border-color: transparent; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.check { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: var(--f); cursor: pointer; }
.check span { flex: 1; min-width: 0; }
.check em { font-style: normal; font-weight: 500; white-space: nowrap; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--n); }
.resumen-cobro { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--l); }
.resumen-cobro b { font-size: 17px; font-weight: 600; white-space: nowrap; }

/* Modal */
.modal { border: 0; padding: 0; border-radius: 20px; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: var(--b); color: var(--t); box-shadow: 0 20px 60px rgb(0 0 0 / .25); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; animation: sube .22s var(--ease); }
.modal.ancho { width: min(680px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(0 0 0 / .4); }
@keyframes sube { from { opacity: 0; transform: translateY(10px); } }
.m-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 10px; }
.m-cab h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.m-x { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--f); flex: none; }
.m-x svg { width: 15px; height: 15px; }
.m-cuerpo { padding: 2px 20px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.m-error { margin-top: 10px; color: #b00012; background: var(--rojo-f); padding: 8px 11px; border-radius: 9px; font-size: 13.5px; }
.m-error[hidden] { display: none; }
.m-pie { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--f2); }
.cita-det { display: flex; flex-direction: column; gap: 8px; }
.cd-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cd-nom { font-size: 17px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--l2); text-underline-offset: 3px; }
.cd-bajo { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 4px; }
.cita-det .tenue::first-letter { text-transform: uppercase; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); background: var(--n); color: #fff; padding: 9px 16px; border-radius: 20px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
#toast.ver { opacity: 1; transform: translate(-50%, 0); }

/* Tablet y celular */
@media (max-width: 1080px) {
  .dos { grid-template-columns: minmax(0, 1fr); }
  .con-orden > :last-child { order: -1; }
  .semana { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .lado { display: none; }
  .principal { margin-left: 0; padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
  .abajo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: fixed; inset: auto 0 0 0; background: rgb(255 255 255 / .94); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--l); padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
  .abajo a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0; color: var(--t2); font-size: 10.5px; letter-spacing: -.01em; font-weight: 500; position: relative; min-width: 0; }
  .abajo a svg { width: 22px; height: 22px; }
  .abajo a.on { color: var(--t); font-weight: 600; }
  .abajo em { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 4px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .odonto { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cuad, .cuad-d, .cuad-i { justify-content: center; border-right: 0; padding: 0; }
  .fila-pac { grid-template-columns: 38px minmax(0, 1fr); padding: 11px 16px; }
  .fp-d { display: none; }
  .fp-c { grid-column: 2; justify-content: flex-start; }
  .fp-c:empty { display: none; }
  .precios { columns: 1; }
}
@media (max-width: 620px) {
  .cab-pant h1, .saludo h1, .fi-cab h1 { font-size: 23px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-v { font-size: 19px; }
  .tarjeta { padding: 15px 16px; }
  .semana { grid-template-columns: minmax(0, 1fr); }
  .form-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fila-cita { grid-template-columns: 46px minmax(0, 1fr); }
  .fila-cita .chip { grid-column: 2; justify-self: start; }
  .dia-cita { flex-direction: column; gap: 4px; }
  .barra > .bar-der, .barra > .btn { flex-wrap: wrap; }
  .bar-t { width: 100%; margin: 4px 0 0; }
  .fila-ins { flex-wrap: wrap; padding: 11px 16px; }
  .fi-n { flex-basis: 100%; }
  .fila-ins .btn { margin-left: auto; }
  .fila-lead { padding: 12px 16px; flex-direction: column; gap: 6px; }
  .fl-d { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
  .pz { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pz-grande { max-width: 130px; }
  .modal { width: 100vw; max-width: 100vw; max-height: 90vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .modal.ancho { width: 100vw; }
  .pend { flex-wrap: wrap; }
  .cuenta { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 10px; }
  .cuenta b { font-size: 14px; }
  .cuenta small { font-size: 11.5px; }
}

/* Impresión del presupuesto */
@media print {
  body > *:not(#impresion) { display: none !important; }
  body { background: #fff; }
}
#impresion { display: none; }
@media print {
  #impresion { display: block; padding: 24px; font-size: 14px; color: #000; }
  #impresion h1 { font-size: 24px; margin-bottom: 6px; }
  #impresion table { width: 100%; border-collapse: collapse; margin-top: 18px; }
  #impresion th, #impresion td { border-bottom: 1px solid #bbb; padding: 8px 4px; text-align: left; }
  #impresion th:last-child, #impresion td:last-child { text-align: right; }
  #impresion tfoot td { font-weight: 700; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
