:root {
  --navy: #18374C;
  --orange: #FF9900;
  --bg: #F4F6F8;
  --text: #1F2933;
  --card-bg: #FFFFFF;
  --border: #E1E5EA;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand .accent { color: var(--orange); }

.topbar .logout {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
}

main { max-width: 1100px; margin: 32px auto; padding: 0 20px; }

h1 { color: var(--navy); }

.subtitle a { color: var(--orange); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.card h2 { font-size: 16px; color: var(--navy); margin-top: 0; }

.card ul { list-style: none; padding: 0; margin: 0; }
.card li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.card li:last-child { border-bottom: none; }
.card .date { float: right; color: #8a97a3; font-size: 12px; }

.card .empty { color: #8a97a3; font-size: 14px; }

.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box label { font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.login-box input {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}
.login-box button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.clients-table { width: 100%; border-collapse: collapse; background: #fff; }
.clients-table th, .clients-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.flash {
  background: #FFF3E0;
  border: 1px solid var(--orange);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* --- V2 : bannière stats, badges, audit --- */

.client-header { margin-bottom: 8px; }

.stat-banner {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 20px 28px;
  margin: 20px 0 4px;
  flex-wrap: wrap;
  position: relative;
}

.stat-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: #dbe4ec;
  line-height: 1.3;
}

.stat-sub { color: #9fb2c2; }

.stat-date {
  margin-left: auto;
  font-size: 12px;
  color: #9fb2c2;
  align-self: flex-end;
}

.ranking-list { list-style: none; padding: 0; margin: 0; }
.ranking-list li {
  display: grid;
  grid-template-columns: 1fr 92px 16px;
  align-items: center;
  column-gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.ranking-list li:last-child { border-bottom: none; }
.ranking-list .keyword {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  min-width: 26px;
  box-sizing: border-box;
  text-align: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.ranking-list .badge {
  display: block;
  width: 100%;
}
.badge-top3 { background: #1e9e5a; }
.badge-top10 { background: #4caf7d; }
.badge-mid { background: var(--orange); }
.badge-far { background: #c65b5b; }

.trend { font-size: 12px; text-align: center; }
.trend-up { color: #1e9e5a; }
.trend-down { color: #c65b5b; }

.audit-score {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  margin-top: 4px;
}
.audit-score .score-max { font-size: 18px; font-weight: 600; color: #8a97a3; }
.score-good { color: #1e9e5a; }
.score-mid { color: var(--orange); }
.score-bad { color: #c65b5b; }

.audit-sub { font-size: 13px; color: #5a6b78; margin: 6px 0 12px; }

.top-issues { list-style: none; padding: 0; margin: 0; }
.top-issues li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.top-issues li:last-child { border-bottom: none; }
