/* Ultra Glass Dashboard – Kinneret */

:root{
  --bg0:#070A12;
  --bg1:#0B1222;
  --card: rgba(255,255,255,.08);
  --card2: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.14);
  --text:#EAF1FF;
  --muted: rgba(234,241,255,.72);
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 22px;

  --good:#48ffd2;
  --warn:#ffd86b;
  --bad:#ff6b91;
  --info:#60a5fa;
}

body.light{
  --bg0:#F4F7FF;
  --bg1:#EAF0FF;
  --card: rgba(255,255,255,.72);
  --card2: rgba(255,255,255,.55);
  --border: rgba(0,0,0,.10);
  --text:#0A1633;
  --muted: rgba(10,22,51,.72);
  --shadow: 0 18px 55px rgba(16,32,68,.18);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(96,165,250,.25), transparent 50%),
              radial-gradient(900px 700px at 80% 20%, rgba(34,197,94,.18), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* Background */
.bg{position:fixed; inset:0; z-index:-1; overflow:hidden}
.grid{
  position:absolute; inset:-2px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity:.35;
  transform: perspective(900px) rotateX(65deg) translateY(-220px);
  transform-origin: top;
  filter: blur(.2px);
}
.blob{
  position:absolute; width:560px; height:560px; border-radius:50%;
  filter: blur(50px);
  opacity:.55;
}
.b1{left:-140px; top:-160px; background: radial-gradient(circle at 30% 30%, rgba(59,130,246,.75), transparent 60%)}
.b2{right:-170px; top:120px; background: radial-gradient(circle at 30% 30%, rgba(34,197,94,.55), transparent 62%)}

.wave{
  position:absolute; left:0; right:0; bottom:-90px; height:320px;
  background:
    radial-gradient(900px 160px at 30% 30%, rgba(72,255,210,.18), transparent 60%),
    radial-gradient(900px 160px at 70% 50%, rgba(59,130,246,.18), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 70%);
  clip-path: path("M 0 160 C 220 120 360 220 520 180 C 680 140 820 220 980 170 C 1140 120 1300 220 1440 170 L 1440 360 L 0 360 Z");
  animation: floaty 10s ease-in-out infinite;
  opacity:.9;
}
@keyframes floaty{
  0%,100%{transform: translateY(0px)}
  50%{transform: translateY(18px)}
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 18px 18px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:44px; height:44px; display:grid; place-items:center;
  border-radius:14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  font-size:20px;
}
.title{font-weight:900; letter-spacing:.2px; font-size:18px}
.subtitle{color:var(--muted); font-size:12px; margin-top:2px}

.actions{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:800;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{transform: translateY(-1px)}
.btn:active{transform: translateY(0px)}
.btn.ghost{background: transparent}
.btn.install{border-color: rgba(72,255,210,.35)}
.btn:focus-visible{outline: 3px solid rgba(96,165,250,.35); outline-offset: 2px}

/* Layout */
.container{
  max-width:1180px;
  margin: 0 auto;
  padding: 10px 18px 40px;
}
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  padding: 18px;
}
@media (max-width: 920px){
  .hero{grid-template-columns:1fr}
}

.kpiLabel{color:var(--muted); font-size:13px; font-weight:800}
.kpiValue{
  font-size:58px;
  font-weight:950;
  line-height:1.05;
  margin: 8px 0 10px;
  letter-spacing: .5px;
}
.kpiMeta{display:flex; gap:10px; flex-wrap:wrap}

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight:850;
  font-size:12px;
}

.statusRow{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 640px){
  .statusRow{grid-template-columns:1fr}
}

.cardInner{
  padding: 12px 12px;
  border-radius: 18px;
  background: var(--card2);
  border: 1px solid var(--border);
}
.miniTitle{color:var(--muted); font-size:12px; font-weight:850}
.miniValue{font-size:18px; font-weight:950; margin-top:6px}
.miniHint{color:var(--muted); font-size:12px; font-weight:750; margin-top:6px}

.callouts{display:grid; gap:10px; margin-top: 12px}
.callout{
  display:flex; gap:10px; align-items:flex-start;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px dashed rgba(255,255,255,.18);
}
.dot{width:10px; height:10px; border-radius:999px; margin-top:5px}
.dot.good{background: var(--good)}
.dot.info{background: var(--info)}
.calloutH{font-weight:950}
.calloutP{color:var(--muted); font-weight:750; font-size:13px; margin-top:3px}

/* Gauge */
.gaugeWrap{padding: 12px 10px}
.gaugeHeader{display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap}
.gaugeTitle{font-weight:950}
.gaugeHint{color:var(--muted); font-size:12px; font-weight:850}

.gauge{
  position:relative;
  margin-top: 14px;
  height: 140px;
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
}
.gaugeTrack{
  position:absolute; inset:0;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,.06),
      rgba(255,255,255,.02) 40%,
      rgba(255,255,255,.06));
  opacity:.9;
}
.gaugeZones{position:absolute; inset:0; display:flex; opacity:.6}
.zone{height:100%}
.zUpper{width:18%; background: rgba(255,216,107,.18)}
.zSafe{width:64%; background: rgba(72,255,210,.10)}
.zLower{width:18%; background: rgba(255,107,145,.16)}

.gaugeFill{
  position:absolute; inset:0;
  width: 0%;
  background: linear-gradient(90deg, rgba(72,255,210,.35), rgba(96,165,250,.22));
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.gaugeNeedle{
  position:absolute;
  top:0; bottom:0;
  width:2px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 0 18px rgba(255,255,255,.35);
  left: 0%;
  transform: translateX(-1px);
  transition: left .9s cubic-bezier(.2,.8,.2,1);
}
.gaugeMarks{
  position:absolute; left:12px; right:12px; bottom:10px;
  display:flex; justify-content:space-between;
  color: var(--muted);
  font-size:12px;
  font-weight:900;
}
.note{
  margin-top:10px;
  color: var(--muted);
  font-size:12px;
  font-weight:800;
}

.pwaRow{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top: 12px; flex-wrap:wrap}
.installHint{color: var(--muted); font-weight:750; font-size:12px}

/* Grid 2 */
.grid2{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 920px){
  .grid2{grid-template-columns:1fr}
}

.cardTitle{padding: 16px 16px 0; font-weight:950; font-size:16px}
.cardSub{padding: 6px 16px 0; color: var(--muted); font-size:12px; font-weight:850}

.chartWrap{padding: 12px 12px 4px}
canvas{
  width:100%;
  height:auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.12);
}

.foot{padding: 10px 16px 16px; color: var(--muted); font-weight:850; font-size:12px}

/* Info */
.info{padding: 12px 16px 16px}
.infoItem{display:flex; gap:12px; align-items:flex-start; padding: 10px 0}
.infoIcon{width:34px; height:34px; display:grid; place-items:center; border-radius: 12px; background: var(--card2); border:1px solid var(--border)}
.infoH{font-weight:950}
.infoP{color:var(--muted); font-weight:750; font-size:13px; margin-top:3px}
.divider{height:1px; background: var(--border); margin: 10px 0}
.smallPrint{color:var(--muted); font-size:12px; font-weight:800}

.footer{
  margin-top: 18px;
  text-align:center;
  color: var(--muted);
  font-weight:850;
  font-size:12px;
  padding: 16px 0 8px;
}

/* Toast */
.toastHost{
  position: fixed;
  bottom: 18px;
  left: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  pointer-events: none;
  z-index: 9999;
  max-width: 1180px;
  margin: 0 auto;
}
.toast{
  pointer-events: auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(10,16,28,.72);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  backdrop-filter: blur(14px);
}
body.light .toast{
  background: rgba(255,255,255,.85);
  border-color: rgba(0,0,0,.10);
  box-shadow: 0 18px 50px rgba(16,32,68,.16);
}
.toastMain{display:flex; gap:10px}
.toastIcon{width:34px; height:34px; display:grid; place-items:center; border-radius: 12px; border:1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06)}
body.light .toastIcon{border-color: rgba(0,0,0,.10); background: rgba(0,0,0,.04)}
.toastH{font-weight:950}
.toastP{color: var(--muted); font-weight:800; font-size:13px; margin-top:3px}
.toastClose{
  pointer-events:auto;
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight:900;
  cursor:pointer;
}
body.light .toastClose{border-color: rgba(0,0,0,.10); color: var(--text)}

/* Skeleton */
.skeleton{
  position:relative;
  color: transparent !important;
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.18), rgba(255,255,255,.08));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 12px;
}
@keyframes shimmer{
  0%{background-position: 200% 0}
  100%{background-position: -200% 0}
}


/* Fix minus position in RTL */
.number-ltr{direction:ltr; unicode-bidi:bidi-override; display:inline-block;}

/* Title badge */
.titleRow{display:flex; align-items:center; gap:10px}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  letter-spacing: .6px;
  border: 1px solid rgba(72,255,210,.38);
  background: rgba(72,255,210,.10);
  box-shadow: 0 10px 28px rgba(72,255,210,.10);
}

/* Gauge freshness (color by data age) */
.gauge.fresh { border-color: rgba(72,255,210,.28); }
.gauge.stale { border-color: rgba(255,216,107,.30); }
.gauge.old   { border-color: rgba(255,107,145,.32); }

.gauge.fresh .gaugeFill { background: linear-gradient(90deg, rgba(72,255,210,.40), rgba(96,165,250,.22)); }
.gauge.stale .gaugeFill { background: linear-gradient(90deg, rgba(255,216,107,.34), rgba(96,165,250,.18)); }
.gauge.old   .gaugeFill { background: linear-gradient(90deg, rgba(255,107,145,.34), rgba(96,165,250,.18)); }
