/* Leza Analytics — design glassmorphism sombre */
:root {
  --bg-1: #0d0d1a;
  --bg-2: #14142b;
  --accent-1: #e879f9; /* rose néon */
  --accent-2: #38bdf8; /* bleu ciel */
  --accent-3: #34d399; /* vert menthe */
  --text: #f1f5f9;
  --muted: rgba(241, 245, 249, .6);
  --glass-bg: rgba(255, 255, 255, .06);
  --glass-border: rgba(255, 255, 255, .12);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, var(--bg-2), var(--bg-1) 60%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 80% 10%, rgba(232, 121, 249, .12), transparent 60%),
    radial-gradient(500px 400px at 10% 80%, rgba(56, 189, 248, .10), transparent 60%);
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}

/* ---------- login ---------- */
.login-body {
  display: grid; place-items: center; padding: 24px;
}
.login-card {
  max-width: 420px; width: 100%; padding: 44px 36px; text-align: center;
}
.login-card .logo { font-size: 1.4rem; font-weight: 700; margin-bottom: 18px; }
.login-card h1 { font-size: 1.7rem; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: .95rem; margin-bottom: 24px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 18px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 600; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(56, 189, 248, .35); }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 12px; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 12px auto 0; padding: 14px 22px;
}
.brand { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; gap: 10px; align-items: center; }

.btn-ghost {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--glass-border);
  background: transparent; color: var(--text); cursor: pointer; font-size: .85rem;
  transition: background .15s ease;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }

.badge-demo {
  padding: 5px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(251, 191, 36, .15); border: 1px solid rgba(251, 191, 36, .5); color: #fbbf24;
}

.container { max-width: 1200px; margin: 24px auto 60px; padding: 0 16px; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
  margin-bottom: 22px;
}
.kpi-card { padding: 22px; position: relative; overflow: hidden; }
.kpi-card::after {
  content: ""; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(232, 121, 249, .18), transparent 70%);
}
.kpi-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.kpi-value {
  font-size: 2.1rem; font-weight: 800; margin: 6px 0 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi-sub { color: var(--muted); font-size: .8rem; }

/* ---------- panels ---------- */
.panel { padding: 22px; margin-bottom: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { font-size: 1.05rem; font-weight: 600; }
.chart-wrap { position: relative; height: 300px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.select {
  background: rgba(255, 255, 255, .08); color: var(--text);
  border: 1px solid var(--glass-border); border-radius: 10px; padding: 8px 12px; font-size: .85rem;
}

/* ---------- heatmap ---------- */
.heatmap {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.hm-cell {
  aspect-ratio: 1; border-radius: 6px; background: rgba(255, 255, 255, .04);
  transition: transform .15s ease;
}
.hm-cell:hover { transform: scale(1.15); }
.hm-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.hm-days span { font-size: .62rem; color: var(--muted); text-align: center; }

/* ---------- posts ---------- */
.post-list { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.post-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
}
.post-badge {
  font-size: .62rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(56, 189, 248, .15); color: var(--accent-2); white-space: nowrap;
}
.post-meta { flex: 1; min-width: 0; }
.post-caption { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-stats { font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* ---------- recommandations ---------- */
.reco-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.reco-card {
  padding: 18px; border-radius: 14px; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}
.reco-card .reco-icon { font-size: 1.6rem; margin-bottom: 8px; }
.reco-card h3 { font-size: .95rem; margin-bottom: 6px; }
.reco-card p { color: var(--muted); font-size: .83rem; line-height: 1.45; }
.reco-alert { border-color: rgba(251, 113, 133, .4); }
.reco-positive { border-color: rgba(52, 211, 153, .4); }
