/* odontOS · «Nueva planificación» de la ficha del paciente (2026-11-30)
   Copia de la maqueta aprobada ~/Desktop/CODIGO/maqueta_nueva_planificacion_ficha.html (medidas en px reales; la ventana corre con zoom 1.3334 como el resto de modales).
   Se apoya en css/48-tratamientoCombo.css (.fx-card.pl2: ventana, tablero del odontograma, lista de caras, hoja móvil) y cambia el resto con prefijo .pf-.
   Va después de 48-tratamientoCombo.css. Nada de esto afecta a otras pantallas: todo cuelga de .fx-card.pf. */

/* ---- Colores de la maqueta (claro) y los mismos tokens en oscuro ---- */
.fx-card.pl2.pf {
  --p-bg:#F3F5FA; --p-card:#FFFFFF; --p-card2:#F1F5F9; --p-fld:#F6F8FB;
  --p-ink:#0F172A; --p-ink2:#38425B; --p-mut:#5A6580;
  --p-line:rgba(47,74,184,.14); --p-line-soft:rgba(47,74,184,.14); --p-fld-line:rgba(47,74,184,.14);
  --p-acc:#0369A1; --p-acc-soft:#F0F9FF; --p-primary:#0369A1; --p-primary-h:#075985;
  --p-h:42px; --pf-good:#0F9D58; --pf-warn:#F59E0B;
}
:root[data-theme="dark"] .fx-card.pl2.pf {
  --p-bg:#121212; --p-card:#1C1C1E; --p-card2:#252528; --p-fld:#252528;
  --p-ink:#ECECEC; --p-ink2:#BDBDC2; --p-mut:#8E8E93;
  --p-line:rgba(255,255,255,.12); --p-line-soft:rgba(255,255,255,.12); --p-fld-line:rgba(255,255,255,.12);
  --p-acc:#38BDF8; --p-acc-soft:rgba(56,189,248,.14); --p-primary:#0284C7; --p-primary-h:#0369A1;
  --pf-good:#34D399; --pf-warn:#FBBF24;
}
html body .fx-ov .fx-card.pl2.pf { width:1120px !important; max-width:94vw !important; font-size:14px; line-height:normal; } /* ~1100 px máx., 94 % del ancho en pantallas chicas */
.fx-card.pf button, .fx-card.pf label { font-family:var(--p-font); line-height:1.2; }
.fx-card.pf .bm-err:not(.on) { display:none; }

/* ---- Encabezado ---- */
.fx-card.pf .pf-hd { display:flex; align-items:center; gap:12px; padding:16px 22px; background:var(--p-card); border-bottom:1px solid var(--p-line); flex:none; }
.fx-card.pf .pf-hic { width:38px; height:38px; border-radius:12px; background:var(--p-acc-soft); color:var(--p-acc); display:grid; place-items:center; flex:none; }
.fx-card.pf .pf-hic svg { width:20px; height:20px; }
.fx-card.pf .pf-htx { min-width:0; }
html body .fx-ov .fx-card.pf .pf-htx h2 { margin:0 !important; font-size:17.6px !important; font-weight:700 !important; line-height:1.3 !important; color:var(--p-ink) !important; font-family:var(--p-font) !important; letter-spacing:0; }
html body .fx-ov .fx-card.pf .pf-htx p { margin:0 !important; font-size:13.6px !important; color:var(--p-mut) !important; line-height:1.3 !important; }
.fx-card.pf .pf-sp { flex:1; }
html body .fx-ov .fx-card.pf.pl2 .pf-seg, html body .fx-ov .fx-card.pf.pl2 .pf-chips, html body .fx-ov .fx-card.pf.pl2 .pf-leg { margin-top:0; margin-bottom:0; }
.fx-card.pf .pf-hmeta { display:flex; align-items:center; gap:12px; }
.fx-card.pf .pf-fecha { display:flex; align-items:center; gap:8px; width:170px; height:42px; padding:0 12px; border-radius:12px; border:1px solid var(--p-line); background:var(--p-fld); }
.fx-card.pf .pf-fecha svg { width:16px; height:16px; color:var(--p-mut); flex:none; }
html body .fx-ov .fx-card.pf.pl2 .pf-fecha input[type="date"] { height:40px !important; min-height:0 !important; width:100%; border:0 !important; background:transparent !important; box-shadow:none !important; padding:0 !important; font-family:var(--p-font) !important; font-size:14.7px !important; font-weight:500; color:var(--p-ink) !important; outline:0; }
.fx-card.pf .pf-seg { display:flex; background:var(--p-fld); border:1px solid var(--p-line); border-radius:12px; padding:4px; gap:4px; }
html body .fx-card.pf .pf-seg button { min-height:0; height:auto; border:0; background:transparent; padding:8px 14px; border-radius:9px; font-size:13.4px; font-weight:700; color:var(--p-mut); display:inline-flex; align-items:center; gap:6px; white-space:nowrap; box-shadow:none; cursor:pointer; transition:background 150ms, color 150ms; }
html body .fx-card.pf .pf-seg button.on { background:var(--p-card); color:var(--p-ink); box-shadow:0 1px 3px rgba(15,23,42,.12); }
:root[data-theme="dark"] .fx-card.pf .pf-seg button.on { background:#48484A; }
.fx-card.pf .pf-dot { width:9px; height:9px; border-radius:50%; display:inline-block; flex:none; }
.fx-card.pf .pf-dot.am { background:var(--pf-warn); } .fx-card.pf .pf-dot.gr { background:var(--pf-good); } .fx-card.pf .pf-dot.rd { background:var(--p-red); }
html body .fx-card.pf button.pf-x { width:34px; height:34px; min-width:0; min-height:0; padding:0; border-radius:50%; border:1px solid var(--p-line); background:var(--p-card); color:var(--p-ink2); display:grid; place-items:center; flex:none; position:relative; box-shadow:none; cursor:pointer; }
.fx-card.pf .pf-x svg { width:15px; height:15px; }
.fx-card.pf .pf-x::after { content:""; position:absolute; inset:-6px; }
.fx-card.pf .pf-x:hover { background:var(--p-card2); color:var(--p-ink); }

/* ---- Cuerpo: 2 columnas 1.25fr / 1fr ---- */
.fx-card.pf .pf-bd { padding:16px 22px; display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:16px; align-items:start; overflow-y:auto; overscroll-behavior:contain; min-height:0; }
.fx-card.pf .pf-col { display:grid; gap:14px; min-width:0; }
.fx-card.pf .pf-cd { background:var(--p-card); border:1px solid var(--p-line); border-radius:16px; padding:16px; min-width:0; }
.fx-card.pf .pf-lab { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; font-size:12.8px; font-weight:800; color:var(--p-ink2); }
html body .fx-ov .fx-card.pf .pf-lab h3 { margin:0 !important; font-size:12.8px !important; font-weight:800 !important; color:var(--p-ink2) !important; letter-spacing:0; font-family:var(--p-font) !important; white-space:nowrap; }
.fx-card.pf .pf-lab span { font-weight:600; color:var(--p-mut); text-align:right; }

/* Chips de zona */
.fx-card.pf .pf-chips { display:flex; gap:8px; flex-wrap:wrap; }
html body .fx-ov .fx-card.pf.pl2 .pf-chips { margin-bottom:10px; }
html body .fx-card.pf button.pf-chip { position:relative; min-height:0; height:auto; padding:9px 15px; border:1px solid var(--p-line); border-radius:999px; background:var(--p-card); font-size:13.1px; font-weight:700; color:var(--p-acc); box-shadow:none; cursor:pointer; transition:background 150ms, border-color 150ms; }
.fx-card.pf .pf-chip::after { content:""; position:absolute; inset:-2px 0; }
.fx-card.pf .pf-chip:hover:not(.on) { background:var(--p-acc-soft); }
html body .fx-card.pf .pf-chip.on { background:var(--p-acc-soft); border-color:var(--p-acc); }
.fx-card.pf .pf-chip:active { transform:scale(.97); }
.fx-card.pf .pf-chip.pf-movil, .fx-card.pf .pf-arcsel { display:none; }

/* Leyenda del odontograma */
.fx-card.pf .pf-leg { display:flex; gap:16px; align-items:center; flex-wrap:wrap; font-size:12.8px; color:var(--p-mut); }
html body .fx-card.pf button.pf-link { min-height:0; height:auto; padding:0; border:0; background:none; box-shadow:none; color:var(--p-acc); font-size:12.8px; font-weight:800; cursor:pointer; position:relative; }
.fx-card.pf .pf-link::after { content:""; position:absolute; inset:-8px -4px; }
.fx-card.pf .pf-link:hover { text-decoration:underline; text-underline-offset:3px; }
.fx-card.pf .pf-leg .k { display:flex; gap:6px; align-items:center; }
.fx-card.pf .pf-leg .k i { width:9px; height:9px; border-radius:2px; display:inline-block; }
.fx-card.pf .pf-leg .k i.au { border:1.5px dashed var(--p-mut); background:none; }
.fx-card.pf .pf-leg .k b.x { color:var(--p-red); font-size:13px; line-height:1; }
.fx-card.pf .pl2-odo-row { margin-top:2px; }
html body .fx-ov .fx-card.pf.pl2 .pf-leg { margin-top:8px; }

/* ---- Formulario ---- */
.fx-card.pf .pf-form { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px; margin-bottom:12px; }
.fx-card.pf .pf-f { display:block; position:relative; min-width:0; margin:0; }
.fx-card.pf .pf-f.pf-full { grid-column:1 / -1; }
.fx-card.pf .pf-lb { display:block; margin:0; padding-bottom:5px; font-size:12.8px; font-weight:700; color:var(--p-ink2); white-space:nowrap; }
html body .fx-ov .fx-card.pf.pl2 .pf-lb { font-size:12.8px !important; line-height:normal !important; font-weight:700 !important; color:var(--p-ink2) !important; }
html body .fx-ov .fx-card.pf.pl2 .pf-lb em { font-weight:600 !important; color:var(--p-mut) !important; }
.fx-card.pf .pf-lb em { font-style:normal; font-weight:600; color:var(--p-mut); }
.fx-card.pf .pf-ast { color:var(--p-red); }
html body .fx-ov .fx-card.pf.pl2 input.pf-in.pf-in, html body .fx-ov .fx-card.pf.pl2 .pf-combo input.tc-in.tc-in, html body .fx-ov .fx-card.pf.pl2 input.et-in.et-in, html body .fx-ov .fx-card.pf.pl2 input.dc-in.dc-in {
  display:block; height:42px !important; min-height:0 !important; width:100% !important; margin:0 !important; border-radius:12px !important; border:1px solid var(--p-line) !important; background-color:var(--p-fld) !important; background-image:none !important; padding:0 12px !important;
  font-family:var(--p-font) !important; font-size:14.7px !important; font-weight:500; color:var(--p-ink) !important; box-shadow:none !important; outline:0; box-sizing:border-box; text-overflow:clip; }
html body .fx-ov .fx-card.pf.pl2 .pf-combo input.tc-in.tc-in { padding-right:34px !important; }
html body .fx-ov .fx-card.pf.pl2 input.pf-in.pf-in:focus, html body .fx-ov .fx-card.pf.pl2 .pf-combo input.tc-in.tc-in:focus, html body .fx-ov .fx-card.pf.pl2 input.et-in.et-in:focus, html body .fx-ov .fx-card.pf.pl2 input.dc-in.dc-in:focus { border-color:var(--p-acc) !important; box-shadow:0 0 0 3px var(--p-acc-soft) !important; }
html body .fx-ov .fx-card.pf.pl2 input.pf-in.pf-in.bm-bad, html body .fx-ov .fx-card.pf.pl2 input.dc-in.dc-in.bm-bad, html body .fx-ov .fx-card.pf.pl2 input.tc-in.tc-in.bm-bad { border-color:var(--p-red) !important; }
.fx-card.pf .pf-in::placeholder, .fx-card.pf .tc-in::placeholder, .fx-card.pf .et-in::placeholder, .fx-card.pf .dc-in::placeholder { color:var(--p-mut); opacity:1; font-weight:500; }
.fx-card.pf .pf-combo { position:relative; min-width:0; }
.fx-card.pf .pf-combo .tc-wrap, .fx-card.pf .pf-combo .tc-box { width:100%; }
.fx-card.pf .pf-money { position:relative; }
.fx-card.pf .pf-money span { position:absolute; left:12px; top:0; height:42px; display:flex; align-items:center; font-size:14.7px; font-weight:700; color:var(--p-ink); pointer-events:none; }
html body .fx-ov .fx-card.pf.pl2 .pf-money input.pf-in.pf-in { padding-left:28px !important; font-weight:700; font-variant-numeric:tabular-nums; }
/* Etapa y descuento (js/plan-item-extra.js) con la medida de la maqueta */
.fx-card.pf .et-c, .fx-card.pf .dc-c { position:relative; }
html body .fx-ov .fx-card.pf.pl2 input.et-in.et-in { padding-right:30px !important; }
html body .fx-ov .fx-card.pf.pl2 input.dc-in.dc-in { padding-right:84px !important; }
.fx-card.pf .et-chev { right:14px; border-color:var(--p-mut); }
.fx-card.pf .et-list { background:var(--p-card); border:1px solid var(--p-line); border-radius:12px; padding:4px; box-shadow:0 10px 28px rgba(15,23,42,.18); min-width:100%; z-index:60; }
.fx-card.pf .et-o { padding:9px 10px; border-radius:8px; font-size:14px; font-weight:600; color:var(--p-ink2); }
.fx-card.pf .et-o.on, .fx-card.pf .et-o:hover { background:var(--p-acc-soft); color:var(--p-acc); }
.fx-card.pf .et-o.new { color:var(--p-acc); font-weight:800; border-radius:8px; }
.fx-card.pf .dc-seg { position:absolute; right:6px; top:50%; transform:translateY(-50%); display:flex; gap:4px; background:var(--p-card); border:1px solid var(--p-line); border-radius:8px; padding:2px; }
html body .fx-card.pf .dc-seg button { flex:none; min-height:0; height:auto; width:auto; margin:0; padding:4px 11px; border:0; border-radius:6px; background:transparent; box-shadow:none; font-size:12.8px; font-weight:800; line-height:1.3; color:var(--p-mut); cursor:pointer; }
html body .fx-card.pf .dc-seg button.on { background:var(--p-primary); color:#fff; }
/* Caras: misma lista de 48-tratamientoCombo con la medida de la maqueta */
html body .fx-card.pf button.bmn-cbtn { height:42px; border-radius:12px; border-color:var(--p-line); padding:0 30px 0 10px; }
html body .fx-card.pf .bmn-dis .bmn-cbtn { border-style:solid; background:var(--p-fld); cursor:default; }
.fx-card.pf .bmn-cbtn > svg { top:12px; right:10px; }
.fx-card.pf .bmn-tags .ph { font-size:14.7px; padding-left:2px; }
html body .fx-card.pf .bmn-tags b { height:28px; min-width:28px; justify-content:center; padding:0 8px; }
html body .fx-card.pf .bmn-cdd { left:0; width:max(100%, 300px); }

/* Caras en la demo (diente de 5 caras): sin caras posibles se ve como el campo de la maqueta */
.fx-card.pf .pf-f.caras .bmn-dien { min-height:42px; }
.fx-card.pf .pf-f.caras .bmn-dien:has(.ph) { height:42px; padding:0 12px; border:1px solid var(--p-line); border-radius:12px; background:var(--p-fld); align-items:center; }
.fx-card.pf .pf-f.caras .bmn-dien .ph { font-size:14.7px; }

/* Botones */
html body .fx-card.pf button.pf-btn { height:42px; min-height:0; padding:0 16px; border-radius:12px; border:1px solid var(--p-line); background:var(--p-card); color:var(--p-ink2); font-size:14px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap; box-shadow:none; cursor:pointer; transition:background 150ms, transform 160ms var(--p-ease); }
.fx-card.pf .pf-btn svg { width:16px; height:16px; }
.fx-card.pf .pf-btn:hover { background:var(--p-card2); }
.fx-card.pf .pf-btn:active { transform:scale(.97); }
html body .fx-card.pf button.pf-btn.pri { background:var(--p-primary); border-color:var(--p-primary); color:#fff; }
html body .fx-card.pf button.pf-btn.pri:hover { background:var(--p-primary-h); border-color:var(--p-primary-h); }
html body .fx-card.pf button.pf-btn.add { width:100%; border:1px dashed var(--p-primary); background:var(--p-acc-soft); color:var(--p-acc); }
html body .fx-card.pf button.pf-btn.add:hover { background:color-mix(in srgb, var(--p-acc) 14%, var(--p-card)); }
.fx-card.pf .bm-err { margin:12px 0 0; }

/* ---- Plan de tratamiento ---- */
.fx-card.pf .pf-ph { display:flex; justify-content:space-between; gap:10px; background:var(--p-acc-soft); border-radius:8px; padding:6px 10px; margin:8px 0 2px; font-size:13.1px; font-weight:800; color:var(--p-ink); }
.fx-card.pf .pf-ph:first-child { margin-top:0; }
.fx-card.pf .pf-ph em { font-style:normal; color:var(--p-acc); font-variant-numeric:tabular-nums; white-space:nowrap; }
.fx-card.pf .pf-it { display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; padding:10px 4px; border-bottom:1px dashed var(--p-line); animation:pl2It 220ms var(--p-ease); }
.fx-card.pf .pf-it:last-child, .fx-card.pf .pf-it:has(+ .pf-ph) { border-bottom:0; }
.fx-card.pf .pf-n { min-width:0; font-size:14.7px; font-weight:700; color:var(--p-ink); }
.fx-card.pf .pf-n b { display:block; font-weight:700; white-space:normal; overflow-wrap:anywhere; }
.fx-card.pf .pf-n small { display:block; margin-top:1px; color:var(--p-mut); font-weight:500; font-size:12.8px; line-height:1.35; }
.fx-card.pf .pf-pr { font-size:15.2px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--p-ink); white-space:nowrap; }
.fx-card.pf .pf-acts { display:flex; gap:2px; }
html body .fx-card.pf button.pf-ib { width:30px; height:30px; min-width:0; min-height:0; padding:0; border-radius:8px; border:0; background:transparent; color:var(--p-mut); display:grid; place-items:center; box-shadow:none; cursor:pointer; position:relative; transition:background 150ms, color 150ms; }
.fx-card.pf .pf-ib svg { width:15px; height:15px; }
.fx-card.pf .pf-ib::after { content:""; position:absolute; inset:-5px -2px; }
.fx-card.pf .pf-ib:hover { background:var(--p-card2); color:var(--p-acc); }
.fx-card.pf .pf-ib.x:hover { background:var(--p-red-soft); color:var(--p-red); }
.fx-card.pf .pf-empty { margin:0; padding:4px 0 8px; font-size:14.4px; line-height:1.45; color:var(--p-mut); }
.fx-card.pf .bmn-dte { display:block; margin-top:4px; }
/* ✎ sobre el borrador */
.fx-card.pf .pf-edit { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:12px; margin:6px 0; border:1px solid var(--p-line); border-radius:12px; background:var(--p-fld); }
.fx-card.pf .pf-edit .pf-full, .fx-card.pf .pf-eb, .fx-card.pf .pf-eerr { grid-column:1 / -1; }
.fx-card.pf .pf-eerr { display:none; color:var(--p-red); font-size:13px; font-weight:600; }
.fx-card.pf .pf-eerr.on { display:block; }
.fx-card.pf .pf-eb { display:flex; justify-content:flex-end; gap:8px; }
html body .fx-ov .fx-card.pf.pl2 .pf-edit input.pf-in.pf-in, html body .fx-ov .fx-card.pf.pl2 .pf-edit input.et-in.et-in, html body .fx-ov .fx-card.pf.pl2 .pf-edit input.dc-in.dc-in { background-color:var(--p-card) !important; }

/* ---- Pie ---- */
.fx-card.pf .pf-ft { display:flex; align-items:center; gap:10px; padding:14px 22px; background:var(--p-card); border-top:1px solid var(--p-line); flex:none; }
.fx-card.pf .pf-tot { margin-right:auto; display:flex; flex-direction:column; min-width:0; }
.fx-card.pf .pf-tot small { font-size:12.5px; font-weight:700; color:var(--p-mut); white-space:nowrap; }
.fx-card.pf .pf-tot b { font-size:22.4px; font-weight:800; line-height:1.2; font-variant-numeric:tabular-nums; color:var(--p-ink); white-space:nowrap; }

/* ---- Móvil (hoja desde abajo; la hoja y el tablero los define 48-tratamientoCombo.css) ---- */
@media (max-width:834px) {
  html body .fx-ov .fx-card.pl2.pf { width:100% !important; }
  .fx-card.pf .pf-hd { flex-wrap:wrap; padding:6px 14px 12px; gap:10px; }
  .fx-card.pf .pf-hd > .pf-sp { display:none; }
  .fx-card.pf .pf-htx { flex:1; }
  .fx-card.pf .pf-x { order:2; }
  .fx-card.pf .pf-hmeta { order:3; flex-basis:100%; display:grid; grid-template-columns:1fr; gap:8px; }
  .fx-card.pf .pf-fecha { width:100%; }
  html body .fx-ov .fx-card.pf.pl2 .pf-fecha input[type="date"] { font-size:16px !important; }
  .fx-card.pf .pf-seg { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; }
  html body .fx-card.pf .pf-seg button { padding:8px 6px; font-size:13.5px; justify-content:center; min-height:40px; }
  .fx-card.pf .pf-bd { grid-template-columns:minmax(0,1fr); padding:12px; gap:12px; }
  .fx-card.pf .pf-cd { padding:14px; }
  .fx-card.pf .pf-arcsel { display:grid; width:100%; margin-bottom:10px; }
  .fx-card.pf .pl2-odo-row { display:flex; flex-direction:column-reverse; align-items:stretch; gap:10px; }
  .fx-card.pf .pf-chip[data-z^="Arcada"] { display:none !important; }
  html body .fx-card.pf button.pf-chip.pf-movil { display:inline-flex; }
  html body .fx-card.pf button.pf-chip { min-height:40px; align-items:center; }
  .fx-card.pf .pf-form { grid-template-columns:1fr 1fr; gap:12px 10px; }
  .fx-card.pf .pf-f.caras, .fx-card.pf .pf-f:nth-child(n+5) { grid-column:auto; }
  html body .fx-ov .fx-card.pf.pl2 input.pf-in.pf-in, html body .fx-ov .fx-card.pf.pl2 .pf-combo input.tc-in.tc-in, html body .fx-ov .fx-card.pf.pl2 input.et-in.et-in, html body .fx-ov .fx-card.pf.pl2 input.dc-in.dc-in { font-size:16px !important; height:44px !important; }
  .fx-card.pf .pf-money span { height:44px; }
  html body .fx-card.pf button.bmn-cbtn { height:44px; }
  html body .fx-card.pf button.pf-btn { height:44px; }
  html body .fx-card.pf button.pf-btn.add { height:46px; }
  html body .fx-card.pf .bmn-cdd { top:calc(100% + 6px); bottom:auto; width:100%; }
  .fx-card.pf .pf-edit { grid-template-columns:1fr; }
  .fx-card.pf .pf-ft { padding:10px 14px calc(10px + env(safe-area-inset-bottom)); gap:8px; }
  .fx-card.pf .pf-tot b { font-size:21px; }
  html body .fx-card.pf button.pf-cancel { display:none; }
  html body .fx-card.pf button.pf-pdf { width:46px; padding:0; }
  .fx-card.pf .pf-pdf span, .fx-card.pf .pf-long { display:none; }
  html body .fx-card.pf button.pf-ib { width:40px; height:40px; }
}
@media (prefers-reduced-motion: reduce) { .fx-card.pf .pf-it { animation:none; } }
