/* Interfarmacias · layout: barra superior + columna única que se ensancha en escritorio */
:root {
  --bg: #f4f6f5; --panel: #ffffff; --fg: #17201d; --muted: #5d6a65; --line: #dbe2df;
  --accent: #0f6b5c; --accent-fg: #ffffff; --accent-soft: #e2f0ec;
  --ok: #1d7a45; --warn: #a3620a; --bad: #b3261e; --info: #2c5d9e;
  --radius: 10px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111715; --panel: #19211e; --fg: #e5ece9; --muted: #9aa8a2; --line: #2c3833;
    --accent: #3fb59d; --accent-fg: #0b1412; --accent-soft: #1d332d; --ok: #4cc27c; --warn: #e3a440; --bad: #f2786f; --info: #7aa8e8; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .01em; color: var(--fg); text-decoration: none; }
.brand small { font-weight: 400; color: var(--muted); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.nav a.on, .nav a:hover { background: var(--accent-soft); color: var(--accent); }
.who { color: var(--muted); font-size: 13px; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 22px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 24px; font-weight: 650; }
.tile .s { font-size: 12px; color: var(--muted); }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.step { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 10px 12px; }
.step .l { font-size: 12px; color: var(--muted); }
.step .v { font-size: 20px; font-weight: 650; }
.step .s { font-size: 12px; color: var(--muted); }
.tw { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tw.tall { max-height: 560px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: top; }
th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; z-index: 1; }
td.n, th.n { text-align: right; }
td.w { white-space: normal; min-width: 200px; }
tr.dim td { color: var(--muted); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); min-width: 90px; }
.bar span { display: block; height: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn.big { padding: 14px 18px; font-size: 17px; width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid2 > * { min-width: 0; }
.msg { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.msg.err { border-color: var(--bad); color: var(--bad); }
.msg.ok { border-color: var(--ok); color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); background: var(--panel); font-size: 13px; }
.chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip b { font-weight: 650; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--fg); }
.item .t { font-weight: 650; }
.item .d { font-size: 13px; color: var(--muted); }
.firma { width: 100%; height: 170px; border: 1px dashed var(--muted); border-radius: 8px; background: #fff; touch-action: none; display: block; }
.firma-img { max-width: 220px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.tl::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); }
.dot.ok { background: var(--ok); border-color: var(--ok); }
.dot.now { border-color: var(--warn); }
.login { max-width: 380px; margin: 10vh auto; }
.login form { display: flex; flex-direction: column; gap: 12px; }
details summary { cursor: pointer; }
.ren-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ren-form select, .ren-form input { padding: 5px 7px; font-size: 13px; }
.ren-form input.obs { width: 220px; }
.ren-form input.cf { width: 70px; }
.saved { color: var(--ok); font-size: 12px; }
@media (max-width: 600px) { .tile .v { font-size: 20px; } main { padding-top: 12px; } .who { width: 100%; } }
