/* Socorro · Abastecimiento — fondo gris azulado, tarjetas blancas, acento azul marino */
:root {
  --bg: #F1F4F9; --card: #FFFFFF; --soft: #F6F8FB; --line: #E3E8F0; --line-2: #EDF1F6; --field: #CDD5E1;
  --fg: #172033; --fg-2: #2E3A52; --muted: #64708A;
  --brand: #14306B; --brand-deep: #0D2457; --brand-ink: #091A40; --brand-soft: #E6ECF8;
  --ok: #1E6B5F; --ok-soft: #DDF0EC; --bad: #B4321C; --bad-soft: #FBE3DE; --warn: #B7791F; --warn-soft: #FCF0D9;
  --sombra: 0 1px 2px rgba(23,32,51,.04), 0 8px 24px rgba(23,32,51,.07);
  --f: "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f); font-size: 14.5px; line-height: 1.5 }
[hidden] { display: none !important }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 24px }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none }

/* ---------- cabecera ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20 }
.top-in { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding-block: 12px }
.marca { display: flex; flex-direction: column; line-height: 1.1; margin-right: auto }
.marca b { font-weight: 800; font-size: 17px; color: var(--brand); letter-spacing: -.01em }
.marca span { font-weight: 700; font-size: 14px; color: var(--fg) }
.marca.grande { margin: 0 }
.marca.grande b { font-size: 24px }
.marca.grande span { font-size: 18px }
.nav { display: flex; gap: 4px; flex-wrap: wrap }
.nav button { font: inherit; font-size: 13.5px; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 8px; cursor: pointer; min-height: 38px }
.nav button:hover { color: var(--fg); background: var(--soft) }
.nav button[aria-current="page"] { color: var(--brand-deep); background: var(--brand-soft) }
.nav .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700 }
.quien { display: flex; align-items: center; gap: 10px }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted) }
.quien b { display: block; font-size: 13.5px; font-weight: 600 }
.quien small { display: block; font-size: 11.5px; color: var(--muted) }

/* ---------- encabezado de cada vista ---------- */
.cabeza { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; padding-block: 26px 18px }
.cabeza h1 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; letter-spacing: -.02em; text-wrap: balance }
.cabeza p { margin: 6px 0 0; max-width: 72ch; font-size: 14px }
.farm-pill { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border: 1px solid var(--field); border-radius: 12px; background: var(--card); font-weight: 700; font-size: 19px; box-shadow: var(--sombra) }
.farm-pill svg { color: var(--brand); width: 30px; height: 30px }
.cabeza.ficha .eyebrow { margin-bottom: 4px }
.cabeza #fEstado { margin-top: 12px }
.volver { background: none; border: 0; color: var(--brand-deep); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; margin-bottom: 8px }
.volver:hover { text-decoration: underline }

.cuerpo { padding-bottom: 64px; display: flex; flex-direction: column; gap: 20px }

/* ---------- tipografía y bloques ---------- */
h2 { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--fg); margin: 0 }
h2 svg { width: 21px; height: 21px; color: var(--fg-2) }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--muted) }
code { font-family: var(--f); font-variant-numeric: tabular-nums; font-weight: 600 }
.muted { color: var(--muted) }
.nota { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: 12.5px; color: var(--muted) }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra) }
.lista { overflow: hidden }
.lh { padding: 18px 22px 16px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between }
.num { font-size: 18px; color: var(--fg); font-weight: 700 }
.num:not(:empty)::before { content: "(" } .num:not(:empty)::after { content: ")" }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start }
.cols > .card { flex: 1 1 400px; min-width: 0 }
.form { padding: 22px; display: flex; flex-direction: column; gap: 16px }

/* formulario de bloqueo */
.bloque { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 16px }
.bloque-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px 28px; align-items: start }
.bloque-grid .col, .bq-top .col { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.grid-q { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 20px; align-items: start }
.bq-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 20px; align-items: start }
.pie { display: flex; justify-content: flex-end }

/* estado rápido */
.resumen { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px }
.estados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px }
.estados li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px }
.estados b { font-variant-numeric: tabular-nums; margin-left: -4px }
.pt { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; flex: none }
.pt.rojo { background: var(--bad) } .pt.ambar { background: #E0A11B } .pt.verde { background: #2E7D4F } .pt.gris { background: #8A94A8 }

/* ---------- campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; position: relative }
label, legend { font-size: 12.5px; font-weight: 600; color: var(--fg-2) }
input, select, textarea { font: inherit; font-size: 14px; color: var(--fg); background: #fff; border: 1px solid var(--field); border-radius: 8px; padding: 0 12px; min-height: 42px; width: 100% }
textarea { padding: 10px 12px; resize: vertical }
input[type=date] { max-width: 220px }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft) }
input::placeholder, textarea::placeholder { color: #8A94A8 }
.ayuda { font-size: 12px; color: var(--muted) }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0 }
legend { padding: 0; margin-bottom: 8px }
.con-icono { position: relative; display: block }
.con-icono input { padding-right: 38px }
.con-icono svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none }
.busca-tabla input { min-width: 240px; min-height: 40px }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end }
.filtro { display: flex; flex-direction: column; gap: 4px; color: var(--muted) }
.filtro input, .filtro select { min-height: 40px; font-size: 13.5px; font-weight: 500; width: auto; min-width: 150px }

/* motivos: etiquetas de color que se marcan */
.pills { display: flex; flex-wrap: wrap; gap: 8px }
.pills label { position: relative; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: box-shadow .12s }
.pills label:not([class]) { background: #E9EDF3; color: var(--fg-2) }
.pills label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .7 }
.pills label:hover { border-color: currentColor }
.pills label:has(input:checked) { border-color: currentColor; box-shadow: 0 0 0 2px currentColor; font-weight: 700 }
.pills label:has(input:checked)::before { content: "✓"; width: auto; height: auto; background: none; opacity: 1; font-weight: 800 }
.pills label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px }
.pills input { position: absolute; opacity: 0; pointer-events: none }
.pills.verde label { background: #fff; border-color: var(--field); color: var(--fg) }
.pills.verde label:has(input:checked) { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); background: var(--ok-soft); color: #134A41 }

.resultados { border: 1px solid var(--line); border-radius: 10px; background: #fff; max-height: 300px; overflow-y: auto; box-shadow: 0 12px 28px rgba(23,32,51,.12); position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin-top: 4px; padding: 4px }
.resultados button { display: flex; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 13.5px; background: none; border: 0; border-radius: 6px; padding: 9px 10px; cursor: pointer; color: var(--fg) }
.resultados button:hover, .resultados button:focus-visible, .resultados button.activo { background: var(--brand-soft) }
.resultados button.activo { box-shadow: inset 3px 0 0 var(--brand) }
.resultados code { color: var(--fg-2); min-width: 48px }
.resultados small { margin-left: auto; padding-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap }
.resultados .vacio { padding: 10px; color: var(--muted) }

.sel { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--soft); display: flex; flex-direction: column; gap: 3px }
.sel .cod { font-size: 12px; font-weight: 600; color: var(--muted) }
.sel b { font-weight: 700 }
.sel .est { font-size: 13px; font-weight: 600 }
.sel .manual { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 4px 0 }
.sel .manual input { min-height: 38px; font-size: 13.5px }
.sel .fila { display: flex; gap: 8px }
.fila input { flex: 1 1 auto; min-width: 0 }
.enlace { align-self: flex-start; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: underline }
.resultados button.agregar { color: var(--brand-deep); font-weight: 600; border-top: 1px solid var(--line-2); border-radius: 0 0 6px 6px; margin-top: 2px }
.ok { color: var(--ok) } .mal { color: var(--bad) }

/* ---------- botones ---------- */
.btn { font: inherit; font-size: 13.5px; font-weight: 600; min-height: 38px; padding: 0 14px; border: 1px solid var(--field); background: #fff; color: var(--fg); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap }
.btn:hover { border-color: var(--fg-2); background: var(--soft) }
.btn.primario, .btn.verde { min-height: 42px; border: 0; color: #fff; font-weight: 600; padding: 0 18px; box-shadow: 0 6px 16px rgba(20,48,107,.3) }
.btn.primario { background: linear-gradient(180deg, #1C3F87, var(--brand)) }
.btn.primario:hover { background: var(--brand-deep) }
.btn.mas::before { content: "+"; font-size: 20px; font-weight: 400; line-height: 1 }
.btn.verde { background: var(--ok); box-shadow: 0 4px 12px rgba(30,107,95,.2) }
.btn.verde:hover { background: #16564C }
.btn.ancho { width: 100% }
.btn.sm { min-height: 32px; font-size: 12.5px; padding: 0 11px }
.btn.sm.verde, .btn.sm.primario { min-height: 32px; box-shadow: none }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none }

/* ---------- mensajes ---------- */
.msg { font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--ok-soft); color: #134A41; font-weight: 500 }
.msg.error, .aviso.error { background: var(--bad-soft); color: var(--bad) }
.aviso { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600 }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px) }

/* ---------- tablas ---------- */
.tabla-wrap { overflow-x: auto; border-top: 1px solid var(--line) }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px }
.tabla th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #EEF2F8 }
.tabla td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle }
.tabla tr:last-child td { border-bottom: 0 }
.tabla tr.clic { cursor: pointer }
.tabla tr.clic:hover td { background: var(--soft) }
.tabla .p b { display: block; font-weight: 600 }
.tabla .p code { font-size: 12px; color: var(--muted); font-weight: 500 }
.tabla .f { font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap }
.tabla .der { text-align: right }
.tabla .vacia td { color: var(--muted); padding: 22px 18px }
.tabla tr.revisar td { background: #FFF6EF }

/* ---------- etiquetas ---------- */
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap }
.m-venc { background: #FCEFD9; color: #7A4A00 }
.m-emer { background: var(--bad-soft); color: var(--bad) }
.m-sobre { background: #E3EBF8; color: #2F4E8C }
.m-norota { background: #E9EDF3; color: #3E4A60 }
.m-desc { background: #EDE4F5; color: #5E3A87 }
.m-quiebre { background: var(--ok-soft); color: var(--ok) }
.m-otro { background: #E9EDF3; color: #3E4A60 }
.t-bloq { background: var(--bad-soft); color: var(--bad) }
.t-pend { background: var(--warn-soft); color: #7A4A00 }
.t-rech { background: #E9EDF3; color: #3E4A60 }
/* estado en la tabla del químico: etiquetas sólidas */
#qTabla .t-bloq { background: #2E7D4F; color: #fff }
#qTabla .t-pend { background: #D99A1E; color: #fff }
#qTabla .t-rech { background: #C0392B; color: #fff }
#qTabla .tag { border-radius: 6px }
.btn.icono { width: 36px; min-height: 36px; padding: 0; background: var(--soft); border-color: var(--line); color: var(--fg-2) }
.btn.icono:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand) }
/* buscador con botón azul pegado */
.busca-unida { display: flex }
.busca-unida input { border-radius: 8px 0 0 8px; border-right: 0 }
.busca-unida .lupa { flex: none; width: 46px; border: 0; border-radius: 0 8px 8px 0; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center }
.busca-unida .lupa:hover { background: var(--brand-deep) }
.t-ok { background: var(--ok-soft); color: var(--ok) }
.estado { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 13px }
.estado:not(.t-ok) { background: var(--bad-soft) !important; color: var(--bad) !important }

/* ---------- indicadores (administrador) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px }
.kpi { padding: 18px 20px; min-width: 0 }
.kpi span { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--fg-2) }
.kpi b { display: block; font-weight: 700; font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 8px }
.kpi b.acc { color: var(--brand-deep) }
.kpi small { font-size: 12px; color: var(--muted) }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 22px 0 }
.chips button { font: inherit; font-size: 12.5px; font-weight: 600; min-height: 32px; padding: 0 11px; border: 1px solid var(--field); background: #fff; border-radius: 99px; cursor: pointer; color: var(--fg) }
.chips button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: #fff }
.chips span { color: var(--muted); margin-left: 5px; font-weight: 700 }
.chips button[aria-pressed="true"] span { color: #fff }

/* ---------- solicitudes ---------- */
#aSolCard { overflow: hidden }
.sol .p b, .sol .p code { display: block }
.sol .p code { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px }
.sol { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(240px, 1.4fr); gap: 12px 20px; padding: 16px 22px; border-top: 1px solid var(--line); align-items: start }
.sol .acc { display: flex; flex-direction: column; gap: 8px }
.sol .acc .botones { display: flex; gap: 8px; flex-wrap: wrap }
.sol .acc input { min-height: 36px; font-size: 13.5px }
.vacio-sol { padding: 16px 22px; color: var(--muted); border-top: 1px solid var(--line) }

/* ---------- historial ---------- */
.ev { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2) }
.ev .f { font-size: 12px; font-weight: 600; color: var(--muted) }
.ev .t { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600 }
.ev p { margin: 3px 0 0; color: var(--fg-2) }
.accion { border-top: 4px solid var(--ok) }

/* ---------- ingreso ---------- */
/* Pantallas de ingreso con la identidad de Farmacia Socorro (naranja, letra redondeada) */
.ingreso { --nar: #F28C1E; --nar-2: #EA6A0C; --nar-3: #C9550A; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); background: #fff; font-family: "Nunito", var(--f) }
.ingreso-arte { position: relative; overflow: hidden; background: linear-gradient(150deg, #F7A23A 0%, var(--nar) 45%, var(--nar-2) 100%); color: #fff; display: flex; align-items: center; padding: 48px clamp(28px, 6vw, 80px) }
.cruz-g { position: absolute; width: 74%; height: auto; right: -24%; top: 50%; transform: translateY(-50%); stroke: none }
.chispa { position: absolute; font-weight: 900; line-height: 1; color: #fff; opacity: .9 }
.s1 { top: 9%; left: 12%; font-size: 54px } .s2 { top: 22%; right: 16%; font-size: 30px } .s3 { bottom: 16%; right: 10%; font-size: 64px } .s4 { bottom: 30%; left: 7%; font-size: 26px; opacity: .7 }
.arte-txt { position: relative; max-width: 520px }
.lema { margin: 26px 0 0; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.1; font-weight: 700; letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(150,60,0,.25) }
.lema b { font-weight: 900 }
.arte-sub { margin: 16px 0 0; font-size: 17px; font-weight: 700; opacity: .95; text-transform: uppercase; letter-spacing: .12em }
/* logotipo en píldora: cruz con "fs" + Farmacia Socorro */
.fs-pill { display: inline-flex; align-items: center; gap: 10px; padding: 9px 22px 9px 12px; border-radius: 999px; background: linear-gradient(180deg, var(--nar), var(--nar-2)); color: #fff; box-shadow: 0 6px 18px rgba(150,60,0,.25); border: 2px solid rgba(255,255,255,.55) }
.fs-cruz { display: grid; place-items: center; width: 38px; height: 38px; font-weight: 900; font-style: italic; font-size: 18px; letter-spacing: -.04em;
  clip-path: polygon(33% 0, 67% 0, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0 67%, 0 33%, 33% 33%); background: #fff; color: var(--nar-2) }
.fs-nom { display: flex; flex-direction: column; line-height: 1; font-weight: 900; font-style: italic; font-size: 24px }
.fs-nom small { font-size: 11px; font-weight: 800; font-style: italic; opacity: .95; margin-bottom: 2px }
.fs-pill.chica { padding: 6px 16px 6px 9px; border: 0; box-shadow: 0 4px 12px rgba(234,106,12,.25) }
.fs-pill.chica .fs-cruz { width: 28px; height: 28px; font-size: 13px }
.fs-pill.chica .fs-nom { font-size: 18px }
.fs-pill.chica .fs-nom small { font-size: 9px }
/* formulario */
.login-card { align-self: center; justify-self: center; width: min(400px, 100%); padding: 40px 28px; display: flex; flex-direction: column; gap: 16px }
.ingreso-cab .fs-pill { display: none }
.ingreso-cab { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 4px }
.login-card h1 { margin: 14px 0 0; font-size: 28px; font-weight: 900; color: #2B2B2B; letter-spacing: -.01em }
.login-card p { margin: 0; font-size: 15px }
.ingreso label { font-size: 13.5px; font-weight: 800; color: #3B3B3B }
.ingreso input { min-height: 48px; border-radius: 12px; font-size: 15px; border-color: #E2D9D0 }
.ingreso input:focus { border-color: var(--nar); box-shadow: 0 0 0 3px #FDE7D1 }
.ingreso .btn.primario { min-height: 50px; border-radius: 999px; font-size: 16px; font-weight: 800; background: linear-gradient(180deg, var(--nar), var(--nar-2)); box-shadow: 0 8px 20px rgba(234,106,12,.35) }
.ingreso .btn.primario:hover { background: linear-gradient(180deg, var(--nar-2), var(--nar-3)) }
.ingreso .enlace { color: #8A7F76 }
.ingreso .enlace:hover { color: var(--nar-2) }
@media (max-width: 820px) {
  .ingreso { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr }
  .ingreso-arte { padding: 32px 24px 40px }
  .ingreso-arte .fs-pill { display: none }
  .ingreso-cab .fs-pill { display: inline-flex }
  .login-card { align-self: start }
  .cruz-g { width: 60%; right: -18% }
  .s2 { display: none }
  .lema { margin: 0; font-size: 28px }
  .arte-sub { font-size: 13px }
  .s1 { font-size: 26px; top: 14%; left: auto; right: 8% } .s3 { font-size: 30px; bottom: 12%; right: 20% } .s4 { display: none }
  .login-card { padding: 28px 20px 40px }
}

@media (max-width: 960px) {
  .grid-q { grid-template-columns: minmax(0, 1fr) }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 700px) {
  .bq-top { grid-template-columns: minmax(0, 1fr) }
  .sol { grid-template-columns: minmax(0, 1fr) }
  .pie .btn { width: 100% }
  .busca-tabla, .busca-tabla input { width: 100%; min-width: 0 }
  .quien small { display: none }
}
@media (max-width: 480px) {
  .wrap { padding-inline: 16px }
  .filtro input, .filtro select { min-width: 0; width: 100% } .filtro { flex: 1 1 100% }
  .kpis { gap: 10px } .kpi { padding: 14px }
}

/* ---------- editar usuarios ---------- */
.botones-fila { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end }
.tabla tr.inactivo td { opacity: .6 }
.tabla tr.editando td { background: var(--soft); border-bottom: 2px solid var(--brand) }
.edit-grid { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(150px, 1.4fr) minmax(130px, 1fr); gap: 12px 16px; align-items: end; margin-bottom: 8px }
.edit-grid .filtro input, .edit-grid .filtro select { width: 100%; min-width: 0 }
.edit-grid .check { grid-column: 1 / 3; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--fg-2); cursor: pointer }
.edit-grid .check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand) }
@media (max-width: 700px) { .edit-grid { grid-template-columns: minmax(0, 1fr) } .edit-grid .check { grid-column: auto } }

/* ---------- cambio de sucursal ---------- */
.farm-caja { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; position: relative }
.cs-pend { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: #7A4A00; font-weight: 600; font-size: 13.5px; max-width: 360px }
.cs-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; width: min(340px, 90vw); padding: 16px; display: flex; flex-direction: column; gap: 12px }
.cs-form .filtro select, .cs-form .filtro input { width: 100%; min-width: 0 }
#sCard { overflow: hidden; border-left: 4px solid #E0A11B }
@media (max-width: 700px) { .cs-form { left: 0; right: auto } }
