/* ============ BASE ============ */
body {
  background-color: #f5f6fa;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============ NAVBAR ============ */
.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
}

/* ============ CARDS ============ */
.card {
  border-radius: 12px;
}
.card-header {
  border-radius: 12px 12px 0 0 !important;
}

/* Stat cards (dashboard global) */
.stat-card {
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Project cards */
.project-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important;
}

/* KPI cards */
.kpi-card {
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .4rem .8rem rgba(0,0,0,.08) !important;
}
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.kpi-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6c757d;
  line-height: 1;
  margin-bottom: 2px;
}
.kpi-value {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-value small {
  font-weight: 400;
  color: #6c757d;
}

/* Phase cards */
.phase-card {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.phase-card:hover {
  border-color: #ffc107 !important;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

/* ============ SECTION TITLE ============ */
.section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-bottom: 0;
}

/* ============ GAUGES ============ */
.gauge-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
}
.gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.gauge-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.gauge-label {
  font-size: .7rem;
  color: #6c757d;
}

/* ============ CHART CONTAINERS ============ */
.chart-body {
  position: relative;
  min-height: 220px;
  padding: 0.75rem;
}
.chart-body canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 240px;
}
.chart-body-lg {
  position: relative;
  min-height: 260px;
  padding: 0.75rem;
}
.chart-body-lg canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 280px;
}

/* Empty chart placeholder */
.empty-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  color: #adb5bd;
  text-align: center;
  gap: 0.75rem;
}
.empty-chart i {
  font-size: 2.5rem;
  opacity: 0.3;
}
.empty-chart span {
  font-size: .8rem;
  max-width: 200px;
  line-height: 1.4;
}

/* ============ TABLE ============ */
.table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============ PROGRESS ============ */
.progress {
  border-radius: 10px;
}
.progress-bar {
  border-radius: 10px;
  font-size: 0.75rem;
}

/* ============ FORM ============ */
.form-range {
  flex: 1;
}

/* ============ MISC ============ */
.btn-group .btn {
  border-radius: 0;
}
.btn-group .btn:first-child {
  border-radius: 4px 0 0 4px;
}
.btn-group .btn:last-child,
.btn-group form:last-child .btn {
  border-radius: 0 4px 4px 0;
}
.bg-purple {
  background-color: #6f42c1 !important;
}
.min-w-0 {
  min-width: 0;
}
.project-title {
  font-size: 1.5rem;
}

/* ============ RESPONSIVE ============ */

/* Tablette */
@media (max-width: 991.98px) {
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
  .gauge-wrapper {
    width: 130px;
    height: 130px;
  }
  .gauge-value {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }
  .project-title {
    font-size: 1.15rem;
  }
  .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.9rem;
  }
  .kpi-value {
    font-size: 0.95rem;
  }
  .kpi-label {
    font-size: .6rem;
  }
  .gauge-wrapper {
    width: 110px;
    height: 110px;
  }
  .gauge-value {
    font-size: 1.3rem;
  }
  .gauge-label {
    font-size: .6rem;
  }
  .chart-body {
    min-height: 200px;
  }
  .chart-body canvas {
    max-height: 200px;
  }
  .chart-body-lg {
    min-height: 220px;
  }
  .chart-body-lg canvas {
    max-height: 220px;
  }
  .section-title {
    font-size: .65rem;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .card {
    border-radius: 10px;
  }
  .card-header {
    border-radius: 10px 10px 0 0 !important;
  }
  .navbar-brand {
    font-size: 1.1rem;
  }
  .empty-chart i {
    font-size: 2rem;
  }
  .empty-chart span {
    font-size: .7rem;
  }
}

/* Petit mobile */
@media (max-width: 400px) {
  .kpi-icon {
    width: 30px;
    height: 30px;
    font-size: .8rem;
    border-radius: 8px;
  }
  .kpi-value {
    font-size: .85rem;
  }
  .gauge-wrapper {
    width: 90px;
    height: 90px;
  }
  .gauge-value {
    font-size: 1.1rem;
  }
}
