:root{
  --bg0:#0b1220;
  --bg1:#0f1a2e;
  --card: rgba(15,26,46,.78);
  --card2: rgba(9,14,26,.55);
  --stroke:rgba(148,163,184,.18);
  --text:#e5e7eb;
  --muted:#94a3b8;

  --brand:#38bdf8;      /* medical blue */
  --brand2:#6366f1;     /* indigo */
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;

  --radius:18px;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
}

.bg-app{
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(56,189,248,.18), transparent 55%),
    radial-gradient(1000px 700px at 90% 0%, rgba(99,102,241,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), #050815 60%);
  color: var(--text);
}

.app-shell{ display:flex; min-height:100vh; }

/* ---- Sidebar ---- */
.sidebar{
  width: 290px;
  flex: 0 0 290px;
  background: rgba(15,26,46,.86);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--stroke);
  position: sticky; top:0; height:100vh; overflow:auto;
}

.brand{
  border-bottom: 1px solid var(--stroke);
}
.brand .logo{
  width:42px; height:42px; border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(56,189,248,.92), rgba(99,102,241,.88));
  box-shadow: var(--shadow);
  font-weight: 900;
  letter-spacing: .02em;
}
.brand .sub{ color: var(--muted); font-size:.82rem; }

.nav-section{
  margin: .85rem .75rem .35rem;
  color: rgba(148,163,184,.9);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.nav-link{
  color: rgba(226,232,240,.86);
  border-radius: 14px;
  padding: .62rem .75rem;
  margin: .1rem .45rem;
  display:flex;
  align-items:center;
  gap:.6rem;
  transition: .15s ease;
}
.nav-link .ico{
  width: 24px;
  height: 24px;
  display:grid;
  place-items:center;
  border-radius: 10px;
  background: rgba(148,163,184,.08);
  border: 1px solid rgba(148,163,184,.12);
}
.nav-link:hover{
  background: rgba(56,189,248,.10);
  color: #fff;
}
.nav-link.active{
  background: linear-gradient(135deg, rgba(56,189,248,.20), rgba(99,102,241,.12));
  border: 1px solid rgba(56,189,248,.22);
  color: #fff;
}
.nav-link.active .ico{
  background: rgba(56,189,248,.16);
  border-color: rgba(56,189,248,.25);
}

/* Mobile sidebar */
@media (max-width: 991px){
  .sidebar{ position: fixed; left: 0; top: 0; transform: translateX(-102%); z-index: 50; }
  .sidebar.show{ transform: translateX(0); transition: transform .2s ease; }
  .backdrop{
    display:none;
    position: fixed; inset:0; background: rgba(0,0,0,.55); z-index:49;
  }
  .backdrop.show{ display:block; }
}

/* ---- Main & Topbar ---- */
.main{ flex:1; min-width:0; }

.topbar{
  position: sticky; top:0; z-index:20;
  background: rgba(11,18,32,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}
.topbar .title{ font-weight: 800; letter-spacing: -0.02em; }
.topbar .meta{ color: var(--muted); font-size:.85rem; }

.content{ min-height: calc(100vh - 70px); }

.cardx{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0,0,0,.22);
}

/* KPI cards */
.kpi{
  display:flex; align-items:center; justify-content:space-between;
}
.kpi .left{ display:flex; gap:.8rem; align-items:center; }
.kpi .kico{
  width:44px; height:44px; border-radius: 16px;
  display:grid; place-items:center;
  background: rgba(56,189,248,.10);
  border:1px solid rgba(56,189,248,.18);
}
.kpi .num{ font-size: 1.8rem; font-weight: 900; letter-spacing: -0.02em; }
.kpi .lbl{ color: var(--muted); font-size: .86rem; }

.badge-soft{
  background: rgba(56,189,248,.12);
  border:1px solid rgba(56,189,248,.22);
  color:#e2f4ff;
  border-radius: 999px;
}

/* Controls */
.form-control,.form-select{
  border-radius: 14px;
  border-color: var(--stroke);
  background: rgba(2,6,23,.35);
  color: var(--text);
}
.btn{ border-radius: 14px; }

/* Tables */
.table{ --bs-table-bg: transparent; }
.table thead th{
  position: sticky;
  top: 0;
  background: rgba(15,26,46,.96);
  border-bottom: 1px solid var(--stroke);
}
.table tbody tr:hover{
  background: rgba(56,189,248,.06);
}
