/* ============ Tokens ============ */
:root {
  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --border: #e2e9e2;
  --text: #22302a;
  --muted: #6c7c74;
  --primary: #2f9e7a;
  --primary-600: #23805f;
  --primary-soft: #e1f3eb;
  --accent: #f08a5d;
  --accent-soft: #fdeee5;
  --ok: #2f9e7a;
  --ok-soft: #e1f3eb;
  --warn: #c98a17;
  --warn-soft: #fdf2d9;
  --bad: #d4574b;
  --bad-soft: #fbe7e4;
  --c-hc: #f0b44c;
  --c-p: #e57f6c;
  --c-l: #8f7fd6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(34, 48, 42, .04), 0 4px 16px rgba(34, 48, 42, .06);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-600); font-weight: 700; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  display: grid; place-items: center; width: 40px; height: 40px; font-size: 22px;
  background: var(--primary-soft); border-radius: 12px;
}
.brand b { display: block; font-size: 18px; font-weight: 800; color: var(--primary-600); }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.patient-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.patient-bar select { min-width: 220px; }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 20px 24px 60px; max-width: 1500px; margin: 0 auto; }
.sidebar { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.nav-items { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer;
  transition: background .15s;
}
.nav-btn .ic { font-size: 18px; width: 24px; text-align: center; }
.nav-btn:hover { background: var(--surface); }
.nav-btn.on { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(47, 158, 122, .3); }

.quick {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; font-size: 13px;
}
.q-name { font-weight: 800; font-size: 15px; }
.q-sub { color: var(--muted); margin-bottom: 8px; }
.q-row { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px dashed var(--border); }
.q-macros { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.q-macros span { padding-left: 10px; border-left: 4px solid var(--c); }
.q-saved { margin-top: 10px; color: var(--primary-600); font-size: 12px; font-weight: 700; }

main { min-width: 0; }

/* ============ Page ============ */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }

.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g-2.tight { gap: 14px; margin: 0; }
.grid.g-req { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
.grid.g-cat { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid.g-cat > .card:only-child { grid-column: 1 / -1; }
.col { display: flex; flex-direction: column; gap: 20px; }
.col > .card { margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; min-width: 0;
}
.grid > .card { margin-bottom: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2 { font-size: 17px; font-weight: 800; }
.card.sticky { position: sticky; top: 84px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.pad { padding: 10px 4px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 16px; }
.warn-t { color: var(--warn); }
.pre { white-space: pre-wrap; }

/* ============ Forms ============ */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.field { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hint { font-style: normal; font-weight: 600; opacity: .8; }
.unit { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.field:has(.unit) input { padding-right: 52px; }

input[type=text], input[type=search], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled { opacity: .75; }
textarea { resize: vertical; }
select { cursor: pointer; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 10px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { padding: 6px 16px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg label.on { background: var(--primary); color: #fff; }
.seg input { display: none; }
.seg.big label { padding: 9px 22px; font-size: 15px; }

.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt {
  display: flex; flex-direction: column; gap: 2px; padding: 12px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.opt input { display: none; }
.opt span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.opt b { font-size: 18px; }
.opt.on { border-color: var(--primary); background: var(--primary-soft); }
.opt.on span { color: var(--primary-600); }

.subbox { margin-top: 16px; padding: 14px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; }
.subbox h4 { font-size: 13.5px; margin-bottom: 10px; }

.row-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.w-sm { width: 110px !important; }
.w-xs { width: 70px !important; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; border-radius: 11px; padding: 9px 16px; transition: all .15s; white-space: nowrap;
}
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary-600); }
.btn.danger-ghost { background: transparent; border-color: var(--border); color: var(--bad); }
.btn.danger-ghost:hover { background: var(--bad-soft); }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; border-radius: 8px; padding: 4px 8px; }
.icon-btn:hover { background: var(--bad-soft); color: var(--bad); }

/* ============ Badges & stats ============ */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.ok { background: var(--ok-soft); color: var(--primary-600); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.lg { font-size: 15px; padding: 7px 12px; align-self: flex-start; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-l { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat-v { font-size: 22px; font-weight: 800; }
.stat-s { font-size: 12px; color: var(--muted); }

/* ============ Chips ============ */
.chip-group { margin-top: 14px; }
.chip-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  transition: all .15s;
}
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; flex: none; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: #c4622f; margin-right: 8px; vertical-align: middle; }

/* ============ Tables ============ */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; padding: 8px 10px; border-bottom: 1.5px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { border-bottom: 0; }
.tbl tr.tot td { font-weight: 800; border-top: 1.5px solid var(--border); }
.tbl tr.dim td { color: var(--muted); }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }

.tbl.formulas tr { cursor: pointer; transition: background .1s; }
.tbl.formulas tbody tr:hover { background: var(--surface-2); }
.tbl.formulas tr.sel { background: var(--primary-soft); }
.tbl.formulas tr.off { opacity: .55; }
.eq-txt { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.w-radio { width: 28px; }
.w-x { width: 36px; text-align: right; }
.radio { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); background: #fff; }
.radio.on { border-color: var(--primary); box-shadow: inset 0 0 0 4px #fff; background: var(--primary); }

.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface);
  font: inherit; font-weight: 800; color: var(--primary-600); cursor: pointer;
}
.stepper button:hover { border-color: var(--primary); background: var(--primary-soft); }
.num-in { width: 64px !important; text-align: center; padding: 6px 8px !important; }
.num-in.sm { width: 56px !important; }

/* ============ Requerimientos ============ */
.get-hero { display: flex; align-items: center; justify-content: space-between; padding: 16px; margin-bottom: 12px; border-radius: 14px; background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); }
.big { font-size: 40px; font-weight: 800; color: var(--primary-600); line-height: 1.1; }
.big small { font-size: 15px; color: var(--muted); font-weight: 700; }

.macro-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: center; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.donut-box { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut { width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center; }
.donut-hole { width: 122px; height: 122px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-hole b { font-size: 24px; font-weight: 800; }
.donut-hole span { font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ============ Plan ============ */
.meta-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.meta-strip div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); }
.meta-strip span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.meta-strip b { font-size: 20px; font-weight: 800; }
.meta-strip div:first-child { background: var(--primary); border-color: var(--primary); color: #fff; }
.meta-strip div:first-child span { color: rgba(255, 255, 255, .85); }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.toolbar .field { width: 240px; }
.toolbar > input[type=search] { max-width: 320px; }
.toolbar > select { max-width: 280px; }
.tiempos-cfg { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tcfg { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.tcfg input[type=text]:first-child { font-weight: 700; }

/* ============ Menú ============ */
.banner { padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); margin-bottom: 18px; font-size: 14px; }
.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.menu-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }
.menu-cols .card { margin: 0; }
.card.tiempo .card-h { margin-bottom: 10px; }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gchip {
  display: inline-flex; align-items: center; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface);
}
.gchip .dot { margin-right: 6px; width: 8px; height: 8px; }
.gchip b { margin-left: 4px; }
.gchip.ok { background: var(--ok-soft); border-color: transparent; color: var(--primary-600); }
.gchip.pend { background: var(--surface-2); color: var(--text); }
.gchip.over { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.gchip.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--primary); }
.platillo { margin-bottom: 10px; font-weight: 600; }
.search { position: relative; display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.filter-pill { flex: none; border: 0; background: var(--primary-soft); color: var(--primary-600); font: inherit; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(34, 48, 42, .16); padding: 4px;
}
.result {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; width: 100%;
  border: 0; background: transparent; font: inherit; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.result:hover { background: var(--primary-soft); }
.r-name { font-weight: 700; font-size: 14px; }
.r-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tbl.items td { padding: 7px 6px; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.tot-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.tot-row > span:first-child { font-weight: 700; }
.tot-row > b { text-align: right; }
.tot-row > .muted { grid-column: 1; font-size: 12px; }
.tot-row > .badge { grid-column: 2; grid-row: 2; justify-self: end; }
.tot-row .bar { grid-column: 1 / -1; }
.bar { position: relative; display: flex; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar-fill { height: 100%; border-radius: 99px; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--c-hc); }
.bar-fill.bad { background: var(--bad); }
.bar-over { position: absolute; right: 0; top: 0; height: 100%; background: repeating-linear-gradient(45deg, var(--bad), var(--bad) 3px, transparent 3px, transparent 6px); }

.empty { text-align: center; padding: 24px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border); border-radius: 14px; margin-bottom: 20px; }
.empty p { margin: 0 0 12px; }

/* ============ Recomendaciones ============ */
.rec-metas { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rec-metas div { padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); }
.rec-metas span { display: block; font-size: 12px; color: var(--primary-600); font-weight: 700; }
.rec-metas b { font-size: 14px; }
.rec-list { margin-top: 10px; }
.rec-list h4 { font-size: 13px; margin-bottom: 6px; }
.rec-list ul { margin: 0; padding-left: 20px; }
.rec-list li { margin: 3px 0; font-size: 14px; }
.rec-list.metas { padding: 10px 14px; background: var(--warn-soft); border-radius: 12px; }
.rec-list.pref, .rec-list.lim { padding: 10px 14px; border-radius: 12px; }
.rec-list.pref { background: var(--ok-soft); }
.rec-list.lim { background: var(--bad-soft); }

/* ============ Resumen ============ */
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); max-width: 960px; }
.report h2 { font-size: 17px; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-soft); color: var(--primary-600); }
.report h3 { font-size: 15px; margin-bottom: 6px; }
.rep-h { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.rep-h h1 { font-size: 26px; }
.rep-h p { margin: 4px 0 0; }
.rep-logo { font-weight: 800; color: var(--primary-600); }
.rep-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.rep-grid div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.rep-grid span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.rep-grid b { font-size: 16px; }
.rep-grid em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.rep-macros { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; }
.rep-get { text-align: center; padding: 14px; border-radius: 14px; background: var(--primary-soft); }
.rep-get b { display: block; font-size: 30px; color: var(--primary-600); }
.rep-get span { font-size: 12px; color: var(--muted); }
.res-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.res-tiempo { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; break-inside: avoid; }
.platillo-t { margin: 0 0 6px; font-style: italic; }
.res-items { list-style: none; margin: 0; padding: 0; }
.res-items li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.res-items li:last-child { border-bottom: 0; }
.rep-rec ul { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; }

/* ============ Barra lateral del menú ============ */
.menu-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.menu-side .card.sticky { position: static; }
.menu-side .card { margin-bottom: 16px; }
.micro-row { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.micro-row > span:first-child { font-weight: 700; }
.micro-row > .muted { grid-column: 1 / -1; }
.tbl td.mic { color: var(--muted); font-size: 13px; }

/* ============ Sellos NOM-051 ============ */
.octo {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  width: 58px; height: 58px; padding: 6px; background: #111; color: #fff;
  font-size: 8px; font-weight: 800; line-height: 1.05; letter-spacing: .01em;
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}
.octo small { font-size: 6.5px; font-weight: 700; opacity: .9; margin-bottom: 1px; }
.sellos { display: flex; flex-wrap: wrap; gap: 3px; }
.sellos.mini { display: inline-flex; vertical-align: middle; margin-left: 4px; gap: 2px; }
.sellos.mini .octo { width: 30px; height: 30px; padding: 2px; font-size: 5px; }
.leyenda { margin-top: 4px; padding: 2px 6px; border: 1.5px solid #111; border-radius: 4px; font-size: 9px; font-weight: 800; line-height: 1.2; max-width: 190px; }
.leyenda-mini { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #111; font-size: 10px; font-weight: 800; margin-left: 2px; }
.w-sellos { min-width: 130px; }

/* ============ Menú semanal ============ */
.daychips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.daychip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 6px; cursor: pointer;
  font: inherit; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface);
}
.daychip span { font-size: 12px; color: var(--muted); }
.daychip:hover { border-color: var(--primary); }
.daychip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.daychip.on span { color: rgba(255, 255, 255, .85); }
.sem-tools { align-items: center; }
.sem-tools .field { width: 220px; }
.semana-tbl td { vertical-align: top; min-width: 120px; }
.semana-tbl tfoot td { vertical-align: middle; }

/* ============ Lista del súper ============ */
.lista { columns: 2 340px; column-gap: 28px; }
.lista-sec { break-inside: avoid; margin-bottom: 18px; }
.lista-sec h3 { font-size: 14px; color: var(--primary-600); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 2px solid var(--primary-soft); }
.lista-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px dashed var(--border); cursor: pointer; font-size: 14px; }
.lista-row:hover { background: var(--surface-2); }
.lista-row .cb { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.lista-row.done .cb { background: var(--primary); border-color: var(--primary); }
.lista-row.done .l-name, .lista-row.done .l-qty { text-decoration: line-through; color: var(--muted); }
.l-qty { text-align: right; font-weight: 700; }
.w-dias { width: 140px; }

@media (max-width: 1200px) {
  .menu-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 900px) {
  .daychips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lista { columns: 1; }
}

/* ============ Evaluación pediátrica ============ */
.edad-exacta { font-size: 18px; padding: 6px 0 0; }
.w-zbar { width: 150px; }
.zbar {
  position: relative; height: 10px; border-radius: 99px;
  background: linear-gradient(90deg, var(--bad) 0 12.5%, var(--c-hc) 12.5% 25%, var(--ok) 25% 62.5%, var(--c-hc) 62.5% 75%, var(--bad) 75% 100%);
  opacity: .85;
}
.zbar i { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px #fff; }

/* ============ Resumen: menú semanal ============ */
.res-dia { margin-bottom: 18px; }
.dia-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 12px; margin: 14px 0 10px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-600); font-size: 16px; }
.dia-h span { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ============ Recetas ============ */
.rec-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.rec-layout .rec-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 150px); overflow-y: auto; position: sticky; top: 84px; padding-right: 4px; scrollbar-width: thin; }
.rec-item {
  display: grid; gap: 4px; text-align: left; font: inherit; cursor: pointer; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; transition: border-color .15s;
}
.rec-item:hover { border-color: var(--primary); }
.rec-item.on { border-color: var(--primary); background: var(--primary-soft); }
.rec-item b { font-size: 14.5px; line-height: 1.25; }
.rec-code { font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.rec-code.s { color: var(--primary-600); }
.rec-code.d { color: #b4467a; }
.rec-meta { font-size: 12px; color: var(--muted); }
.rec-eqs { display: flex; flex-wrap: wrap; gap: 4px; }
.eqchip { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; color: #fff; background: var(--c); }
.rec-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-kcal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.rec-kcal > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.rec-kcal > div.hl { background: var(--primary-soft); border-color: transparent; }
.rec-kcal span { font-size: 12px; color: var(--muted); font-weight: 700; }
.rec-kcal b { font-size: 20px; }
.rec-kcal em { font-style: normal; font-size: 12px; color: var(--muted); }
.rec-kcal .badge { align-self: flex-start; }
.rec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; margin: 18px 0 8px; }
.rec-ings td { vertical-align: top; }
.rec-ings tr.rec-sec td { background: var(--surface-2); font-weight: 800; font-size: 12.5px; color: var(--primary-600); }
.rec-ings tr.del td { opacity: .45; }
.rec-ings tr.del .rec-ing { text-decoration: line-through; }
.rec-ings tr.cero td { opacity: .6; }
.rec-ings .num-in.manual { border-color: var(--accent); background: var(--accent-soft); }
.w-acc { white-space: nowrap; text-align: right; width: 70px; }
.icon-btn.sw:hover { background: var(--primary-soft); color: var(--primary-600); }
.sub-row td { background: var(--surface-2); }
.sub-panel .row-inline input { flex: 1; min-width: 200px; }
.sub-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 220px; overflow-y: auto; }
.sub-opt { font: inherit; font-size: 13px; cursor: pointer; border: 1.5px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 10px; text-align: left; }
.sub-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.rec-subst { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.rec-prep { margin: 0; }
.rec-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.banner.ok-b { background: var(--ok-soft); margin: 14px 0 0; }
.banner.mt { margin: 12px 0 0; }
.rec-btn { flex: none; }
@media (max-width: 1100px) {
  .rec-layout { grid-template-columns: 1fr; }
  .rec-layout .rec-list { position: static; max-height: 420px; }
}
@media (max-width: 600px) { .rec-kcal { grid-template-columns: 1fr; } }

/* ============ Toast ============ */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: 11px 20px; border-radius: 12px; font-weight: 700; font-size: 14px;
  transition: all .25s; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .grid.g-req, .grid.g-cat { grid-template-columns: 1fr; }
  .menu-layout { grid-template-columns: 1fr; }
  .card.sticky { position: static; }
}
@media (max-width: 900px) {
  .topbar { flex-direction: column; align-items: stretch; padding: 10px 16px; position: static; }
  .patient-bar { justify-content: flex-start; }
  .patient-bar select { flex: 1 1 100%; min-width: 0; }
  .layout { grid-template-columns: 1fr; padding: 12px 16px 60px; gap: 12px; }
  .sidebar { position: sticky; top: 0; z-index: 25; background: var(--bg); padding: 6px 0; }
  .nav-items { flex-direction: row; overflow-x: auto; }
  .nav-btn { flex: none; padding: 8px 12px; }
  .quick { display: none; }
  .grid.g-2, .macro-layout, .res-menu { grid-template-columns: 1fr; }
  .form-grid, .form-grid.g3, .form-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opts, .meta-strip { grid-template-columns: repeat(2, 1fr); }
  .menu-cols { grid-template-columns: 1fr; }
  .rep-grid { grid-template-columns: repeat(3, 1fr); }
  .rep-macros { grid-template-columns: 1fr; }
  .report { padding: 18px; }
}

/* ============ Impresión ============ */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .sidebar, .no-print, #toast { display: none !important; }
  .layout { display: block; padding: 0; }
  .report { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .report h2 { break-after: avoid; }
  .res-tiempo, .rep-rec { break-inside: avoid; }
  .card { box-shadow: none; }
  .dia-h { break-after: avoid; }
  .res-dia + .res-dia { break-before: auto; }
  .lista-sec { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============ Antropometría ============ */
.antro-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); gap: 20px; align-items: start; margin-bottom: 20px; }
.antro-layout > .col:last-child { position: sticky; top: 84px; }
.form-grid.g-med { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
.muneco-card { margin: 0; }
.muneco-wrap { background: var(--surface-2); border-radius: 12px; }
.muneco { display: block; width: 100%; height: auto; font-family: var(--font); }
.muneco-leg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 10px 0; font-size: 13px; }
.muneco-leg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(91, 70, 54, .35); }
.comp-bar { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; }
.comp-bar i { display: block; min-width: 3px; }
.comp-leg { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; font-size: 13px; }
.comp-leg > div { display: grid; grid-template-columns: 12px 1fr; column-gap: 6px; align-items: center; }
.comp-leg i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(91, 70, 54, .35); }
.comp-leg b { grid-column: 2; font-size: 16px; }
.comp-leg em { grid-column: 2; font-style: normal; color: var(--muted); font-size: 12px; }
.diag { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.diag-i { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--border); font-size: 14px; break-inside: avoid; }
.diag-i.ok { border-left-color: var(--ok); }
.diag-i.warn { border-left-color: var(--warn); }
.diag-i.bad { border-left-color: var(--bad); }
.antro-acc { margin-top: 14px; }
.reg-list { display: grid; gap: 8px; margin-bottom: 10px; }
.reg { display: grid; grid-template-columns: 110px 1fr 62px; gap: 10px; align-items: center; font-size: 13.5px; }
.reg b { text-align: right; }
.reg-bar { height: 10px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.reg-bar i { display: block; height: 100%; background: var(--c-hc); border-radius: 0 4px 4px 0; }
.soma { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.soma div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.soma span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.soma b { font-size: 18px; }
.rep-antro { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 12px; break-inside: avoid; }
.agua-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.agua-opt { display: flex; gap: 10px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 12px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px; }
.agua-opt:hover:not(:disabled) { border-color: var(--primary); }
.agua-opt:disabled { opacity: .55; cursor: not-allowed; }
.agua-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.agua-opt .radio { flex: none; }
.agua-txt { display: flex; flex-direction: column; gap: 1px; }
.agua-txt span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.agua-txt b { font-size: 16px; }
.agua-txt em { font-style: normal; font-size: 11.5px; color: var(--muted); }
@media (max-width: 1100px) {
  .antro-layout { grid-template-columns: minmax(0, 1fr); }
  .antro-layout > .col:last-child { position: static; grid-row: 1; }
}
@media (max-width: 600px) { .rep-antro { grid-template-columns: minmax(0, 1fr); } }

/* La barra de pestañas se desplaza dentro de su ancho y no ensancha la página */
.sidebar { min-width: 0; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* ============ Proteína bruta y neta ============ */
.prot-strip { margin: 14px 0 0; }
.prot-strip div { box-shadow: none; }

/* ============ Bioquímicos ============ */
.bq-tabla td { padding: 6px 10px; }
.bq-tabla tr.fuera td:first-child { font-weight: 800; }
.bq-ref { white-space: nowrap; }
.bq-ref .num-in.sm { width: 62px !important; }
.bq-ref span { margin: 0 4px; }
.num-in.manual { border-color: var(--accent); background: var(--accent-soft); }
.bq-linea { max-width: 320px; overflow-wrap: anywhere; }
.bq-crit { background: var(--bad-soft); }
.bq-strip { align-items: stretch; }
.meta-strip .bq-fecha { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); }
.bq-fecha input { margin-top: 2px; padding: 4px 8px; }
.bq-diag { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.bq-dx { gap: 6px; }
.bq-dx-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bq-ul { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
.bq-ul li { margin: 4px 0; }
@media print { .bq-tabla input { border: 0; background: none; padding: 0; } }

/* ============ Consultas y agenda ============ */
.con-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--primary-soft); font-size: 13.5px; }
.exp-list { display: grid; gap: 8px; margin-top: 12px; }
.exp { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.exp-n { display: flex; flex-direction: column; min-width: 0; }
.exp-n a { color: var(--text); text-decoration: none; }
.ag-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.ag-layout > .card { margin: 0; }
.cal-s, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-s { margin-bottom: 4px; font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; }
.cal-d { display: flex; flex-direction: column; gap: 1px; min-height: 74px; padding: 5px 6px; text-align: left; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-d.vacio { background: none; border: 0; cursor: default; }
.cal-d span { font-weight: 800; }
.cal-d em { font-style: normal; font-size: 11px; line-height: 1.25; padding: 1px 4px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-d:hover:not(.vacio) { border-color: var(--primary); }
.cal-d.hoy span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; }
.cal-d.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cita { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cita:last-child { border-bottom: 0; }
.cita.cancelada .cita-n a { text-decoration: line-through; color: var(--muted); }
.cita-h { display: flex; flex-direction: column; }
.cita-n a { color: var(--text); font-weight: 700; text-decoration: none; }
.cita-a { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.cita-rep input { width: 132px; padding: 4px 6px; font-size: 12.5px; }
.form-grid.g-cita { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.prox { display: flex; flex-direction: column; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--primary-soft); }

/* ============ Seguimiento ============ */
.evo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.evo-card { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); break-inside: avoid; }
.evo-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.evo-h b { font-size: 21px; color: var(--text); }
.evo-h small { font-size: 12px; font-weight: 600; color: var(--muted); }
.evo { display: block; width: 100%; height: auto; margin-top: 4px; font-family: var(--font); }
.evo-t { font-size: 10px; fill: var(--muted); }
.evo-v { font-size: 11.5px; font-weight: 800; fill: var(--text); }
.evo-d { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.evo-dolls { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 20px; }
.evo-dolls figure { margin: 0; text-align: center; font-size: 13.5px; }
.tbl tr.con-sel td { background: var(--primary-soft); }
.tbl.hist td:first-child { white-space: nowrap; }
.stat-v small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ============ Equivalentes con varios tipos ============ */
.tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.chip.chip-s { padding: 5px 11px; font-size: 13px; }
.tipos + .note { margin: 8px 0 14px; }
.prot-apl { margin: 14px 0; }
.prot-apl .banner { margin: 8px 0 0; }

@media (max-width: 1100px) { .ag-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .cal-d { min-height: 48px; padding: 3px; }
  .cal-d em { font-size: 9.5px; padding: 0 2px; }
  .cita { grid-template-columns: 50px minmax(0, 1fr); }
  .cita-a { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ============ Menú para impresión ============ */
.print-only { display: none; }
@media print {
  .screen-only { display: none !important; }
  .print-only { display: block; }
  @page semana { size: A4 landscape; margin: 11mm; }
  .pm-semana { page: semana; break-before: page; }
  .pm-tit span { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-600); }
  .pm-tit h2 { margin: 1px 0 2px; padding: 0; border: 0; font-size: 25px; color: var(--text); }
  .pm-tit p { margin: 0 0 10px; color: var(--muted); }
  .pm-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-size: 10.5px; line-height: 1.3; }
  .pm-grid thead th { padding: 6px; border-radius: 6px; background: var(--primary-600); color: #fff; font-size: 11.5px; text-align: center; }
  .pm-grid tbody th { width: 88px; padding: 6px 7px; border-radius: 6px; background: var(--surface-2); border-left: 4px solid var(--c); font-size: 11px; text-align: left; vertical-align: middle; }
  .pm-grid tbody th span { display: block; font-size: 15px; }
  .pm-grid tbody td { padding: 6px; border-radius: 6px; background: var(--surface-2); vertical-align: top; }
  .pm-grid tbody td b { font-weight: 700; }
  .pm-grid tfoot th, .pm-grid tfoot td { padding: 5px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-600); font-weight: 800; text-align: center; font-size: 11px; }
  .pm-dia { break-before: page; }
  .pm-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 13px 18px; border-radius: 12px; background: linear-gradient(120deg, var(--primary-600), var(--primary)); color: #fff; }
  .pm-band span { font-size: 10.5px; letter-spacing: .04em; opacity: .9; }
  .pm-band h2 { margin: 0; padding: 0; border: 0; color: #fff; font-size: 31px; line-height: 1.05; }
  .pm-band dl { display: flex; gap: 16px; margin: 0; }
  .pm-band dt { font-size: 9.5px; opacity: .88; }
  .pm-band dd { margin: 0; font-size: 18px; font-weight: 800; white-space: nowrap; }
  .pm-band small { font-size: 10px; font-weight: 600; }
  .pm-lin { position: relative; margin-top: 13px; }
  .pm-lin::before { content: ''; position: absolute; left: 20px; top: 12px; bottom: 12px; width: 2px; background: var(--border); }
  .pm-t { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 11px; margin-bottom: 9px; break-inside: avoid; }
  .pm-ic span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 2.5px solid var(--c); font-size: 19px; }
  .pm-b { padding: 9px 13px; border-radius: 11px; background: var(--surface-2); border-top: 3px solid var(--c); }
  .pm-th { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .pm-th h3 { margin: 0; font-size: 14.5px; font-weight: 800; color: var(--c); }
  .pm-th span { font-size: 10.5px; font-weight: 700; color: var(--muted); }
  .pm-plat { margin: 1px 0 5px; font-size: 13px; font-weight: 700; }
  .pm-b ul { list-style: none; margin: 4px 0 0; padding: 0; columns: 2; column-gap: 18px; font-size: 11px; line-height: 1.3; }
  .pm-b li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 2.5px 0; border-bottom: 1px dotted var(--border); break-inside: avoid; }
  .pm-b li i { width: 7px; height: 7px; border-radius: 50%; }
  .pm-b li b { font-weight: 700; text-align: right; }
  .pm-b li small { color: var(--muted); }
  .pm-prep { margin: 6px 0 0; font-size: 10.5px; line-height: 1.35; color: #44524b; }
  .pm-pie { margin-top: 6px; padding: 6px 12px; border-radius: 8px; background: var(--primary-soft); font-size: 11.5px; text-align: center; }
  .pm + * { break-before: page; }
}

/* Barra superior con paciente y consulta en una línea */
.patient-bar select { width: auto; min-width: 170px; max-width: 250px; }
@media (max-width: 900px) { .patient-bar select { width: 100%; max-width: none; flex: 1 1 100%; } }
@media print {
  .report .tbl-wrap { overflow: visible; break-inside: avoid; }
}

/* ============ Agenda ============ */
.ag-hero { padding: 24px 26px; margin-bottom: 18px; color: #fff; border-radius: var(--radius); background: linear-gradient(120deg, var(--primary-600), var(--primary)); box-shadow: var(--shadow); }
.ag-hero-t { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 18px; }
.ag-hero small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.ag-hero h1 { margin: 2px 0 4px; font-size: 26px; color: #fff; }
.ag-hero p { margin: 0; font-size: 15px; }
.ag-kpis { display: flex; gap: 10px; }
.ag-kpis div { min-width: 92px; padding: 10px 12px; text-align: center; border-radius: 12px; background: rgba(255, 255, 255, .17); }
.ag-kpis b { display: block; font-size: 26px; line-height: 1.1; }
.ag-kpis span { font-size: 12px; font-weight: 700; }
.ag-kpis .alerta { background: #fff; color: #b3402e; }
.ag-buscar { display: block; margin-top: 18px; }
.ag-buscar span { display: block; margin-bottom: 6px; font-weight: 800; }
.ag-buscar input { width: 100%; padding: 13px 16px; font-size: 16px; color: var(--text); background: #fff; border: 0; border-radius: 12px; }
.ag-res { margin: 0 0 20px; }
.ag-tit { margin: 0; font-size: 14px; color: var(--muted); }
.ag-res .exp { background: var(--surface); }
.ag-crear { justify-self: start; }
.ag-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ag-alerta { border-color: var(--bad); background: var(--bad-soft); }
.ag-pie { display: flex; justify-content: flex-end; }
.ag-form .field { margin-top: 10px; }
.ag-form .presets { align-items: center; }
.ag-frase { margin: 12px 0; padding: 10px 12px; font-size: 14px; border-radius: 10px; background: var(--primary-soft); }
.ag-ok { width: 100%; justify-content: center; }
.cal-d em.at { background: var(--ok-soft); color: var(--text); }
.cal-d em.ven { background: var(--bad-soft); color: var(--text); }
.cal-ley { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.cal-ley i { display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 3px; }
.cal-ley i:first-child { margin-left: 0; }
.c-pen { background: var(--primary-soft); border: 1px solid var(--primary); }
.c-at { background: var(--ok-soft); border: 1px solid var(--ok, #2f9e7a); }
.c-ven { background: var(--bad-soft); border: 1px solid var(--bad); }
.cita { grid-template-columns: 74px minmax(0, 1fr); padding: 12px 0; }
.cita-h b { font-size: 16px; }
.cita-n a { font-size: 15px; }
.cita-a { grid-column: 1 / -1; justify-content: flex-start; }
.cita-rep { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cita-rep input { width: 132px; }
.cita.atendida, .cita.cancelada { opacity: .75; }
@media (max-width: 1100px) { .ag-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .ag-hero { padding: 18px 16px; }
  .ag-kpis { width: 100%; }
  .ag-kpis div { flex: 1; min-width: 0; }
}

/* ============ Menú con recetas ============ */
.llenar .row-inline { flex-wrap: wrap; }
.llenar .field { max-width: 460px; margin-bottom: 12px; }
.tag.comp { background: var(--primary-soft); color: var(--primary-600); margin-left: 6px; }

/* ============ Menú lateral con su propia barra de desplazamiento ============ */
.sidebar { max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 8px; }
.sidebar::-webkit-scrollbar-track { background: var(--primary-soft); border-radius: 8px; }
@media (max-width: 900px) { .sidebar { max-height: none; overflow: visible; padding-right: 0; } }

/* ============ Restricciones del menú ============ */
.restr { margin-top: 10px; }
.restr p { margin: 6px 0; }
.restr .banner { margin: 8px 0 0; }
.restr-al { font-size: 14px; }
.tag.al { background: var(--bad); color: #fff; margin-left: 6px; }
.restr .tag.al { margin-left: 0; }
@media print { .rep-grid { grid-template-columns: repeat(5, 1fr); } }

/* ============ Suplementación ============ */
.sup-aviso { font-size: 15px; }
.sup-pl { padding: 14px 0; border-bottom: 1px solid var(--border); }
.sup-pl:last-child { border-bottom: 0; }
.sup-pl-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.sup-pl-h .btn { margin-left: auto; }
.sup-g { padding: 14px 0; border-top: 1px solid var(--border); }
.sup-g h3 { margin: 0 0 6px; font-size: 15px; }
.sup-g p { margin: 4px 0; }
.sup-ops { display: grid; gap: 8px; margin-top: 10px; }
.sup-p { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.sup-p-n { min-width: 0; }
.sup-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.sup-c { padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.sup-c .sup-p { padding: 0 0 8px; background: none; border-radius: 0; }
.sup-c p { margin: 6px 0; }
.sup-c details ul { margin: 6px 0; padding-left: 18px; }
.sup-rev { padding: 6px 8px; background: var(--warn-soft); border-radius: 8px; }
@media (max-width: 600px) { .sup-cat { grid-template-columns: minmax(0, 1fr); } }

/* Día con muchos alimentos en la impresión: se compacta para no dejar media página vacía */
@media print {
  .pm-denso .pm-lin { margin-top: 8px; }
  .pm-denso .pm-t { margin-bottom: 5px; }
  .pm-denso .pm-b { padding: 6px 11px; }
  .pm-denso .pm-b ul { line-height: 1.2; }
  .pm-denso .pm-b li { padding: 1.5px 0; }
  .pm-denso .pm-prep { margin-top: 3px; line-height: 1.25; }
  .pm-denso .pm-pie { margin-top: 3px; padding: 4px 12px; }
}

/* ============ Lista del súper impresa ============ */
@media print {
  .lista { display: block !important; columns: 2; column-gap: 18px; }
  .lista-sec { break-inside: auto !important; margin-bottom: 8px; }
  .lista-sec h3 { break-after: avoid; margin: 0 0 3px; font-size: 12px; }
  .lista-row { grid-template-columns: 12px 1fr auto; gap: 5px; padding: 2px 0; font-size: 10.5px; break-inside: avoid; }
  .lista-row .cb { width: 11px; height: 11px; border-width: 1px; border-radius: 3px; }
  .l-qty .small { font-size: 9px; font-weight: 400; }
  .l-name .dot { display: none; }
}

/* ============ Ordenar ingredientes ============ */
.fila-acc { width: auto; white-space: nowrap; }
.fila-acc .icon-btn.sw { padding: 4px 5px; font-size: 11px; }
.fila-acc .icon-btn:disabled { opacity: .25; cursor: default; background: transparent; color: var(--muted); }
.sem-tools .btn:disabled { opacity: .45; cursor: default; }

/* ============ Estudios importados ============ */
.est-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.est-datos > div { padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.est-datos span { display: block; font-size: 12px; color: var(--muted); }
.est-datos b { font-size: 15px; }
tr.dudoso td { background: var(--warn-soft); }

/* ============ Recetas propias ============ */
.nr-ing { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(90px, 1fr) minmax(130px, 1.2fr) 74px 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.nr-ing.sec { grid-template-columns: minmax(150px, 1fr) 28px; }
.nr-res { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nr-eqs { margin: 10px 0; }
@media (max-width: 760px) { .nr-ing { grid-template-columns: 1fr 1fr; } }

/* ============ Ajustes de alineación ============ */
/* Sexo: el selector ocupa el ancho de su columna y no se desborda */
.field > .seg { display: flex; max-width: 100%; }
.field > .seg label { flex: 1 1 auto; min-width: 0; padding: 6px 6px; font-size: 14px; text-align: center; white-space: nowrap; }
/* Unidades (°C, kg, …): el campo se pega abajo para que la unidad quede dentro del cuadro aunque la fila sea más alta */
.field:has(> .unit) { justify-content: flex-end; }

/* ============ Colores de la app ============ */
/* El verde aqua (los valores de :root) es el color base; los demás solo cambian la paleta */
:root { --primary-shadow: rgba(47, 158, 122, .3); }
:root[data-tema="azul"] { --primary: #2f6fd0; --primary-600: #2257a8; --primary-soft: #e3edfb; --bg: #f2f5fa; --surface-2: #f7f9fd; --border: #dee6f1; --primary-shadow: rgba(47, 111, 208, .3); }
:root[data-tema="rosa"] { --primary: #d6497f; --primary-600: #b13363; --primary-soft: #fbe6ef; --bg: #faf3f6; --surface-2: #fdf8fa; --border: #f0dfe7; --primary-shadow: rgba(214, 73, 127, .3); }
:root[data-tema="morado"] { --primary: #7a52c7; --primary-600: #5f3ca6; --primary-soft: #eee7fa; --bg: #f5f3fa; --surface-2: #faf8fd; --border: #e5dff1; --primary-shadow: rgba(122, 82, 199, .3); }
:root[data-tema="rojo"] { --primary: #d14a3c; --primary-600: #ad3528; --primary-soft: #fbe7e4; --bg: #faf4f3; --surface-2: #fdf9f8; --border: #f0e1de; --primary-shadow: rgba(209, 74, 60, .3); }
:root[data-tema="negro"] { --primary: #2e3338; --primary-600: #15181b; --primary-soft: #e9ebed; --bg: #f2f3f4; --surface-2: #f8f9fa; --border: #dfe2e6; --primary-shadow: rgba(30, 34, 38, .3); }
.nav-btn.on { box-shadow: 0 4px 14px var(--primary-shadow); }

.tema { position: relative; margin-right: auto; }
.tema-btn { display: grid; place-items: center; width: 36px; height: 36px; font-size: 18px; border: 1.5px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s; }
.tema-btn:hover { border-color: var(--primary); transform: rotate(-8deg); }
.tema-pop { position: absolute; top: 44px; left: 0; z-index: 40; display: flex; flex-direction: column; gap: 2px; min-width: 190px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(34, 48, 42, .16); }
.tema-pop[hidden] { display: none; }
.tema-t { padding: 4px 8px 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.tema-sw { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 700; color: var(--text); text-align: left; cursor: pointer; }
.tema-sw:hover { background: var(--surface-2); }
.tema-sw i { width: 18px; height: 18px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.tema-sw small { color: var(--muted); font-weight: 600; }
.tema-sw[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-600); }
.tema-sw[aria-pressed="true"]::after { content: '✓'; margin-left: auto; }

/* ============ Detalles visuales (solo pantalla) ============ */
@media screen {
  body { background: radial-gradient(1100px 420px at 0% -8%, var(--primary-soft), transparent 65%), radial-gradient(900px 380px at 100% 0%, var(--accent-soft), transparent 60%), var(--bg); background-attachment: fixed; }
  ::selection { background: var(--primary-soft); color: var(--primary-600); }
  .brand .logo { background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); box-shadow: inset 0 0 0 1px var(--border); }
  .page-head h1::after { content: ''; display: block; width: 52px; height: 4px; margin-top: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
  .card { transition: box-shadow .2s, border-color .2s; }
  .card:hover { box-shadow: 0 1px 2px rgba(34, 48, 42, .05), 0 8px 24px rgba(34, 48, 42, .09); }
  .card-h h2::before { content: ''; display: inline-block; vertical-align: -3px; width: 6px; height: 18px; margin-right: 9px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--primary-600)); }
  .nav-btn { transition: background .15s, transform .15s, box-shadow .15s; }
  .nav-btn:hover:not(.on) { transform: translateX(3px); }
  .nav-btn.on { background: linear-gradient(135deg, var(--primary), var(--primary-600)); }
  .btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-600)); }
  .btn.primary:hover { box-shadow: 0 4px 12px var(--primary-shadow); transform: translateY(-1px); }
  .seg label { transition: background .15s, color .15s; }
  .get-hero .big, .rep-get b { letter-spacing: -.5px; }
  * { scrollbar-color: var(--primary-soft) transparent; }
}

/* ============ Formas de suplementos ============ */
.tag.forma { background: var(--primary-soft); color: var(--primary-600); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.sup-forma { padding: 6px 10px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.forma-esta { font-weight: 700; color: var(--primary-600); }

/* ============ Más colores de la app ============ */
:root[data-tema="turquesa"] { --primary: #0e8a9e; --primary-600: #0b6c7b; --primary-soft: #e0f0f2; --bg: #eaf2f1; --surface-2: #f7fbfc; --border: #cededf; --primary-shadow: rgba(14, 138, 158, .3); }
:root[data-tema="celeste"] { --primary: #1f84bd; --primary-600: #186793; --primary-soft: #e2eff6; --bg: #ebf1f2; --surface-2: #f7fbfd; --border: #d0dee3; --primary-shadow: rgba(31, 132, 189, .3); }
:root[data-tema="indigo"] { --primary: #4a4fc2; --primary-600: #3a3e97; --primary-soft: #e7e8f7; --bg: #edeff2; --surface-2: #f9f9fd; --border: #d5d7e3; --primary-shadow: rgba(74, 79, 194, .3); }
:root[data-tema="lavanda"] { --primary: #8466c9; --primary-600: #67509d; --primary-soft: #efebf8; --bg: #f0f0f3; --surface-2: #fbfafd; --border: #dcdae4; --primary-shadow: rgba(132, 102, 201, .3); }
:root[data-tema="rosamex"] { --primary: #c8106f; --primary-600: #9c0c57; --primary-soft: #f8e0ec; --bg: #f4ebee; --surface-2: #fdf7fa; --border: #e4d0d9; --primary-shadow: rgba(200, 16, 111, .3); }
:root[data-tema="coral"] { --primary: #d4564b; --primary-600: #a5433b; --primary-soft: #f9e9e8; --bg: #f4efed; --surface-2: #fdf9f9; --border: #e6d8d5; --primary-shadow: rgba(212, 86, 75, .3); }
:root[data-tema="naranja"] { --primary: #c45a16; --primary-600: #994611; --primary-soft: #f7eae1; --bg: #f4efea; --surface-2: #fdf9f7; --border: #e4d9cf; --primary-shadow: rgba(196, 90, 22, .3); }
:root[data-tema="mostaza"] { --primary: #9c7210; --primary-600: #7a590c; --primary-soft: #f2ede0; --bg: #f2f0ea; --surface-2: #fcfaf7; --border: #dfdcce; --primary-shadow: rgba(156, 114, 16, .3); }
:root[data-tema="oliva"] { --primary: #66791d; --primary-600: #505e17; --primary-soft: #ebeee2; --bg: #eff1ea; --surface-2: #fafaf7; --border: #d8dcd0; --primary-shadow: rgba(102, 121, 29, .3); }
:root[data-tema="bosque"] { --primary: #2e7448; --primary-600: #245a38; --primary-soft: #e4ede7; --bg: #ecf0ec; --surface-2: #f8faf9; --border: #d2dcd5; --primary-shadow: rgba(46, 116, 72, .3); }
:root[data-tema="cafe"] { --primary: #86573a; --primary-600: #69442d; --primary-soft: #efe9e5; --bg: #f0efec; --surface-2: #fbf9f8; --border: #dcd8d3; --primary-shadow: rgba(134, 87, 58, .3); }
:root[data-tema="vino"] { --primary: #8c2846; --primary-600: #6d1f37; --primary-soft: #f0e3e7; --bg: #f1edec; --surface-2: #fbf7f9; --border: #ddd3d5; --primary-shadow: rgba(140, 40, 70, .3); }
:root[data-tema="pizarra"] { --primary: #4f5d6b; --primary-600: #3e4953; --primary-soft: #e8eaec; --bg: #eeefee; --surface-2: #f9f9fa; --border: #d6d9d9; --primary-shadow: rgba(79, 93, 107, .3); }
:root[data-tema="esmeralda"] { --primary: #0e845b; --primary-600: #0b6747; --primary-soft: #e2f0eb; --bg: #e3ece7; --surface-2: #f8fbfa; --border: #c4d8d1; --primary-shadow: rgba(14, 132, 91, .3); }
:root[data-tema="jade"] { --primary: #12806e; --primary-600: #0e6456; --primary-soft: #e3f0ee; --bg: #e3ece9; --surface-2: #f8fbfb; --border: #c5d8d3; --primary-shadow: rgba(18, 128, 110, .3); }
:root[data-tema="petroleo"] { --primary: #1d6b78; --primary-600: #17535e; --primary-soft: #e4edef; --bg: #e4eae9; --surface-2: #f8fbfb; --border: #c6d5d5; --primary-shadow: rgba(29, 107, 120, .3); }
:root[data-tema="cian"] { --primary: #0a7a9c; --primary-600: #075f7a; --primary-soft: #e2eff3; --bg: #e3ebec; --surface-2: #f8fbfc; --border: #c4d7da; --primary-shadow: rgba(10, 122, 156, .3); }
:root[data-tema="cielo"] { --primary: #2a78c2; --primary-600: #215e97; --primary-soft: #e5eff8; --bg: #e5ebef; --surface-2: #f9fbfd; --border: #c8d7df; --primary-shadow: rgba(42, 120, 194, .3); }
:root[data-tema="marino"] { --primary: #1f3f7a; --primary-600: #18315f; --primary-soft: #e4e8ef; --bg: #e4e7ea; --surface-2: #f8f9fb; --border: #c7cfd5; --primary-shadow: rgba(31, 63, 122, .3); }
:root[data-tema="zafiro"] { --primary: #2348b0; --primary-600: #1b3889; --primary-soft: #e5e9f6; --bg: #e4e8ed; --surface-2: #f8fafd; --border: #c7d0dd; --primary-shadow: rgba(35, 72, 176, .3); }
:root[data-tema="medianoche"] { --primary: #2b2f5e; --primary-600: #222549; --primary-soft: #e6e6ec; --bg: #e5e6e8; --surface-2: #f9f9fa; --border: #c8ccd1; --primary-shadow: rgba(43, 47, 94, .3); }
:root[data-tema="violeta"] { --primary: #6a3fb5; --primary-600: #53318d; --primary-soft: #ede8f6; --bg: #e9e7ee; --surface-2: #fbf9fd; --border: #d1cfdd; --primary-shadow: rgba(106, 63, 181, .3); }
:root[data-tema="uva"] { --primary: #5b2b82; --primary-600: #472265; --primary-soft: #ebe6f0; --bg: #e8e6ea; --surface-2: #faf9fb; --border: #cfccd6; --primary-shadow: rgba(91, 43, 130, .3); }
:root[data-tema="orquidea"] { --primary: #9c3a9a; --primary-600: #7a2d78; --primary-soft: #f3e7f3; --bg: #ede7ec; --surface-2: #fcf9fc; --border: #d8ceda; --primary-shadow: rgba(156, 58, 154, .3); }
:root[data-tema="fucsia"] { --primary: #b5197d; --primary-600: #8d1462; --primary-soft: #f6e3ef; --bg: #efe5ea; --surface-2: #fdf8fb; --border: #dcc9d6; --primary-shadow: rgba(181, 25, 125, .3); }
:root[data-tema="frambuesa"] { --primary: #b8234f; --primary-600: #901b3e; --primary-soft: #f6e5ea; --bg: #efe5e7; --surface-2: #fdf8fa; --border: #dccbcf; --primary-shadow: rgba(184, 35, 79, .3); }
:root[data-tema="cereza"] { --primary: #a3162f; --primary-600: #7f1125; --primary-soft: #f4e3e6; --bg: #ede4e4; --surface-2: #fcf8f9; --border: #d9c9cb; --primary-shadow: rgba(163, 22, 47, .3); }
:root[data-tema="terracota"] { --primary: #b4532e; --primary-600: #8c4124; --primary-soft: #f6eae6; --bg: #efe9e4; --surface-2: #fdfaf9; --border: #dcd1cb; --primary-shadow: rgba(180, 83, 46, .3); }
:root[data-tema="durazno"] { --primary: #b15835; --primary-600: #8a452a; --primary-soft: #f6ebe7; --bg: #eee9e5; --surface-2: #fdfaf9; --border: #dbd2cc; --primary-shadow: rgba(177, 88, 53, .3); }
:root[data-tema="ambar"] { --primary: #a8640a; --primary-600: #834e08; --primary-soft: #f5ece2; --bg: #eeeae2; --surface-2: #fcfaf8; --border: #dad4c5; --primary-shadow: rgba(168, 100, 10, .3); }
:root[data-tema="dorado"] { --primary: #8d6a0c; --primary-600: #6e5309; --primary-soft: #f1ede2; --bg: #eceae2; --surface-2: #fcfbf8; --border: #d6d5c6; --primary-shadow: rgba(141, 106, 12, .3); }
:root[data-tema="pistacho"] { --primary: #557a1f; --primary-600: #425f18; --primary-soft: #ebefe4; --bg: #e8ebe3; --surface-2: #fafbf8; --border: #ced7c8; --primary-shadow: rgba(85, 122, 31, .3); }
:root[data-tema="salvia"] { --primary: #4f7259; --primary-600: #3e5945; --primary-soft: #eaeeeb; --bg: #e8ebe7; --surface-2: #fafbfa; --border: #cdd6d1; --primary-shadow: rgba(79, 114, 89, .3); }
:root[data-tema="chocolate"] { --primary: #5e3a24; --primary-600: #492d1c; --primary-soft: #ece7e5; --bg: #e9e7e4; --surface-2: #faf9f8; --border: #d0cec9; --primary-shadow: rgba(94, 58, 36, .3); }
:root[data-tema="arena"] { --primary: #80694a; --primary-600: #64523a; --primary-soft: #f0ede9; --bg: #ebeae6; --surface-2: #fbfbfa; --border: #d4d4ce; --primary-shadow: rgba(128, 105, 74, .3); }
:root[data-tema="grafito"] { --primary: #3f454c; --primary-600: #31363b; --primary-soft: #e8e9ea; --bg: #e6e8e6; --surface-2: #f9f9fa; --border: #cbcfcf; --primary-shadow: rgba(63, 69, 76, .3); }
.tema-pop { display: grid; grid-template-columns: 1fr 1fr; min-width: 330px; }
.tema-pop .tema-t { grid-column: 1 / -1; }
.tema-pop { min-width: 360px; }
.tema-sw { white-space: nowrap; }
.tema-sw i { flex: none; }

/* ============ Prioridad, medicamentos y enlaces de laboratorio ============ */
.prio { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.prio-c { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.prio-c span { display: block; font-size: 12px; font-weight: 800; color: var(--muted); }
.prio-c b { display: block; margin: 2px 0; font-size: 15px; }
.prio-c small { color: var(--muted); }
.prio-c.prim { background: var(--primary-soft); border-color: transparent; }
.prio-c.prim span, .prio-c.prim b { color: var(--primary-600); }
.prio-c.sec { background: var(--warn-soft); border-color: transparent; }
.prio-ul { margin: 12px 0 0; padding-left: 18px; }
.prio-ul li { margin: 4px 0; font-size: 13.5px; }
.prio-linea { margin: 6px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--primary-soft); }
.med-i { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.med-i:last-child { border-bottom: 0; }
.med-i ul { margin: 6px 0; padding-left: 18px; font-size: 13.5px; }
.restr-prio { padding: 6px 10px; border-radius: 8px; background: var(--primary-soft); }
.bq-enlace { color: var(--primary-600); }

/* ============ Agua del menú y preparación editable ============ */
.agua-dia { display: grid; gap: 8px; }
.agua-dia > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.agua-dia span { font-size: 13px; color: var(--muted); }
.agua-dia .hl { background: var(--primary-soft); }
.agua-dia .hl b { color: var(--primary-600); font-size: 17px; }
.agua-dia em { width: 100%; font-size: 12px; color: var(--muted); font-style: normal; }
.prep-ed { margin-top: 10px; display: grid; gap: 6px; }
.prep-ed details { padding: 8px 10px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); }
.prep-ed summary { cursor: pointer; font-size: 13.5px; }
.prep-ed textarea { width: 100%; margin: 8px 0 6px; font: inherit; font-size: 13.5px; }

/* Gasto semanal, suplementos propios y plan del lactante */
.gasto-res { margin-top: 4px; }
.agua-dia .warn-t b { color: var(--warn, #c77700); }
.sup-mio { display: flex; align-items: flex-start; gap: 8px; }
.sup-mio > .sup-p { flex: 1; }
.lac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.lac-stats .stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.lac-stats .stat span { font-size: 12px; color: var(--muted); }
.lac-stats .stat b { font-size: 18px; }
.lac-stats .stat em { font-size: 12px; font-style: normal; color: var(--muted); }
.lac-tbl td:first-child { width: 70px; }
.lac-tbl tr.lac-com td, .lac-tbl tr.lac-col td { background: var(--primary-soft); }
.lac-guia { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.lac-guia h4 { margin: 0 0 4px; }
.lac-guia ul { margin: 0; padding-left: 18px; font-size: 13px; }
.edad-ped { grid-column: 1 / -1; }
.ac-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ac-tiempo .row-inline { flex-wrap: wrap; gap: 6px; }
.ac-ings .ac-nrow { display: flex; align-items: center; gap: 6px; }
.ac-ings input.ac-in-n { flex: 1; min-width: 0; width: 100%; font-weight: 600; }
.ac-ings input.ac-in-q { flex: 1; min-width: 0; width: 100%; }
.ac-ings { table-layout: fixed; width: 100%; }
.ac-ings col.c-mv { width: 50px; }
.ac-ings col.c-eq { width: 156px; }
.ac-ings col.c-q { width: 104px; }
.ac-ings col.c-k { width: 40px; }
.ac-ings col.c-acc { width: 92px; }
.ac-ings .qty { width: 100%; }
.ac-tiempo .ac-rec { margin-bottom: 8px; }
.ac-tiempo .ac-badges { margin-bottom: 10px; }
.ac-tiempo .ac-mic { margin: 6px 0 0; }
.ac-tiempo .gchip { cursor: default; }
.ac-ings tr.ac-sub-on td { background: var(--primary-soft); }
.ac-ings tr.del td { opacity: .6; }
.ac-tiempo details { margin-top: 8px; }
.ac-tiempo textarea { width: 100%; }
.ac-ing { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.ac-ing .dot { display: inline-block; vertical-align: middle; }
.ac-nuevo { color: var(--primary-600); font-weight: 700; }
.ac-dias { flex-wrap: wrap; gap: 6px; }
.ac-sem td { vertical-align: top; min-width: 110px; }
.ac-imp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.edad-am { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.edad-box { display: flex; align-items: center; gap: 8px; }
.edad-box input { width: 90px; text-align: center; font-size: 16px; }
.edad-box .unit { position: static; font-size: 14px; color: var(--text); font-weight: 600; }
.edad-txt { font-size: 13px; color: var(--muted); }
.gasto-camb ul { margin: 6px 0; padding-left: 18px; }
.form-ficha { margin: 4px 0 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }

/* ============ Menú infantil: ordenar ingredientes ============ */
.ac-ings td.ac-mv { width: 46px; padding-right: 0; white-space: nowrap; }
.ac-drag { display: inline-block; padding: 2px 3px; margin-right: 2px; color: var(--muted); font-size: 16px; line-height: 1; cursor: grab; user-select: none; border-radius: 4px; }
.ac-drag:hover { background: var(--primary-soft); color: var(--primary-600); }
.ac-drag:active { cursor: grabbing; }
.ac-chk { width: 15px; height: 15px; vertical-align: middle; accent-color: var(--primary); cursor: pointer; }
.ac-ings tr.ac-sel-on td { background: var(--primary-soft); }
.ac-ings tr.ac-arr td { opacity: .45; }
.ac-ings tr.ac-drop-a td { box-shadow: inset 0 3px 0 var(--primary); }
.ac-ings tr.ac-drop-d td { box-shadow: inset 0 -3px 0 var(--primary); }
.ac-ord { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: 13px; }

/* ============ Hoja del lactante (impresión y resumen) ============ */
.pp { color: var(--text); }
.pp-band { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 16px 20px; border-radius: 14px; color: #fff; background: linear-gradient(120deg, var(--primary-600), var(--primary)); }
.pp-band span { font-size: 11px; font-weight: 700; letter-spacing: .04em; opacity: .9; }
.pp-band h2 { margin: 2px 0; padding: 0; border: 0; font-size: 30px; line-height: 1.05; color: #fff; }
.pp-band p { margin: 0; font-size: 12.5px; opacity: .92; }
.pp-band dl { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.pp-band dl > div { min-width: 92px; padding: 7px 11px; border-radius: 10px; background: rgba(255, 255, 255, .17); }
.pp-band dt { font-size: 10px; opacity: .9; }
.pp-band dd { margin: 0; font-size: 18px; font-weight: 800; white-space: nowrap; }
.pp-band dd small { font-size: 10.5px; font-weight: 600; }
.pp-band em { display: block; font-size: 10px; font-style: normal; opacity: .9; }
.pp-sec { margin-top: 16px; }
.pp-h { display: flex; align-items: baseline; gap: 6px; margin: 0 0 9px; padding: 0; border: 0; font-size: 16px; font-weight: 800; color: var(--primary-600); }
.pp-h small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pp-lin { position: relative; }
.pp-lin::before { content: ""; position: absolute; left: 75px; top: 14px; bottom: 14px; width: 2px; background: var(--border); }
.pp-t { position: relative; display: grid; grid-template-columns: 50px 36px minmax(0, 1fr); gap: 8px; margin-bottom: 6px; align-items: center; break-inside: avoid; }
.pp-hora { font-size: 14px; font-weight: 800; text-align: right; }
.pp-ic { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2.5px solid var(--c); font-size: 16px; }
.pp-t > div { padding: 6px 12px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--c); }
.pp-t strong { font-size: 13px; color: var(--c); }
.pp-t p { margin: 1px 0 0; font-size: 12.5px; line-height: 1.3; }
.pp-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.pp-tips > div, .pp-nota { padding: 8px 12px; border-radius: 10px; background: var(--primary-soft); break-inside: avoid; }
.pp-tips b, .pp-nota b { font-size: 12.5px; color: var(--primary-600); }
.pp-tips p, .pp-nota p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.35; }
.pp-nota { margin-top: 8px; background: var(--accent-soft); }
.pp-nota b { color: #a8532c; }
.pp-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-size: 11px; line-height: 1.3; }
.pp-grid thead th { padding: 6px; border-radius: 6px; background: var(--primary-600); color: #fff; font-size: 11.5px; text-align: center; }
.pp-grid tbody th { width: 92px; padding: 6px 7px; border-radius: 6px; background: var(--surface-2); border-left: 4px solid var(--c); font-size: 11.5px; text-align: left; vertical-align: middle; }
.pp-grid tbody th span { display: block; font-size: 16px; }
.pp-grid tbody td { padding: 6px; border-radius: 6px; background: var(--surface-2); vertical-align: top; overflow-wrap: anywhere; }
.pp-grid tbody td b { font-weight: 700; }
.pp-grid tbody td small { color: var(--muted); }
.pp-grid tbody td em { display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 99px; background: var(--accent-soft); color: #a8532c; font-size: 10px; font-style: normal; font-weight: 700; }
.pp-grid tfoot th, .pp-grid tfoot td { padding: 5px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-600); font-weight: 800; text-align: center; font-size: 11px; }
.pp-ley { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.pp-recs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pp-rec { padding: 10px 13px; border-radius: 12px; background: var(--surface-2); border-top: 3px solid var(--primary); break-inside: avoid; }
.pp-rec header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pp-rec h4 { margin: 0; font-size: 13.5px; font-weight: 800; }
.pp-rec header span { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); }
.pp-dias { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.pp-dias i { padding: 0 6px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-600); font-size: 10px; font-style: normal; font-weight: 700; }
.pp-dias i.aj { background: var(--accent-soft); color: #a8532c; }
.pp-rec ul { list-style: none; margin: 4px 0 0; padding: 0; font-size: 11.5px; }
.pp-rec li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 2px 0; border-bottom: 1px dotted var(--border); }
.pp-rec li i { width: 7px; height: 7px; border-radius: 50%; }
.pp-rec li b { font-weight: 700; text-align: right; }
.pp-prep { margin: 6px 0 0; font-size: 11.5px; line-height: 1.4; }
.pp-tip { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.pp-guias .lac-guia { gap: 10px; }
.pp-guias .lac-guia > div { padding: 10px 13px; border-radius: 12px; background: var(--surface-2); border-top: 3px solid var(--primary); break-inside: avoid; }
.pp-guias .lac-guia:last-child > div:nth-child(2) { background: var(--bad-soft); border-top-color: var(--bad); }
.pp-guias .lac-guia h4 { color: var(--primary-600); }
.pp-guias .lac-guia:last-child > div:nth-child(2) h4 { color: var(--bad); }
.pp-guias .lac-guia ul { font-size: 12px; }
.pp-guias .lac-guia + .lac-guia { margin-top: 10px; }
@media (max-width: 700px) { .pp-recs { grid-template-columns: minmax(0, 1fr); } }

/* Resumen del pediátrico */
.rep-ped .rep-h { align-items: center; padding: 18px 22px; border-radius: 14px; color: #fff; background: linear-gradient(120deg, var(--primary-600), var(--primary)); }
.rep-ped .rep-h h1 { color: #fff; }
.rep-ped .rep-h .muted { color: rgba(255, 255, 255, .9); }
.rep-ped .rep-logo { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .18); color: #fff; }
.rep-ped .rep-grid div { border-top: 3px solid var(--primary); }
.rep-ped > h2 { display: flex; align-items: center; gap: 8px; border-bottom: 0; }
.rep-ped > h2::before { content: ""; width: 5px; height: 18px; border-radius: 3px; background: var(--primary); }
.rep-ped > h3 { color: var(--primary-600); }
.rep-ped .tbl.compact thead th { background: var(--primary-soft); color: var(--primary-600); }

@media print {
  .pp-semana { break-before: page; }
  .pp-semana .pp-grid { font-size: 9.5px; border-spacing: 2px; }
  .pp-semana .pp-grid thead th { font-size: 10px; padding: 5px 3px; }
  .pp-semana .pp-grid tbody th { width: 62px; padding: 5px; font-size: 10px; }
  .pp-semana .pp-grid tbody td { padding: 5px 4px; }
  .pp-semana .pp-grid tbody td em { font-size: 8.5px; padding: 1px 4px; }
  .pp-semana .pp-grid tfoot td, .pp-semana .pp-grid tfoot th { font-size: 9.5px; padding: 4px 2px; }
  .pp-semana + .pp-recs-sec { break-before: page; }
  .pp-guias { break-before: page; }
  .pp-h { break-after: avoid; }
  .pp-band, .pp-grid, .pp-tips { break-inside: avoid; }
  .pp-recs { display: block; columns: 2; column-gap: 10px; }
  .pp-rec { margin-bottom: 10px; }
  .rep-ped .rep-h { margin-bottom: 14px; }
}

/* ============ Hoja del lactante: una hoja por día ============ */
.pp-semana .pp-band { margin-bottom: 12px; }
.pp-diap .pp-band { margin-bottom: 12px; }
.pp-dlin { position: relative; }
.pp-dlin::before { content: ""; position: absolute; left: 75px; top: 14px; bottom: 14px; width: 2px; background: var(--border); }
.pp-dt { position: relative; display: grid; grid-template-columns: 50px 36px minmax(0, 1fr); gap: 8px; margin-bottom: 6px; break-inside: avoid; }
.pp-dl { align-items: center; }
.pp-dc { align-items: start; }
.pp-dc .pp-hora { padding-top: 9px; }
.pp-dl > div { padding: 4px 12px; border-radius: 8px; font-size: 12px; background: var(--surface-2); border-left: 3px solid var(--c); }
.pp-dl strong { color: var(--c); font-size: 12px; }
.pp-db { padding: 8px 13px; border-radius: 11px; background: var(--surface-2); border-top: 3px solid var(--c); }
.pp-dh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pp-dh h3 { margin: 0; padding: 0; border: 0; font-size: 14.5px; font-weight: 800; color: var(--c); }
.pp-dh span { font-size: 11px; font-weight: 700; color: var(--muted); }
.pp-plat { margin: 1px 0 4px; font-size: 13px; font-weight: 700; }
.pp-plat small { font-weight: 600; color: var(--muted); }
.pp-db ul { list-style: none; margin: 2px 0 0; padding: 0; columns: 2; column-gap: 18px; font-size: 11.5px; line-height: 1.3; }
.pp-db li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 2px 0; border-bottom: 1px dotted var(--border); break-inside: avoid; }
.pp-db li i { width: 7px; height: 7px; border-radius: 50%; }
.pp-db li b { font-weight: 700; text-align: right; }
.pp-db .pp-prep { margin-top: 5px; }
.pp-pie { margin-top: 8px; padding: 6px 12px; border-radius: 8px; background: var(--primary-soft); font-size: 11.5px; text-align: center; }
@media print {
  .pp-diap { break-before: page; }
  .pp-diap .pp-band { padding: 11px 16px; margin-bottom: 9px; }
  .pp-diap .pp-band h2 { font-size: 26px; }
  .pp-diap .pp-band dl > div { padding: 5px 9px; }
  .pp-diap .pp-band dd { font-size: 16px; }
  .pp-diap .pp-dt { margin-bottom: 4px; }
  .pp-diap .pp-dl > div { padding: 3px 11px; }
  .pp-diap .pp-db { padding: 6px 11px; }
  .pp-diap .pp-db li { padding: 1.5px 0; }
  .pp-diap .pp-db .pp-prep { margin-top: 3px; line-height: 1.3; }
  .pp-diap .pp-pie { margin-top: 4px; padding: 4px 12px; break-before: avoid; }
  .pp-semana .pp-band { break-inside: avoid; }
}

/* ============ Curvas de percentiles ============ */
.pc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; }
.pc-top .seg { margin: 0; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 6px; }
.pc-card { padding: 10px 12px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pc-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.pc-h h4 { margin: 0; font-size: 15px; }
.pc-h span { font-size: 13px; color: var(--muted); }
.pc-h b { color: var(--text); }
.pc-na { padding: 28px 8px; text-align: center; }
.pc-svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.pc-g { stroke: var(--border); stroke-width: 1; }
.pc-g.v { stroke-dasharray: 2 3; }
.pc-t { fill: var(--muted); font-size: 10.5px; }
.pc-eje { font-size: 11px; font-weight: 700; }
.pc-c { fill: none; stroke-linejoin: round; }
.pc-c.pc-50 { stroke: var(--primary); stroke-width: 2.2; }
.pc-c.pc-mid { stroke: #8a9a92; stroke-width: 1.2; }
.pc-c.pc-ext { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 5 3; }
.pc-l { font-size: 10px; font-weight: 700; fill: var(--muted); }
.pc-l.pc-50 { fill: var(--primary-600); }
.pc-pl { fill: none; stroke: var(--text); stroke-width: 1.6; }
.pc-pt circle { fill: var(--text); stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.pc-pt.on circle { fill: var(--accent); }
.pc-pt:hover circle { stroke: var(--accent); stroke-width: 3; }
.pc-ley { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 10px 0 0; color: var(--muted); }
.pc-k { display: inline-block; width: 18px; height: 0; margin-left: 8px; border-top: 2px solid; vertical-align: middle; }
.pc-k:first-child { margin-left: 0; }
.pc-k.k50 { border-color: var(--primary); border-top-width: 3px; }
.pc-k.kmid { border-color: #8a9a92; }
.pc-k.kext { border-color: var(--bad); border-top-style: dashed; }
.pc-k.kpt { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--accent); }
.pc-tbl tr.sel td { background: var(--primary-soft); font-weight: 700; }
@media print { .pc-card { break-inside: avoid; } }

/* ============ Menú semanal del adulto: ordenar alimentos ============ */
.sem-ings td.sem-mv { width: 46px; padding-right: 0; white-space: nowrap; }
.sem-drag { display: inline-block; padding: 2px 3px; margin-right: 2px; color: var(--muted); font-size: 16px; line-height: 1; cursor: grab; user-select: none; border-radius: 4px; }
.sem-drag:hover { background: var(--primary-soft); color: var(--primary-600); }
.sem-drag:active { cursor: grabbing; }
.sem-chk { width: 15px; height: 15px; vertical-align: middle; accent-color: var(--primary); cursor: pointer; }
.sem-ings tr.sem-sel-on td { background: var(--primary-soft); }
.sem-ings tr.sem-arr td { opacity: .45; }
.sem-ings tr.sem-drop-a td { box-shadow: inset 0 3px 0 var(--primary); }
.sem-ings tr.sem-drop-d td { box-shadow: inset 0 -3px 0 var(--primary); }
.sem-ord { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: 13px; }

/* ============ Resumen: encabezado, datos, requerimiento y equivalentes ============ */
.report .rep-h { align-items: center; padding: 18px 22px; border-radius: 14px; color: #fff; background: linear-gradient(120deg, var(--primary-600), var(--primary)); }
.report .rep-h h1 { color: #fff; }
.report .rep-h .muted { color: rgba(255, 255, 255, .9); }
.report .rep-logo { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .18); color: #fff; }
.report > h2 { display: flex; align-items: center; gap: 8px; border-bottom: 0; }
.report > h2::before { content: ""; width: 5px; height: 18px; border-radius: 3px; background: var(--primary); }
.report .rep-grid { gap: 10px; }
.report .rep-grid div { position: relative; padding: 10px 12px 10px 46px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid var(--primary); }
.report .rep-grid i { position: absolute; left: 10px; top: 11px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); font-size: 15px; font-style: normal; }
.report .rep-grid b { font-size: 17px; }
.report .rep-grid em.badge { display: inline-block; margin-top: 3px; font-size: 10.5px; }
.rep-conds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; }
.rep-conds b { margin-right: 4px; font-size: 13px; color: var(--primary-600); }
.rep-conds span { padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: #a8532c; font-size: 12.5px; font-weight: 700; }
.rep-antro { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.rep-fig { padding: 6px; border-radius: 12px; background: var(--surface); }
.rep-comp tr td { padding: 7px 8px; }
.rep-comp tr:nth-child(odd) td { background: var(--surface); }
.rep-comp td:first-child { font-weight: 700; color: var(--primary-600); }
.rep-req { grid-template-columns: 210px 1fr; gap: 18px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.rep-req .rep-get { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px; background: none; }
.rep-req .rep-get > span { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary-600); }
.rep-req .donut { width: 170px; height: 170px; }
.rep-req .donut-hole { width: 112px; height: 112px; }
.rep-req .donut-hole b { font-size: 26px; color: var(--primary-600); }
.rep-mac { display: grid; gap: 10px; }
.rep-m { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border-left: 5px solid var(--c); }
.rep-m > span { font-weight: 800; font-size: 14px; }
.rep-m > b { grid-row: span 2; align-self: center; font-size: 22px; color: var(--text); }
.rep-m > b small { font-size: 12px; color: var(--muted); }
.rep-m > em { font-style: normal; font-size: 12px; color: var(--muted); }
.rep-bar { grid-column: 1 / -1; display: block; height: 7px; margin-top: 4px; border-radius: 99px; background: var(--border); overflow: hidden; }
.rep-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.rep-eq { border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rep-eq thead th { background: var(--primary-600); color: #fff; font-size: 12px; }
.rep-eq tbody tr:nth-child(even) td { background: var(--surface-2); }
.rep-eq td { padding: 6px 8px; }
.rep-eq td:first-child { font-weight: 700; }
.rep-eq .eqv { display: inline-block; min-width: 30px; padding: 1px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-600); font-weight: 700; text-align: center; }
.rep-eq .eqt { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 99px; background: var(--primary); color: #fff; text-align: center; }
@media (max-width: 700px) { .rep-req { grid-template-columns: 1fr; } }
@media print {
  .rep-req, .rep-eq, .rep-grid, .rep-conds { break-inside: avoid; }
  .report .rep-grid { grid-template-columns: repeat(5, 1fr); }
  .report .rep-grid div { padding-left: 42px; }
}
.rep-dona { display: block; width: 170px; height: 170px; }
.rep-dona-v { font-size: 22px; font-weight: 800; fill: var(--primary-600); font-family: var(--font); }
.rep-dona-u { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.report .pp { margin-top: 18px; }
.bq-reftag { margin-top: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; }
.bq-reftag.ped { color: var(--primary-600); }

/* Menú impreso del adulto un poco más compacto: mismo diseño, menos hojas */
@media print {
  .pm-grid { font-size: 10px; line-height: 1.25; }
  .pm-grid tbody td, .pm-grid tbody th { padding: 5px 6px; }
  .pm-dia .pm-band { padding: 10px 16px; }
  .pm-dia .pm-band h2 { font-size: 26px; }
  .pm-dia .pm-band dd { font-size: 16px; }
  .pm-dia .pm-lin { margin-top: 9px; }
  .pm-dia .pm-lin::before { left: 17px; }
  .pm-dia .pm-t { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; margin-bottom: 6px; }
  .pm-dia .pm-ic span { width: 36px; height: 36px; font-size: 16px; border-width: 2px; }
  .pm-dia .pm-b { padding: 7px 11px; }
  .pm-dia .pm-th h3 { font-size: 13.5px; }
  .pm-dia .pm-plat { margin: 0 0 3px; font-size: 12px; }
  .pm-dia .pm-b ul { font-size: 10.3px; line-height: 1.22; }
  .pm-dia .pm-b li { padding: 1.6px 0; }
  .pm-dia .pm-prep { margin-top: 4px; font-size: 9.8px; line-height: 1.3; }
  .pm-dia .pm-pie { margin-top: 4px; padding: 5px 12px; font-size: 11px; break-before: avoid; }
  .pm-denso .pm-t { margin-bottom: 4px; }
  .pm-denso .pm-b { padding: 5px 10px; }
  .pm-denso .pm-b ul { line-height: 1.15; }
  .pm-denso .pm-b li { padding: 1px 0; }
}

/* ============ Cuentas en la nube ============ */
body.nube-fuera .topbar, body.nube-fuera .layout { display: none; }
#nube:empty { display: none; }
#nube { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--primary-soft), var(--bg) 60%); }
.nube-caja { width: 100%; max-width: 420px; padding: 28px 26px; border-radius: 20px; background: var(--surface); box-shadow: 0 12px 40px rgba(34, 48, 42, .12); }
.nube-caja h1 { margin: 14px 0 14px; font-size: 22px; }
.nube-caja form { display: grid; gap: 12px; }
.nube-caja .field input { width: 100%; }
.nube-logo { display: flex; align-items: baseline; gap: 8px; font-size: 22px; }
.nube-logo b { color: var(--primary-600); }
.nube-logo span { font-size: 12.5px; color: var(--muted); }
.nube-btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.nube-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; font-size: 13.5px; }
.nube-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; }
.nube-check input { margin-top: 2px; accent-color: var(--primary); }
.nube-carga { text-align: center; }
.nube-plan { width: 100%; max-width: 980px; align-self: start; }
.nube-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.nube-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.nube-stats .stat.ok { border-top: 3px solid var(--ok); }
.nube-stats .stat.warn { border-top: 3px solid var(--warn); }
.nube-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.nube-opcion { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2); }
.nube-opcion.on { border-color: var(--primary); background: var(--primary-soft); }
.nube-opcion b { font-size: 16px; }
.nube-precio { font-size: 24px; font-weight: 800; color: var(--primary-600); }
.nube-precio small { font-size: 12px; color: var(--muted); font-weight: 600; }
.nube-total { font-size: 22px; color: var(--primary-600); }
.nube-banco { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.nube-banco div { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.nube-banco span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.nube-banco b { word-break: break-all; }
.nube-acc { white-space: nowrap; }
.nube-acc .btn { margin: 2px 2px 2px 0; }
.nube-filtros { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.nube-filtros input { flex: 1 1 220px; }
.cuenta-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; }
.cuenta-mail { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
@media (max-width: 900px) { .cuenta-bar { width: 100%; margin-left: 0; flex-wrap: wrap; } }
@media print { .cuenta-bar, #nube { display: none !important; } }
/* Campos de las pantallas de cuenta con el mismo estilo que el resto de la app */
input[type=email], input[type=password], input[id^="n_"]:not([type]), input[inputmode][id^="n_"] {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=file][id^="n_"] { width: 100%; padding: 8px; font: inherit; font-size: 13px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }

/* Logotipo: nutria con bata clínica */
.brand .logo { overflow: hidden; padding: 0; background: none !important; box-shadow: none !important; }
.logo-img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.nube-logo { align-items: center; }
.nube-logo .logo-img { width: 42px; height: 42px; border-radius: 12px; align-self: center; }
.rep-logo { display: inline-flex; align-items: center; gap: 8px; }
.rep-logo .logo-img { width: 28px; height: 28px; border-radius: 8px; }
/* Logotipo de NUTRÉA (emblema con fondo transparente) */
.brand .logo { width: 46px; height: 46px; border-radius: 0; }
.logo-img { object-fit: contain; border-radius: 0; }
.nube-logo .logo-img { width: 52px; height: 52px; border-radius: 0; }
.rep-logo .logo-img { width: 34px; height: 34px; border-radius: 0; }
.rep-ped .rep-logo .logo-img, .report .rep-logo .logo-img { background: #fff; border-radius: 50%; }

/* Lista del súper: cuánto de cada carne en fajitas, aplanada, deshebrada, etc. */
.l-forma { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
@media print { .l-forma { font-size: 9px; } }

/* Verificación en dos pasos y captcha */
.nube-mfa { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.nube-mfa img { flex: none; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.nube-mfa > div { flex: 1 1 260px; }
.nube-mfa input { max-width: 180px; letter-spacing: .3em; font-size: 18px; text-align: center; }
.nube-clave { word-break: break-all; font-family: ui-monospace, monospace; }
.nube-captcha { min-height: 66px; }

/* Etapa de alimentación del paciente pediátrico */
.etapa-v { font-size: 16px; line-height: 1.25; }
.rec-ul { margin: 10px 0; padding-left: 20px; font-size: 14px; }
.rec-ul li { margin: 3px 0; }
.chip.chip-mal { border-color: var(--bad); color: var(--bad); }

/* Términos y condiciones */
.nube-caja.nube-terminos { max-width: 760px; }
.terminos-texto { max-height: 46vh; overflow-y: auto; margin: 12px 0 14px; padding: 4px 18px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); font-size: 13.5px; line-height: 1.55; }
.terminos-texto h2 { font-size: 15px; margin: 16px 0 6px; color: var(--primary-600); }
.terminos-texto ul { padding-left: 20px; margin: 6px 0; }
.terminos-texto li { margin: 3px 0; }
.nube-terminos .nube-pie { align-items: center; }

/* Seguimiento: tramos que suben o bajan, ruta de valores y planes por consulta */
.evo-tramo { stroke-width: 2; stroke-linecap: round; stroke: var(--muted); }
.evo-tramo.baja { stroke: #2f6fd0; }
.evo-tramo.sube { stroke: #d9822b; }
.evo-ley { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; margin-bottom: 10px; align-items: center; }
.evo-ley i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.evo-ley i.baja { background: #2f6fd0; }
.evo-ley i.sube { background: #d9822b; }
.evo-ruta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; margin: 4px 0 0; color: var(--muted); }
.evo-ruta b { color: var(--text); }
.evo-ruta i { font-style: normal; font-weight: 800; }
.evo-ruta i.baja, .tr-r.baja { color: #2f6fd0; }
.evo-ruta i.sube, .tr-r.sube { color: #b8691c; }
.tbl.planes td { vertical-align: top; font-size: 12.5px; min-width: 150px; }
.tbl.planes td:first-child { font-weight: 700; min-width: 140px; }
.tbl.planes td.plan-cambio { background: var(--warn-soft); }
.tramos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tramos li { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.tramos p { margin: 4px 0; font-size: 13.5px; }
.tr-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tr-l { font-weight: 700; color: var(--muted); font-size: 12.5px; }
.tr-r { display: inline-block; margin-right: 8px; font-weight: 700; }

/* Requerimientos: tipo de gasto de cada fórmula y datos de la fórmula elegida */
.badge.tf { font-size: 11px; padding: 2px 8px; vertical-align: middle; }
.badge.tf-geb { background: var(--ok-soft); color: var(--primary-600); border-color: transparent; }
.badge.tf-ger { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.tf-get { background: var(--surface-2, #eef1f4); color: var(--muted); }
.metodo-info { margin-top: 10px; display: grid; gap: 6px; }
.metodo-info p { margin: 0; }
.metodo-res { margin: 12px 0 0; font-size: 15px; }
.check.off { opacity: .65; cursor: not-allowed; }
.datos-bloque + .datos-bloque { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, #e6e9ee); }
.datos-bloque h4 { margin: 0 0 8px; }

/* Alergias: alimentos específicos */
.al-esp { margin-top: 10px; }
.al-esp summary { cursor: pointer; padding: 6px 0; }
.al-esp h5 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.al-esp input[type=text] { flex: 1; min-width: 180px; }

/* Nombres o textos largos sin espacios (p. ej. nombres capturados con símbolos) no deben empujar la pantalla */
.page-head > div, .rep-h > div { min-width: 0; }
.page-head h1, .page-head p, .rep-h h1, .rep-h p, .q-name, .exp-n b, .card-h h2, .con-bar { overflow-wrap: anywhere; }
.rep-h { gap: 12px; }
.rep-logo { flex-shrink: 0; }
@media (max-width: 700px) { .page-head { flex-wrap: wrap; } .rep-h { flex-wrap: wrap; } }
.btn { max-width: 100%; }
.btn.danger-ghost { white-space: normal; overflow-wrap: anywhere; }

/* Tratamiento específico */
.opts-2 { grid-template-columns: repeat(2, 1fr); }
button.opt { text-align: left; cursor: pointer; font: inherit; display: grid; gap: 4px; }
button.opt em { font-style: normal; color: var(--muted); }
.rep-trat { margin: 6px 0 14px; padding-left: 20px; }
.rep-trat li { margin: 3px 0; }
@media (max-width: 700px) { .opts-2 { grid-template-columns: 1fr; } }

/* Beta de Tratamiento */
.badge.beta { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-size: 12px; vertical-align: middle; }
.banner.beta-b { margin-bottom: 14px; }
#view textarea#ui_com_texto { width: 100%; margin-top: 8px; }

/* Áreas de trabajo: Nutrición clínica general | Nutrición clínica especializada (β) */
.tema { margin-right: 0; }
.areas { display: flex; gap: 4px; margin-right: auto; padding: 3px; border: 1.5px solid var(--border); border-radius: 13px; background: var(--surface); }
.area-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.area-btn:hover { color: var(--text); background: var(--surface-2); }
.area-btn.gen.on { background: var(--primary); color: #fff; }
.area-btn.esp.on { background: #6d5bc4; color: #fff; }
.area-btn .badge.beta { font-size: 11px; padding: 1px 6px; margin-left: 2px; }
.area-btn.on .badge.beta { background: rgba(255, 255, 255, .25); color: #fff; }
.q-area { margin-top: 8px; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 9px; }
.q-area.gen { background: var(--primary-soft); color: var(--primary-600); }
.q-area.esp { background: #ece8fb; color: #4f3fa3; }
.q-area a { font-weight: 600; }
.banner.area-b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.banner.area-b.esp { background: #ece8fb; border-color: #d6cff5; color: #3e3285; }
.banner.area-b .btn { margin-left: auto; }
.tag.area-t { font-size: 11px; }
.tag.area-t.esp { background: #ece8fb; color: #4f3fa3; }
.tag.area-t.gen { background: var(--primary-soft); color: var(--primary-600); }
body[data-area="especializada"] .topbar { border-bottom-color: #d6cff5; }
@media (max-width: 900px) {
  .areas { margin-right: 0; width: 100%; }
  .area-btn { flex: 1 1 0; white-space: normal; line-height: 1.2; padding: 8px 6px; }
}
/* Pautas especializadas por patología */
.pauta-sn + .pauta-sn { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 10px; }
.pauta-sn h3 { margin: 0 0 6px; font-size: 15px; }

/* Barra superior más grande, nutria más grande y selector de color en cuadrícula (42 colores) */
.topbar { padding: 14px 28px; min-height: 78px; }
.brand { gap: 12px; }
.brand .logo { width: 62px; height: 62px; }
.brand b { font-size: 22px; letter-spacing: .2px; }
.brand small { font-size: 13px; }
.tema-btn { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
.area-btn { font-size: 14px; padding: 9px 14px; }
.tema-pop { top: 50px; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 520px; max-height: min(72vh, 620px); overflow-y: auto; }
@media (max-width: 900px) {
  .topbar { padding: 12px 16px; min-height: 0; }
  .brand .logo { width: 54px; height: 54px; }
  .tema-pop { grid-template-columns: 1fr 1fr; min-width: 0; width: calc(100vw - 32px); }
}
.brand small { white-space: nowrap; }
.tema-pop { min-width: 600px; }
@media (max-width: 900px) {
  .topbar { position: relative; z-index: 35; }
  .tema-pop { min-width: 0; }
}

/* ============ Resumen: tarjetas de colores (recomendaciones, suplementación, soporte y tratamiento) ============ */
.report { --r0: #2f9e7a; --r0s: #e6f5ee; --r1: #e08a3c; --r1s: #fdf0e3; --r2: #7a64c9; --r2s: #efebfa; --r3: #d4567a; --r3s: #fbe8ee; --r4: #2f86c4; --r4s: #e5f0fa; --r5: #b48a12; --r5s: #faf3dc; }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rep-rec { --c: var(--r0); --cs: var(--r0s); background: var(--cs); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); border-left: 5px solid var(--c); border-radius: 14px; padding: 12px 14px 8px; break-inside: avoid; }
.rep-rec.c1, .sup-r.c1 { --c: var(--r1); --cs: var(--r1s); } .rep-rec.c2, .sup-r.c2 { --c: var(--r2); --cs: var(--r2s); }
.rep-rec.c3, .sup-r.c3 { --c: var(--r3); --cs: var(--r3s); } .rep-rec.c4, .sup-r.c4 { --c: var(--r4); --cs: var(--r4s); }
.rep-rec.c5, .sup-r.c5 { --c: var(--r5); --cs: var(--r5s); }
.rep-rec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--c); font-size: 15px; }
.rep-rec h3 span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; font-size: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.rep-rec ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.rep-rec li { position: relative; padding: 3px 0 3px 22px; }
.rep-rec li::before { content: '✓'; position: absolute; left: 2px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--c); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.sup-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sup-r { --c: var(--r0); --cs: var(--r0s); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--cs); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); break-inside: avoid; }
.sup-r-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; font-size: 21px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.sup-r-c { min-width: 0; }
.sup-r-c > b { color: var(--c); font-size: 14.5px; }
.sup-r-c > small { color: var(--muted); }
.sup-r-d { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 5px; }
.sup-r-d span { padding: 4px 10px; border-radius: 99px; background: #fff; font-size: 12.5px; font-weight: 700; }
.sup-r-d i { font-style: normal; color: var(--c); margin-right: 6px; font-weight: 800; }
.sup-r-c em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.rep-trat { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rep-trat li { margin: 0; padding: 9px 12px; border-radius: 12px; background: var(--r2s); border-left: 4px solid var(--r2); font-size: 13px; break-inside: avoid; }
.rep-trat li b { color: var(--r2); }
.sn-res { display: grid; gap: 12px; }
.sn-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sn-tile { position: relative; padding: 12px 12px 10px 48px; border-radius: 14px; background: var(--r4s); border: 1px solid color-mix(in srgb, var(--r4) 20%, transparent); }
.sn-tile:nth-child(2) { background: var(--r3s); } .sn-tile:nth-child(3) { background: var(--r0s); } .sn-tile:nth-child(4) { background: var(--r4s); }
.sn-tile.warn { background: var(--r1s); }
.sn-tile i { position: absolute; left: 10px; top: 12px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; font-style: normal; font-size: 16px; }
.sn-tile span { display: block; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.sn-tile b { display: block; font-size: 20px; color: var(--text); }
.sn-tile em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.sn-card { border-radius: 16px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface); break-inside: avoid; }
.sn-card.en { border-left: 6px solid var(--r0); } .sn-card.mod { border-left: 6px solid var(--r1); } .sn-card.pn { border-left: 6px solid var(--r2); }
.sn-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.sn-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); font-size: 22px; flex: none; }
.sn-card h3 { margin: 0; font-size: 15px; }
.sn-card header b { display: block; font-size: 16px; color: var(--primary-600); }
.sn-card header small { color: var(--muted); }
.sn-minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sn-mini { padding: 8px 10px; border-radius: 10px; background: var(--r0s); }
.sn-mini span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.sn-mini b { font-size: 15px; }
.sn-pasos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.sn-pasos span { font-weight: 800; color: var(--muted); margin-right: 4px; }
.sn-pasos em { font-style: normal; padding: 3px 9px; border-radius: 99px; background: var(--r0s); font-weight: 700; }
.sn-pasos i { font-style: normal; color: var(--muted); }
.sn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sn-chips span { padding: 6px 12px; border-radius: 99px; background: var(--r1s); font-size: 12.5px; }
.sn-comps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sn-comp { --c: var(--r4); --cs: var(--r4s); padding: 12px; border-radius: 14px; background: var(--cs); border-top: 4px solid var(--c); text-align: center; }
.sn-comp.dx { --c: var(--r5); --cs: var(--r5s); } .sn-comp.lp { --c: var(--r2); --cs: var(--r2s); }
.sn-comp i { display: block; font-style: normal; font-size: 22px; }
.sn-comp span { display: block; font-weight: 800; color: var(--c); font-size: 13px; }
.sn-comp b { display: block; font-size: 22px; }
.sn-comp em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.sn-comp small { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 99px; background: #fff; font-weight: 800; color: var(--c); font-size: 12px; }
.sn-ind { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; }
.sn-alerta { display: grid; gap: 4px; padding: 10px 14px; border-radius: 12px; background: var(--bad-soft); border-left: 5px solid var(--bad); font-size: 12.5px; }
@media (max-width: 700px) {
  .rec-grid, .sup-res, .rep-trat, .sn-comps { grid-template-columns: 1fr; }
  .sn-tiles, .sn-minis { grid-template-columns: 1fr 1fr; }
}
@media print {
  .rec-grid, .sup-res, .rep-trat { grid-template-columns: 1fr 1fr; }
  .sn-tiles { grid-template-columns: repeat(4, 1fr); }
  .sn-comps { grid-template-columns: repeat(3, 1fr); }
  .rep-rec, .sup-r, .sn-card, .sn-tile { break-inside: avoid; }
}

/* Mezcla de dos colores: degradado entre el color principal y el segundo */
:root { --mix: var(--primary-600); }
.tema-pop { display: block; }
.tema-pop[hidden] { display: none; }
.tema-cab { position: sticky; top: -8px; z-index: 1; display: grid; gap: 8px; padding: 6px 6px 10px; margin: -8px -8px 6px; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0; }
.tema-prev { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--mix)); }
.tema-modos { display: flex; gap: 6px; }
.tema-modo { flex: 1; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 800; font-size: 13px; color: var(--muted); cursor: pointer; }
.tema-modo.on { border-color: var(--primary); color: var(--primary-600); background: var(--primary-soft); }
.tema-lista { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.tema-lista[hidden] { display: none; }
.tema-mx[data-mezcla-v=""] i { background: repeating-linear-gradient(45deg, #ddd 0 3px, #fff 3px 6px); }
@media (max-width: 900px) { .tema-lista { grid-template-columns: 1fr 1fr; } }
:root[data-mezcla] .nav-btn.on, :root[data-mezcla] .btn.primary, :root[data-mezcla] .area-btn.gen.on, :root[data-mezcla] .area-btn.esp.on,
:root[data-mezcla] .seg label.on, :root[data-mezcla] .daychip.on, :root[data-mezcla] .meta-strip div:first-child, :root[data-mezcla] .rep-eq .eqt,
:root[data-mezcla] .cal-d.hoy span { background: linear-gradient(135deg, var(--primary), var(--mix)); border-color: transparent; }
:root[data-mezcla] .card-h h2::before, :root[data-mezcla] .report > h2::before, :root[data-mezcla] .rep-ped > h2::before { background: linear-gradient(180deg, var(--primary), var(--mix)); }
:root[data-mezcla] .page-head h1::after { background: linear-gradient(90deg, var(--primary), var(--mix)); }
:root[data-mezcla] .ag-hero, :root[data-mezcla] .report .rep-h, :root[data-mezcla] .rep-ped .rep-h { background: linear-gradient(120deg, var(--primary), var(--mix)); }
:root[data-mezcla] .topbar { border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, var(--primary), var(--mix)) 1; }
:root[data-mezcla] .brand b { background: linear-gradient(90deg, var(--primary-600), var(--mix)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-mezcla] .sidebar::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary), var(--mix)); }

/* Teléfono: menos texto. Secciones solo con ícono (el nombre de la sección abierta va arriba), barra compacta */
.nav-tit { display: none; }
@media (max-width: 900px) {
  .nav-tit { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--primary-600); letter-spacing: .2px; }
  .nav-items { gap: 6px; }
  .nav-btn { padding: 8px; min-width: 44px; justify-content: center; }
  .nav-btn .nav-t { display: none; }
  .nav-btn .ic { margin: 0; font-size: 20px; }
  .brand small { display: none; }
  .brand b { font-size: 20px; }
  .topbar { gap: 8px; }
  .patient-bar { gap: 6px; }
  .patient-bar select { flex: 1 1 45%; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
  .patient-bar .btn.sm { padding: 6px 9px; font-size: 12px; }
  .page-head p { display: none; }
  .page-head h1 { font-size: 21px; }
  .card { padding: 14px; }
  .note { font-size: 11.5px; }
  .area-btn { font-size: 12.5px; }
}
@media (max-width: 900px) {
  .topbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .topbar .brand { flex: 1 1 auto; }
  .topbar .tema { order: 2; }
  .topbar .areas { order: 3; flex: 1 1 100%; }
  .topbar .patient-bar { order: 4; flex: 1 1 100%; }
  .tema-pop { left: auto; right: 0; }
}

/* ============ Tamizaje, notas clínicas, consultorio y plan para el paciente ============ */
.tam-res { margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 14px; background: var(--ok-soft); border-left: 5px solid var(--ok); }
.tam-res.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.tam-res.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.glim-g { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.glim-l { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.glim-l li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.glim-l li.si { background: var(--bad-soft); border-color: transparent; font-weight: 700; }
.glim-l li select { margin-left: 6px; width: auto; display: inline-block; }
.nota-sec { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border-left: 5px solid var(--primary); }
.nota-sec h3 { margin: 0 0 8px; color: var(--primary-600); }
.nota-s, .nota-ev { border-left-color: #2f86c4; } .nota-o, .nota-dx { border-left-color: #e08a3c; } .nota-a, .nota-iv { border-left-color: #7a64c9; } .nota-p, .nota-mon { border-left-color: #2f9e7a; }
.nota-sec textarea { width: 100%; }
.nota-txt { display: none; white-space: pre-wrap; font-size: 13.5px; }
.pes { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.pes-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pes-h .btn { margin-left: auto; }
.pes-c { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #fff; background: #2f86c4; }
.pes-c.NC { background: #e08a3c; } .pes-c.NB { background: #7a64c9; }
.pes .nota-txt { display: block; margin: 8px 0 0; color: var(--muted); }
.nota-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 2px solid var(--primary-soft); }
.nota-h > div > b { display: block; font-size: 18px; }
.nota-h > div > span { color: var(--muted); font-size: 13px; }
.cons-h { display: flex; align-items: center; gap: 10px; text-align: right; }
.cons-h b { display: block; font-size: 15px; }
.cons-h span { display: block; font-size: 11.5px; opacity: .9; max-width: 380px; }
.cons-logo { max-height: 56px; max-width: 120px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; }
.cons-det { margin-bottom: 14px; } .cons-det > summary { cursor: pointer; font-weight: 800; color: var(--primary-600); padding: 8px 0; }
.pl-dias { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pl-dia { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); break-inside: avoid; }
.pl-dia h3 { margin: 0 0 6px; color: var(--primary-600); }
.pl-t { margin: 6px 0; } .pl-t > b { display: block; font-size: 13px; } .pl-t > i { display: block; font-size: 12.5px; color: var(--muted); }
.pl-t ul, .pl-lista ul { list-style: none; padding: 0; margin: 2px 0 0; font-size: 12.5px; }
.pl-t li, .pl-lista li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--border); padding: 2px 0; }
.pl-t li span, .pl-lista li span { color: var(--muted); }
.pl-lista { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pl-agua, .pl-cita { margin: 12px 0; padding: 12px 16px; border-radius: 14px; background: var(--r4s, #e5f0fa); font-size: 15px; }
.pl-cita { background: var(--r1s, #fdf0e3); }
.pl-pl { margin: 6px 0 0; font-size: 12.5px; }
@media (max-width: 700px) { .glim-g, .pl-dias, .pl-lista { grid-template-columns: 1fr; } }
@media print {
  body.imprime-nota .layout > nav, body.imprime-nota .page-head, body.imprime-nota #view > *:not(.nota-imp) { display: none !important; }
  body.imprime-nota .nota-imp { border: 0; box-shadow: none; padding: 0; }
  .nota textarea { display: none !important; }
  .nota .nota-txt { display: block; }
  .pl-dias { grid-template-columns: 1fr 1fr; } .pl-lista { grid-template-columns: repeat(3, 1fr); }
}

/* ============ Modo oscuro (el color elegido se conserva; al imprimir siempre es claro) ============ */
:root[data-oscuro], :root[data-oscuro][data-tema] {
  --bg: #10151a; --surface: #182027; --surface-2: #1f2930; --border: #2c3840; --text: #e5ece8; --muted: #9fb0a8;
  --primary-soft: color-mix(in srgb, var(--primary) 24%, #182027); --primary-600: color-mix(in srgb, var(--primary) 62%, #ffffff);
  --accent-soft: #3b2a20; --ok-soft: #173329; --warn-soft: #3a2f15; --bad-soft: #3d1f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-oscuro] body { background: var(--bg); color: var(--text); }
:root[data-oscuro] .topbar { background: rgba(24, 32, 39, .94); }
:root[data-oscuro] input, :root[data-oscuro] select, :root[data-oscuro] textarea { background: var(--surface-2); color: var(--text); border-color: var(--border); }
:root[data-oscuro] input:focus, :root[data-oscuro] select:focus, :root[data-oscuro] textarea:focus, :root[data-oscuro] .ag-buscar input { background: var(--surface); color: var(--text); }
:root[data-oscuro] .radio, :root[data-oscuro] .pm-ic span, :root[data-oscuro] .pp-ic, :root[data-oscuro] .rep-rec h3 span, :root[data-oscuro] .sup-r-ic,
:root[data-oscuro] .sup-r-d span, :root[data-oscuro] .sn-tile i, :root[data-oscuro] .sn-comp small, :root[data-oscuro] .ag-kpis .alerta { background: var(--surface); }
:root[data-oscuro] .report { --r0s: #16302a; --r1s: #3a2a1a; --r2s: #28233f; --r3s: #3a1f2a; --r4s: #1a2c3c; --r5s: #352d14; }
:root[data-oscuro] .badge { filter: saturate(.9); }
:root[data-oscuro] img.logo-img { filter: none; }
:root[data-oscuro] .tema-osc.on, :root .tema-osc.on { border-color: var(--primary); color: var(--primary-600); background: var(--primary-soft); }
.tema-oscs { margin-bottom: 2px; }

:root[data-oscuro]:not([data-mezcla]) .ag-hero, :root[data-oscuro]:not([data-mezcla]) .report .rep-h, :root[data-oscuro]:not([data-mezcla]) .rep-ped .rep-h { background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 72%, #000), var(--primary)); }
:root[data-oscuro]:not([data-mezcla]) .nav-btn.on, :root[data-oscuro]:not([data-mezcla]) .btn.primary { background: var(--primary); }
:root[data-oscuro] #toast { background: #e5ece8; color: #10151a; }
:root[data-oscuro] .ag-kpis div { background: rgba(255, 255, 255, .14); }

/* Plan para el paciente: máximo 2 columnas; tiempos con color; lista del súper por secciones con casillas */
.plan-pac .pl-lista { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.plan-pac .pl-dias { grid-template-columns: 1fr !important; }
.pl-dia { padding: 12px 14px; background: var(--surface); }
.pl-dia h3 { font-size: 16px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-soft); }
.pl-t { margin: 10px 0 4px; padding-left: 10px; border-left: 4px solid var(--c, var(--primary)); }
.pl-t > b { display: flex; align-items: center; gap: 6px; color: var(--c, var(--primary-600)); font-size: 13.5px; }
.pl-t > b span { font-size: 15px; }
.pl-t > i { margin: 2px 0 4px; }
.pl-t li { padding: 3px 0; }
.pl-sec { --c: var(--r0, #2f9e7a); --cs: var(--r0s, #e6f5ee); padding: 12px 14px; border-radius: 14px; background: var(--cs); break-inside: avoid; }
.pl-sec.c1 { --c: var(--r1); --cs: var(--r1s); } .pl-sec.c2 { --c: var(--r2); --cs: var(--r2s); } .pl-sec.c3 { --c: var(--r3); --cs: var(--r3s); } .pl-sec.c4 { --c: var(--r4); --cs: var(--r4s); } .pl-sec.c5 { --c: var(--r5); --cs: var(--r5s); }
.pl-sec h3 { margin: 0 0 8px; font-size: 14px; color: var(--c); text-transform: uppercase; letter-spacing: .4px; }
.pl-sec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl-sec li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 9px; background: var(--surface); font-size: 13px; }
.pl-sec li i { width: 14px; height: 14px; border: 2px solid var(--c); border-radius: 4px; }
.pl-sec li b { font-weight: 700; }
.pl-sec li span { color: var(--muted); font-size: 12px; text-align: right; }
@media (max-width: 700px) { .plan-pac .pl-dias, .plan-pac .pl-lista { grid-template-columns: 1fr !important; } }
@media print { .plan-pac .pl-lista { grid-template-columns: 1fr 1fr !important; } }
/* Historia clínica */
.hc-g { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.hc-g > summary { cursor: pointer; font-weight: 800; }
/* Resumen: botones compactos en una sola línea */
.res-acc { flex-wrap: nowrap; gap: 6px; }
.res-acc .btn { padding: 7px 11px; font-size: 13px; white-space: nowrap; }
@media (max-width: 900px) { .res-acc { flex-wrap: wrap; } }
/* Modo oscuro: letras blancas */
:root[data-oscuro], :root[data-oscuro][data-tema] { --text: #ffffff; --muted: #d0dad5; }
:root[data-oscuro] .note, :root[data-oscuro] .small.muted, :root[data-oscuro] .muted { color: #d0dad5; }
:root[data-oscuro] h1, :root[data-oscuro] h2, :root[data-oscuro] .lbl, :root[data-oscuro] .stat-v { color: #ffffff; }
:root[data-oscuro] .banner.area-b.esp, :root[data-oscuro] .q-area.esp, :root[data-oscuro] .tag.area-t.esp { background: #2b2545; border-color: #3d3466; color: #ece6ff; }
:root[data-oscuro] .banner.area-b.gen, :root[data-oscuro] .q-area.gen, :root[data-oscuro] .tag.area-t.gen { background: color-mix(in srgb, var(--primary) 22%, #182027); color: #e8f6f0; }
:root[data-oscuro] .banner { color: var(--text); }
/* Mezcla con blanco: el color principal se degrada hacia blanco; donde hay letras blancas el degradado termina en un tono claro del color */
:root[data-mezcla="blanco"] { --mix: color-mix(in srgb, var(--primary) 30%, #ffffff); }
:root[data-mezcla="blanco"] .nav-btn.on, :root[data-mezcla="blanco"] .btn.primary, :root[data-mezcla="blanco"] .area-btn.gen.on, :root[data-mezcla="blanco"] .area-btn.esp.on,
:root[data-mezcla="blanco"] .seg label.on, :root[data-mezcla="blanco"] .daychip.on, :root[data-mezcla="blanco"] .meta-strip div:first-child, :root[data-mezcla="blanco"] .rep-eq .eqt,
:root[data-mezcla="blanco"] .cal-d.hoy span { background: linear-gradient(135deg, var(--primary-600) 15%, color-mix(in srgb, var(--primary) 62%, #ffffff)); text-shadow: 0 1px 2px rgba(0, 0, 0, .28); }
:root[data-mezcla="blanco"] .ag-hero, :root[data-mezcla="blanco"] .report .rep-h, :root[data-mezcla="blanco"] .rep-ped .rep-h { background: linear-gradient(120deg, var(--primary-600) 25%, color-mix(in srgb, var(--primary) 45%, #ffffff)); text-shadow: 0 1px 2px rgba(0, 0, 0, .22); }
:root[data-mezcla="blanco"] .brand b { background: linear-gradient(90deg, var(--primary-600), color-mix(in srgb, var(--primary) 55%, #ffffff)); -webkit-background-clip: text; background-clip: text; }
.tema-mx[data-mezcla-v="blanco"] i { box-shadow: inset 0 0 0 1.5px #b9c2be; }
/* Logo del consultorio junto al de NUTRÉA (el de NUTRÉA nunca se quita) */
.rep-marcas { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.rep-marcas .rep-logo { font-size: 13px; }
.nota-h .rep-marcas .rep-logo { color: var(--primary-600); }
/* Firma de la nota (NOM-004-SSA3-2012) */
.nota-firma { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-top: 22px; }
.nota-firma div { display: flex; flex-direction: column-reverse; gap: 4px; }
.nota-firma b { display: block; min-height: 22px; border-bottom: 1.5px solid var(--text); font-weight: 600; }
.nota-firma span { font-size: 11.5px; color: var(--muted); }
@media (max-width: 700px) { .nota-firma { grid-template-columns: 1fr; } }
/* Lista del súper del paciente: cuánto de cada carne en qué corte */
.pl-sec li .pl-forma { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: -2px; font-style: normal; }
.pl-sec li .pl-forma span { padding: 1px 8px; border-radius: 99px; background: var(--cs); color: var(--text); font-size: 11.5px; text-align: left; }
/* VGS */
.card h4.mt { margin-bottom: 4px; color: var(--primary-600); }
/* Lista del súper dentro del resumen (antes estaba en el plan del paciente) */
.report .pl-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .report .pl-lista { grid-template-columns: 1fr; } }
@media print { .res-super { break-before: page; } .report .pl-lista { grid-template-columns: 1fr 1fr; } .pl-sec li { font-size: 11px; padding: 3px 7px; } }
/* Soporte: módulos automáticos y reparto de la meta */
.mod-auto td { background: var(--primary-soft); }
.sn-reparto { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 10px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
/* Menú lateral: queda justo debajo de la barra superior (su alto real se mide en vivo) para que Agenda nunca se esconda,
   y al llegar al tope la rueda del mouse sigue moviendo la página (antes se quedaba atorado en Paciente) */
.sidebar { top: calc(var(--top-h, 84px) + 10px); max-height: calc(100vh - var(--top-h, 84px) - 80px); overscroll-behavior: auto; } /* 80 = 10 arriba + 60 del margen inferior del contenedor + 10 */
.card.sticky, .menu-side, .rec-layout .rec-list, .antro-layout > .col:last-child { top: calc(var(--top-h, 84px) + 10px); }
.menu-side { max-height: calc(100vh - var(--top-h, 84px) - 26px); }
@media (max-width: 900px) { .sidebar { top: 0; max-height: none; } }
/* Ventana de Exportar */
.dlg-exp { border: 0; border-radius: 18px; padding: 22px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.dlg-exp::backdrop { background: rgba(15, 25, 20, .45); }
.dlg-exp h2 { margin: 0 0 4px; }
.dlg-exp .btn { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin-top: 10px; text-align: left; }
.dlg-exp .btn small { font-weight: 500; opacity: .85; }
.dlg-exp .btn.sm { align-items: center; }

/* Cuenta (nombre, Operador, Mi plan, Salir) debajo del logo de NUTRÉA */
.brand-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 0 0 auto; }
.brand-col .cuenta-bar { margin-left: 0; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.brand-col .cuenta-mail { max-width: 210px; }
.brand-col .cuenta-bar .btn.sm { padding: 4px 9px; font-size: 12px; }
@media (max-width: 900px) {
  .topbar .brand-col { flex: 1 1 auto; }
  .brand-col .cuenta-bar { width: auto; }
}

/* Pago con tarjeta (Mercado Pago) en Mi plan */
.nube-tarjeta { padding: 12px 14px; border: 1.5px solid var(--primary-soft); border-radius: 12px; background: var(--surface-2); }
.nube-tarjeta .btn { font-size: 15px; }
.nube-tarjeta p { margin: 8px 0 0; }

/* Operador: botones de cada usuario en cuadrícula, sin salirse de la tabla */
.nube-acc-u { display: flex; flex-wrap: wrap; gap: 6px; }
.nube-acc-u .btn { margin: 0; white-space: nowrap; }
.tbl tr.op-acc td { padding-top: 0; border-top: 0; }
.tbl tr:has(+ tr.op-acc) td { border-bottom: 0; }
