/* ============================================================
   Bitua Dashboard (animated) — ported from "Dashboard Bitua Animado.dc.html"
   Real product UI palette (navy rail, blue numbers, green actions,
   amber Beta, teal bars). ALL rules scoped under .scdash so it never
   clashes with the marketing site's styles.
   ============================================================ */
.scdash {
  --sc-navy:#2F4C66; --sc-navy-2:#3A5A78;
  --sc-blue:#5B96D1; --sc-blue-dk:#4781BD; --sc-blue-soft:#DCE9F7;
  --sc-teal:#2BB6A3; --sc-green:#5CB85C; --sc-green-dk:#4CA64C; --sc-green-soft:#D4EDDA;
  --sc-amber:#E8930C; --sc-amber-soft:#FBEED2;
  --sc-orange:#ED6B4E; --sc-orange-sf:#FBE3DC; --sc-cyan:#4BA8C4; --sc-cyan-soft:#D4ECF2;
  --sc-bg:#ECECEC; --sc-surface:#FFFFFF; --sc-text:#3D3D3D; --sc-text-2:#6B6B6B;
  --sc-dark:#2D3A45; --sc-muted:#9AA0A6; --sc-border:#ECECEC; --sc-border-2:#DADCE0;
  --sc-font:'Montserrat',system-ui,sans-serif;
  font-family: var(--sc-font); color: var(--sc-text); background: var(--sc-bg);
  -webkit-font-smoothing: antialiased; text-align: left;
}
.scdash *, .scdash *::before, .scdash *::after { box-sizing: border-box; margin: 0; padding: 0; }
.scdash button { font-family: var(--sc-font); cursor: default; }
.scdash .ic { line-height: 0; flex: none; display: inline-flex; }
.scdash .ic > svg { width: 100%; height: 100%; display: block; }

.scdash .app { display: grid; grid-template-columns: 72px 1fr; height: 900px; position: relative; }

/* rail */
.scdash .rail { background: var(--sc-navy); display: flex; flex-direction: column; align-items: center; padding: 16px 0; gap: 3px; }
.scdash .rail .logo { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.scdash .rail .logo img { width: 30px; }
.scdash .rail-btn { width: 46px; height: 46px; border: none; background: transparent; border-radius: 10px; color: rgba(255,255,255,.74); display: flex; align-items: center; justify-content: center; }
.scdash .rail-btn.active { background: rgba(255,255,255,.18); color: #fff; }
.scdash .rail .spacer { flex: 1; }

/* main */
.scdash .main { display: flex; flex-direction: column; min-width: 0; }
.scdash .content { flex: 1; overflow: hidden; padding: 22px 26px 40px; }
.scdash .page-title { font-size: 18px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; padding: 4px 4px 20px; }

/* topbar */
.scdash .topbar { height: 64px; background: var(--sc-surface); border-bottom: 1px solid var(--sc-border); display: flex; align-items: center; gap: 14px; padding: 0 0 0 24px; flex-shrink: 0; }
.scdash .selector { display: flex; align-items: center; gap: 10px; min-width: 290px; height: 44px; padding: 0 16px; border: 1px solid var(--sc-border-2); border-radius: 8px; font-size: 15px; font-weight: 500; justify-content: space-between; }
.scdash .topbar .spacer { flex: 1; }
.scdash .tools { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.scdash .tool { width: 42px; height: 42px; border: none; background: transparent; border-radius: 8px; color: var(--sc-text-2); display: flex; align-items: center; justify-content: center; position: relative; }
.scdash .tool .nbadge { position: absolute; top: 4px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sc-orange); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.scdash .flag { width: 24px; height: 17px; border-radius: 3px; background: linear-gradient(#C60B1E 0 25%, #FFC400 25% 75%, #C60B1E 75% 100%); box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.scdash .userbox { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px 0 20px; background: #F4F5F7; margin-left: 4px; }
.scdash .userbox .ava { width: 38px; height: 38px; border-radius: 50%; background: #E3E6E8; color: #9AA0A6; display: flex; align-items: center; justify-content: center; }
.scdash .userbox .uname { font-size: 15px; font-weight: 600; white-space: nowrap; }

/* KPI panel */
.scdash .kpi-panel { background: var(--sc-surface); border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.07); margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; }
.scdash .kpi-cell { padding: 26px 28px; border-right: 1px solid var(--sc-border); border-bottom: 1px solid var(--sc-border); min-height: 152px; }
.scdash .kpi-cell:nth-child(4n) { border-right: none; }
.scdash .kpi-cell:nth-last-child(-n+4) { border-bottom: none; }
.scdash .kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.scdash .kpi-label { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sc-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scdash .kpi-ind.amber { color: var(--sc-orange); }
.scdash .kpi-ind.green { color: var(--sc-green); }
.scdash .kpi-body { display: flex; align-items: center; gap: 22px; margin-top: 28px; }
.scdash .kpi-body .gic { color: #3F3F3F; }
.scdash .kpi-num { font-size: 50px; font-weight: 700; color: var(--sc-blue); line-height: 1; }
.scdash .beta { background: var(--sc-amber); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }

/* table panel */
.scdash .tbl-panel { background: var(--sc-surface); border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.07); padding: 24px 26px; }
.scdash .tbl-tools { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.scdash .search { flex: 1; max-width: 640px; height: 50px; display: flex; align-items: center; padding: 0 18px; border: 1px solid var(--sc-border-2); border-radius: 8px; }
.scdash .btn-export { display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 22px; border: 1px solid var(--sc-green); color: var(--sc-green-dk); background: #fff; border-radius: 8px; font-size: 15px; font-weight: 600; }
.scdash .btn-export.blue { border-color: var(--sc-blue); color: var(--sc-blue-dk); }
.scdash .refresh { margin-left: auto; width: 40px; height: 40px; border: none; background: transparent; color: var(--sc-muted); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.scdash table { width: 100%; border-collapse: collapse; }
.scdash thead th { font-size: 14px; font-weight: 600; color: var(--sc-text-2); text-align: left; padding: 14px 14px; border-bottom: 2px solid var(--sc-border); vertical-align: bottom; }
.scdash thead th .th { display: inline-flex; align-items: flex-start; gap: 6px; }
.scdash .num-col { text-align: center; }
.scdash tbody td { font-size: 15px; padding: 18px 14px; border-bottom: 1px solid var(--sc-border); vertical-align: middle; }
.scdash .loc-name { font-weight: 600; max-width: 180px; line-height: 1.3; }
.scdash .cb { width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--sc-border-2); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.scdash .cb.on { background: var(--sc-blue); border-color: var(--sc-blue); }
.scdash .c-blue { color: var(--sc-blue); font-weight: 600; }
.scdash .c-orange { color: var(--sc-orange); font-weight: 600; }
.scdash .c-eq { color: var(--sc-text-2); }
.scdash .expiry { display: inline-flex; height: 30px; border-radius: 5px; overflow: hidden; min-width: 120px; transform-origin: left; }
.scdash .expiry span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; padding: 0 6px; }
.scdash .expiry .ok { background: var(--sc-green); } .scdash .expiry .soon { background: var(--sc-amber); } .scdash .expiry .exp { background: var(--sc-orange); }
.scdash .upd { font-size: 14px; line-height: 1.45; }
.scdash .offline { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; background: var(--sc-orange-sf); color: var(--sc-orange); font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.scdash .det-stack { display: flex; flex-direction: column; gap: 6px; }
.scdash .det-btn { width: 40px; height: 34px; border-radius: 6px; background: #EAF1FA; color: var(--sc-blue); border: none; display: flex; align-items: center; justify-content: center; }

/* analytics */
.scdash .filter-bar { background: var(--sc-surface); border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.07); padding: 18px 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.scdash .date-range { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--sc-border-2); border-radius: 8px; color: var(--sc-muted); font-size: 14px; }
.scdash .date-range .sep { color: var(--sc-text-2); }
.scdash .filter-sel { display: flex; align-items: center; justify-content: space-between; min-width: 210px; height: 48px; padding: 0 14px; border: 1px solid var(--sc-border-2); border-radius: 8px; font-size: 14px; font-weight: 500; }
.scdash .data-note { display: inline-flex; align-items: center; gap: 7px; color: var(--sc-text-2); font-size: 14px; }
.scdash .sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.scdash .sum-card { background: var(--sc-surface); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.07); padding: 22px 24px; min-height: 168px; display: flex; flex-direction: column; }
.scdash .sum-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scdash .sum-label { font-size: 15px; color: var(--sc-text-2); font-weight: 500; }
.scdash .sum-badge { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scdash .sum-val { font-size: 20px; font-weight: 700; color: var(--sc-dark); margin-top: auto; line-height: 1.3; }
.scdash .sum-val.big { font-size: 44px; }
.scdash .chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.scdash .chart-card { background: var(--sc-surface); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.07); padding: 24px 26px; }
.scdash .cc-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--sc-border); margin-bottom: 22px; }
.scdash .cc-head h3 { font-size: 19px; font-weight: 700; }
.scdash .cc-tools { display: flex; align-items: center; gap: 14px; }
.scdash .cc-iconbtn { width: 38px; height: 38px; border-radius: 6px; border: 1px solid var(--sc-border-2); background: #fff; display: flex; align-items: center; justify-content: center; }
.scdash .cc-iconbtn.red { color: var(--sc-orange); }
.scdash .hbar-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; margin-bottom: 12px; }
.scdash .hbar-row .lab { font-size: 13px; color: var(--sc-text-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scdash .hbar { height: 26px; border-radius: 4px; background: var(--sc-teal); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-size: 13px; font-weight: 700; min-width: 28px; width: 0; transition: width 1s cubic-bezier(.16,1,.3,1); }
.scdash .vchart { display: flex; align-items: flex-end; gap: 14px; height: 300px; padding: 10px 4px 0; }
.scdash .vcol { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 10px; }
.scdash .vbar { width: 100%; max-width: 46px; background: var(--sc-blue); border-radius: 3px 3px 0 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; color: #fff; font-size: 14px; font-weight: 700; height: 0; transition: height 1s cubic-bezier(.16,1,.3,1); }
.scdash .vlab { font-size: 13px; color: var(--sc-text-2); }

/* consumos */
.scdash .con-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.scdash .con-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.07); padding: 22px 24px; min-height: 168px; display: flex; flex-direction: column; }
.scdash .con-ic { width: 50px; height: 50px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.scdash .con-head { display: flex; align-items: center; gap: 16px; }
.scdash .con-label { font-size: 15px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--sc-text-2); }
.scdash .con-val { font-size: 42px; font-weight: 700; color: var(--sc-dark); margin-top: 18px; line-height: 1; }
.scdash .con-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; }
.scdash .delta-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--sc-orange-sf); color: var(--sc-orange); }
.scdash .con-note { font-size: 14px; color: var(--sc-text-2); }
.scdash .link-soft { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--sc-blue-dk); background: #EAF1FA; border: none; padding: 8px 12px; border-radius: 6px; }
.scdash .con-filters { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--sc-border); }
.scdash .cf-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.scdash .cf-field { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border: 1px solid var(--sc-border-2); border-radius: 8px; font-size: 14px; }
.scdash .cf-field.grow { flex: 1; min-width: 200px; color: var(--sc-muted); }
.scdash .toggle-um { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--sc-blue); }
.scdash .toggle-um button { height: 50px; padding: 0 18px; border: none; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--sc-blue-dk); }
.scdash .toggle-um button.on { background: var(--sc-blue); color: #fff; }
.scdash .btn-outline { display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 20px; border-radius: 8px; font-size: 15px; font-weight: 600; background: #fff; color: var(--sc-blue-dk); border: 1px solid var(--sc-blue); }
.scdash .con-legend { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.scdash .lg-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #fff; padding: 5px 12px; border-radius: 6px; }
.scdash .lg-pill .d { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.5); }
.scdash .lg-amber { background: var(--sc-amber); } .scdash .lg-orange { background: var(--sc-orange); }
.scdash tr.row-system td { background: #FCF6E3; } .scdash tr.row-sup td { background: #F1ECFA; }
.scdash .warn-badge { display: inline-flex; align-items: center; gap: 5px; }
.scdash .warn-ic { width: 28px; height: 28px; border-radius: 6px; background: var(--sc-amber); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.scdash .warn-count { width: 26px; height: 26px; border-radius: 6px; background: #E8a200; color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.scdash .pac-input { width: 120px; height: 40px; border: 1px solid var(--sc-border-2); border-radius: 6px; padding: 0 12px; font-size: 14px; color: var(--sc-muted); display: inline-flex; align-items: center; }
.scdash .op-btn { width: 34px; height: 34px; border: none; background: transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--sc-blue); }
.scdash .brand-crumb { margin-left: auto; font-size: 14px; color: var(--sc-text-2); display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

/* temperature */
.scdash .th-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.scdash .th-sel { display: flex; align-items: center; justify-content: space-between; min-width: 230px; height: 52px; padding: 0 18px; border: 1px solid var(--sc-border-2); border-radius: 8px; font-size: 16px; font-weight: 500; }
.scdash .seg { display: inline-flex; border: 1px solid var(--sc-border-2); border-radius: 8px; overflow: hidden; }
.scdash .seg button { height: 52px; padding: 0 20px; border: none; background: #fff; font-size: 15px; font-weight: 600; color: var(--sc-blue); border-right: 1px solid var(--sc-border-2); }
.scdash .seg button:last-child { border-right: none; }
.scdash .seg button.on { background: var(--sc-blue); color: #fff; }
.scdash .th-note { color: var(--sc-text-2); font-size: 14px; margin: 16px 4px 4px; }
.scdash .th-chart-title { color: var(--sc-muted); font-size: 17px; margin: 4px 4px 10px; }
.scdash .legend { display: flex; gap: 18px; flex-wrap: wrap; }
.scdash .legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.scdash .legend .lg i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* enter animation (fade-up, staggered via --d) */
.scdash .fade-up { opacity: 0; transform: translateY(12px); }
/* first paint: no entry animation — everything visible at once */
.scdash .screen.no-anim .fade-up { transition: none !important; transition-delay: 0ms !important; }
.scdash .screen.no-anim svg path.draw, .scdash .screen.no-anim svg path.dash { transition: none !important; }
.scdash .screen.no-anim .hbar, .scdash .screen.no-anim .vbar { transition: none !important; }
.scdash .screen.in .fade-up { opacity: 1; transform: none; transition: opacity .5s ease, transform .55s cubic-bezier(.16,1,.3,1); transition-delay: var(--d, 0ms); }
.scdash .screen { transition: opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1); }
.scdash svg path.draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.scdash .screen.in svg path.draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s ease; transition-delay: var(--d, 0ms); }
.scdash .screen.in svg path.dash { opacity: 1 !important; transition: opacity .9s ease; transition-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  .scdash .fade-up { opacity: 1 !important; transform: none !important; }
  .scdash .hbar, .scdash .vbar { transition: none !important; }
  .scdash .screen.in svg path.draw { stroke-dashoffset: 0; transition: none; }
}

/* scaler root (scaled to fit the frame width) */
.scdash[data-dash-root] { transform-origin: top left; }
