/* Data Web · estilos */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f8f9fb; --border: #e2e5ea; --border-strong: #cfd4db;
  --text: #1c222b; --muted: #6a7380; --brand: #d7191f; --brand-ink: #ffffff; --accent: #24303f;
  --focus: #3b82f6; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --good-bg: #e6f4ea; --good: #1e7a3b; --bad-bg: #fdecea; --bad: #b42318; --warn-bg: #fff4e0; --warn: #9a5b00;
  --row-alt: #f8f9fb; --row-ses: #eaf5e4; --row-hover: #f1f4f8;
  --chart-bg: #ffffff; --chart-lane: #f6f7f9; --chart-grid: #eceff3; --chart-grid-major: #d3d8df; --chart-axis: #737d89; --chart-frame: #d9dde3; --chart-title: #2b3440;
  --c-limit: #e03131; --c-leq: #2b9a3f; --c-l10: #f08c00; --c-l50: #1c8fd6; --c-l90: #3b5bdb; --c-coh: #c2255c; --c-att: #0b8a9e; --c-re: #e8590c;
  --c-ses-ok: #a9dc9a; --c-ses-inc: #ee9a82; --c-ses-open: #b8bec7;
  --c-ver: #3b5bdb; --c-cal: #e8836a; --c-geq: #74b816; --c-lim: #4a72b0;
  --radius: 10px; --side-w: 210px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #161a20; --surface-2: #1b2028; --border: #272d36; --border-strong: #353c47;
    --text: #e4e7ec; --muted: #8b94a1; --accent: #c9d1dc; --shadow: none;
    --good-bg: #12301d; --good: #6fd08c; --bad-bg: #3a1513; --bad: #ff8a80; --warn-bg: #3a2a0c; --warn: #ffc35c;
    --row-alt: #1a1f26; --row-ses: #1a2b1c; --row-hover: #1f252e;
    --chart-bg: #12161b; --chart-lane: #171c23; --chart-grid: #222932; --chart-grid-major: #36404b; --chart-axis: #8b94a1; --chart-frame: #2c333d; --chart-title: #d6dbe2;
    --c-limit: #ff6b6b; --c-leq: #51cf66; --c-l10: #ffa94d; --c-l50: #4dabf7; --c-l90: #748ffc; --c-coh: #f06595; --c-att: #3bc9db; --c-re: #ff922b;
    --c-ses-ok: #2f6b3a; --c-ses-inc: #8f4334; --c-ses-open: #4a525c; --c-ver: #748ffc; --c-cal: #ff8f6e; --c-geq: #94d82d; --c-lim: #74a0e0;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161a20; --surface-2: #1b2028; --border: #272d36; --border-strong: #353c47;
  --text: #e4e7ec; --muted: #8b94a1; --accent: #c9d1dc; --shadow: none;
  --good-bg: #12301d; --good: #6fd08c; --bad-bg: #3a1513; --bad: #ff8a80; --warn-bg: #3a2a0c; --warn: #ffc35c;
  --row-alt: #1a1f26; --row-ses: #1a2b1c; --row-hover: #1f252e;
  --chart-bg: #12161b; --chart-lane: #171c23; --chart-grid: #222932; --chart-grid-major: #36404b; --chart-axis: #8b94a1; --chart-frame: #2c333d; --chart-title: #d6dbe2;
  --c-limit: #ff6b6b; --c-leq: #51cf66; --c-l10: #ffa94d; --c-l50: #4dabf7; --c-l90: #748ffc; --c-coh: #f06595; --c-att: #3bc9db; --c-re: #ff922b;
  --c-ses-ok: #2f6b3a; --c-ses-inc: #8f4334; --c-ses-open: #4a525c; --c-ver: #748ffc; --c-cal: #ff8f6e; --c-geq: #94d82d; --c-lim: #74a0e0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; }

/* ---------- barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand img { height: 26px; width: auto; border-radius: 2px; }
.brand-sub { font-weight: 600; color: var(--muted); letter-spacing: .02em; padding-left: 12px; border-left: 1px solid var(--border); white-space: nowrap; }
.devchip { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.dc-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-meta { display: flex; gap: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.dc-meta span { overflow: hidden; text-overflow: ellipsis; }
.dc-meta span + span::before { content: "·"; margin-right: 10px; color: var(--border-strong); }
.actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.actions select { height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 0 8px; }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover:not(:disabled) { background: #b8141a; border-color: #b8141a; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.icon .fillc { fill: currentColor; stroke: none; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 15px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.ibtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); }
.ibtn:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.ibtn:disabled { opacity: .35; cursor: default; }
.lnk { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 0; font-size: 12.5px; }
.lnk:hover { color: var(--text); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- estructura ---------- */
.layout { display: flex; min-height: calc(100vh - 60px); }
.sidenav { flex: none; width: var(--side-w); padding: 14px 10px; border-right: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.sidenav[hidden] { display: none; }
.sidenav button { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; color: var(--muted); font-weight: 550; }
.sidenav button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidenav button:hover { background: var(--surface-2); color: var(--text); }
.sidenav button.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
main { flex: 1; min-width: 0; padding: 18px 20px 28px; }
.view { display: grid; gap: 16px; }
.view-week, .view-day { grid-template-columns: 270px minmax(0, 1fr); align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 78px; }
.main-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.main-col.full { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.card-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 34px; }
.vtitle { font-size: 18px; margin: 0; font-weight: 650; }
.seg { display: flex; align-items: center; gap: 10px; }
.range { font-variant-numeric: tabular-nums; white-space: nowrap; }
.range b { margin-right: 4px; }
.zoominfo { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 10px; text-align: center; color: var(--muted); }

/* ---------- bienvenida ---------- */
.welcome { display: flex; justify-content: center; padding: 4vh 0; }
.welcome[hidden] { display: none; }
.welcome-card { max-width: 760px; width: 100%; text-align: center; }
.welcome h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; font-weight: 700; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 15px; margin: 0 auto 26px; max-width: 640px; }
.drop { border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--surface); padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.drop svg { width: 38px; height: 38px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop-t { font-weight: 600; font-size: 15px; }
.drop-or { color: var(--muted); font-size: 12.5px; }
.feats { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.feats li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 12px 38px; position: relative; font-weight: 550; }
.feats li::before { content: ""; position: absolute; left: 14px; top: 17px; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.privacy { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 20px; }
.privacy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.dropveil { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(14, 17, 22, .55); }
.dropveil div { background: var(--surface); padding: 26px 40px; border-radius: 14px; font-weight: 650; font-size: 17px; border: 2px dashed var(--brand); }
body.dragging .dropveil { display: flex; }

/* ---------- calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 650; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); padding: 3px 0; font-weight: 600; }
.cal-day { position: relative; height: 32px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day.has { color: var(--text); font-weight: 650; }
.cal-day.has::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--c-leq); }
.cal-day:hover { background: var(--surface-2); }
.cal-day.on { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--text); }
.cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* ---------- series / leyendas ---------- */
.toggles { display: flex; flex-direction: column; gap: 6px; }
.tg { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.tg input { margin: 0; accent-color: var(--accent); }
.tg i { width: 16px; height: 3px; border-radius: 2px; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend.sm { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.legend span, .legend-v span { display: flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.sw.line { height: 3px; width: 16px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 12px; }

/* ---------- graficas ---------- */
.chart-card { padding: 12px 14px 8px; }
.chart-card.plain { padding: 8px 0 0; border: 0; box-shadow: none; background: none; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-head h3 { margin: 4px 0 0; font-size: 14px; font-weight: 700; white-space: nowrap; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.readout span { display: inline-flex; align-items: baseline; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; min-width: 54px; }
.readout em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 11px; }
.readout .ro-off { color: var(--muted); font-weight: 600; }
.chart { width: 100%; }
.tc-wrap { position: relative; }
.tc-host { position: relative; touch-action: pan-y; cursor: crosshair; user-select: none; }
.tc-cursor { position: absolute; width: 1px; background: var(--text); opacity: .55; display: none; pointer-events: none; }
.tc-sel { position: absolute; display: none; background: color-mix(in srgb, var(--focus) 16%, transparent); border-left: 1px solid var(--focus); border-right: 1px solid var(--focus); pointer-events: none; }
.bchart-wrap svg, .spec svg { width: 100%; height: auto; }

/* ---------- tablas ---------- */
.table-card { padding: 0; overflow: hidden; }
.tscroll { overflow: auto; max-height: calc(100vh - 190px); }
.modal .tscroll { max-height: none; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 7px 10px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--border); }
.grid thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.grid thead tr.grp th { top: 0; font-size: 11px; color: var(--text); border-bottom: 0; padding-bottom: 2px; }
.grid thead tr.grp + tr th { top: 24px; }
.grid tbody tr:nth-child(even) td { background: var(--row-alt); }
.grid tbody tr:hover td { background: var(--row-hover); }
.grid tbody tr.ses td { background: var(--row-ses); }
.grid tbody tr.alert td { color: var(--bad); font-weight: 600; }
.grid tbody tr.off td { color: var(--muted); }
.grid tbody th { text-align: left; font-weight: 600; background: var(--surface); }
.grid.dense th, .grid.dense td { padding: 5px 7px; font-size: 12.5px; }
.grid td.left, .grid th.left { text-align: left; }
.grid td.wide { white-space: normal; min-width: 260px; text-align: left; }
.grid td.num { color: var(--muted); }
.grid td.acts { display: flex; gap: 6px; justify-content: center; }
.grid.mini th, .grid.mini td { padding: 6px 8px; text-align: left; }
.grid.diff th, .grid.diff td { padding: 4px 5px; font-size: 11.5px; }
.grid.diff td.pos { color: var(--good); font-weight: 600; }
.grid.diff td.neg { color: var(--bad); font-weight: 600; }
.badge { display: inline-block; min-width: 38px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 0; line-height: 1.6; }
button.badge { cursor: pointer; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warnb { background: var(--warn-bg); color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 550; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* ---------- equipo ---------- */
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px -4px 12px; padding: 0 4px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--brand); }
.spec-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.spec-title { font-weight: 650; margin-bottom: 4px; }
.sch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10, 13, 18, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 980px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal-card.sm { max-width: 520px; }
.modal-card.lg { max-width: 1000px; }
.modal-card.xl { max-width: 1240px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
body.modal-open { overflow: hidden; }
.kv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.kv span { color: var(--muted); }
.kv.inline { font-size: 13px; }
.note { border-radius: 10px; padding: 11px 14px; }
.note ul { margin: 6px 0 0; padding-left: 20px; }
.note.ok { background: var(--good-bg); color: var(--good); }
.note.warn { background: var(--bad-bg); color: var(--bad); }
.note.err { background: var(--warn-bg); color: var(--warn); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow.end { justify-content: flex-end; }
.insp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.insp { padding: 12px 14px; }
.insp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.insp-head h4 { margin: 0; }
.sumrow { display: flex; flex-direction: column; gap: 6px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.form input[type=text], .form input[type=date], .form input[type=number], .form textarea { border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; background: var(--surface); font-weight: 400; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form .tabs { margin: 0 0 4px; }

/* ---------- carga / avisos ---------- */
.loading { position: fixed; inset: 0; z-index: 90; background: rgba(10, 13, 18, .45); display: flex; align-items: center; justify-content: center; }
.loading[hidden] { display: none; }
.ld-card { background: var(--surface); border-radius: 12px; padding: 20px 24px; width: 320px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.ld-t { font-weight: 600; margin-bottom: 12px; }
.ld-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 95; background: var(--accent); color: var(--surface);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; transition: all .2s; pointer-events: none; max-width: min(560px, 92vw); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); color: #fff; }
#print-root { display: none; }
body.locked #app, body.locked .dropveil { display: none !important; }
.login { position: fixed; inset: 0; z-index: 100; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.login[hidden] { display: none; }
/* Login: mismas medidas que el de Control WEB (tarjeta 430 px, cabecera con logo 270 px, campos y boton de 50 px) */
.login-card { width: min(100%, 430px); overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow), 0 24px 60px rgba(0, 0, 0, .18); text-align: center; }
.login-head { padding: 34px 34px 22px; border-bottom: 1px solid var(--border); }
.login-logo { display: block; width: min(100%, 270px); max-height: 110px; object-fit: contain; margin: 0 auto 24px; }
.login-card h1 { font-size: clamp(1.15rem, 3.6vw, 1.35rem); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.login-body { padding: 28px 34px 30px; display: flex; flex-direction: column; gap: 16px; }
.login-card input { width: 100%; height: 50px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 0 15px; background: var(--surface-2); font-size: 15px; }
.login-card .btn.lg { justify-content: center; height: 50px; margin-top: 6px; border-radius: 12px; font-size: 15.5px; }
@media (max-width: 520px) {
  .login { align-items: flex-start; padding: 22px 12px 16px; }
  .login-card { margin: auto 0; border-radius: 17px; }
  .login-head { padding: 28px 22px 19px; }
  .login-logo { width: min(100%, 235px); max-height: 90px; margin-bottom: 17px; }
  .login-body { padding: 24px 22px 26px; }
  .login-card input, .login-card .btn.lg { height: 48px; }
}
.login-err { color: var(--bad); font-weight: 600; font-size: 13px; }
.login-err:empty { display: none; }

/* ---------- adaptable ---------- */
@media (max-width: 1100px) {
  .view-week, .view-day { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidenav { position: sticky; top: 60px; z-index: 20; width: 100%; height: auto; flex-direction: row; overflow-x: auto; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidenav button { flex: none; padding: 7px 10px; }
  .sidenav button.active { box-shadow: inset 0 -2px 0 var(--brand); }
  .brand-sub, .devchip .dc-meta span:last-child { display: none; }
  .btn span { display: none; }
  .btn { padding: 0 10px; }
  main { padding: 14px 12px 24px; }
  .feats { grid-template-columns: 1fr; }
  .spec-body { grid-template-columns: minmax(0, 1fr); }
  .readout { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .topbar { gap: 10px; padding: 0 10px; }
  .brand img { height: 20px; }
  .devchip { display: none !important; }
  .welcome h1 { font-size: 21px; }
}

/* ---------- informes (impresion) ---------- */
.rp { font-family: "Segoe UI", Arial, sans-serif; color: #111; background: #fff; }
.rp { --chart-bg: #fff; --chart-lane: #f6f7f9; --chart-grid: #e6e9ee; --chart-grid-major: #c9ced6; --chart-axis: #555; --chart-frame: #bbb; --chart-title: #111;
  --c-limit: #e03131; --c-leq: #2b9a3f; --c-l10: #f08c00; --c-l50: #1c8fd6; --c-l90: #3b5bdb; --c-coh: #c2255c; --c-att: #0b8a9e; --c-re: #e8590c;
  --c-ver: #3b5bdb; --c-cal: #e8836a; --c-geq: #74b816; --c-lim: #4a72b0; --muted: #555; --text: #111; --border: #bbb; }
body.preview #app { display: none; }
body.preview #print-root { display: block; max-width: 900px; margin: 0 auto; padding: 20px; background: #fff; }
body.preview .rp-page { border-bottom: 2px dashed #999; margin-bottom: 20px; padding-bottom: 20px; }
.rp-page { page-break-after: always; break-after: page; padding: 0; }
.rp-page:last-child { page-break-after: auto; break-after: auto; }
.rp-cover { text-align: center; padding-top: 30px; }
.rp-logo { height: 46px; margin: 0 auto 30px; }
.rp-cover h1 { font-size: 30px; margin: 10px 0 6px; letter-spacing: .02em; }
.rp-sn { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.rp-inst { font-size: 17px; font-weight: 600; color: #333; margin-bottom: 26px; }
.rp-kv { margin: 26px auto 0; border-collapse: collapse; font-size: 14px; min-width: 60%; }
.rp-kv th { text-align: right; padding: 5px 14px; color: #555; font-weight: 600; width: 40%; }
.rp-kv td { text-align: left; padding: 5px 14px; font-weight: 600; }
.rp-foot { margin-top: 40px; color: #777; font-size: 11px; }
.rp h2 { font-size: 20px; margin: 4px 0 12px; border-bottom: 2px solid #d7191f; padding-bottom: 4px; }
.rp h3 { font-size: 15px; margin: 16px 0 8px; }
.rp h4 { font-size: 13px; margin: 14px 0 6px; }
.rp-t { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 12px; page-break-inside: auto; }
.rp-t th, .rp-t td { border: 1px solid #bbb; padding: 4px 6px; text-align: center; }
.rp-t th { background: #f0f1f3; font-weight: 700; }
.rp-t tr { page-break-inside: avoid; }
.rp-t.rp-small th, .rp-t.rp-small td { font-size: 10px; padding: 2px 3px; }
.rp-t.rp-tiny th, .rp-t.rp-tiny td { font-size: 8.5px; padding: 1px 3px; }
.rp-t.rp-inc td:first-child { text-align: left; }
.rp-ok { color: #1e7a3b; }
.rp-bad { color: #b42318; }
.rp-chart { page-break-inside: avoid; break-inside: avoid; margin: 6px 0; }
.rp-chart svg, .rp > .rp-page > svg { width: 100%; height: auto; }
.rp-break { height: 1px; page-break-before: always; break-before: page; }
.rp-pre { white-space: pre-wrap; font-size: 13px; }
.rp .card { border: 0; padding: 0; box-shadow: none; background: none; margin-bottom: 10px; }
.rp .card-title { color: #333; font-size: 13px; }
.rp .tscroll { max-height: none; overflow: visible; }
.rp table.grid th, .rp table.grid td { border: 1px solid #bbb; padding: 3px 5px; font-size: 11px; background: none !important; position: static; color: #111; }
.rp .badge { background: none !important; color: #111; padding: 0; }
.rp .sch-grid { display: block; }
.rp .legend.sm { color: #333; }

@media print {
  @page { size: A4; margin: 12mm; }
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --chart-bg: #fff; --chart-lane: #f6f7f9; --chart-grid: #e6e9ee; --chart-grid-major: #c9ced6; --chart-axis: #555; --chart-frame: #bbb; --chart-title: #111;
    --c-limit: #e03131; --c-leq: #2b9a3f; --c-l10: #f08c00; --c-l50: #1c8fd6; --c-l90: #3b5bdb; --c-coh: #c2255c; --c-att: #0b8a9e; --c-re: #e8590c;
    --c-ver: #3b5bdb; --c-cal: #e8836a; --c-geq: #74b816; --c-lim: #4a72b0; --muted: #555; --text: #111; --border: #bbb;
  }
  body { background: #fff; }
  body.printing #app, body.printing .modal, body.printing .toast, body.printing .loading, body.printing .dropveil { display: none !important; }
  body.printing #print-root { display: block; }
  body:not(.printing) #print-root { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.username { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .username { display: none; } }
