:root{
  --bg:#f6f8fb;
  --panel:#ffffff;
  --panel2:#fbfcfe;
  --text:#0f172a;
  --muted:#64748b;
  --stroke:#e5eaf2;
  --shadow: 0 12px 30px rgba(15,23,42,.08);
  --shadow2: 0 10px 22px rgba(15,23,42,.06);
  --radius:18px;
  --radius2:24px;

  /* Accent “santé” (teal doux) */
  --accent:#0ea5a4;
  --accent2:#22c1b7;

  /* États */
  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#ef4444;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(14,165,164,.10), transparent 60%),
    radial-gradient(800px 600px at 90% 0%, rgba(56,189,248,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), #eef3f8);
}

a{color:inherit; text-decoration:none}
h1,h2,h3{margin:0}
small{color:var(--muted)}
hr{border:none; border-top:1px solid var(--stroke); margin:16px 0}


.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e8f5f3; /* très léger */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.app-title {
  font-weight: 900;
  font-size: 18px;
}
.app-sub {
  font-size: 13px;
  color: var(--muted);
}


.sidebarFooter {
  padding: 16px;
  border-top: 1px solid var(--stroke);
}

.userCard {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.userName {
  font-weight: 800;
  line-height: 1.2;
}

.userRole {
  font-size: 13px;
  color: var(--muted);
}

.privacy {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}


.app{
  display:grid;
  grid-template-columns: 300px 1fr;
  min-height:100vh;
}


.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search input {
  width: 260px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--card);
}

.searchResults {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  z-index: 1000;
  max-height: 360px;
  overflow-y: auto;
}

.searchResults a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}

.searchResults a:hover {
  background: rgba(0,0,0,.04);
}

/* Sidebar */
.sidebar{
  position:sticky; top:0; align-self:start;
  height:100vh;
  padding:18px;
  border-right:1px solid var(--stroke);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex; gap:12px; align-items:center;
  padding:12px 12px;
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow2);
}
.brandMark{
  width:42px; height:42px; border-radius:14px;
  background: radial-gradient(circle at 30% 30%, rgba(34,193,183,.95), rgba(14,165,164,.9));
  box-shadow: 0 12px 24px rgba(14,165,164,.20);
  position:relative;
}
.brandMark:after{
  content:"";
  position:absolute; inset:11px;
  border-radius:10px;
  background: rgba(255,255,255,.55);
}
.brandTitle{font-weight:900; letter-spacing:.2px}
.brandSub{font-size:12px; color:var(--muted); margin-top:2px}

.nav{
  margin-top:16px;
  display:flex; flex-direction:column; gap:8px;
}
.nav a{
  display:flex; align-items:center; gap:10px;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  color: var(--muted);
}
.nav a:hover{
  background: rgba(14,165,164,.06);
  border-color: rgba(14,165,164,.14);
  color: var(--text);
}
.nav a.active{
  background: rgba(14,165,164,.10);
  border-color: rgba(14,165,164,.22);
  color: var(--text);
}
.badge{
  margin-left:auto;
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: #fff;
  color: var(--muted);
}

.sidebarFooter{
  margin-top:auto;
  padding-top:14px;
}
.userCard{
  display:flex; gap:12px; align-items:center;
  padding:12px;
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow2);
}
.avatar{
  width:38px; height:38px; border-radius:14px;
  background: linear-gradient(180deg, #f1f5f9, #e8eef7);
  border:1px solid var(--stroke);
}
.userName{font-weight:900; font-size:14px}
.userRole{font-size:12px; color:var(--muted)}
.privacy{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
  line-height:1.35;
}

/* Main */
.main{padding:18px 18px 28px}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-radius: var(--radius2);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.titleBlock .title{
  font-weight:950;
  font-size:18px;
}
.titleBlock .subtitle{
  color:var(--muted);
  font-size:13px;
  margin-top:2px;
}

.search{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: #fff;
  min-width: 280px;
}
.search input{
  width:100%;
  border:0;
  outline:none;
  background:transparent;
  color:var(--text);
}

.actions{display:flex; gap:10px; align-items:center}
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: #fff;
  cursor:pointer;
  box-shadow: 0 6px 14px rgba(15,23,42,.06);
}
.btn:hover{transform: translateY(-1px)}
.btn.primary{
  border-color: rgba(14,165,164,.28);
  background: linear-gradient(90deg, rgba(14,165,164,.12), rgba(255,255,255,.85));
}

.grid{
  margin-top:16px;
  display:grid;
  grid-template-columns: 1.25fr .9fr;
  gap:16px;
}

.card{
  padding:16px;
  border-radius: var(--radius2);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.cardHeader{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.cardTitle{font-weight:950}
.cardMeta{color:var(--muted); font-size:13px}

.kpis{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.kpi{
  padding:14px;
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow2);
}
.kpi .label{color:var(--muted); font-size:12px}
.kpi .value{font-size:22px; font-weight:950; margin-top:6px}
.kpi .hint{color:var(--muted); font-size:12px; margin-top:4px}

.row{
  border:1px solid var(--stroke);
  background:#fff;
  border-radius: var(--radius);
  padding:12px;
  box-shadow: var(--shadow2);
}
.pill{
  display:inline-flex;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--stroke);
  color: var(--muted);
  background:#fff;
}
.pill.ok{border-color: rgba(22,163,74,.25); color: var(--ok)}
.pill.warn{border-color: rgba(245,158,11,.25); color: var(--warn)}
.pill.bad{border-color: rgba(239,68,68,.25); color: var(--bad)}

.spark{
  width:100%;
  height:56px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.footerNote{margin-top:14px; color:var(--muted); font-size:12px}

@media (max-width: 980px){
  .app{grid-template-columns: 1fr}
  .sidebar{height:auto; position:relative; border-right:0; border-bottom:1px solid var(--stroke)}
  .grid{grid-template-columns: 1fr}
  .kpis{grid-template-columns: 1fr}
  .topbar{flex-wrap:wrap}
  .search{min-width: 0; flex:1}
}


/* ==========================================================
   Apple Health Layout – Adaptation layout v2
   ========================================================== */

.health-app{
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.health-sidebar{
  width:300px;
  padding:18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border-right:1px solid var(--stroke);
  display:flex;
  flex-direction:column;
}

/* Reprise de l'ancien style sidebar */
.health-sidebar .brand,
.health-sidebar .nav,
.health-sidebar .sidebarFooter{
  width:100%;
}

/* Main area */
.health-main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

/* Header Apple-like */
.health-header{
  position:sticky;
  top:0;
  z-index:20;
  padding:18px;
  background: rgba(246,248,251,.75);
  backdrop-filter: blur(14px);
}

/* Le header existant garde son style */
.health-header .topbar{
  box-shadow: var(--shadow);
}

/* Contenu scrollable */
.health-content{
  flex:1;
  padding:18px 18px 28px;
  max-width:1200px;
}

/* Mobile */
@media (max-width: 980px){
  .health-app{
    flex-direction:column;
  }

  .health-sidebar{
    width:100%;
    border-right:0;
    border-bottom:1px solid var(--stroke);
  }

  .health-content{
    padding:14px;
  }
}
