/* ------------------------------
   STYLE GLOBAL
------------------------------ */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 40%, #000 100%);
  color: #e5e7eb;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------
   HEADER CIS OFFRANVILLE (MODERNISÉ)
------------------------------ */

header {
  position: relative;
  background: linear-gradient(135deg, #b00000 0%, #7f1d1d 40%, #0f172a 100%);
  padding: 2.8rem 1.4rem;
  text-align: center;
  color: white;
  box-shadow: 0 22px 45px rgba(0,0,0,0.65);
  border-bottom: 3px solid #b91c1c;
  border-radius: 0 0 18px 18px;
}

header h1 {
  margin: 0;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #ffffff;
}

header h2 {
  margin: 0;
  margin-top: 10px;
  font-size: 1.25rem;
  font-weight: 500;
  opacity: 0.95;
  color: #ffffff;
}

/* ------------------------------
   CODE ADMIN DANS LE BANDEAU
------------------------------ */

.header-admin {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-admin input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #fff;
  width: 110px;
}

.header-admin button {
  padding: 8px 12px;
  background: #b00000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* ------------------------------
   LOGO CENTRÉ — VERSION 120px
------------------------------ */

.logo-sdis-center {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin: 20px auto;
  display: block;
  box-shadow: 0 0 14px rgba(255,255,255,0.25);
}

/* ------------------------------
   CONTENU PRINCIPAL
------------------------------ */

main {
  padding: 1.8rem;
}

/* ------------------------------
   MENU PRINCIPAL — BOUTONS MODERNISÉS
------------------------------ */

.home-menu {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.home-btn {
  width: 190px;
  padding: 18px;
  font-size: 18px;
  border-radius: 14px;
  border: none;
  background: #f3f4f6;
  color: #111;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: 0.25s ease;
  text-align: center;
}

.home-btn:hover {
  background: #e5e7eb;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* ------------------------------
   (ANCIENNE ZONE ADMIN — DÉSACTIVÉE)
------------------------------ */

#admin-zone {
  display: none;
}

/* ------------------------------
   TABLEAU CONSOMMABLES
------------------------------ */

table {
  width: 100%;
  border-collapse: collapse;
  background: #111827;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  table-layout: auto !important;
}

th, td {
  padding: 0.85rem;
  border-bottom: 1px solid #1f2937;
  white-space: normal !important;
  overflow: visible !important;
  font-size: 1rem;
}

th {
  background: #020617;
  text-align: left;
  color: #f3f4f6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:hover {
  background: #1e293b;
  transform: translateY(-1px);
  transition: 0.15s ease;
}

/* ------------------------------
   BADGES STATUT
------------------------------ */

.badge {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.badge-ok {
  background: #14532d;
  color: #22c55e;
  border: 1px solid #22c55e;
}

.badge-low {
  background: #7c2d12;
  color: #f97316;
  border: 1px solid #f97316;
}

.badge-crit {
  background: #7f1d1d;
  color: #ef4444;
  border: 1px solid #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

/* ------------------------------
   BOUTONS GLOBAUX
------------------------------ */

.btn {
  padding: 0.7rem 1.3rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: 0.15s ease;
  margin: 0.3rem;
}

.btn-sec {
  background: #374151;
  color: white;
}

.btn-sec:hover {
  background: #4b5563;
}

/* ------------------------------
   PANNEAU RÉARMEMENT MANUEL
------------------------------ */

#section-rearmement {
  margin-top: 1rem;
  background: #111827;
  border-radius: 14px;
  padding: 1.2rem;
  border: 2px solid #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.3);
}

.rearm-item {
  background: #1f2937;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rearm-item label {
  font-size: 1rem;
  font-weight: 600;
}

.rearm-item input {
  width: 90px;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.95rem;
}

/* ------------------------------
   HISTORIQUE
------------------------------ */

#section-historique {
  margin-top: 1rem;
  background: #111827;
  padding: 1.2rem;
  border-radius: 14px;
  border: 2px solid #374151;
  box-shadow: 0 0 14px rgba(0,0,0,0.4);
}

.hidden {
  display: none;
}

/* ------------------------------
   SORTIE RAPIDE
------------------------------ */

.sortie-line {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  margin-bottom: 20px;
  background: #1f1f1f;
  border-radius: 14px;
  box-shadow: 0 0 14px rgba(0,0,0,0.4);
}

.sortie-line select,
.sortie-line input {
  padding: 14px;
  font-size: 1.15rem;
  border-radius: 10px;
  border: 1px solid #333;
  background: #020617;
  color: #e5e7eb;
  width: 100%;
}

.btn-delete {
  align-self: flex-end;
  margin-top: 4px;
  background: #ef4444;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 1.1rem;
}

#add-line,
#valider-multi {
  width: 100%;
  padding: 16px;
  font-size: 1.25rem;
  border-radius: 12px;
  margin-top: 12px;
}

/* ------------------------------
   FIX LARGEUR TABLEAU MOBILE
------------------------------ */

#table-consommables th:nth-child(1),
#table-consommables td:nth-child(1) {
  width: 40px;
}

#table-consommables th:nth-child(3),
#table-consommables td:nth-child(3) {
  width: 70px;
}

#table-consommables th:nth-child(4),
#table-consommables td:nth-child(4) {
  width: 80px;
}

#table-consommables th:nth-child(5),
#table-consommables td:nth-child(5) {
  width: 70px;
  text-align: center;
}

#table-consommables th:nth-child(2),
#table-consommables td:nth-child(2) {
  width: auto;
}

/* ------------------------------
   CARTE RÉSUMÉ GÉNÉRAL (MODERNE)
------------------------------ */

.resume-card {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  padding: 22px;
  border-radius: 18px;
  box-shadow: 0 0 25px rgba(0,0,0,0.45);
  border: 2px solid rgba(239, 68, 68, 0.4);
  margin: 25px 0;
  text-align: center;
}

.resume-card h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #f3f4f6;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.resume-item {
  font-size: 1.2rem;
  margin: 10px 0;
  color: #e5e7eb;
  font-weight: 500;
}

.resume-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ef4444;
}

.resume-date {
  margin-top: 18px;
  font-size: 0.95rem;
  opacity: 0.8;
  color: #9ca3af;
}
/* ------------------------------
   STATUTS CONSOMMABLES (VERSION SDIS)
------------------------------ */

/* Sous-dimensionné → ROUGE */
.pct-high {
  color: #ef4444;
  font-weight: 700;
}

/* Normal → VERT */
.pct-mid {
  color: #22c55e;
  font-weight: 700;
}

/* Sur-dimensionné → ORANGE */
.pct-low {
  color: #f97316;
  font-weight: 700;
}

/* Dormant → GRIS */
.pct-zero {
  color: #6b7280;
  font-weight: 700;
  opacity: 0.7;
}

/* ------------------------------
   BARRES ANIMÉES (GRAPHIQUE)
------------------------------ */

.bar {
  height: 22px;
  background: linear-gradient(90deg, #7f1d1d, #ef4444);
  border-radius: 6px;
  width: 0%;
  transition: width 1.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.bar-label {
  font-size: 15px;
  margin-bottom: 4px;
  color: #e5e7eb;
  font-weight: 500;
}
