@font-face {
  font-family: "BwModelica HS";
  src: url("brand/fonts/BwModelica-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BwModelica HS";
  src: url("brand/fonts/BwModelica-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BwStretch HS";
  src: url("brand/fonts/BwStretch-Black.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #edf2f8;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #142338;
  --muted: #657487;
  --line: #dce5ef;
  --line-strong: #c7d5e4;
  --brand: #003f80;
  --brand-strong: #041c34;
  --accent: #bba757;
  --accent-soft: #fff8df;
  --ok: #16834a;
  --ok-soft: #e7f5ec;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --danger: #b42318;
  --danger-soft: #fdecec;
  --shadow: 0 16px 36px rgba(0, 63, 128, .09);
  --shadow-sm: 0 8px 20px rgba(0, 63, 128, .06);
  --radius: 8px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "BwModelica HS", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    linear-gradient(180deg, rgba(0, 63, 128, .08), rgba(255,255,255,0) 280px),
    var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

a:hover { color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 24px;
  color: #fff;
  background: linear-gradient(110deg, var(--brand-strong), var(--brand));
  border-bottom: 1px solid rgba(187,167,87,.26);
  box-shadow: 0 12px 28px rgba(4, 28, 52, .2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--accent);
  font-size: .82rem;
  font-weight: 900;
}

.brand-logo {
  width: 50px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.brand span {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,.72);
  font-size: .76rem;
  font-weight: 650;
}

.topbar nav,
.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.topbar nav a,
.nav-menu summary,
.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255,255,255,.88);
  background: transparent;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all .15s ease;
}

.topbar nav a:hover,
.topbar nav a.on,
.nav-menu[open] summary,
.nav-menu summary:hover,
.logout-button:hover {
  color: #fff;
  background: rgba(255,255,255,.14);
  border-color: rgba(187,167,87,.45);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  color: rgba(255,255,255,.86);
  font-size: .9rem;
  line-height: 1;
}

.nav-menu {
  position: relative;
  margin: 0;
}

.nav-menu summary {
  list-style: none;
  user-select: none;
}

.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .8;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1100;
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  background: linear-gradient(180deg, #0b2545, #06172b);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .45);
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  color: rgba(255,255,255,.9);
  font-size: .84rem;
  font-weight: 650;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.nav-dropdown a:hover,
.nav-dropdown a.on {
  color: #fff;
  background: rgba(255,255,255,.16);
}

.nav-menu:not([open]) .nav-dropdown { display: none; }

.nav-menu[open] { z-index: 1050; }

.logout-form { display: inline-flex; margin: 0 0 0 4px; }

/* ── Menu agrupado en desplegables (aditivo, sin JS) ───────────────── */
.topbar nav details.nav-group { position: relative; display: inline-flex; }
.topbar nav details.nav-group > summary {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 7px 10px;
  border: 1px solid transparent; border-radius: 8px;
  color: rgba(255,255,255,.78);
  font-size: .82rem; font-weight: 750;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.topbar nav details.nav-group > summary::-webkit-details-marker { display: none; }
.topbar nav details.nav-group > summary::after { content: "▾"; font-size: .65rem; opacity: .75; }
.topbar nav details.nav-group[open] > summary,
.topbar nav details.nav-group > summary:hover {
  color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.12);
}
.topbar nav details.nav-group .nav-panel {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 60;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(2, 22, 42, .22);
}
.topbar nav details.nav-group .nav-panel a {
  min-height: 32px; width: 100%; justify-content: flex-start;
  color: #24313d; font-size: .82rem; font-weight: 650; border-radius: 6px;
}
.topbar nav details.nav-group .nav-panel a:hover,
.topbar nav details.nav-group .nav-panel a.on {
  color: var(--brand-strong); background: var(--bg); border-color: transparent;
}
@media (max-width: 720px) {
  .topbar nav details.nav-group { display: block; width: 100%; }
  .topbar nav details.nav-group .nav-panel {
    position: static; box-shadow: none; border: 0; padding: 2px 0 2px 14px; min-width: 0;
  }
  .topbar nav details.nav-group .nav-panel a { color: rgba(255,255,255,.72); }
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: "BwStretch HS", "BwModelica HS", "Segoe UI", sans-serif;
  font-size: 1.55rem;
  line-height: 1.12;
}

h2 {
  margin: 0 0 14px;
  color: var(--brand-strong);
  font-family: "BwStretch HS", "BwModelica HS", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.22;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title h1 { margin-bottom: 6px; }

.page-title p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: .92rem;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.kpi .n {
  color: var(--brand-strong);
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1.05;
}

.kpi .l {
  margin-top: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.kpi.warn::before { background: var(--warn); }
.kpi.warn .n { color: var(--warn); }

.card {
  margin-bottom: 18px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card.tight { padding: 14px; }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.quick-card {
  display: block;
  min-height: 122px;
  padding: 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.quick-card:hover {
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.quick-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-strong);
  font-size: .98rem;
}

.quick-card span {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-card textarea {
  min-height: 118px;
}

.action-card .btn {
  align-self: flex-start;
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

tr:hover td { background: #fbfdff; }

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-size: .88rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.sm { min-height: 30px; padding: 6px 10px; font-size: .78rem; }
.btn.gray { color: var(--ink); background: #eef2f7; border-color: var(--line); }
.btn.gray:hover { color: var(--ink); background: #e2e8f0; }
.btn.green { background: var(--ok); }
.btn.green:hover { background: #10652d; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #a82820; border-color: #a82820; }
.btn.ghost { color: var(--brand); background: #fff; border-color: var(--line); }
.btn.ghost:hover { color: var(--brand-strong); background: var(--accent-soft); border-color: rgba(187,167,87,.52); }

input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: .92rem;
}

textarea { min-height: 90px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(187, 167, 87, .22);
}

label {
  display: block;
  margin: 10px 0 5px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.flash {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .9rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.flash.ok { color: var(--ok); background: var(--ok-soft); border-color: #bfe7cc; }
.flash.err { color: var(--danger); background: var(--danger-soft); border-color: #fac9c4; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--accent-soft);
  font-size: .74rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.deuda { color: var(--danger); background: var(--danger-soft); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }

.muted { color: var(--muted); font-size: .85rem; }
.right { text-align: right; }

.section-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.control-shell {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.control-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.control-main h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.25rem;
}

.control-main p { margin: 0; color: var(--muted); }

.control-actions,
.driver-command-actions,
.driver-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.control-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.metric-card span,
.driver-metrics span,
.driver-topline span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--brand-strong);
  font-family: "BwStretch HS", "BwModelica HS", "Segoe UI", sans-serif;
  font-size: 1.32rem;
  line-height: 1.05;
}

.metric-card.strong {
  background: var(--brand);
  border-color: var(--brand);
}

.metric-card.strong span,
.metric-card.strong strong { color: #fff; }
.metric-card.warn strong { color: var(--warn); }
.metric-card.danger strong { color: var(--danger); }

.live-strip,
.live-board {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.live-strip {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.live-mini,
.driver-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.live-mini-head,
.driver-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.live-mini p,
.driver-card p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: .86rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f7;
  font-size: .72rem;
  font-weight: 900;
}

.status-chip.programada { color: var(--warn); background: var(--warn-soft); }
.status-chip.en_curso { color: var(--ok); background: var(--ok-soft); }
.status-chip.cerrada { color: var(--brand); background: var(--accent-soft); }
.status-chip.cancelada { color: var(--danger); background: var(--danger-soft); }

.mini-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.mini-progress span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--accent);
}

.live-mini-grid,
.driver-metrics,
.driver-topline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.live-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
}

.mini-alert,
.location-line.danger {
  margin-top: 10px;
  color: var(--danger);
  font-size: .82rem;
  font-weight: 850;
}

.driver-card header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.driver-card header h2 { margin-bottom: 4px; }

.driver-topline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.driver-topline strong,
.driver-metrics strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.1;
}

.driver-topline small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .76rem;
}

.driver-metrics {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.driver-metrics > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.driver-metrics .danger strong { color: var(--danger); }

.location-line {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .84rem;
}

.driver-card footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.alert-list { display: grid; gap: 8px; }

.alert-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.alert-row.alta { border-left-color: var(--danger); }
.alert-row.media { border-left-color: var(--warn); }
.alert-row small { color: var(--muted); }

.driver-command {
  position: sticky;
  top: 84px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.driver-command h2 { margin-bottom: 4px; }
.driver-command p { margin: 0; color: var(--muted); }
.btn.xl { min-height: 48px; padding: 12px 16px; font-size: .96rem; }
.route-kpis .kpi { min-height: 96px; }

details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 850;
}

.login-shell {
  width: min(420px, 100%);
  margin: 7vh auto;
}

.login-brand {
  margin-bottom: 18px;
  text-align: center;
}

.login-mark {
  display: inline-block;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  object-fit: contain;
  border-radius: 12px;
  color: var(--brand-strong);
  background: #fff;
  border: 1px solid rgba(187,167,87,.38);
  padding: 6px;
  font-weight: 950;
}

.login-brand h1 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.stat-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 12px;
}

.section-heading h2 { margin-bottom: 4px; }

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.packaging-stock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.packaging-stock-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.packaging-stock-code {
  display: inline-flex;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid #b8e3dc;
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--accent-soft);
  font-size: .78rem;
  font-weight: 900;
}

.packaging-stock-item div { min-width: 0; }

.packaging-stock-item strong,
.packaging-stock-item span,
.packaging-stock-item small {
  display: block;
}

.packaging-stock-item strong {
  color: var(--brand-strong);
  font-size: 1.7rem;
  line-height: 1;
}

.packaging-stock-item div > span {
  margin-top: 5px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 800;
}

.packaging-stock-item small {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .7rem;
}

.packaging-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.packaging-reason { grid-column: span 2; }
.packaging-submit { min-height: 40px; }
.inventory-delta { font-weight: 900; }
.inventory-delta.positive { color: var(--ok); }
.inventory-delta.negative { color: var(--danger); }
.consumables-orders { margin-top: 30px; }
.form-actions { margin-top: 14px; }

@font-face {
  font-family: "HS Modelica";
  src: url("brand/bw-modelica-light.otf") format("opentype");
  font-weight: 400;
}

@font-face {
  font-family: "HS Modelica";
  src: url("brand/bw-modelica-bold.otf") format("opentype");
  font-weight: 800;
}

.commercial-page {
  --brand-blue: #003F80;
  --brand-blue-dark: #041C34;
  --brand-gold: #BBA757;
  --brand-silver: #A7A9AC;
  display: grid;
  gap: 26px;
  font-family: "HS Modelica", "Segoe UI", system-ui, sans-serif;
}

.commercial-floating-cta {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  color: #fff;
  background: #0f7a3a;
  box-shadow: 0 14px 34px rgba(15, 122, 58, .28);
}

.commercial-floating-cta:hover {
  color: #fff;
  background: #0b6530;
}

.commercial-floating-cta svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.commercial-floating-cta span {
  font-size: .82rem;
  font-weight: 900;
}

.commercial-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  padding: 104px 44px 54px;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--brand-blue-dark);
  background-repeat: no-repeat;
  background-size: auto 106%;
  background-position: right top;
  box-shadow: var(--shadow);
  isolation: isolate;
  animation: commercial-pan 16s ease-in-out infinite alternate;
}

.commercial-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 7px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-gold), var(--brand-silver), var(--brand-blue));
  z-index: -1;
}

.commercial-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("brand/hs-avatar-pattern.png");
  background-repeat: no-repeat;
  background-size: 330px auto;
  background-position: calc(100% - 42px) calc(100% - 24px);
  opacity: .08;
  z-index: 0;
}

.commercial-watermark {
  position: absolute;
  right: 42px;
  bottom: 38px;
  width: 190px;
  max-width: 26vw;
  opacity: .11;
  z-index: 1;
  pointer-events: none;
}

.commercial-nav {
  position: absolute;
  top: 22px;
  right: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(3, 20, 31, .58);
  backdrop-filter: blur(14px);
  z-index: 3;
}

.commercial-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 900;
}

.commercial-logo img {
  display: block;
  width: 174px;
  height: auto;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}

.commercial-logo span {
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.commercial-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(3, 20, 31, .42);
  backdrop-filter: blur(12px);
}

.commercial-nav-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  font-weight: 850;
}

.commercial-nav-actions a:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}

.commercial-hero-copy {
  position: relative;
  z-index: 2;
  width: min(620px, 100%);
  max-width: 100%;
  min-width: 0;
  color: #fff;
}

.commercial-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(187,167,87,.58);
  border-radius: 8px;
  color: #f3df8e;
  background: rgba(3, 20, 31, .46);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.commercial-hero h1 {
  margin: 14px 0 12px;
  color: #fff;
  font-size: 3.25rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.commercial-lead {
  width: 100%;
  max-width: 610px;
  color: rgba(255,255,255,.9);
  font-size: 1.12rem;
  font-weight: 600;
  overflow-wrap: break-word;
}

.commercial-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.commercial-page .btn.green {
  background: var(--brand-blue);
  box-shadow: 0 10px 26px rgba(0, 63, 128, .16);
}

.commercial-page .btn.green:hover {
  background: #002f61;
}

.commercial-page .btn.ghost {
  color: var(--brand-blue);
  border-color: rgba(187,167,87,.5);
  box-shadow: 0 10px 26px rgba(0, 63, 128, .12);
}

.commercial-page .btn.ghost:hover {
  color: #002f61;
  background: #fffaf0;
  border-color: var(--brand-gold);
}

.commercial-page .btn.green::before,
.commercial-page .btn.ghost::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.commercial-page .btn.green::before { background: var(--brand-gold); }
.commercial-page .btn.ghost::before { background: var(--brand-silver); }

.commercial-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  max-width: 590px;
}

.commercial-trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.08);
  font-size: .78rem;
  font-weight: 800;
}

.commercial-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: -50px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.commercial-strip > div {
  min-height: 104px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.commercial-strip > div:hover {
  transform: translateY(-3px);
  border-color: rgba(187,167,87,.55);
  box-shadow: var(--shadow);
}

.commercial-strip strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-blue);
  font-size: 1.25rem;
}

.commercial-strip span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

/* Diferenciador de planta: el tren físico y el costo de energía hacen
   tangible que el SaaS va más allá de ventas y reparto. */
.commercial-plant-proof {
  display: grid;
  gap: 22px;
  margin: 42px 0;
  padding: clamp(22px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(100, 181, 246, .32);
  border-radius: calc(var(--radius) + 4px);
  color: #f4f8fc;
  background:
    radial-gradient(circle at 88% 4%, rgba(68, 156, 219, .34), transparent 27%),
    linear-gradient(135deg, #031526 0%, #062d4d 55%, #06416d 100%);
  box-shadow: 0 22px 55px rgba(0, 32, 60, .19);
}

.commercial-plant-proof > *,
.plant-proof-head > * {
  min-width: 0;
}

.plant-proof-head {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(260px, .78fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: end;
}

.commercial-plant-proof .commercial-eyebrow {
  color: #b8ddff;
  border-color: rgba(143, 207, 255, .48);
  background: rgba(255,255,255,.06);
}

.plant-proof-head h2 {
  max-width: 760px;
  margin: 14px 0 10px;
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 1.06;
}

.plant-proof-head p {
  max-width: 770px;
  margin: 0;
  color: rgba(236, 246, 255, .86);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.58;
}

.plant-proof-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.plant-proof-actions .btn.ghost {
  color: #eaf5ff;
  border-color: rgba(185, 222, 249, .45);
  background: rgba(255,255,255,.06);
  box-shadow: none;
}

.plant-proof-actions .btn.ghost:hover {
  color: #062d4d;
  background: #fff;
}

.plant-proof-actions small {
  max-width: 340px;
  color: rgba(218, 237, 252, .76);
  font-size: .78rem;
  line-height: 1.42;
}

.plant-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plant-value-grid article {
  position: relative;
  min-height: 138px;
  padding: 18px 16px 16px 58px;
  border: 1px solid rgba(193, 226, 250, .18);
  border-radius: 12px;
  background: rgba(1, 16, 30, .25);
}

.plant-value-number {
  position: absolute;
  top: 17px;
  left: 16px;
  color: #8dc9f5;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.plant-value-grid strong {
  display: block;
  margin-bottom: 7px;
  color: #fff;
  font-size: .96rem;
}

.plant-value-grid p {
  margin: 0;
  color: rgba(228, 242, 253, .78);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.43;
}

.plant-flow-showcase {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(189, 225, 249, .25);
  border-radius: 14px;
  background: rgba(0, 16, 29, .32);
}

.plant-flow-showcase figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 4px 12px;
}

.plant-flow-title {
  color: #fff;
  font-size: .95rem;
  font-weight: 900;
}

.plant-flow-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b9e9d1;
  font-size: .76rem;
  font-weight: 800;
}

.plant-flow-live i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #47cf8d;
  box-shadow: 0 0 0 0 rgba(71, 207, 141, .65);
  animation: plant-flow-pulse 1.8s ease-out infinite;
}

@keyframes plant-flow-pulse {
  70% { box-shadow: 0 0 0 7px rgba(71, 207, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(71, 207, 141, 0); }
}

.plant-flow-canvas {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(176, 211, 239, .44);
  border-radius: 9px;
  background: #f2f6fb;
  scrollbar-color: rgba(143, 207, 255, .7) transparent;
}

.plant-flow-canvas img {
  display: block;
  width: 100%;
  min-width: 1120px;
  height: auto;
}

.plant-flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 4px 3px;
}

.plant-flow-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #e9f5ff;
  font-size: .72rem;
  font-weight: 800;
}

.plant-flow-legend .raw { background: rgba(61, 143, 214, .21); }
.plant-flow-legend .filter { background: rgba(143, 164, 188, .2); }
.plant-flow-legend .product { background: rgba(31, 157, 106, .22); }
.plant-flow-legend .delivery { background: rgba(143, 127, 232, .2); }

.plant-flow-note {
  margin: 10px 4px 3px;
  color: rgba(218, 237, 252, .73);
  font-size: .76rem;
  line-height: 1.42;
}

/* Mapa de capacidades reales: reemplaza la maqueta de tienda y no simula
   pedidos, productos ni pagos que el SaaS no procese. */
.commercial-real-features {
  display: grid;
  gap: 20px;
  margin: 42px 0;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid rgba(0, 63, 128, .19);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, #f8fbff 0%, #edf5fc 100%);
  box-shadow: var(--shadow-sm);
}

.real-features-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.real-features-head > div { max-width: 760px; }

.real-features-head h2 {
  margin: 14px 0 9px;
  color: var(--brand-blue);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.08;
}

.real-features-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.56;
}

.real-features-head .btn { flex: 0 0 auto; }

.real-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.real-feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 218px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-blue);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 63, 128, .06);
}

.real-feature-card:nth-child(2) { border-top-color: #16834a; }
.real-feature-card:nth-child(3) { border-top-color: #b7841d; }
.real-feature-card:nth-child(4) { border-top-color: #4f46c9; }

.real-feature-number {
  color: var(--brand-blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.real-feature-card h3 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.real-feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.47;
}

.real-feature-plan {
  align-self: flex-start;
  margin-top: auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: #eef6ff;
  font-size: .69rem;
  font-weight: 850;
}

.real-features-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(183, 132, 29, .34);
  border-radius: 10px;
  color: #5d4816;
  background: #fffaf0;
}

.real-features-note strong { font-size: .9rem; }

.real-features-note p {
  margin: 0;
  color: #71613d;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.42;
}

.real-features-note a {
  color: var(--brand-strong);
  font-size: .8rem;
  font-weight: 850;
  white-space: nowrap;
}

.commercial-marketplace {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(0,63,128,.18);
  border-radius: var(--radius);
  background: #eef4fb;
  box-shadow: var(--shadow-sm);
}

.market-topbar {
  display: grid;
  grid-template-columns: minmax(200px, .8fr) minmax(280px, 1.4fr) minmax(150px, .55fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--brand-blue);
  box-shadow: 0 14px 28px rgba(0, 63, 128, .18);
}

.market-brand,
.market-location {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #fff;
}

.market-brand {
  gap: 10px;
}

.market-brand:hover,
.market-location:hover {
  color: #fff;
}

.market-brand img {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.14);
}

.market-brand span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.market-brand strong {
  overflow: hidden;
  color: #fff;
  font-size: .96rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-brand small {
  overflow: hidden;
  color: rgba(255,255,255,.76);
  font-size: .72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 -1px 0 rgba(15,23,42,.06);
}

.market-search input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
}

.market-search input:focus {
  outline: 3px solid rgba(187,167,87,.26);
  outline-offset: -3px;
}

.market-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--brand-blue);
  background: #f8fbff;
  cursor: pointer;
}

.market-search button:hover {
  background: #fffaf0;
}

.market-search svg,
.market-location svg,
.market-benefits svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.market-location {
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  font-size: .78rem;
  font-weight: 900;
}

.market-navline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 42px;
  padding: 0 4px;
}

.market-navline a,
.market-navline span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--brand-blue);
  background: rgba(255,255,255,.72);
  font-size: .78rem;
  font-weight: 850;
}

.market-navline span {
  margin-left: auto;
  color: var(--muted);
  background: transparent;
}

.market-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, .55fr);
  gap: 12px;
}

.market-promo {
  position: relative;
  overflow: hidden;
  min-height: 154px;
  border: 1px solid rgba(0,63,128,.16);
  border-radius: var(--radius);
  background: #fff;
}

.market-promo-main {
  display: flex;
  align-items: stretch;
  min-height: 250px;
  grid-row: span 2;
}

.market-promo-main img {
  width: 44%;
  min-width: 250px;
  object-fit: cover;
}

.market-promo-main > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px;
}

.market-promo span {
  display: inline-flex;
  align-self: flex-start;
  min-height: 26px;
  margin-bottom: 12px;
  padding: 5px 9px;
  border-radius: 8px;
  color: #5b4a10;
  background: #fff4bf;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.market-promo h2 {
  margin: 0 0 10px;
  color: var(--brand-blue);
  font-size: 1.72rem;
  line-height: 1.08;
}

.market-promo p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 650;
}

.market-promo .btn {
  align-self: flex-start;
  margin-top: 18px;
}

.market-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(135deg, #fff, #f8fbff);
}

.market-side.gold {
  background: linear-gradient(135deg, #fff, #fffaf0);
}

.market-side strong {
  display: block;
  color: var(--brand-blue);
  font-size: 1.05rem;
  line-height: 1.14;
}

.market-side small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.market-departments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.market-departments a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 10px;
  min-height: 92px;
  padding: 13px;
  border: 1px solid rgba(0,63,128,.14);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}

.market-departments a:hover {
  color: var(--ink);
  border-color: rgba(187,167,87,.62);
  transform: translateY(-2px);
}

.market-departments span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-blue);
  font-size: .78rem;
  font-weight: 950;
}

.market-departments strong {
  min-width: 0;
  color: var(--brand-blue);
  line-height: 1.14;
}

.market-departments small {
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.22;
}

.market-benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.market-benefits > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-height: 84px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.market-benefits svg {
  grid-row: span 2;
  align-self: center;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 8px;
  color: var(--brand-blue);
  background: #eef6ff;
}

.market-benefits strong {
  min-width: 0;
  color: var(--brand-blue);
  font-size: .86rem;
  line-height: 1.16;
}

.market-benefits span {
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.22;
}

.market-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 6px;
}

.market-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.market-filter button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(0,63,128,.14);
  border-radius: 8px;
  color: var(--brand-blue);
  background: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
}

.market-filter button:hover,
.market-filter button.active {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.market-shopping-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.market-product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 384px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}

.market-product-media {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: #e5eef8;
}

.market-product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.market-product-media span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(4,28,52,.76);
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.market-product-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
}

.market-product-copy strong {
  min-height: 42px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.14;
}

.market-product-copy p {
  min-height: 42px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}

.market-price {
  margin-top: 12px;
  color: var(--brand-blue);
  font-size: 1.42rem;
  font-weight: 950;
  line-height: 1.04;
}

.market-price small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.market-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.market-product-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--brand);
  background: var(--accent-soft);
  font-size: .7rem;
  font-weight: 850;
}

.market-product-copy a,
.market-product-copy button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  margin-top: auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-blue);
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
}

.market-product-copy a:hover,
.market-product-copy button:hover {
  color: #fff;
  background: #002f61;
}

.market-cart {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  min-height: 320px;
  padding: 16px;
  border: 1px solid rgba(0,63,128,.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.market-cart-header {
  display: grid;
  gap: 4px;
}

.market-cart-header span {
  color: var(--brand-gold);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.market-cart-header strong {
  color: var(--brand-blue);
  font-size: 1.18rem;
}

.market-cart-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed rgba(0,63,128,.2);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbff;
  font-size: .82rem;
  font-weight: 750;
}

.market-cart-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.market-cart-items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.market-cart-items strong {
  overflow: hidden;
  color: var(--ink);
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-cart-items span {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

.market-cart-items em {
  grid-row: span 2;
  align-self: center;
  color: var(--brand-blue);
  font-style: normal;
  font-weight: 950;
}

.market-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.market-cart-total span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}

.market-cart-total strong {
  color: var(--brand-blue);
  font-size: 1.08rem;
}

.market-cart small {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.35;
}

.market-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed rgba(0,63,128,.28);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  text-align: center;
}

.commercial-photo-band {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap: 14px;
}

.photo-card {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--brand-blue-dark);
  box-shadow: var(--shadow-sm);
}

.photo-card-main {
  min-height: 300px;
}

.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,28,52,.12), rgba(4,28,52,.78));
}

.photo-card-copy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 1;
  color: #fff;
}

.photo-card-copy span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 9px;
  border: 1px solid rgba(187,167,87,.72);
  border-radius: 8px;
  color: #fff3bd;
  background: rgba(4,28,52,.48);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.photo-card-copy strong {
  display: block;
  max-width: 360px;
  font-size: 1.05rem;
  line-height: 1.18;
}

.sales-problem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sales-problem {
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--shadow-sm);
}

.sales-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid rgba(187,167,87,.45);
  border-radius: 8px;
  color: var(--brand-blue);
  background: #fffaf0;
}

.sales-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-problem strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-blue);
  font-size: .98rem;
}

.sales-problem p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

.commercial-section {
  padding: 12px 0;
}

.commercial-flow {
  margin-top: 4px;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flow-step {
  position: relative;
  min-height: 170px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.flow-step::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--brand-blue);
}

.flow-step:nth-child(2)::before { background: var(--brand-gold); }
.flow-step:nth-child(3)::before { background: var(--brand-silver); }
.flow-step:nth-child(4)::before { background: var(--brand-blue); }

.flow-step-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.flow-index {
  display: block;
  color: #cbd5e1;
  font-size: 2.2rem;
  font-weight: 950;
  line-height: 1;
}

.flow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0,63,128,.18);
  border-radius: 8px;
  color: var(--brand-blue);
  background: #f8fbff;
}

.flow-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-step strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-blue);
  font-size: .98rem;
}

.flow-step p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.commercial-spotlight {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #041C34 0%, #062B52 58%, #003F80 100%);
  box-shadow: var(--shadow);
}

.spotlight-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 360px;
  padding: 12px;
  color: #fff;
}

.spotlight-brand {
  width: 210px;
  max-width: 78%;
  margin-bottom: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
}

.spotlight-copy h2 {
  margin: 14px 0 12px;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1.12;
}

.spotlight-copy p {
  color: rgba(255,255,255,.78);
  font-size: .98rem;
}

.spotlight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.spotlight-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  color: #fff7d8;
  background: rgba(255,255,255,.08);
  font-size: .78rem;
  font-weight: 850;
}

.product-preview {
  overflow: hidden;
  min-height: 360px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: #082838;
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}

.product-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.commercial-calculator {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(0,63,128,.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f8fbff 0%, #fff 54%, #fffaf0 100%);
  box-shadow: var(--shadow-sm);
}

.calculator-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.calculator-copy h2 {
  margin: 14px 0 10px;
  color: var(--brand-blue);
  font-size: 1.65rem;
  line-height: 1.14;
}

.calculator-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.calculator-result {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(0,63,128,.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.calculator-result span,
.calculator-result small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.calculator-result strong {
  display: block;
  margin: 6px 0;
  color: var(--brand-blue);
  font-size: 2rem;
  line-height: 1.05;
}

.loss-calculator {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.loss-calculator label,
.lead-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--brand-blue);
  font-size: .78rem;
  font-weight: 900;
}

.loss-calculator input,
.lead-form input,
.lead-form select,
.lead-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: .9rem;
}

.lead-form textarea {
  min-height: 92px;
  resize: vertical;
}

.loss-calculator input:focus,
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  outline: 3px solid rgba(0,63,128,.12);
  border-color: var(--brand-blue);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.pricing-featured {
  border-color: rgba(187,167,87,.74);
  background: linear-gradient(180deg, #fffaf0, #fff);
  box-shadow: var(--shadow);
}

.plan-tag {
  align-self: flex-start;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(0,63,128,.16);
  border-radius: 8px;
  color: var(--brand-blue);
  background: #f8fbff;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pricing-card h3 {
  margin: 18px 0 8px;
  color: var(--brand-blue);
  font-size: 1.2rem;
}

.plan-price {
  display: block;
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.12;
}

.pricing-card p {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}

.pricing-card ul {
  display: grid;
  gap: 8px;
  margin: 4px 0 20px;
  padding: 0;
  list-style: none;
}

.pricing-card li {
  position: relative;
  padding-left: 20px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 750;
}

.pricing-card li::before {
  content: "";
  position: absolute;
  top: .6em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand-gold);
}

.pricing-card .btn {
  margin-top: auto;
  justify-content: center;
}

.commercial-contact {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(187,167,87,.4);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #041C34 0%, #083A69 68%, #003F80 100%);
  box-shadow: var(--shadow);
}

.contact-copy {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 360px;
  padding: 8px;
  color: #fff;
}

.contact-copy h2 {
  margin: 14px 0 10px;
  color: #fff;
  font-size: 1.65rem;
  line-height: 1.14;
}

.contact-copy p {
  color: rgba(255,255,255,.78);
  font-weight: 650;
}

.contact-copy img {
  width: 112px;
  margin-top: 18px;
  opacity: .82;
}

.lead-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 42px rgba(0,0,0,.18);
}

.lead-form-wide {
  grid-column: 1 / -1;
}

.lead-form .btn {
  justify-content: center;
  min-height: 46px;
}

.lead-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.commercial-close {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(187,167,87,.48);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff 0%, #f8fbff 58%, #fffaf0 100%);
  box-shadow: var(--shadow-sm);
}

.commercial-close::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("brand/hs-avatar-pattern.png");
  background-size: 210px auto;
  background-repeat: no-repeat;
  background-position: right -22px bottom -36px;
  opacity: .12;
  pointer-events: none;
}

.commercial-close > * {
  position: relative;
  z-index: 1;
}

.commercial-close-mark {
  width: 96px;
  opacity: .72;
}

.commercial-close h2 {
  margin: 12px 0 8px;
}

.commercial-close p {
  margin: 0;
  color: var(--muted);
}

@keyframes commercial-pan {
  from { background-position: right top; }
  to { background-position: right 20%; }
}

@media (prefers-reduced-motion: reduce) {
  .commercial-hero { animation: none; }
  .commercial-strip > div { transition: none; }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand { width: 100%; }
  .topbar nav { justify-content: flex-start; width: 100%; }
  .topbar nav a, .nav-menu summary, .logout-button { font-size: .78rem; }
  .nav-menu { position: static; }
  .nav-dropdown {
    position: static;
    min-width: min(260px, calc(100vw - 32px));
    margin-top: 4px;
  }
  main, footer { width: min(100% - 24px, 1180px); }
  .page-head { flex-direction: column; }
  .packaging-stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packaging-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packaging-reason { grid-column: 1 / -1; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-main,
  .driver-command {
    align-items: stretch;
    flex-direction: column;
  }
  .control-actions,
  .driver-command-actions {
    justify-content: flex-start;
    width: 100%;
  }
  .control-actions .btn,
  .driver-command-actions .btn {
    flex: 1 1 180px;
  }
  .driver-command {
    position: static;
  }
  .driver-topline {
    grid-template-columns: 1fr;
  }
  .studio-dashboard { gap: 14px; }
  .ops-hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    padding: 18px;
  }
  .ops-hero h1 { font-size: 1.6rem; }
  .ops-actions {
    justify-content: flex-start;
    max-width: none;
  }
  .ops-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .department-board,
  .ops-panels { grid-template-columns: 1fr; }
  .department-card { min-height: auto; }
  .commercial-hero { min-height: 540px; padding: 94px 28px 34px; }
  .commercial-nav { top: 18px; right: 18px; left: 18px; }
  .commercial-nav-actions { display: none; }
  .commercial-logo img { width: 158px; }
  .commercial-logo span { font-size: .72rem; }
  .commercial-watermark { width: 150px; opacity: .08; }
  .commercial-hero h1 { font-size: 2.1rem; }
  .commercial-strip { grid-template-columns: 1fr; margin-top: -28px; padding: 0 12px; }
  .commercial-plant-proof { margin: 30px 0; }
  .plant-proof-head { grid-template-columns: 1fr; }
  .plant-value-grid { grid-template-columns: 1fr; }
  .real-features-head { align-items: flex-start; flex-direction: column; }
  .real-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .real-features-note { grid-template-columns: 1fr; }
  .commercial-marketplace { padding: 14px; }
  .market-topbar { grid-template-columns: 1fr; }
  .market-location { justify-content: flex-start; }
  .market-navline span { margin-left: 0; width: 100%; }
  .market-hero-grid { grid-template-columns: 1fr; }
  .market-promo-main { flex-direction: column; }
  .market-promo-main img { width: 100%; min-width: 0; height: 210px; }
  .market-departments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-toolbar { align-items: flex-start; flex-direction: column; }
  .market-filter { justify-content: flex-start; }
  .market-shopping-layout { grid-template-columns: 1fr; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-cart { position: static; }
  .commercial-photo-band { grid-template-columns: 1fr; }
  .photo-card,
  .photo-card-main { min-height: 230px; }
  .sales-problem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-calculator,
  .commercial-contact { grid-template-columns: 1fr; padding: 18px; }
  .calculator-copy h2,
  .contact-copy h2 { font-size: 1.35rem; }
  .contact-copy { min-height: auto; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card { min-height: auto; }
  .commercial-spotlight { grid-template-columns: 1fr; padding: 18px; }
  .spotlight-copy { min-height: auto; }
  .product-preview { min-height: 300px; }
  .commercial-close { align-items: flex-start; flex-direction: column; }
  th, td { padding: 10px 8px; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .control-metrics,
  .live-strip,
  .driver-metrics,
  .live-mini-grid {
    grid-template-columns: 1fr;
  }
  .metric-card,
  .live-mini,
  .driver-card {
    min-height: auto;
  }
  .btn.xl {
    width: 100%;
  }
  .stop-form {
    grid-template-columns: 1fr !important;
  }
  .packaging-stock-grid,
  .packaging-form-grid { grid-template-columns: 1fr; }
  .packaging-reason { grid-column: auto; }
  .packaging-stock-item { min-height: 104px; }
  .quick-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .kpi { min-height: auto; }
  .ops-hero { padding: 16px; }
  .ops-hero h1 { font-size: 1.42rem; }
  .ops-kpi-grid { grid-template-columns: 1fr; }
  .studio-kpi { min-height: auto; padding: 16px; }
  .department-card { padding: 16px; }
  .dept-metrics { flex-wrap: wrap; }
  .dept-metrics strong { font-size: 1.15rem; }
  .priority-list a { min-height: auto; }
  .commercial-hero {
    min-height: 520px;
    padding: 22px;
    padding-top: 92px;
    background-size: cover;
    background-position: center top;
  }
  .commercial-hero h1 { font-size: 1.72rem; }
  .commercial-logo { gap: 8px; }
  .commercial-logo img { width: 138px; padding: 4px 7px; }
  .commercial-logo span { display: none; }
  .commercial-watermark { display: none; }
  .commercial-lead {
    max-width: 280px;
    font-size: .92rem;
    line-height: 1.42;
  }
  .commercial-actions .btn { width: 100%; }
  .commercial-trust-row span { width: 100%; }
  .commercial-plant-proof { padding: 18px; }
  .plant-proof-head h2 { font-size: 1.55rem; }
  .plant-flow-showcase { padding: 9px; }
  .plant-flow-showcase figcaption { align-items: flex-start; flex-direction: column; gap: 4px; }
  .plant-flow-canvas img { min-width: 1120px; }
  .commercial-real-features { padding: 18px; }
  .real-feature-grid { grid-template-columns: 1fr; }
  .real-feature-card { min-height: 0; }
  .real-features-note a { white-space: normal; }
  .commercial-marketplace { padding: 10px; }
  .market-topbar { padding: 10px; }
  .market-brand img { width: 36px; height: 36px; }
  .market-brand strong { font-size: .88rem; }
  .market-search { grid-template-columns: minmax(0, 1fr) 42px; }
  .market-search input { min-height: 42px; font-size: .84rem; }
  .market-search button { min-width: 42px; }
  .market-promo-main img { height: 180px; }
  .market-promo-main > div,
  .market-side { padding: 14px; }
  .market-promo h2 { font-size: 1.32rem; }
  .market-departments { grid-template-columns: 1fr; }
  .market-benefits { grid-template-columns: 1fr; }
  .market-grid { grid-template-columns: 1fr; }
  .market-product { min-height: auto; }
  .market-product-copy strong,
  .market-product-copy p { min-height: 0; }
  .photo-card,
  .photo-card-main { min-height: 210px; }
  .photo-card-copy strong { font-size: .96rem; }
  .commercial-floating-cta {
    right: 12px;
    bottom: 12px;
    min-height: 42px;
    padding: 10px;
  }
  .commercial-floating-cta span { display: none; }
  .sales-problem-grid { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .flow-step { min-height: 138px; }
  .flow-step-top { margin-bottom: 18px; }
  .flow-index { font-size: 1.9rem; }
  .flow-icon { width: 38px; height: 38px; }
  .loss-calculator,
  .lead-form { grid-template-columns: 1fr; padding: 14px; }
  .calculator-result strong { font-size: 1.55rem; }
  .commercial-spotlight { padding: 14px; }
  .spotlight-brand { width: 170px; }
  .spotlight-copy h2 { font-size: 1.35rem; }
  .product-preview { min-height: 240px; }
  .commercial-close-mark { display: none; }
}

.plant-logo-tool {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  align-items: center;
  gap: 28px;
  margin-bottom: 18px;
  scroll-margin-top: 96px;
  border-color: rgba(0,95,176,.24);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(234,243,251,.72) 100%);
}

.plant-logo-preview {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.plant-logo-preview img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 100px;
  object-fit: contain;
}

.plant-logo-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.plant-logo-empty strong {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  color: #fff;
  background: var(--brand);
  font-size: 1.2rem;
}

.plant-logo-content h2 { margin: 4px 0 7px; }
.plant-logo-content > p { margin: 0 0 15px; color: var(--muted); }

.plant-logo-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.plant-logo-form input[type="file"] {
  flex: 1 1 280px;
  min-height: 43px;
  padding: 7px;
  background: var(--surface);
}

.plant-location-picker {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.plant-location-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.plant-location-header h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 1rem;
}

.plant-location-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.plant-location-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plant-location-actions .btn:disabled {
  cursor: wait;
  opacity: .68;
}

.plant-location-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, .75fr);
  gap: 16px;
  align-items: start;
}

.plant-location-map-wrap {
  min-width: 0;
}

.plant-location-map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 350px;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #e8f0f7;
}

.plant-location-map.leaflet-container {
  z-index: 0;
  font: inherit;
}

.plant-location-map .leaflet-top,
.plant-location-map .leaflet-bottom {
  z-index: 10;
}

.plant-location-fields {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 4px 0;
}

.plant-location-status {
  min-height: 23px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

.plant-location-status[data-tipo="ok"] { color: var(--ok); font-weight: 750; }
.plant-location-status[data-tipo="error"] { color: var(--danger); font-weight: 750; }

@media (max-width: 780px) {
  .plant-location-header { flex-direction: column; }
  .plant-location-actions { justify-content: flex-start; }
  .plant-location-grid { grid-template-columns: 1fr; }
  .plant-location-map { height: 310px; }
}

@media (max-width: 720px) {
  .plant-logo-tool { grid-template-columns: 1fr; gap: 16px; }
  .plant-logo-form { align-items: stretch; }
  .plant-logo-form .btn { width: 100%; }
}

/* ── Aplicación administrativa: sidebar + encabezado ───────────────── */
.has-app-shell {
  --phi: 1.618;
  --space-1: 8px;
  --space-2: 13px;
  --space-3: 21px;
  --space-4: 34px;
  --space-5: 55px;
  --space-6: 89px;
  --sidebar-width: 247px;
  background:
    radial-gradient(circle at 93% 11%, rgba(43,165,224,.09), transparent 17%),
    radial-gradient(circle at 80% 88%, rgba(0,63,128,.06), transparent 20%),
    #f4f8fc;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: var(--space-3) var(--space-2) var(--space-2);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.98)),
    #fff;
  border-right: 1px solid rgba(0,63,128,.1);
  box-shadow: 10px 0 32px rgba(13,66,112,.06);
}

.sidebar-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 0 22px var(--space-2) 4px;
}

.sidebar-system-logo {
  display: block;
  width: 188px;
  max-width: 100%;
  height: 60px;
  object-fit: contain;
}

.sidebar-brand .sidebar-close {
  position: absolute;
  top: 0;
  right: -2px;
}

.workspace-context strong,
.workspace-context span,
.workspace-user strong,
.workspace-user span,
.plant-current strong,
.plant-current span,
.account-menu summary strong,
.account-menu summary span {
  display: block;
}

.ui-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  padding: var(--space-2) 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-nav > a,
.sidebar-group > summary {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #34516f;
  background: transparent;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.sidebar-nav > a:hover,
.sidebar-nav > a.on,
.sidebar-group[open] > summary,
.sidebar-group > summary:hover {
  color: var(--brand);
  background: linear-gradient(135deg, #edf6ff, #f7fbff);
  border-color: rgba(0,95,176,.11);
}

.sidebar-nav > a.on {
  box-shadow: inset 3px 0 0 #1685dd, 0 4px 12px rgba(0,90,170,.07);
}

.sidebar-nav > a:hover { transform: translateX(2px); }

.sidebar-nav > a .ui-icon,
.sidebar-group > summary .ui-icon:first-child {
  color: #176dc0;
}

.sidebar-group {
  margin: 0;
}

.sidebar-group > summary {
  list-style: none;
  user-select: none;
}

.sidebar-group > summary::-webkit-details-marker { display: none; }

.sidebar-group > summary .ui-icon:last-child {
  width: 15px;
  height: 15px;
  transition: transform .18s ease;
}

.sidebar-group[open] > summary .ui-icon:last-child { transform: rotate(90deg); }

.sidebar-group > div {
  display: grid;
  gap: 2px;
  padding: 4px 0 6px 43px;
}

.sidebar-group > div a {
  position: relative;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}

.sidebar-group > div a::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bfd3e5;
  transform: translateY(-50%);
}

.sidebar-group > div a:hover,
.sidebar-group > div a.on {
  color: var(--brand);
  background: #f0f7fd;
}

.sidebar-group > div a.on::before { background: #1685dd; }

.sidebar-bottom {
  display: grid;
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.plant-current {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 55px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #3d5874;
  background: #fbfdff;
}

.plant-current .ui-icon { color: #6d8aa6; }
.plant-current span { color: var(--muted); font-size: .66rem; }
.plant-current strong { margin-top: 2px; font-size: .74rem; }

.account-menu { position: relative; }
.account-menu > summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  align-items: center;
  gap: var(--space-1);
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(251,253,255,.9);
  list-style: none;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { border-color: rgba(0,95,176,.2); background: #f2f7fb; transform: translateY(-1px); }
.account-menu > summary > .ui-icon { width: 15px; height: 15px; }
.sidebar-tenant-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 5px 8px rgba(4,28,52,.15));
}
.user-avatar,
.header-avatar {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #5d70c7, #8795dc);
  box-shadow: 0 5px 12px rgba(62,78,162,.2);
  font-weight: 800;
}
.user-avatar { width: 39px; height: 39px; border-radius: 50%; font-size: .82rem; }
.account-identity-copy { min-width: 0; }
.account-menu summary strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: .74rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.account-menu summary span:not(.user-avatar) { color: var(--muted); font-size: .66rem; }
.account-menu > div {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 10;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(4,28,52,.18);
}
.account-menu form { margin: 0; }
.account-menu > div a,
.account-menu > div button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.account-menu > div a:hover,
.account-menu > div button:hover { color: var(--brand); background: #f0f7fd; }

.sidebar-close,
.sidebar-toggle,
.sidebar-overlay {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.sidebar-close { display: none; padding: 6px; color: var(--muted); }

.app-workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 89px;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(0,63,128,.09);
  background: rgba(255,255,255,.93);
  box-shadow: 0 5px 18px rgba(13,66,112,.04);
  backdrop-filter: blur(12px);
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 9px;
  color: var(--brand);
}

.workspace-context { min-width: 0; }
.workspace-context strong { color: var(--brand-strong); font-size: .85rem; }
.workspace-context span { color: var(--muted); font-size: .69rem; }
.workspace-user {
  display: grid;
  grid-template-columns: 42px minmax(130px, auto) 42px;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.workspace-user.has-tenant-logo {
  grid-template-columns: clamp(110px, 9vw, 154px) minmax(150px, auto) 42px;
}
.header-avatar { width: 42px; height: 42px; border-radius: 50%; font-size: .78rem; }
.header-tenant-logo {
  display: block;
  width: 100%;
  height: 63px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 7px 10px rgba(4,28,52,.18));
}
.workspace-user-copy {
  min-width: 0;
  max-width: min(32vw, 340px);
  padding-left: var(--space-2);
  border-left: 1px solid var(--line);
}
.workspace-user strong { overflow: hidden; color: var(--brand-strong); font-size: .8rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.workspace-user span { color: var(--muted); font-size: .68rem; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-left: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 1rem;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.has-app-shell main {
  width: min(1220px, calc(100% - 42px));
  margin: var(--space-3) auto var(--space-4);
}

.has-app-shell footer {
  width: min(1220px, calc(100% - 42px));
  padding: var(--space-2) 0 var(--space-3);
  border-top: 1px solid rgba(0,63,128,.08);
  font-size: .72rem;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: none;
  background: rgba(4,28,52,.38);
}

@media (max-width: 980px) {
  .app-sidebar {
    width: min(294px, calc(100vw - 42px));
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar-close { display: inline-grid; place-items: center; }
  .sidebar-toggle { display: inline-grid; place-items: center; }
  .app-workspace { margin-left: 0; }
  .sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-overlay { display: block; }
  .sidebar-open { overflow: hidden; }
}

/* Vista oscura: las tarjetas y sus divisiones quedan claramente separadas. */
html.theme-dark {
  color-scheme: dark;
  --bg: #111923;
  --surface: #1b2633;
  --surface-soft: #202e3d;
  --ink: #e7edf4;
  --muted: #aab8c7;
  --line: #354658;
  --line-strong: #506276;
  --brand: #72b8f0;
  --brand-strong: #b9ddfa;
  --accent: #e3c965;
  --accent-soft: #3a3420;
  --ok: #5ed18b;
  --ok-soft: #193d2c;
  --warn: #f0b35e;
  --warn-soft: #43331e;
  --danger: #ff837a;
  --danger-soft: #472321;
  --shadow: 0 16px 36px rgba(0,0,0,.28);
  --shadow-sm: 0 8px 20px rgba(0,0,0,.22);
}

html.theme-dark body {
  background: linear-gradient(180deg, rgba(44,119,177,.15), transparent 280px), var(--bg);
}

html.theme-dark .app-sidebar {
  background: linear-gradient(180deg, #172331, #131d28);
  border-right-color: var(--line);
  box-shadow: 10px 0 32px rgba(0,0,0,.22);
}

html.theme-dark .sidebar-logo { background: #eef3f7; }
html.theme-dark .sidebar-nav > a,
html.theme-dark .sidebar-group > summary { color: #c1d0df; }
html.theme-dark .sidebar-nav > a:hover,
html.theme-dark .sidebar-nav > a.on,
html.theme-dark .sidebar-group[open] > summary,
html.theme-dark .sidebar-group > summary:hover { color: #eaf5ff; background: #223449; border-color: #3a5872; }
html.theme-dark .sidebar-group > div a:hover,
html.theme-dark .sidebar-group > div a.on,
html.theme-dark .account-menu > summary:hover,
html.theme-dark .account-menu > div a:hover,
html.theme-dark .account-menu > div button:hover { color: #eaf5ff; background: #223449; }
html.theme-dark .account-menu > summary { background: rgba(27,41,55,.88); border-color: var(--line); }
html.theme-dark .plant-current,
html.theme-dark .account-menu > div { background: #1b2937; }
html.theme-dark .workspace-header { background: rgba(27,38,51,.94); border-bottom-color: var(--line); }
html.theme-dark .quick-card,
html.theme-dark .metric-card,
html.theme-dark .profit-card,
html.theme-dark .task-metrics > div,
html.theme-dark .task-link,
html.theme-dark .quick-actions-panel > a { background: var(--surface); border-color: var(--line); }
html.theme-dark .dashboard-page .metric-card,
html.theme-dark .dashboard-page .profit-card { background: linear-gradient(145deg, #1d2a38, #182431); border-color: var(--line); }
html.theme-dark .dashboard-page .dashboard-hero,
html.theme-dark .dashboard-page .task-column { background: var(--surface); border-color: var(--line); }
html.theme-dark tr:hover td { background: #243445; }
html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea { color: var(--ink); background: #151f2b; border-color: var(--line-strong); }
html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder { color: #8191a2; }
html.theme-dark th { background: var(--surface-soft); }
html.theme-dark .btn.gray { color: var(--ink); background: #2a3949; border-color: var(--line-strong); }
html.theme-dark .btn.ghost { color: var(--brand); background: var(--surface); }
html.theme-dark footer { color: var(--muted); border-top-color: var(--line); }

@media (max-width: 560px) {
  .workspace-header { min-height: 68px; padding: 8px 12px; }
  .workspace-context span,
  .workspace-user div { display: none; }
  .workspace-user,
  .workspace-user.has-tenant-logo { grid-template-columns: minmax(72px, 96px) 40px; gap: 8px; }
  .workspace-user:not(.has-tenant-logo) { grid-template-columns: 42px 40px; }
  .header-tenant-logo { height: 48px; }
  .theme-toggle { width: 40px; height: 40px; }
  .has-app-shell main { width: min(100% - 24px, 1220px); margin-top: var(--space-2); }
  .has-app-shell footer { width: calc(100% - 24px); }
}

/* ── Tablero administrativo: simplicidad, tareas y proporción áurea ── */
.dashboard-page { --dash-phi: 1.618; position: relative; }
.dashboard-hero { align-items: center; margin-bottom: 21px; padding: 5px 0 13px; }
.dashboard-hero .page-title h1 { margin: 3px 0 6px; color: #0b1f3a; font-family: "BwModelica HS", "Segoe UI", sans-serif; font-size: clamp(1.55rem, 2.1vw, 2rem); letter-spacing: -.035em; }
.dashboard-hero .page-title p { font-size: .82rem; }
.dashboard-primary-actions .btn { min-height: 42px; padding: 9px 15px; }
.dashboard-primary-actions .btn.green { box-shadow: 0 7px 16px rgba(22,131,74,.18); }
.dashboard-primary-actions .ui-icon { width: 17px; height: 17px; }

.dashboard-page .control-shell,
.dashboard-page .card,
.dashboard-task-board,
.dashboard-more,
.dashboard-help { border: 1px solid rgba(0,63,128,.1); border-radius: 13px; background: rgba(255,255,255,.96); box-shadow: 0 10px 26px rgba(21,71,116,.07); }
.dashboard-page .control-shell { gap: 13px; margin-bottom: 13px; padding: 16px 18px; }
.dashboard-page .control-main { display: grid; grid-template-columns: 1.618fr 1fr; align-items: center; gap: 21px; }
.dashboard-page .control-main h2 { margin: 3px 0 5px; font-family: "BwModelica HS", "Segoe UI", sans-serif; font-size: 1rem; letter-spacing: -.015em; }
.dashboard-page .control-main p { font-size: .78rem; }
.dashboard-page .control-actions { justify-content: flex-end; }
.dashboard-page .control-actions .btn { min-height: 38px; padding: 8px 12px; font-size: .76rem; }
.dashboard-page .live-button { color: #087643; background: #effaf3; border-color: #cfe9d9; }
.dashboard-page .live-button:hover { color: #fff; background: var(--ok); border-color: var(--ok); }
.dashboard-page .control-metrics { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.dashboard-page .metric-card { position: relative; overflow: hidden; min-height: 82px; padding: 11px 38px 10px 11px; border: 1px solid #e2eaf3; border-radius: 9px; background: linear-gradient(145deg, #fff, #f8fbfe); box-shadow: 0 4px 10px rgba(21,71,116,.05); }
.dashboard-page .metric-card > .ui-icon { position: absolute; right: 10px; bottom: 12px; width: 24px; height: 24px; color: #2785d8; opacity: .95; }
.dashboard-page .metric-card span { font-size: .62rem; line-height: 1.22; }
.dashboard-page .metric-card strong { margin-top: 9px; font-family: "BwModelica HS", sans-serif; font-size: 1.12rem; }
.dashboard-page .metric-money { border-color: #d8eadf; background: linear-gradient(145deg, #fff, #f1faf5); }
.dashboard-page .metric-money > .ui-icon { color: #15a15a; }
.dashboard-page .metric-card.warn > .ui-icon,
.dashboard-page .metric-card.warn strong { color: var(--warn); }
.dashboard-page .metric-card.danger > .ui-icon,
.dashboard-page .metric-card.danger strong { color: var(--danger); }

.dashboard-page .card { margin-bottom: 13px; padding: 16px 18px; }
.dashboard-page .card-header { align-items: center; margin-bottom: 13px; }
.dashboard-page .card-header h2 { margin-bottom: 4px; font-family: "BwModelica HS", sans-serif; font-size: .94rem; letter-spacing: -.015em; }
.dashboard-page .card-header .btn { min-height: 36px; padding: 7px 11px; font-size: .74rem; }
.dashboard-page .card-header .ui-icon { width: 16px; height: 16px; }
.profit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.profit-card { position: relative; min-height: 78px; padding: 13px 78px 12px 14px; overflow: hidden; border: 1px solid #e1eaf2; border-radius: 8px; background: linear-gradient(145deg, #fff, #f9fbfd); box-shadow: 0 4px 10px rgba(21,71,116,.05); }
.profit-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #2d84cf; }
.profit-card.expense::before { background: #ef5560; }
.profit-card.gain::before { background: #1fa35d; }
.profit-card.margin::before { background: #37b7bb; }
.profit-card.margin { background: linear-gradient(135deg, #fff, #e9f9f8); }
.profit-card span { display: block; color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.profit-card strong { display: block; margin-top: 5px; color: #0d2442; font-size: 1.24rem; line-height: 1; }
.mini-trend { position: absolute; right: 14px; bottom: 17px; width: 51px; height: 25px; opacity: .85; }
.mini-trend::before,
.mini-trend::after { content: ""; position: absolute; height: 2px; border-radius: 3px; background: #1fa35d; transform-origin: left center; }
.mini-trend::before { left: 1px; bottom: 6px; width: 28px; transform: rotate(-38deg); }
.mini-trend::after { left: 23px; bottom: 22px; width: 31px; transform: rotate(26deg); }
.mini-trend.down::before,
.mini-trend.down::after { background: #ef4552; }
.mini-trend.down { transform: scaleY(-1); }
.margin-ring { position: absolute; right: 14px; top: 13px; display: grid; place-items: center; width: 49px; height: 49px; border: 7px solid #d6eeee; border-top-color: #38b7ba; border-right-color: #38b7ba; border-radius: 50%; transform: rotate(18deg); }
.margin-ring span { color: #0b6070; font-size: .9rem; transform: rotate(-18deg); }
.profit-note { margin: 10px 0 0; color: var(--muted); font-size: .7rem; }

.dashboard-task-board { display: grid; grid-template-columns: 1.618fr 1.618fr 1.618fr 1fr; gap: 0; margin-bottom: 13px; padding: 13px; }
.task-column,
.quick-actions-panel { min-width: 0; padding: 3px 13px 0; }
.task-column + .task-column,
.quick-actions-panel { border-left: 1px solid #e2eaf2; }
.task-column h2,
.quick-actions-panel h2 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-family: "BwModelica HS", sans-serif; font-size: .83rem; }
.task-column h2 .ui-icon { width: 17px; height: 17px; color: #1c72c0; }
.task-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.task-metrics > div { position: relative; min-height: 67px; padding: 9px 31px 8px 9px; border: 1px solid #e4ebf3; border-radius: 8px; background: #fbfdff; }
.task-metrics > div.positive { background: #f2faf5; }
.task-metrics > div.warn { background: #fff8ee; }
.task-metrics strong { display: block; color: #10294a; font-size: 1rem; }
.task-metrics span { display: block; margin-top: 3px; color: var(--muted); font-size: .58rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.task-metrics .ui-icon { position: absolute; right: 8px; top: 50%; width: 21px; height: 21px; color: #237fd1; transform: translateY(-50%); }
.task-metrics .positive .ui-icon { color: #1d9c57; }
.task-metrics .warn .ui-icon { color: var(--warn); }
.task-link { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; margin-top: 8px; border: 1px solid #dce7f1; border-radius: 7px; color: #155da0; font-size: .7rem; background: #fff; }
.task-link .ui-icon { width: 14px; height: 14px; }
.task-link:hover { color: var(--brand); background: #f2f8fd; }
.quick-actions-panel { display: grid; align-content: start; gap: 7px; }
.quick-actions-panel h2 { margin-bottom: 3px; }
.quick-actions-panel > a { display: grid; grid-template-columns: 18px 1fr 13px; align-items: center; gap: 7px; min-height: 38px; padding: 8px; border: 1px solid #dfe8f1; border-radius: 7px; color: #255b92; background: #fff; box-shadow: 0 3px 8px rgba(21,71,116,.04); font-size: .67rem; }
.quick-actions-panel > a .ui-icon { width: 16px; height: 16px; color: #257ed0; }
.quick-actions-panel > a .ui-icon:last-child { width: 12px; height: 12px; color: #8aa0b5; }
.quick-actions-panel > a:hover { border-color: #bad6ec; background: #f5faff; }

.dashboard-more { margin-bottom: 13px; overflow: hidden; }
.dashboard-more > summary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 10px 16px; color: #315b83; font-size: .76rem; font-weight: 800; list-style: none; cursor: pointer; }
.dashboard-more > summary::-webkit-details-marker { display: none; }
.dashboard-more > summary .ui-icon { width: 15px; height: 15px; transition: transform .18s ease; }
.dashboard-more[open] > summary .ui-icon { transform: rotate(90deg); }
.dashboard-more-content { display: grid; gap: 21px; padding: 5px 18px 18px; border-top: 1px solid #e5edf4; }
.dashboard-more-content > section { padding-top: 16px; }
.recent-movements { margin-top: 0; }
.dashboard-help { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; min-height: 60px; padding: 10px 16px; color: #355a7d; background: linear-gradient(135deg, #f0f8ff, #fff); }
.dashboard-help > .ui-icon { width: 27px; height: 27px; color: #2087dc; }
.dashboard-help strong,
.dashboard-help span { display: block; }
.dashboard-help strong { font-size: .73rem; }
.dashboard-help span { color: var(--muted); font-size: .65rem; }
.dashboard-help a { display: flex; align-items: center; gap: 5px; font-size: .7rem; }
.dashboard-help a .ui-icon { width: 13px; height: 13px; }
.dashboard-page .btn { transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.dashboard-page .btn:hover { transform: translateY(-1px); box-shadow: 0 7px 14px rgba(0,63,128,.13); }

@media (max-width: 1180px) {
  .dashboard-page .control-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .task-column + .task-column,
  .quick-actions-panel { border-left: 0; }
  .task-column,
  .quick-actions-panel { padding: 5px; }
}
@media (max-width: 760px) {
  .dashboard-page .control-main { grid-template-columns: 1fr; }
  .dashboard-primary-actions,
  .dashboard-page .control-actions { justify-content: flex-start; }
  .dashboard-page .control-metrics,
  .profit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-task-board { grid-template-columns: 1fr; }
  .task-column,
  .quick-actions-panel { padding: 8px 3px; border-bottom: 1px solid #e5edf4; }
  .quick-actions-panel { border-bottom: 0; }
}

/* Estos selectores van al final para vencer los estilos específicos del tablero. */
html.theme-dark .dashboard-page .dashboard-hero .page-title h1,
html.theme-dark .dashboard-page .profit-card strong,
html.theme-dark .dashboard-page .task-metrics strong { color: var(--ink); }
html.theme-dark .dashboard-page .control-shell,
html.theme-dark .dashboard-page .card,
html.theme-dark .dashboard-task-board,
html.theme-dark .dashboard-more,
html.theme-dark .dashboard-help { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
html.theme-dark .dashboard-page .metric-card,
html.theme-dark .profit-card,
html.theme-dark .task-metrics > div,
html.theme-dark .quick-actions-panel > a { background: var(--surface-soft); border-color: var(--line); }
html.theme-dark .dashboard-page .metric-money,
html.theme-dark .task-metrics > div.positive { background: #1d3a2b; }
html.theme-dark .task-metrics > div.warn { background: #40321f; }
html.theme-dark .dashboard-page .task-column + .task-column,
html.theme-dark .dashboard-page .quick-actions-panel { border-left-color: var(--line); }
html.theme-dark .task-link,
html.theme-dark .quick-actions-panel > a { color: var(--brand); }
html.theme-dark .dashboard-more-content { border-top-color: var(--line); }
@media (max-width: 430px) {
  .dashboard-primary-actions .btn { width: 100%; }
  .dashboard-page .control-shell,
  .dashboard-page .card,
  .dashboard-task-board { padding: 13px; }
  .dashboard-page .control-metrics,
  .profit-grid { grid-template-columns: 1fr; }
  .task-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-help { grid-template-columns: 30px 1fr; }
  .dashboard-help a { grid-column: 1 / -1; justify-content: center; }
}

/* ==========================================================================
   Tren de tratamiento (/planta/tren)
   Diagrama horizontal: cada etapa es una tarjeta y entre tarjetas va la
   tuberia. En movil el tren se desliza de lado en vez de apilarse, para que
   se siga leyendo como el orden fisico de la planta.
   ========================================================================== */
.tren-alertas .tren-lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.tren-lista li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .9rem;
}

.tren-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
}

.tren-flujo {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: min-content;
}

.tren-node {
  position: relative;
  flex: 0 0 210px;
  width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 12px 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.tren-node.verde { border-top-color: var(--ok); }
.tren-node.amarillo { border-top-color: var(--warn); background: var(--warn-soft); }
.tren-node.rojo { border-top-color: var(--danger); background: var(--danger-soft); }

.tren-node h3 {
  margin: 2px 0 0;
  font-size: .92rem;
  line-height: 1.25;
}

.tren-specs {
  margin: 0;
  font-size: .76rem;
  color: var(--muted);
  letter-spacing: .01em;
}

.tren-lado {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(0, 63, 128, .09);
}

.tren-lado.producto { color: var(--ok); background: var(--ok-soft); }
.tren-lado.membrana { color: var(--accent); background: var(--accent-soft); }

.tren-glifo {
  width: 58px;
  height: 76px;
  color: var(--brand);
}

.tren-node.verde .tren-glifo { color: var(--ok); }
.tren-node.amarillo .tren-glifo { color: var(--warn); }
.tren-node.rojo .tren-glifo { color: var(--danger); }

.tren-medidor {
  width: 100%;
  display: grid;
  gap: 3px;
  margin-top: 4px;
}

.tren-barra {
  height: 9px;
  border-radius: 999px;
  background: #e4ebf3;
  overflow: hidden;
}

.tren-barra-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ok);
  transition: width .3s ease;
}

.tren-barra-fill.amarillo { background: var(--warn); }
.tren-barra-fill.rojo { background: var(--danger); }

.tren-medidor-txt {
  font-size: .74rem;
  line-height: 1.3;
}

.tren-datos {
  width: 100%;
  margin: 4px 0 0;
  display: grid;
  gap: 2px;
  font-size: .74rem;
}

.tren-datos > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px dotted var(--line);
  padding-bottom: 2px;
}

.tren-datos dt { color: var(--muted); }
.tren-datos dd { margin: 0; font-weight: 700; }

.tren-detalle {
  margin: 2px 0 0;
  font-size: .7rem;
  color: var(--muted);
  line-height: 1.35;
}

.tren-aviso {
  margin: 4px 0 0;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: .72rem;
  line-height: 1.35;
  color: var(--danger);
  background: rgba(180, 35, 24, .08);
  text-align: left;
}

.tren-accion { margin-top: auto; padding-top: 8px; width: 100%; }
.tren-accion .btn { width: 100%; }

.tren-conector {
  position: relative;
  flex: 0 0 34px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 60px;
}

.tren-conector::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 63, 128, .28);
}

.tren-conector.producto::before { background: rgba(22, 131, 74, .32); }

.tren-flecha {
  position: relative;
  z-index: 1;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--brand);
}

.tren-conector.producto .tren-flecha { border-left-color: var(--ok); }

.tren-leyenda {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.tren-punto {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 6px;
}

.tren-punto.verde { background: var(--ok); }
.tren-punto.amarillo { background: var(--warn); }
.tren-punto.rojo { background: var(--danger); }

.tren-config summary {
  cursor: pointer;
  font-size: .95rem;
  padding: 2px 0;
}

.tren-config h3 {
  margin: 22px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.tren-form { margin: 0; }
.tren-form .btn { margin-top: 10px; }

.tren-inline {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.tren-inline input { max-width: 120px; margin: 0; }

@media (max-width: 720px) {
  .tren-node { flex-basis: 178px; width: 178px; padding: 28px 10px 12px; }
  .tren-glifo { width: 48px; height: 64px; }
  .tren-conector { flex-basis: 24px; }
  .tren-conector::before { width: 24px; }
}

/* Balance de agua y detalle de lavado del tren */
.tren-balance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.tren-balance > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.tren-balance span { font-size: .74rem; color: var(--muted); }
.tren-balance strong { font-size: 1.02rem; }
.tren-balance > div.alto { border-color: rgba(180, 83, 9, .4); background: var(--warn-soft); }
.tren-balance > div.alto strong { color: var(--warn); }

.tren-hydraulic-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin: 10px 0 6px;
}

.tren-hydraulic-summary > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 7px;
  background: var(--surface-soft);
}

.tren-hydraulic-summary > div.warn-soft {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.tren-hydraulic-summary span {
  color: var(--muted);
  font-size: .74rem;
}

.tren-hydraulic-summary strong { font-size: 1.05rem; }

.tren-hydraulic-note {
  margin: 0 0 12px;
  padding: 0 2px;
}

.tren-lavado {
  width: 100%;
  margin-top: 6px;
  font-size: .74rem;
  text-align: left;
}

.tren-lavado summary {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(0, 63, 128, .06);
  color: var(--brand);
}

.tren-lavado[open] summary { margin-bottom: 4px; }
.tren-lavado .tren-datos { font-size: .7rem; }

.tren-subtitulo {
  margin: 16px 0 6px;
  font-size: .9rem;
  color: var(--muted);
}

/* Elevacion de la planta: los equipos dibujados a escala, no como iconos */
.tren-escena-scroll { padding-bottom: 8px; }

.tren-escena {
  display: block;
  border-radius: var(--radius);
  background: #f2f6fb;
}

.tren-escena-pieza { cursor: pointer; }
.tren-escena-pieza:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tren-escena-pieza > g { transition: opacity .15s ease; }
.tren-escena-pieza:hover > g { opacity: .82; }

.tren-escena-etiqueta {
  font-size: 9.5px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
}

.tren-escena-txt {
  font-size: 8.5px;
  fill: var(--muted);
  text-anchor: middle;
}

.tren-escena-alerta { stroke: #fff; stroke-width: 1.5; }
.tren-escena-alerta.amarillo { fill: var(--warn); }
.tren-escena-alerta.rojo { fill: var(--danger); }

.tren-escena-alerta-txt {
  font-size: 9px;
  font-weight: 700;
  fill: #fff;
  text-anchor: middle;
}

.tren-node:target {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 63, 128, .18), var(--shadow-sm);
}

.tren-node .tren-glifo {
  width: 100%;
  max-width: 96px;
  height: 82px;
  color: inherit;
}

/* ==========================================================================
   Agua circulando por el tren
   El agua es una tercera capa de trazo con guiones que se desplazan: se anima
   `stroke-dashoffset`, que el navegador repinta sin recalcular layout, asi que
   14 tuberias corriendo a la vez no pesan ni en celular.
   El periodo de la animacion (28) es igual a la suma del patron (7 + 21), si
   no el ciclo daria un salto al reiniciar.
   Si la planta no vendio nada NO se anima: el dibujo dice la verdad, la planta
   esta parada.
   ========================================================================== */
@keyframes tren-fluir { to { stroke-dashoffset: -28; } }
@keyframes tren-fluir-drenaje { to { stroke-dashoffset: -9; } }
@keyframes tren-burbujear {
  0%   { transform: translateY(0); opacity: .35; }
  45%  { opacity: .9; }
  100% { transform: translateY(-6px); opacity: 0; }
}
@keyframes tren-uv-latir {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

.tren-agua {
  fill: none;
  stroke-dasharray: 7 21;      /* gota + hueco: periodo 28 */
  stroke-linecap: round;
  opacity: 0;                  /* sin planta corriendo, no hay agua */
}

.tren-agua.cruda { stroke: #3d8fd6; }
.tren-agua.producto { stroke: #1f9d6a; }

.tren-escena.corriendo .tren-agua {
  opacity: .95;
  animation: tren-fluir 1.4s linear infinite;
}

.tren-escena.corriendo .tren-drenaje {
  animation: tren-fluir-drenaje .9s linear infinite;
}

/* Detalles que rematan el "esta prendida": burbujas del ozono y LED de la UV.
   Van scopeados a .tren-escena para que los dibujitos de las tarjetas
   (.tren-glifo) se queden quietos y no distraigan al leer los numeros. */
.tren-escena.corriendo .tren-burbuja {
  transform-box: fill-box;
  transform-origin: center;
  animation: tren-burbujear 2.6s ease-out infinite;
}

.tren-escena.corriendo .tren-burbuja:nth-of-type(2) { animation-delay: 1.1s; }

.tren-escena.corriendo .tren-uv-led {
  animation: tren-uv-latir 2.2s ease-in-out infinite;
}

/* Accesibilidad: quien pidio menos movimiento ve el agua QUIETA pero visible,
   como una linea continua dentro del tubo, no un tubo vacio. */
@media (prefers-reduced-motion: reduce) {
  .tren-escena.corriendo .tren-agua,
  .tren-escena.corriendo .tren-drenaje,
  .tren-escena.corriendo .tren-burbuja,
  .tren-escena.corriendo .tren-uv-led { animation: none; }
  .tren-escena.corriendo .tren-agua {
    stroke-dasharray: none;
    opacity: .5;
  }
}

/* ===========================================================================
   SECCION PLANTA — proporciones aureas
   ---------------------------------------------------------------------------
   El diagrama del tren ya parte su lienzo en cascada aurea (ver PHI en
   tren_planta.py). Aqui se extiende esa misma disciplina al layout de las
   pantallas de Planta, SIN tocar el resto de la app: todo cuelga de
   `.planta-ui`, asi que reparto, clientes y reportes siguen igual.

     - Espaciado: Fibonacci 8/13/21/34/55/89/144. Cada paso es el anterior
       por phi, y son enteros, asi que la proporcion se puede verificar.
     - Tipografia: pasos de raiz de phi (1.272), de modo que UNO DE CADA DOS
       pasos es phi exacto (.78 -> 1.26 -> 2.04 y .99 -> 1.60).
     - Columnas: 1.618fr / 1fr es literalmente la seccion aurea (61.8 / 38.2).
     - Tarjetas KPI: 144 x 89 px = 1.6180, el rectangulo aureo de Fibonacci.
   ======================================================================== */
.planta-ui {
  --phi: 1.618;
  --e1: 8px;
  --e2: 13px;
  --e3: 21px;
  --e4: 34px;
  --e5: 55px;
  --e6: 89px;
  --e7: 144px;
  --t0: .78rem;
  --t1: .99rem;
  --t2: 1.26rem;
  --t3: 1.60rem;
  --t4: 2.04rem;
}

/* --- Indice de la seccion: donde estoy y a donde puedo ir ---------------- */
.planta-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e1);
  margin-bottom: var(--e3);
  padding-bottom: var(--e2);
  border-bottom: 1px solid var(--line);
}
.planta-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--e4);
  padding: 0 var(--e2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t0);
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.planta-nav a:hover { color: var(--brand); border-color: var(--line-strong); }
.planta-nav a.on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* --- Ritmo de la seccion ------------------------------------------------- */
.planta-ui .page-head { margin-bottom: var(--e3); }
.planta-ui .card { margin-bottom: var(--e3); padding: var(--e3); }
.planta-ui .card-header { margin-bottom: var(--e2); }
.planta-ui .grid { gap: var(--e2); grid-template-columns: repeat(auto-fit, minmax(var(--e7), 1fr)); }

/* Rectangulo aureo: 144 de ancho por 89 de alto. */
.planta-ui .kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--e6);
  padding: var(--e2) var(--e3);
  aspect-ratio: var(--phi);
}
.planta-ui .kpi .n { font-size: var(--t3); }
.planta-ui .kpi .l { margin-top: var(--e1); font-size: var(--t0); }

/* --- Seccion aurea: lo que se lee (61.8%) y lo que se captura (38.2%) ---- */
.planta-split {
  display: grid;
  /* La unidad NO se puede pegar a una variable: pegarle 'fr' a un var()
     es CSS invalido y el navegador tira la regla entera, dejando UNA
     columna. Por eso aqui va el literal. */
  grid-template-columns: 1.618fr 1fr;
  gap: var(--e3);
  align-items: start;
}
@media (max-width: 900px) {
  .planta-split { grid-template-columns: 1fr; }
}
.planta-split > * { min-width: 0; }

/* Suscripciones SaaS: panel comercial y avisos operativos. */
.subscription-banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 0 0 14px; padding: 12px 16px; border-radius: 10px;
  background: #eaf4ff; color: #0c4a6e; border: 1px solid #9fd2ff; text-decoration: none;
}
.subscription-banner b { margin-left: auto; }
.subscription-banner.grace_period, .subscription-banner.past_due { background: #fff8df; border-color: #f0c75e; color: #7a4b00; }
.subscription-banner.suspended, .subscription-banner.cancelled { background: #fff0f0; border-color: #eea3a3; color: #8b1e1e; }
.billing-admin, .subscription-page { max-width: 1280px; margin: 0 auto; }
.billing-title { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.billing-title h1 { margin: 3px 0 6px; }
.billing-title p { margin: 0; color: var(--muted); }
.eyebrow { display: block; color: var(--brand); font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.billing-kpis { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 13px; margin-bottom: 21px; }
.billing-kpis article { min-height: 108px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.billing-kpis article span, .billing-kpis article small { color: var(--muted); font-size: .82rem; }.billing-kpis article strong { font-size: 1.45rem; color: var(--brand); }.billing-kpis .warn strong { color: #a76000; }.billing-kpis .danger strong { color: #bd2424; }
.billing-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.billing-toolbar label, .grace-form label { display: grid; gap: 4px; font-size: .84rem; font-weight: 700; }.billing-toolbar input { min-width: 250px; }.grace-form { display: flex; gap: 8px; align-items: end; margin-left: auto; }.grace-form input { width: 70px; }
.billing-table { width: 100%; border-collapse: collapse; background: var(--surface); }.billing-table th { text-align: left; color: var(--muted); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }.billing-table th, .billing-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }.billing-table td small { display: block; color: var(--muted); margin-top: 3px; }.billing-table td form { margin-top: 6px; }
.subscription-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-weight: 800; font-size: .75rem; background: #e8f5ec; color: #18713a; }.subscription-status.grace_period, .subscription-status.past_due { background: #fff1c9; color: #815100; }.subscription-status.suspended, .subscription-status.cancelled { background: #ffe3e3; color: #9f2020; }
.billing-new-tenant { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.billing-new-tenant summary { cursor: pointer; font-weight: 800; }.billing-new-tenant p { color: var(--muted); }
.billing-form { display: grid; gap: 11px; }.billing-form label { display: grid; gap: 5px; font-size: .86rem; font-weight: 700; }.billing-form textarea { min-height: 82px; resize: vertical; }.billing-form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }.billing-form.compact button { grid-column: 1 / -1; width: fit-content; }
.subscription-summary { display: grid; grid-template-columns: 1.4fr .8fr; gap: 22px; margin-bottom: 22px; padding: 22px; border: 1px solid #b5d8f8; border-radius: var(--radius); background: #f3f9ff; }.subscription-summary.grace_period, .subscription-summary.past_due { border-color: #f0c75e; background: #fffaf0; }.subscription-summary.suspended, .subscription-summary.cancelled { border-color: #e9aaaa; background: #fff5f5; }.subscription-summary h2 { margin: 9px 0 4px; }.subscription-summary p { color: var(--muted); }.subscription-dates { display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 7px 15px; }.subscription-dates span { color: var(--muted); }.subscription-dates strong { text-align: right; }.subscription-dates small { grid-column: 1 / -1; color: var(--muted); }.subscription-message { grid-column: 1 / -1; margin: 0; }
.subscription-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 21px; margin: 22px 0; }.subscription-columns > div, .manual-payment, .subscription-page > section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.subscription-columns h2, .manual-payment h2, .subscription-page > section h2 { margin-top: 0; }.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }.feature-list li { color: var(--muted); }.feature-list li.included { color: var(--text); font-weight: 650; }.feature-list.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }.upsell-card { margin: 0 0 18px; padding: 14px 16px; background: #edf7ff; border-left: 4px solid var(--brand); border-radius: 7px; }.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }.plan-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.plan-card.current { border: 2px solid var(--brand); box-shadow: 0 7px 22px rgba(12,97,164,.13); }.plan-card h3 { margin: 8px 0; }.plan-card > strong { font-size: 1.45rem; color: var(--brand); }.plan-card > strong small { font-size: .8rem; color: var(--muted); }.plan-card ul { margin: 13px 0 0; padding-left: 16px; font-size: .86rem; }.admin-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }.admin-actions > div { display: grid; align-content: start; gap: 11px; }.inline-action { grid-template-columns: 1fr auto; align-items: end; }.danger-action { display: inline-block; }.payment-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }.payment-form .wide { grid-column: span 2; }.validate-payment { display: inline-flex; gap: 5px; flex-wrap: wrap; }.btn.danger { background: #b82b2b; color: #fff; }
@media (max-width: 950px) { .billing-kpis { grid-template-columns: repeat(2, 1fr); }.subscription-columns, .subscription-summary, .plan-cards { grid-template-columns: 1fr; }.feature-list.three-cols, .payment-form { grid-template-columns: repeat(2, 1fr); }.billing-title { flex-direction: column; }.grace-form { margin-left: 0; }.billing-toolbar input { min-width: 180px; } }
@media (max-width: 600px) { .billing-kpis, .billing-form.compact, .feature-list.three-cols, .payment-form { grid-template-columns: 1fr; }.payment-form .wide { grid-column: auto; }.subscription-banner b { margin-left: 0; }.billing-toolbar, .grace-form { align-items: stretch; }.billing-toolbar input { min-width: 0; width: 100%; } }

/* Bitacoras P0: captura corta integrada al tablero y a la navegacion de planta. */
.dashboard-bitacoras { margin-bottom: 14px; }
.dashboard-bitacoras .card-header { align-items: flex-start; }
.dashboard-bitacoras .card-header h2 { margin: 3px 0 4px; }
.dashboard-bitacoras-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 7px; }
.dashboard-bitacoras-kpi { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.dashboard-bitacoras-kpi strong { font-size: 1.2rem; color: var(--brand); }
.dashboard-bitacoras-kpi span { color: var(--muted); font-size: .78rem; }
.dashboard-bitacoras-kpi.warn strong { color: var(--warn); }
.dashboard-bitacoras-list { display: grid; }
.dashboard-bitacora-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dashboard-bitacora-item > div { display: grid; gap: 2px; min-width: 0; }
.dashboard-bitacora-item .muted { font-size: .78rem; }
.dashboard-bitacora-dot, .bitacora-task-status { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.dashboard-bitacora-item.completada .dashboard-bitacora-dot, .bitacora-task.completada .bitacora-task-status { background: var(--ok); }
.dashboard-bitacora-item.requiere_atencion .dashboard-bitacora-dot, .bitacora-task.requiere_atencion .bitacora-task-status { background: var(--danger); }
.bitacora-page { max-width: 1120px; margin: 0 auto; }
.bitacora-summary { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; align-items: center; margin-bottom: 14px; }
.bitacora-summary-main { display: flex; align-items: end; gap: 18px; }
.bitacora-summary-main h2 { margin: 5px 0 12px; }
.bitacora-summary-main > div { flex: 1; min-width: 0; }
.bitacora-progress { height: 8px; overflow: hidden; border-radius: 99px; background: var(--line); }
.bitacora-progress span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.bitacora-progress-number { color: var(--brand); font-size: 1.55rem; }
.bitacora-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.bitacora-kpis > div { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.bitacora-kpis strong { font-size: 1.35rem; color: var(--brand); }
.bitacora-kpis span { color: var(--muted); font-size: .8rem; }
.bitacora-kpis .warn strong { color: var(--warn); }
.bitacora-task-list { display: grid; gap: 10px; }
.bitacora-task { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 12px; margin: 0; padding: 15px 17px; }
.bitacora-task-body { min-width: 0; }
.bitacora-task-heading { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.bitacora-task-heading h2 { margin: 3px 0 0; font-size: 1.05rem; }
.bitacora-category { color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.bitacora-task-hint { margin: 8px 0 12px; font-size: .84rem; }
.bitacora-task-form { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(150px, .85fr) minmax(180px, 1.35fr) auto; gap: 8px; align-items: end; }
.bitacora-task-form label { display: grid; gap: 4px; color: var(--muted); font-size: .74rem; font-weight: 750; }
.bitacora-task-form label em { font-style: normal; font-weight: 500; }
.bitacora-task-form input { min-width: 0; }
.bitacora-task-form .bitacora-observacion { min-width: 0; }
.bitacora-task-recorded { display: flex; flex-wrap: wrap; gap: 9px 14px; align-items: center; color: var(--muted); font-size: .82rem; }
.bitacora-task-recorded strong { color: var(--text); }
.bitacora-disclaimer { margin: 13px 2px 0; font-size: .78rem; }
@media (max-width: 780px) {
  .dashboard-bitacoras-summary, .bitacora-summary { grid-template-columns: 1fr; }
  .bitacora-task-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bitacora-task-form .bitacora-observacion { grid-column: span 2; }
  .bitacora-task-form button { width: 100%; }
}
@media (max-width: 520px) {
  .dashboard-bitacoras .card-header, .bitacora-task-heading { display: grid; }
  .dashboard-bitacoras .card-header .btn { width: 100%; text-align: center; }
  .dashboard-bitacoras-summary, .bitacora-kpis { grid-template-columns: 1fr; }
  .dashboard-bitacora-item { grid-template-columns: 9px minmax(0, 1fr); }
  .dashboard-bitacora-item .btn, .dashboard-bitacora-item .pill { grid-column: 2; justify-self: start; }
  .bitacora-summary-main { align-items: center; }
  .bitacora-task-form { grid-template-columns: 1fr; }
  .bitacora-task-form .bitacora-observacion { grid-column: auto; }
}

/* ===========================================================================
   MI PLANTA — centro operativo y bitácora diaria unificada
   ======================================================================== */
.mi-planta-page,
.daily-log-page { max-width: 1320px; margin: 0 auto; }

.planta-context-nav {
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: .82rem;
}
.planta-context-nav a {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--brand);
  letter-spacing: 0;
  text-transform: none;
}
.planta-context-nav strong { color: var(--text); }

.mi-planta-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 170px;
  margin-bottom: 18px;
  padding: 28px 30px;
  border: 1px solid #184f80;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 10%, rgba(103,190,246,.3), transparent 28%),
    linear-gradient(128deg, #052d53, #075b9b 72%, #0e77b7);
  box-shadow: 0 18px 42px rgba(4, 44, 80, .18);
}
.mi-planta-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 310px;
  height: 310px;
  border: 42px solid rgba(255,255,255,.07);
  border-radius: 50%;
}
.mi-planta-hero > * { position: relative; z-index: 1; }
.mi-planta-hero .section-kicker { color: #9ed8ff; }
.mi-planta-hero h1 { margin: 5px 0 4px; color: #fff; font-size: clamp(1.85rem, 4vw, 2.7rem); }
.mi-planta-hero p { margin: 0; color: rgba(255,255,255,.78); }
.mi-planta-title-row { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.operation-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(3, 27, 51, .32);
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
}
.operation-status i { width: 8px; height: 8px; border-radius: 50%; background: #f2b544; box-shadow: 0 0 0 4px rgba(242,181,68,.17); }
.operation-status.estable i { background: #56d38d; box-shadow: 0 0 0 4px rgba(86,211,141,.18); }
.operation-status.atencion i { background: #ff7c7c; box-shadow: 0 0 0 4px rgba(255,124,124,.2); }
.operation-status.captura i { background: #76c7fa; box-shadow: 0 0 0 4px rgba(118,199,250,.18); }
.mi-planta-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.mi-planta-hero .btn { min-height: 44px; border-color: #fff; background: #fff; color: #064f88; }
.mi-planta-hero .btn.ghost { border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.08); color: #fff; }

.mi-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mi-kpi-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.mi-kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand); }
.mi-kpi-card.pending::before { background: var(--warn); }
.mi-kpi-card.complete::before { background: var(--ok); }
.mi-kpi-card.attention::before { background: var(--danger); }
.mi-kpi-card > span { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.mi-kpi-card > strong { margin-top: 4px; color: var(--text); font-size: clamp(1.25rem, 2.2vw, 1.72rem); line-height: 1.05; }
.mi-kpi-card > small { color: var(--muted); line-height: 1.35; }
.mi-mini-progress { height: 5px; margin-top: auto; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.mi-mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

.source-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .63rem;
  font-weight: 850;
  font-style: normal;
  letter-spacing: .025em;
  text-transform: uppercase;
  vertical-align: middle;
}
.source-label.measured { color: #075b9d; background: #dff1ff; }
.source-label.calculated { color: #24683d; background: #e2f6e9; }
.source-label.estimated { color: #8a5700; background: #fff0c9; }

.mi-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(320px, .82fr); gap: 18px; }
.mi-dashboard-grid > .card { min-width: 0; }
.mi-attention-panel .card-header h2,
.mi-shift-panel .card-header h2,
.mi-tank-panel .card-header h2,
.mi-history-strip .card-header h2 { margin: 3px 0 0; }
.attention-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.attention-row > .ui-icon { color: var(--muted); }
.attention-row > div { min-width: 0; }
.attention-row > div > strong,
.attention-row > div > small { display: block; }
.attention-row > div > small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.attention-row details { margin-top: 6px; color: var(--muted); font-size: .76rem; }
.attention-row details summary { cursor: pointer; color: var(--brand); font-weight: 750; }
.attention-row details p { margin: 4px 0 0; }
.attention-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #0b5e96;
  background: #e1f2ff;
  font-size: .78rem;
  font-weight: 900;
}
.attention-row.warn .attention-icon { color: #865500; background: #fff0c9; }
.attention-row.danger .attention-icon { color: #a82727; background: #ffe2e2; }
.attention-icon .ui-icon { width: 16px; height: 16px; }
.mi-empty-ok { display: flex; gap: 12px; align-items: center; min-height: 90px; padding: 16px; border-radius: 11px; color: #18663a; background: #e8f7ee; }
.mi-empty-ok > .ui-icon { width: 26px; height: 26px; }
.mi-empty-ok strong, .mi-empty-ok span { display: block; }
.mi-empty-ok span { margin-top: 3px; font-size: .82rem; }

.shift-timeline { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 15px 0 18px; }
.shift-timeline > div { display: grid; gap: 2px; }
.shift-timeline > div:last-child { text-align: right; }
.shift-timeline span { color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.shift-timeline strong { font-size: 1.08rem; }
.shift-timeline > i { height: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #64bdec); }
.shift-details { display: grid; margin: 0; }
.shift-details > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.shift-details dt { color: var(--muted); }
.shift-details dd { margin: 0; text-align: right; font-weight: 750; }

.tank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 12px; }
.tank-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 126px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.tank-card h3 { margin: 0 0 5px; font-size: .98rem; }
.tank-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.tank-card p strong { color: var(--text); }
.tank-card small { display: block; margin-top: 8px; color: var(--muted); }
.tank-visual { position: relative; overflow: hidden; width: 50px; height: 86px; border: 2px solid var(--line-strong); border-radius: 9px 9px 14px 14px; background: var(--surface); }
.tank-visual::before { content: ""; position: absolute; left: 12px; right: 12px; top: -7px; height: 8px; border: 2px solid var(--line-strong); border-bottom: 0; border-radius: 5px 5px 0 0; }
.tank-visual > span { position: absolute; left: 0; right: 0; bottom: 0; min-height: 0; background: linear-gradient(#65c6f2, #1586c9); opacity: .85; }
.tank-visual > b { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); font-size: .75rem; text-shadow: 0 1px var(--surface); }

.mi-section-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mi-section-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 10px; align-items: center; min-height: 112px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--surface); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.mi-section-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.mi-section-card > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--brand); background: var(--surface-soft); }
.mi-section-card > span .ui-icon { width: 20px; height: 20px; }
.mi-section-card > div { min-width: 0; }
.mi-section-card strong, .mi-section-card small { display: block; }
.mi-section-card small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.mi-section-card > .ui-icon { color: var(--muted); }
.mi-section-card.primary { color: #fff; border-color: #075b9b; background: linear-gradient(135deg, #075b9b, #0d77b5); }
.mi-section-card.primary > span { color: #fff; background: rgba(255,255,255,.16); }
.mi-section-card.primary small, .mi-section-card.primary > .ui-icon { color: rgba(255,255,255,.78); }

.history-day-grid { display: grid; grid-template-columns: repeat(7, minmax(70px, 1fr)); gap: 9px; align-items: end; min-height: 110px; }
.history-day-grid a { display: grid; grid-template-rows: auto 64px auto; align-items: end; gap: 4px; color: var(--muted); text-align: center; text-decoration: none; font-size: .72rem; }
.history-day-grid i { justify-self: center; align-self: end; width: 24px; max-height: 62px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#72c8f3, var(--brand)); }
.history-day-grid strong { color: var(--text); font-size: .72rem; }

.mi-empty-state { display: flex; flex-wrap: wrap; gap: 5px 12px; align-items: center; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 11px; color: var(--muted); background: var(--surface-soft); }
.mi-empty-state strong { color: var(--text); }
.mi-empty-state a { margin-left: auto; font-weight: 800; }

/* Bitácora diaria */
.daily-log-head { align-items: flex-end; }
.daily-log-head .page-title { max-width: 730px; }
.log-date-picker { display: grid; gap: 4px; }
.log-date-picker label { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.log-date-picker input { min-height: 40px; }
.log-status-card { position: sticky; top: 8px; z-index: 15; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr); gap: 20px; align-items: center; margin-bottom: 14px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 8px 24px rgba(8, 41, 69, .1); backdrop-filter: blur(12px); }
.log-status-card > div:first-child { display: flex; gap: 10px; align-items: center; min-width: 0; }
.log-status-card strong, .log-status-card small { display: block; }
.log-status-card small { margin-top: 2px; color: var(--muted); }
.log-status-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warn) 15%, transparent); }
.log-status-card.completa .log-status-dot { background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 15%, transparent); }
.log-status-card.nuevo .log-status-dot { background: var(--muted); box-shadow: 0 0 0 5px color-mix(in srgb, var(--muted) 13%, transparent); }
.log-progress-wrap { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.log-progress-wrap > strong { color: var(--brand); font-size: 1.15rem; }
.log-progress { overflow: hidden; height: 7px; border-radius: 99px; background: var(--surface-soft); }
.log-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #49b8ec); transition: width .25s ease; }
.daily-log-form { display: grid; gap: 14px; }
.daily-log-form .card { margin: 0; }
.log-step { scroll-margin-top: 90px; }
.log-step-header { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 13px; align-items: start; margin-bottom: 18px; }
.log-step-header h2 { margin: 2px 0 4px; font-size: 1.2rem; }
.log-step-header p { margin: 0; color: var(--muted); }
.log-step-number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #0865a8, #0d8acb); box-shadow: 0 7px 16px rgba(7, 91, 155, .2); font-size: .9rem; font-weight: 900; }
.task-count { display: grid; place-items: center; min-width: 48px; min-height: 32px; padding: 0 8px; border-radius: 9px; color: var(--brand); background: var(--surface-soft); font-weight: 900; }
.operation-input-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.daily-log-form label { display: grid; align-content: start; gap: 5px; min-width: 0; }
.daily-log-form label > span { color: var(--text); font-size: .81rem; font-weight: 800; }
.daily-log-form label > span em { color: var(--muted); font-style: normal; font-weight: 500; }
.daily-log-form label > small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.input-with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.input-with-unit:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.input-with-unit input { min-width: 0; border: 0 !important; border-radius: 0; box-shadow: none !important; }
.input-with-unit b { padding: 0 11px; color: var(--muted); font-size: .75rem; }
.calculation-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.25fr); gap: 9px; align-items: stretch; margin-top: 16px; padding: 12px; border: 1px solid #b9dcf5; border-radius: 12px; background: #f1f9ff; }
.calculation-strip article { display: grid; align-content: center; gap: 3px; min-height: 82px; padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.76); }
.calculation-strip article > span { color: #5a7186; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.calculation-strip article > strong { color: #12324f; font-size: 1.18rem; }
.calculation-strip article > small { color: #5a7186; }
.calculation-strip .calculation-primary { color: #fff; background: linear-gradient(135deg, #075b9b, #0c81bf); }
.calculation-strip .calculation-primary > span,
.calculation-strip .calculation-primary > strong,
.calculation-strip .calculation-primary > small { color: #fff; }
.calculation-symbol { align-self: center; color: var(--brand); font-size: 1.2rem; font-weight: 900; }
.hydraulic-balance-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); gap: 9px; align-items: stretch; margin-top: 10px; padding: 10px 12px; border: 1px solid #b8dfc8; border-radius: 12px; background: #f2fbf5; }
.hydraulic-balance-strip article { display: grid; align-content: center; gap: 3px; min-height: 70px; padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.78); }
.hydraulic-balance-strip article > span { color: #4b6c59; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.hydraulic-balance-strip article > strong { color: #1f6340; font-size: 1.18rem; }
.hydraulic-balance-strip article > small { color: #4b6c59; }
.hydraulic-balance-strip .calculation-primary { color: #fff; background: linear-gradient(135deg, #1e7147, #2d9b66); }
.hydraulic-balance-strip .calculation-primary > span,
.hydraulic-balance-strip .calculation-primary > strong,
.hydraulic-balance-strip .calculation-primary > small { color: #fff; }
.tds-comparison { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(220px, .9fr); gap: 12px; align-items: end; }
.tds-arrow { align-self: center; color: var(--brand); font-size: 1.5rem; }
.rejection-result { display: grid; align-content: center; gap: 3px; min-height: 94px; padding: 12px 15px; border: 1px solid #a9d5f1; border-radius: 11px; background: #ecf8ff; }
.rejection-result > span { color: #4c6c84; font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.rejection-result > strong { color: #075b9b; font-size: 1.55rem; }
.rejection-result > small { color: #4c6c84; }
.quality-primary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.advanced-measurements { margin-top: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.advanced-measurements summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 15px; cursor: pointer; }
.advanced-measurements summary > span { display: inline-flex; gap: 8px; align-items: center; color: var(--text); font-weight: 850; }
.advanced-measurements summary small { color: var(--muted); }
.advanced-measurements-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; padding: 0 15px 15px; }
.daily-task-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.daily-task-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 68px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.daily-task-row:hover { border-color: var(--brand); }
.daily-task-row input { position: absolute; width: 1px !important; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.daily-task-row .task-check { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--line-strong); border-radius: 9px; color: transparent; background: var(--surface-soft); font-weight: 900; }
.daily-task-row > div { min-width: 0; }
.daily-task-row strong, .daily-task-row small { display: block; }
.daily-task-row small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.daily-task-row.done { border-color: #9fd8b5; background: #effaf3; }
.daily-task-row.done .task-check { border-color: var(--ok); color: #fff; background: var(--ok); }
.daily-task-row.linked { cursor: default; }
.task-tap-label { color: var(--muted); font-size: .69rem; }
.log-note { margin: 12px 0 0; color: var(--muted); font-size: .75rem; }
.tank-input-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.tank-input-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.closing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.closing-grid .wide { grid-column: 1 / -1; }
.log-save-bar { position: sticky; bottom: 8px; z-index: 20; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 76px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 14px 36px rgba(5, 37, 65, .2); backdrop-filter: blur(14px); }
.log-save-bar > div:first-child { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 9px; align-items: center; }
.log-save-bar > div:first-child strong,
.log-save-bar > div:first-child small { grid-column: 2; }
.log-save-bar > div:first-child small { color: var(--muted); }
.log-save-bar > div:last-child { display: flex; gap: 8px; }
.save-indicator { grid-row: 1 / span 2; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.save-indicator.pending { background: var(--warn); }
.save-indicator.saving { background: var(--brand); animation: save-pulse 1s ease-in-out infinite; }
.save-indicator.saved { background: var(--ok); }
.save-indicator.error { background: var(--danger); }
@keyframes save-pulse { 50% { opacity: .35; transform: scale(.8); } }
.log-history { margin-top: 18px !important; }
.history-controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0 0 13px; }
.history-controls > a,
.history-controls > details > summary { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: .75rem; font-weight: 850; text-decoration: none; cursor: pointer; list-style: none; }
.history-controls > a.on,
.history-controls > a:hover,
.history-controls > details[open] > summary { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.history-controls > details > summary::-webkit-details-marker { display: none; }
.history-controls > details { position: relative; }
.history-controls > details > form { position: absolute; top: calc(100% + 7px); left: 0; z-index: 20; display: grid; grid-template-columns: repeat(2, minmax(132px, 1fr)); gap: 9px; min-width: 350px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 14px 32px rgba(5, 37, 62, .16); }
.history-controls > details > form label { display: grid; gap: 4px; }
.history-controls > details > form label span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.history-controls > details > form button { grid-column: 1 / -1; justify-self: start; }
.log-calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); gap: 6px; margin-bottom: 10px; }
.log-calendar > a { position: relative; display: grid; justify-items: center; gap: 1px; min-height: 54px; padding: 7px 4px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface-soft); text-decoration: none; }
.log-calendar > a:hover,
.log-calendar > a.selected { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 13%, transparent); }
.log-calendar > a span { font-size: .82rem; font-weight: 900; }
.log-calendar > a small { color: var(--muted); font-size: .6rem; }
.log-calendar > a i { position: absolute; right: 6px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.log-calendar > a.completa i { background: var(--ok); }
.log-calendar > a.borrador i { background: var(--warn); }
.log-calendar > a.faltante { color: var(--muted); background: color-mix(in srgb, var(--surface-soft) 82%, transparent); }
.calendar-legend { display: flex; gap: 13px; flex-wrap: wrap; margin: 0 0 14px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.calendar-legend i.completa { background: var(--ok); }
.calendar-legend i.borrador { background: var(--warn); }
.log-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.log-history-card { position: relative; display: grid; gap: 7px; min-height: 118px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface-soft); text-decoration: none; }
.log-history-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 11px 0 0 11px; background: var(--warn); }
.log-history-card.completa::before { background: var(--ok); }
.log-history-card > div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.log-history-card > span,
.log-history-card > small { color: var(--muted); }
.log-history-card .history-alert { color: var(--danger); font-size: .72rem; font-weight: 800; }
.legacy-history-note { margin: 13px 0 0; color: var(--muted); font-size: .78rem; }

/* Mantenimiento: tarjetas y contadores diferenciados por equipo. */
.maintenance-center { max-width: 1320px; margin: 0 auto; }
.maintenance-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 18px; }
.maintenance-kpis article { display: grid; gap: 4px; min-height: 104px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.maintenance-kpis span, .maintenance-kpis small { color: var(--muted); }
.maintenance-kpis span { font-size: .74rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.maintenance-kpis strong { color: var(--brand); font-size: 1.7rem; }
.maintenance-kpis .warn strong { color: var(--warn); }
.maintenance-kpis .danger strong { color: var(--danger); }
.equipment-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.equipment-life-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.equipment-life-card::before { content: ""; display: block; height: 4px; background: var(--ok); }
.equipment-life-card.estado-por_vencer::before { background: var(--warn); }
.equipment-life-card.estado-vencido::before { background: var(--danger); }
.equipment-life-card > header { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 16px; }
.equipment-life-card > header > div { min-width: 0; }
.equipment-life-card > header > div > span { color: var(--brand); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.equipment-life-card h2 { margin: 2px 0; font-size: 1.05rem; }
.equipment-life-card header small { color: var(--muted); }
.equipment-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--brand); background: var(--surface-soft); }
.equipment-icon .ui-icon { width: 20px; height: 20px; }
.calendar-life { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 16px 14px; }
.calendar-life > div { display: grid; gap: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.calendar-life span, .calendar-life small { color: var(--muted); font-size: .72rem; }
.calendar-life strong { font-size: .88rem; }
.equipment-counters { display: grid; gap: 8px; padding: 0 16px 14px; }
.counter-row { display: grid; grid-template-columns: auto minmax(80px, 1fr); gap: 4px 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.counter-row > div:first-child { display: grid; }
.counter-row > div:first-child span { color: var(--muted); font-size: .69rem; font-weight: 800; text-transform: uppercase; }
.counter-row > div:first-child strong { font-size: .9rem; }
.counter-row > small { grid-column: 1 / -1; color: var(--muted); font-size: .7rem; }
.counter-progress { overflow: hidden; height: 7px; border-radius: 99px; background: var(--surface-soft); }
.counter-progress i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.counter-row.por_vencer .counter-progress i { background: var(--warn); }
.counter-row.vencido .counter-progress i { background: var(--danger); }
.counter-empty { padding: 11px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: .76rem; background: var(--surface-soft); }
.equipment-action { border-top: 1px solid var(--line); }
.equipment-action summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 16px; cursor: pointer; color: var(--brand); font-size: .8rem; font-weight: 850; }
.equipment-action summary .ui-icon { width: 16px; height: 16px; transition: transform .15s ease; }
.equipment-action[open] summary .ui-icon { transform: rotate(90deg); }
.equipment-action > form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; align-items: end; padding: 0 16px 12px; }
.equipment-action.service-action > form { grid-template-columns: 1fr; }
.equipment-action label { display: grid; gap: 4px; }
.equipment-action label > span { font-size: .75rem; font-weight: 800; }
.equipment-action > p { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: .72rem; }
.service-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.counter-resets { display: flex; flex-wrap: wrap; gap: 7px 13px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.counter-resets legend { padding: 0 5px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.counter-resets label { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.counter-resets input { width: auto; }
.new-equipment-panel > summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) 18px; gap: 10px; align-items: center; cursor: pointer; }
.new-equipment-panel > summary > span strong,
.new-equipment-panel > summary > span small { display: block; }
.new-equipment-panel > summary > span small { margin-top: 2px; color: var(--muted); }
.new-equipment-panel > form { display: grid; gap: 11px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.maintenance-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.maintenance-form-grid label,
.new-equipment-panel > form > label { display: grid; gap: 4px; }
.maintenance-form-grid label > span,
.new-equipment-panel > form > label > span { font-size: .76rem; font-weight: 800; }
.maintenance-history-list { display: grid; }
.maintenance-history-list > article { display: grid; grid-template-columns: 125px minmax(0, 1fr) auto; gap: 13px; align-items: center; min-height: 62px; padding: 10px 0; border-top: 1px solid var(--line); }
.maintenance-history-list time,
.maintenance-history-list span,
.maintenance-history-list small { color: var(--muted); }
.maintenance-history-list article > div { display: grid; gap: 2px; }
.maintenance-history-list article > div:last-child { text-align: right; }
.tren-bitacora-counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 9px 0; }
.tren-bitacora-counters > div { display: grid; gap: 1px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.tren-bitacora-counters span,
.tren-bitacora-counters small { color: var(--muted); font-size: .64rem; }
.tren-bitacora-counters strong { font-size: .78rem; }

.theme-dark .calculation-strip { border-color: #244e6c; background: #13283a; }
.theme-dark .calculation-strip article { background: #182f42; }
.theme-dark .calculation-strip article > span,
.theme-dark .calculation-strip article > small { color: #9bb4c9; }
.theme-dark .calculation-strip article > strong { color: #e5f3ff; }
.theme-dark .rejection-result { border-color: #28516e; background: #152e42; }
.theme-dark .rejection-result > span,
.theme-dark .rejection-result > small { color: #9bbbd0; }
.theme-dark .rejection-result > strong { color: #77c9f5; }
.theme-dark .hydraulic-balance-strip { border-color: #285b45; background: #142f26; }
.theme-dark .hydraulic-balance-strip article { background: #1a3a2d; }
.theme-dark .hydraulic-balance-strip article > span,
.theme-dark .hydraulic-balance-strip article > small { color: #a5cdb4; }
.theme-dark .hydraulic-balance-strip article > strong { color: #a9e1bd; }
.theme-dark .daily-task-row.done { border-color: #275f45; background: #173528; }
.theme-dark .mi-empty-ok { color: #91e2b3; background: #173528; }
.theme-dark .source-label.measured { color: #9bd8ff; background: #183b55; }
.theme-dark .source-label.calculated { color: #9be0b4; background: #1b422d; }
.theme-dark .source-label.estimated { color: #ffd68a; background: #4a3718; }

@media (max-width: 1180px) {
  .mi-section-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mi-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maintenance-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mi-dashboard-grid { grid-template-columns: 1fr; }
  .tds-comparison { grid-template-columns: 1fr auto 1fr; }
  .rejection-result { grid-column: 1 / -1; }
  .advanced-measurements-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-task-checklist { grid-template-columns: 1fr; }
  .log-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .mi-planta-hero { align-items: flex-start; flex-direction: column; padding: 23px; }
  .mi-planta-hero-actions { width: 100%; justify-content: flex-start; }
  .mi-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mi-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-log-head { align-items: stretch; }
  .daily-log-head .page-actions { width: 100%; }
  .daily-log-head .page-actions > * { flex: 1; }
  .log-status-card { top: 6px; grid-template-columns: 1fr; gap: 9px; }
  .log-calendar { grid-template-columns: repeat(7, minmax(38px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .log-step-header { grid-template-columns: 38px minmax(0, 1fr); }
  .log-step-header > :last-child { grid-column: 2; justify-self: start; }
  .calculation-strip { grid-template-columns: 1fr; }
  .hydraulic-balance-strip { grid-template-columns: 1fr; }
  .calculation-symbol { display: none; }
  .calculation-strip article { min-height: 68px; }
  .quality-primary-grid { grid-template-columns: 1fr; }
  .log-save-bar { position: static; align-items: stretch; flex-direction: column; }
  .log-save-bar > div:last-child { width: 100%; }
  .log-save-bar .btn { flex: 1; }
  .maintenance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .planta-context-nav span { display: none; }
  .planta-context-nav { justify-content: space-between; }
  .planta-ui .card { padding: 16px; }
  .mi-kpi-grid,
  .mi-section-grid,
  .operation-input-grid,
  .advanced-measurements-grid,
  .closing-grid,
  .log-history-grid { grid-template-columns: 1fr; }
  .closing-grid .wide { grid-column: auto; }
  .mi-kpi-card { min-height: 118px; }
  .mi-section-card { min-height: 92px; }
  .tds-comparison { grid-template-columns: 1fr; }
  .tds-arrow { transform: rotate(90deg); justify-self: center; }
  .rejection-result { grid-column: auto; }
  .attention-row { grid-template-columns: 32px minmax(0, 1fr); }
  .attention-row > form,
  .attention-row > .ui-icon { grid-column: 2; justify-self: start; }
  .tank-grid { grid-template-columns: 1fr; }
  .history-day-grid { overflow-x: auto; grid-template-columns: repeat(7, 78px); padding-bottom: 6px; }
  .log-step-header { gap: 9px; }
  .log-save-bar > div:last-child { flex-direction: column; }
  .log-save-bar .btn { width: 100%; }
  .advanced-measurements summary { align-items: flex-start; flex-direction: column; }
  .daily-task-row { grid-template-columns: 30px minmax(0, 1fr); }
  .daily-task-row > .pill,
  .daily-task-row > .task-tap-label { grid-column: 2; justify-self: start; }
  .maintenance-kpis,
  .maintenance-form-grid { grid-template-columns: 1fr; }
  .equipment-life-card > header { grid-template-columns: 38px minmax(0, 1fr); }
  .equipment-life-card > header > .pill { grid-column: 2; justify-self: start; }
  .calendar-life,
  .service-two-cols { grid-template-columns: 1fr; }
  .equipment-action > form { grid-template-columns: 1fr; }
  .maintenance-history-list > article { grid-template-columns: 1fr; }
  .maintenance-history-list article > div:last-child { text-align: left; }
}
@media (max-width: 430px) {
  .mi-planta-hero { min-height: 0; padding: 19px; border-radius: 14px; }
  .mi-planta-hero-actions { display: grid; grid-template-columns: 1fr; }
  .mi-planta-hero-actions .btn { width: 100%; justify-content: center; }
  .daily-log-head .page-actions { display: grid; }
  .log-date-picker input { width: 100%; }
  .history-controls > details { width: 100%; }
  .history-controls > details > summary { width: 100%; justify-content: center; }
  .history-controls > details > form { position: static; grid-template-columns: 1fr; min-width: 0; margin-top: 7px; box-shadow: none; }
  .history-controls > details > form button { grid-column: auto; width: 100%; justify-content: center; }
  .log-calendar { grid-template-columns: repeat(7, 40px); }
}
@media (max-width: 390px) {
  .mi-planta-page,
  .daily-log-page { min-width: 0; }
  .mi-planta-title-row { display: grid; }
  .log-status-card { padding: 11px 12px; }
  .planta-ui .card { padding: 14px; }
}
@media (max-width: 375px) {
  .mi-kpi-card { padding: 15px; }
  .tank-card { grid-template-columns: 46px minmax(0, 1fr); padding: 12px; }
  .tank-visual { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .mi-section-card,
  .log-progress span { transition: none; }
  .save-indicator.saving { animation: none; }
}

/* Landing pública v2: los estilos están encapsulados en .hs-landing para no
   alterar las pantallas operativas ni el tren interno del SaaS. */
.hs-landing {
  --hs-navy: #0b4169;
  --hs-navy-2: #0d5a8e;
  --hs-blue: #003f80;
  --hs-blue-dark: #041c34;
  --hs-sky: #eaf4fb;
  --hs-gold: #bba757;
  --hs-silver: #a7a9ac;
  --hs-ink: #18324a;
  --hs-muted: #5c7082;
  --hs-line: #d6e2eb;
  --hs-soft: #f6f9fb;
  --hs-green: #16834a;
  --hs-yellow: #a66a00;
  gap: 28px;
  color: var(--hs-ink);
  font-family: "HS Modelica", "Segoe UI", system-ui, sans-serif;
}

.hs-landing > section { min-width: 0; }
.hs-landing h1,
.hs-landing h2,
.hs-landing h3,
.hs-landing p { overflow-wrap: anywhere; }
.hs-landing h2 { margin: 0; color: var(--hs-ink); font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1.08; }
.hs-landing p { color: var(--hs-muted); }

.hs-floating-cta {
  border-color: rgba(255,255,255,.4);
  border-radius: 999px;
  background: #128346;
  box-shadow: 0 14px 30px rgba(9, 91, 49, .28);
}
.hs-floating-cta:hover { background: #0c6d38; }

.hs-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: end;
  min-height: 590px;
  padding: 112px clamp(22px, 4vw, 44px) 30px;
  overflow: hidden;
  border: 1px solid #4d87aa;
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 15%, rgba(255, 255, 255, .17), transparent 32%),
    linear-gradient(135deg, #0b4169 0%, #0d5a8e 52%, #4e91b5 100%);
  box-shadow: 0 18px 40px rgba(4, 28, 52, .13);
  isolation: isolate;
}
.hs-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--hs-blue), var(--hs-gold), var(--hs-silver), var(--hs-blue));
}
.hs-hero-glow {
  position: absolute;
  right: -100px;
  bottom: -160px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: rgba(39, 139, 205, .16);
  filter: blur(10px);
  pointer-events: none;
}
.hs-nav {
  position: absolute;
  top: 20px;
  right: 22px;
  left: 22px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 11px;
  border: 1px solid rgba(234, 244, 251, .34);
  border-radius: 12px;
  background: rgba(4, 28, 52, .48);
  backdrop-filter: blur(14px);
}
.hs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 900;
}
.hs-brand img {
  display: block;
  width: 166px;
  height: auto;
  padding: 5px 8px;
  border-radius: 8px;
  background: #fff;
}
.hs-brand span {
  color: #eaf6ff;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hs-nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 3px;
  border: 1px solid rgba(215, 239, 255, .15);
  border-radius: 9px;
}
.hs-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 9px;
  border-radius: 7px;
  color: #deeffb;
  font-size: .75rem;
  font-weight: 850;
  white-space: nowrap;
}
.hs-nav-links a:hover { color: #fff; background: rgba(255,255,255,.12); }
.hs-hero-copy,
.hs-hero-proof { position: relative; z-index: 1; min-width: 0; }
.hs-hero-copy { max-width: 590px; padding-bottom: 12px; }
.hs-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(199,168,77,.72);
  border-radius: 7px;
  color: #7c5b00;
  background: #fff9e8;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hs-kicker-light {
  color: #bfe3ff;
  border-color: rgba(176, 221, 255, .42);
  background: rgba(255,255,255,.08);
}
.hs-hero h1 {
  max-width: 640px;
  margin: 16px 0 14px;
  color: #fff;
  font-size: clamp(2.7rem, 5vw, 4.65rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.hs-landing .hs-hero-lead {
  max-width: 530px;
  margin: 0;
  color: #e5f2fc;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 650;
  line-height: 1.42;
}
.hs-hero-actions,
.hs-final-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.hs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: .83rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}
.hs-btn:hover { transform: translateY(-1px); }
.hs-btn-primary { color: #fff; border-color: #197cc7; background: var(--hs-blue); box-shadow: 0 9px 20px rgba(0, 87, 155, .22); }
.hs-btn-primary:hover { color: #fff; background: #004c8d; }
.hs-btn-secondary { color: #e8f5ff; border-color: rgba(205, 232, 251, .48); background: rgba(255,255,255,.08); }
.hs-btn-secondary:hover { color: var(--hs-navy); border-color: #fff; background: #fff; }
.hs-btn-outline { color: var(--hs-blue-dark); border-color: #9ab7d1; background: #fff; }
.hs-btn-outline:hover { color: var(--hs-blue-dark); border-color: var(--hs-gold); background: #fffaf0; }
.hs-text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: #d8eeff;
  font-size: .83rem;
  font-weight: 900;
}
.hs-text-link:hover { color: #fff; }
.hs-text-link-light { color: #d8eeff; }
.hs-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}
.hs-trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(216, 239, 255, .2);
  border-radius: 7px;
  color: #e2f2fd;
  background: rgba(255,255,255,.07);
  font-size: .72rem;
  font-weight: 800;
}
.hs-hero-proof {
  align-self: end;
  overflow: hidden;
  border: 1px solid rgba(213, 238, 255, .38);
  border-radius: 14px;
  background: #f2f7fb;
  box-shadow: 0 20px 42px rgba(0,0,0,.28);
}
.hs-proof-label {
  position: absolute;
  top: 11px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px;
  color: #fff;
  background: rgba(5, 25, 42, .78);
  font-size: .7rem;
  font-weight: 850;
}
.hs-proof-label i,
.hs-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45c98a;
  box-shadow: 0 0 0 4px rgba(69,201,138,.16);
}
.hs-hero-proof img { display: block; width: 100%; height: auto; max-height: 410px; object-fit: cover; object-position: left top; }

.hs-feature-section,
.hs-treatment {
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid #4b83a5;
  border-radius: 16px;
  background: linear-gradient(135deg, #0b4169, #0d5a8e 65%, #2d789e);
  box-shadow: 0 15px 32px rgba(4, 28, 52, .12);
}
.hs-section-heading { display: grid; gap: 10px; min-width: 0; }
.hs-section-heading h2 { color: var(--hs-ink); }
.hs-section-heading > p,
.hs-heading-inline > p { max-width: 670px; margin: 0; color: var(--hs-muted); font-weight: 650; line-height: 1.45; }
.hs-feature-section .hs-section-heading h2,
.hs-treatment .hs-section-heading h2 { color: #fff; }
.hs-feature-section .hs-section-heading > p,
.hs-treatment .hs-section-heading > p,
.hs-feature-section .hs-heading-inline > p { color: #d9ecfa; }

/* La sección pública usa el azul institucional como acento; los bloques de
   lectura descansan sobre superficies claras para evitar contrastes bruscos. */
.hs-feature-section {
  border-color: #c2d8e5;
  background: linear-gradient(135deg, #f5f9fc 0%, #e7f1f7 100%);
  box-shadow: 0 14px 30px rgba(4, 28, 52, .08);
}
.hs-feature-section .hs-section-heading h2 { color: var(--hs-ink); }
.hs-feature-section .hs-section-heading > p,
.hs-feature-section .hs-heading-inline > p { color: var(--hs-muted); }
.hs-heading-inline { grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); align-items: end; gap: 22px; }
.hs-heading-inline > div { display: grid; gap: 10px; }
.hs-section-heading .hs-kicker { justify-self: start; }
.hs-heading-inline h2 { max-width: 680px; }
.hs-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-top: 24px;
}
.hs-feature-card {
  min-width: 0;
  min-height: 156px;
  padding: 17px;
  border: 1px solid #c4d8e5;
  border-top: 3px solid var(--hs-blue);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(21, 56, 86, .05);
}
.hs-feature-card:nth-child(2) { border-top-color: #6b9dbb; }
.hs-feature-card:nth-child(3) { border-top-color: var(--hs-gold); }
.hs-feature-card:nth-child(4) { border-top-color: var(--hs-silver); }
.hs-feature-number { color: var(--hs-blue); font-size: .72rem; font-weight: 950; letter-spacing: .1em; }
.hs-feature-card h3 { margin: 22px 0 7px; color: var(--hs-ink); font-size: 1.02rem; line-height: 1.16; }
.hs-feature-card p { margin: 0; color: #475569; font-size: .84rem; font-weight: 650; line-height: 1.4; }

.hs-problem-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 22px clamp(20px, 4vw, 42px);
  border: 1px solid #e0c77f;
  border-radius: 14px;
  background: #fffaf0;
}
.hs-problem-strip > div { display: grid; gap: 7px; min-width: 0; }
.hs-problem-label { color: #7c5b00; font-size: .7rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.hs-problem-strip strong { color: #26384d; font-size: 1rem; line-height: 1.27; }
.hs-problem-arrow { color: var(--hs-blue); font-size: 1.8rem; font-weight: 900; }
.hs-problem-result { padding-left: 22px; border-left: 1px solid #e2c879; }

.hs-role-section,
.hs-ecosystem-section { display: grid; gap: 20px; padding: 8px 0; }
.hs-role-section .hs-section-heading,
.hs-ecosystem-section .hs-section-heading { max-width: 780px; }
.hs-role-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.hs-role-card { display: grid; align-content: start; min-width: 0; min-height: 214px; padding: 17px; border: 1px solid #cbd9e5; border-top: 4px solid var(--hs-blue); border-radius: 11px; background: #fff; box-shadow: 0 9px 22px rgba(21, 56, 86, .07); }
.hs-role-card:nth-child(2) { border-top-color: #63b887; }
.hs-role-card:nth-child(3) { border-top-color: var(--hs-gold); }
.hs-role-card:nth-child(4) { border-top-color: #a66fd1; }
.hs-role-card:nth-child(5) { border-top-color: #d47a52; }
.hs-role-tag { justify-self: start; padding: 5px 8px; border: 1px solid #a9c5d9; border-radius: 999px; color: #0b5c92; background: #f1f8fd; font-size: .66rem; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }
.hs-role-card h3 { margin: 18px 0 7px; color: var(--hs-ink); font-size: 1rem; line-height: 1.15; }
.hs-role-card p { margin: 0; color: #475d71; font-size: .8rem; font-weight: 650; line-height: 1.43; }

.hs-ecosystem-section { padding: clamp(24px, 4vw, 42px); overflow: hidden; border: 1px solid #c2d8e5; border-radius: 16px; background: linear-gradient(135deg, #f5f9fc 0%, #e4f0f7 100%); box-shadow: 0 14px 30px rgba(4, 28, 52, .08); }
.hs-ecosystem-section .hs-section-heading h2 { color: var(--hs-ink); }
.hs-ecosystem-section .hs-section-heading > p { color: var(--hs-muted); }
.hs-ecosystem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hs-ecosystem-card { display: grid; align-content: start; min-width: 0; min-height: 285px; padding: 19px; border: 1px solid #bfd4e1; border-radius: 12px; background: #fff; box-shadow: 0 9px 20px rgba(21, 56, 86, .06); }
.hs-ecosystem-card.hs-ecosystem-primary { border-color: #d4c17d; background: linear-gradient(180deg, #fffdf6, #fff); }
.hs-ecosystem-index { color: var(--hs-blue); font-size: .68rem; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.hs-ecosystem-card h3 { margin: 14px 0 8px; color: var(--hs-ink); font-size: 1.2rem; line-height: 1.1; }
.hs-ecosystem-card p { margin: 0; color: #465e72; font-size: .82rem; font-weight: 650; line-height: 1.45; }
.hs-ecosystem-card ul { display: grid; gap: 7px; margin: 17px 0 0; padding: 0; list-style: none; }
.hs-ecosystem-card li { position: relative; padding-left: 17px; color: #18324a; font-size: .78rem; font-weight: 800; }
.hs-ecosystem-card li::before { content: "✓"; position: absolute; left: 0; color: #188158; font-weight: 950; }
.hs-ecosystem-note { margin: 0; color: #5a7488; font-size: .72rem; font-weight: 700; line-height: 1.45; }

.hs-dashboard-section {
  display: grid;
  grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr);
  gap: clamp(20px, 4vw, 52px);
  align-items: center;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--hs-line);
  border-radius: 16px;
  background: #f7fafc;
}
.hs-dashboard-copy { display: grid; gap: 13px; min-width: 0; }
.hs-dashboard-copy h2 { color: var(--hs-ink); }
.hs-dashboard-copy p { margin: 0; font-size: 1rem; line-height: 1.48; }
.hs-dashboard-copy .hs-btn { justify-self: start; margin-top: 3px; }
.hs-disclaimer { color: #52667a; font-size: .74rem; font-weight: 650; line-height: 1.4; }
.hs-dashboard-frame {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #adc5d8;
  border-radius: 12px;
  background: #0b2b47;
  box-shadow: 0 16px 34px rgba(7, 31, 52, .19);
}
.hs-frame-bar { display: flex; align-items: center; gap: 5px; min-height: 27px; padding: 5px 9px; color: #dceefa; background: #0b2b47; font-size: .67rem; font-weight: 800; }
.hs-frame-bar span { width: 6px; height: 6px; border-radius: 50%; background: #7ca5be; }
.hs-frame-bar span:nth-child(2) { background: #c7a84d; }
.hs-frame-bar span:nth-child(3) { background: #54b67f; }
.hs-frame-bar b { margin-left: 5px; font-weight: 800; }
.hs-dashboard-frame img { display: block; width: 100%; height: auto; }

.hs-treatment { color: #fff; }
.hs-treatment .hs-section-heading { max-width: 720px; }
.hs-treatment-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(295px, .7fr); gap: 16px; align-items: start; margin-top: 25px; }
.hs-plant-diagram { min-width: 0; margin: 25px 0 0; padding: 12px; border: 1px solid rgba(184, 221, 246, .25); border-radius: 12px; background: rgba(1, 19, 34, .3); }
.hs-plant-diagram figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 3px 12px; }
.hs-plant-diagram figcaption > div { display: grid; gap: 4px; min-width: 0; }
.hs-plant-diagram figcaption strong { color: #fff; font-size: .92rem; }
.hs-plant-diagram figcaption span { color: #c5ddeb; font-size: .73rem; line-height: 1.35; }
.hs-diagram-live { display: inline-flex; align-items: center; gap: 7px; color: #b9e9d1; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.hs-diagram-live i { width: 7px; height: 7px; border-radius: 50%; background: #47cf8d; box-shadow: 0 0 0 4px rgba(71, 207, 141, .15); animation: hs-plant-flow-pulse 1.8s ease-out infinite; }
.hs-plant-diagram-canvas { max-width: 100%; overflow-x: auto; border: 1px solid #a9c7dc; border-radius: 9px; background: #f2f6fb; scrollbar-color: #5a95bd transparent; }
.hs-plant-diagram-canvas img { display: block; width: 100%; min-width: 760px; height: auto; }
.hs-plant-diagram > p { margin: 9px 3px 2px; color: #b9d9ed; font-size: .72rem; line-height: 1.4; }
@keyframes hs-plant-flow-pulse {
  0% { box-shadow: 0 0 0 0 rgba(71, 207, 141, .35); }
  70% { box-shadow: 0 0 0 6px rgba(71, 207, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(71, 207, 141, 0); }
}
.hs-train-column { min-width: 0; padding: 14px; border: 1px solid rgba(184, 221, 246, .25); border-radius: 12px; background: rgba(1, 19, 34, .3); }
.hs-train-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 1px 13px; color: #e6f5ff; font-size: .76rem; font-weight: 850; }
.hs-train-toolbar small { color: #b9d9ed; font-size: .7rem; font-weight: 650; }
.hs-train-flow { display: flex; align-items: stretch; min-width: 0; padding-bottom: 3px; overflow-x: auto; scrollbar-color: #5a95bd rgba(255,255,255,.08); }
.hs-train-stage {
  flex: 1 1 68px;
  min-width: 68px;
  min-height: 113px;
  padding: 10px 6px;
  border: 1px solid rgba(185, 221, 244, .3);
  border-radius: 9px;
  color: #e8f5fd;
  background: rgba(255,255,255,.06);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.hs-train-stage:hover,
.hs-train-stage:focus-visible,
.hs-train-stage.is-active { border-color: #72c1f2; background: rgba(38, 137, 201, .24); }
.hs-train-stage:focus-visible { outline: 3px solid rgba(203, 235, 255, .45); outline-offset: 2px; }
.hs-train-stage.is-active { transform: translateY(-2px); box-shadow: 0 7px 15px rgba(0,0,0,.13); }
.hs-stage-featured { border-color: rgba(199,168,77,.68); }
.hs-stage-index { display: block; margin-bottom: 16px; color: #89c9ef; font-size: .67rem; font-weight: 950; letter-spacing: .08em; }
.hs-train-stage strong { display: block; color: #fff; font-size: .76rem; line-height: 1.14; }
.hs-train-stage small { display: block; margin-top: 6px; color: #bcd5e5; font-size: .64rem; line-height: 1.25; }
.hs-train-connector { flex: 0 0 10px; align-self: center; color: #78b8df; font-size: .78rem; font-weight: 900; text-align: center; }
.hs-train-panel { min-width: 0; padding: 17px; border: 1px solid #a9cfe7; border-radius: 12px; color: var(--hs-ink); background: #fff; box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.hs-panel-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hs-panel-kicker { color: var(--hs-blue); font-size: .67rem; font-weight: 950; letter-spacing: .08em; }
.hs-state { display: inline-flex; align-items: center; gap: 6px; font-size: .69rem; font-weight: 900; }
.hs-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hs-state-ok { color: var(--hs-green); }
.hs-state-warn { color: var(--hs-yellow); }
.hs-train-panel h3 { margin: 15px 0 14px; color: var(--hs-ink); font-size: 1.45rem; line-height: 1.05; }
.hs-train-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hs-train-stats div { display: grid; gap: 3px; min-width: 0; padding: 8px 9px; border: 1px solid #e0e9f1; border-radius: 7px; background: #f7fafc; }
.hs-train-stats span,
.hs-life span,
.hs-panel-next span,
.hs-operating-summary span,
.hs-operating-summary small { color: #5b6b7c; font-size: .68rem; font-weight: 750; }
.hs-train-stats strong { color: var(--hs-ink); font-size: .82rem; }
.hs-life { display: grid; gap: 6px; margin-top: 15px; }
.hs-life > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.hs-life strong { color: var(--hs-blue); font-size: .82rem; }
.hs-life-bar,
.hs-goal-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #dbe7f0; }
.hs-life-fill,
.hs-goal-bar span { display: block; height: 100%; border-radius: inherit; background: var(--hs-blue); transition: width .22s ease; }
.hs-life-ok { background: #21895b; }
.hs-life-warn { background: #b47b12; }
.hs-panel-next { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e1e9f0; }
.hs-panel-next strong { color: var(--hs-ink); font-size: .8rem; }
.hs-panel-note { margin: 12px 0 0; color: #52667a; font-size: .76rem; line-height: 1.4; }
.hs-operating-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.hs-operating-summary article { display: grid; gap: 4px; min-width: 0; padding: 13px; border: 1px solid rgba(185, 221, 244, .25); border-radius: 9px; background: rgba(1, 19, 34, .34); }
.hs-operating-summary strong { color: #fff; font-size: 1.32rem; line-height: 1.05; }
.hs-operating-summary small { color: #c4dbea; }
.hs-goal-bar { margin: 5px 0 1px; background: rgba(225, 239, 250, .2); }
.hs-goal-bar span { background: #70c1ef; }
.hs-maintenance-callout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr) auto; gap: 18px; align-items: center; margin-top: 14px; padding: 14px 15px; border: 1px solid rgba(199,168,77,.58); border-radius: 10px; background: rgba(255, 250, 232, .09); }
.hs-maintenance-callout > div:first-child { display: grid; gap: 8px; }
.hs-maintenance-callout .hs-kicker { justify-self: start; }
.hs-maintenance-callout strong { color: #fff; font-size: .92rem; line-height: 1.25; }
.hs-maintenance-items { display: grid; gap: 5px; }
.hs-maintenance-items span { color: #d4e8f5; font-size: .76rem; font-weight: 750; }
.hs-maintenance-items b { margin-left: 5px; color: #f0d879; }
.hs-noscript { margin: 12px 0 0; color: #dceefa; font-size: .8rem; }

.hs-photo-section { display: grid; gap: 20px; padding: 8px 0; }
.hs-photo-section .hs-section-heading { max-width: 640px; }
.hs-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hs-photo-card { position: relative; min-width: 0; min-height: 310px; overflow: hidden; border: 1px solid #b4c9da; border-radius: 12px; background: var(--hs-navy); }
.hs-photo-card img { display: block; width: 100%; height: 100%; min-height: 310px; object-fit: cover; transition: transform .4s ease; }
.hs-photo-card:hover img { transform: scale(1.035); }
.hs-photo-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,25,43,.04) 28%, rgba(5,25,43,.86) 100%); pointer-events: none; }
.hs-photo-card > div { position: absolute; right: 17px; bottom: 17px; left: 17px; z-index: 1; display: grid; gap: 8px; }
.hs-photo-card span { justify-self: start; padding: 5px 8px; border: 1px solid rgba(232, 205, 119, .75); border-radius: 6px; color: #fff3bd; background: rgba(4, 28, 52, .64); font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hs-photo-card strong { color: #fff; font-size: 1.1rem; line-height: 1.1; }

.hs-calculator-wrap { padding: 0; }
.hs-calculator { border: 1px solid #c9d8e5; border-radius: 12px; background: #f7fafc; }
.hs-calculator summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; color: var(--hs-ink); cursor: pointer; list-style: none; }
.hs-calculator summary::-webkit-details-marker { display: none; }
.hs-calculator summary span { display: grid; gap: 4px; }
.hs-calculator summary b { font-size: .94rem; }
.hs-calculator summary small { color: #5b6b7c; font-size: .72rem; font-weight: 700; }
.hs-calculator summary i { color: var(--hs-blue); font-size: 1.35rem; font-style: normal; }
.hs-calculator[open] summary i { transform: rotate(45deg); }
.hs-calculator-body { display: grid; grid-template-columns: minmax(200px, .7fr) minmax(0, 1.3fr); gap: 15px; padding: 0 18px 18px; }
.hs-calculator-body > p { margin: 0; font-size: .8rem; line-height: 1.4; }
.hs-calculator-form { grid-column: 2; grid-row: 1 / span 2; }
.hs-calculator-form label { color: var(--hs-ink); }
.hs-calculator-result { grid-column: 1; align-self: end; padding: 12px; border: 1px solid #cbd9e5; border-radius: 9px; background: #fff; }
.hs-calculator-result span,
.hs-calculator-result small { display: block; color: #5b6b7c; font-size: .7rem; font-weight: 750; }
.hs-calculator-result strong { display: block; margin: 5px 0; color: var(--hs-blue); font-size: 1.5rem; }

.hs-pricing { display: grid; gap: 20px; padding: 8px 0; }
.hs-section-heading > p { margin: 0; }
.hs-pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.hs-plan-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 360px; padding: 21px; border: 1px solid #cbd9e5; border-radius: 13px; background: #fff; box-shadow: 0 9px 22px rgba(21, 56, 86, .08); }
.hs-plan-featured { border: 2px solid var(--hs-gold); background: linear-gradient(180deg, #fffaf0 0%, #fff 52%); box-shadow: 0 15px 28px rgba(117, 88, 17, .12); }
.hs-plan-badge { position: absolute; top: 13px; right: 13px; padding: 5px 8px; border-radius: 999px; color: #5f4600; background: #f3dc89; font-size: .65rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.hs-plan-label { align-self: flex-start; padding: 5px 8px; border: 1px solid #abc2d6; border-radius: 6px; color: var(--hs-blue-dark); background: #f3f8fc; font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.hs-plan-featured .hs-plan-label { border-color: #dfc574; background: #fff8dd; }
.hs-plan-card h3 { margin: 18px 0 8px; color: var(--hs-blue-dark); font-size: 1.25rem; }
.hs-plan-price { color: var(--hs-ink); font-size: 1.7rem; line-height: 1; }
.hs-plan-price small { color: #52667a; font-size: .78rem; font-weight: 800; }
.hs-plan-card p { min-height: 42px; margin: 12px 0 15px; color: #475569; font-size: .86rem; font-weight: 650; line-height: 1.4; }
.hs-plan-card ul { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.hs-plan-card li { position: relative; padding-left: 19px; color: #26384d; font-size: .82rem; font-weight: 750; }
.hs-plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--hs-green); font-weight: 950; }
.hs-plan-card .hs-btn { width: 100%; margin-top: auto; }

/* Contraste reforzado: evita que los planes queden casi blancos sobre
   tarjetas claras por efecto de estilos generales de texto. */
.hs-landing .hs-pricing .hs-section-heading > p { color: #344f68; font-weight: 700; }
.hs-landing .hs-pricing .hs-plan-card h3 { color: #003f76; font-weight: 850; }
.hs-landing .hs-pricing .hs-plan-card .hs-plan-price { color: #0b2138; font-weight: 900; }
.hs-landing .hs-pricing .hs-plan-card .hs-plan-price small { color: #31485e; }
.hs-landing .hs-pricing .hs-plan-card p { color: #304b63; font-weight: 700; }
.hs-landing .hs-pricing .hs-plan-card li { color: #18324a; font-weight: 800; }
.hs-landing .hs-pricing .hs-plan-card li::before { color: #8a6900; }
.hs-landing .hs-pricing .hs-plan-label { color: #003f76; border-color: #78a4c2; background: #f1f7fc; }
.hs-landing .hs-pricing .hs-plan-featured .hs-plan-label { color: #604800; border-color: #c9a943; background: #fff5c9; }
.hs-landing .hs-pricing .hs-plan-card .hs-btn-outline { color: #003f76; border-color: #6f9bbc; background: #f5faff; }
.hs-landing .hs-pricing .hs-plan-card .hs-btn-outline:hover { color: #00345f; border-color: #a17c11; background: #fff9e4; }

.hs-contact { display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 1.22fr); gap: 20px; align-items: stretch; padding: clamp(22px, 4vw, 38px); border: 1px solid #24557b; border-radius: 16px; background: linear-gradient(135deg, #071a2b, #0a3a61); box-shadow: 0 18px 40px rgba(4, 25, 44, .17); }
.hs-contact-copy { display: grid; align-content: center; gap: 13px; min-width: 0; }
.hs-contact-copy h2 { color: #fff; }
.hs-contact-copy p { margin: 0; color: #dceefa; font-size: 1rem; line-height: 1.45; }
.hs-contact-note { color: #b8d3e6; font-size: .76rem; font-weight: 700; }
.hs-contact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 11px; min-width: 0; padding: 17px; border: 1px solid #b5d0e5; border-radius: 11px; background: #fff; }
.hs-contact-form label { color: var(--hs-ink); }
.hs-contact-form input,
.hs-contact-form select,
.hs-contact-form textarea { border-color: #b8cbd9; color: var(--hs-ink); background: #fff; }
.hs-contact-form .hs-btn { border-radius: 8px; }
.hs-contact-form .lead-note { color: #52667a; }

.hs-final-cta { display: grid; justify-items: center; gap: 12px; padding: clamp(25px, 4vw, 44px); border: 1px solid #d4b861; border-radius: 15px; background: linear-gradient(135deg, #fffdf6, #f3f8fc); text-align: center; }
.hs-final-cta h2 { max-width: 650px; color: var(--hs-ink); }
.hs-final-actions { justify-content: center; margin-top: 7px; }
.hs-final-cta .hs-btn-secondary { color: var(--hs-blue-dark); border-color: #9bb7ce; background: #fff; }
.hs-final-cta .hs-btn-secondary:hover { color: var(--hs-blue-dark); background: #f1f8fd; }

@media (prefers-reduced-motion: reduce) {
  .hs-btn,
  .hs-train-stage,
  .hs-life-fill,
  .hs-photo-card img { transition: none; }
}

@media (max-width: 1050px) {
  .hs-nav-links a { padding-right: 7px; padding-left: 7px; }
  .hs-hero { grid-template-columns: minmax(0, .85fr) minmax(320px, 1.15fr); gap: 24px; }
  .hs-role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hs-treatment-layout { grid-template-columns: 1fr; }
  .hs-train-flow { overflow-x: auto; }
  .hs-train-panel { max-width: 590px; }
  .hs-maintenance-callout { grid-template-columns: minmax(0, 1fr) minmax(200px, .8fr); }
  .hs-maintenance-callout .hs-text-link { grid-column: 2; justify-self: end; }
}

@media (max-width: 760px) {
  .hs-hero { grid-template-columns: 1fr; min-height: auto; padding: 100px 20px 22px; }
  .hs-nav { right: 13px; left: 13px; }
  .hs-nav-links { display: none; }
  .hs-brand img { width: 148px; }
  .hs-brand span { display: none; }
  .hs-hero-copy { padding-bottom: 0; }
  .hs-hero h1 { max-width: 500px; font-size: clamp(2.45rem, 11vw, 3.4rem); }
  .hs-hero-proof { max-width: 650px; }
  .hs-hero-proof img { max-height: 330px; }
  .hs-heading-inline { grid-template-columns: 1fr; }
  .hs-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-problem-strip { grid-template-columns: 1fr; gap: 14px; }
  .hs-problem-arrow { transform: rotate(90deg); justify-self: center; }
  .hs-problem-result { padding-top: 14px; padding-left: 0; border-top: 1px solid #e2c879; border-left: 0; }
  .hs-dashboard-section { grid-template-columns: 1fr; }
  .hs-dashboard-frame { order: -1; }
  .hs-plant-diagram { margin-top: 20px; padding: 9px; }
  .hs-plant-diagram figcaption { align-items: flex-start; flex-direction: column; gap: 5px; }
  .hs-plant-diagram-canvas img { min-width: 560px; }
  .hs-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-ecosystem-grid { grid-template-columns: 1fr; }
  .hs-photo-grid,
  .hs-pricing-grid { grid-template-columns: 1fr; }
  .hs-photo-card { min-height: 270px; }
  .hs-photo-card img { min-height: 270px; }
  .hs-calculator-body { grid-template-columns: 1fr; }
  .hs-calculator-form { grid-column: 1; grid-row: auto; }
  .hs-calculator-result { grid-column: 1; }
  .hs-contact { grid-template-columns: 1fr; }
  .hs-contact-copy { max-width: 600px; }
}

@media (max-width: 520px) {
  .hs-landing { gap: 20px; }
  .hs-hero { padding-top: 92px; }
  .hs-hero h1 { font-size: 2.45rem; }
  .hs-hero-actions { align-items: stretch; flex-direction: column; }
  .hs-hero-actions .hs-btn { width: 100%; }
  .hs-hero-actions .hs-text-link { justify-content: center; }
  .hs-trust-row span { width: 100%; }
  .hs-feature-section,
  .hs-treatment,
  .hs-ecosystem-section { padding: 20px 16px; border-radius: 13px; }
  .hs-feature-grid { grid-template-columns: 1fr; }
  .hs-role-grid { grid-template-columns: 1fr; }
  .hs-feature-card { min-height: 125px; }
  .hs-feature-card h3 { margin-top: 15px; }
  .hs-dashboard-section { padding: 16px; }
  .hs-train-toolbar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .hs-train-flow { display: flex; flex-direction: column; gap: 0; overflow: visible; }
  .hs-train-stage { width: 100%; min-width: 0; min-height: 0; padding: 12px 13px; }
  .hs-stage-index { display: inline-block; width: 27px; margin: 0 8px 0 0; }
  .hs-train-stage strong,
  .hs-train-stage small { display: inline; }
  .hs-train-stage small { margin-left: 7px; }
  .hs-train-connector { flex: 0 0 17px; height: 17px; font-size: 0; }
  .hs-train-connector::after { content: "↓"; font-size: .9rem; }
  .hs-train-panel h3 { font-size: 1.28rem; }
  .hs-operating-summary { grid-template-columns: 1fr; }
  .hs-maintenance-callout { grid-template-columns: 1fr; gap: 12px; }
  .hs-maintenance-callout .hs-text-link { grid-column: auto; justify-self: start; }
  .hs-maintenance-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-photo-card,
  .hs-photo-card img { min-height: 230px; }
  .hs-contact { padding: 19px 15px; }
  .hs-contact-form { grid-template-columns: 1fr; padding: 14px; }
  .hs-contact-form .lead-form-wide { grid-column: auto; }
  .hs-final-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .hs-final-actions .hs-btn { width: 100%; }
  .hs-floating-cta { right: 12px; bottom: 12px; padding: 10px; }
  .hs-floating-cta span { display: none; }
}

/* Ajustes de campaña: movimiento útil, navegación estable y conversión clara. */
.hs-landing.hs-reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .36s ease, transform .36s ease;
}
.hs-landing.hs-reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
.hs-landing.hs-reveal-ready [data-reveal].hs-hero {
  opacity: 1;
  transform: none;
}

.hs-nav-toggle {
  display: none;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(234, 244, 251, .42);
  border-radius: 8px;
  color: #eaf4fb;
  background: rgba(255,255,255,.08);
  font: inherit;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}
.hs-floating-cta {
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.hs-floating-cta.is-visible {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.hs-nav.is-sticky {
  position: fixed;
  top: 10px;
  right: max(18px, calc((100vw - 1240px) / 2));
  left: max(18px, calc((100vw - 1240px) / 2));
  border-color: rgba(0, 63, 128, .16);
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 28px rgba(24, 50, 74, .13);
}
.hs-nav.is-sticky .hs-brand { color: var(--hs-blue-dark); }
.hs-nav.is-sticky .hs-brand span { color: var(--hs-blue-dark); }
.hs-nav.is-sticky .hs-nav-links { border-color: #d6e2eb; background: #f6f9fb; }
.hs-nav.is-sticky .hs-nav-links a { color: var(--hs-blue-dark); }
.hs-nav.is-sticky .hs-nav-links a:hover,
.hs-nav.is-sticky .hs-nav-links a.is-active { color: var(--hs-blue); background: #eaf4fb; }
.hs-nav.is-sticky .hs-nav-toggle { border-color: #b4cddd; color: var(--hs-blue-dark); background: #f6f9fb; }

.hs-nav-links a { position: relative; }
.hs-nav-links a.is-active::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 3px;
  left: 9px;
  height: 2px;
  border-radius: 99px;
  background: var(--hs-gold);
}
.hs-hero-proof { isolation: isolate; }
.hs-proof-chips { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hs-proof-chip {
  position: absolute;
  display: grid;
  gap: 2px;
  min-width: 105px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 9px;
  color: var(--hs-ink);
  background: rgba(255,255,255,.9);
  box-shadow: 0 9px 20px rgba(24, 50, 74, .14);
  backdrop-filter: blur(8px);
  animation: hs-chip-float 5.8s ease-in-out infinite;
}
.hs-proof-chip b { font-size: .82rem; line-height: 1.05; }
.hs-proof-chip small { color: #5c7082; font-size: .61rem; font-weight: 800; line-height: 1.15; }
.hs-proof-chip-one { top: 17%; right: 5%; }
.hs-proof-chip-two { top: 42%; left: 4%; animation-delay: -1.3s; }
.hs-proof-chip-three { right: 5%; bottom: 24%; animation-delay: -2.8s; }
.hs-proof-chip-four { bottom: 7%; left: 9%; animation-delay: -4.1s; }
@keyframes hs-chip-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -3px, 0); }
}

.hs-feature-card,
.hs-role-card,
.hs-ecosystem-card,
.hs-plan-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.hs-feature-card:hover,
.hs-role-card:hover,
.hs-ecosystem-card:hover,
.hs-plan-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(24, 50, 74, .1); }
.hs-feature-card:nth-child(2) { border-top-color: #5b8eae; }
.hs-feature-card:nth-child(4) { border-top-color: var(--hs-silver); }

.hs-photo-grid { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); grid-template-rows: repeat(2, minmax(175px, 1fr)); }
.hs-photo-card:first-child { grid-row: 1 / span 2; min-height: 390px; }
.hs-photo-card:nth-child(2),
.hs-photo-card:nth-child(3) { min-height: 188px; }
.hs-photo-card:nth-child(2) img,
.hs-photo-card:nth-child(3) img { min-height: 188px; }

.hs-dashboard-frame {
  transform: perspective(1200px) rotateX(1deg);
  transition: transform .35s ease, box-shadow .35s ease;
}
.hs-dashboard-frame:hover { transform: perspective(1200px) rotateX(0deg) translateY(-2px); box-shadow: 0 20px 38px rgba(7, 31, 52, .16); }

.hs-train-connector {
  min-height: 18px;
  border-radius: 999px;
  color: #8ed7f3;
  background: linear-gradient(90deg, transparent, rgba(117, 210, 241, .72), transparent);
  background-size: 210% 100%;
  animation: hs-water-flow 3.2s linear infinite;
}
@keyframes hs-water-flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.hs-train-stage { scroll-snap-align: start; }
.hs-train-panel { transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease; }
.hs-train-panel.is-changing { opacity: .6; transform: translateY(3px); }

.hs-connection-section {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid #c2d8e5;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #eef6fa);
  box-shadow: 0 12px 28px rgba(24, 50, 74, .06);
}
.hs-connection-map { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
.hs-connection-lane { display: grid; gap: 8px; min-width: 0; }
.hs-connection-lane-label { color: var(--hs-blue); font-size: .68rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.hs-connection-steps { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hs-connection-steps span { flex: 1 1 auto; min-width: 0; padding: 12px 8px; border: 1px solid #c7dae6; border-radius: 8px; color: var(--hs-ink); background: #fff; font-size: .75rem; font-weight: 850; text-align: center; }
.hs-connection-steps i { flex: 0 0 auto; color: var(--hs-gold); font-style: normal; font-weight: 950; }
.hs-connection-core { display: grid; justify-items: center; gap: 3px; min-width: 118px; padding: 16px 12px; border: 2px solid var(--hs-gold); border-radius: 12px; color: #fff; background: var(--hs-blue); box-shadow: 0 10px 22px rgba(0, 63, 128, .18); text-align: center; }
.hs-connection-core strong { font-size: .9rem; }
.hs-connection-core small { color: #eaf4fb; font-size: .61rem; font-weight: 750; }

.hs-calculator-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; grid-column: 1; align-self: end; }
.hs-calculator-results .hs-calculator-result { grid-column: auto; }
.hs-calculator-result { min-width: 0; }
.hs-calculator-result-total { border-color: #d5bf74; background: #fffdf6; }
.hs-calculator-result strong { transition: transform .2s ease; }
.hs-calculator-result.is-updating strong { transform: scale(1.04); }
.hs-compare-plans { border: 1px solid #c9d8e5; border-radius: 12px; background: #f7fafc; }
.hs-compare-plans summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; color: var(--hs-ink); cursor: pointer; list-style: none; }
.hs-compare-plans summary::-webkit-details-marker { display: none; }
.hs-compare-plans summary span { display: grid; gap: 4px; }
.hs-compare-plans summary small { color: #5b6b7c; font-size: .72rem; font-weight: 700; }
.hs-compare-plans summary i { color: var(--hs-blue); font-size: 1.35rem; font-style: normal; }
.hs-compare-plans[open] summary i { transform: rotate(45deg); }
.hs-comparison-scroll { overflow-x: auto; padding: 0 18px 18px; }
.hs-comparison-scroll table { min-width: 620px; margin: 0; }
.hs-comparison-scroll th,
.hs-comparison-scroll td { padding: 10px 12px; border-bottom: 1px solid #e1e9f0; font-size: .78rem; }
.hs-comparison-scroll thead th { color: var(--hs-blue-dark); background: #edf5fa; }
.hs-comparison-scroll tbody th { color: var(--hs-ink); font-weight: 800; text-align: left; }
.hs-comparison-scroll td { color: var(--hs-blue); font-weight: 950; text-align: center; }

.hs-contact .hs-btn-primary,
.hs-final-cta .hs-btn-primary { min-width: 160px; }

@media (max-width: 760px) {
  .hs-nav.is-sticky { top: 8px; right: 10px; left: 10px; }
  .hs-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .hs-nav-links { position: absolute; top: calc(100% + 8px); right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; padding: 6px; border-color: rgba(234, 244, 251, .32); background: rgba(4, 28, 52, .92); }
  .hs-nav-links.is-open { display: flex; }
  .hs-nav-links a { min-height: 38px; justify-content: flex-start; padding: 8px 11px; }
  .hs-nav-links a.is-active::after { right: 11px; bottom: 6px; left: auto; width: 24px; }
  .hs-nav.is-sticky .hs-nav-links { background: rgba(255,255,255,.98); }
  .hs-proof-chip { min-width: 88px; padding: 6px 8px; }
  .hs-proof-chip b { font-size: .72rem; }
  .hs-proof-chip small { font-size: .55rem; }
  .hs-proof-chip-one { top: 12%; right: 3%; }
  .hs-proof-chip-two { top: 42%; left: 2%; }
  .hs-proof-chip-three { right: 3%; bottom: 23%; }
  .hs-proof-chip-four { bottom: 5%; left: 4%; }
  .hs-photo-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hs-photo-card:first-child,
  .hs-photo-card:nth-child(2),
  .hs-photo-card:nth-child(3) { grid-row: auto; min-height: 270px; }
  .hs-photo-card:nth-child(2) img,
  .hs-photo-card:nth-child(3) img { min-height: 270px; }
  .hs-connection-map { grid-template-columns: 1fr; gap: 12px; }
  .hs-connection-core { order: -1; justify-self: center; }
  .hs-connection-steps { gap: 5px; }
  .hs-connection-steps span { padding: 10px 4px; font-size: .65rem; }
  .hs-connection-steps i { font-size: .75rem; }
  .hs-calculator-results { grid-template-columns: 1fr; grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-proof-chip,
  .hs-train-connector { animation: none; }
  .hs-landing.hs-reveal-ready [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hs-feature-card,
  .hs-role-card,
  .hs-ecosystem-card,
  .hs-plan-card,
  .hs-dashboard-frame,
  .hs-train-panel { transition: none; }
}
