*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#0f172a;color:#e5e7eb}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 22px;background:#020617;border-bottom:1px solid #1e293b}
.brand{font-size:24px;font-weight:800;color:#38bdf8}
.brand span{font-size:13px;color:#94a3b8}
nav a{color:#e5e7eb;text-decoration:none;margin-left:16px;font-weight:700}
nav a:hover{color:#38bdf8}
.container{padding:22px;max-width:1400px;margin:auto}
.card{background:#111827;border:1px solid #1f2937;border-radius:16px;padding:18px;margin-bottom:18px;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:18px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:18px}

.kpi{background:#020617;border:1px solid #1e293b;border-radius:14px;padding:16px;min-height:96px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
.kpi .num{font-size:28px;font-weight:800;color:#38bdf8;line-height:1.05;min-height:32px}
.kpi-last-sync .num{font-size:18px;line-height:1.15;min-height:42px}

h1,h2,h3{margin-top:0}
input,select,button,textarea{padding:11px;border-radius:10px;border:1px solid #334155;background:#020617;color:#e5e7eb}
textarea{font-family:Arial,Helvetica,sans-serif;resize:vertical;}
.details-textarea{
  width:100%;
  max-width:650px;
  min-height:92px;
  display:block;
  margin-top:6px;
}
.btn-limpiar {color: #facc15;  /* amarillo tipo warning */
}
.btn{display:inline-flex;align-items:center;justify-content:center;height:32px;width:70px;padding:0;border-radius:4px;font-size:12px;font-weight:700;text-decoration:none;border:0;box-sizing:border-box}
.btn.secondary{background:#334155}
.btn.danger{background:#b91c1c}
.btn-ver{background:#38bdf8;color:#0b1220}
.btn-editar{background:#6366f1;color:#fff}
.btn-delete{background:#dc2626;color:#fff}
.btn-delete:hover{background:#b91c1c}

table{width:100%;border-collapse:collapse;background:#111827;border-radius:12px;overflow:hidden}
th,td{padding:11px;border-bottom:1px solid #1f2937;text-align:left}
th{background:#020617;color:#93c5fd}
.status-ok{color:#22c55e;font-weight:800}
.status-warn{color:#f59e0b;font-weight:800}
.status-error{color:#ef4444;font-weight:800}
.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-bottom:12px}
.small{color:#94a3b8;font-size:13px}
.login-wrap{max-width:420px;margin:70px auto}
canvas{max-height:260px}

.readonly-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:14px;margin:20px 0}
.readonly-box{background:#020617;border:1px solid #334155;border-radius:10px;padding:12px;color:#e5e7eb;font-weight:bold}

.measurements-card h2{margin-bottom:18px}
.measurements-table{width:100%;table-layout:fixed;border-collapse:collapse;background:#111827;border:1px solid #1f2937;border-radius:12px;overflow:hidden}
.measurements-table thead,.measurements-table tbody tr{display:table;width:100%;table-layout:fixed}
.measurements-table tbody{display:block;max-height:420px;overflow-y:auto}
.measurements-table th,.measurements-table td{padding:11px;border-bottom:1px solid #1f2937;text-align:left;box-sizing:border-box}
.measurements-table th{background:#020617;color:#93c5fd}
.measurements-table th:nth-child(1),.measurements-table td:nth-child(1){width:40%}
.measurements-table th:nth-child(2),.measurements-table td:nth-child(2){width:20%}
.measurements-table th:nth-child(3),.measurements-table td:nth-child(3){width:15%}
.measurements-table th:nth-child(4),.measurements-table td:nth-child(4){width:25%}

.th-filter{display:flex;align-items:center;gap:8px}
.th-filter span{white-space:nowrap;font-weight:800}
.col-filter{width:100%;min-width:90px;padding:7px 9px;font-size:13px;border-radius:8px;border:1px solid #334155;background:#020617;color:#e5e7eb}

.chart-filter{align-items:end;margin:18px 0}
.chart-filter label{display:block;color:#93c5fd;font-weight:800;margin-bottom:6px}
.filter-actions{display:flex;gap:10px;align-items:end}

.detail-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:10px}
.detail-head h1 span{font-size:14px;color:#93c5fd}
.detail-head .chart-filter{display:flex;align-items:center;gap:8px;margin:0;flex-wrap:nowrap}
.detail-head .chart-filter label{margin:0;font-size:14px;color:#e5e7eb}
.detail-head .chart-filter input{width:135px}
.detail-head .chart-filter button,.detail-head .chart-filter .btn{white-space:nowrap}

.detail-head-main{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:8px}
.detail-title{flex:1;min-width:0}
.detail-title-line{margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}
.detail-field{font-size:22px;color:#cbd5e1;font-weight:800}
.detail-silo{font-size:30px;color:#e5e7eb;font-weight:800}
.detail-last-measure{font-size:18px;color:#38bdf8;font-weight:700}

.chart-filter-top{display:flex;align-items:center;gap:6px;margin:0;flex-wrap:wrap}
.chart-filter-top label{margin:0;color:#e5e7eb}
.chart-filter-top input{width:150px}
.chart-filter-top .date-picker{cursor:pointer;user-select:none;caret-color:transparent}
.chart-filter-top button,.chart-filter-top .btn{white-space:nowrap}

.detail-meta{text-align:right;line-height:1.9;font-size:16px;white-space:nowrap;padding-top:7px}
.detail-meta b{color:#ffffff}
.detail-meta span{color:#94a3b8;margin:0 5px}

.grid .card{
  display:flex;
  flex-direction:column;
  min-height:0;
}
.card-details{min-height:22px;margin-bottom:14px}
.card-details-text{display:inline-block;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;cursor:pointer}
.card-details-text:hover{color:#38bdf8;text-decoration:underline}



.grid .card p:last-child{
  margin-top:6px;
  margin-bottom:0;
}

.measurements-table tbody::-webkit-scrollbar{width:14px}
.measurements-table tbody::-webkit-scrollbar-track{background:#020617}
.measurements-table tbody::-webkit-scrollbar-thumb{background:#64748b;border-radius:12px;border:3px solid #020617}
.measurements-table tbody::-webkit-scrollbar-thumb:hover{background:#94a3b8}
.measurements-table tbody::-webkit-scrollbar-button:single-button{display:block;height:14px;background-color:#020617;border:1px solid #334155}
.measurements-table tbody::-webkit-scrollbar-button:single-button:vertical:decrement{background:linear-gradient(135deg,transparent 45%,#93c5fd 46% 55%,transparent 56%) center / 8px 8px no-repeat,#020617}
.measurements-table tbody::-webkit-scrollbar-button:single-button:vertical:increment{background:linear-gradient(315deg,transparent 45%,#93c5fd 46% 55%,transparent 56%) center / 8px 8px no-repeat,#020617}

#detailsModal.details-modal{position:fixed;inset:0;background:rgba(2,6,23,.78);z-index:99999;display:none;align-items:center;justify-content:center;padding:24px}
#detailsModal.details-modal.show{display:flex}
#detailsModal .details-modal-box{width:min(620px,94vw);max-height:75vh;overflow-y:auto;background:#111827;border:1px solid #334155;border-radius:14px;padding:22px;box-shadow:0 18px 50px rgba(0,0,0,.45);position:relative}
#detailsModal .details-modal-box h3{margin:0 38px 14px 0;color:#e5e7eb}
#detailsModal .details-modal-text{white-space:pre-wrap;text-overflow:ellipsis;line-height:1.45;color:#e5e7eb;max-width:100%}
#detailsModal .details-modal-close{position:absolute;top:10px;right:12px;width:32px;height:32px;border:0;border-radius:8px;background:#1e293b;color:#e5e7eb;font-size:22px;cursor:pointer}
#detailsModal .details-modal-close:hover{background:#334155}

.silos-table th.actions-title,.silos-table td.table-actions{text-align:center;width:240px}
.table-actions{display:flex;justify-content:center;align-items:center;gap:6px}
.table-actions .btn{width:68px;height:32px;min-width:68px;max-width:68px;padding:0;margin:0;font-size:12px;line-height:1;border-radius:8px;font-weight:700;text-align:center;box-sizing:border-box}

@media (max-width:900px){
  .detail-head-main{flex-direction:column}
  .detail-meta{text-align:left;white-space:normal}
}
.silo-visual-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  margin:12px 0 22px;
  min-height:190px;
}

.silo-visual{
  width:116px;
  height:165px;
  position:relative;
}

.silo-top{
  width:116px;
  height:24px;
  border:2px solid #64748b;
  border-bottom:0;
  border-radius:58px 58px 0 0;
  background:#1e293b;
}

.silo-body{
  width:116px;
  height:120px;
  position:relative;
  overflow:hidden;
  border-left:2px solid #64748b;
  border-right:2px solid #64748b;
  background:#0f172a;
}

.silo-bottom{
  width:116px;
  height:22px;
  border:2px solid #64748b;
  border-top:0;
  border-radius:0 0 58px 58px;
  background:#1e293b;
}

.silo-fill{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  background:#38bdf8;
}

.silo-level-line{
  position:absolute;
  left:0;
  right:0;
  height:3px;
  background:#facc15;
}

.silo-percent{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:900;
  color:white;
}

.silo-legend{
  margin-top:10px;
  color:#cbd5e1;
  font-size:14px;
}

.silo-legend b{
  color:white;
}
.silo-svg {
  width: 140px;
  height: auto;
  display: block;
  margin: 10px auto;
}

.silo-body-shape {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
}

.silo-fill {
  fill: url(#siloGradient);
  opacity: 0.9;
}

.silo-roof {
  fill: #1e293b;
  stroke: #94a3b8;
  stroke-width: 2;
}

.silo-base {
  fill: #020617;
  stroke: #94a3b8;
  stroke-width: 2;
}

.silo-level-line {
  stroke: #facc15;
  stroke-width: 3;
}

.silo-text {
  fill: #ffffff;
  font-size: 20px;
  font-weight: 800;
  text-anchor: middle;
}
.silo-img-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  margin:12px 0 18px;
}

.silo-img-container{
  position:relative;
  width:180px;
}

.silo-img{
  width:100%;
  display:block;
  filter:brightness(0.9) contrast(1.1);
}

.silo-fill-mask{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  background:linear-gradient(to top,#0284c7,#38bdf8,#67e8f9);
  opacity:0.65;
  mix-blend-mode:multiply;
  pointer-events:none;
}

.silo-level-line{
  position:absolute;
  left:0;
  right:0;
  height:3px;
  background:#facc15;
  box-shadow:0 0 6px #facc15;
}

.silo-text{
  position:absolute;
  top:45%;
  left:50%;
  transform:translate(-50%,-50%);
  color:white;
  font-size:24px;
  font-weight:900;
  text-shadow:0 2px 10px rgba(0,0,0,.8);
}

.silo-data-row{
  display:flex;
  justify-content:space-between;
  width:180px;
  font-size:13px;
  color:#94a3b8;
}

.silo-data-row b{
  color:white;
}
.silo-img-wrap{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:10px 0 14px;
  overflow:hidden;
}

.silo-img-container{
  position:relative;
  width:170px;
  height:240px;
  overflow:hidden;
  margin:0 auto;
}

.silo-img{
  width:170px !important;
  height:240px !important;
  object-fit:contain;
  display:block;
}

.silo-fill-mask{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  background:linear-gradient(to top,#0284c7,#38bdf8,#67e8f9);
  opacity:.45;
  pointer-events:none;
}

.silo-level-line{
  position:absolute;
  left:0;
  right:0;
  height:3px;
  background:#facc15;
  box-shadow:0 0 8px #facc15;
}

.silo-text{
  position:absolute;
  top:42%;
  left:50%;
  transform:translate(-50%,-50%);
  color:#fff;
  font-size:24px;
  font-weight:900;
  text-shadow:0 2px 8px rgba(0,0,0,.9);
}

.silo-data-row{
  width:170px;
  display:flex;
  justify-content:space-between;
  gap:8px;
  font-size:13px;
  color:#94a3b8;
}

.silo-data-row b{
  color:#fff;
}

/* === SILO DASHBOARD FINAL - fuerza visual, evita estilos viejos/cacheados === */
/* === SILO PREMIUM LIMPIO (ÚNICA VERSION) === */

.silo-dashboard-visual{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  margin:10px 0 16px;
  gap:8px;
}

.silo-premium-svg{
  width:220px;
  height:auto;
  display:block;
  margin:4px auto 2px;
}

/* eliminamos cualquier basura anterior */
.silo-clean-svg,
.silo-img-wrap,
.silo-visual-wrap{
  display:none !important;
}

.silo-data-row{
  width:170px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  color:#94a3b8;
  font-size:13px;
  font-weight:700;
}

.silo-data-row b{
  color:#f8fafc;
}

.silo-fill-anim{
  transition: all 0.8s cubic-bezier(.22,1,.36,1);
}
.silo-extra{
  width:170px;
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:#64748b;
}
.card p{
  margin:4px 0;
  line-height:1.25;
}

/* títulos */
.card h2{
  margin-bottom:10px;
}

/* bloques principales */
.card p{
  margin:4px 0;
}

/* separación antes del silo */
.card .silo-dashboard-visual{
  margin-top:12px;
}

/* bloque inferior */
.silo-data-row{
  margin-top:6px;
}
.grid .card > p{
  margin:4px 0 !important;
  line-height:1.22 !important;
}

.card-details{
  min-height:0 !important;
  margin:4px 0 !important;
}

.small{
  margin-top:6px !important;
  margin-bottom:6px !important;
}
.card p{
  margin:3px 0 !important;
  line-height:1.18 !important;
}

.card h2{
  margin-bottom:8px !important;
}

.card-details{
  min-height:0 !important;
  margin:3px 0 !important;
}

.small{
  margin-top:6px !important;
  margin-bottom:4px !important;
}

.silo-dashboard-visual{
  margin-top:8px !important;
  margin-bottom:8px !important;
}

.silo-premium-svg{
  width:220px;
  height:auto;
  display:block;
  margin:0 auto !important;
}

.silo-data-row{
  margin-top:2px !important;
}
/* === DASHBOARD CARD PRO - 2026-05-03 === */
.dashboard-grid{
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:20px;
}

.silo-card-pro{
  position:relative;
  overflow:hidden;
  padding:25px;
  border:1px solid rgba(148,163,184,.18);
  background:
    radial-gradient(circle at 22% 0%, rgba(56,189,248,.13), transparent 34%),
    linear-gradient(180deg, #111827 0%, #0b1220 100%);
  box-shadow:0 18px 45px rgba(0,0,0,.30);
}

.silo-card-pro::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:16px;
  background:linear-gradient(135deg, rgba(255,255,255,.055), transparent 34%);
}

.silo-card-header{
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;

  margin-bottom:18px;
  padding-bottom:10px;

  border-bottom:1px solid rgba(148,163,184,.10);
}

.silo-card-header h2{
  margin:0 !important;
  color:#f8fafc;
  line-height:1.05;
  letter-spacing:-.02em;
}

.silo-card-header h2 .campo-nombre{
  display:block;
  font-size:13px;
  font-weight:700;
  color:#94a3b8;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:2px;
}

.silo-card-header h2 .silo-nombre{
  display:block;
  font-size:26px;
  font-weight:900;
  color:#ffffff;
  line-height:1;
}

.silo-card-serial{
  min-height:16px;
  margin-top:4px;
  color:#64748b;
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.sync-badge{
  display:inline-flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  line-height:1;
  border:1px solid currentColor;
  white-space:nowrap;
}

.sync-badge span{
  width:7px;
  height:7px;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 12px currentColor;
}

.sync-badge.status-ok{
  color:#22c55e;
  background:rgba(34,197,94,.12);
}

.sync-badge.status-warn{
  color:#f59e0b;
  background:rgba(245,158,11,.12);
}

.silo-metrics{
  position:relative;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:10px;
}

.metric-box{
  padding:11px 12px;
  border:1px solid rgba(51,65,85,.85);
  border-radius:12px;
  background:rgba(2,6,23,.42);
}

.metric-box span{
  display:block;
  margin-bottom:5px;
  color:#93c5fd;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.metric-box b{
  display:block;
  color:#fff;
  font-size:14px;
  font-weight:800;
}

.silo-card-pro .silo-dashboard-visual{
  position:relative;
  margin:18px 0 20px !important;
  padding:4px;
}

.silo-card-pro .silo-premium-svg{
  width:220px;
  height:auto;
  display:block;
  margin:0 auto !important;
}

.silo-card-pro .silo-fill-anim{
  transition:all .8s cubic-bezier(.22,1,.36,1);
}

.silo-alert{
  position:relative;
  width:100%;
  min-height:62px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:5px;
  margin:4px 0 12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(239,68,68,.30);
  background:linear-gradient(180deg, rgba(239,68,68,.10), rgba(127,29,29,.08));
  color:#fecaca;
  text-align:left;
  cursor:pointer;
  appearance:none;
}

.silo-alert:hover{
  border-color:rgba(248,113,113,.55);
  background:linear-gradient(180deg, rgba(239,68,68,.15), rgba(127,29,29,.10));
}

.silo-alert span{
  display:block;
  color:#fca5a5;
  font-size:10px;
  line-height:1;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.silo-alert b{
  display:block;
  width:100%;
  max-width:100%;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;

  color:#fee2e2;
  font-size:13px;
  line-height:1.25;
  font-weight:800;
}

.silo-alert.empty{
  border-color:rgba(51,65,85,.85);
  background:rgba(2,6,23,.35);
  color:#94a3b8;
  cursor:pointer;
}

.silo-alert.empty:hover{
  border-color:rgba(51,65,85,.85);
  background:rgba(2,6,23,.35);
}

.silo-alert.empty span,
.silo-alert.empty b{
  color:#94a3b8;
}

.btn-card-detail{
  width:100%;
  height:40px;
  border-radius:12px;
  background:linear-gradient(180deg,#2563eb,#1d4ed8);
  color:#fff !important;
  font-size:13px;
  font-weight:900;
  letter-spacing:.01em;
  box-shadow:0 10px 22px rgba(37,99,235,.22);
}

.btn-card-detail:hover{
  background:linear-gradient(180deg,#3b82f6,#2563eb);
}

@media (max-width:480px){
  .silo-metrics{grid-template-columns:1fr}
  .silo-card-header{flex-direction:column}
  .sync-badge{align-self:flex-start}
}
.silo-alert{
  overflow:hidden;
}
.silo-click {
  display: block;
  cursor: pointer;
  text-decoration: none;
}

.silo-click:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.silo-click:active {
  transform: scale(0.98);
}
/* === TITULO CARD: CAMPO + SILO === */

.card-header-text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-width:0;
  flex:1;
}

.card-header-text .campo-nombre{
  display:inline-flex;
  align-items:center;

  padding:4px 11px;
  margin-bottom:10px;

  border-radius:999px;

  background:linear-gradient(
    180deg,
    rgba(37,99,235,.20),
    rgba(29,78,216,.08)
  );

  border:1px solid rgba(96,165,250,.26);

  color:#7dd3fc;

  font-size:10px;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 0 18px rgba(56,189,248,.10);
}

.card-header-text .silo-nombre{
  font-size:34px;
  font-weight:900;
  line-height:.88;
  letter-spacing:-.06em;

  color:#ffffff;

  text-shadow:
    0 3px 14px rgba(0,0,0,.45);

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.card-header-text .serial{
  margin-top:8px;

  color:#475569;

  font-size:10px;
  font-weight:800;
  letter-spacing:.20em;
  text-transform:uppercase;
}
/* === SILOGUARDIAN v1.1 - detalle por medición + datos sincronizados === */
.sg-toast-ok{
  margin:0 0 14px;
  padding:11px 14px;
  border:1px solid rgba(34,197,94,.35);
  border-radius:12px;
  background:rgba(34,197,94,.10);
  color:#bbf7d0;
  font-weight:800;
}
.sg-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.sg-section-head h2{margin:0 0 4px;color:#fff}
.sg-section-head p{margin:0;color:#94a3b8;font-size:13px}
.sg-sync-time{
  padding:7px 10px;
  border-radius:10px;
  border:1px solid rgba(96,165,250,.25);
  background:rgba(37,99,235,.08);
  color:#93c5fd;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.sg-data-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.sg-data-grid-main{margin-bottom:18px}
.sg-data-box{
  min-height:76px;
  padding:13px 14px;
  border:1px solid rgba(51,65,85,.85);
  border-radius:13px;
  background:rgba(2,6,23,.38);
}
.sg-data-box span{
  display:block;
  margin-bottom:8px;
  color:#93c5fd;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.sg-data-box b{
  display:block;
  color:#fff;
  font-size:17px;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.sg-data-box-small b{font-size:14px}
.sg-subtitle{
  margin:20px 0 10px;
  color:#cbd5e1;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.sg-advanced{
  margin-top:16px;
  padding:12px 14px;
  border:1px solid rgba(51,65,85,.75);
  border-radius:13px;
  background:rgba(2,6,23,.25);
}
.sg-advanced summary{
  cursor:pointer;
  color:#93c5fd;
  font-weight:850;
}
.sg-advanced[open] summary{margin-bottom:12px}
.sg-empty{
  padding:18px;
  border:1px dashed rgba(100,116,139,.45);
  border-radius:12px;
  color:#94a3b8;
}
.sg-empty-soft{margin-top:12px}
.sg-table-wrap{overflow-x:auto}
.sg-measurements-table{min-width:800px}
.sg-note-cell{min-width:220px}
.sg-note-btn{
  width:100%;
  max-width:320px;
  padding:8px 10px;
  border:1px solid rgba(96,165,250,.25);
  border-radius:10px;
  background:rgba(37,99,235,.08);
  color:#dbeafe;
  text-align:left;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}
.sg-note-btn:hover{border-color:rgba(96,165,250,.55);background:rgba(37,99,235,.14)}
.sg-note-btn.empty{color:#93c5fd;font-weight:800}
.sg-note-modal-box{max-width:620px}
.sg-note-date{margin:-4px 0 12px;color:#94a3b8;font-size:12px}
.sg-note-form textarea{
  width:100%;
  min-height:135px;
  resize:vertical;
  padding:12px;
  border-radius:12px;
  border:1px solid #334155;
  background:#0f172a;
  color:#fff;
  font:inherit;
  box-sizing:border-box;
}
.sg-note-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}
@media (max-width:900px){
  .sg-data-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:560px){
  .sg-section-head{flex-direction:column}
  .sg-data-grid{grid-template-columns:1fr}
  .sg-sync-time{white-space:normal}
}

/* === SILOGUARDIAN v1.2 - hero visual + mediciones clickeables === */
.sg-hero-card{
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(56,189,248,.08), transparent 28%),
    linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
}
.sg-hero-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
}
.sg-hero-header h2{margin:0 0 4px;color:#fff;font-size:30px;line-height:1.05}
.sg-hero-header p{margin:0;color:#94a3b8}
.sg-hero-layout{
  display:grid;
  grid-template-columns:minmax(220px, 1fr) minmax(340px, 420px) minmax(220px, 1fr);
  gap:18px;
  align-items:stretch;
}
.sg-side-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.sg-side-box,
.sg-emphasis-box{
  min-height:88px;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(51,65,85,.9);
  background:linear-gradient(180deg, rgba(2,6,23,.54), rgba(2,6,23,.30));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.sg-side-box span,
.sg-emphasis-box span{
  display:block;
  margin-bottom:8px;
  color:#7dd3fc;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.10em;
}
.sg-side-box b,
.sg-emphasis-box b{
  display:block;
  color:#fff;
  font-size:20px;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.sg-silo-stage{
  position:relative;
  padding:18px 16px 20px;
  border-radius:22px;
  border:1px solid rgba(96,165,250,.20);
  background:
    radial-gradient(circle at 50% 0%, rgba(96,165,250,.16), transparent 38%),
    linear-gradient(180deg, rgba(17,24,39,.98), rgba(11,18,32,.95));
  box-shadow:0 18px 40px rgba(0,0,0,.28);
  text-align:center;
}
.sg-silo-stage-topline{
  color:#7dd3fc;
  font-size:11px;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.sg-silo-stage-title{
  margin-top:6px;
  color:#fff;
  font-size:34px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.05em;
}
.sg-silo-stage-sub{
  margin-top:10px;
  color:#94a3b8;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
}
.sg-silo-svg-big{
  display:block;
  width:min(100%, 360px);
  height:auto;
  margin:18px auto 8px;
}
.sg-silo-emphasis-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:8px;
}
.sg-data-box-compact{min-height:72px}
.sg-latest-note{
  margin-top:18px;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(248,113,113,.28);
  background:linear-gradient(180deg, rgba(127,29,29,.10), rgba(2,6,23,.20));
}
.sg-latest-note span{
  display:block;
  margin-bottom:8px;
  color:#fca5a5;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.sg-latest-note b{
  display:block;
  color:#fee2e2;
  line-height:1.5;
  font-size:14px;
}
.sg-measurement-row{
  cursor:pointer;
  transition:background .18s ease, transform .08s ease;
}
.sg-measurement-row:hover{
  background:rgba(37,99,235,.08);
}
.sg-measurement-row:active{transform:scale(.998)}
.sg-note-inline{
  display:flex;
  flex-direction:column;
  gap:4px;
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(96,165,250,.20);
  background:rgba(37,99,235,.08);
}
.sg-note-inline strong{
  color:#dbeafe;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}
.sg-note-inline span{
  color:#93c5fd;
  font-size:11px;
}
.sg-note-inline.empty{
  border-style:dashed;
  background:rgba(2,6,23,.28);
}
.sg-note-inline.empty strong,
.sg-note-inline.empty span{color:#93c5fd}
@media (max-width:1200px){
  .sg-hero-layout{grid-template-columns:1fr}
  .sg-side-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:900px){
  .sg-side-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .sg-hero-header{flex-direction:column}
  .sg-side-grid,
  .sg-silo-emphasis-grid{grid-template-columns:1fr}
  .sg-silo-stage-title{font-size:28px}
}


/* === SILOGUARDIAN v1.3 - dashboard premium around silo === */
.silo-card-dashboard-pro{
  padding:26px 26px 22px;
}
.sg-dash-card-body{
  display:grid;
  grid-template-columns:minmax(220px, 1fr) minmax(360px, 520px) minmax(220px, 1fr);
  gap:18px;
  align-items:stretch;
  margin-top:8px;
}
.sg-dash-side{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.sg-dash-info-box{
  min-height:84px;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(51,65,85,.88);
  background:linear-gradient(180deg, rgba(2,6,23,.52), rgba(2,6,23,.26));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.sg-dash-info-box span{
  display:block;
  margin-bottom:8px;
  color:#7dd3fc;
  font-size:11px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.sg-dash-info-box b{
  display:block;
  color:#fff;
  font-size:20px;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.sg-dash-silo-wrap{
  padding:12px 12px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.sg-dash-mini-meta{
  margin-bottom:6px;
  color:#93c5fd;
  font-size:12px;
  font-weight:800;
}
.sg-dash-mini-meta b{color:#fff}
.sg-dash-silo-link{display:block; width:100%}
.sg-dash-silo-link:hover{transform:scale(1.018)}
.sg-dash-silo-svg{
  width:min(100%, 340px);
  display:block;
  margin:0 auto;
}
.sg-dash-silo-bottom-metrics{
  width:100%;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}
.sg-dash-pill{
  padding:10px 12px;
  border-radius:13px;
  border:1px solid rgba(51,65,85,.88);
  background:rgba(2,6,23,.38);
  text-align:center;
}
.sg-dash-pill span{
  display:block;
  color:#93c5fd;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:6px;
}
.sg-dash-pill b{
  color:#fff;
  font-size:15px;
  font-weight:800;
}
.sg-note-inline{
  display:flex;
  flex-direction:column;
  gap:4px;
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(96,165,250,.20);
  background:rgba(37,99,235,.08);
}
.sg-note-inline strong{
  color:#dbeafe;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}
.sg-note-inline span{
  color:#93c5fd;
  font-size:11px;
}
.sg-note-inline.empty{
  border-style:dashed;
  background:rgba(2,6,23,.28);
}
.sg-note-inline.empty strong,
.sg-note-inline.empty span{color:#93c5fd}
@media (max-width:1240px){
  .sg-dash-card-body{grid-template-columns:1fr}
  .sg-dash-side{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:720px){
  .sg-dash-side,
  .sg-dash-silo-bottom-metrics{grid-template-columns:1fr}
}


/* === SILOGUARDIAN v1.4 - dashboard final / comentarios por medición === */
.silo-card-dashboard-pro{
  padding:26px 26px 24px !important;
}
.silo-card-dashboard-pro .sg-dash-card-body{
  display:grid !important;
  grid-template-columns:minmax(220px,1fr) minmax(480px,620px) minmax(220px,1fr) !important;
  gap:22px !important;
  align-items:center !important;
  margin-top:14px !important;
}
.silo-card-dashboard-pro .sg-dash-side{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:12px !important;
  align-content:center !important;
}
.silo-card-dashboard-pro .sg-dash-info-box{
  display:block !important;
  min-height:82px !important;
  padding:14px 16px !important;
  border:1px solid rgba(51,65,85,.88) !important;
  border-radius:14px !important;
  background:rgba(2,6,23,.48) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035) !important;
}
.silo-card-dashboard-pro .sg-dash-info-box span{
  display:block !important;
  margin-bottom:7px !important;
  color:#7dd3fc !important;
  font-size:10px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.09em !important;
  text-transform:uppercase !important;
}
.silo-card-dashboard-pro .sg-dash-info-box b{
  display:block !important;
  color:#fff !important;
  font-size:19px !important;
  line-height:1.18 !important;
  font-weight:850 !important;
}
.silo-card-dashboard-pro .sg-dash-silo-wrap{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  padding:4px 10px 0 !important;
}
.silo-card-dashboard-pro .sg-dash-silo-link{
  display:block !important;
  width:100% !important;
  max-width:580px !important;
}
.silo-card-dashboard-pro .sg-dash-silo-svg{
  display:block !important;
  width:100% !important;
  max-width:520px !important;
  min-width:420px !important;
  height:auto !important;
  margin:0 auto !important;
}
.silo-card-dashboard-pro .sg-dash-silo-bottom-metrics{
  width:100% !important;
  max-width:560px !important;
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:10px !important;
  margin-top:4px !important;
}
.silo-card-dashboard-pro .sg-dash-pill{
  padding:11px 12px !important;
  border-radius:13px !important;
  border:1px solid rgba(51,65,85,.88) !important;
  background:rgba(2,6,23,.42) !important;
  text-align:center !important;
}
.silo-card-dashboard-pro .sg-dash-pill span{
  display:block !important;
  margin-bottom:5px !important;
  color:#93c5fd !important;
  font-size:10px !important;
  font-weight:900 !important;
  text-transform:uppercase !important;
  letter-spacing:.08em !important;
}
.silo-card-dashboard-pro .sg-dash-pill b{
  color:#fff !important;
  font-size:15px !important;
  font-weight:850 !important;
}

/* modal específico de detalle por medición */
#measurementDetailModal.details-modal{
  position:fixed !important;
  inset:0 !important;
  z-index:100000 !important;
  display:none !important;
  align-items:center !important;
  justify-content:center !important;
  padding:24px !important;
  background:rgba(2,6,23,.82) !important;
  backdrop-filter:blur(6px);
}
#measurementDetailModal.details-modal.show{display:flex !important}
#measurementDetailModal .details-modal-box{
  position:relative !important;
  width:min(640px,94vw) !important;
  max-height:82vh !important;
  overflow:auto !important;
  padding:24px !important;
  border:1px solid rgba(96,165,250,.28) !important;
  border-radius:18px !important;
  background:#111827 !important;
  box-shadow:0 24px 70px rgba(0,0,0,.55) !important;
}
#measurementDetailModal .details-modal-box h3{
  margin:0 42px 8px 0 !important;
  color:#fff !important;
  font-size:22px !important;
}
#measurementDetailModal .details-modal-close{
  position:absolute !important;
  top:12px !important;
  right:14px !important;
  width:34px !important;
  height:34px !important;
  border:1px solid #334155 !important;
  border-radius:10px !important;
  background:#0f172a !important;
  color:#e5e7eb !important;
  font-size:22px !important;
  cursor:pointer !important;
}
.sg-measurement-row{cursor:pointer !important}
.sg-measurement-row:hover{background:rgba(37,99,235,.10) !important}

@media (max-width:1250px){
  .silo-card-dashboard-pro .sg-dash-card-body{
    grid-template-columns:1fr !important;
  }
  .silo-card-dashboard-pro .sg-dash-side{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width:720px){
  .silo-card-dashboard-pro .sg-dash-side,
  .silo-card-dashboard-pro .sg-dash-silo-bottom-metrics{
    grid-template-columns:1fr !important;
  }
  .silo-card-dashboard-pro .sg-dash-silo-svg{
    min-width:0 !important;
    max-width:100% !important;
  }
}

/* === SILOGUARDIAN v1.5 - widgets laterales y métricas extendidas === */
.sg-dash-card-body-v15{
  grid-template-columns:minmax(320px, 1.08fr) minmax(520px, 1.45fr) minmax(320px, 1.08fr);
  gap:22px;
  align-items:start;
}
.sg-dash-left-grid,
.sg-dash-right-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.sg-visual-card{
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(51,65,85,.88);
  background:linear-gradient(180deg, rgba(2,6,23,.56), rgba(2,6,23,.30));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.sg-visual-title{
  color:#7dd3fc;
  font-size:11px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.sg-visual-sub{
  margin-top:6px;
  color:#93c5fd;
  font-size:12px;
  line-height:1.35;
}
.sg-topview-canvas{
  width:100%;
  max-width:360px;
  height:auto;
  display:block;
  margin:14px auto 2px;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(15,23,42,.7), rgba(2,6,23,.95));
}
.sg-profile-svg{
  width:100%;
  max-width:360px;
  height:auto;
  display:block;
  margin:12px auto 0;
}
.sg-dash-silo-wrap-v15{
  padding-top:6px;
}
.sg-dash-silo-svg-v15{
  width:min(100%, 470px);
}
.sg-dash-silo-bottom-metrics-v15{
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
.sg-dash-right-grid .sg-dash-info-box,
.sg-dash-left-grid .sg-dash-info-box{
  min-height:82px;
}
@media (max-width:1420px){
  .sg-dash-card-body-v15{
    grid-template-columns:1fr;
  }
  .sg-dash-left-grid,
  .sg-dash-right-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .sg-topview-canvas,
  .sg-profile-svg{
    max-width:420px;
  }
}
@media (max-width:860px){
  .sg-dash-left-grid,
  .sg-dash-right-grid,
  .sg-dash-silo-bottom-metrics-v15{
    grid-template-columns:1fr;
  }
  .sg-dash-silo-svg-v15{
    width:min(100%, 390px);
  }
}

/* === SILOGUARDIAN v1.6 - semillas, simetría y color por contenido === */
.seed-chip-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:700;
}
.seed-dot,
.seed-dot-big{
  display:inline-block;
  width:11px;
  height:11px;
  border-radius:50%;
  box-shadow:0 0 0 2px rgba(255,255,255,.08);
}
.seed-dot-big{
  width:18px;
  height:18px;
}
.seed-form-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:16px;
  align-items:end;
}
.seed-form-actions{
  display:flex;
  gap:10px;
  align-items:end;
}
.color-input{
  height:44px;
  padding:4px;
}
.sg-dash-card-body-v16{
  grid-template-columns:minmax(290px, 1fr) minmax(460px, 1.25fr) minmax(290px, 1fr);
  gap:20px;
  align-items:start;
}
.sg-dash-left-grid,
.sg-dash-right-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.sg-visual-card{
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(51,65,85,.88);
  background:linear-gradient(180deg, rgba(2,6,23,.56), rgba(2,6,23,.30));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.sg-visual-card-title{
  display:block;
  color:#7dd3fc;
  font-size:11px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  margin-bottom:10px;
}
.sg-topview-canvas,
.sg-profile-svg{
  width:100%;
  max-width:350px;
  height:auto;
  display:block;
  margin:0 auto;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(15,23,42,.7), rgba(2,6,23,.95));
}
.sg-profile-svg{ background:transparent; }
.sg-dash-silo-wrap-v16{
  padding-top:8px;
}
.sg-dash-silo-svg-v16{
  width:min(100%, 440px);
}
.sg-dash-silo-bottom-metrics-v16{
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}
.sg-dash-left-grid .sg-dash-info-box,
.sg-dash-right-grid .sg-dash-info-box,
.sg-visual-card{
  min-height:86px;
}
.sg-top-view-card,
.sg-profile-card{
  min-height:252px;
}
@media (max-width:1450px){
  .seed-form-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .sg-dash-card-body-v16{ grid-template-columns:1fr; }
  .sg-dash-left-grid,
  .sg-dash-right-grid,
  .sg-dash-silo-bottom-metrics-v16{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .sg-topview-canvas,
  .sg-profile-svg{ max-width:420px; }
}
@media (max-width:860px){
  .seed-form-grid,
  .sg-dash-left-grid,
  .sg-dash-right-grid,
  .sg-dash-silo-bottom-metrics-v16{ grid-template-columns:1fr; }
  .sg-dash-silo-svg-v16{ width:min(100%, 380px); }
}

/* === SILOGUARDIAN v1.7 - simetría, zoom y detalle operativo === */

/* Dashboard */
.sg-dash-card-body-v16{
  grid-template-columns:minmax(300px,1fr) minmax(500px,1.35fr) minmax(300px,1fr) !important;
  gap:22px !important;
  align-items:start !important;
}
.sg-dash-side-left,
.sg-dash-side-right{
  display:grid !important;
  grid-template-rows:auto 1fr !important;
  gap:14px !important;
}
.sg-dash-left-grid,
.sg-dash-right-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px !important;
}
.sg-dash-left-grid .sg-dash-info-box,
.sg-dash-right-grid .sg-dash-info-box{
  min-height:82px !important;
}
.sg-top-view-card,
.sg-profile-card{
  min-height:245px !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
}
.sg-topview-canvas,
.sg-profile-svg{
  width:100% !important;
  max-width:340px !important;
  height:auto !important;
  margin:auto auto 0 !important;
}
.sg-visual-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.sg-profile-state{
  padding:5px 9px;
  border-radius:999px;
  border:1px solid rgba(96,165,250,.24);
  background:rgba(37,99,235,.08);
  color:#dbeafe;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.sg-seed-badge{
  --seed-color:#38bdf8;
  width:max-content;
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:10px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--seed-color) 45%, #334155);
  background:color-mix(in srgb, var(--seed-color) 12%, transparent);
  color:#e5e7eb;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.sg-seed-badge-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:var(--seed-color);
  box-shadow:0 0 12px color-mix(in srgb, var(--seed-color) 70%, transparent);
}
.sg-dash-info-box.is-missing b,
.sg-geometry-box.is-missing b{
  color:#64748b !important;
  font-size:13px !important;
  font-weight:800 !important;
}
.sg-geometry-strip{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin:18px 0 12px;
  padding-top:18px;
  border-top:1px solid rgba(148,163,184,.10);
}
.sg-geometry-box{
  min-height:74px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(51,65,85,.88);
  background:linear-gradient(180deg, rgba(2,6,23,.48), rgba(2,6,23,.24));
}
.sg-geometry-box span{
  display:block;
  margin-bottom:7px;
  color:#7dd3fc;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sg-geometry-box b{
  color:#fff;
  font-size:15px;
  font-weight:850;
}
.sg-dash-silo-svg-v16{
  width:min(100%,465px) !important;
}

/* Gráfico: escala real por defecto + controles manuales */
.sg-chart-card{padding-bottom:18px !important}
.sg-chart-toolbar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 12px;
  padding:10px 12px;
  border:1px solid rgba(51,65,85,.75);
  border-radius:12px;
  background:rgba(2,6,23,.24);
}
.sg-chart-toolbar-title{
  margin-right:4px;
  color:#93c5fd;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sg-chart-btn{
  appearance:none;
  border:1px solid rgba(96,165,250,.28);
  border-radius:9px;
  background:#0f172a;
  color:#dbeafe;
  padding:7px 11px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.sg-chart-btn:hover{
  border-color:rgba(96,165,250,.60);
  background:#172033;
}
.sg-chart-btn-primary{
  background:linear-gradient(180deg,#2563eb,#1d4ed8);
  border-color:#3b82f6;
  color:#fff;
}
.sg-chart-scale-info{
  margin-left:auto;
  color:#94a3b8;
  font-size:11px;
  font-weight:700;
}
.sg-chart-wrap{
  position:relative;
  width:100%;
  height:390px;
}
.sg-chart-wrap canvas{
  width:100% !important;
  height:100% !important;
}

/* Mediciones compactas */
.sg-measurements-head{margin-bottom:10px !important}
.sg-measurements-table-compact{
  min-width:980px !important;
}
.sg-measurements-table-compact th,
.sg-measurements-table-compact td{
  padding:7px 10px !important;
  line-height:1.18 !important;
  vertical-align:middle !important;
}
.sg-measurements-table-compact tbody tr{
  min-height:38px !important;
}
.sg-measurements-table-compact th:nth-child(1),
.sg-measurements-table-compact td:nth-child(1){width:21% !important}
.sg-measurements-table-compact th:nth-child(2),
.sg-measurements-table-compact td:nth-child(2){width:10% !important}
.sg-measurements-table-compact th:nth-child(3),
.sg-measurements-table-compact td:nth-child(3){width:10% !important}
.sg-measurements-table-compact th:nth-child(4),
.sg-measurements-table-compact td:nth-child(4){width:12% !important}
.sg-measurements-table-compact th:nth-child(5),
.sg-measurements-table-compact td:nth-child(5){width:47% !important}
.sg-note-cell{min-width:0 !important}
.sg-note-line{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  white-space:nowrap;
}
.sg-detail-type-badge{
  flex:0 0 auto;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(96,165,250,.28);
  background:rgba(37,99,235,.10);
  color:#93c5fd;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.sg-detail-line-text{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#dbeafe;
  font-size:12px;
  font-weight:650;
}
.sg-note-line.empty .sg-detail-line-text{
  color:#64748b;
  font-style:italic;
}
.sg-measurement-row:hover .sg-detail-line-text{
  color:#fff;
}

/* Modal detalle */
#measurementDetailModal.details-modal{
  background:rgba(2,6,23,.84) !important;
  backdrop-filter:blur(7px);
}
#measurementDetailModal .details-modal-box{
  width:min(620px,94vw) !important;
  padding:26px !important;
  border-radius:20px !important;
  border:1px solid rgba(96,165,250,.30) !important;
  background:linear-gradient(180deg,#111827,#0b1220) !important;
  box-shadow:0 28px 80px rgba(0,0,0,.60) !important;
}
.sg-modal-kicker{
  color:#60a5fa;
  font-size:10px;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:5px;
}
#measurementDetailModal .details-modal-box h3{
  margin:0 46px 5px 0 !important;
  color:#fff !important;
  font-size:24px !important;
  letter-spacing:-.02em;
}
.sg-note-date{
  margin:0 0 18px !important;
  color:#94a3b8 !important;
  font-size:12px !important;
  font-weight:700;
}
.sg-note-form label{
  display:block;
  margin:14px 0 7px;
  color:#93c5fd;
  font-size:11px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.sg-detail-type-select,
.sg-note-form textarea{
  width:100% !important;
  box-sizing:border-box !important;
  border:1px solid #334155 !important;
  border-radius:12px !important;
  background:#07101f !important;
  color:#fff !important;
  font:inherit !important;
  outline:none !important;
}
.sg-detail-type-select{
  min-height:44px;
  padding:0 12px;
}
.sg-note-form textarea{
  min-height:122px !important;
  padding:12px !important;
  resize:vertical !important;
}
.sg-detail-type-select:focus,
.sg-note-form textarea:focus{
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 3px rgba(59,130,246,.12) !important;
}
.sg-note-actions{
  display:flex !important;
  justify-content:flex-end !important;
  gap:10px !important;
  margin-top:18px !important;
}
.sg-modal-btn{
  min-width:124px;
  min-height:42px;
  border-radius:11px;
  border:1px solid transparent;
  padding:0 16px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.sg-modal-btn-secondary{
  color:#cbd5e1;
  background:#0f172a;
  border-color:#334155;
}
.sg-modal-btn-secondary:hover{background:#172033}
.sg-modal-btn-primary{
  color:#fff;
  background:linear-gradient(180deg,#3b82f6,#2563eb);
  border-color:#60a5fa;
  box-shadow:0 10px 20px rgba(37,99,235,.20);
}
.sg-modal-btn-primary:hover{background:linear-gradient(180deg,#60a5fa,#2563eb)}

@media (max-width:1450px){
  .sg-dash-card-body-v16{grid-template-columns:1fr !important}
  .sg-dash-left-grid,
  .sg-dash-right-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .sg-geometry-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:760px){
  .sg-dash-left-grid,
  .sg-dash-right-grid,
  .sg-geometry-strip{grid-template-columns:1fr !important}
  .sg-chart-toolbar{align-items:flex-start}
  .sg-chart-scale-info{width:100%;margin-left:0}
  .sg-chart-wrap{height:320px}
  .sg-note-actions{flex-direction:column-reverse}
  .sg-modal-btn{width:100%}
}

/* === SILOGUARDIAN v1.8 - monitoreo avanzado + ciclos + simetría === */
.sg-dash-card-body-v16{
  grid-template-columns:minmax(300px,1fr) minmax(500px,1.32fr) minmax(300px,1fr) !important;
  gap:22px !important;
  align-items:start !important;
}
.sg-top-view-card,
.sg-profile-card{
  min-height:252px !important;
  height:252px !important;
  box-sizing:border-box !important;
}
.sg-topview-canvas,
.sg-profile-svg{
  max-width:338px !important;
}
.sg-dash-left-grid,
.sg-dash-right-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px !important;
}
.sg-dash-left-grid .sg-dash-info-box,
.sg-dash-right-grid .sg-dash-info-box{
  min-height:82px !important;
}

.sg-operations-strip{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
  margin:18px 0 12px;
  padding-top:18px;
  border-top:1px solid rgba(148,163,184,.10);
}
.sg-operation-box{
  min-height:82px;
  padding:13px 14px;
  border-radius:14px;
  border:1px solid rgba(51,65,85,.88);
  background:linear-gradient(180deg, rgba(2,6,23,.48), rgba(2,6,23,.24));
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.sg-operation-box span,
.sg-upgrade-head span,
.sg-sensor-box span{
  display:block;
  color:#7dd3fc;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sg-operation-box span{margin-bottom:8px}
.sg-operation-box b{
  color:#fff;
  font-size:15px;
  font-weight:850;
  line-height:1.25;
}
.sg-operation-action{
  align-items:center;
  text-align:center;
}
.sg-request-measure-btn{
  width:100%;
  min-height:42px;
  margin-top:2px;
  border-radius:11px;
  border:1px solid #334155;
  background:#111827;
  color:#64748b;
  font-size:13px;
  font-weight:900;
  cursor:not-allowed;
  opacity:.85;
}

.sg-geometry-strip{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:10px !important;
  margin:12px 0 14px !important;
  padding-top:0 !important;
  border-top:0 !important;
}
.sg-geometry-box{
  min-height:78px !important;
}

.sg-upgrade-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:18px 0 10px;
  padding-top:18px;
  border-top:1px solid rgba(148,163,184,.10);
}
.sg-upgrade-head small{
  color:#64748b;
  font-size:11px;
  font-weight:700;
}
.sg-sensor-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.sg-sensor-box{
  min-height:78px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(51,65,85,.88);
  background:linear-gradient(180deg, rgba(2,6,23,.48), rgba(2,6,23,.24));
}
.sg-sensor-box span{margin-bottom:7px}
.sg-sensor-box b{
  color:#fff;
  font-size:14px;
  font-weight:850;
}
.sg-sensor-box.is-missing b{
  color:#64748b;
  font-size:13px;
}

/* Detalle general del silo: mismo lenguaje visual que las demás tarjetas */
.sg-detail-standard,
.sg-detail-standard.empty{
  width:100% !important;
  min-height:76px !important;
  margin:12px 0 0 !important;
  padding:12px 14px !important;
  border-radius:14px !important;
  border:1px solid rgba(51,65,85,.88) !important;
  background:linear-gradient(180deg, rgba(2,6,23,.48), rgba(2,6,23,.24)) !important;
  color:#fff !important;
  cursor:pointer !important;
  text-align:left !important;
}
.sg-detail-standard:hover,
.sg-detail-standard.empty:hover{
  border-color:rgba(96,165,250,.48) !important;
  background:linear-gradient(180deg, rgba(15,23,42,.62), rgba(2,6,23,.30)) !important;
}
.sg-detail-standard span,
.sg-detail-standard.empty span{
  display:block !important;
  margin-bottom:7px !important;
  color:#7dd3fc !important;
  font-size:10px !important;
  font-weight:900 !important;
  letter-spacing:.08em !important;
  text-transform:uppercase !important;
}
.sg-detail-standard b,
.sg-detail-standard.empty b{
  color:#fff !important;
  font-size:14px !important;
  font-weight:850 !important;
  line-height:1.3 !important;
}
.sg-detail-standard.empty b{color:#64748b !important}

@media (max-width:1450px){
  .sg-dash-card-body-v16{grid-template-columns:1fr !important}
  .sg-top-view-card,
  .sg-profile-card{height:auto !important;min-height:245px !important}
  .sg-operations-strip,
  .sg-geometry-strip,
  .sg-sensor-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
}
@media (max-width:760px){
  .sg-dash-left-grid,
  .sg-dash-right-grid,
  .sg-operations-strip,
  .sg-geometry-strip,
  .sg-sensor-grid{grid-template-columns:1fr !important}
  .sg-upgrade-head{align-items:flex-start;flex-direction:column}
}

/* === SILOGUARDIAN v1.9 - ajuste de layout y relleno === */
.silo-card-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}
.sg-header-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
}
.sg-request-measure-btn.sg-request-measure-btn-header{
  min-width:190px;
  height:38px;
  padding:0 16px;
  border-radius:12px;
  opacity:.72;
}
.sg-dash-card-body-v19{
  display:grid;
  grid-template-columns:minmax(300px,1.02fr) minmax(420px,500px) minmax(300px,1.02fr);
  gap:24px;
  align-items:start;
  margin-top:10px;
}
.sg-dash-side-left-v19,
.sg-dash-side-right-v19{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.sg-dash-left-grid-v19,
.sg-dash-right-grid-v19{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.sg-visual-stack-v19{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.sg-top-view-card,
.sg-profile-card{
  min-height:232px;
}
.sg-topview-canvas,
.sg-profile-svg{
  max-width:100%;
}
.sg-dash-silo-wrap-v19{
  padding-top:6px;
}
.sg-dash-silo-svg-v19{
  width:min(100%, 390px);
}
.sg-dash-silo-bottom-metrics-v19{
  width:100%;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.sg-operations-strip-v19{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.sg-detail-standard,
.sg-detail-standard.empty{
  border-color:rgba(51,65,85,.88) !important;
  background:linear-gradient(180deg, rgba(2,6,23,.52), rgba(2,6,23,.26)) !important;
}
.sg-detail-standard span,
.sg-detail-standard.empty span{
  color:#7dd3fc !important;
}
.sg-detail-standard b,
.sg-detail-standard.empty b{
  color:#fff !important;
}
.sg-detail-standard.empty b{color:#94a3b8 !important;}
@media (max-width:1450px){
  .sg-dash-card-body-v19{
    grid-template-columns:1fr;
  }
  .sg-dash-left-grid-v19,
  .sg-dash-right-grid-v19,
  .sg-dash-silo-bottom-metrics-v19,
  .sg-operations-strip-v19{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:780px){
  .sg-header-actions{
    width:100%;
    align-items:stretch;
  }
  .silo-card-header{flex-direction:column;}
  .sg-dash-left-grid-v19,
  .sg-dash-right-grid-v19,
  .sg-dash-silo-bottom-metrics-v19,
  .sg-operations-strip-v19{
    grid-template-columns:1fr;
  }
}

/* === SILOGUARDIAN v1.11 - alineación superior izquierda === */
.silo-card-dashboard-pro .sg-dash-card-body.sg-dash-card-body-v19{
  align-items:start !important;
}
.silo-card-dashboard-pro .sg-dash-side.sg-dash-side-left-v19{
  display:flex !important;
  flex-direction:column !important;
  align-content:start !important;
  justify-content:flex-start !important;
  align-self:start !important;
  gap:14px !important;
}
.silo-card-dashboard-pro .sg-dash-side.sg-dash-side-right-v19{
  display:flex !important;
  flex-direction:column !important;
  align-content:start !important;
  justify-content:flex-start !important;
  align-self:start !important;
  gap:14px !important;
}
.silo-card-dashboard-pro .sg-dash-left-grid-v19{
  width:100% !important;
  align-content:start !important;
  margin-top:0 !important;
}
.silo-card-dashboard-pro .sg-cycle-box{
  min-height:84px !important;
}
.silo-card-dashboard-pro .sg-cycle-box b{
  font-size:14px !important;
  line-height:1.28 !important;
}

/* === SILOGUARDIAN v1.12 - historial por semilla/PH + encabezado Medir === */
.sg-header-actions{
  min-width:220px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.sg-request-measure-btn.sg-request-measure-btn-header{
  width:168px;
  min-width:168px;
  height:40px;
  padding:0 18px;
  border-radius:12px;
  border:1px solid rgba(125,211,252,.28);
  background:linear-gradient(180deg, rgba(30,41,59,.96), rgba(15,23,42,.96));
  color:#cbd5e1;
  font-size:12px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 8px 20px rgba(2,6,23,.18);
  opacity:1;
  cursor:not-allowed;
}
.sg-request-measure-btn.sg-request-measure-btn-header:hover{
  background:linear-gradient(180deg, rgba(30,41,59,.96), rgba(15,23,42,.96));
}
.sg-header-collector{
  width:168px;
  padding-top:2px;
  text-align:right;
  color:#64748b;
  font-size:10px;
  line-height:1.25;
}
.sg-header-collector span{
  display:block;
  color:#7dd3fc;
  font-size:9px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.sg-header-collector b{
  display:block;
  margin-top:2px;
  color:#cbd5e1;
  font-size:10px;
  font-weight:800;
  overflow-wrap:anywhere;
}

/* Tabla histórica con snapshot de semilla, PH y toneladas */
.sg-measurements-table-v12{
  min-width:1280px !important;
  table-layout:fixed;
}
.sg-measurements-table-v12 th,
.sg-measurements-table-v12 td{
  padding:6px 8px !important;
  line-height:1.08 !important;
  font-size:12px;
}
.sg-measurements-table-v12 th:nth-child(1),
.sg-measurements-table-v12 td:nth-child(1){width:15% !important;}
.sg-measurements-table-v12 th:nth-child(2),
.sg-measurements-table-v12 td:nth-child(2){width:11% !important;}
.sg-measurements-table-v12 th:nth-child(3),
.sg-measurements-table-v12 td:nth-child(3){width:8% !important;}
.sg-measurements-table-v12 th:nth-child(4),
.sg-measurements-table-v12 td:nth-child(4){width:7% !important;}
.sg-measurements-table-v12 th:nth-child(5),
.sg-measurements-table-v12 td:nth-child(5){width:10% !important;}
.sg-measurements-table-v12 th:nth-child(6),
.sg-measurements-table-v12 td:nth-child(6){width:10% !important;}
.sg-measurements-table-v12 th:nth-child(7),
.sg-measurements-table-v12 td:nth-child(7){width:11% !important;}
.sg-measurements-table-v12 th:nth-child(8),
.sg-measurements-table-v12 td:nth-child(8){width:28% !important;}
.sg-measurement-seed{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-width:0;
  max-width:100%;
  font-weight:800;
  color:#e2e8f0;
}
.sg-measurement-seed-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  flex:0 0 auto;
  box-shadow:0 0 0 2px rgba(255,255,255,.06);
}
.sg-ph-inline-form{
  display:flex;
  align-items:center;
  gap:5px;
  margin:0;
}
.sg-ph-inline-input{
  width:70px;
  height:30px;
  padding:4px 7px;
  border-radius:8px;
  border:1px solid rgba(51,65,85,.95);
  background:#0b1220;
  color:#fff;
  font-size:12px;
  font-weight:800;
}
.sg-ph-inline-input:focus{
  outline:none;
  border-color:rgba(96,165,250,.70);
  box-shadow:0 0 0 2px rgba(37,99,235,.12);
}
.sg-ph-save-btn{
  width:30px;
  height:30px;
  padding:0;
  border-radius:8px;
  border:1px solid rgba(34,197,94,.30);
  background:rgba(34,197,94,.10);
  color:#86efac;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}
.sg-ph-save-btn:hover{
  background:rgba(34,197,94,.18);
  border-color:rgba(34,197,94,.55);
}
.sg-tonnes-head{
  background:rgba(14,165,233,.08) !important;
}
.sg-tonnes-cell{
  background:linear-gradient(180deg, rgba(14,165,233,.10), rgba(37,99,235,.05));
  border-left:1px solid rgba(56,189,248,.14);
  border-right:1px solid rgba(56,189,248,.14);
}
.sg-tonnes-cell strong{
  display:inline-block;
  color:#7dd3fc;
  font-size:14px;
  font-weight:950;
  letter-spacing:.01em;
}
.sg-detail-line-text-v12{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sg-meta-tonnes{
  margin-top:5px;
  color:#94a3b8;
}
.sg-meta-tonnes b{
  color:#7dd3fc;
  font-size:16px;
}
.sg-toast-error{
  margin:0 0 14px;
  padding:11px 14px;
  border:1px solid rgba(248,113,113,.35);
  border-radius:12px;
  background:rgba(127,29,29,.12);
  color:#fecaca;
  font-weight:800;
}
@media (max-width:780px){
  .sg-header-actions{
    width:100%;
    min-width:0;
    align-items:stretch;
  }
  .sg-request-measure-btn.sg-request-measure-btn-header,
  .sg-header-collector{
    width:100%;
    min-width:0;
    text-align:left;
  }
}

/* === SILOGUARDIAN v1.14 - silo premium render === */
.sg-dash-silo-link-premium{
  display:flex;
  justify-content:center;
}
.sg-silo-hero-premium{
  position:relative;
  width:min(100%, 520px);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  filter: drop-shadow(0 28px 32px rgba(0,0,0,.45));
}
.sg-silo-premium-image{
  width:100%;
  height:auto;
  display:block;
  user-select:none;
  -webkit-user-drag:none;
}
.sg-silo-premium-percentage{
  position:absolute;
  left:50%;
  top:56%;
  transform:translate(-50%, -50%);
  min-width:260px;
  padding:16px 26px;
  border-radius:22px;
  text-align:center;
  font-size:68px;
  font-weight:900;
  line-height:1;
  color:#ffffff;
  letter-spacing:-0.04em;
  background:linear-gradient(180deg, rgba(6,23,52,.78), rgba(7,18,35,.60));
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 16px 40px rgba(2,6,23,.34), inset 0 1px 0 rgba(255,255,255,.10);
  text-shadow:0 3px 16px rgba(2,6,23,.95);
  backdrop-filter:blur(8px);
}
.sg-silo-premium-percentage::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  pointer-events:none;
}
.sg-dash-silo-bottom-metrics-v19{
  margin-top:-8px;
}
@media (max-width: 1200px){
  .sg-silo-hero-premium{ width:min(100%, 470px); }
  .sg-silo-premium-percentage{ font-size:58px; min-width:230px; }
}
@media (max-width: 780px){
  .sg-silo-hero-premium{ width:min(100%, 360px); }
  .sg-silo-premium-percentage{ font-size:42px; min-width:180px; padding:12px 18px; border-radius:18px; }
}

/* === SILOGUARDIAN v1.15 - silo premium con nivel/talud dinámicos === */
.sg-silo-hero-premium{
  overflow:visible;
}
.sg-silo-dynamic-chamber{
  position:absolute;
  left:17.4%;
  right:17.2%;
  top:22.4%;
  bottom:8.3%;
  overflow:hidden;
  border-radius:7% 7% 3% 3%;
  background:
    linear-gradient(90deg, rgba(255,255,255,.07), transparent 12%, transparent 88%, rgba(0,0,0,.14)),
    linear-gradient(180deg, #202a36 0%, #111925 45%, #0a111b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(226,232,240,.16),
    inset 18px 0 28px rgba(255,255,255,.035),
    inset -26px 0 32px rgba(0,0,0,.24);
  pointer-events:none;
}
.sg-grain-body{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:var(--grain-body);
  background:
    repeating-radial-gradient(ellipse at 20% 30%, rgba(255,255,255,.18) 0 1px, transparent 1.2px 6px),
    repeating-radial-gradient(ellipse at 70% 65%, rgba(2,6,23,.18) 0 1px, transparent 1.2px 7px),
    linear-gradient(90deg, rgba(255,255,255,.12), transparent 18%, transparent 72%, rgba(2,6,23,.20)),
    linear-gradient(180deg, var(--grain-light) 0%, var(--grain-base) 55%, var(--grain-dark) 100%);
  box-shadow:inset 0 14px 20px rgba(255,255,255,.05);
}
.sg-grain-mound{
  position:absolute;
  left:0;
  right:0;
  bottom:calc(var(--grain-body) - .3%);
  height:var(--grain-mound);
  background:
    repeating-radial-gradient(ellipse at 30% 30%, rgba(255,255,255,.18) 0 1px, transparent 1.2px 6px),
    repeating-radial-gradient(ellipse at 70% 70%, rgba(2,6,23,.16) 0 1px, transparent 1.2px 7px),
    linear-gradient(180deg, var(--grain-top) 0%, var(--grain-base) 70%, var(--grain-dark) 100%);
  filter:drop-shadow(0 -2px 2px rgba(255,255,255,.05));
}
.sg-silo-dynamic-chamber.is-carga .sg-grain-mound{
  clip-path:polygon(0 100%, 0 70%, 14% 62%, 28% 48%, 40% 26%, 50% 0, 60% 25%, 72% 47%, 86% 62%, 100% 70%, 100% 100%);
}
.sg-silo-dynamic-chamber.is-descarga .sg-grain-mound{
  clip-path:polygon(0 100%, 0 20%, 16% 28%, 32% 48%, 50% 88%, 68% 48%, 84% 28%, 100% 20%, 100% 100%);
}
.sg-silo-glass-overlay{
  position:absolute;
  inset:0;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,.12) 0%, rgba(255,255,255,.03) 12%, transparent 19%,
      rgba(255,255,255,.05) 35%, transparent 44%, transparent 67%,
      rgba(2,6,23,.16) 78%, rgba(2,6,23,.28) 100%);
  box-shadow:
    inset 20px 0 24px rgba(255,255,255,.025),
    inset -24px 0 28px rgba(2,6,23,.20);
}
.sg-silo-premium-percentage{
  top:57%;
  min-width:0;
  padding:0;
  border:none;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
  font-size:72px;
  color:#ffffff;
  -webkit-text-stroke:1px rgba(2,6,23,.65);
  text-shadow:0 4px 18px rgba(2,6,23,.95), 0 0 2px #020617;
}
.sg-silo-premium-percentage::after{display:none;}
@media (max-width:1200px){
  .sg-silo-premium-percentage{font-size:60px;}
}
@media (max-width:780px){
  .sg-silo-premium-percentage{font-size:44px; padding:0; min-width:0;}
}

/* === SILOGUARDIAN v1.16 - mejora general de botones === */
:root{
  --btn-shadow: 0 10px 24px rgba(2,6,23,.22);
  --btn-shadow-hover: 0 14px 28px rgba(2,6,23,.28);
  --btn-shadow-press: 0 6px 14px rgba(2,6,23,.20);
  --btn-border: rgba(148,163,184,.18);
}

button,
.btn,
input[type="submit"],
input[type="button"],
input[type="reset"],
a.btn,
.btn-card-detail,
.sg-request-measure-btn{
  position:relative;
  overflow:hidden;
  transition:transform .14s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
  will-change:transform;
}

button::before,
.btn::before,
input[type="submit"]::before,
input[type="button"]::before,
input[type="reset"]::before,
a.btn::before,
.btn-card-detail::before,
.sg-request-measure-btn::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
  opacity:.9;
  pointer-events:none;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
a.btn:hover,
.btn-card-detail:hover,
.sg-request-measure-btn:hover:not(:disabled){
  transform:translateY(-1px);
  box-shadow:var(--btn-shadow-hover);
}

button:active,
.btn:active,
input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active,
a.btn:active,
.btn-card-detail:active,
.sg-request-measure-btn:active:not(:disabled){
  transform:translateY(1px) scale(.985);
  box-shadow:var(--btn-shadow-press);
}

button:focus-visible,
.btn:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible,
input[type="reset"]:focus-visible,
a.btn:focus-visible,
.btn-card-detail:focus-visible,
.sg-request-measure-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px rgba(2,6,23,.85), 0 0 0 4px rgba(56,189,248,.45), var(--btn-shadow);
}

button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled,
input[type="reset"]:disabled,
.sg-request-measure-btn:disabled{
  cursor:not-allowed;
  transform:none !important;
  box-shadow:none !important;
}

.btn,
a.btn{
  min-height:36px;
  width:auto;
  min-width:86px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid var(--btn-border);
  text-transform:none;
  letter-spacing:.01em;
  box-shadow:var(--btn-shadow);
}

.btn.secondary{background:linear-gradient(180deg,#475569,#334155); color:#fff;}
.btn.secondary:hover{background:linear-gradient(180deg,#64748b,#475569);}
.btn.danger{background:linear-gradient(180deg,#dc2626,#b91c1c); color:#fff;}
.btn.danger:hover{background:linear-gradient(180deg,#ef4444,#dc2626);}
.btn-ver{background:linear-gradient(180deg,#67e8f9,#38bdf8); color:#082f49;}
.btn-ver:hover{background:linear-gradient(180deg,#a5f3fc,#67e8f9);}
.btn-editar{background:linear-gradient(180deg,#818cf8,#6366f1); color:#fff;}
.btn-editar:hover{background:linear-gradient(180deg,#a5b4fc,#818cf8);}
.btn-delete{background:linear-gradient(180deg,#ef4444,#dc2626); color:#fff;}
.btn-delete:hover{background:linear-gradient(180deg,#f87171,#ef4444);}

.table-actions .btn{
  width:74px;
  min-width:74px;
  height:34px;
  border-radius:10px;
}

.btn-card-detail{
  height:42px;
  border-radius:13px;
  border:1px solid rgba(96,165,250,.34);
  background:linear-gradient(180deg,#3b82f6,#2563eb) !important;
  box-shadow:0 12px 24px rgba(37,99,235,.22);
}
.btn-card-detail:hover{
  background:linear-gradient(180deg,#60a5fa,#3b82f6) !important;
}

#detailsModal .details-modal-box button,
#detailsModal .details-modal-box .btn,
#detailsModal .details-modal-box input[type="submit"]{
  min-height:38px;
  border-radius:11px;
  padding:0 14px;
  font-weight:800;
}

#detailsModal .details-modal-box button[type="submit"],
#detailsModal .details-modal-box .btn-primary,
#detailsModal .details-modal-box .save-btn,
#detailsModal .details-modal-box button.save{
  background:linear-gradient(180deg,#3b82f6,#2563eb);
  border:1px solid rgba(96,165,250,.35);
  color:#fff;
  box-shadow:0 12px 24px rgba(37,99,235,.18);
}
#detailsModal .details-modal-box button[type="submit"]:hover,
#detailsModal .details-modal-box .btn-primary:hover,
#detailsModal .details-modal-box .save-btn:hover,
#detailsModal .details-modal-box button.save:hover{
  background:linear-gradient(180deg,#60a5fa,#3b82f6);
}

#detailsModal .details-modal-box .btn-secondary,
#detailsModal .details-modal-box .cancel-btn,
#detailsModal .details-modal-box button[type="button"]{
  background:linear-gradient(180deg,#1e293b,#0f172a);
  border:1px solid rgba(148,163,184,.18);
  color:#cbd5e1;
}
#detailsModal .details-modal-box .btn-secondary:hover,
#detailsModal .details-modal-box .cancel-btn:hover,
#detailsModal .details-modal-box button[type="button"]:hover{
  background:linear-gradient(180deg,#334155,#1e293b);
}

.detail-head .chart-filter button,
.detail-head .chart-filter .btn,
.chart-filter-top button,
.chart-filter-top .btn{
  min-height:40px;
  padding:0 16px;
  border-radius:11px;
  border:1px solid rgba(148,163,184,.18);
  box-shadow:var(--btn-shadow);
}

.sg-request-measure-btn.sg-request-measure-btn-header{
  height:42px;
  border-radius:14px;
  box-shadow:0 12px 26px rgba(2,6,23,.22), inset 0 1px 0 rgba(255,255,255,.06);
}
.sg-request-measure-btn.sg-request-measure-btn-header:active:not(:disabled){
  transform:translateY(1px) scale(.99);
}

.btn-limpiar,
a.btn-limpiar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 14px;
  border-radius:11px;
  border:1px solid rgba(250,204,21,.18);
  background:linear-gradient(180deg, rgba(51,65,85,.55), rgba(15,23,42,.78));
  color:#facc15 !important;
  text-decoration:none;
  font-weight:800;
  box-shadow:var(--btn-shadow);
}
.btn-limpiar:hover,
a.btn-limpiar:hover{
  background:linear-gradient(180deg, rgba(71,85,105,.75), rgba(30,41,59,.95));
  color:#fde68a !important;
}

/* === SILOGUARDIAN v1.17 - layout izquierdo + grano mejorado === */
.sg-dash-silo-wrap-v19{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  gap:0;
}

.sg-dash-side-left-v19 .sg-dash-left-grid-v19{
  align-content:start;
}

.sg-dash-silo-link-premium{
  align-self:center;
}

/* === SILOGUARDIAN v1.18 - silo refinado, contenido más real === */
.sg-silo-hero-premium{
  width:min(100%, 500px);
}

.sg-silo-dynamic-chamber{
  position:absolute;
  left:18.6%;
  right:18.4%;
  top:27.1%;
  bottom:11.5%;
  overflow:hidden;
  clip-path:polygon(1.5% 0%, 98.5% 0%, 97.6% 79%, 93.2% 95.5%, 6.8% 95.5%, 2.4% 79%);
  background:
    linear-gradient(90deg, rgba(255,255,255,.03) 0%, transparent 12%, transparent 88%, rgba(0,0,0,.12) 100%),
    linear-gradient(180deg, rgba(18,27,40,.96) 0%, rgba(12,18,28,.94) 54%, rgba(9,14,22,.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(226,232,240,.10),
    inset 18px 0 18px rgba(255,255,255,.02),
    inset -18px 0 22px rgba(0,0,0,.16);
  pointer-events:none;
}

.sg-grain-body,
.sg-grain-mound{
  position:absolute;
  left:0;
  right:0;
  overflow:hidden;
  background-color:var(--grain-base);
}

.sg-grain-body{
  bottom:0;
  height:var(--grain-body);
  border-radius:0 0 7% 7%;
  background:
    radial-gradient(ellipse 5px 3.2px at 5px 4px, rgba(255,255,255,.22) 0 44%, transparent 48%) 0 0/18px 13px repeat,
    radial-gradient(ellipse 4.8px 3px at 12px 9px, rgba(255,255,255,.12) 0 40%, transparent 46%) 0 0/20px 14px repeat,
    radial-gradient(ellipse 5px 3px at 9px 6px, rgba(0,0,0,.13) 0 40%, transparent 46%) 0 0/19px 13px repeat,
    linear-gradient(90deg, rgba(255,255,255,.08) 0%, transparent 18%, transparent 78%, rgba(2,6,23,.16) 100%),
    linear-gradient(180deg, var(--grain-light) 0%, var(--grain-base) 54%, var(--grain-dark) 100%);
  box-shadow:
    inset 0 12px 12px rgba(255,255,255,.035),
    inset 0 -16px 22px rgba(0,0,0,.14);
}

.sg-grain-body::after{
  content:'';
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.13), transparent 38%),
    linear-gradient(180deg, transparent 0%, transparent 72%, rgba(0,0,0,.10) 100%);
  pointer-events:none;
}

.sg-grain-mound{
  bottom:calc(var(--grain-body) - 1.2%);
  height:calc(var(--grain-mound) + 1.3%);
  background:
    radial-gradient(ellipse 5px 3.2px at 6px 5px, rgba(255,255,255,.26) 0 42%, transparent 48%) 0 0/18px 13px repeat,
    radial-gradient(ellipse 4.8px 3px at 13px 8px, rgba(255,255,255,.14) 0 40%, transparent 46%) 0 0/19px 13px repeat,
    radial-gradient(ellipse 5px 3px at 10px 7px, rgba(0,0,0,.10) 0 38%, transparent 46%) 0 0/20px 14px repeat,
    linear-gradient(180deg, var(--grain-top) 0%, var(--grain-light) 32%, var(--grain-base) 72%, var(--grain-dark) 100%);
  box-shadow:
    inset 0 8px 10px rgba(255,255,255,.05),
    0 -1px 0 rgba(255,255,255,.08);
}

.sg-silo-dynamic-chamber.is-carga .sg-grain-mound{
  clip-path:polygon(0 100%, 0 78%, 8% 72%, 18% 61%, 30% 47%, 42% 30%, 50% 18%, 58% 30%, 70% 47%, 82% 61%, 92% 72%, 100% 78%, 100% 100%);
}

.sg-silo-dynamic-chamber.is-descarga .sg-grain-mound{
  clip-path:polygon(0 100%, 0 20%, 14% 28%, 28% 40%, 40% 56%, 50% 68%, 60% 56%, 72% 40%, 86% 28%, 100% 20%, 100% 100%);
}

.sg-silo-glass-overlay{
  position:absolute;
  inset:0;
  z-index:3;
  background:
    linear-gradient(90deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.05) 8%, transparent 16%, rgba(255,255,255,.035) 33%, transparent 44%, transparent 68%, rgba(2,6,23,.10) 79%, rgba(2,6,23,.22) 100%);
  box-shadow:
    inset 14px 0 18px rgba(255,255,255,.018),
    inset -20px 0 22px rgba(2,6,23,.14);
}

.sg-silo-premium-percentage{
  z-index:4;
  top:57%;
  min-width:0;
  padding:16px 24px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(11,19,32,.78), rgba(13,20,31,.62));
  box-shadow:0 18px 34px rgba(2,6,23,.30), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter:blur(6px);
  font-size:72px;
  color:#ffffff;
  -webkit-text-stroke:1px rgba(2,6,23,.40);
  text-shadow:0 4px 18px rgba(2,6,23,.85), 0 0 2px #020617;
}

.sg-silo-premium-percentage::after{
  display:none;
}

@media (max-width:1200px){
  .sg-silo-hero-premium{ width:min(100%, 455px); }
  .sg-silo-premium-percentage{ font-size:60px; }
}

@media (max-width:780px){
  .sg-silo-hero-premium{ width:min(100%, 340px); }
  .sg-silo-dynamic-chamber{ left:18.4%; right:18.1%; top:27.0%; bottom:11.4%; }
  .sg-silo-premium-percentage{ font-size:42px; padding:12px 16px; border-radius:18px; }
}

/* === SILOGUARDIAN v1.19 - detalle mediciones === */
.sg-tonnes-head,
.sg-tonnes-cell{
  background:transparent !important;
  border-left:0 !important;
  border-right:0 !important;
  box-shadow:none !important;
}

.sg-tonnes-cell strong{
  color:#7dd3fc !important;
  font-size:14px;
  font-weight:950;
  letter-spacing:.01em;
}

.sg-measurements-table-v12 th:nth-child(1),
.sg-measurements-table-v12 td:nth-child(1){
  width:13% !important;
}


/* === SILOGUARDIAN v1.21 - gráfico por semilla + PH modificado === */
.sg-ph-value{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:3px 7px;
  border-radius:7px;
  color:#f8fafc;
  font-size:12px;
  font-weight:900;
  border:1px solid transparent;
}
.sg-ph-value.is-custom{
  color:#f87171 !important;
  background:rgba(239,68,68,.08);
  border-color:rgba(248,113,113,.28);
  box-shadow:inset 0 0 0 1px rgba(239,68,68,.04);
}
.sg-ph-value.is-custom::after{
  content:"•";
  margin-left:5px;
  color:#ef4444;
  font-size:14px;
  line-height:1;
}
