/* DEKS DCM — surcouche dashboard v7 (2026-10-11, révisé 22:55)
   Chargé APRÈS les CSS dcm-* dans include/headhtml.php (ligne 50).
   Correction du 1er passage : la règle générique .box écrasait les
   couleurs d'origine des cartes (.bg-blue/.bg-green/.bg-yellow/.bg-red).
   À révoquer : retirer la ligne <link> qui charge ce fichier. */

:root {
  --dcm-v7-bg: #0d1726;
  --dcm-v7-panel: #14243c;
  --dcm-v7-panel-2: #182a45;
  --dcm-v7-line: #2c4d78;
  --dcm-v7-text: #eaf3ff;
  --dcm-v7-muted: #9fb4cd;
  --dcm-v7-blue: #2f9be8;
}

/* Fond et typographie générale */
body {
  background: linear-gradient(180deg, #0f1b2d 0%, var(--dcm-v7-bg) 320px) !important;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: .01em;
}

/* Barre du haut */
.navbar {
  background: #0e1a2c !important;
  border-bottom: 1px solid #24446d !important;
}
.navbar a {
  color: #d9e7f8 !important;
}

/* Panneaux : fond navy, MAIS on épargne les cartes colorées .bg-* */
.box, .card, .panel, .box-bordered {
  border: 1px solid #24446d !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22) !important;
}
.box:not([class*="bg-"]), .card, .panel, .box-bordered:not([class*="bg-"]) {
  background: var(--dcm-v7-panel) !important;
}
.box .box-header, .box-header, .panel-heading, .card-header {
  border-bottom: 1px solid #223f63 !important;
  font-weight: 600 !important;
  color: var(--dcm-v7-text) !important;
}

/* ===== Cartes colorées (Hotspot + Consommation) =====
   On garde les couleurs d'origine du thème, on les affine :
   dégradé, coins, ombre, survol, chiffres en gras. */
.box[class*="bg-"] {
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .30) !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease !important;
  overflow: hidden;
}
.box.bg-blue   { background: linear-gradient(135deg, #29b6f6 0%, #1565c0 100%) !important; }
.box.bg-green  { background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%) !important; }
.box.bg-yellow { background: linear-gradient(135deg, #ffca28 0%, #f57f17 100%) !important; }
.box.bg-red    { background: linear-gradient(135deg, #ef5350 0%, #c62828 100%) !important; }
.box[class*="bg-"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .40) !important;
  filter: brightness(1.07);
}
.box[class*="bg-"] a {
  color: #fff !important;
}
.box[class*="bg-"] h1 {
  font-weight: 700 !important;
  font-size: 24px !important;
  line-height: 1.15;
}
.box[class*="bg-"] h1 span {
  font-size: 14px !important;
  font-weight: 500;
  opacity: .9;
}

/* Cartes icônes du haut (date / board / CPU) : pastille d'icône */
.box-group-icon {
  background: rgba(255, 255, 255, .10) !important;
  border-radius: 10px !important;
  color: #cfe1f7 !important;
}

/* Tableaux (top consommateurs, log, users…) */
table, .table {
  background: transparent !important;
}
table thead th, .table thead th {
  background: var(--dcm-v7-panel-2) !important;
  color: #cfe1f7 !important;
  border-bottom: 2px solid var(--dcm-v7-line) !important;
  font-weight: 600 !important;
}
table tbody tr {
  transition: background .12s ease !important;
}
table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .025) !important;
}
table tbody tr:hover {
  background: rgba(47, 155, 232, .12) !important;
}
table td, .table td {
  border-color: #1f3a5c !important;
}

/* Log hotspot (panneau droit) : scroll propre */
#r_3 .box-body, #r_3 {
  max-height: 520px;
  overflow-y: auto;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #2c4d78;
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Liens et boutons */
a {
  color: var(--dcm-v7-blue) !important;
}
.box[class*="bg-"] a, .box[class*="bg-"] a:hover {
  color: #fff !important;
}
a:hover {
  color: #6cc0ff !important;
  text-decoration: none !important;
}
.btn, button {
  transition: filter .12s ease !important;
}
.btn:hover, button:hover {
  filter: brightness(1.12);
}

/* Menu latéral : fond navy harmonisé avec le dashboard */
#sidenav, .sidenav {
  background: #101d30 !important;
  border-right: 1px solid #24446d !important;
}
#sidenav .card-header {
  background: #0e1a2c !important;
  border-bottom: 1px solid #24446d !important;
}
#sidenav .menu, #sidenav .dropdown-btn {
  color: #cfe1f7 !important;
}
#sidenav .dropdown-container {
  background: #0c1626 !important;
}
#sidenav .menu:hover, #sidenav .dropdown-btn:hover {
  background: #1e3a5f !important;
  color: #fff !important;
  border-radius: 5px;
}
#sidenav .active {
  background: linear-gradient(135deg, #1689dc, #26b5d8) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 153, 255, .20) !important;
}

/* ===== Boutons .btn.bg-* : fix contraste texte/fond (2026-10-14) =====
   Le thème d'origine (et la règle générique `a { color: blue }` de v7)
   mettait du texte clair sur fond clair : Generate 2.2, Print 1.1,
   Small 1.4 (seuil WCAG = 4.5). On force fond + texte par classe. */
.btn.bg-warning   { background: #ffc107 !important; color: #13233b !important; }
.btn.bg-pink      { background: #d81b60 !important; color: #ffffff !important; }
.btn.bg-primary   { background: #1565c0 !important; color: #ffffff !important; }
.btn.bg-secondary { background: #5c6b7a !important; color: #ffffff !important; }
.btn.bg-danger    { background: #f96b6b !important; color: #13233b !important; }
.btn.bg-info      { background: #63c2de !important; color: #13233b !important; }
