/* odontOS · Planificación (escritorio): estilo Opción A alineado 1:1 con Nueva atención / Nueva cita */
#presupuestos {
  --pl-bg: #F2F2F7;
  --pl-card: #FFFFFF;
  --pl-card2: #F1F5F9;
  --pl-fld: #F6F8FB;
  --pl-ink: rgba(15, 23, 42, .94);
  --pl-ink2: #38425B;
  --pl-mut: #5A6580;
  --pl-line: rgba(47, 74, 184, .14);
  --pl-line-soft: rgba(47, 74, 184, .08);
  --pl-fld-line: rgba(47, 74, 184, .16);
  --pl-primary: #0284C7;
  --pl-primary-h: #0369A1;
  --pl-acc: #0284C7;
  --pl-acc-soft: #E8F4FB;
  --pl-green: #0F9D58;
  --pl-green-soft: #E6F6EC;
  --pl-red: #DC2626;
  --pl-red-soft: #FEE7E7;
  --pl-amber: #B45309;
  --pl-amber-soft: #FEF3C7;
  --pl-seg: #E9EBF0;
  --pl-seg-on: #FFFFFF;
  --pl-shadow: 0 1px 3px rgba(15, 17, 22, .04), 0 4px 12px rgba(15, 17, 22, .04);
  --pl-shadow-lg: 0 20px 50px rgba(15, 17, 22, .16), 0 4px 12px rgba(15, 17, 22, .05);
  --pl-font: "Plus Jakarta Sans", "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --pl-ease: cubic-bezier(.23, 1, .32, 1);
}
:root[data-theme="dark"] #presupuestos {
  --pl-bg: #121212;
  --pl-card: #1C1C1E;
  --pl-card2: #252528;
  --pl-fld: #252528;
  --pl-ink: #ECECEC;
  --pl-ink2: #BDBDC2;
  --pl-mut: #8E8E93;
  --pl-line: rgba(255, 255, 255, .08);
  --pl-line-soft: rgba(255, 255, 255, .05);
  --pl-fld-line: rgba(255, 255, 255, .11);
  --pl-acc: #38BDF8;
  --pl-acc-soft: rgba(56, 189, 248, .16);
  --pl-green: #34D399;
  --pl-green-soft: rgba(52, 211, 153, .14);
  --pl-red: #F87171;
  --pl-red-soft: rgba(248, 113, 113, .14);
  --pl-amber: #F59E0B;
  --pl-amber-soft: rgba(245, 158, 11, .14);
  --pl-seg: #2C2C2E;
  --pl-seg-on: #48484A;
  --pl-shadow: none;
  --pl-shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

@media (min-width: 821px) {
  /* Lienzo transparente para que respiren las tarjetas blancas estilo Nueva atención / Nueva cita */
  html body #presupuestos.panel { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; font-family: var(--pl-font); color: var(--pl-ink); }
  html body #presupuestos #hsPlan { background: var(--pl-card) !important; border: 0 !important; border-radius: 16px !important; box-shadow: var(--pl-shadow) !important; padding: 10px 14px !important; margin: 0 0 12px !important; align-items: center !important; }
  html body #presupuestos #plSeg { display: inline-flex !important; align-items: center; gap: 2px !important; padding: 3px !important; margin: 0 !important; background: var(--pl-seg) !important; border: 0 !important; border-radius: 12px !important; overflow: visible !important; }
  html body #presupuestos > #plSeg { margin-bottom: 12px !important; }
  html body #presupuestos #plSeg button { height: 38px !important; min-height: 38px !important; padding: 0 14px !important; border: 0 !important; border-radius: 9px !important; background: transparent !important; color: var(--pl-ink2) !important; font-family: var(--pl-font); font-size: 13.5px !important; font-weight: 650 !important; white-space: nowrap; box-shadow: none !important; transition: background 150ms, color 150ms; }
  html body #presupuestos #plSeg button:hover:not(.on) { background: color-mix(in srgb, var(--pl-seg-on) 55%, transparent) !important; color: var(--pl-ink) !important; }
  html body #presupuestos #plSeg button.on { background: var(--pl-seg-on) !important; color: var(--pl-ink) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .12) !important; }
  html body #presupuestos #hsPlan #hdActionBtn { height: 44px !important; min-height: 44px !important; border-radius: 12px !important; border: 0 !important; padding: 0 18px !important; background: var(--pl-primary) !important; color: #fff !important; font-size: 14px !important; font-weight: 700 !important; box-shadow: none !important; transition: transform 160ms var(--pl-ease), background 150ms; }
  html body #presupuestos #hsPlan #hdActionBtn:hover { background: var(--pl-primary-h) !important; }
  html body #presupuestos #hsPlan #hdActionBtn:active { transform: scale(.97); }

  /* Tarjetas limpias para cada subvista sobre el lienzo */
  #planPaneFollow .pla-surface,
  #planPaneEspera,
  #planPaneSin,
  #planPaneResumen,
  #planPaneEsp,
  #presupuestos > .budget-grid { background: var(--pl-card); border-radius: 16px; box-shadow: var(--pl-shadow); padding: 14px 16px; }

  /* 5 KPI cards con icono suave 30x30 */
  #planPaneFollow .pla-kp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
  .pla-k { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: flex-start !important; gap: 12px !important; border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; background: var(--pl-card); box-shadow: var(--pl-shadow); text-align: left; cursor: pointer; font: inherit; color: var(--pl-ink); margin: 0; min-height: 0; height: auto; transition: border-color 150ms, box-shadow 150ms, transform 160ms var(--pl-ease); }
  .pla-k:hover { border-color: var(--pl-line); background: var(--pl-card); }
  .pla-k:active { transform: scale(.98); }
  .pla-k.on { border-color: var(--pl-acc); box-shadow: 0 0 0 3px var(--pl-acc-soft); background: var(--pl-card); }
  .pla-kic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--pl-acc-soft); color: var(--pl-acc); }
  .pla-kic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pla-kic.r { background: var(--pl-red-soft); color: var(--pl-red); }
  .pla-kic.a { background: var(--pl-amber-soft); color: var(--pl-amber); }
  .pla-kic.n { background: var(--pl-card2); color: var(--pl-mut); }
  .pla-ktx { display: flex; flex-direction: column; min-width: 0; }
  .pla-k small { display: block; font-size: 11.5px; font-weight: 700; color: var(--pl-mut); text-transform: none; letter-spacing: 0; line-height: 1.25; }
  .pla-k b { display: block; font-size: 22px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--pl-ink); }
  .pla-k.r b { color: var(--pl-red); }
  .pla-k.a b { color: var(--pl-amber); }

  /* Barra de búsqueda, filtro y selector de vista */
  .pla-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 44px; flex-wrap: wrap; }
  .pla-sw { position: relative; display: inline-flex; align-items: center; width: 290px; max-width: 100%; }
  .pla-sw svg { position: absolute; left: 12px; width: 17px; height: 17px; fill: none; stroke: var(--pl-mut); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
  .pla-bar #plSearch { height: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--pl-fld-line); padding: 0 12px 0 38px; width: 100%; margin: 0; background: var(--pl-fld); color: var(--pl-ink); font-size: 14px; outline: none; box-shadow: none; transition: border-color 150ms, box-shadow 150ms; }
  .pla-bar #plSearch:focus { border-color: var(--pl-acc); box-shadow: 0 0 0 3px var(--pl-acc-soft); }
  .pla-bar #plSearch::placeholder { color: var(--pl-mut); }
  .pla-count { font-size: 13px; color: var(--pl-mut); font-weight: 600; white-space: nowrap; }
  .pla-fw { margin-left: auto; position: relative; display: inline-flex; }
  .pla-fb { height: 40px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--pl-card2); color: var(--pl-ink); font: inherit; font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; margin: 0; transition: background 150ms, color 150ms, transform 160ms var(--pl-ease); }
  .pla-fb:hover { background: var(--pl-seg); color: var(--pl-ink); }
  .pla-fb:active { transform: scale(.97); }
  .pla-fb svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .pla-fb.on { background: var(--pl-acc-soft); color: var(--pl-acc); }
  .pla-fp { position: fixed; right: auto; left: 0; top: 0; width: 290px; overflow-y: auto; background: var(--pl-card); border: 1px solid var(--pl-line); border-radius: 14px; box-shadow: var(--pl-shadow-lg); padding: 12px; z-index: 2400; display: flex; flex-direction: column; gap: 10px; color: var(--pl-ink); }
  .pla-fp[hidden] { display: none !important; }
  .pla-fp label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--pl-ink2); text-transform: none; letter-spacing: 0; }
  .pla-fp select { height: 42px; min-height: 42px; border-radius: 10px; border: 1px solid var(--pl-fld-line); background: var(--pl-fld); padding: 0 10px; font: inherit; font-size: 14px; font-weight: 600; color: var(--pl-ink); text-transform: none; letter-spacing: 0; margin: 0; }
  .pla-lk { height: 40px; min-height: 40px; border-radius: 10px; border: 0; background: var(--pl-card2); color: var(--pl-ink); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; margin: 0; transition: background 150ms, color 150ms; }
  .pla-lk:hover { background: var(--pl-acc-soft); color: var(--pl-acc); }
  .pla-seg { display: flex; background: var(--pl-seg); border-radius: 11px; padding: 3px; gap: 2px; flex: none; }
  .pla-seg button { height: 34px; min-height: 34px; padding: 0 14px; min-width: 0; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 650; color: var(--pl-ink2); cursor: pointer; margin: 0; display: inline-flex; align-items: center; justify-content: center; transition: background 150ms, color 150ms; }
  .pla-seg button:hover:not(.on) { background: color-mix(in srgb, var(--pl-seg-on) 55%, transparent); color: var(--pl-ink); }
  .pla-seg button.on { background: var(--pl-seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--pl-ink); }

  /* Lista de pendientes */
  .pla-hd, .pla-row { display: grid; grid-template-columns: 38px minmax(140px, 1.15fr) minmax(220px, 2.2fr) minmax(115px, .85fr) auto; gap: 12px; align-items: center; }
  .pla-hd { padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--pl-mut); text-transform: uppercase; letter-spacing: .04em; }
  .pla-hd .r { text-align: right; }
  .pla-sec { display: flex; gap: 8px; align-items: center; border-radius: 0; padding: 8px 10px 6px; margin: 8px 0 0; background: transparent; font-size: 12.5px; font-weight: 750; color: var(--pl-ink2); }
  .pla-sec small { color: var(--pl-mut); font-weight: 600; }
  .pla-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--pl-acc); }
  .pla-sec.vencido .pla-dot { background: var(--pl-red); }
  .pla-sec.proximo .pla-dot { background: var(--pl-amber); }
  .pla-sec.sinfecha .pla-dot { background: var(--pl-mut); }
  .pla-sec.cerrado .pla-dot { background: var(--pl-green); }
  .pla-cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--pl-card2); color: var(--pl-ink2); }
  .pla-sec.vencido .pla-cnt { background: var(--pl-red-soft); color: var(--pl-red); }
  .pla-sec.proximo .pla-cnt { background: var(--pl-amber-soft); color: var(--pl-amber); }
  #planPaneFollow .pla-row.pl-card { border: 0; border-top: 1px solid var(--pl-line-soft); border-left: 0; border-radius: 10px; padding: 10px; margin: 0; min-height: 60px; background: transparent; opacity: 1; transition: background 140ms; }
  #planPaneFollow .pla-row.pl-card:hover { background: var(--pl-fld); }
  .pla-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pl-card2); border: 1px solid var(--pl-line-soft); color: var(--pl-ink2); font-weight: 700; font-size: 12px; flex: none; overflow: hidden; }
  .pla-av svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .pla-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pla-nm { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--pl-ink); min-width: 0; }
  .pla-ti { font-weight: 700; font-size: 14px; color: var(--pl-ink); min-width: 0; line-height: 1.3; }
  .pla-ti small { display: block; margin-top: 2px; font-weight: 500; font-size: 12.5px; color: var(--pl-mut); }
  .pla-tag { display: inline-flex; align-items: center; height: 24px; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 0 10px; background: var(--pl-card2); color: var(--pl-ink2); margin-left: 8px; vertical-align: 1px; white-space: nowrap; }
  .pla-fe { font-weight: 750; font-size: 13.5px; color: var(--pl-ink); font-variant-numeric: tabular-nums; }
  .pla-fe small { display: block; font-size: 12px; font-weight: 600; color: var(--pl-mut); }
  .pla-fe.vencido { color: var(--pl-red); }
  .pla-fe.proximo { color: var(--pl-amber); }
  .pla-ac { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

  /* Botones suaves sin bordes duros (estilo Nueva atención / Nueva cita) */
  .pla-b { height: 40px; min-height: 40px; border-radius: 10px; border: 0; background: var(--pl-card2); color: var(--pl-ink); font: inherit; font-size: 13px; font-weight: 700; padding: 0 14px; cursor: pointer; margin: 0; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; transition: transform 160ms var(--pl-ease), background 150ms, filter 150ms; }
  .pla-b:hover { background: var(--pl-seg); color: var(--pl-ink); }
  .pla-b:active { transform: scale(.97); }
  .pla-b.i { width: 40px; padding: 0; font-size: 18px; color: var(--pl-ink2); }
  .pla-b.i svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .pla-b.m { background: var(--pl-acc-soft); color: var(--pl-acc); }
  .pla-b.m:hover { background: color-mix(in srgb, var(--pl-acc) 18%, var(--pl-card)); color: var(--pl-acc); }
  .pla-b.ok { background: var(--pl-green-soft); color: var(--pl-green); }
  .pla-b.ok:hover { background: color-mix(in srgb, var(--pl-green) 20%, var(--pl-card)); color: var(--pl-green); }

  /* Menú flotante (fixed, nunca se recorta) */
  .pla-mw { position: relative; display: inline-flex; }
  .pla-menu { position: fixed; right: auto; left: 0; top: 0; min-width: 170px; overflow-y: auto; background: var(--pl-card); border: 1px solid var(--pl-line); border-radius: 14px; box-shadow: var(--pl-shadow-lg); padding: 6px; z-index: 2400; display: flex; flex-direction: column; gap: 2px; }
  .pla-menu[hidden] { display: none !important; }
  .pla-menu button { height: 38px; min-height: 38px; width: 100%; border: 0; border-radius: 9px; background: transparent; justify-content: flex-start; text-align: left; padding: 0 12px; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--pl-ink); cursor: pointer; margin: 0; transition: background 140ms, color 140ms; }
  .pla-menu button:hover { background: var(--pl-acc-soft); color: var(--pl-acc); }
  .pla-menu button.dg { color: var(--pl-red); }
  .pla-menu button.dg:hover { background: var(--pl-red-soft); color: var(--pl-red); }

  /* Vista tarjetas */
  .pla-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  @media (max-width: 1100px) { .pla-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  #planPaneFollow .pla-card.pl-card { border: 1px solid var(--pl-line-soft); border-radius: 14px; padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--pl-fld); box-shadow: none; }
  #planPaneFollow .pla-card.vencido { border-color: color-mix(in srgb, var(--pl-red) 35%, transparent); }
  .pla-ct { display: flex; gap: 10px; align-items: center; }
  .pla-card .pla-ti { min-height: 38px; }
  .pla-card .pla-ac { margin-top: auto; }
  .pla-card .pla-b.m { flex: 1; }
}

@media (min-width: 821px) {
  /* la versión anterior ponía una columna lateral; ahora el panel va a todo el ancho */
  html body #planPaneFollow:not([style*="none"]) { display: block !important; }
  #planPaneFollow #plList, #planPaneFollow .pl-note { grid-column: auto !important; grid-row: auto !important; }
}

@media (min-width: 821px) {
  html body #planPaneFollow #plList { display: block !important; grid-template-columns: none !important; }
  html body #planPaneFollow #plList .pla-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px !important; }
  .pla-fe small { white-space: nowrap; }
}

/* Lista de espera, Sin continuar y Resumen (escritorio): tarjetas */
@media (min-width: 821px) {
  .pla-grid.pla-g3 { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; }
  .pla-sub { font-size: 12.5px; color: var(--pl-mut); line-height: 1.35; }
  .pla-st { display: inline-flex; align-items: center; height: 24px; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 0 10px; flex: none; }
  .pla-st.r { background: var(--pl-red-soft); color: var(--pl-red); }
  .pla-st.o { background: var(--pl-amber-soft); color: var(--pl-amber); }
  .pla-st.n { background: var(--pl-card2); color: var(--pl-ink2); }
  .pla-b.w { background: var(--pl-green-soft); color: var(--pl-green); flex: 1; }
  .pla-b.w:hover { background: color-mix(in srgb, var(--pl-green) 20%, var(--pl-card)); color: var(--pl-green); }
  .pla-b.p { background: var(--pl-primary); color: #fff; border-radius: 12px; padding: 0 16px; }
  .pla-b.p:hover { background: var(--pl-primary-h); color: #fff; }
  .pla-card .pla-b { flex: 1; }
  .pla-card .pla-b.i { flex: none; }
  .pla-sel { height: 40px; min-height: 40px; border-radius: 10px; border: 1px solid var(--pl-fld-line); background: var(--pl-fld); padding: 0 14px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--pl-ink); margin: 0; }
  .pla-lab { font-weight: 800; font-size: 11px; letter-spacing: .06em; color: var(--pl-mut); text-transform: uppercase; margin: 4px 2px 8px; }
  .pla-two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; }
  .pla-box { border: 1px solid var(--pl-line-soft); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--pl-fld); }
  .pla-fl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; color: var(--pl-ink); }
  .pla-pb { height: 12px; border-radius: 99px; background: var(--pl-card2); overflow: hidden; }
  .pla-pb i { display: block; height: 100%; border-radius: 99px; }
  .pla-col { display: flex; flex-direction: column; gap: 8px; }
  .pla-kk { border: 1px solid var(--pl-line-soft); border-radius: 14px; padding: 10px 14px; background: var(--pl-fld); }
  .pla-kk small { display: block; font-size: 11px; font-weight: 700; color: var(--pl-mut); text-transform: uppercase; letter-spacing: .04em; }
  .pla-kk b { display: block; font-size: 1.3rem; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--pl-ink); }
  .pla-kk i { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--pl-mut); }
  .pla-kk.g b { color: var(--pl-green); }
  .pla-kk.r { border-color: color-mix(in srgb, var(--pl-red) 30%, transparent); background: var(--pl-red-soft); }
  .pla-kk.r b { color: var(--pl-red); }
  .pla-kp4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .pla-row2 { display: grid; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--pl-line-soft); min-height: 44px; font-size: 14px; }
  #planPaneEspera .pla-bar, #planPaneSin .pla-bar, #planPaneResumen .pla-bar { margin-bottom: 10px; }
}
@media (min-width: 821px) {
  #planPaneEspera .pla-card.pl-card, #planPaneSin .pla-card.pl-card { border: 1px solid var(--pl-line-soft); border-left: 1px solid var(--pl-line-soft); border-radius: 14px; padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--pl-fld); }
  #planPaneEspera .pla-card.vencido { border-color: color-mix(in srgb, var(--pl-red) 35%, transparent); }
  .pla-card .pla-ti { min-height: 0; }
  .pla-b svg.wa { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; }
  .pla-b.w, .pla-b.m { font-size: 13.5px; }
}

/* Planes de tratamiento (escritorio): tarjetas compactas en 3 columnas + métricas */
@media (min-width: 821px) {
  html body #presupuestos .bp-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;justify-content:stretch!important}
  html body #presupuestos .bp-pc{display:flex;flex-direction:column;gap:8px;padding:12px!important;border:1px solid #E5E8EE;border-radius:16px;background:#fff;box-shadow:none;margin:0;min-width:0}
  html body #presupuestos .bp-pc-h{display:flex;align-items:center;gap:10px;margin:0!important;padding:0!important}
  html body #presupuestos .bp-pc-h .bp-av{width:36px;height:36px;font-size:12px;flex:none}
  html body #presupuestos .bp-pc-who{min-width:0;flex:1}
  html body #presupuestos .bp-pc-who strong{font-size:.95rem;line-height:1.2;display:block}
  html body #presupuestos .bp-pc-who small{font-size:.76rem;color:#6B7586}
  html body #presupuestos .bp-pc-body{display:flex!important;flex-direction:column;gap:8px;grid-template-columns:none!important;padding:0!important;margin:0!important}
  html body #presupuestos .bp-pc-l,html body #presupuestos .bp-pc-r{width:auto!important;min-width:0;padding:0!important;margin:0!important;background:transparent!important;border:0!important}
  html body #presupuestos .bp-pc-prog{margin:0 0 4px}
  html body #presupuestos .bp-pc-prog span{font-size:.76rem}
  html body #presupuestos .bp-ph{padding:4px 10px!important;font-size:.76rem!important;border-radius:9px}
  html body #presupuestos .bp-pi{padding:4px 6px!important;min-height:36px;font-size:.88rem}
  html body #presupuestos .bp-pc-tot{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0!important;padding:8px!important;background:#F7F9FC;border-radius:12px;border:0!important}
  html body #presupuestos .bp-pc-tot>div{display:block!important;padding:0!important;border:0!important;text-align:left}
  html body #presupuestos .bp-pc-tot span{display:block;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#8A93A3}
  html body #presupuestos .bp-pc-tot b{font-size:1rem}
  html body #presupuestos .bp-pc-a{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:2px}
  html body #presupuestos .bp-pc-a button{height:38px;min-height:38px;padding:0 8px;margin:0;font-size:.8rem;font-weight:700;border-radius:11px;justify-content:center;white-space:nowrap}
  html body #presupuestos .bp-pc-a .js-budget-ficha{grid-column:1/-1;height:40px}
  html body #presupuestos .bp-pc-a .js-budget-delete{grid-column:1/-1}
  .pla-pk{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 12px}
}
@media (min-width:821px){.pla-kk.a b{color:#B45F00}}
@media (min-width: 821px) {
  html body #presupuestos .bp-pc-body{align-items:stretch!important}
  html body #presupuestos .bp-pc-a{grid-template-columns:repeat(6,minmax(0,1fr))!important}
  html body #presupuestos .bp-pc-a button{grid-column:span 2!important}
  html body #presupuestos .bp-pc-a .js-budget-status{grid-column:span 3!important}
  html body #presupuestos .bp-pc-a .js-budget-ficha,html body #presupuestos .bp-pc-a .js-budget-delete{grid-column:1/-1!important}
  html body #presupuestos .bp-pc-a .js-budget-delete{height:38px!important}
  html body #presupuestos .bp-pc-h{padding:0!important}
}
@media (min-width: 821px) {
  html body #presupuestos .bp-pc-a:not(:has(.js-budget-status + .js-budget-status)) .js-budget-status{grid-column:1/-1!important}
  html body #presupuestos #budgetSaved .bp-sv-head{flex-wrap:nowrap!important;gap:10px!important;margin-bottom:12px!important}
  html body #presupuestos #budgetSaved .bp-sv-head #bpNewBtn{order:3;margin:0 0 0 auto!important;height:42px}
  html body #presupuestos #budgetSaved .bp-sv-head .budget-search{order:1;width:300px!important;height:42px;margin:0}
  html body #presupuestos #budgetSaved .bp-sv-head #bpEstadoChips{order:2;margin:0!important}
}

/* Planes guardados: versión más compacta (menos alto por tarjeta) */
@media (min-width: 821px) {
  html body #presupuestos .bp-pc{gap:6px;padding:10px 12px!important}
  html body #presupuestos .bp-pc-h .bp-av{width:34px;height:34px}
  html body #presupuestos .bp-pc-who strong{font-size:.92rem}
  html body #presupuestos .bp-pc-prog{margin:0!important;display:flex;align-items:center;gap:8px}
  html body #presupuestos .bp-pc-prog .bp-bar{flex:1}
  html body #presupuestos .bp-pc-prog span{white-space:nowrap}
  html body #presupuestos .bp-pc .bp-ph{background:#F1F4F8!important;color:#3B4757!important;padding:3px 10px!important;min-height:0;font-size:.72rem!important;border-radius:9px}
  html body #presupuestos .bp-pc .bp-ph em{color:#3B4757!important}
  html body #presupuestos .bp-pi{min-height:32px!important;padding:2px 6px!important;font-size:.84rem!important}
  html body #presupuestos .bp-pi .js-budget-done{width:22px!important;height:22px!important;min-height:22px!important}
  html body #presupuestos .bp-pc-tot{padding:6px 10px!important;background:#F7F9FC}
  html body #presupuestos .bp-pc-tot b{font-size:.92rem}
  html body #presupuestos .bp-pc-tot span{font-size:.64rem}
  html body #presupuestos .bp-pc-a{grid-template-columns:repeat(8,minmax(0,1fr))!important;gap:6px!important}
  html body #presupuestos .bp-pc-a button{grid-column:span 1!important;height:38px!important;min-height:38px!important;padding:0!important;font-size:0!important;gap:0!important}
  html body #presupuestos .bp-pc-a button svg{width:18px;height:18px}
  html body #presupuestos .bp-pc-a .js-budget-ficha{grid-column:span 4!important;font-size:.84rem!important;gap:6px!important}
  html body #presupuestos .bp-pc-a .js-budget-status{grid-column:span 4!important;font-size:.82rem!important;gap:6px!important}
  html body #presupuestos .bp-pc-a:not(:has(.js-budget-status + .js-budget-status)) .js-budget-status{grid-column:span 8!important}
  html body #presupuestos .bp-pc-a .js-budget-delete{grid-column:span 1!important;height:38px!important}
}
@media (min-width: 821px) {
  html body #presupuestos .bp-pc-a .js-budget-ficha{order:1}
  html body #presupuestos .bp-pc-a .js-budget-print,html body #presupuestos .bp-pc-a .js-budget-abono,html body #presupuestos .bp-pc-a .js-budget-desc{order:2}
  html body #presupuestos .bp-pc-a .js-budget-delete{order:3}
  html body #presupuestos .bp-pc-a .js-budget-status{order:4}
}

/* Planes guardados: filas de datos + resumen del plan en panel lateral */
@media (min-width: 821px) {
  html body #presupuestos .bp-cards.pla-on{display:block!important}
  html body #presupuestos .bp-cards.pla-on > .bp-pc:not(.pla-open){display:none!important}
  .pla-phead,.pla-prow{display:grid;grid-template-columns:36px minmax(0,1.2fr) minmax(0,2fr) 104px 150px 96px 96px 96px 18px;gap:12px;align-items:center}
  .pla-phead{padding:4px 12px;font-size:10.5px;font-weight:700;color:#8A93A3;text-transform:uppercase;letter-spacing:.04em}.pla-phead .r{text-align:right}
  .pla-prow{padding:8px 12px;min-height:56px;border-bottom:1px solid #EEF0F4;border-radius:12px;cursor:pointer;background:#fff;outline:none}
  .pla-prow:hover{background:#F5F9FD}.pla-prow:focus-visible{box-shadow:0 0 0 2px #0A84C7 inset}
  .pla-prow.on{background:#EEF6FC;box-shadow:0 0 0 1.5px #B5D9F0 inset}
  .pla-pn{min-width:0}.pla-pn b{display:block;font-size:14px;line-height:1.2}.pla-pn small{display:block;font-size:12px;color:#8A93A3;margin-top:2px}
  .pla-pt{font-size:13.5px;font-weight:600;color:#1D1D1F;line-height:1.25;min-width:0}
  .pla-pg small{display:block;font-size:11.5px;color:#6B7586;margin-top:3px;white-space:nowrap}
  .pla-pb{height:6px;border-radius:99px;background:#EEF0F4;overflow:hidden}.pla-pb i{display:block;height:100%;background:#1B9A55;border-radius:99px}
  .pla-pm{font-size:14px;font-weight:700;text-align:right}.pla-pm.good{color:#1B7F46}.pla-pm.warn{color:#B45F00}
  .pla-prow .r{text-align:right}
  .pla-ch{font-size:22px;color:#B0B8C6;text-align:center;line-height:1}
  .pla-prow.on .pla-ch{color:#0A84C7}
  .pla-scrim{position:fixed;inset:0;background:rgba(15,23,42,.34);z-index:1490}.pla-scrim[hidden]{display:none!important}
  html body #presupuestos .bp-pc.pla-open{display:flex!important;position:fixed;top:0;right:0;bottom:0;left:auto;width:500px;max-width:92vw;z-index:1500;overflow-y:auto;border-radius:20px 0 0 20px;border:0;box-shadow:-18px 0 44px rgba(15,23,42,.22);padding:18px 20px!important;gap:10px;background:#fff}
  html body #presupuestos .bp-pc.pla-open::before{content:"Resumen del plan";font-size:11px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:#8A93A3}
  .pla-x{display:none}
  html body #presupuestos .bp-pc.pla-open .pla-x{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:50%;border:1px solid #DADDE5;background:#fff;color:#515154;font-size:15px;cursor:pointer;flex:none;margin:0;padding:0}
  html body #presupuestos .bp-pc.pla-open .bp-pi{min-height:40px!important;font-size:.92rem!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-tot b{font-size:1.15rem}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a{grid-template-columns:repeat(6,minmax(0,1fr))!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a button{grid-column:span 2!important;font-size:.84rem!important;gap:6px!important;height:40px!important;min-height:40px!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-ficha,html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-delete{grid-column:1/-1!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-status{grid-column:span 3!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a:not(:has(.js-budget-status + .js-budget-status)) .js-budget-status{grid-column:1/-1!important}
}
@media (min-width: 821px) {
  html body #presupuestos .pla-prow{border:0!important;border-bottom:1px solid #EEF0F4!important;text-align:left;color:#1D1D1F;margin:0!important;box-shadow:none}
  html body #presupuestos .pla-prow.on{box-shadow:0 0 0 1.5px #B5D9F0 inset;border-bottom-color:transparent!important}
  html body #presupuestos .pla-prow *{text-align:inherit}
  html body #presupuestos .pla-pn b{color:#1D1D1F!important;font-size:14px!important;font-weight:700!important}
  html body #presupuestos .pla-pn small{font-size:12px!important;color:#8A93A3!important}
  html body #presupuestos .pla-pt{color:#1D1D1F!important;text-align:left!important;font-size:13.5px!important}
  html body #presupuestos .pla-pm{color:#1D1D1F;font-size:14px!important;font-weight:700!important;text-align:right!important}
  html body #presupuestos .pla-pm.good{color:#1B7F46!important}html body #presupuestos .pla-pm.warn{color:#B45F00!important}
  html body #presupuestos .pla-pg small{font-size:11.5px!important}
  html body #presupuestos .pla-phead span{font-size:10.5px!important;font-weight:700!important;color:#8A93A3!important;text-transform:uppercase;letter-spacing:.04em;text-align:left}
  html body #presupuestos .pla-phead .r{text-align:right!important}
  html body #presupuestos .pla-prow .bp-st{font-size:12px!important}
}

/* Planes guardados v3: panel integrado a la derecha de la lista (sin fondo oscuro), fila resumida, contraste y foco */
@media (min-width: 821px) {
  html body #presupuestos .pla-phead,html body #presupuestos .pla-prow{grid-template-columns:36px minmax(0,1.2fr) minmax(0,1.7fr) 104px 112px 16px}
  html body #presupuestos #budgetList.pla-has-open{display:grid!important;grid-template-columns:minmax(0,1fr) 470px!important;column-gap:16px;align-items:start}
  html body #presupuestos #budgetList.pla-has-open > .pla-phead,html body #presupuestos #budgetList.pla-has-open > .pla-prow{grid-column:1}
  html body #presupuestos #budgetList.pla-has-open .pla-phead,html body #presupuestos #budgetList.pla-has-open .pla-prow{grid-template-columns:36px minmax(0,1.1fr) minmax(0,1.3fr) 96px 104px 14px;gap:10px}
  html body #presupuestos .bp-pc.pla-open{position:sticky!important;top:8px!important;right:auto!important;bottom:auto!important;left:auto!important;width:auto!important;max-width:none!important;grid-column:2;grid-row:1 / span 40;align-self:start;overflow:visible!important;z-index:1!important;border:1px solid #B5D9F0!important;border-radius:16px!important;box-shadow:0 8px 24px rgba(10,108,168,.10)!important;padding:14px 16px!important;background:#fff}
  html body #presupuestos .bp-pc.pla-open .pla-x{width:44px;height:44px}
  html body #presupuestos .pla-x:focus-visible,html body #presupuestos .bp-pc.pla-open button:focus-visible{outline:2px solid #0A84C7;outline-offset:2px}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a button{height:44px!important;min-height:44px!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a{gap:8px!important}
  html body #presupuestos .pla-pm small{display:block;font-size:12px!important;font-weight:600;margin-top:2px}
  html body #presupuestos .pla-pm small.good{color:#1B7F46}html body #presupuestos .pla-pm small.warn{color:#B45F00}
  html body #presupuestos .pla-pn small,html body #presupuestos .pla-phead span,html body #presupuestos .pla-kk small,html body #presupuestos .pla-kk i{color:#5F6B7C!important}
  html body #presupuestos .pla-prow{min-height:60px}
}

/* Panel del plan: Aceptar (verde) y Eliminar (rojo) en 2 columnas, como Asistió / No asistió de la Agenda */
@media (min-width: 821px) {
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-status{order:3!important;grid-column:span 3!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-delete{order:4!important;grid-column:span 3!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a:not(:has(.js-budget-status + .js-budget-status)) .js-budget-status{grid-column:span 3!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a:has(.js-budget-status + .js-budget-status) .js-budget-status,html body #presupuestos .bp-pc.pla-open .bp-pc-a:has(.js-budget-status + .js-budget-status) .js-budget-delete{grid-column:span 2!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-status[data-status="Aceptado"]{color:#1B7F46;border:1.5px solid #BFE5CE;background:#F2FAF5;font-weight:700}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-status[data-status="Aceptado"]:hover{background:#1B9A55;border-color:#1B9A55;color:#fff}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-delete{color:#C22A2A;border:1.5px solid #F3C4C4;background:#FEF5F5;font-weight:700}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-delete:hover{background:#D63A3A;border-color:#D63A3A;color:#fff}
}
@media (min-width: 821px) {
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-status[data-status="Aceptado"]{color:#1B7F46!important;border:1.5px solid #BFE5CE!important;background:#F2FAF5!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-status[data-status="Aceptado"]:hover{background:#1B9A55!important;border-color:#1B9A55!important;color:#fff!important}
  html body #presupuestos .bp-pc.pla-open .bp-pc-a .js-budget-delete:hover{background:#D63A3A!important;border-color:#D63A3A!important;color:#fff!important}
}

/* Casilla de "realizado" de cada tratamiento: círculo con check que se llena en verde */
@media (min-width: 821px) {
  html body #presupuestos .bp-pi .js-budget-done{width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;border:2px solid #C5CDD8!important;background:#fff!important;color:transparent!important;font-size:17px!important;font-weight:800;line-height:1;transition:background .15s,border-color .15s,color .15s,transform .12s;box-shadow:none}
  html body #presupuestos .bp-pi .js-budget-done:hover{border-color:#0A84C7!important;background:#EEF6FC!important;color:#7FBCE3!important}
  html body #presupuestos .bp-pi .js-budget-done:active{transform:scale(.92)}
  html body #presupuestos .bp-pi .js-budget-done:focus-visible{outline:2px solid #0A84C7;outline-offset:2px}
  html body #presupuestos .bp-pi .js-budget-done.on{background:#1B9A55!important;border-color:#1B9A55!important;color:#fff!important}
  html body #presupuestos .bp-pi .js-budget-done.on:hover{background:#15803F!important;border-color:#15803F!important;color:#fff!important}
  html body #presupuestos .bp-pi.done{background:#F2FAF5!important}
  html body #presupuestos .bp-pi:not(.done):hover{background:#F7FAFD}
  html body #presupuestos .bp-pi{grid-template-columns:36px minmax(0,1fr) auto auto!important;min-height:44px!important}
  html body #presupuestos .bp-pi .bp-link{color:#1B7F46}
}
@media (prefers-reduced-motion:reduce){html body #presupuestos .bp-pi .js-budget-done{transition:none}}
@media (min-width: 821px) {
  html body #presupuestos .bp-pi .js-budget-done:not(.on){color:#D3D9E2!important;background:#F7F9FC!important}
  html body #presupuestos .bp-pi .js-budget-done:not(.on):hover{color:#7FBCE3!important;background:#EEF6FC!important}
  html body #presupuestos .bp-pc.pla-open .bp-bar i{background:#1B9A55!important}
  html body #presupuestos .bp-pc.pla-open .bp-bar{height:8px}
}

/* Panel del plan: agregar tratamiento/fase y registrar realizado, todo dentro del panel */
#quickCareModal.pla-silent{opacity:0!important;pointer-events:none!important;transition:none!important}
@media (min-width: 821px) {
  .pla-add{margin-top:8px}
  .pla-addbtn{width:100%;height:44px;border:1.5px dashed #9CC9E6;border-radius:12px;background:#F5FAFE;color:#0A6CA8;font:inherit;font-size:.9rem;font-weight:700;cursor:pointer;margin:0}
  .pla-addbtn:hover{background:#EAF4FC;border-color:#0A84C7}
  .pla-addbtn[hidden],.pla-addf[hidden],.pla-abw[hidden]{display:none!important}
  .pla-addf,.pla-reg{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid #D8E6F2;border-radius:12px;background:#F7FAFD;margin:6px 0 2px}
  .pla-g2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .pla-addf label,.pla-reg label{display:flex;flex-direction:column;gap:3px;font-size:.7rem;font-weight:700;color:#5F6B7C;text-transform:uppercase;letter-spacing:.04em;min-width:0}
  .pla-addf input,.pla-addf select,.pla-reg input,.pla-reg select{height:44px;min-height:44px;border-radius:11px;border:1.5px solid #D2D6DE;background:#fff;padding:0 10px;font:inherit;font-size:.9rem;font-weight:600;color:#1D1D1F;text-transform:none;letter-spacing:0;margin:0;width:100%;min-width:0}
  .pla-addf input:focus-visible,.pla-addf select:focus-visible,.pla-reg input:focus-visible,.pla-reg select:focus-visible{outline:2px solid #0A84C7;outline-offset:1px}
  .pla-fa{display:flex;gap:8px;align-items:center;justify-content:flex-end}
  .pla-fa button{height:44px;min-height:44px;border-radius:11px;padding:0 16px;font:inherit;font-size:.88rem;font-weight:700;cursor:pointer;margin:0}
  .pla-ok{background:#0A84C7;border:1px solid #0A84C7;color:#fff}.pla-reg .pla-ok{background:#1B9A55;border-color:#1B9A55}
  .pla-cancel{background:#fff;border:1px solid #DADDE5;color:#515154}
  .pla-cancel:hover{background:#F5F6F8;border-color:#CBD5E1;color:#1D1D1F}
  .pla-link{margin-right:auto;border:0!important;background:transparent!important;color:#0A6CA8;padding:0 4px!important;text-decoration:underline;font-weight:600!important}
  .pla-rt{font-size:.88rem;font-weight:800;color:#1D1D1F}
  .pla-seg3{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:rgba(120,120,128,.14);border-radius:12px;padding:3px}
  .pla-seg3 button{height:40px;min-height:40px;border:0;border-radius:10px;background:transparent;font:inherit;font-size:.84rem;font-weight:700;color:#515154;cursor:pointer;margin:0;padding:0}
  .pla-seg3 button.on{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.18);color:#1B7F46}
}

/* Ventanitas mínimas: "+" para agregar tratamiento y cobro al marcar realizado */
@media (min-width: 821px) {
  html body #presupuestos .bp-pi{position:relative}
  .pla-pop{position:absolute;z-index:30;background:#fff;border:1px solid #CFE0EE;border-radius:14px;box-shadow:0 12px 30px rgba(15,23,42,.18);padding:10px;display:grid;gap:8px}
  .pla-pop[hidden]{display:none!important}
  .pla-reg.pla-pop{top:calc(100% - 4px);right:0;left:auto;width:min(100%,340px);margin:0}
  .pla-rrow{display:flex;gap:8px;align-items:center}
  .pla-amt{flex:1;min-width:0;display:flex;align-items:center;gap:6px;height:44px;border:1.5px solid #D2D6DE;border-radius:11px;background:#fff;padding:0 10px}
  .pla-amt:focus-within{border-color:#0A84C7;box-shadow:0 0 0 2px rgba(10,132,199,.2)}
  .pla-amt span{font-weight:700;color:#5F6B7C}
  .pla-amt input{border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;height:40px!important;min-height:0!important;padding:0!important;margin:0!important;font:inherit;font-size:1rem!important;font-weight:700!important;width:100%;min-width:0;color:#1D1D1F}
  .pla-reg .pla-ok{height:44px;min-height:44px;padding:0 14px;border-radius:11px;font:inherit;font-weight:700;font-size:.9rem;cursor:pointer;margin:0;background:#1B9A55;border:1px solid #1B9A55;color:#fff}
  .pla-xs{width:44px;height:44px;border-radius:11px;border:1px solid #DADDE5;background:#fff;color:#515154;font-size:14px;cursor:pointer;margin:0;padding:0;flex:none}
  .pla-xs:hover{background:#F5F6F8;border-color:#CBD5E1;color:#1D1D1F}
  .pla-chips{display:flex;gap:6px;flex-wrap:wrap}
  .pla-chips button{height:40px;min-height:40px;padding:0 12px;border-radius:99px;border:1.5px solid #DADDE5;background:#fff;color:#3B4757;font:inherit;font-size:.84rem;font-weight:700;cursor:pointer;margin:0}
  .pla-chips button.on{background:#EAF7EF;border-color:#1B9A55;color:#1B7F46}
  .pla-chips button:focus-visible,.pla-xs:focus-visible,.pla-reg .pla-ok:focus-visible,.pla-addcell:focus-visible{outline:2px solid #0A84C7;outline-offset:2px}
  .pla-add{position:relative;margin-top:6px}
  .pla-addcell{display:grid;place-items:center;width:100%;height:44px;border:1.5px dashed #9CC9E6;border-radius:12px;background:#F5FAFE;color:#0A6CA8;font:inherit;font-size:1.5rem;font-weight:500;line-height:1;cursor:pointer;margin:0;padding:0}
  .pla-addcell:hover{background:#EAF4FC;border-color:#0A84C7}
  .pla-addf.pla-pop{bottom:calc(100% + 6px);left:0;right:0;grid-template-columns:1fr 1fr;padding:12px}
  .pla-addf .pla-w2{grid-column:1/-1}
  .pla-addf label{display:flex;flex-direction:column;gap:3px;font-size:.68rem;font-weight:700;color:#5F6B7C;text-transform:uppercase;letter-spacing:.04em;min-width:0}
  .pla-addf input,.pla-addf select{height:44px;min-height:44px;border-radius:11px;border:1.5px solid #D2D6DE;background:#fff;padding:0 10px;font:inherit;font-size:.9rem;font-weight:600;color:#1D1D1F;text-transform:none;letter-spacing:0;margin:0;width:100%;min-width:0}
  .pla-addf .pla-fa{justify-content:flex-end;display:flex;gap:8px}
}
@media (min-width: 821px) {
  html body #presupuestos .pla-amt{display:flex!important;flex-direction:row!important;align-items:center!important;gap:6px;height:44px;margin:0!important;padding:0 10px!important;text-transform:none!important;letter-spacing:0!important}
  html body #presupuestos .pla-amt span{display:inline!important;font-size:1rem!important;line-height:1}
  html body #presupuestos .pla-amt input{border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;height:40px!important;min-height:0!important;padding:0!important;margin:0!important;font-size:1rem!important;font-weight:700!important;width:100%!important;color:#1D1D1F!important}
  html body #presupuestos .pla-reg .pla-rrow{display:flex!important;flex-direction:row!important}
  html body #presupuestos .pla-addf.pla-pop{top:calc(100% + 6px)!important;bottom:auto!important;grid-template-columns:1fr 1.5fr 1fr!important}
  html body #presupuestos .pla-addf .pla-w2{grid-column:1/-1!important}
  html body #presupuestos .pla-addf .pla-fa{grid-column:1/-1!important}
  html body #presupuestos .pla-addf label{display:flex!important;flex-direction:column!important}
}
@media (max-width: 820px) {
  .pla-prow,.pla-phead,.pla-pk,.pla-x,.pla-add{display:none!important}
}

/* Tratamiento en amarillo mientras el pago no esté registrado completo; verde solo cuando está pagado */
@media (min-width: 821px) {
  html body #presupuestos .bp-pi.pla-wait .js-budget-done{background:#FEF3C7!important;border-color:#F59E0B!important;color:#B45F00!important}
  html body #presupuestos .bp-pi.pla-wait{background:#FFFBEB!important}
  html body #presupuestos .bp-pi .js-budget-done.on.pla-y{background:#F59E0B!important;border-color:#F59E0B!important;color:#fff!important}
  html body #presupuestos .bp-pi.pla-y-row{background:#FFFBEB!important}
  html body #presupuestos .bp-pi.pla-y-row .bp-link{color:#B45F00}
  html body #presupuestos .bp-pi .pla-pw{display:block;font-size:.74rem;font-weight:700;color:#B45F00;margin-top:1px}
}

/* Especialidades (escritorio): tarjetas por especialidad + últimas fichas en filas */
@media (min-width: 821px) {
  #planPaneEsp .esp-bar{display:flex;align-items:center;gap:10px;margin:0 0 10px;min-height:46px}
  #planPaneEsp .esp-count{font-size:13px;font-weight:600;color:#515154;white-space:nowrap}
  #planPaneEsp .esp-q{height:42px;min-height:42px;border-radius:12px;border:1.5px solid #E1E4EA;padding:0 12px;width:300px;margin:0 0 0 auto;background:#fff;font:inherit;font-size:.9rem}
  #planPaneEsp .esp-clear{height:42px;min-height:42px;padding:0 16px;border-radius:12px;border:1.5px solid #D2D6DE;background:#fff;color:#0A6CA8;font:inherit;font-weight:700;font-size:.84rem;cursor:pointer;margin:0}
  #planPaneEsp .esp-cards{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:0 0 14px}
  @media (max-width:1250px){#planPaneEsp .esp-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
  #planPaneEsp .esp-card{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;padding:12px 14px;border:1px solid #E5E8EE;border-left:5px solid var(--c);border-radius:16px;background:#fff;cursor:pointer;font:inherit;margin:0;min-height:96px;color:#1D1D1F}
  #planPaneEsp .esp-card:hover{background:#F7FAFD}
  #planPaneEsp .esp-card.on{border-color:var(--c);background:#F5FAFE;box-shadow:0 0 0 1.5px var(--c) inset}
  #planPaneEsp .esp-card:focus-visible{outline:2px solid #0A84C7;outline-offset:2px}
  #planPaneEsp .esp-n{font-size:28px;font-weight:800;line-height:1.1;letter-spacing:-.02em}
  #planPaneEsp .esp-t{font-size:14px;font-weight:700}
  #planPaneEsp .esp-s{font-size:12px;font-weight:600;color:#5F6B7C;line-height:1.25}
  #planPaneEsp .esp-lab{font-weight:800;font-size:11px;letter-spacing:.06em;color:#5F6B7C;text-transform:uppercase;margin:4px 2px 6px}
  #planPaneEsp .esp-hd,#planPaneEsp .esp-row{display:grid;grid-template-columns:36px minmax(0,1.1fr) 130px minmax(0,2fr) 120px 130px;gap:12px;align-items:center}
  #planPaneEsp .esp-hd{padding:4px 12px;font-size:10.5px;font-weight:700;color:#5F6B7C;text-transform:uppercase;letter-spacing:.04em}
  #planPaneEsp .esp-row{padding:8px 12px;min-height:56px;border-bottom:1px solid #EEF0F4}
  #planPaneEsp .esp-row:hover{background:#F5F9FD;border-radius:12px}
  #planPaneEsp .esp-nm{font-weight:700;font-size:14px;line-height:1.2;min-width:0}
  #planPaneEsp .esp-ti{font-weight:600;font-size:13.5px;min-width:0;line-height:1.3}
  #planPaneEsp .esp-tag{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;border-radius:99px;padding:2px 10px;background:#EEF0F4;color:#3B4757}
  #planPaneEsp .esp-tag::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--c)}
  #planPaneEsp .esp-fe{font-weight:700;font-size:13px}
  #planPaneEsp .esp-fe small{display:block;font-size:12px;font-weight:600;color:#5F6B7C}
  #planPaneEsp .esp-ac{display:flex;justify-content:flex-end}
  #planPaneEsp .esp-open{height:40px;min-height:40px;padding:0 14px;border-radius:11px;border:1px solid #B5D9F0;background:#EEF6FC;color:#0A6CA8;font:inherit;font-weight:700;font-size:.84rem;cursor:pointer;margin:0}
  #planPaneEsp .esp-open:hover{background:#DCEEFA}
  #planPaneEsp .esp-open:focus-visible,#planPaneEsp .esp-clear:focus-visible,#planPaneEsp .esp-q:focus-visible{outline:2px solid #0A84C7;outline-offset:2px}
}
@media (min-width: 821px) {
  .pla-use{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;min-height:44px;padding:0 10px;border-radius:11px;background:#EAF7EF;border:1px solid #BFE5CE;color:#1B7F46;font-size:.86rem;font-weight:600;text-transform:none!important;letter-spacing:0!important;cursor:pointer}
  .pla-use input{width:20px!important;height:20px!important;min-height:0!important;margin:0!important;accent-color:#1B9A55;flex:none}
  .pla-use b{font-weight:800}
}
@media (min-width: 821px) {
  html body #presupuestos .pla-use input[type="checkbox"]{-webkit-appearance:checkbox!important;appearance:auto!important;width:20px!important;height:20px!important;accent-color:#1B9A55;background:#fff;opacity:1!important;position:static!important}
  html body #presupuestos .pla-use input[type="checkbox"]::after{content:none!important}
}

/* ===== Rediseño Planificación (maqueta 2026-11-30): ventana «Nuevo plan», lista y resumen del plan ===== */
#presupuestos{--pl-fld:var(--fld,#F6F8FB);--pl-good-ink:var(--good-ink,#0B7A44);--pl-warn-ink:var(--warn-ink,#B45309)}
/* Nuevo plan: ventana de dos columnas */
html body #presupuestos .bp-win{grid-column:1/-1;background:var(--bg);border:1px solid var(--line);border-radius:20px;max-width:1320px;width:100%;min-width:0}
html body #presupuestos .bp-grid.bp-mode-saved>.bp-win{display:none}
html body #presupuestos .bp-whead{display:flex;align-items:center;gap:12px;padding:16px 22px;background:#fff;border-bottom:1px solid var(--line);border-radius:20px 20px 0 0}
html body #presupuestos .bp-hic{width:38px;height:38px;border-radius:12px;background:var(--blue-soft);color:var(--blue);display:grid;place-items:center;flex:none}
html body #presupuestos .bp-hic svg{width:20px;height:20px}
html body #presupuestos .bp-ht{flex:1;min-width:0}
html body #presupuestos .bp-ht b{display:block;font-size:1.1rem;font-weight:700;color:var(--ink)}
html body #presupuestos .bp-ht small{display:block;font-size:.85rem;color:var(--muted)}
html body #presupuestos .bp-wx{width:34px;height:34px;min-height:0;padding:0;margin:0;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--ink-2);display:grid;place-items:center;cursor:pointer;box-shadow:none}
html body #presupuestos .bp-wx svg{width:15px;height:15px}
html body #presupuestos .bp-wbody{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:16px;padding:18px 22px;align-items:start}
html body #presupuestos .bp-wbody>.bp-main{display:flex;flex-direction:column;gap:14px;min-width:0}
html body #presupuestos .bp-wbody .bp-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;min-width:0}
html body #presupuestos .bp-wbody .bp-ch{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 8px}
html body #presupuestos .bp-wbody .bp-ch h3{margin:0;font-size:.8rem;font-weight:800;color:var(--ink-2)}
html body #presupuestos .bp-chs{font-size:.8rem;font-weight:600;color:var(--muted)}
html body #presupuestos .bp-wbody .bp-lb,html body #presupuestos .bp-wbody .budget-add-row .bar-f>span,html body #presupuestos .bp-wbody .pt-lb{font-size:.8rem;font-weight:700;color:var(--ink-2);margin:0 0 5px;display:block;text-transform:none;letter-spacing:0}
html body #presupuestos .bp-opt{font-style:normal;font-weight:600;color:var(--muted)}
html body #presupuestos #bpCard1 .bp-row3{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px}
html body #presupuestos .bp-wbody input:not([type=radio]):not([type=checkbox]),html body #presupuestos .bp-wbody select{height:42px;min-height:42px;border:1px solid var(--line);border-radius:12px;background:var(--pl-fld);padding:0 12px;font-size:.9rem;font-weight:500;color:var(--ink);box-shadow:none;text-align:left}
html body #presupuestos .bp-wbody input::placeholder{color:var(--muted)}
html body #presupuestos #bpAdd .budget-add-row{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start;margin:0}
html body #presupuestos #bpAdd .budget-add-row .bar-f{display:flex;flex-direction:column;gap:0;margin:0;min-width:0}
html body #presupuestos #bpAdd .budget-add-row .bar-proc{grid-column:1/-1;flex:none}
html body #presupuestos #bpAdd .budget-add-row .bar-fin{grid-column:span 2}
html body #presupuestos #bpAdd .budget-add-row input,html body #presupuestos #bpAdd .budget-add-row select{width:100%!important;height:42px!important;min-height:42px!important;font-size:.9rem!important}
html body #presupuestos #bpAdd .budget-add-row #budgetAddItemBtn,html body #presupuestos #bpAdd .bp-addbtn{grid-column:1/-1;width:100%;height:42px!important;min-height:42px;border:1px dashed var(--blue)!important;background:var(--blue-soft)!important;color:var(--blue-2)!important;border-radius:12px;font-size:.86rem;font-weight:700;display:flex;align-items:center;justify-content:center;gap:7px;align-self:auto;padding:0 16px}
html body #presupuestos #bpAdd .bp-addbtn svg{width:16px;height:16px}
html body #presupuestos #bpAdd .quick-chips{margin:10px 0 0!important;gap:8px!important}
html body #presupuestos #bpAdd #budgetToothChips>span{display:none}
html body #presupuestos #bpAdd .quick-chip,html body #presupuestos #bpAdd .quick-chips button{padding:8px 14px;border:1px solid var(--line);border-radius:999px;font-size:.82rem;font-weight:600;color:var(--blue-2);background:#fff;min-height:0;height:auto}
html body #presupuestos #bpAdd .quick-chip.active,html body #presupuestos #bpAdd .quick-chip[aria-pressed="true"]{background:var(--blue-soft);border-color:var(--blue)}
html body #presupuestos .bp-more{margin-top:10px}
html body #presupuestos .bp-more summary{cursor:pointer;font-size:.82rem;font-weight:700;color:var(--blue-2);width:max-content;list-style:none;padding:4px 0}
html body #presupuestos .bp-more summary::-webkit-details-marker{display:none}
html body #presupuestos .bp-more .bar-f{display:flex;flex-direction:column;max-width:320px;margin-top:6px}
/* plantilla: segmentado */
html body #presupuestos #planTplBox{margin-top:12px}
html body #presupuestos #planTplChips{display:flex;background:var(--pl-fld);border:1px solid var(--line);border-radius:12px;padding:3px;gap:3px;flex-wrap:wrap}
html body #presupuestos #planTplChips .pt-chip,html body #presupuestos #planTplChips .pt-link{flex:1 1 0;min-height:0;text-align:center;padding:8px;border-radius:9px;border:0;background:transparent;font-size:.86rem;font-weight:700;color:var(--muted);box-shadow:none;width:auto;white-space:nowrap}
html body #presupuestos #planTplChips .pt-chip[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(15,23,42,.12)}
/* combo de etapa */
.et-c{position:relative}
.et-in{width:100%;padding-right:30px!important;text-overflow:clip}
.et-chev{position:absolute;right:13px;top:50%;width:7px;height:7px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:translateY(-70%) rotate(45deg);cursor:pointer}
.et-list{position:absolute;z-index:80;left:0;top:calc(100% + 4px);min-width:210px;width:max-content;max-width:min(320px,90vw);border:1px solid var(--line);border-radius:10px;padding:4px;background:#fff;box-shadow:0 6px 18px rgba(15,23,42,.10)}
.et-list[hidden]{display:none}
.et-o{padding:5px 8px;border-radius:6px;font-size:.8rem;font-weight:600;color:var(--ink-2);cursor:pointer;line-height:1.35}
.et-o.on,.et-o:hover{background:var(--blue-soft);color:var(--blue-2)}
.et-o.new{color:var(--blue-2);font-weight:800;border-top:1px dashed var(--line);margin-top:3px;border-radius:0 0 6px 6px}
/* descuento + precio final */
.dc-c{position:relative}
.dc-in{width:100%;padding-right:78px!important}
.dc-seg{position:absolute;right:6px;left:auto;top:50%;width:max-content;transform:translateY(-50%);display:flex;gap:2px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:2px}
html body #presupuestos .dc-seg button{flex:none;min-height:0;width:auto;height:auto;margin:0;padding:2px 9px;border:0;border-radius:6px;background:transparent;box-shadow:none;font:inherit;font-size:.8rem;font-weight:800;color:var(--muted);cursor:pointer}
html body #presupuestos .dc-seg button.on{background:var(--blue-2);color:#fff}
.bp-fin{height:42px;border:1px solid var(--line);border-radius:12px;background:var(--pl-fld,#F6F8FB);padding:0 12px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.9rem;color:var(--ink);font-variant-numeric:tabular-nums}
.bp-fin s{color:var(--muted)}.bp-fin .ph{color:var(--muted)}.bp-fin b{font-weight:800}
/* resumen del plan (lado derecho de Nuevo plan) */
html body #presupuestos .bp-wbody>.bp-side{position:sticky;top:8px;display:block;max-height:none;overflow:visible;background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px}
html body #presupuestos .bp-wbody .bp-sh{padding:0;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}
html body #presupuestos .bp-wbody .bp-sh h2{margin:0;font-size:.8rem;font-weight:800;color:var(--ink-2)}
html body #presupuestos .bp-wbody .bp-prog{padding:0 0 8px;border:0}
html body #presupuestos .bp-wbody .bp-items{padding:0;min-height:0;overflow:visible}
html body #presupuestos .bp-wbody .bp-items:empty::before{content:"Aún no agregas tratamientos. Elige una plantilla o agrégalos a la izquierda.";font-size:.88rem;color:var(--muted);padding:6px 0 12px}
html body #presupuestos .bp-wbody .bp-foot{padding:11px 0 0;margin-top:4px;border-top:1px solid var(--line);background:transparent}
html body #presupuestos .bp-wbody .bp-foot .budget-total-row{font-size:1.2rem;font-weight:800;color:var(--ink);margin:0;display:flex;justify-content:space-between;align-items:center}
html body #presupuestos .bp-wbody .bp-foot .budget-total-row strong{font-size:1.2rem}
html body #presupuestos .bp-wbody .bp-it{display:grid!important;grid-template-columns:minmax(0,1fr) auto 30px;gap:10px;align-items:center;padding:9px 4px;border:0;border-bottom:1px dashed var(--line);border-radius:0;background:transparent}
html body #presupuestos .bp-wbody .bp-it .budget-item-proc{font-size:.92rem;font-weight:700;color:var(--ink)}
html body #presupuestos .bp-wbody .bp-it .budget-item-proc small{font-size:.8rem;font-weight:500;color:var(--muted)}
html body #presupuestos .bp-wbody .bp-it .budget-item-cost{font-size:.95rem;font-weight:700}
/* encabezado de etapa (igual en el resumen y en el panel) */
html body #presupuestos .bp-phase{margin:0}
html body #presupuestos .bp-ph,html body #presupuestos .bp-pc .bp-ph{display:flex;justify-content:space-between;gap:8px;background:var(--blue-soft)!important;color:var(--ink)!important;border-radius:8px!important;padding:6px 10px!important;font-weight:800;font-size:.82rem!important;margin:8px 0 2px}
html body #presupuestos .bp-ph em,html body #presupuestos .bp-pc .bp-ph em{font-style:normal;color:var(--blue-2)!important;opacity:1}
/* pie de la ventana */
html body #presupuestos .bp-wfoot{display:flex;align-items:center;gap:10px;padding:14px 22px;background:#fff;border-top:1px solid var(--line);border-radius:0 0 20px 20px}
html body #presupuestos .bp-sp{flex:1}
html body #presupuestos .bp-wfoot button{height:42px;min-height:42px;padding:0 16px;margin:0;width:auto;border-radius:12px;border:1px solid var(--line);background:#fff;font-weight:700;font-size:.86rem;color:var(--ink-2);display:flex;align-items:center;gap:7px;box-shadow:none}
html body #presupuestos .bp-wfoot button svg{width:16px;height:16px}
html body #presupuestos .bp-wfoot #budgetSaveBtn{background:var(--blue-2)!important;border-color:var(--blue-2)!important;color:#fff!important}
html body #presupuestos .bp-wfoot .secondary{background:#fff!important;color:var(--ink-2)!important;border:1px solid var(--line)!important}
html body #presupuestos #budgetPatient{padding-left:34px;background:var(--pl-fld) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6580' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") 11px center/16px no-repeat}
@media (max-width:820px){
  html body #presupuestos .bp-wbody{grid-template-columns:minmax(0,1fr);padding:14px 12px}
  html body #presupuestos .bp-whead,html body #presupuestos .bp-wfoot{padding:12px}
  html body #presupuestos .bp-wbody>.bp-side{position:static}
  html body #presupuestos #bpAdd .budget-add-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  html body #presupuestos #bpAdd .budget-add-row .bar-fin{grid-column:1/-1}
  html body #presupuestos #bpAdd .budget-add-row .bar-et{grid-column:1/-1}
  html body #presupuestos #bpAdd .budget-add-row .bar-f:has(#budgetItemTooth){grid-column:1/-1}
  html body #presupuestos #budgetDate,html body #presupuestos #budgetPatient{width:100%}
  html body #presupuestos .bp-wbody .bp-row3{grid-template-columns:minmax(0,1fr)!important}
  .et-o{padding:10px 12px;font-size:.9rem}
  html body #presupuestos #planTplChips .pt-chip,html body #presupuestos #planTplChips .pt-link{flex:1 1 auto}
  html body #presupuestos .bp-wfoot button{flex:1 1 auto;justify-content:center}
  html body #presupuestos .bp-sp{display:none}
  html body #presupuestos .bp-wfoot button{height:44px!important;min-height:44px!important;font-size:.86rem!important;padding:0 14px!important}
  html body #presupuestos .dc-seg button{height:28px!important;min-height:0!important;width:auto!important;padding:0 10px!important;font-size:.8rem!important;line-height:1}
  html body #presupuestos #budgetDate{width:100%!important;max-width:none!important}
}

/* ===== Lista de planes y resumen del plan (escritorio) ===== */
@media (min-width: 821px) {
  /* indicadores: una tarjeta con 3 datos separados por líneas */
  html body #presupuestos .pla-pk{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0 0 12px;padding:12px 0;border:1px solid var(--line);border-radius:16px;background:#fff;max-width:760px}
  html body #presupuestos .pla-kk{border:0;border-right:1px solid var(--line);border-radius:0;background:transparent;padding:4px 14px}
  html body #presupuestos .pla-kk:last-child{border-right:0}
  html body #presupuestos .pla-kk small{font-size:.78rem;font-weight:700;text-transform:none;letter-spacing:0;color:var(--muted)!important}
  html body #presupuestos .pla-kk b{font-size:1.15rem;font-weight:800;color:var(--ink)}
  html body #presupuestos .pla-kk.g b{color:var(--good)}
  html body #presupuestos .pla-kk.a b{color:var(--pl-warn-ink)}
  /* filas */
  html body #presupuestos #budgetList .pla-prow{display:grid!important;grid-template-columns:34px minmax(0,1fr) auto 118px!important;gap:12px!important;align-items:center;padding:10px 8px;min-height:0;border:0!important;border-bottom:1px solid var(--line)!important;border-radius:10px;background:transparent}
  html body #presupuestos #budgetList .pla-prow:hover{background:var(--blue-soft)}
  html body #presupuestos #budgetList .pla-prow.on{background:var(--blue-soft);box-shadow:none;border-bottom-color:transparent!important}
  html body #presupuestos #budgetList .pla-av{width:34px;height:34px;border-radius:50%;color:#fff;display:grid;place-items:center;font-size:.76rem;font-weight:800}
  html body #presupuestos #budgetList .pla-pn b{display:block;font-size:.92rem;font-weight:700;color:var(--ink)}
  html body #presupuestos #budgetList .pla-pn small{display:block;font-size:.8rem;font-weight:500;color:var(--muted)!important;overflow-wrap:anywhere}
  html body #presupuestos #budgetList .pla-prow .bp-st{font-size:.8rem!important;font-weight:800;padding:5px 12px;border-radius:999px;background:var(--warn-soft);color:var(--pl-warn-ink);white-space:nowrap}
  html body #presupuestos #budgetList .pla-prow .bp-st.ok{background:var(--good-soft);color:var(--pl-good-ink)}
  html body #presupuestos #budgetList .pla-prow .bp-st.bad{background:var(--red-soft);color:var(--red)}
  html body #presupuestos #budgetList .pla-pm{text-align:right;font-size:.92rem;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
  html body #presupuestos #budgetList .pla-pm small{display:block;font-size:.76rem;font-weight:700;color:var(--pl-warn-ink)}
  html body #presupuestos #budgetList .pla-pm small.good{color:var(--pl-good-ink)}
  html body #presupuestos #budgetList.pla-has-open{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)!important;column-gap:16px}
  html body #presupuestos #budgetList.pla-has-open>.pla-prow{grid-column:1}

  /* panel «Resumen del plan» */
  html body #presupuestos #budgetList .bp-pc.pla-open{display:block!important;padding:0!important;gap:0;overflow:visible!important;border:1px solid var(--line)!important;border-radius:16px!important;box-shadow:none!important;background:#fff}
  html body #presupuestos #budgetList .bp-pc.pla-open::before{display:none!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-h{display:flex;align-items:flex-start;gap:12px;padding:14px 16px!important;border-bottom:1px solid var(--line);border-radius:16px 16px 0 0;background:#fff}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-av{width:38px;height:38px;border-radius:12px;background:var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284C7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center/20px no-repeat;color:transparent;font-size:0;flex:none}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-who{flex:0 1 auto;min-width:0}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-who strong{display:block;font-size:1rem;font-weight:700;color:var(--ink)}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-who small{display:block;font-size:.85rem;color:var(--muted);margin-top:2px}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-h>.bp-st{margin-top:1px;font-size:.8rem;font-weight:800;padding:5px 12px;border-radius:999px;background:var(--warn-soft);color:var(--pl-warn-ink);white-space:nowrap;flex:none}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-h>.bp-st.ok{background:var(--good-soft);color:var(--pl-good-ink)}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-h>.bp-st.bad{background:var(--red-soft);color:var(--red)}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-x{width:34px;height:34px;margin-left:auto;font-size:14px;border:1px solid var(--line);color:var(--ink-2);flex:none}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-body{display:block;padding:14px 16px}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-prog{display:block!important;margin:0!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-plab{display:flex;justify-content:space-between;gap:8px;font-size:.8rem;font-weight:800;color:var(--ink-2);margin-bottom:8px}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-plab span{font-weight:600;color:var(--muted);white-space:nowrap}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-bar{height:6px;border-radius:99px;background:var(--line);margin:4px 0 2px;overflow:hidden}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-bar i{background:var(--good)!important}
  /* tratamientos */
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pi{display:grid!important;grid-template-columns:30px minmax(0,1fr) auto auto!important;gap:10px;align-items:center;padding:9px 4px!important;min-height:0!important;border:0!important;border-bottom:1px dashed var(--line)!important;border-radius:0!important;background:transparent!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-phase:last-child .bp-pi:last-child{border-bottom:0!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pn{font-size:.92rem;font-weight:700;line-height:1.3}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pn small{font-size:.8rem;font-weight:500;color:var(--muted);margin-top:0}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pn small.pla-pw{font-weight:700;color:var(--pl-warn-ink)}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pn .bp-link{color:var(--pl-good-ink);font-weight:600}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pi>b{font-size:.95rem;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-ia{display:flex;gap:2px}
  html body #presupuestos #budgetList .bp-pc.pla-open .plc-chk,html body #presupuestos #budgetList .bp-pc.pla-open .js-budget-done{width:26px!important;min-width:26px!important;height:26px!important;min-height:26px!important;padding:0;margin:0;border-radius:50%!important;border:1.5px solid var(--line)!important;background:#fff!important;color:transparent!important;font-size:.8rem!important;display:grid;place-items:center;box-shadow:none;cursor:pointer}
  html body #presupuestos #budgetList .bp-pc.pla-open .plc-chk:hover,html body #presupuestos #budgetList .bp-pc.pla-open .js-budget-done:not(.on):hover{border-color:var(--blue)!important;background:var(--blue-soft)!important;color:var(--blue)!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .plc-chk.on{background:var(--blue-soft)!important;border-color:var(--blue)!important;color:var(--blue-2)!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .js-budget-done.on{background:var(--good-soft)!important;border-color:var(--good)!important;color:var(--pl-good-ink)!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .js-budget-done.on.pla-y{background:#FEF3C7!important;border-color:#F59E0B!important;color:var(--pl-warn-ink)!important}
  /* agregar tratamiento (dentro del panel) */
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-add{margin-top:8px}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addcell{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;height:42px;border:1px dashed var(--blue);border-radius:12px;background:var(--blue-soft);color:var(--blue-2);font-size:.86rem;font-weight:700;margin:0}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf.pla-pop{position:static!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:10px 12px;margin:8px 0 0;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:none}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf[hidden]{display:none!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf .pla-w2{grid-column:1/-1!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf label,html body #presupuestos #budgetList .bp-pc.pla-open .pla-fld>span{display:flex!important;flex-direction:column;gap:5px;font-size:.8rem;font-weight:700;color:var(--ink-2);text-transform:none;letter-spacing:0;min-width:0}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-fld>span{display:block!important;margin-bottom:5px}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-fld i{font-style:normal;font-weight:600;color:var(--muted)}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf input,html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf select{height:42px;min-height:42px;border:1px solid var(--line);border-radius:12px;background:var(--pl-fld);font-size:.9rem;font-weight:500;color:var(--ink)}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf .pla-fa{display:flex;justify-content:flex-end;gap:8px}
  html body #presupuestos #budgetList .bp-pc.pla-open .pla-addf .pla-fa button{height:42px;min-height:42px;padding:0 16px;border-radius:12px;font-size:.86rem;font-weight:700}
  /* totales */
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-r{margin:12px 0 0!important;padding:8px 0 0!important;border-top:1px solid var(--line)!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot{display:block!important;padding:0!important;margin:0 0 4px!important;background:transparent!important;border:0}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot>div{display:flex!important;justify-content:space-between;align-items:baseline;padding:7px 0!important;font-size:.92rem;color:var(--ink-2)}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot span{font-size:.92rem;font-weight:400;text-transform:none;letter-spacing:0;color:inherit}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot b{font-size:.92rem}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot>div:first-child b{font-size:1.15rem;font-weight:800;color:var(--ink)}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot>div.good b{color:var(--pl-good-ink);font-weight:700}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot>div.warn{color:var(--pl-warn-ink);font-weight:800}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-tot>div.warn b{color:var(--pl-warn-ink);font-weight:800}
  /* botones */
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:12px}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a button{grid-column:auto!important;order:5;height:42px!important;min-height:42px!important;padding:0 16px!important;margin:0;border-radius:12px;border:1px solid var(--line)!important;background:#fff!important;color:var(--ink-2)!important;font-weight:700;font-size:.86rem!important;display:flex;align-items:center;justify-content:center;gap:7px!important;box-shadow:none;white-space:nowrap}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a button svg{width:16px;height:16px}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-abono{order:1}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-desc{order:2}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-print{order:3}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-status[data-status="Aceptado"]{order:4;background:var(--blue-2)!important;border-color:var(--blue-2)!important;color:#fff!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-status[data-status="Rechazado"]{order:5;color:var(--red)!important;border-color:rgba(220,38,38,.35)!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-delete{order:6;color:var(--red)!important;border:1px solid rgba(220,38,38,.35)!important;background:#fff!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-ficha{order:7;grid-column:1/-1!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-status:hover,html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a .js-budget-delete:hover{filter:brightness(.97)}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a:not(:has(.js-budget-status[data-status="Aceptado"])) .js-budget-print{grid-column:1/-1!important}
  html body #presupuestos #budgetList .bp-pc.pla-open .bp-pc-a:not(:has(.js-budget-status[data-status="Rechazado"])) .js-budget-delete{grid-column:1/-1!important}
  /* editar tratamiento (✎) */
  html body #presupuestos .bp-edit{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  html body #presupuestos .bp-edit .bp-edf{display:block;min-width:0}
  html body #presupuestos .bp-edit .bp-edf>span{font-size:.75rem;font-weight:700;color:var(--muted);display:block;margin-bottom:3px}
  html body #presupuestos .bp-edit .bp-edf .bp-opt{font-style:normal;font-weight:600}
  html body #presupuestos .bp-edit .bp-edfull{grid-column:1/-1}
  html body #presupuestos .bp-edit input{height:42px;border:1px solid var(--line);border-radius:12px;background:var(--pl-fld,#F6F8FB);font-size:.9rem}
}
/* ✎ editar tratamiento: también en la ficha del paciente */
.bm-pan .bp-edit .bp-edf,.fx-card .bp-edit .bp-edf{display:block;min-width:0}
.bm-pan .bp-edit .bp-edf>span,.fx-card .bp-edit .bp-edf>span{font-size:.75rem;font-weight:700;color:var(--muted);display:block;margin-bottom:3px}
.bp-edit .bp-edf .bp-opt{font-style:normal;font-weight:600}
.bp-edit .bp-edfull{grid-column:1/-1}
.bp-edit .et-in,.bp-edit .dc-in{height:34px;min-height:0;margin-top:0;font-size:.88rem;padding-top:0;padding-bottom:0}
.bp-edit .bp-fin{height:34px;font-size:.88rem}
.bp-edit .dc-seg{right:4px}
/* progreso del plan: «Tratamientos · N de M realizados» y la barra debajo (móvil y escritorio) */
html body #presupuestos .bp-pc-prog{display:block!important}
html body #presupuestos .bp-pc-prog .bp-plab{display:flex;justify-content:space-between;gap:8px;font-size:.8rem;font-weight:800;color:var(--ink-2);margin-bottom:6px}
html body #presupuestos .bp-pc-prog .bp-plab span{font-weight:600;color:var(--muted);white-space:nowrap}
html body #presupuestos .bp-pc-prog .bp-bar{width:100%}
html body #presupuestos .bp-pn small.bp-meta{display:block}
html body #presupuestos .dc-in,html body #presupuestos .et-in{display:block;margin:0}
html body #presupuestos #bpAdd .budget-add-row input,html body #presupuestos #bpAdd .budget-add-row select,html body #presupuestos #bpCard1 input{margin:0}
