/* Agrosense · sensores de campo · raiz fluida, 1 rem ~ 16 px a 2000 px */
:root {
  --bg: #0a0a0b;
  --side: #0c0c0d;
  --card: #111112;
  --card-2: #151516;
  --line: #1c1c1e;
  --line-2: #262628;
  --tx: #ededee;
  --tx-2: #b4b4b8;
  --mut: #86868b;
  --mut-2: #5c5c61;
  --red: #3dff6e;
  --red-soft: rgba(61, 255, 110, 0.1);
  --ok: #4ade80;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { font-size: clamp(10px, calc(4px + 0.6vw), 17px); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--tx);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.35;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.55); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
svg.i { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

/* ───── shell ───── */
.app { display: grid; grid-template-columns: 16.1rem minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.ws { height: 4.6rem; display: flex; align-items: center; gap: 0.85rem; padding: 0 1.1rem 0 1.4rem; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.ws .logo { width: 2rem; height: 2rem; border-radius: 0.55rem; background: #1b1b1d; border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 600; font-size: 0.95rem; }
.ws .nom { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.15; }
.ws .sub { color: var(--mut); font-size: 0.85rem; line-height: 1.2; }
.ws .tx { flex: 1; min-width: 0; }
.ws .i { color: var(--mut); }
.nav { padding: 0.85rem 0.85rem 0; display: flex; flex-direction: column; gap: 0.1rem; }
.nav a, .nav button.it {
  display: flex; align-items: center; gap: 0.8rem; height: 2.3rem; padding: 0 0.7rem; border-radius: 0.55rem;
  color: var(--tx-2); font-size: 1rem; text-align: left; width: 100%; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: #141415; color: var(--tx); }
.nav a.on { background: #1b1b1d; color: #fff; }
.nav .i { width: 1.1rem; height: 1.1rem; color: var(--mut); }
.nav a.on .i { color: #fff; }
.proj-t { margin: 1.35rem 0 0.35rem; padding: 0 1.55rem; color: var(--mut); font-size: 0.85rem; }
.proj { padding: 0 0.85rem; display: flex; flex-direction: column; }
.proj button { display: flex; align-items: center; gap: 0.8rem; height: 2.3rem; padding: 0 0.7rem; border-radius: 0.55rem; color: var(--tx-2); width: 100%; text-align: left; }
.proj button:hover { background: #141415; color: var(--tx); }
.proj button.on { color: #fff; }
.proj .d { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: #55555a; margin: 0 0.35rem 0 0.2rem; }
.proj .on .d { background: var(--red); }
.side .fill { flex: 1; }
.uso { margin: 0 0.8rem 0.8rem; padding: 0.95rem 1rem 1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: #0f0f10; }
.uso .t { display: flex; justify-content: space-between; color: var(--mut); font-size: 0.85rem; }
.uso .v { margin-top: 0.25rem; font-size: 1.05rem; color: var(--mut-2); }
.uso .v b { font-weight: 500; color: var(--tx); }
.uso .bar { margin-top: 0.7rem; height: 0.3rem; border-radius: 99px; background: #232325; overflow: hidden; }
.uso .bar i { display: block; height: 100%; border-radius: 99px; background: #f3f3f3; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.top { height: 3.6rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 1.65rem; position: sticky; top: 0; background: rgba(10, 10, 11, 0.88); backdrop-filter: blur(8px); z-index: 30; }
.crumbs { display: flex; align-items: center; gap: 0.7rem; font-size: 1.05rem; color: var(--mut); white-space: nowrap; overflow: hidden; }
.crumbs span.s { color: var(--mut-2); }
.crumbs b { font-weight: 500; color: #fff; }
.burger { display: none; width: 2.2rem; height: 2.2rem; margin-right: 0.6rem; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 0.6rem; }
.top .der { display: flex; align-items: center; gap: 0.9rem; }
.buscar { display: flex; align-items: center; gap: 0.7rem; width: 15.4rem; height: 2.3rem; padding: 0 0.7rem 0 0.85rem; background: #121213; border: 1px solid var(--line-2); border-radius: 0.8rem; color: var(--mut); font-size: 1rem; text-align: left; }
.buscar span { flex: 1; }
.buscar kbd { font-family: var(--mono); font-size: 0.72rem; border: 1px solid var(--line-2); border-radius: 0.4rem; padding: 0.1rem 0.4rem; color: var(--mut); background: #19191a; }
.campana { position: relative; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; color: var(--tx-2); border-radius: 0.7rem; }
.campana:hover { background: #151516; }
.campana .p { position: absolute; top: 0.45rem; right: 0.55rem; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.campana .p.off { display: none; }

.page { padding: 1.4rem 1.65rem 2rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.cab { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cab .izq { display: flex; align-items: center; gap: 0.9rem; min-width: 0; flex-wrap: wrap; }
h1 { font-size: 1.62rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.pill { display: inline-flex; align-items: center; gap: 0.45rem; height: 1.6rem; padding: 0 0.7rem; border: 1px solid var(--line-2); background: #121213; border-radius: 99px; font-size: 0.9rem; font-weight: 500; }
.pill i { width: 0.32rem; height: 0.32rem; border-radius: 50%; background: #fff; }
.enlace { font-family: var(--mono); font-size: 0.9rem; color: var(--mut); display: inline-flex; gap: 0.3rem; align-items: center; }
.enlace:hover { color: var(--tx); }
.cab .der { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.seg { display: flex; padding: 0.2rem; background: #121213; border: 1px solid var(--line-2); border-radius: 0.8rem; height: 2.3rem; }
.seg button { padding: 0 0.85rem; border-radius: 0.6rem; color: var(--mut); font-size: 1rem; font-weight: 500; transition: all 0.15s; }
.seg button:hover { color: var(--tx); }
.seg button.on { background: #262628; color: #fff; }
.sel { position: relative; }
.sel > button { display: inline-flex; align-items: center; gap: 0.6rem; height: 2.3rem; padding: 0 0.95rem; border: 1px solid var(--line-2); background: #121213; border-radius: 99px; font-size: 1rem; font-weight: 500; }
.sel > button:hover { background: #171718; }
.sel .i { color: var(--mut); width: 0.9rem; height: 0.9rem; }
.menu-f { position: absolute; right: 0; top: calc(100% + 0.4rem); min-width: 13rem; padding: 0.3rem; background: #131314; border: 1px solid var(--line-2); border-radius: 0.8rem; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.6); z-index: 50; max-height: 22rem; overflow: auto; }
.menu-f button { display: flex; width: 100%; gap: 0.6rem; align-items: center; padding: 0.5rem 0.7rem; border-radius: 0.5rem; font-size: 0.95rem; text-align: left; color: var(--tx-2); }
.menu-f button:hover { background: #1b1b1d; color: #fff; }
.menu-f button.on { color: #fff; background: #19191a; }
.menu-f .c { font-family: var(--mono); color: var(--mut); font-size: 0.8rem; width: 2rem; }
.btn-b { height: 2.3rem; padding: 0 1.2rem; border-radius: 99px; background: #f4f4f5; color: #0a0a0b; font-weight: 600; font-size: 1rem; transition: transform 0.15s var(--ease), background 0.15s; }
.btn-b:hover { background: #fff; transform: translateY(-1px); }
.btn-b:active { transform: none; }

/* ───── tarjetas ───── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 1.4rem 1.7rem 1.4rem 1.5rem; border-left: 1px solid var(--line); position: relative; min-width: 0; transition: background 0.2s; }
.kpi:first-child { border-left: 0; }
.kpi:hover { background: #131314; }
.kpi .e { display: flex; align-items: center; gap: 0.55rem; color: var(--mut); font-size: 0.9rem; }
.kpi .e .i { width: 1rem; height: 1rem; }
.kpi .v { margin-top: 0.55rem; font-size: 1.9rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; white-space: nowrap; }
.kpi .v small { font-size: 1.1rem; font-weight: 500; color: var(--mut); letter-spacing: -0.01em; }
.kpi .f { max-width: calc(100% - 7.6rem); margin-top: 0.85rem; color: var(--mut); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .f b { font-weight: 500; color: var(--tx); margin-right: 0.3rem; }
.kpi .f b.r { color: var(--red); }
.kpi svg.bar { position: absolute; right: 1.4rem; bottom: 1.25rem; width: 7rem; height: 2.35rem; }

.fila { display: grid; grid-template-columns: minmax(0, 1.86fr) minmax(0, 1fr); gap: 1rem; }
.ch { display: flex; align-items: center; gap: 0.85rem; height: 3.75rem; padding: 0 1.2rem 0 1.15rem; border-bottom: 1px solid var(--line); }
.ch .ic { width: 2rem; height: 2rem; border: 1px solid var(--line-2); border-radius: 0.55rem; display: grid; place-items: center; color: var(--tx-2); background: #131314; }
.ch .ic .i { width: 1rem; height: 1rem; }
.ch h2 { font-size: 1.07rem; font-weight: 500; letter-spacing: -0.01em; }
.ch .cnt { color: var(--mut); font-size: 1rem; }
.ch .viv { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--mut); font-size: 0.95rem; }
.ch .viv i { width: 0.32rem; height: 0.32rem; border-radius: 50%; background: #fff; }
.ch .sp { flex: 1; }
.ch .lg { display: inline-flex; gap: 1.1rem; color: var(--mut); font-size: 0.9rem; }
.ch .lg span { display: inline-flex; align-items: center; gap: 0.4rem; }
.ch .lg i { width: 0.32rem; height: 0.32rem; border-radius: 50%; background: #fff; }
.ch .lg i.r { background: var(--red); }
.ch .lg i.l { width: 0.8rem; height: 2px; border-radius: 1px; background: #fff; }
.ch .lg i.l.g { background: #8a8a8e; }
.ch .lg i.l.d { background: repeating-linear-gradient(90deg, #8a8a8e 0 2px, transparent 2px 4px); }
.ch .todo { color: var(--tx-2); font-size: 0.95rem; display: inline-flex; gap: 0.35rem; align-items: center; }
.ch .todo:hover { color: #fff; }
.ch .todo .i { width: 0.8rem; height: 0.8rem; }

/* mapa */
.mapa { position: relative; }
.mapa svg.mp { display: block; width: 100%; height: auto; }
.mapa .nodo { cursor: pointer; }
.mapa .nodo:focus-visible { outline: none; }
.mapa .nodo:focus-visible .eti rect { stroke: #fff; }
.mapa .eti rect { fill: rgba(12, 12, 13, 0.88); stroke: rgba(255, 255, 255, 0.07); transition: stroke 0.15s; }
.mapa .nodo:hover .eti rect, .mapa .nodo.on .eti rect { stroke: rgba(255, 255, 255, 0.28); }
.mapa .nodo.alto .eti rect { stroke: rgba(61, 255, 110, 0.35); }
.mapa .eti .c { font-family: var(--mono); font-size: 16px; font-weight: 600; fill: #f2f2f2; }
.mapa .eti .n { font-family: var(--mono); font-size: 15px; fill: #7d7d82; }
.mapa .nodo.dim { opacity: 0.35; }
.tip {
  position: absolute; left: 3.6%; top: 46%; width: 33.5%; padding: 1.05rem 1.1rem 0.95rem;
  background: rgba(19, 19, 20, 0.96); border: 1px solid #2a2a2c; border-radius: 1rem;
  box-shadow: 0 1.6rem 3.5rem rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px);
}
.tip .h { display: flex; align-items: center; gap: 0.6rem; }
.tip .h i { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: #fff; }
.tip .h i.r { background: var(--red); box-shadow: 0 0 0.6rem rgba(61, 255, 110, 0.6); }
.tip .h b { font-weight: 500; font-size: 1.05rem; }
.tip .h span { margin-left: auto; font-family: var(--mono); color: var(--mut); font-size: 0.85rem; }
.tip svg { display: block; width: 100%; height: 2.5rem; margin: 0.5rem 0 0.7rem; }
.tip .gr { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); padding-top: 0.75rem; }
.tip .gr > div { padding-left: 0.7rem; border-left: 1px solid var(--line-2); }
.tip .gr > div:first-child { padding-left: 0; border-left: 0; }
.tip .gr small { display: block; color: var(--mut); font-size: 0.75rem; font-family: var(--mono); }
.tip .gr b { display: block; font-size: 1.2rem; font-weight: 600; letter-spacing: -0.03em; margin-top: 0.1rem; white-space: nowrap; }
.tip .gr b em { font-style: normal; font-size: 0.9rem; font-weight: 500; color: var(--mut); letter-spacing: 0; }
.tip .gr b.r { color: var(--red); }

/* centros */
.reg { display: flex; flex-direction: column; }
.reg .cuerpo { padding: 1.05rem 1.05rem 1rem; display: flex; flex-direction: column; gap: 0.9rem; flex: 1; min-height: 0; }
.alerta { padding: 0.8rem 0.9rem 0.85rem; border: 1px solid rgba(61, 255, 110, 0.3); background: linear-gradient(180deg, rgba(61, 255, 110, 0.1), rgba(61, 255, 110, 0.06)); border-radius: 0.9rem; }
.alerta.ok { border-color: rgba(74, 222, 128, 0.28); background: linear-gradient(180deg, rgba(74, 222, 128, 0.08), rgba(74, 222, 128, 0.04)); }
.alerta b.t { display: block; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.alerta p { margin-top: 0.4rem; font-size: 0.86rem; color: var(--tx-2); line-height: 1.4; }
.alerta .ac { margin-top: 0.7rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.alerta .ac button { height: 2rem; padding: 0 0.9rem; border-radius: 99px; font-size: 0.93rem; font-weight: 500; border: 1px solid var(--line-2); background: #19191a; transition: all 0.15s; }
.alerta .ac button:first-child { background: #f4f4f5; color: #0a0a0b; font-weight: 600; border-color: transparent; }
.alerta .ac button:first-child:hover { background: #fff; }
.alerta .ac button:last-child:hover { background: #222224; }
.lista { display: flex; flex-direction: column; overflow: auto; min-height: 0; }
.lista .fl { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 5rem 4.5rem; align-items: center; gap: 0.5rem; height: 2.25rem; padding: 0 0.2rem; cursor: pointer; border-radius: 0.5rem; }
.lista .fl:hover { background: #151516; }
.lista .fl .c { font-family: var(--mono); color: var(--mut); font-size: 0.93rem; }
.lista .fl .n { font-size: 1rem; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .fl .b { height: 0.2rem; background: #232325; border-radius: 99px; overflow: hidden; }
.lista .fl .b i { display: block; height: 100%; background: #dcdcdd; border-radius: 99px; transition: width 0.5s var(--ease); }
.lista .fl .m { text-align: right; font-size: 1.03rem; font-weight: 500; white-space: nowrap; }
.lista .fl .m small { color: var(--mut); font-size: 0.85rem; font-weight: 400; }
.lista .fl.alto .c, .lista .fl.alto .m { color: var(--red); }
.lista .fl.alto .b i { background: var(--red); }
.lista .fl.on { background: #161617; }

/* gráfico de entrega */
.graf { padding: 0; }
.graf svg { display: block; width: 100%; height: auto; }
.graf text { font-family: "Inter", sans-serif; font-size: 15.5px; fill: #77777c; }
.graf .pico text { fill: var(--red); font-size: 15.5px; }

/* despachos */
.desp { display: flex; flex-direction: column; }
.desp .it { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) 2.2rem; gap: 0.7rem; padding: 0.4rem 1.1rem 0.35rem 1.15rem; align-items: start; cursor: default; }
.desp .it:hover { background: #131314; }
.desp .pt { margin-top: 0.35rem; justify-self: center; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #4b4b50; }
.desp .pt.t-ok { background: #fff; box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.15); }
.desp .pt.t-alerta { background: var(--red); }
.desp .t { font-size: 1.03rem; font-weight: 500; letter-spacing: -0.005em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desp .mt { margin-top: 0.1rem; font-family: var(--mono); color: var(--mut); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desp .av { text-align: center; }
.desp .av span { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; margin: 0 auto; border-radius: 50%; background: #232325; color: var(--tx-2); font-size: 0.7rem; font-weight: 600; }
.desp .av small { display: block; line-height: 1; margin-top: 0.2rem; color: var(--mut); font-size: 0.85rem; white-space: nowrap; margin-left: -0.3rem; margin-right: -0.3rem; }
.desp .lst { padding: 0.35rem 0 0.4rem; }

/* vistas secundarias */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-weight: 400; color: var(--mut); font-size: 0.85rem; padding: 0.8rem 1.2rem; border-bottom: 1px solid var(--line); }
.tabla td { padding: 0.8rem 1.2rem; border-bottom: 1px solid var(--line); font-size: 0.98rem; }
.tabla tr:last-child td { border-bottom: 0; }
.vacio { padding: 4rem 1.5rem; text-align: center; color: var(--mut); }
.vacio b { display: block; color: var(--tx); font-size: 1.15rem; font-weight: 500; margin-bottom: 0.5rem; }

/* diálogos y avisos */
dialog { margin: auto; padding: 0; border: 1px solid var(--line-2); border-radius: 1.1rem; background: #121213; color: var(--tx); width: min(34rem, calc(100vw - 2rem)); box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0.7); }
dialog::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); }
.dlg { padding: 1.4rem 1.5rem 1.3rem; }
.dlg h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.dlg .lead { color: var(--mut); font-size: 0.95rem; margin-top: 0.3rem; }
.dlg label { display: block; margin-top: 1rem; font-size: 0.85rem; color: var(--mut); }
.dlg input, .dlg select { width: 100%; margin-top: 0.4rem; height: 2.5rem; padding: 0 0.8rem; background: #0d0d0e; border: 1px solid var(--line-2); border-radius: 0.7rem; color: var(--tx); font: inherit; font-size: 1rem; }
.dlg .err { color: var(--red); font-size: 0.9rem; margin-top: 0.6rem; min-height: 1.2rem; }
.dlg .pie { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.btn-g { height: 2.3rem; padding: 0 1.1rem; border-radius: 99px; border: 1px solid var(--line-2); background: #19191a; font-weight: 500; font-size: 0.97rem; }
.btn-g:hover { background: #222224; }
.paso { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 3.4rem; gap: 0.8rem; align-items: center; padding: 0.45rem 0; font-size: 0.93rem; color: var(--tx-2); }
.paso .bb { height: 0.5rem; background: #1f1f21; border-radius: 99px; overflow: hidden; }
.paso .bb i { display: block; height: 100%; background: #cfcfd1; border-radius: 99px; }
.paso.r { color: var(--red); } .paso.r .bb i { background: var(--red); }
.paso .mm { text-align: right; font-variant-numeric: tabular-nums; }
.nota-t { margin-top: 0.9rem; padding: 0.8rem 0.9rem; border-radius: 0.8rem; background: #0d0d0e; border: 1px solid var(--line); font-size: 0.93rem; color: var(--tx-2); line-height: 1.45; }
.res { max-height: 16rem; overflow: auto; margin-top: 0.8rem; }
.res button { display: flex; gap: 0.8rem; width: 100%; padding: 0.55rem 0.7rem; border-radius: 0.6rem; text-align: left; color: var(--tx-2); }
.res button:hover, .res button:focus-visible { background: #1b1b1d; color: #fff; }
.res .c { font-family: var(--mono); color: var(--mut); width: 2.4rem; }
.toast { position: fixed; left: 50%; bottom: 3.4rem; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; padding: 0.7rem 1.1rem; border-radius: 99px; background: #f4f4f5; color: #0a0a0b; font-weight: 500; font-size: 0.95rem; transition: all 0.3s var(--ease); z-index: 90; max-width: calc(100vw - 2rem); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.pop { position: absolute; right: 0; top: calc(100% + 0.5rem); width: 21rem; padding: 0.9rem 1rem; background: #131314; border: 1px solid var(--line-2); border-radius: 0.9rem; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.6); font-size: 0.93rem; color: var(--tx-2); z-index: 60; }
.pop b { color: #fff; display: block; margin-bottom: 0.3rem; font-weight: 600; }

/* sello y banda ArchiTechIA */
.pw-sello { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--mut); font-size: 0.8rem; line-height: 1; margin: 0 0 0.8rem 1.4rem; transition: color 0.18s; }
.pw-sello img { width: 1.15rem; height: 1.15rem; border-radius: 0.3rem; opacity: 0.8; transition: opacity 0.18s; }
.pw-sello strong { font-weight: 500; color: var(--tx-2); }
.pw-sello:hover { color: var(--tx); } .pw-sello:hover img { opacity: 1; }
.pw-banda { position: sticky; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: center; gap: 1rem; min-height: 2.2rem; padding: 0 1rem; background: rgba(12, 12, 14, 0.92); border-top: 1px solid rgba(255, 255, 255, 0.09); color: #8f92a6; font-size: 0.82rem; backdrop-filter: blur(6px); margin-top: auto; }
.pw-banda strong { font-weight: 500; color: #d3d5df; }
.pw-banda a { color: #fff; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: rgba(255, 255, 255, 0.35); }
.pw-banda a:hover { text-decoration-color: #fff; }

.cargando { opacity: 0.55; transition: opacity 0.2s; }
@keyframes ent { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }
.page > * { animation: ent 0.5s var(--ease) both; }
.page > *:nth-child(2) { animation-delay: 0.05s; } .page > *:nth-child(3) { animation-delay: 0.1s; } .page > *:nth-child(4) { animation-delay: 0.15s; }
@keyframes pulso { 0%, 100% { opacity: 0.55; r: 15; } 50% { opacity: 1; r: 19; } }
.halo-r { animation: pulso 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───── responsive ───── */
@media (min-width: 901px) and (max-width: 1560px) { .kpi .ft { display: none; } }
@media (max-width: 1180px) {
  .fila { grid-template-columns: minmax(0, 1fr); }
  .tip { width: 38%; }
}
@media (max-width: 900px) {
  html { font-size: 15px; }
  .kpi .f { max-width: calc(100% - 7.6rem); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 17rem; transform: translateX(-102%); transition: transform 0.3s var(--ease); box-shadow: 0 0 4rem rgba(0, 0, 0, 0.7); }
  .side.abierto { transform: none; }
  .burger { display: inline-flex; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .buscar { width: auto; } .buscar span, .buscar kbd { display: none; }
  .crumbs .h { display: none; }
  .page { padding: 1rem 1rem 1.5rem; }
  .top { padding: 0 1rem; }
  .tip { position: static; width: auto; margin: 0 1rem 1rem; }
  .ch .lg { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); } .kpi:first-child { border-top: 0; }
  .cab .der { width: 100%; } .cab .der .seg { flex: 1; } .cab .der .seg button { flex: 1; padding: 0; }
  .paso { grid-template-columns: 7.5rem minmax(0, 1fr) 3rem; }
  .lista .fl { grid-template-columns: 2.8rem minmax(0, 1fr) 3.5rem 4.3rem; }
}

/* ───── Agrosense ───── */
.fila.r2 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.rad { position: relative; display: flex; flex-direction: column; }
.rad .cuerpo-r { position: relative; padding: 0.4rem 1rem 0.2rem; }
.rad svg.dial { display: block; width: 100%; max-width: 44rem; height: auto; margin: 0 auto; }
.rad svg.dial text { font-family: var(--mono); fill: #77777c; font-size: 15px; }
.rad svg.dial .pico-t { fill: var(--red); font-size: 16px; }
.rad .centro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; width: 14rem; }
.rad .centro .g { font-size: 3.3rem; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.rad .centro .g small { font-size: 1.5rem; color: var(--mut); font-weight: 500; letter-spacing: 0; margin-left: 0.1rem; }
.rad .centro .s { margin-top: 0.5rem; color: var(--tx-2); font-size: 1.05rem; }
.rad .centro .d { margin-top: 0.6rem; color: var(--red); font-size: 1.05rem; font-weight: 500; }
.rad .centro .d.ok { color: var(--ok); }
.rad .pie-l { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; padding: 1.05rem 1.5rem 1.1rem; border-top: 1px solid var(--line); font-size: 1.02rem; color: var(--mut); }
.rad .pie-l span { display: inline-flex; align-items: center; gap: 0.55rem; }
.rad .pie-l i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #fff; }
.rad .pie-l i.g { background: #7a7a7f; } .rad .pie-l i.r { background: var(--red); }
.rad .pie-l b { font-weight: 500; color: var(--tx); font-variant-numeric: tabular-nums; }
.rad .pie-l b.r { color: var(--red); }

.lista .fl.nd { grid-template-columns: 4.6rem minmax(0, 1fr) 3.6rem 5rem; }
.lista .fl.nd .c { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .fl.off .n, .lista .fl.off .m { color: var(--mut-2); }

.mseg { display: inline-flex; padding: 0.15rem; background: #121213; border: 1px solid var(--line-2); border-radius: 0.65rem; height: 1.9rem; }
.mseg button { padding: 0 0.65rem; border-radius: 0.5rem; color: var(--mut); font-size: 0.88rem; font-weight: 500; }
.mseg button.on { background: #262628; color: #fff; }
.mseg button:hover { color: var(--tx); }

.acts { padding: 0.4rem 0.5rem 0.6rem; display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 0.7rem 0.7rem; }
.act + .act { border-top: 1px solid var(--line); }
.act .t { font-size: 1.02rem; font-weight: 500; }
.act .m { margin-top: 0.15rem; color: var(--mut); font-size: 0.85rem; font-family: var(--mono); }
.act.on .m { color: var(--ok); }
.sw { position: relative; width: 2.6rem; height: 1.5rem; border-radius: 99px; background: #26262a; border: 1px solid var(--line-2); transition: background 0.2s; flex: none; }
.sw::after { content: ""; position: absolute; top: 0.17rem; left: 0.2rem; width: 1.04rem; height: 1.04rem; border-radius: 50%; background: #9a9a9f; transition: all 0.25s var(--ease); }
.sw[aria-checked="true"] { background: #f1f1f2; border-color: #f1f1f2; }
.sw[aria-checked="true"]::after { left: 1.3rem; background: #0a0a0b; }
.sw:disabled { opacity: 0.5; cursor: progress; }

.finca svg.mp { display: block; width: 100%; height: auto; }
.finca .zn { cursor: pointer; }
.finca .zn:focus-visible { outline: none; }
.finca .zn .eti rect { fill: rgba(12, 12, 13, 0.9); stroke: rgba(255, 255, 255, 0.08); transition: stroke 0.15s; }
.finca .zn:hover .eti rect, .finca .zn.on .eti rect { stroke: rgba(255, 255, 255, 0.3); }
.finca .zn.alto .eti rect { stroke: rgba(61, 255, 110, 0.4); }
.finca .zn .eti .c { font-family: var(--mono); font-size: 16px; font-weight: 600; fill: #f2f2f2; }
.finca .zn .eti .n { font-family: var(--mono); font-size: 15px; fill: #86868b; }
.finca .zn.alto .eti .n { fill: var(--red); }
.finca .zn .nom { font-family: "Inter", sans-serif; font-size: 13px; fill: #6b6b70; letter-spacing: 0.04em; text-transform: uppercase; }
.finca .zn.on .nom { fill: #b4b4b8; }
.finca .zn .nom { paint-order: stroke; stroke: #0a0a0b; stroke-width: 5px; stroke-linejoin: round; }
.finca .tip { top: auto; bottom: 4%; left: 3%; width: 31%; }
.ev .it { grid-template-columns: 1.2rem minmax(0, 1fr) 3rem; }

.tabla tbody tr.cl { cursor: pointer; transition: background 0.15s; }
.tabla tbody tr.cl:hover { background: #141415; }
.tabla .mono { font-family: var(--mono); }
.tabla td.mu { color: var(--mut); }
.tg { display: inline-flex; align-items: center; gap: 0.4rem; height: 1.45rem; padding: 0 0.6rem; border-radius: 99px; border: 1px solid var(--line-2); background: #121213; font-size: 0.82rem; font-weight: 500; white-space: nowrap; color: var(--tx-2); }
.tg i { width: 0.34rem; height: 0.34rem; border-radius: 50%; background: #fff; }
.tg.r { color: var(--red); border-color: rgba(61, 255, 110, 0.35); background: var(--red-soft); } .tg.r i { background: var(--red); }
.tg.a { color: #f0c26a; border-color: rgba(240, 194, 106, 0.3); background: rgba(240, 194, 106, 0.07); } .tg.a i { background: #f0c26a; }
.tg.g { color: var(--mut); } .tg.g i { background: #5c5c61; }
.bat { display: inline-flex; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.bat u { display: inline-block; width: 1.5rem; height: 0.6rem; border-radius: 0.2rem; border: 1px solid #55555a; padding: 1px; text-decoration: none; }
.bat u i { display: block; height: 100%; background: #dcdcdd; border-radius: 0.1rem; }
.bat.low u i { background: var(--red); } .bat.low { color: var(--red); }
.alr { display: grid; grid-template-columns: 0.5rem minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.alr:last-child { border-bottom: 0; }
.alr .pt { margin-top: 0.45rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #5c5c61; }
.alr.alta .pt { background: var(--red); box-shadow: 0 0 0 0.25rem rgba(61, 255, 110, 0.14); }
.alr.media .pt { background: #f0c26a; }
.alr .t { font-size: 1.05rem; font-weight: 500; }
.alr p { margin-top: 0.25rem; color: var(--tx-2); font-size: 0.93rem; line-height: 1.4; max-width: 60rem; }
.alr .mt { margin-top: 0.45rem; display: flex; gap: 0.5rem 0.9rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.8rem; color: var(--mut); }
.alr.rec { opacity: 0.55; }
.rg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.95rem 1.2rem; border-bottom: 1px solid var(--line); }
.rg:last-child { border-bottom: 0; }
.rg .t { font-size: 1.03rem; font-weight: 500; }
.rg .m { margin-top: 0.25rem; color: var(--mut); font-size: 0.88rem; line-height: 1.5; }
.rg .m code { font-family: var(--mono); color: var(--tx-2); font-size: 0.85em; background: #17171a; padding: 0.05rem 0.35rem; border-radius: 0.3rem; }
.rg .d { display: flex; align-items: center; gap: 1rem; color: var(--mut); font-size: 0.85rem; }
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
dialog.g { width: min(40rem, calc(100vw - 2rem)); }
.det-top { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.det-top h3 { font-family: var(--mono); font-size: 1.2rem; letter-spacing: -0.01em; }
.dgr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1rem; border: 1px solid var(--line-2); border-radius: 0.8rem; background: #0d0d0e; }
.dgr > div { padding: 0.75rem 0.9rem; border-left: 1px solid var(--line-2); }
.dgr > div:first-child { border-left: 0; }
.dgr small { display: block; color: var(--mut); font-size: 0.75rem; font-family: var(--mono); }
.dgr b { display: block; margin-top: 0.15rem; font-size: 1.2rem; font-weight: 600; letter-spacing: -0.03em; white-space: nowrap; }
.dgr b em { font-style: normal; font-weight: 500; font-size: 0.85rem; color: var(--mut); letter-spacing: 0; margin-left: 0.15rem; }
.dgr b.r { color: var(--red); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; margin-top: 1rem; font-size: 0.92rem; }
.kv > div { border-bottom: 1px solid var(--line); padding: 0.4rem 0; display: flex; justify-content: space-between; gap: 0.6rem; }
.kv span { color: var(--mut); } .kv b { font-weight: 500; font-family: var(--mono); font-size: 0.85rem; color: var(--tx-2); }
.spk { display: block; width: 100%; height: 4.2rem; margin-top: 1rem; }
.dlg .pie.sp { justify-content: space-between; flex-wrap: wrap; }
.dlg .pie .acc { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dlg .fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; }
.dlg .fila2 .u { display: grid; grid-template-columns: 5rem 1fr; gap: 0.5rem; }

@media (max-width: 1180px) { .fila.r2 { grid-template-columns: minmax(0, 1fr); } .finca .tip { width: 38%; } }
@media (max-width: 900px) {
  .rad .centro { width: 10rem; } .rad .centro .g { font-size: 2.4rem; } .rad .centro .s { font-size: 0.9rem; }
  .finca .tip { position: static; width: auto; margin: 0 1rem 1rem; }
  .dos, .dlg .fila2 { grid-template-columns: minmax(0, 1fr); }
  .tabla { display: block; overflow-x: auto; white-space: nowrap; }
}

.graf { display: flex; flex-direction: column; }
.graf .pie-g { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; padding: 0.95rem 1.4rem 1rem; border-top: 1px solid var(--line); color: var(--mut); font-size: 0.95rem; }
.graf .pie-g b { color: var(--tx); font-weight: 500; font-variant-numeric: tabular-nums; }
.graf .pie-g .r, .graf .pie-g .r b { color: var(--red); }

/* ───── interacción: hover, selección, tooltip, overlay ───── */
:root { --red: #3dff6e; --red-soft: rgba(61, 255, 110, 0.1); --glow: 0 0 0 1px rgba(61, 255, 110, 0.35), 0 0 2rem rgba(61, 255, 110, 0.12); }
.card { transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s; }
.card:hover { border-color: #2d2d30; }
.kpi { cursor: pointer; outline: none; }
.kpi:hover, .kpi:focus-visible { background: linear-gradient(180deg, #161617, #121213); }
.kpi:hover .v, .kpi:focus-visible .v { color: #fff; text-shadow: 0 0 1.4rem rgba(255, 255, 255, 0.25); }
.kpi::after { content: ''; position: absolute; inset: 0; border: 1px solid transparent; pointer-events: none; transition: border-color 0.2s, box-shadow 0.25s; }
.kpi:hover::after { border-color: rgba(61, 255, 110, 0.28); }
.kpi.sel::after, .kpi:focus-visible::after { border-color: var(--red); box-shadow: inset 0 0 2.2rem rgba(61, 255, 110, 0.1); }
.kpi.sel { background: #131a15; }
.kpi svg.bar rect { transition: opacity 0.2s; }
.kpi:hover svg.bar { filter: brightness(1.25); }
.lista .fl { transition: background 0.15s, box-shadow 0.15s; outline: none; }
.lista .fl:hover { background: #171a18; box-shadow: inset 2px 0 0 rgba(61, 255, 110, 0.55); }
.lista .fl:hover .c { color: var(--tx); }
.lista .fl.sel, .lista .fl:focus-visible { background: #14241a; box-shadow: inset 2px 0 0 var(--red); }
.lista .fl.sel .n { color: #fff; }
.nav a { position: relative; }
.nav a:hover { box-shadow: inset 2px 0 0 rgba(61, 255, 110, 0.5); }
.nav a.on, .nav a[aria-current] { box-shadow: inset 2px 0 0 var(--red); }
.btn-b { transition: transform 0.15s, box-shadow 0.2s, background 0.15s; }
.btn-b:hover { box-shadow: 0 0 1.6rem rgba(61, 255, 110, 0.35); }
.btn-g { transition: background 0.15s, border-color 0.15s, color 0.15s; }
.btn-g:hover { border-color: rgba(61, 255, 110, 0.45); color: #fff; }
.alerta button:first-child { background: var(--red); color: #04130a; }
.alerta button:first-child:hover { background: #7dffa0; box-shadow: 0 0 1.4rem rgba(61, 255, 110, 0.4); }
.seg button.on, .mseg button.on { box-shadow: 0 0 0 1px rgba(61, 255, 110, 0.35); }
.pill i { background: var(--red); box-shadow: 0 0 0.7rem var(--red); }
.tabla tbody tr.cl { cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.tabla tbody tr.cl:hover { box-shadow: inset 2px 0 0 rgba(61, 255, 110, 0.6); }
.desp .it { transition: background 0.15s; }
.alr { transition: border-color 0.2s, background 0.2s; }
.alr:hover { border-color: rgba(61, 255, 110, 0.35); }
.rg, .act, .gan { transition: border-color 0.2s, background 0.2s; }
.rg:hover, .act:hover { border-color: rgba(61, 255, 110, 0.3); }
.mapa .nodo, .finca .zn { cursor: pointer; }
.mapa .nodo:hover, .finca .zn:hover { filter: brightness(1.2); }
.finca .zn.on .eti rect { stroke: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.cuna { fill: rgba(61, 255, 110, 0.1); stroke: rgba(61, 255, 110, 0.55); stroke-width: 1.2; pointer-events: none; }
.rad svg.dial { cursor: default; }

.ttf { position: fixed; left: 0; top: 0; z-index: 99999; pointer-events: none; min-width: 11rem; padding: 0.7rem 0.85rem; background: rgba(18, 18, 19, 0.97); border: 1px solid #2f2f32; border-radius: 0.7rem; box-shadow: 0 1.2rem 2.6rem rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(61, 255, 110, 0.12); font-size: 0.88rem; opacity: 0; transition: opacity 0.12s; }
.ttf.on { opacity: 1; }
.ttf > b { display: block; font-family: var(--mono); font-weight: 500; font-size: 0.92rem; margin-bottom: 0.4rem; }
.ttf p { margin: 0 0 0.35rem; color: var(--mut); font-size: 0.85rem; }
.ttf .tr { display: flex; align-items: center; gap: 0.5rem; color: var(--tx-2); padding: 0.12rem 0; }
.ttf .tr i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #e6e6e8; }
.ttf .tr i.g { background: #7a7a7f; } .ttf .tr i.r { background: var(--red); box-shadow: 0 0 0.5rem var(--red); }
.ttf .tr b { margin-left: auto; padding-left: 1.2rem; color: var(--tx); font-weight: 600; font-variant-numeric: tabular-nums; }
.ttf .tr b.r { color: var(--red); }

dialog.ov { animation: ovin 0.22s var(--ease, ease-out); border-color: #2c2c2f; box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(61, 255, 110, 0.1), 0 0 6rem rgba(61, 255, 110, 0.06); }
dialog.ov::backdrop { animation: bdin 0.22s ease-out; }
@keyframes ovin { from { opacity: 0; transform: translateY(0.8rem) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes bdin { from { opacity: 0; } to { opacity: 1; } }
dialog.ov .spk svg.bar { position: static; width: 100%; height: 100%; }
.barra3 { display: flex; height: 0.5rem; border-radius: 99px; overflow: hidden; background: #1c1c1e; margin-top: 1rem; gap: 2px; }
.barra3 i { display: block; height: 100%; background: #e6e6e8; } .barra3 i.g { background: #6d6d72; } .barra3 i.r { background: var(--red); box-shadow: 0 0 0.8rem var(--red); }
@media (prefers-reduced-motion: reduce) { dialog.ov, dialog.ov::backdrop { animation: none; } }
