@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f9f8f4;
  --line: #e3e0d6;
  --line-strong: #cfcabb;
  --text: #1c2119;
  --text-2: #5b6157;
  --text-3: #8a8f84;
  --brand: #1f5a3a;
  --brand-strong: #154129;
  --brand-soft: #e3efe6;
  --accent: #c8a531;
  --on-brand: #ffffff;
  --ok: #23824d;
  --ok-soft: #e1f2e7;
  --warn: #b26b00;
  --warn-soft: #fdf0d9;
  --bad: #c13a2b;
  --bad-soft: #fbe5e1;
  --info: #2c5f9e;
  --info-soft: #e3ecf8;
  --shadow: 0 1px 2px rgba(38, 46, 28, .06), 0 6px 20px rgba(38, 46, 28, .07);
  --card-shadow: 0 0 0 1px rgba(38, 46, 28, .06), 0 1px 2px rgba(38, 46, 28, .05);
  --ink: #163f28;          /* verde de marca profundo: barra lateral, banda y marca (igual en ambos temas) */
  --ink-2: #1f5a3a;
  --paper: #f4f2ec;
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 52px;
  --side: 248px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121512;
    --surface: #1a1e1a;
    --surface-2: #1f241f;
    --line: #2c322c;
    --line-strong: #3a423a;
    --text: #ecefe8;
    --text-2: #aab1a5;
    --text-3: #7d857a;
    --brand: #4fae78;
    --brand-strong: #6cc792;
    --brand-soft: #1d3326;
    --accent: #dcbc4e;
    --on-brand: #0c1a11;
    --ok: #4fbf7d;
    --ok-soft: #183222;
    --warn: #e7a23a;
    --warn-soft: #36290f;
    --bad: #f0715f;
    --bad-soft: #3a1c18;
    --info: #79a7e3;
    --info-soft: #18263a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --card-shadow: 0 0 0 1px var(--line);
  --ink: #12301f;
  --ink-2: #1a4a30;
    --card-shadow: 0 0 0 1px var(--line);
    --ink: #12301f;
    --ink-2: #1a4a30;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121512;
  --surface: #1a1e1a;
  --surface-2: #1f241f;
  --line: #2c322c;
  --line-strong: #3a423a;
  --text: #ecefe8;
  --text-2: #aab1a5;
  --text-3: #7d857a;
  --brand: #4fae78;
  --brand-strong: #6cc792;
  --brand-soft: #1d3326;
  --accent: #dcbc4e;
  --on-brand: #0c1a11;
  --ok: #4fbf7d;
  --ok-soft: #183222;
  --warn: #e7a23a;
  --warn-soft: #36290f;
  --bad: #f0715f;
  --bad-soft: #3a1c18;
  --info: #79a7e3;
  --info-soft: #18263a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
svg { display: block; flex: none; }
.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 28px; height: 28px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: var(--ink); color: #e9efe6;
  display: none; flex-direction: column; padding: 18px 12px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--ink-2); color: var(--paper); display: grid; place-items: center; flex: none; }
.side .brand-mark { background: var(--paper); color: var(--ink); }
.brand-mark svg { width: 24px; height: 24px; }
.brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand > div > span { display: block; font-size: 12.5px; color: var(--text-3); }
.side .brand > div > span { color: rgba(233, 239, 230, .6); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.side .nav a { color: rgba(233, 239, 230, .72); position: relative; transition: background .15s, color .15s; }
.side .nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side .nav a.on { background: rgba(255, 255, 255, .1); color: #fff; }
.side .nav a.on::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #9fd4ae; }
.nav a .count { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; }
.side .avatar { background: rgba(255, 255, 255, .12); color: #fff; }
.side .me .faint { color: rgba(233, 239, 230, .55); }
.avatar { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-strong); border: 0; display: grid; place-items: center; font-weight: 650; font-size: 14px; flex: none; }

.top {
  position: sticky; top: 0; z-index: 15;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 10px; min-height: 58px;
}
.top h1 { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .back { margin-left: -8px; }
.main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
  color: var(--text-3); text-decoration: none; font-size: 11.5px; font-weight: 500; border-radius: 10px; position: relative;
}
.tabbar a.on { color: var(--brand); }
.tabbar a .dot { position: absolute; top: 3px; left: calc(50% + 8px); }

@media (min-width: 900px) {
  .side { display: flex; }
  .tabbar { display: none; }
  .shell { padding-left: var(--side); }
  .main { padding: 24px 32px 48px; }
  .top { padding: 14px 32px; }
  .top h1 { font-size: 22px; }
  .top .back.mobile-only { display: none; }
}

/* ---------- Status bar ---------- */
.netchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.netchip.off { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.netchip.pending { background: var(--info-soft); color: var(--info); border-color: transparent; }
.netchip.err { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.netchip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.netchip.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Building blocks ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 12px; }
.grid.k4 { grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); }
.grid.k4 > .kpi { border: 0; border-radius: 0; box-shadow: none; }
.grid.c2 { grid-template-columns: 1fr; }
.grid.c3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid.k4 { grid-template-columns: repeat(4, 1fr); }
  .grid.c2 { grid-template-columns: 1fr 1fr; }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) { .grid.c3 { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--card-shadow); }
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { display: flex; align-items: center; gap: 8px; }
.section-t { font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--text); margin: 10px 2px -4px; display: flex; align-items: baseline; gap: 8px; }
.section-t .faint, .section-t a { font-size: 14px; font-weight: 500; }
.section-t a { margin-left: auto; }

.kpi { background: var(--surface); border-radius: var(--radius); padding: 14px 16px 15px; min-width: 0; box-shadow: var(--card-shadow); }
.kpi .l { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v small { font-size: 14px; font-weight: 500; color: var(--text-2); margin-left: 3px; }
.kpi .d { font-size: 12.5px; margin-top: 2px; color: var(--text-3); }
.kpi .d.up { color: var(--ok); }
.kpi .d.down { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.big { min-height: 60px; font-size: 18px; border-radius: 16px; padding: 0 22px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.sm { width: 36px; }

/* Banda de marca: verde profundo con textura de surcos */
.band {
  position: relative; overflow: hidden; color: #eef3ea; border-radius: 22px; padding: 20px;
  background: radial-gradient(120% 130% at 100% 0%, #2b7349 0%, transparent 58%), var(--ink);
  isolation: isolate;
}
.band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(118deg, rgba(255, 255, 255, .055) 0 1.5px, transparent 1.5px 15px);
  -webkit-mask-image: linear-gradient(to left, #000 10%, transparent 80%); mask-image: linear-gradient(to left, #000 10%, transparent 80%);
}
.login-band { border-radius: 0; }
.band .eyebrow { font-size: 13.5px; color: rgba(238, 243, 234, .72); font-weight: 500; }
.band h1 { color: #fff; font-size: 28px; letter-spacing: -.02em; }
.band .big { font-size: 56px; font-weight: 650; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.band .big small { font-size: 20px; font-weight: 500; letter-spacing: 0; color: rgba(238, 243, 234, .7); margin-left: 6px; }
.band .inline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14); }
.band .inline b { display: block; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; color: #fff; }
.band .inline span { font-size: 12.5px; color: rgba(238, 243, 234, .7); }
.band a:not(.btn):not(.hero-cta) { color: #cfe8d6; }
.btn.on-band { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn.on-band:hover { background: #fff; }
.btn.on-band.ghost { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.hero-cta { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px 18px 12px 12px; margin-top: 18px; border-radius: 16px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 650; transition: transform .1s, background .15s; }
.hero-cta:active { transform: scale(.985); }
.hero-cta .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.hero-cta b { display: block; font-size: 19px; }
.hero-cta span { display: block; font-size: 13.5px; font-weight: 500; opacity: .7; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); 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.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--info); }

.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer;
}
.item:first-child { border-top: 0; }
a.item:hover, button.item:hover { background: var(--surface-2); }
.item .t { font-weight: 600; }
.item .s { font-size: 14px; color: var(--text-2); }
.item .r { margin-left: auto; text-align: right; flex: none; }
.item .chev { color: var(--text-3); }
.empty { padding: 28px 16px; text-align: center; color: var(--text-3); }
.empty svg { margin: 0 auto 8px; width: 34px; height: 34px; }

.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert p { color: var(--text); }
.alert ul { margin: 4px 0 0; padding-left: 18px; color: var(--text); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 13px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 17px; outline: none;
}
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input.sm { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 62px; }
.input-unit .u { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 15px; pointer-events: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.c2 { grid-template-columns: 1fr 1fr; } .form-grid.c3 { grid-template-columns: repeat(3, 1fr); } .form-grid .span2 { grid-column: span 2; } }
.form-grid.always2 { grid-template-columns: 1fr 1fr; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { min-height: 46px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 0 8px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.ok { background: var(--ok); color: #fff; }
.seg button.on.warn { background: var(--warn); color: #fff; }
.seg button.on.bad { background: var(--bad); color: #fff; }
.seg.sm button { min-height: 36px; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--text-2);
}
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }

.stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.stepper button { height: var(--tap); border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 24px; font-weight: 500; cursor: pointer; }
.stepper .input { text-align: center; font-weight: 600; font-size: 20px; }

.pick { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pick { grid-template-columns: 1fr 1fr; } }
.pick-o {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: left; width: 100%;
}
.pick-o.on { border-color: var(--brand); background: var(--brand-soft); }
.pick-o:disabled { opacity: .55; cursor: not-allowed; }
.pick-o .t { font-weight: 650; }
.pick-o .s { font-size: 13.5px; color: var(--text-2); }

.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check .txt { flex: 1; min-width: 0; }
.check .txt b { font-weight: 600; display: block; }
.check .opts { display: flex; gap: 6px; flex: none; }
.check .opts button {
  width: 64px; height: 48px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font-weight: 700; font-size: 14px; color: var(--text-2); display: grid; place-items: center;
}
.check .opts button.on.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.check .opts button.on.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.check.failed { background: var(--bad-soft); }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; background: var(--surface); }
.toggle input { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked { background: var(--brand); }
.toggle input:checked::after { left: 23px; }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 4px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--brand); }
.wiz-foot {
  position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; gap: 10px; padding: 12px 0 4px; background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (min-width: 900px) { .wiz-foot { bottom: 0; } }
.verdict { border-radius: 18px; padding: 22px; display: flex; gap: 16px; align-items: center; }
.verdict.ok { background: var(--ok); color: #fff; }
.verdict.bad { background: var(--bad); color: #fff; }
.verdict b { font-size: 26px; display: block; letter-spacing: -.01em; }
.verdict svg { width: 44px; height: 44px; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }

/* ---------- Progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; max-height: 300px; }
.chart text { fill: var(--text-3); font-family: var(--font); font-size: 11px; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .b { fill: var(--brand); }
.chart .b2 { fill: var(--bad); }
.chart .b:hover { fill: var(--brand-strong); }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.hbar .tr { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo .pend { position: absolute; left: 4px; bottom: 4px; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line-strong); display: grid; place-items: center; color: var(--text-3); cursor: pointer; text-align: center; font-size: 13px; font-weight: 600; }
.photo-add input { display: none; }

/* ---------- Overlays ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; left: calc(50% + var(--side) / 2); } }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 500; box-shadow: var(--shadow); animation: up .2s ease; pointer-events: auto; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
dialog.modal {
  border: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); margin: auto auto 0; width: 100%; max-width: 100%;
  max-height: 92dvh; overflow: auto; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
}
dialog.modal[open] { animation: up .2s ease; }
dialog.modal:modal { overscroll-behavior: contain; }
dialog.modal::backdrop { background: rgba(10, 14, 10, .45); overflow: hidden; overscroll-behavior: contain; }
@media (min-width: 700px) {
  dialog.modal { margin: auto; width: min(620px, 94vw); border-radius: 20px; padding: 22px; }
  dialog.modal.wide { width: min(860px, 96vw); }
}
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.92); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92dvh; border-radius: 8px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; color: var(--text-2); font-weight: 600; text-decoration: none; border-bottom: 2.5px solid transparent; white-space: nowrap; cursor: pointer; margin-bottom: -1px; }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

.login { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.login-band { padding: calc(env(safe-area-inset-top) + 40px) 24px 88px; text-align: center; }
.login-band .brand { justify-content: center; flex-direction: column; text-align: center; padding: 0; gap: 14px; }
.login-band .brand-mark { width: 60px; height: 60px; border-radius: 18px; background: var(--paper); color: var(--ink); }
.login-band .brand-mark svg { width: 36px; height: 36px; }
.login-band .brand b { font-size: 26px; color: #fff; }
.login-band .brand > div > span { color: rgba(233, 239, 230, .7); font-size: 14px; }
.login .card { position: relative; z-index: 1; width: min(420px, calc(100% - 32px)); margin: -60px auto 24px; padding: 26px 22px; box-shadow: var(--shadow); align-self: start; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 80px; }
@keyframes sk { to { background-position: -200% 0; } }
.split { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .split { grid-template-columns: 1.4fr 1fr; align-items: start; } }

@media print { .side, .tabbar, .top, .no-print { display: none !important; } .shell { padding: 0; } }
.seg.g2 { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 520px) { .seg.g2 { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Detalles de interacción ---------- */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 2px; }
.item, .chip, .pick-o, .seg button, .check .opts button, .tabbar a { transition: background .15s, color .15s, border-color .15s, transform .08s; }
.chip:active, .pick-o:active, .check .opts button:active, .seg button:active { transform: scale(.97); }
h1, h2, h3, .empty p { text-wrap: balance; }
p, .s { text-wrap: pretty; }
.tabbar { box-shadow: 0 -1px 0 var(--line); border-top: 0; }
.tabbar a.on::after { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

/* Lista con barra de estado a la izquierda */
.item.st { position: relative; }
.item.st::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--text-3); opacity: .5; }
.item.st.ok::before { background: var(--ok); opacity: 1; }
.item.st.info::before { background: var(--info); opacity: 1; }
.item.st.bad::before { background: var(--bad); opacity: 1; }
.item.st.warn::before { background: var(--warn); opacity: 1; }
.code { font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* Tarjetas de dron */
.dcard { display: block; text-decoration: none; color: inherit; position: relative; overflow: hidden; padding: 18px; transition: transform .12s, box-shadow .15s; }
.dcard:hover { box-shadow: var(--shadow); }
.dcard:active { transform: scale(.99); }
.dcard .code { font-size: 34px; line-height: 1; letter-spacing: -.03em; }
.dcard .model { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.dcard .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.dcard .nums b { display: block; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dcard .nums span { font-size: 12.5px; color: var(--text-3); }
.dcard .rail { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ok); }
.dcard .rail.warn { background: var(--warn); } .dcard .rail.bad { background: var(--bad); } .dcard .rail.off { background: var(--line-strong); }

/* Paso del asistente */
.step-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.step-h h2 { font-size: 24px; letter-spacing: -.02em; }

/* Resumen compacto de avisos */
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); text-decoration: none; color: inherit; }
.notice .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--bad-soft); color: var(--bad); }
.notice.warn .ic { background: var(--warn-soft); color: var(--warn); }
.notice.ok .ic { background: var(--ok-soft); color: var(--ok); }

/* Banda del panel con gráfica */
.band-split { display: grid; gap: 18px; }
@media (min-width: 900px) { .band-split { grid-template-columns: 1fr 1.2fr; align-items: end; padding: 24px 26px; } }
.band .chart .b { fill: rgba(238, 243, 234, .85); }
.band .chart .b:hover { fill: #fff; }
.band .chart text { fill: rgba(238, 243, 234, .6); }
.band .chart .grid-l { stroke: rgba(255, 255, 255, .1); }
.section-t a, .card-h a { color: var(--brand); text-decoration: none; font-weight: 600; }
.section-t a:hover, .card-h a:hover { text-decoration: underline; }
