:root {
  --sidebar-width: 222px;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-light);
}

h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy-blue);
  letter-spacing: -0.5px;
}
h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-blue);
}
h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Layout sidebar (pages hors login) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--primary);
  color: #ffffff;
  padding: 14px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.sidebar-user {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-username {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 13px;
}

.sidebar-societe {
  margin-top: 4px;
  color: #ffffff;
  font-weight: 600;
  opacity: 0.88;
  font-size: 11px;
  line-height: 1.3;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  margin-right: -2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}

.sidebar-nav-section {
  margin-top: 12px;
}

.sidebar-nav-section:first-child {
  margin-top: 0;
}

.sidebar-nav-section--tight {
  margin-top: 8px;
}

.sidebar-nav-section__title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 4px;
  padding: 0 10px;
  line-height: 1.2;
}

.sidebar-nav-section__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12.5px;
  display: block;
  line-height: 1.28;
}

.nav-link.active {
  background: var(--amber-gold);
  color: #ffffff;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-bottom .nav-link {
  background: transparent;
}

.main-content {
  margin-left: var(--sidebar-width);
  background: var(--bg-light);
  min-height: 100vh;
}

.cell-current {
  background: var(--light-gray) !important;
}

/* Grille KPI (gérant) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Règle globale : toute valeur numérique < 0 s'affiche en rouge. */
.value-negative {
  color: var(--amber-gold) !important;
  font-weight: 600;
}

.value-positive {
  color: var(--navy-blue) !important;
  font-weight: 600;
}

.value-neutral {
  color: var(--text-secondary);
}

.value-unknown {
  color: var(--text-disabled);
  font-style: italic;
}

.evolution-positive {
  color: var(--navy-blue);
  font-weight: 600;
}

.evolution-negative {
  color: var(--amber-gold);
  font-weight: 600;
}

.evolution-neutral {
  color: var(--text-disabled);
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Page de connexion */
.page-login {
  min-height: 100vh;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.card-login {
  width: 420px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.logo-bfev {
  color: #ffffff;
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 800;
}

.card-login input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.card-login input:focus {
  outline: none;
  border-color: var(--navy-blue);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.card-login .btn {
  width: 100%;
}

