/* ===== Pied Piper — styles de l'app (auth + dashboard) ===== */

/* --- Page d'authentification --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(79, 70, 229, 0.14), transparent),
    var(--bg-soft);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.auth-card .logo { justify-content: center; margin-bottom: 24px; }
.auth-tabs {
  display: flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 26px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }
.auth-foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--primary); font-weight: 600; }
.hidden { display: none !important; }

/* --- Dashboard --- */
.app-shell { display: flex; min-height: 100vh; background: var(--bg-soft); }

.sidebar {
  width: 232px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.sidebar .logo { padding: 0 10px; margin-bottom: 22px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.side-link:hover { background: var(--bg-soft); color: var(--ink); }
.side-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar .spacer { flex: 1; }
@media (max-width: 900px) { .sidebar { display: none; } }

.app-main { flex: 1; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-email { font-size: 14px; font-weight: 600; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  padding: 8px 16px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.logout-btn:hover { background: var(--bg-soft); border-color: #cbd5e1; }

.app-content { padding: 28px; max-width: 1200px; }

.welcome-banner {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  color: var(--primary-dark);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 24px;
}

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.kpi .kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.kpi .kpi-delta { font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.kpi .kpi-delta.up { color: var(--success); }
.kpi .kpi-delta.down { color: var(--danger); }

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15.5px; font-weight: 700; }
.panel-head span { font-size: 13px; color: var(--muted); }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 18px 20px; }
@media (max-width: 1000px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
.pipe-col-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}
.deal {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 9px;
}
.deal b { display: block; font-size: 13.5px; }
.deal span { font-size: 12.5px; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left;
  padding: 11px 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
table.data td { padding: 13px 20px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.badge.green { background: #dcfce7; color: #15803d; }
.badge.blue { background: var(--primary-light); color: var(--primary); }
.badge.amber { background: #fef3c7; color: #b45309; }

.upgrade-banner {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: var(--radius);
  padding: 26px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.upgrade-banner h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.upgrade-banner p { font-size: 14px; opacity: 0.85; }
.upgrade-banner .btn { background: #fff; color: var(--primary); flex-shrink: 0; }
