
/* =========================================================
   HOME UI REDESIGN V4
   Visual-only layer: preserves existing HTML IDs/classes,
   JS behavior, API calls and navigation.
   ========================================================= */

:root{
  --home-bg:#f6f8fc;
  --home-surface:#ffffff;
  --home-text:#172033;
  --home-muted:#718096;
  --home-line:#e7ebf2;
  --home-green:#126b55;
  --home-green-2:#1b876c;
  --home-green-soft:#eaf7f2;
  --home-shadow:0 12px 35px rgba(20,35,55,.07);
  --home-shadow-hover:0 18px 44px rgba(20,35,55,.12);
  --home-radius:20px;
}

html,body{
  background:var(--home-bg)!important;
}

body{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;
}

/* ---------- App shell ---------- */
.content{
  background:
    radial-gradient(circle at 88% 4%, rgba(34,197,145,.055), transparent 28%),
    var(--home-bg)!important;
  padding:30px!important;
}

#dashboardPage{
  max-width:1500px;
  margin:0 auto;
}

/* ---------- Welcome header ---------- */
.welcome-head{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:20px!important;
  margin:0 0 24px!important;
  padding:2px 2px 0!important;
}

.welcome-head h1{
  margin:0!important;
  font-size:30px!important;
  line-height:1.15!important;
  letter-spacing:-.045em!important;
  font-weight:850!important;
  color:#142033!important;
}

.welcome-head h1 span{
  color:var(--home-green)!important;
}

.welcome-head p{
  margin:9px 0 0!important;
  color:var(--home-muted)!important;
  font-size:14px!important;
}

.head-line{
  display:none!important;
}

.status{
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  height:34px!important;
  padding:0 13px!important;
  border-radius:999px!important;
  border:1px solid #d9eee6!important;
  background:#f0faf6!important;
  color:#137456!important;
  font-size:12px!important;
  font-weight:800!important;
  box-shadow:0 4px 14px rgba(18,107,85,.06)!important;
}

.status::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#20b486;
  box-shadow:0 0 0 4px rgba(32,180,134,.12);
}

/* ---------- Summary cards ---------- */
.summary-grid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:16px!important;
  margin-bottom:18px!important;
}

.summary-card{
  position:relative!important;
  min-height:152px!important;
  padding:20px!important;
  overflow:hidden!important;
  border:1px solid var(--home-line)!important;
  border-radius:var(--home-radius)!important;
  background:var(--home-surface)!important;
  box-shadow:var(--home-shadow)!important;
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease!important;
}

.summary-card:hover{
  transform:translateY(-4px)!important;
  box-shadow:var(--home-shadow-hover)!important;
  border-color:#d8e1ea!important;
}

.summary-card::after{
  content:"";
  position:absolute;
  width:90px;
  height:90px;
  right:-34px;
  top:-38px;
  border-radius:50%;
  background:currentColor;
  opacity:.045;
}

.summary-card.blue{color:#2b78d4!important}
.summary-card.amber{color:#c58a22!important}
.summary-card.green{color:#17866a!important}
.summary-card.purple{color:#7657bd!important}
.summary-card.red{color:#c45668!important}

.card-top{
  display:grid!important;
  grid-template-columns:38px 1fr!important;
  grid-template-rows:auto auto!important;
  column-gap:11px!important;
  align-items:center!important;
}

.summary-icon{
  grid-row:1 / span 2!important;
  width:38px!important;
  height:38px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:12px!important;
  background:currentColor!important;
  color:#fff!important;
  font-size:16px!important;
  font-weight:800!important;
  box-shadow:0 7px 16px rgba(20,35,55,.10)!important;
}

.card-top > span:not(.summary-icon){
  color:#69788a!important;
  font-size:12px!important;
  font-weight:750!important;
  letter-spacing:.01em!important;
}

.card-top strong{
  margin-top:2px!important;
  color:#162033!important;
  font-size:22px!important;
  line-height:1.1!important;
  letter-spacing:-.035em!important;
  font-weight:850!important;
}

.card-bottom{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin-top:25px!important;
}

.card-bottom small{
  color:#8995a4!important;
  font-size:11px!important;
}

.card-bottom em{
  font-style:normal!important;
  color:#238264!important;
  font-size:10px!important;
  font-weight:800!important;
  white-space:nowrap!important;
}

.card-bottom em.neutral{
  color:#8b95a2!important;
}

.accent-line{
  position:absolute!important;
  left:20px!important;
  right:20px!important;
  bottom:0!important;
  height:3px!important;
  border-radius:5px 5px 0 0!important;
  background:currentColor!important;
  opacity:.65!important;
}

/* ---------- Analytics + overview ---------- */
.double-row{
  display:grid!important;
  grid-template-columns:minmax(0,1.75fr) minmax(300px,.9fr)!important;
  gap:18px!important;
  margin-bottom:18px!important;
}

.wide-card,
.quick-links-card{
  background:var(--home-surface)!important;
  border:1px solid var(--home-line)!important;
  border-radius:var(--home-radius)!important;
  box-shadow:var(--home-shadow)!important;
}

.wide-card{
  min-height:330px!important;
  padding:21px!important;
}

.wide-head{
  display:flex!important;
  align-items:center!important;
  gap:11px!important;
  min-height:36px!important;
}

.wide-head strong{
  color:#172033!important;
  font-size:14px!important;
  font-weight:820!important;
  letter-spacing:-.01em!important;
}

.wide-icon{
  width:34px!important;
  height:34px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:11px!important;
  font-weight:800!important;
  font-size:14px!important;
}

.green-icon{
  background:#eaf7f2!important;
  color:#15785f!important;
}

.blue-icon{
  background:#edf4ff!important;
  color:#3979cf!important;
}

.link-icon{
  background:#f0f7f4!important;
  color:#176f58!important;
}

.pill{
  margin-left:auto!important;
  padding:6px 10px!important;
  border:1px solid #e3e9ef!important;
  background:#f8fafc!important;
  border-radius:999px!important;
  color:#7b8795!important;
  font-size:10px!important;
  font-weight:750!important;
}

.chart-wrap{
  height:255px!important;
  margin-top:12px!important;
}

.quick-panel{
  padding-bottom:15px!important;
}

.overview-row{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  padding:16px 2px!important;
  border-bottom:1px solid #eef1f5!important;
}

.overview-row:last-child{
  border-bottom:0!important;
}

.overview-row span{
  color:#7b8795!important;
  font-size:12px!important;
}

.overview-row strong{
  color:#182234!important;
  font-size:13px!important;
  font-weight:800!important;
  text-align:right!important;
}

.overview-row strong.online{
  color:#16805f!important;
}

/* ---------- Quick links ---------- */
.quick-links-card{
  padding:20px 21px!important;
}

.quick-links{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:11px!important;
  margin-top:14px!important;
}

.quick-links button{
  min-height:52px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  border:1px solid #e4eaf0!important;
  border-radius:13px!important;
  background:#fbfcfd!important;
  color:#536274!important;
  font-size:12px!important;
  font-weight:760!important;
  transition:all .2s ease!important;
}

.quick-links button span{
  color:var(--home-green)!important;
  font-size:15px!important;
}

.quick-links button:hover{
  transform:translateY(-2px)!important;
  background:#f2faf7!important;
  border-color:#cce6dc!important;
  color:#126b55!important;
  box-shadow:0 8px 20px rgba(18,107,85,.08)!important;
}

/* ---------- Keep non-home pages clean but consistent ---------- */
.page-head{
  margin-bottom:20px!important;
}

.page-head h1{
  letter-spacing:-.035em!important;
}

.panel{
  border-radius:18px!important;
  border:1px solid var(--home-line)!important;
  box-shadow:var(--home-shadow)!important;
}

/* ---------- Responsive ---------- */
@media (max-width:1200px){
  .summary-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .double-row{
    grid-template-columns:1fr!important;
  }
}

@media (max-width:800px){
  .content{
    padding:20px!important;
  }
  .welcome-head{
    align-items:flex-start!important;
  }
  .welcome-head h1{
    font-size:25px!important;
  }
  .summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .quick-links{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media (max-width:520px){
  .content{
    padding:14px!important;
  }
  .welcome-head{
    flex-direction:column!important;
    margin-bottom:18px!important;
  }
  .summary-grid{
    grid-template-columns:1fr!important;
  }
  .summary-card{
    min-height:140px!important;
  }
  .quick-links{
    grid-template-columns:1fr!important;
  }
  .wide-card{
    padding:16px!important;
  }
}
