:root {
  --hass-dark: #1f3316;
  --hass: #3f6b2a;
  --hass-light: #e8f0df;
  --hv-bg: #f3f5ef;
  --hv-surface: #ffffff;
  --hv-ink: #1d2618;
  --hv-muted: #66705f;
  --hv-line: #e1e6da;
  --hv-accent: #b8860b;
  --hv-verde: #2e8540;
  --hv-amarillo: #e0a800;
  --hv-rojo: #c8372d;
  --hv-gris: #a7ae9f;
  --hv-radius: 14px;
  --hv-shadow: 0 1px 2px rgba(31, 51, 22, .06), 0 4px 14px rgba(31, 51, 22, .06);
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--hv-ink);
}
body { background: var(--hv-bg); color: var(--hv-ink); }
.bg-hass { background: var(--hass-dark); }
.btn-hass { background: var(--hass); color: #fff; border-color: var(--hass); }
.btn-hass:hover, .btn-hass:focus { background: var(--hass-dark); color: #fff; border-color: var(--hass-dark); }
.btn-hass-soft { background: var(--hass-light); color: var(--hass-dark); border-color: transparent; }
.btn-hass-soft:hover { background: #d8e6c9; color: var(--hass-dark); }
.text-hass { color: var(--hass) !important; }
.nav-tabs .nav-link.active { font-weight: 600; color: var(--hass-dark); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ estructura: menú lateral + contenido */
.hv-shell { display: flex; min-height: 100vh; }
.hv-sidebar { width: 264px; flex-shrink: 0; background: var(--hass-dark); color: #e9f0e1; }
@media (min-width: 992px) {
  .hv-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
  .hv-sidebar .offcanvas-body { display: flex; flex-direction: column; flex: 1; }
}
.hv-sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--hass-dark); --bs-offcanvas-color: #e9f0e1; --bs-offcanvas-width: 280px; }
.hv-brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.2rem .9rem; }
.hv-logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #6f9a3c, #2c4a1d); display: grid; place-items: center; font-size: 1.3rem; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.hv-brand .name { font-weight: 700; font-size: 1.1rem; line-height: 1.1; color: #fff; }
.hv-brand .sub { font-size: .74rem; opacity: .7; }
.hv-view-switch { margin: 0 1rem .6rem; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 3px; display: flex; }
.hv-view-switch button { flex: 1; border: 0; background: transparent; color: #cfdbc4; font-size: .8rem; padding: .35rem .4rem; border-radius: 8px; }
.hv-view-switch button.active { background: #fff; color: var(--hass-dark); font-weight: 600; }
.hv-nav { padding: 0 .6rem; gap: 2px; }
.hv-nav .hv-nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #9fb391; padding: .9rem .7rem .3rem; list-style: none; }
.hv-nav .nav-link { color: #dbe6d1; border-radius: 10px; padding: .55rem .75rem; display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; border: 0; background: none; font-size: .92rem; }
.hv-nav .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.hv-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.hv-nav .nav-link.active { background: #fff; color: var(--hass-dark); font-weight: 600; }
.hv-nav .nav-link.active i { color: var(--hass); opacity: 1; }
.hv-sidebar-foot { margin-top: auto; padding: 1rem; font-size: .75rem; color: #9fb391; }

.hv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hv-topbar { position: sticky; top: 0; z-index: 1020; background: rgba(243, 245, 239, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hv-line); padding: .7rem 1.25rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.hv-topbar h1 { font-size: 1.25rem; font-weight: 700; margin: 0; line-height: 1.2; }
.hv-topbar .hint { font-size: .8rem; color: var(--hv-muted); }
.hv-content { padding: 1.25rem; padding-bottom: 6rem; }
@media (min-width: 992px) { .hv-content { padding-bottom: 2rem; } }
.hv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--hass); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.hv-user-btn { border: 1px solid var(--hv-line); background: var(--hv-surface); border-radius: 999px; padding: 2px 10px 2px 2px; display: flex; align-items: center; gap: .5rem; font-size: .85rem; }

/* barra inferior del celular */
.hv-bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: var(--hv-surface); border-top: 1px solid var(--hv-line); display: flex; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0, 0, 0, .05); }
.hv-bottombar button { flex: 1; border: 0; background: none; color: var(--hv-muted); font-size: .68rem; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .25rem 0; border-radius: 10px; }
.hv-bottombar button i { font-size: 1.3rem; }
.hv-bottombar button.active { color: var(--hass); font-weight: 600; }
.hv-bottombar button.active i { background: var(--hass-light); border-radius: 999px; padding: 0 .9rem; }

/* ------------------------------------------------------------------ tarjetas y piezas comunes */
.card { border: 1px solid var(--hv-line); border-radius: var(--hv-radius); box-shadow: var(--hv-shadow); }
.card > .card-header { background: transparent; border-bottom: 1px solid var(--hv-line); font-weight: 600; padding: .75rem 1rem; border-radius: var(--hv-radius) var(--hv-radius) 0 0 !important; }
.card > .card-header.py-1 { padding-top: .65rem !important; padding-bottom: .65rem !important; }
.card > .card-body.py-2 { padding: .85rem 1rem !important; }
.hv-card-title { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.hv-card-title .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--hass-light); color: var(--hass); }
.hv-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.hv-toolbar .form-label { font-size: .72rem; color: var(--hv-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .1rem; }
.hv-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--hv-surface); border: 1px solid var(--hv-line); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; color: var(--hv-muted); }
.hv-muted { color: var(--hv-muted); }
.hv-kpi { background: var(--hv-surface); border: 1px solid var(--hv-line); border-radius: var(--hv-radius); padding: .85rem 1rem; box-shadow: var(--hv-shadow); height: 100%; }
.hv-kpi .lbl { font-size: .74rem; color: var(--hv-muted); display: flex; align-items: center; gap: .35rem; }
.hv-kpi .val { font-size: 1.6rem; font-weight: 700; line-height: 1.15; margin-top: .15rem; }
.hv-kpi .val small { font-size: .85rem; font-weight: 500; color: var(--hv-muted); }
.hv-kpi .foot { font-size: .74rem; color: var(--hv-muted); }
.hv-empty { text-align: center; color: var(--hv-muted); padding: 1.5rem 1rem; }
.hv-empty i { font-size: 2rem; display: block; margin-bottom: .3rem; opacity: .5; }
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--hv-muted); font-weight: 600; border-bottom-color: var(--hv-line); }
.form-control, .form-select { border-color: #d3dacb; border-radius: 9px; }
.form-control:focus, .form-select:focus { border-color: #8fb46b; box-shadow: 0 0 0 .2rem rgba(63, 107, 42, .18); }
.btn { border-radius: 9px; }
.hv-section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hv-muted); font-weight: 600; margin: 0 0 .5rem; }

/* ------------------------------------------------------------------ inicio */
.hv-hero { background: linear-gradient(135deg, #2c4a1d 0%, #3f6b2a 55%, #5e8a37 100%); color: #fff; border-radius: 18px; padding: 1.4rem 1.5rem; box-shadow: var(--hv-shadow); position: relative; overflow: hidden; }
.hv-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hv-hero .eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.hv-hero .big { font-size: 2.3rem; font-weight: 800; line-height: 1.05; }
.hv-hero .count { display: inline-flex; align-items: baseline; gap: .35rem; background: rgba(255, 255, 255, .14); border-radius: 12px; padding: .35rem .8rem; margin-top: .5rem; }
.hv-hero .count b { font-size: 1.5rem; }
.hv-hero .meta { font-size: .85rem; opacity: .88; }
.hv-steps { display: flex; gap: 0; margin-top: 1.2rem; position: relative; z-index: 1; }
.hv-step { flex: 1; text-align: center; position: relative; font-size: .74rem; }
.hv-step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 3px; background: rgba(255, 255, 255, .25); }
.hv-step:first-child::before { display: none; }
.hv-step .dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto .3rem; display: grid; place-items: center; background: rgba(255, 255, 255, .15); border: 2px solid rgba(255, 255, 255, .35); position: relative; z-index: 1; font-size: .95rem; }
.hv-step.done .dot { background: #fff; color: var(--hass); border-color: #fff; }
.hv-step.done::before, .hv-step.current::before { background: #fff; }
.hv-step.current .dot { background: #f3c74a; color: #3b2c00; border-color: #fff; box-shadow: 0 0 0 5px rgba(243, 199, 74, .3); animation: hv-pulse 2s infinite; }
.hv-step .when { opacity: .75; font-size: .68rem; }
@keyframes hv-pulse { 50% { box-shadow: 0 0 0 9px rgba(243, 199, 74, .08); } }
@media (max-width: 576px) { .hv-step .when { display: none; } .hv-step { font-size: .64rem; } .hv-hero .big { font-size: 1.8rem; } }

.hv-timeline { margin-top: 1rem; position: relative; z-index: 1; }
.hv-timeline .track { position: relative; height: 12px; background: rgba(255, 255, 255, .18); border-radius: 999px; }
.hv-timeline .seg { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.hv-timeline .seg.flor { background: #f6d77a; }
.hv-timeline .seg.win { background: rgba(255, 255, 255, .55); }
.hv-timeline .seg.real { background: #9fe07a; }
.hv-timeline .mark { position: absolute; top: -5px; width: 3px; height: 22px; background: #fff; border-radius: 2px; transform: translateX(-50%); }
.hv-timeline .mark span { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-size: .68rem; white-space: nowrap; background: rgba(0, 0, 0, .25); padding: 0 .35rem; border-radius: 5px; }
.hv-timeline .mark.pred { background: #f3c74a; }
.hv-timeline .ends { display: flex; justify-content: space-between; font-size: .68rem; opacity: .75; margin-top: 1.6rem; }

.hv-valves { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.hv-valve { border: 1px solid var(--hv-line); border-radius: 12px; padding: .6rem .7rem; background: var(--hv-surface); cursor: pointer; text-align: left; position: relative; transition: transform .12s, box-shadow .12s; border-top: 5px solid var(--hv-gris); width: 100%; }
.hv-valve:hover { transform: translateY(-2px); box-shadow: var(--hv-shadow); }
.hv-valve.c-verde { border-top-color: var(--hv-verde); background: #f1f8f1; }
.hv-valve.c-amarillo { border-top-color: var(--hv-amarillo); background: #fdf8e8; }
.hv-valve.c-rojo { border-top-color: var(--hv-rojo); background: #fcf0ef; }
.hv-valve .vname { font-weight: 700; font-size: 1rem; }
.hv-valve .vdate { font-size: .78rem; color: var(--hv-muted); }
.hv-valve .vms { font-size: 1.15rem; font-weight: 700; margin-top: .15rem; }
.hv-valve .vms small { font-size: .7rem; font-weight: 500; color: var(--hv-muted); }
.hv-valve .vt { font-size: .72rem; color: var(--hv-muted); }
.hv-valve.selected { outline: 3px solid var(--hass); outline-offset: 1px; }
@media (max-width: 400px) { .hv-valve { padding: .45rem .5rem; } .hv-valve .vms { font-size: 1rem; } }
.hv-legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .75rem; color: var(--hv-muted); margin-top: .6rem; }

.hv-todo { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px dashed var(--hv-line); }
.hv-todo:last-child { border-bottom: 0; }
.hv-todo .ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: #fff4d6; color: #8a6100; display: grid; place-items: center; }
.hv-todo .txt { font-size: .86rem; flex: 1; min-width: 0; }
/* pestaña Clima */
.cl-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.cl-grid line { stroke: var(--hv-line); }
.cl-grid text { fill: var(--hv-muted); font-size: 11px; }
.cl-table td, .cl-table th { font-size: .8rem; }  /* min-width: las tablas por calibre se desplazan dentro, sin empujar el botón */
.hv-ok { display: flex; gap: .6rem; align-items: center; color: var(--hv-verde); font-weight: 500; }
.hv-ok i { font-size: 1.6rem; }

/* gráficos SVG */
.hv-chart { position: relative; }
.hv-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.hv-chart .axis text, .hv-chart text { fill: var(--hv-muted); font-size: 11px; }
.hv-chart .grid line { stroke: #e8ece3; }
.hv-tip { position: absolute; pointer-events: none; background: var(--hv-ink); color: #fff; font-size: .75rem; padding: .3rem .55rem; border-radius: 7px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 5; }
.hv-tip.on { opacity: 1; }
.hv-hit { fill: transparent; cursor: pointer; }
.hv-bars-h .row-b { display: grid; grid-template-columns: 2.4rem 1fr 4.2rem; align-items: center; gap: .5rem; font-size: .8rem; margin-bottom: .35rem; }
.hv-bars-h .bar { height: 12px; background: var(--hv-line); border-radius: 999px; overflow: hidden; }
.hv-bars-h .bar span { display: block; height: 100%; background: var(--hass); border-radius: 999px; transition: width .4s; }

/* ------------------------------------------------------------------ muestreos */
.hv-valve-pick { display: grid; grid-template-columns: repeat(9, 1fr); gap: .35rem; }
@media (max-width: 768px) { .hv-valve-pick { grid-template-columns: repeat(5, 1fr); } }
.hv-valve-pick button { border: 2px solid var(--hv-line); background: var(--hv-surface); border-radius: 10px; padding: .45rem 0; font-weight: 700; position: relative; }
.hv-valve-pick button .light { position: absolute; top: 4px; right: 4px; width: .55rem; height: .55rem; }
.hv-valve-pick button.active { border-color: var(--hass); background: var(--hass-light); color: var(--hass-dark); }
.smp-fruits { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; }
.smp-fruit { border: 1px solid var(--hv-line); border-radius: 12px; padding: .65rem .75rem; background: #fbfcf9; border-left: 5px solid var(--hv-gris); }
.smp-fruit.ok { border-left-color: var(--hv-verde); }
.smp-fruit.low { border-left-color: var(--hv-rojo); }
.smp-fruit .head { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.smp-fruit .head .n { font-weight: 700; }
.smp-fruit .head .smp-num { width: 3.6rem; }
.smp-fruit .smp-ms { margin-left: auto; font-weight: 700; font-size: 1.05rem; }
.smp-fruit .grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .5rem; }
.smp-fruit label { font-size: .68rem; color: var(--hv-muted); margin: 0; display: block; }
.smp-fruit .smp-photo { margin-top: .5rem; font-size: .8rem; }
.smp-fruit .smp-photo .btn { width: 100%; }
.smp-sticky { position: sticky; bottom: 0; background: var(--hv-surface); border-top: 1px solid var(--hv-line); margin: .8rem -1rem -.85rem; padding: .7rem 1rem; border-radius: 0 0 var(--hv-radius) var(--hv-radius); display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; z-index: 3; }
@media (max-width: 991px) { .smp-sticky { bottom: 64px; } }
.smp-verdict { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.smp-verdict .light { width: 1.1rem; height: 1.1rem; }
.hv-steplbl { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin: .3rem 0 .5rem; font-size: .9rem; }
.hv-steplbl .n { width: 24px; height: 24px; border-radius: 50%; background: var(--hass); color: #fff; display: grid; place-items: center; font-size: .75rem; }

/* ------------------------------------------------------------------ registro de cosecha */
.hl-datebar { display: flex; align-items: center; gap: .4rem; }
.hl-datebar input { max-width: 11rem; font-weight: 600; }
.hl-dayname { font-size: .85rem; color: var(--hv-muted); }
.hl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.hl-cell { border: 1px solid var(--hv-line); border-radius: 12px; padding: .5rem .55rem; background: #fbfcf9; transition: border-color .15s, background .15s; }
.hl-cell.has { border-color: #9cc27a; background: #f1f8ea; }
.hl-cell label { font-weight: 700; font-size: .85rem; display: flex; justify-content: space-between; margin-bottom: .2rem; }
.hl-cell label span { font-weight: 400; color: var(--hv-muted); font-size: .7rem; }
.hl-cell input { font-size: 1.25rem; font-weight: 700; text-align: center; padding: .25rem; }
.hl-cell .t { font-size: .7rem; color: var(--hv-muted); text-align: center; margin-top: .15rem; min-height: 1em; }
.hl-total { background: var(--hass-light); border-radius: 12px; padding: .6rem .8rem; margin-top: .7rem; display: flex; align-items: center; gap: .6rem; }
.hl-total .v { font-size: 1.4rem; font-weight: 800; color: var(--hass-dark); }

/* ------------------------------------------------------------------ resto (investigación y cámara) */
.stat-card { border-left: 4px solid var(--hass); }
.camera-stage { position: relative; width: 100%; height: min(70vh, 640px); background: #111; border-radius: .75rem; overflow: hidden; }
.camera-stage video, .camera-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.camera-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.camera-guide { position: absolute; top: 12%; bottom: 12%; left: 50%; aspect-ratio: 3 / 4; transform: translateX(-50%); border: 2px dashed rgba(255, 255, 255, .55); border-radius: 50%; pointer-events: none; }
.stat-card .val { font-size: 1.5rem; font-weight: 600; line-height: 1; }
.stat-card .lbl { font-size: .75rem; color: #6c757d; }

.fruit-card { border-left: 5px solid #adb5bd; }
.fruit-card.st-confirmado { border-left-color: #198754; }
.fruit-card.st-propuesto { border-left-color: #0d6efd; }
.fruit-card.st-pendiente { border-left-color: #ffc107; }
.fruit-card.st-con_errores { border-left-color: #dc3545; }

.slot { background: #fff; border: 1px dashed #ced4da; border-radius: .5rem; padding: .35rem; height: 100%; }
.slot .slot-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; color: #495057; letter-spacing: .02em; }
.slot img, .thumb img { width: 100%; aspect-ratio: 4/3; object-fit: contain; /* fotos verticales sin recorte */ border-radius: .35rem; cursor: zoom-in; background: #ddd; }
.slot.missing { display: flex; align-items: center; justify-content: center; color: #adb5bd; min-height: 150px; }
.slot .meta, .thumb .meta { font-size: .72rem; color: #555; }
.alt-thumb { width: 148px; }
.place-btns { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; margin-top: .25rem; font-size: .72rem; color: #555; }
.place-btns .btn { font-size: .7rem; padding: 0 .3rem; }
.alt-thumb img { width: 148px;aspect-ratio: 4/3; object-fit: contain; background: #ddd; border-radius: .3rem; cursor: zoom-in; opacity: .85; }
.thumb { background: #fff; border-radius: .5rem; padding: .35rem; border: 1px solid #e3e3e3; height: 100%; }
.thumb.sel { outline: 3px solid #0dcaf0; }
.badge-xs { font-size: .65rem; font-weight: 500; }
.warn-list { font-size: .78rem; margin: 0; padding-left: 1.1rem; color: #8a5a00; }
.dim { opacity: .45; }
.kv td:first-child { color: #6c757d; white-space: nowrap; padding-right: 1rem; }
.kv td { font-size: .8rem; vertical-align: top; word-break: break-all; }
.dup-member { width: 220px; }
.dup-member.rec { outline: 3px solid #198754; border-radius: .5rem; }
.dup-member.chosen { outline: 3px solid #0d6efd; border-radius: .5rem; }
.preview-img { max-width: 100%; max-height: 70vh; border-radius: .5rem; }
.thumb { position: relative; }
.caliber-thumb { width: 56px; aspect-ratio: 4/3; object-fit: contain; background: #ddd; border-radius: .25rem; cursor: zoom-in; }
.caliber-weight { width: 6.5rem; }
.caliber-obs { min-width: 9rem; }
.ms-input { width: 6.5rem; }
.cam-prob-label { width: 1.6rem; text-align: right; }
.cam-prob-value { width: 2.6rem; text-align: right; }
.cam-real { min-width: 5rem; }

/* ------------------------------------------------------------------ inicio de sesión */
.login-screen { position: fixed; inset: 0; z-index: 2000; background: radial-gradient(circle at 20% 20%, #5e8a37 0%, #2c4a1d 45%, #182a10 100%); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 400px; border: 0; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login-card .card-body { padding: 2rem; }
.login-card .hv-logo { width: 56px; height: 56px; font-size: 1.8rem; border-radius: 16px; margin-bottom: .8rem; }
.login-card .form-control { padding: .65rem .8rem; }
.login-foot { color: rgba(255, 255, 255, .6); font-size: .75rem; text-align: center; margin-top: 1rem; }
.app-hidden { visibility: hidden; }
.light { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0, 0, 0, .12); }
.light-verde { background: var(--hv-verde); }
.light-amarillo { background: var(--hv-amarillo); }
.light-rojo { background: var(--hv-rojo); }
.light-gris { background: var(--hv-gris); }
.smp-num { width: 3.5rem; }
.valve-card { min-width: 7.5rem; }
.fade-in { animation: hv-in .25s ease-out; }
@keyframes hv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hv-sidebar, .hv-sidebar.offcanvas-lg { background: var(--hass-dark) !important; color: #e9f0e1; }
.hl-cell input::placeholder { color: #c3cab9; font-weight: 400; }
@media (max-width: 576px) {
  .hv-topbar { flex-wrap: nowrap; padding: .6rem .9rem; }
  .hv-topbar .hint { display: none; }
  .hv-topbar h1 { font-size: 1.1rem; }
  .hv-content { padding: .9rem; padding-bottom: 6rem; }
  .hv-kpi .val { font-size: 1.3rem; }
}

/* ---------- predicción de cosecha ---------- */
.hv-key { display: inline-block; vertical-align: middle; margin-right: .2rem; }
.hv-key.dot { width: 11px; height: 11px; border-radius: 50%; }
.hv-key.ring { width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--hv-accent); background: #fff; }
.hv-key.dash { width: 18px; border-top: 2px dashed var(--hv-accent); }
.hv-key.line { width: 18px; height: 3px; border-radius: 2px; }
.hv-key.line.thin { height: 2px; background: #bcc6b0; }
.hv-formula { display: flex; align-items: stretch; gap: .4rem; }
.hv-formula .term { flex: 1; background: #f5f8f1; border: 1px solid var(--hv-line); border-radius: 12px; padding: .5rem .6rem; text-align: center; min-width: 0; }
.hv-formula .term .k { font-size: .68rem; color: var(--hv-muted); text-transform: uppercase; letter-spacing: .03em; }
.hv-formula .term .v { font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.hv-formula .term.res { background: var(--hass); border-color: var(--hass); color: #fff; }
.hv-formula .term.res .k { color: rgba(255, 255, 255, .8); }
.hv-formula .op { align-self: center; font-size: 1.3rem; font-weight: 700; color: var(--hv-muted); }
.hv-score { text-align: center; background: #f5f8f1; border-radius: 12px; padding: .5rem .8rem; min-width: 6.5rem; }
.hv-score b { display: block; font-size: 1.7rem; line-height: 1; color: var(--hass); }
.hv-score span { font-size: .68rem; color: var(--hv-muted); }
.hv-prob .row-b { grid-template-columns: 2.4rem 1fr 6.4rem; }
.hv-prob .bar { position: relative; height: 14px; }
.hv-prob .bar .half { position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 2px dashed var(--hv-accent); }
.hv-models .row-b { grid-template-columns: minmax(9rem, 15rem) 1fr 3.4rem; }
@media (max-width: 576px) { .hv-formula .term .v { font-size: .95rem; } .hv-formula .op { font-size: 1rem; } .hv-models .row-b { grid-template-columns: 8.5rem 1fr 3rem; font-size: .72rem; } }
