body {
  background: #f5f7fb;
}

.app-view.d-none {
  display: none !important;
}

#chart {
  width: 100%;
  height: 420px !important;
  display: block;
  border-radius: 0.4rem;
  background: #fff;
}

#tableBody tr.future td {
  color: #b06b20;
}

.sidebar-item.active > .sidebar-link {
  background: rgba(59, 125, 221, 0.14);
}

.card-title {
  letter-spacing: 0;
}

#addressSuggestions {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.35rem;
}

@media (max-width: 991.98px) {
  .content {
    padding: 1rem 0.75rem;
  }

  .content .container-fluid.p-0 {
    padding: 0 !important;
  }

  .d-flex.gap-2 {
    width: 100%;
  }

  .d-flex.gap-2 .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .card-header {
    padding: 0.75rem 0.9rem;
  }

  .card-body {
    padding: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .h3 {
    font-size: 1.45rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card h2 {
    font-size: 1.65rem;
  }

  .card-header .form-select.w-auto {
    width: 100% !important;
    margin-top: 0.6rem;
  }

  .card-header.d-flex.justify-content-between.align-items-center {
    align-items: flex-start !important;
    flex-direction: column;
  }

  #chart {
    height: 280px !important;
  }

  .table-responsive {
    margin: 0 -0.4rem;
  }

  .table th,
  .table td {
    white-space: nowrap;
    font-size: 0.87rem;
    padding: 0.55rem 0.5rem;
  }
}

/* Heatmap horaire */
.heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
.heatmap-row {
  display: grid;
  grid-template-columns: 36px repeat(24, 1fr);
  gap: 3px;
  align-items: center;
}
.heatmap-label {
  font-size: 0.72rem;
  color: #6c757d;
  text-align: right;
  padding-right: 4px;
}
.heatmap-hour {
  font-size: 0.68rem;
  color: #6c757d;
  text-align: center;
  min-height: 14px;
}
.heatmap-cell {
  aspect-ratio: 1 / 1;
  min-height: 14px;
  border-radius: 3px;
  background: rgba(15, 123, 114, 0);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.heatmap-cell:hover {
  outline: 2px solid #d6852a;
  outline-offset: -1px;
}

/* Conteneur du graphique meteo : hauteur fixe requise avec maintainAspectRatio: false */
.weather-chart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ===== Mode sombre ===== */
body.dark-theme {
  background: #151a23;
  color: #d5dbe5;
}
body.dark-theme .main,
body.dark-theme .content {
  background: #151a23;
}
body.dark-theme .card {
  background: #1d2531;
  color: #d5dbe5;
  box-shadow: 0 0 0.875rem 0 rgba(0, 0, 0, 0.35);
}
body.dark-theme .card-header {
  background: #1d2531;
  border-bottom-color: #2b3547;
}
body.dark-theme .card-title,
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme h4, body.dark-theme h5, body.dark-theme h6 {
  color: #e8edf5;
}
body.dark-theme .navbar {
  background: #1d2531 !important;
  border-bottom: 1px solid #2b3547;
}
body.dark-theme .sidebar,
body.dark-theme .sidebar-content {
  background: #10141c;
}
body.dark-theme .table {
  color: #d5dbe5;
}
body.dark-theme .table-hover tbody tr:hover {
  background: #232d3d;
  color: #e8edf5;
}
body.dark-theme .table td,
body.dark-theme .table th {
  border-color: #2b3547;
}
body.dark-theme .form-control,
body.dark-theme .form-select {
  background: #141a24;
  border-color: #2b3547;
  color: #d5dbe5;
}
body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
  background: #141a24;
  color: #e8edf5;
  border-color: #0f7b72;
  box-shadow: 0 0 0 0.2rem rgba(15, 123, 114, 0.25);
}
body.dark-theme .form-control::placeholder {
  color: #6b7789;
}
body.dark-theme .text-muted,
body.dark-theme .form-text {
  color: #8a94a6 !important;
}
body.dark-theme .list-group-item {
  background: #1d2531;
  border-color: #2b3547;
  color: #d5dbe5;
}
body.dark-theme .list-group-item-action:hover {
  background: #232d3d;
  color: #e8edf5;
}
body.dark-theme .alert-info {
  background: #12323d;
  border-color: #14495a;
  color: #9fd8e8;
}
body.dark-theme .btn-outline-secondary {
  color: #a9b3c2;
  border-color: #3a465c;
}
body.dark-theme .progress {
  background: #2b3547;
}
body.dark-theme .heatmap-cell {
  border-color: rgba(255, 255, 255, 0.05);
}
body.dark-theme #chart {
  background: transparent;
}
body.dark-theme hr {
  border-color: #2b3547;
}

/* Connexion (acces distant) */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}
.login-card {
  width: min(92vw, 380px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
