﻿:root {
  --bg: #070c0a;
  --surface: #0f1814;
  --surface-soft: #17241f;
  --text: #eaf2ee;
  --muted: #a1b5ac;
  --line: #20352c;
  
  --green: #00e676;
  --green-soft: rgba(0, 230, 118, 0.12);
  --yellow: #ffd600;
  --yellow-soft: rgba(255, 214, 0, 0.12);
  --red: #ff5252;
  --red-soft: rgba(255, 82, 82, 0.12);
  --blue: #29b6f6;
  --blue-soft: rgba(41, 182, 246, 0.12);
  
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --glow-green: 0 0 16px rgba(0, 230, 118, 0.25);
  --glow-yellow: 0 0 16px rgba(255, 214, 0, 0.25);
  --glow-red: 0 0 16px rgba(255, 82, 82, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

.loginBody {
  min-height: 100vh;
  overflow: hidden;
}

.loginScene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #06100c;
}

.loginScene::before,
.loginScene::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--login-bg);
  background-repeat: no-repeat;
  pointer-events: none;
}

.loginScene::before {
  background-size: cover;
  background-position: center center;
  filter: blur(18px) saturate(1.1);
  transform: scale(1.08);
  opacity: 0.58;
}

.loginScene::after {
  background-size: auto 100vh;
  background-position: center center;
}

.loginBrandBar,
.loginPanel {
  position: absolute;
  z-index: 1;
}

.loginBrandBar {
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 18px, 940px);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(35, 10, 4, 0.22), rgba(5, 18, 11, 0.12));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(2px);
}

.loginPanel {
  top: clamp(122px, 19vh, 190px);
  right: 12px;
  width: min(38vw, 330px);
  display: grid;
  padding: 9px;
  border: 1px solid rgba(203, 255, 226, 0.18);
  border-radius: 12px;
  background: rgba(5, 14, 10, 0.34);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.loginHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 980px);
  margin: 0 auto;
}

.loginBadge {
  width: clamp(48px, 10vw, 78px);
  height: clamp(48px, 10vw, 78px);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green), #16ffd0);
  color: #03120c;
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 900;
  box-shadow: var(--glow-green);
}

.loginEyebrow {
  color: #9fffd0;
  font-size: clamp(13px, 3.1vw, 24px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.loginBrandBar h1 {
  font-size: clamp(30px, 8vw, 72px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75);
}

.loginCopy {
  display: none;
  max-width: 32ch;
  color: #c6d8d0;
  line-height: 1.45;
}

.loginForm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.loginForm label {
  display: grid;
  gap: 3px;
  color: #b9cdc4;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.loginForm input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(203, 255, 226, 0.24);
  border-radius: 8px;
  background: rgba(6, 16, 12, 0.46);
  color: #fff;
  padding: 0 9px;
  font-size: 13px;
  letter-spacing: 0;
  outline: none;
}

.loginForm input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.16);
}

.loginButton {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--green), #19ffd5);
  color: #04120c;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.loginError {
  border: 1px solid rgba(255, 82, 82, 0.42);
  border-radius: 12px;
  background: rgba(255, 82, 82, 0.14);
  color: #ffd5d5;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

@media (min-width: 860px) {
  .loginScene {
    min-height: 100vh;
  }

  .loginScene::after {
    background-size: auto 100vh;
    background-position: center center;
  }

  .loginBrandBar {
    padding-inline: 28px;
  }

  .loginPanel {
    width: min(310px, 24vw);
    top: clamp(138px, 22vh, 230px);
    right: clamp(28px, 8vw, 150px);
  }
}

@media (max-width: 480px) {
  .loginScene {
    min-height: 100svh;
  }

  .loginScene::before {
    opacity: 0.28;
  }

  .loginScene::after {
    background-size: auto 100svh;
    background-position: center center;
  }

  .loginBrandBar {
    min-height: auto;
    display: flex;
    align-items: center;
    top: max(3px, env(safe-area-inset-top));
    padding: 9px 11px;
    border-radius: 14px;
  }

  .loginPanel {
    top: clamp(122px, 16svh, 170px);
    right: 10px;
    width: min(35vw, 152px);
    min-width: 136px;
    padding: 7px;
  }

  .loginForm {
    gap: 5px;
  }

  .loginForm input {
    min-height: 30px;
    font-size: 12px;
  }

  .loginButton {
    min-height: 30px;
    font-size: 12px;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

button, input, select {
  font: inherit;
  color: inherit;
}

.appShell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.logoutForm {
  margin-top: auto;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #090f0d;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brandMark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #050a08;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
}

.brandName {
  font-weight: 800;
  font-size: 19px;
  background: linear-gradient(to right, #ffffff, #82988e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brandSub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.nav {
  display: grid;
  gap: 6px;
}

.navItem {
  border: 1px solid transparent;
  width: 100%;
  border-radius: var(--radius);
  padding: 11px 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.navItem:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.navItem.active {
  background: var(--green-soft);
  border-color: rgba(0, 230, 118, 0.2);
  color: var(--green);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Main Layout */
.main {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

body.hideTopbar .topbar {
  display: none;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

h2 {
  font-size: 18px;
  font-weight: 700;
}

.topActions,
.actionBar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.selectCompact {
  width: auto;
  min-width: 180px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-weight: 700;
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.selectCompact:focus {
  border-color: var(--green);
  outline: none;
}

/* Status Pill */
.statusPill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.statusPill.ok { background: var(--green-soft); color: #00e676; }
.statusPill.warn { background: var(--yellow-soft); color: #ffd600; }
.statusPill.danger { background: var(--red-soft); color: #ff5252; }
.statusPill.neutral { background: var(--surface-soft); color: var(--muted); }

/* Live Status Dot Indicator */
.statusPill.ok::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulseLED 1.6s infinite alternate;
}

@keyframes pulseLED {
  0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 rgba(0, 230, 118, 0.4); }
  100% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 8px rgba(0, 230, 118, 0.9); }
}

/* View Views */
.view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Cards */
.automationHero { margin-bottom: 14px; padding: 14px; border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 12px; background: var(--surface-soft); }
.automationHero.ok { border-left-color: var(--green); background: var(--green-soft); }
.automationHero.warn { border-left-color: var(--yellow); background: var(--yellow-soft); }
.automationHero.danger { border-left-color: var(--red); background: var(--red-soft); }
.automationHeroTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.automationHeroTop > div { display: grid; gap: 3px; }
.automationHeroTop > span { color: var(--muted); font-size: .8rem; text-align: right; }
.automationHero p { margin: 8px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.automationBlockers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.automationBlockers span { padding: 5px 8px; border-radius: 999px; color: #ff8a80; background: rgba(255, 82, 82, .12); font-size: .72rem; font-weight: 700; }
.automationHero .linkBtn { margin-top: 10px; }
.btn:disabled { cursor: not-allowed; opacity: .48; filter: saturate(.6); }


.dataTrustBanner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 14px;
  background: var(--surface);
}

.dataTrustBanner > div { display: grid; gap: 3px; }
.dataTrustBanner strong { font-size: .96rem; }
.dataTrustBanner span:not(.statusPill) { color: var(--muted); font-size: .86rem; }
.dataTrustBanner.ok { border-left-color: var(--green); background: var(--green-soft); }
.dataTrustBanner.warn { border-left-color: var(--yellow); background: var(--yellow-soft); }
.dataTrustBanner.simulation { border-left-color: #8b5cf6; background: rgba(139, 92, 246, .11); }

.kpiHeading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dataOriginBadge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--surface-soft);
  white-space: nowrap;
}

.dataOriginBadge.ok { color: #00e676; background: var(--green-soft); }
.dataOriginBadge.warn { color: #ffd600; background: var(--yellow-soft); }
.dataOriginBadge.simulation { color: #a78bfa; background: rgba(139, 92, 246, .14); }
.statusPill.simulation { color: #a78bfa; background: rgba(139, 92, 246, .14); }


.kpiGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi,
.panel,
.cropCard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.kpi {
  padding: 20px;
  border-left-width: 5px;
  position: relative;
}

.kpi.ok { border-left-color: var(--green); }
.kpi.warn { border-left-color: var(--yellow); }
.kpi.danger { border-left-color: var(--red); }
.kpi.neutral { border-left-color: var(--muted); }
.kpi.disabled {
  border-left-color: #2a3832;
  background: rgba(18, 29, 24, 0.62);
  opacity: 0.62;
}

.kpi.disabled .kpiValue {
  color: var(--muted);
  font-size: 30px;
}

.kpi.disabled .gaugeContainer {
  opacity: 0.25;
}

.kpi.disabled .kpiMeta {
  color: #607469;
}

.kpiLabel {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpiValue {
  margin-top: 10px;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.kpiValue span {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.kpiMeta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Gauge Range Line indicators inside KPI */
.gaugeContainer {
  margin-top: 14px;
  width: 100%;
}

.gaugeTrack {
  position: relative;
  height: 6px;
  background: var(--surface-soft);
  border-radius: 3px;
  overflow: visible;
}

.gaugeOptimal {
  position: absolute;
  height: 100%;
  background: rgba(0, 230, 118, 0.3);
  border-radius: 3px;
  border-left: 1px solid rgba(0, 230, 118, 0.5);
  border-right: 1px solid rgba(0, 230, 118, 0.5);
}

.gaugeMarker {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0,0,0,0.5);
  z-index: 2;
}

.kpi.ok .gaugeMarker { border: 3px solid var(--green); }
.kpi.warn .gaugeMarker { border: 3px solid var(--yellow); }
.kpi.danger .gaugeMarker { border: 3px solid var(--red); }
.kpi.neutral .gaugeMarker { border: 3px solid var(--muted); }

/* Layout Grid System */
.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Panels */
.panel {
  padding: 24px;
  margin-bottom: 16px;
}

.panelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panelHead h2 {
  color: #fff;
}

.panel canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  touch-action: pan-y;
}

.rows {
  display: grid;
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.row span {
  color: var(--muted);
  font-weight: 500;
}

.row strong {
  text-align: right;
  color: #fff;
}

/* Interactive elements */
.btn,
.iconBtn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 46px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active,
.iconBtn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--green);
  color: #050a08;
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.2);
}
.btn.primary:hover {
  background: #00ff81;
  box-shadow: 0 6px 18px rgba(0, 230, 118, 0.35);
}

.btn.secondary {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}
.btn.secondary:hover {
  background: var(--line);
  color: #fff;
}

.btn.success {
  background: #00b0ff;
  color: #03080f;
  box-shadow: 0 4px 14px rgba(0, 176, 255, 0.2);
}
.btn.success:hover {
  background: #33c2ff;
}

.btn.danger {
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 82, 82, 0.2);
}
.btn.danger:hover {
  background: #ff7373;
  box-shadow: 0 6px 18px rgba(255, 82, 82, 0.35);
}

.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none !important;
}

.iconBtn {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 42px;
  padding: 8px 12px;
}
.iconBtn:hover {
  background: var(--line);
  color: #fff;
}

/* Acciones en tarjetas y enlaces de botones */
.miniActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.linkBtn {
  background: transparent;
  border: none;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-height: auto;
}

.linkBtn:hover {
  background: var(--green-soft);
  color: var(--green);
}

.linkBtn.dangerText {
  color: var(--red);
}

.linkBtn.dangerText:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* Manual Forms & Inputs */
.stackForm {
  display: grid;
  gap: 16px;
}

.formGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 10px 14px;
  color: #fff;
  background: var(--surface-soft);
  transition: all 0.2s;
}

input:focus,
select:focus {
  border-color: var(--green);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.1);
}

.fieldHint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.formButton {
  grid-column: 1 / -1;
  justify-self: start;
}

.wideField {
  grid-column: 1 / -1;
}

/* Table styling */
.tableWrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

/* Lists and Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.commissioningIntro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.commissioningSummary { margin-bottom: 16px; }
.commissioningProgressHead { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.commissioningProgressHead > div { display: grid; gap: 4px; }
.commissioningProgressHead span { color: var(--muted); font-size: .86rem; }
.commissioningProgressHead b { color: var(--green); font-size: 1.25rem; }
.commissioningProgressTrack { height: 10px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.commissioningProgressTrack span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #55efc4); transition: width .3s ease; }
.commissioningList { display: grid; gap: 10px; }
.commissioningStep { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.commissioningStep.complete { border-color: rgba(0, 230, 118, .3); }
.commissioningStep.blocked { border-color: rgba(255, 82, 82, .35); }
.commissioningStepIndex { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-weight: 800; }
.commissioningStep.complete .commissioningStepIndex { color: #00e676; background: var(--green-soft); }
.commissioningStepTitle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.commissioningStepBody p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.commissioningFinish { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; }
.commissioningFinish h3, .commissioningFinish p { margin: 0; }
.commissioningFinish p { margin-top: 5px; color: var(--muted); }
.commissioningFinish.ready { border-color: rgba(0, 230, 118, .35); background: var(--green-soft); }
.commissioningConfigCard { position: relative; border-color: rgba(0, 230, 118, .25); }
.commissioningConfigCard .statusPill { position: absolute; top: 12px; right: 12px; }
.btn.small { padding: 8px 11px; font-size: .78rem; }


.configCards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.configCard {
  min-height: 148px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
}

.appCard {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.appCard.active,
.cropCard.active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(56, 189, 148, 0.25), var(--shadow);
}

.screenCards {
  margin-bottom: 16px;
}

.screenHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.screenHeader h2 {
  margin: 0;
  color: #fff;
}

.manualDetail[hidden],
.devicesListScreen[hidden],
.deviceDetailScreen[hidden],
.cropListScreen[hidden],
.cropDetailScreen[hidden],
.hardwareTypeScreen[hidden],
.hardwareListScreen[hidden],
.hardwareDetailScreen[hidden] {
  display: none;
}

.miniSelectCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

#reservoirCropSelect {
  display: none;
}

.miniSelectCard {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 800;
}

.miniSelectCard.active {
  border-color: var(--green);
  background: rgba(56, 189, 148, 0.14);
  color: #fff;
}

.configCard strong {
  color: #fff;
  font-size: 18px;
}

/* Solucion nutritiva */
.solutionHero {
  position: relative;
  min-height: clamp(190px, 34vw, 360px);
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: transparent;
}

.solutionHero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.solutionTitle {
  margin: 2px 0 14px;
}

.solutionRule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(0, 230, 118, 0.24);
  border-radius: var(--radius);
  background: rgba(0, 230, 118, 0.08);
}

.solutionRule.danger {
  margin: 12px 0 0;
  border-color: rgba(255, 193, 7, 0.28);
  background: rgba(255, 193, 7, 0.08);
}

.solutionRule strong,
.phDownSummary strong,
.purchaseItem strong,
.restockTotals strong {
  display: block;
  color: #fff;
}

.solutionRule span,
.phDownSummary span,
.purchaseItem span,
.restockTotals span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.solutionCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.solutionRecipe {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.solutionRecipe.red {
  border-color: rgba(255, 82, 82, 0.28);
}

.solutionRecipe.blue {
  border-color: rgba(0, 176, 255, 0.28);
}

.solutionRecipeHead,
.phDownSummary,
.purchaseItem,
.restockTotals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.solutionRecipeHead h3 {
  color: #fff;
  font-size: 22px;
}

.solutionRecipeHead p,
.solutionDescription {
  color: var(--muted);
  line-height: 1.45;
}

.solutionDescription {
  margin: 12px 0;
}

.solutionVolumes {
  display: grid;
  gap: 10px;
}

.solutionVolume {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.solutionVolume > strong {
  color: #a6ffd7;
}

.solutionVolume div {
  display: grid;
  gap: 6px;
}

.solutionVolume span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.solutionVolume b {
  color: #fff;
  white-space: nowrap;
}

.purchaseList,
.restockPanel,
.phDownPanel,
.solutionSteps {
  display: grid;
  gap: 10px;
}

.purchaseItem {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.purchaseItem .btn {
  min-height: 38px;
  padding: 8px 12px;
}

.restockTotals {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.restockPanel h3 {
  margin-top: 8px;
  color: #fff;
  font-size: 15px;
}

.restockPanel ul,
.solutionSteps {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.maintenanceTool {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.maintenanceSummary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.maintenanceSummary article,
.maintenanceItem {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.maintenanceSummary article {
  padding: 14px;
}

.maintenanceSummary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.maintenanceSummary strong {
  color: #fff;
  font-size: 20px;
}

.maintenanceSummary strong.ok { color: #00e676; }
.maintenanceSummary strong.warn { color: #ffd600; }
.maintenanceSummary strong.danger { color: #ff5252; }
.maintenanceSummary strong.neutral { color: var(--muted); }

.maintenanceCard {
  min-height: 170px;
}

.maintenanceCard.warn,
.maintenanceItem.warn {
  border-color: rgba(255, 214, 0, 0.35);
}

.maintenanceCard.danger,
.maintenanceItem.danger {
  border-color: rgba(255, 82, 82, 0.38);
}

.maintenanceCard.ok,
.maintenanceItem.ok {
  border-color: rgba(0, 230, 118, 0.22);
}

.maintenanceIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--green-soft);
  color: #00e676;
  font-weight: 900;
}

.maintenanceDetail[hidden] {
  display: none;
}

.maintenanceDetail {
  margin-top: 16px;
}

.maintenanceItems {
  display: grid;
  gap: 12px;
}

.maintenanceItem {
  padding: 16px;
}

.maintenanceItemHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.maintenanceItem h3 {
  margin: 10px 0 0;
  color: #fff;
  font-size: 18px;
}

.maintenanceItem p {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.45;
}

.maintenanceItem small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.maintenanceDetailGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.maintenanceDetailGrid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.maintenanceDetailGrid span,
.maintenanceDetailGrid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.maintenanceDetailGrid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.maintenanceDetailGrid strong {
  color: #fff;
  font-size: 13px;
}

.configCard small {
  color: var(--muted);
  line-height: 1.35;
}

.configCard:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.cropCard {
  padding: 20px;
}

.cards.compact,
.cropCardsCompact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.cards.compact .cropCard,
.cropCard.compact,
.hardwareCard {
  padding: 16px;
}

.cropCard h3 {
  margin-bottom: 14px;
  font-size: 18px;
  color: #fff;
}

.cropMeta {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.cropMeta strong {
  color: #fff;
}

.hardwareTitle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.hardwareTitle h3 {
  margin: 0;
}

.choiceGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.choiceCard,
.calibrationCard {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.choiceCard {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
}

.choiceCard small {
  color: var(--muted);
  line-height: 1.35;
}

.choiceIcon {
  font-size: 28px;
}

.choiceCard.active,
.calibrationCard.active {
  border-color: var(--green);
  background: rgba(56, 189, 148, 0.12);
  box-shadow: 0 0 0 1px rgba(56, 189, 148, 0.28);
}

.calibrationItems {
  margin-bottom: 16px;
}

.calibrationCard {
  display: block;
}

.calibrationGroupedList {
  display: grid;
  gap: 18px;
}

.calReservoirGroup {
  display: grid;
  gap: 10px;
}

.calibrationHardwareCard {
  min-height: 150px;
}

.calHelpBox {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

.calHelpBox strong {
  color: #fff;
}

.calResultCard {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  padding: 16px;
}

.calResultEmpty {
  color: var(--muted);
  line-height: 1.5;
}

.compactRows {
  margin-bottom: 0;
}

.emptyState {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.editorPanel.collapsed {
  display: none;
}

.smallBtn {
  min-height: 36px;
  padding: 8px 12px;
}

.panelSubhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.tagList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.checkLine {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkLine input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.phaseSwitch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.phaseBtn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 46px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.phaseBtn.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  box-shadow: var(--glow-green);
}

.cropSelector {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.cropChoice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.cropChoice:hover {
  border-color: var(--muted);
}

.cropChoice.active {
  border-color: var(--green);
  background: rgba(0, 230, 118, 0.05);
}

.cropChoice input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

.cropChoice span {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.cropChoice small {
  grid-column: 2;
  color: var(--muted);
}

/* Mixed Profile Panel styling */
.profileBox {
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface-soft);
}

.profileBox.ok { border-left-color: var(--green); }
.profileBox.warn { border-left-color: var(--yellow); }
.profileBox.danger { border-left-color: var(--red); }

.profileBox h3 {
  color: #fff;
  font-size: 19px;
  margin-bottom: 8px;
}

.profileBox p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.profileRanges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.profileRanges div {
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.profileRanges span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.profileRanges strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
  color: #fff;
  font-weight: 800;
}

.profileRanges small {
  color: var(--muted);
  font-size: 12px;
}

.profileList ul {
  margin-top: 8px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.dangerText,
.dangerText ul {
  color: var(--red) !important;
}

/* Result Logs Panel */
.resultBox {
  min-height: 260px;
  margin: 0;
  border-radius: var(--radius);
  padding: 16px;
  background: #050a08;
  border: 1px solid var(--line);
  color: #a4ffd3;
  font-family: monospace;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}

/* Generic List Items */
.noteList, .checkList, .commandList, .logList {
  display: grid;
  gap: 10px;
}

.filterBar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.filterBar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.noteItem, .checkItem, .commandItem, .logItem {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
  transition: transform 0.2s;
}

.noteItem h3 {
  margin-bottom: 6px;
  font-size: 16px;
  color: #fff;
}

.noteItem p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.checkItem, .commandItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.checkItem span, .commandItem span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
  display: block;
}

.checkItem label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-transform: none;
  font-size: 15px;
  color: #fff;
}

.checkItem input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.logItem {
  border-left-width: 4px;
}
.logItem.ok { border-left-color: var(--green); }
.logItem.warn { border-left-color: var(--yellow); }
.logItem.info { border-left-color: var(--blue); }
.logItem.danger { border-left-color: var(--red); }

.logOverview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.logOverview article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.logOverview span,
.logItemHead span,
.logDetailGrid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.logOverview strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 22px;
}

.logItem {
  display: grid;
  gap: 12px;
}

.logItemHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.logItemHead strong {
  color: #fff;
  font-size: 16px;
}

.logItem p {
  color: var(--text);
  line-height: 1.45;
}

.logDetailGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.logDetailGrid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.logDetailGrid strong {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: 14px;
}

.logMeta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.logPagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Toast alert */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  border-radius: var(--radius);
  padding: 16px 20px;
  background: rgba(15, 24, 20, 0.95);
  border: 1px solid var(--line);
  color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  z-index: 2000;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast[hidden] {
  display: none !important;
}

@keyframes slideIn {
  from { transform: translateY(100%) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Bottom Navigation Bar (Movil) styles */
.bottomNav {
  display: none;
}

/* Mobile Navigation Drawer styles */
.mobileDrawer {
  display: none;
}

/* Responsive Overrides */
@media (max-width: 980px) {
  .appShell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px 24px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    margin-bottom: 16px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .navItem {
    width: auto;
    white-space: nowrap;
  }

  .main {
    padding: 20px;
  }

  
.kpiGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .formGrid,
  .profileRanges {
    grid-template-columns: 1fr;
  }
}

/* Mobile viewport optimizing */
@media (max-width: 768px) {
  .automationHeroTop { flex-direction: column; }
  .automationHeroTop > span { text-align: left; }
  .commissioningIntro, .commissioningFinish { flex-direction: column; align-items: stretch; }
  .commissioningStep { grid-template-columns: 36px minmax(0, 1fr); }
  .commissioningStep > button { grid-column: 2; justify-self: start; }
  .automationHero { margin-bottom: 14px; padding: 14px; border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 12px; background: var(--surface-soft); }
.automationHero.ok { border-left-color: var(--green); background: var(--green-soft); }
.automationHero.warn { border-left-color: var(--yellow); background: var(--yellow-soft); }
.automationHero.danger { border-left-color: var(--red); background: var(--red-soft); }
.automationHeroTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.automationHeroTop > div { display: grid; gap: 3px; }
.automationHeroTop > span { color: var(--muted); font-size: .8rem; text-align: right; }
.automationHero p { margin: 8px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.automationBlockers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.automationBlockers span { padding: 5px 8px; border-radius: 999px; color: #ff8a80; background: rgba(255, 82, 82, .12); font-size: .72rem; font-weight: 700; }
.automationHero .linkBtn { margin-top: 10px; }
.btn:disabled { cursor: not-allowed; opacity: .48; filter: saturate(.6); }


.dataTrustBanner { flex-direction: column; align-items: flex-start; }
  .sidebar {
    display: none; /* Hide top/side nav entirely on mobile */
  }

  .main {
    padding: 16px 16px 84px 16px; /* Extra bottom padding so nav doesn't cover content */
  }

  .topbar {
    margin-bottom: 20px;
  }

  /* Show Fixed Bottom Navigation Bar */
  .bottomNav {
    display: grid;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(15, 24, 20, 0.92);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    z-index: 1000;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 6px;
  }

  .bottomNavItem {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
  }

  .bottomNavItem svg.icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    transition: transform 0.2s;
  }

  .bottomNavItem:active svg.icon {
    transform: scale(0.85);
  }

  .bottomNavItem.active {
    color: var(--green);
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 88px;
    max-width: none;
    justify-content: center;
    text-align: center;
  }

  /* Show Drawer */
  .mobileDrawer {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    visibility: hidden;
    transition: visibility 0.3s;
  }

  .mobileDrawer.open {
    visibility: visible;
  }

  .drawerOverlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobileDrawer.open .drawerOverlay {
    opacity: 1;
  }

  .drawerContent {
    position: absolute;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--surface);
    box-shadow: -8px 0 40px rgba(0,0,0,0.8);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--line);
  }

  .mobileDrawer.open .drawerContent {
    right: 0;
  }

  .drawerHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  .drawerHeader h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 800;
  }

  .drawerCloseBtn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 32px;
    cursor: pointer;
    line-height: 0.8;
  }

  .drawerNav {
    display: grid;
    gap: 8px;
    overflow-y: auto;
  }

  .drawerNavItem {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    text-align: left;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
  }

  .drawerNavItem:hover,
  .drawerNavItem.active {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--green);
  }
}

@media (max-width: 560px) {
  .choiceGrid {
    grid-template-columns: 1fr;
  }

  .choiceCard {
    min-height: 92px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .topActions {
    width: 100%;
    justify-content: space-between;
  }

  .selectCompact {
    flex-grow: 1;
    min-width: 0;
  }

  
.kpiGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .kpi {
    padding: 16px;
  }

  .kpiValue {
    font-size: 32px;
  }

  .panel {
    padding: 18px 16px;
  }
  
  /* Keep standard rows clean and inline on mobile */
  .row {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  
  .row span {
    font-size: 14px;
  }
  
  .row strong {
    font-size: 14px;
    text-align: right;
  }

  .checkItem,
  .commandItem {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .solutionHero {
    min-height: 230px;
    border-radius: 0;
    margin-inline: -16px;
  }

  .solutionRule,
  .solutionRecipeHead,
  .phDownSummary,
  .purchaseItem,
  .restockTotals {
    align-items: stretch;
    flex-direction: column;
  }

  .solutionCards,
  .maintenanceTool {
    grid-template-columns: 1fr;
  }

  .maintenanceSummary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .maintenanceCard {
    min-height: 142px;
    padding: 14px;
  }

  .maintenanceItemHead {
    align-items: stretch;
    flex-direction: column;
  }

  .maintenanceItemHead .btn {
    width: 100%;
  }

  .maintenanceDetailGrid {
    grid-template-columns: 1fr;
  }

  .purchaseItem .btn,
  .phDownSummary .btn {
    width: 100%;
  }
  
  .reservoirChips {
    width: 100%;
    order: 2;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
    margin-top: 4px;
  }
}

/* Reservoir Chips Navigation */
.reservoirChips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.reservoirChips::-webkit-scrollbar {
  display: none;
}
.reservoirChip {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.reservoirChip:hover {
  border-color: var(--muted);
  color: var(--text);
}
.reservoirChip.active {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}

/* Toggle Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  min-height: auto;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface-soft);
  border: 1px solid var(--line);
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--muted);
  transition: .3s;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background-color: var(--green-soft);
  border-color: var(--green);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--green);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

/* Crop Card Emojis */
.cropEmoji {
  font-size: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Wiring reference */
.wiringIntro { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.wiringNotice { display:flex; gap:14px; align-items:center; padding:16px 18px; margin-bottom:18px; border:1px solid rgba(245,158,11,.35); border-radius:14px; background:rgba(245,158,11,.08); }
.wiringNotice strong { color:#f59e0b; white-space:nowrap; }
.wiringGrid { align-items:stretch; margin-bottom:18px; }
.wiringPanel { overflow:hidden; }
.wiringWide { margin-bottom:18px; }
.wiringBadge { display:inline-flex; padding:6px 10px; border-radius:999px; background:var(--green-soft); color:var(--green); border:1px solid rgba(0,230,118,.25); font-size:12px; font-weight:800; white-space:nowrap; }
.wiringBadge.safe { color:#38bdf8; background:rgba(56,189,248,.1); border-color:rgba(56,189,248,.3); }
.wiringBadge.future { color:#a78bfa; background:rgba(167,139,250,.1); border-color:rgba(167,139,250,.3); }
.wiringRows { display:grid; gap:8px; }
.wiringRow { display:grid; grid-template-columns:minmax(130px,1.25fr) 76px minmax(120px,1fr); align-items:center; gap:10px; padding:11px 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); }
.wiringRow code, .registerGrid code, .futureDiagram code { color:var(--green); font-weight:800; }
.wiringRow span, .wiringFoot, .wireNode span, .registerGrid span, .pinMatrix span, .futureDiagram span { color:var(--muted); font-size:13px; }
.wiringFoot { margin:14px 0 0; line-height:1.55; }
.wiringSteps { display:grid; gap:10px; padding:0; margin:0; list-style:none; }
.wiringSteps li { display:flex; gap:12px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); }
.wiringSteps li:last-child { border-bottom:0; }
.wiringSteps li > span { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:var(--green-soft); color:var(--green); font-weight:900; flex:0 0 auto; }
.wiringSteps div { display:grid; gap:2px; }
.wiringSteps small { color:var(--muted); }
.wireFlow { display:flex; align-items:stretch; gap:9px; overflow-x:auto; padding:3px 0 10px; }
.wireFlow > i { align-self:center; color:var(--green); font-size:22px; font-style:normal; }
.wireNode { flex:1 0 150px; min-width:0; display:flex; flex-direction:column; gap:5px; padding:13px; border-radius:12px; border:1px solid var(--line); background:var(--surface-soft); }
.wireNode small { color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:800; }
.wireNode.source { border-color:rgba(245,158,11,.35); }
.wireNode.signal { border-color:rgba(56,189,248,.35); }
.wireNode.protect { border-color:rgba(167,139,250,.35); }
.wireNode.target { border-color:rgba(0,230,118,.35); }
.wiringCallout { margin-top:10px; padding:12px 14px; border-left:3px solid var(--green); background:var(--surface-soft); color:var(--muted); border-radius:0 10px 10px 0; }
.registerGrid, .futureDiagram { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:12px; }
.registerGrid > div, .futureDiagram > div { display:grid; gap:4px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); }
.pinMatrix { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; }
.pinMatrix > div { display:grid; gap:4px; padding:12px; border-radius:11px; border:1px solid var(--line); }
.pinMatrix .used { background:rgba(245,158,11,.06); border-color:rgba(245,158,11,.25); }
.pinMatrix .free { background:var(--green-soft); border-color:rgba(0,230,118,.24); }
.futurePanel { border-color:rgba(167,139,250,.25); }
@media (max-width: 760px) {
  .wiringIntro, .wiringNotice { flex-direction:column; align-items:flex-start; }
  .wiringRow { grid-template-columns:1fr auto; }
  .wiringRow span { grid-column:1 / -1; }
  .wireFlow { flex-direction:column; overflow:visible; }
  .wireFlow > i { transform:rotate(90deg); line-height:16px; }
  .wireNode { flex:auto; width:100%; }
  .registerGrid, .futureDiagram, .pinMatrix { grid-template-columns:1fr; }
}
/* Detailed cable guides */
.wiringGuideGrid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr); gap:18px; margin-bottom:18px; }
.cableGuide, .phReference, .potsPanel { overflow:hidden; }
.cableSteps { display:grid; gap:9px; }
.cableSteps.twoColumns { grid-template-columns:repeat(2,minmax(0,1fr)); }
.cableSteps > div { display:flex; gap:11px; align-items:flex-start; padding:11px 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); }
.cableSteps > div > span { width:28px; height:28px; flex:0 0 28px; display:grid; place-items:center; border-radius:50%; background:var(--green-soft); color:var(--green); font-weight:900; }
.cableSteps p { margin:3px 0 0; line-height:1.5; }
.cableSteps code { color:var(--green); font-weight:800; }
.dangerNote { margin-top:13px; padding:12px 14px; border:1px solid rgba(239,68,68,.28); border-left:4px solid #ef4444; background:rgba(239,68,68,.07); border-radius:10px; color:var(--muted); line-height:1.5; }
.phReference img { display:block; width:100%; max-height:640px; object-fit:contain; border-radius:12px; background:#fff; }
.imageCaption { color:var(--muted); font-size:13px; line-height:1.5; margin:12px 0 0; }
.potsPanel { margin-bottom:18px; }
.potCards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.potCard { padding:16px; border:1px solid var(--line); border-radius:13px; background:var(--surface-soft); }
.potCard h4 { margin:9px 0 7px; }
.potCard p { color:var(--muted); line-height:1.5; }
.potCard strong { display:block; margin-top:12px; color:var(--text); }
.potCard.useCare { border-color:rgba(245,158,11,.35); }
.potCard.noUse { border-color:rgba(148,163,184,.25); }
.potIcon { display:inline-flex; padding:5px 8px; border-radius:7px; background:rgba(245,158,11,.13); color:#f59e0b; font-size:11px; font-weight:900; letter-spacing:.05em; }
.potCard.noUse .potIcon { background:rgba(148,163,184,.13); color:var(--muted); }
.calibrationRule { margin-top:13px; padding:13px 15px; border-radius:11px; background:var(--green-soft); border:1px solid rgba(0,230,118,.25); line-height:1.55; }
.ecGuide { margin-bottom:18px; }
@media (max-width:900px) { .wiringGuideGrid { grid-template-columns:1fr; } .phReference img { max-height:720px; } .potCards { grid-template-columns:1fr; } }
@media (max-width:760px) { .cableSteps.twoColumns { grid-template-columns:1fr; } }
/* Definitive pH text diagram */
.definitiveDiagram { margin-bottom:18px; border-color:rgba(56,189,248,.28); }
.definitiveDiagram pre { margin:0; padding:22px; overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:#f7f8fa; color:#172033; font:600 15px/1.55 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace; white-space:pre; tab-size:2; }
.definitiveWarnings { display:grid; gap:7px; margin-top:12px; color:var(--muted); font-size:13px; }
.definitiveWarnings span { padding:9px 11px; border-radius:9px; background:var(--green-soft); border:1px solid rgba(0,230,118,.16); }
@media (max-width:760px) { .definitiveDiagram pre { padding:15px 13px; font-size:12px; line-height:1.5; } }
/* Configuracion agrupada por finalidad */
.configGroups { display: grid; gap: 22px; }
.configGroup { display: grid; gap: 12px; }
.configGroupHead { display: flex; align-items: center; gap: 12px; }
.configGroupHead > span { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 900; }
.configGroupHead h3, .configGroupHead p { margin: 0; }
.configGroupHead h3 { color: #fff; font-size: 1rem; }
.configGroupHead p { margin-top: 2px; color: var(--muted); font-size: .82rem; }
.configGroup .configCards { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.configGroup .configCard { min-height: 132px; }
.technicalGroup { padding-top: 18px; border-top: 1px solid var(--line); }
.row > small { display: block; max-width: 360px; margin: 3px auto 0 8px; color: var(--muted); font-size: .72rem; line-height: 1.3; }
@media (max-width: 640px) {
  .configGroups { gap: 26px; }
  .configGroup .configCards { grid-template-columns: 1fr; }
  .configGroup .configCard { min-height: 112px; }
  .configGroupHead { align-items: flex-start; }
  .row > small { display: none; }
}

.controlAvailability { display: block; min-height: 18px; margin-top: 10px; color: var(--amber); font-size: .78rem; line-height: 1.4; }
.controlAvailability:empty { display: none; }

.calPreflight { margin: 12px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.calPreflight > strong { display: block; margin-bottom: 9px; color: #fff; }
.preflightRow { display: flex; align-items: flex-start; gap: 9px; padding: 6px 0; }
.preflightRow > span { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; font-weight: 900; }
.preflightRow.ok > span { background: var(--green-soft); color: var(--green); }
.preflightRow.blocked > span { background: rgba(255, 183, 77, .15); color: var(--amber); }
.preflightRow b, .preflightRow small { display: block; }
.preflightRow small { margin-top: 2px; color: var(--muted); }
.commandDetailed > div { display: grid; gap: 3px; }
.commandDetailed small { color: var(--muted); line-height: 1.35; }
.commandDetailed .technicalDetail { opacity: .68; font-size: .7rem; }
.statusPill.danger { color: #ff8a80; background: rgba(255, 82, 82, .12); }
.calWarning { margin: 8px 0; padding: 10px; border-radius: 10px; background: rgba(255, 183, 77, .12); color: var(--amber); font-size: .78rem; line-height: 1.45; }

.commandProgress { display: grid; gap: 5px; margin-top: 5px; min-width: min(360px, 60vw); }
.commandProgress > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .75rem; }
.progressTrack { height: 6px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progressTrack i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s linear; }

.simulationGlobalBanner { position: sticky; top: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 9px 18px; color: #241600; background: #ffb74d; border-bottom: 1px solid rgba(0,0,0,.2); box-shadow: 0 5px 18px rgba(0,0,0,.22); }
.simulationGlobalBanner[hidden] { display: none; }
.simulationGlobalBanner strong { letter-spacing: .08em; }
.simulationGlobalBanner span { font-size: .84rem; }
.simulationGlobalBanner .linkBtn { color: #241600; border-color: rgba(36,22,0,.35); }
.historyOriginNotice { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: .82rem; }
.historyOriginNotice.simulation { color: #ffcc80; background: rgba(255,183,77,.1); border: 1px solid rgba(255,183,77,.25); }
.compactSelect { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.compactSelect select { width: auto; min-width: 155px; }
@media (max-width: 640px) {
  .simulationGlobalBanner { align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px; }
  .simulationGlobalBanner span { width: calc(100% - 150px); min-width: 180px; }
  .compactSelect { width: 100%; justify-content: space-between; }
}

.hardwareCards:has(.hardwareGroup) { display: grid; grid-template-columns: 1fr; gap: 22px; }
.hardwareGroup { display: grid; gap: 10px; }
.hardwareGroup > .cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.reservoirStatusCard { border-left: 4px solid var(--line); }
.reservoirStatusCard.active { border-left-color: var(--green); }
.reservoirIssues { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.reservoirIssues span { padding: 4px 7px; border-radius: 8px; color: var(--amber); background: rgba(255,183,77,.1); font-size: .72rem; }
.manualTasks, .expansionNotice { margin-top: 6px; padding: 8px; border-radius: 9px; font-size: .75rem; line-height: 1.4; }
.manualTasks { color: #90caf9; background: rgba(33,150,243,.1); }
.expansionNotice { color: #ce93d8; background: rgba(156,39,176,.1); }
@media (max-width: 640px) { .hardwareGroup > .cards { grid-template-columns: 1fr; } }

.maintenanceTaskStrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.maintenanceTaskStrip button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
}
.maintenanceTaskStrip button:first-child { border-color: rgba(255,82,82,.38); }
.maintenanceTaskStrip span { color: var(--muted); font-size: .85rem; }
.maintenanceActions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.maintenanceActions .btn:disabled { opacity: .7; cursor: default; }
@media (max-width: 720px) {
  .maintenanceTaskStrip { grid-template-columns: 1fr; }
  .maintenanceTaskStrip button { min-height: 48px; }
  .maintenanceActions { width: 100%; justify-content: stretch; }
  .maintenanceActions .btn { flex: 1; }
}

/* Sistema visual semantico y estados de interfaz */
:root {
  --status-ok: #00e676;
  --status-info: #4fc3f7;
  --status-warning: #ffd54f;
  --status-danger: #ff6b6b;
  --status-offline: #b0bec5;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --card-shadow: 0 10px 28px rgba(0,0,0,.32);
}
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:where(button, input, select, textarea, a):focus-visible {
  outline: 3px solid var(--status-info);
  outline-offset: 3px;
}
.panel, .appCard, .configCard { border-radius: var(--radius-md); }
.appCard, .configCard { min-height: 108px; }
.kpi strong, .metricValue, .sensorValue { font-variant-numeric: tabular-nums; }
.emptyState.richEmpty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  border-style: dashed;
  text-align: left;
}
.emptyState.richEmpty strong { color: var(--text); font-size: 1.05rem; }
.emptyState.richEmpty span { max-width: 52ch; line-height: 1.5; }
.toast[data-tone="danger"] { border-color: var(--status-danger); background: #351619; }
.isLoading::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: uiSpin .7s linear infinite; vertical-align: -2px; }
@keyframes uiSpin { to { transform: rotate(360deg); } }
canvas.isEmpty { opacity: .28; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.inlineControlError { display:block; width:100%; margin-top:7px; color:var(--status-danger); font-size:.86rem; line-height:1.4; }
[aria-invalid="true"] { border-color:var(--status-danger) !important; }

@media (max-width: 720px) {
  .bottomNavItem, .linkBtn, .reservoirChip, .drawerNavItem { min-height: 44px; }
  .bottomNavItem.bottomStop { color: var(--status-danger); }
  .wiringPanel { overflow-x: auto; overscroll-behavior-x: contain; }
  .wiringGuideGrid img, .phReference img { max-width: 100%; height: auto; object-fit: contain; }
  form .actionBar { position: sticky; bottom: 76px; z-index: 5; padding: 10px; background: rgba(15,24,20,.96); border: 1px solid var(--line); border-radius: var(--radius-md); }
}

/* Cierre de puesta en marcha, diagnostico y trazabilidad */
.okText { color: var(--status-ok); }
.outputStatusList { display:grid; gap:8px; margin-top:10px; }
.outputStatusItem { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 11px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.025); }
.outputStatusItem strong { color:var(--status-offline); font-size:.76rem; letter-spacing:.05em; }
.outputStatusItem.active { border-color:rgba(255,107,107,.45); background:rgba(255,107,107,.08); }
.outputStatusItem.active strong { color:var(--status-danger); }
.commissioningReviewGrid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0 0 16px; }
.commissioningReviewGrid > div { display:grid; gap:5px; min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.025); }
.commissioningReviewGrid span { color:var(--muted); font-size:.78rem; }
.commissioningReviewGrid strong { overflow-wrap:anywhere; }
.historyFilters { display:flex; flex-wrap:wrap; gap:10px; align-items:end; }
.historyFilters label { min-width:120px; }
.technicalDetails { margin-top:12px; }
.technicalDetails pre { overflow:auto; max-height:300px; padding:12px; border-radius:10px; background:#09100d; color:#b8d3c6; font-size:.78rem; }
.calibrationHistoryPanel { margin-top:16px; }
.calibrationHistoryList { display:grid; gap:8px; }
.calibrationHistoryItem { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:11px 12px; border:1px solid var(--line); border-radius:11px; }
.calibrationHistoryItem > div { display:grid; gap:4px; min-width:0; }
.calibrationHistoryItem > div:last-child { justify-items:end; }
.calibrationHistoryItem span:not(.statusPill) { color:var(--muted); font-size:.78rem; }
@media (max-width:720px) {
  .commissioningReviewGrid { grid-template-columns:1fr; }
  .calibrationHistoryItem { align-items:flex-start; }
  .calibrationHistoryItem > div:last-child { justify-items:start; }
}


.manualGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.outputTestGrid .btn {
  min-height: 50px;
}

/* Asistente unico de calibracion */
.calWizardBackdrop{position:fixed;inset:0;z-index:2200;display:grid;place-items:center;padding:18px;background:rgba(0,0,0,.78);backdrop-filter:blur(6px)}.calWizardBackdrop[hidden]{display:none}.calWizardCard{width:min(560px,100%);max-height:calc(100vh - 36px);overflow:auto;padding:22px;border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:0 24px 80px rgba(0,0,0,.6)}.calWizardHead{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.calWizardHead h2{margin:3px 0 0}.calWizardClose{border:0;background:transparent;color:var(--muted);font-size:2rem;line-height:1;cursor:pointer}.calWizardBody{display:grid;gap:14px;margin:22px 0;line-height:1.55}.calWizardBody p{margin:0}.calWizardBody label{display:grid;gap:7px;font-weight:700}.calWizardActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px}.calWizardProgress{display:grid;gap:10px;padding:16px;border-radius:12px;background:var(--surface-soft)}.calWizardProgressBar{height:8px;overflow:hidden;border-radius:99px;background:var(--line)}.calWizardProgressBar i{display:block;width:var(--progress,8%);height:100%;border-radius:inherit;background:var(--green);transition:width .4s ease}.calWizardSuccess{padding:16px;border:1px solid rgba(0,220,130,.35);border-radius:12px;background:var(--green-soft)}.calWizardError{padding:16px;border:1px solid rgba(255,80,80,.4);border-radius:12px;color:#ff9d96;background:rgba(255,80,80,.08)}

.manualReadModal .calWizardCard{}


/* Graficas separadas: cada magnitud conserva su propia escala y lectura */
.dashboardCharts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.chartPane, .historyChartPane { border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); padding:10px; }
.chartPaneHead { display:flex; justify-content:space-between; align-items:center; padding:2px 4px 6px; }
.chartPaneHead span { color:var(--muted); font-size:.72rem; }
.historyCharts { display:grid; gap:14px; margin-top:12px; }
.historyChartPane h3 { margin:0 0 4px 4px; font-size:.95rem; }
.dashboardCharts canvas, .historyCharts canvas { display:block; width:100%; height:auto; border-radius:8px; }
@media (max-width:720px) { .dashboardCharts { grid-template-columns:1fr; } }
