:root{
  --bg:#0f172a;
  --panel:#111827;
  --card:#0b1220;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --border:rgba(148,163,184,.15);
}

*{box-sizing:border-box}
body{
  background: radial-gradient(1200px 600px at 20% 0%, rgba(59,130,246,.15), transparent 60%),
              radial-gradient(1200px 600px at 80% 20%, rgba(245,158,11,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

/* ===== App Layout ===== */
.layout{display:flex; min-height:100vh;}
.sidebar{
  width:270px;
  background: rgba(17,24,39,.75);
  border-right:1px solid var(--border);
  backdrop-filter: blur(10px);
  padding:18px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand{display:flex; gap:12px; align-items:center;}
.brand-badge{
  width:42px; height:42px; border-radius:12px;
  display:grid; place-items:center;
  background: rgba(59,130,246,.18);
  border:1px solid var(--border);
}
.brand-title{font-weight:900; letter-spacing:-.02em;}
.brand-sub{font-size:12px; color:var(--muted);}

.nav-link{
  color:rgba(229,231,235,.85);
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:6px;
}
.nav-link:hover{background:rgba(148,163,184,.08); color:var(--text);}
.nav-link.active{background:rgba(59,130,246,.18); border:1px solid var(--border);}

.sidebar-footer{
  margin-top:auto;
  padding-top:14px;
  border-top:1px solid var(--border);
  position:absolute;
  left:18px;
  right:18px;
  bottom:18px;
}

.avatar{
  width:36px; height:36px; border-radius:12px;
  display:grid; place-items:center;
  background: rgba(148,163,184,.12);
  border:1px solid var(--border);
  font-weight:800;
}

.main{
  flex:1;
  padding:20px 20px 40px;
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; margin-bottom:14px;
}
.page-title{font-size:28px; font-weight:900; letter-spacing:-.02em;}
.page-sub{color:var(--muted); font-size:14px;}

/* ===== Cards / Widgets ===== */
.cardx{
  background: rgba(11,18,32,.75);
  border:1px solid var(--border);
  border-radius:16px;
  backdrop-filter: blur(10px);
}
.cardx-body{padding:16px;}

.label{
  font-size:12px;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:var(--muted);
}

.hr{border-color:var(--border); opacity:1;}

.kpi{
  font-size:42px;
  font-weight:900;
  letter-spacing:-.04em;
  line-height:1.1;
}

.badge-soft{
  background: rgba(148,163,184,.12);
  border:1px solid var(--border);
  color: rgba(229,231,235,.9);
  padding:.5rem .6rem;
  border-radius:999px;
}

.status-pill{
  display:inline-flex; align-items:center;
  padding:8px 12px; border-radius:999px;
  font-weight:900; letter-spacing:.02em;
  margin-top:6px;
  border:1px solid var(--border);
}
.pill-safe{background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.25);}
.pill-alert{background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.25);}
.pill-danger{background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.25);}
.pill-unknown{background: rgba(148,163,184,.12);}

.meter{
  height:10px;
  background: rgba(148,163,184,.10);
  border:1px solid var(--border);
  border-radius:999px;
  overflow:hidden;
}
.meter-fill{
  height:100%;
  background: rgba(59,130,246,.55);
}

.action-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.action-tile{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: rgba(148,163,184,.06);
}
.tile-top{display:flex; align-items:center; gap:10px;}
.tile-icon{
  width:34px; height:34px; border-radius:12px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  background: rgba(148,163,184,.08);
}
.tile-title{font-weight:900;}
.tile-value{font-size:18px; font-weight:900; margin-top:6px;}
.tile-actions{display:flex; gap:8px; margin-top:10px;}

.table{color:rgba(229,231,235,.92);}
thead{color:rgba(148,163,184,.9);}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.widget{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: rgba(148,163,184,.06);
}

.status-light{
  width:18px; height:18px; border-radius:999px;
  border:1px solid var(--border);
  background: rgba(148,163,184,.18);
  box-shadow: none;
}
.status-light.safe{ background: rgba(34,197,94,.18); }
.status-light.alert{ background: rgba(245,158,11,.18); }
.status-light.danger{ background: rgba(239,68,68,.18); }

.status-light.on.safe{ box-shadow: 0 0 0 6px rgba(34,197,94,.10), 0 0 18px rgba(34,197,94,.35); }
.status-light.on.alert{ box-shadow: 0 0 0 6px rgba(245,158,11,.10), 0 0 18px rgba(245,158,11,.35); }
.status-light.on.danger{ box-shadow: 0 0 0 6px rgba(239,68,68,.10), 0 0 18px rgba(239,68,68,.35); }

.light-wrap{ display:flex; flex-direction:column; align-items:center; }
.chart-wrap{ width:100%; }

/* ===== Auth (Login/Register) – Mobile-first ===== */
.auth-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  background:
    radial-gradient(1200px 700px at 20% 30%, rgba(40,120,255,.28), transparent 60%),
    linear-gradient(135deg, #060b1c 0%, #0a1230 55%, #070a12 100%);
}

.auth-card{
  width: 100%;
  max-width: 420px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10, 16, 32, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.auth-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom: 14px;
}

.auth-brand-badge{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
}

.auth-brand-title{
  color:#fff;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.1;
}

.auth-brand-subtitle{
  color: rgba(255,255,255,.68);
  font-size: .95rem;
  margin-top: 2px;
}

.auth-label{
  color: rgba(255,255,255,.78);
  font-weight: 600;
  font-size: .92rem;
}

.auth-input{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 11px 12px;
}

.auth-input:focus{
  border-color: rgba(40,120,255,.65);
  box-shadow: 0 0 0 .2rem rgba(40,120,255,.25);
}

.auth-btn{
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
}

/* Google button container sizing */
.g_id_signin{
  width: 100% !important;
}
/* ===== Auth alignment fixes ===== */

.auth-head-center{
  justify-content: center;
  text-align: center;
}

.auth-head-center .auth-brand-badge{
  margin: 0 auto;
}

.auth-divider{
  position: relative;
  text-align: center;
  margin: 14px 0 12px;
}

.auth-divider::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:50%;
  height:1px;
  background: rgba(255,255,255,.10);
}

.auth-divider span{
  position: relative;
  display:inline-block;
  padding: 0 10px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  background: rgba(10,16,32,.72);
}

.google-wrap{
  width: 100%;
  display: flex;
  justify-content: center;
}

.g_id_signin{
  width: 100% !important;
  display:flex !important;
  justify-content:center !important;
}
/* ===== Collapsible Sidebar ===== */

.layout{
  position: relative;
}

/* desktop collapsed width */
.sidebar{
  transition: width .18s ease, transform .18s ease, opacity .18s ease;
}

/* when collapsed (desktop) */
.layout.sidebar-collapsed .sidebar{
  width: 86px;
}

/* hide text labels when collapsed */
.layout.sidebar-collapsed .brand-text,
.layout.sidebar-collapsed .nav-link span,
.layout.sidebar-collapsed .sidebar-footer .small,
.layout.sidebar-collapsed .sidebar-footer .fw-semibold,
.layout.sidebar-collapsed .sidebar-footer .text-muted.small,
.layout.sidebar-collapsed .sidebar-footer .btn span{
  display:none !important;
}

/* center icons when collapsed */
.layout.sidebar-collapsed .nav-link{
  display:flex;
  justify-content:center;
  padding:12px 10px;
}
.layout.sidebar-collapsed .nav-link i{
  margin-right:0 !important;
  font-size:1.1rem;
}

/* avatar + brand look in collapsed */
.layout.sidebar-collapsed .brand{
  justify-content:center;
}
.layout.sidebar-collapsed .brand-badge{
  width:46px;height:46px;
}
.layout.sidebar-collapsed .sidebar-footer{
  left:12px; right:12px;
}
.layout.sidebar-collapsed .avatar{
  margin: 0 auto;
}

/* main area transitions nicely */
.main{
  transition: padding-left .18s ease;
}
/* ===== Mobile: sidebar becomes hamburger drawer ===== */
@media (max-width: 991.98px){
  /* hide sidebar by default */
  .sidebar{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 270px;
    z-index: 999;
    transform: translateX(-110%);
    transition: transform .2s ease;
  }

  /* open drawer */
  .layout.sidebar-open .sidebar{
    transform: translateX(0);
  }

  /* overlay behind drawer */
  .sidebar-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 998;
  }

  .layout.sidebar-open .sidebar-overlay{
    opacity: 1;
    pointer-events: auto;
  }

  /* make main full width (no reserved space) */
  .main{
    padding: 16px 14px 40px;
  }

  /* remove sticky desktop behavior */
  .sidebar{
    height: 100vh;
  }
}/* Example CSS for fan and valve animations */
.fan-on-animation {
  animation: fanOnAnimation 1s forwards;
}

.valve-open-animation {
  animation: valveOpenAnimation 1s forwards;
}

/* Define the animations (can adjust styles as needed) */
@keyframes fanOnAnimation {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.1); opacity: 1; }
}

@keyframes valveOpenAnimation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}