/* ===========================
   Variables & reset global
   =========================== */

:root {
  --blue-main: #1F6CB0;
  --blue-light: #4EC6EE;
  --orange: #FFA430;
  --soft-bg: #F7F2EC;
  --text: #1f2933;
  --border-radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
}

body {
  background: #f5f7fb;
  color: var(--text);
}


body.protected {
  visibility: hidden;
}


/* ===========================
   Header & Footer
   =========================== */

.main-header,
.main-footer {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Header Eqwater */

.main-header {
  padding: 8px 32px;
  border-bottom: 1px solid #e5e7eb;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 24px;
  width: auto;
}

.brand-name {
  font-weight: 600;
  font-size: 1rem;
}

/* Navigation */

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
  color: #374151;
  font-size: 15px;
}

.nav-links a:hover {
  color: var(--blue-main);
}

/* Footer */

.main-footer {
  padding: 14px 36px;
  font-size: 0.8rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
}

/* ===========================
   Compte utilisateur (navbar)
   =========================== */

/* Conteneur compte à droite */
.account-section {
  display: inline-flex;
  align-items: center;
  margin-left: 32px;
  padding-left: 16px;
  border-left: 1px solid #e5e7eb; /* séparation liens / compte */
}

/* Bouton icône invité (petit carré jaune) */
.account-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;            /* carré à bords arrondis */
  background: #fbbf24;           /* jaune */
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.account-icon {
  font-size: 18px;
  color: #111827;
}

/* Mode connecté : avatar + texte + bouton logout */

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #1f2937;
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  margin-right: 8px;
}

/* Variante éventuelle invité */
.account-avatar-guest {
  background: #e5e7eb;
  color: #374151;
}

.account-info-text {
  display: flex;
  flex-direction: column;
  margin-right: 8px;
}

.account-name {
  font-weight: 500;
  font-size: 0.8rem;
}

.account-role {
  font-size: 0.7rem;
  opacity: 0.7;
}

.btn-login-nav,
.btn-logout {
  border: none;
  background: #2563eb;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-login-nav:hover,
.btn-logout:hover {
  background: #1d4ed8;
}

/* ===========================
   Mise en page générique
   =========================== */

.page {
  padding: 32px 36px 60px;
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}

.page-subtitle {
  color: #6b7280;
  margin-bottom: 24px;
}

/* Cartes & boutons */

.card {
  background: #ffffff;
  border-radius: var(--border-radius);
  padding: 20px 22px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
  margin-bottom: 18px;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: #ffffff;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

/* Inputs & formulaires */

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

textarea.textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===========================
   Layouts : toolbars, etc.
   =========================== */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===========================
   Tags de statut
   =========================== */

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.tag-preparation {
  background: #e0ebff;
  color: #1d4ed8;
}

.tag-travaux {
  background: #dcfce7;
  color: #15803d;
}

.tag-attente {
  background: #fef9c3;
  color: #ca8a04;
}

.tag-termine {
  background: #e5e7eb;
  color: #374151;
}

/* ===========================
   Modale générique
   =========================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: #ffffff;
  width: min(560px, 94vw);
  border-radius: 18px;
  padding: 22px 24px 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}


/* ===========================
   Carte (Leaflet)
   =========================== */

#map {
  width: 100%;
  height: 520px;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* ===========================
   Accueil (hero + cartes)
   =========================== */

.hero {
  padding: 32px 36px 16px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero p {
  color: #6b7280;
}

.cards {
  padding: 0 36px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.cards .card {
  margin-bottom: 0;
}
/* ===== PAGE LOGIN ===== */

.login-page {
  background: #f3f4f6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.login-card {
  /* .card gère déjà le fond blanc, le radius et l'ombre */
  padding: 24px 24px 26px;
}

.login-header {
  text-align: center;
  margin-bottom: 18px;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #4ec6ee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 10px;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: #6b7280;
}

.login-form-group {
  margin-bottom: 14px;
}

.login-form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

.login-actions {
  margin-top: 8px;
}

.login-btn-full {
  width: 100%;
  justify-content: center;
}

.login-error {
  margin-top: 10px;
  font-size: 13px;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 8px;
  padding: 6px 8px;
  display: none;
}

.login-footer {
  margin-top: 14px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* ===========================
   Planning (nouvelle version)
   =========================== */

/* Conteneur principal du planning (le <div id="planningGrid">) */
.planning-grid {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 16px 12px;
  margin: 24px auto;
  max-width: 1200px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  overflow-x: auto;
}

/* En-tête : colonne "Chantier" + 7 jours */
.planner-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.planner-header-label {
  width: 180px;
  font-size: 14px;
  font-weight: 600;
  padding-left: 4px;
  flex-shrink: 0;
}

.planner-header-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* 7 colonnes égales */
  min-width: 7 * 120px;
  column-gap: 0;
  flex: 1;
}

.planner-day-header {
  text-align: center;
  font-size: 12px;
  padding: 4px 0;
  background: #e5eefc;
  border-left: 1px solid #d1d5db;
  color: #1f2933;
}

/* Une ligne de planning = un chantier */
.planner-row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid #f3f4f6;
  padding: 4px 0;
}

.planner-row-label {
  width: 180px;
  font-size: 13px;
  padding: 4px;
  flex-shrink: 0;
  color: #111827;
}

/* Zone des jours pour une ligne (grille horizontale) */
.planner-row-grid {
  position: relative;
  flex: 1;
  min-height: 32px;
}

/* Colonnes de fond (les lignes verticales des jours) */
.planner-day-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #f3f4f6;
}

/* Barre d'intervention (le bloc bleu) */
.planner-bar {
  position: absolute;
  top: 4px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  padding: 4px 8px;
  white-space: normal;
  line-height: 1.35;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

/* Titre de l'intervention (ex: "test") */
.planner-bar-title {
  font-weight: 600;
  margin-bottom: 2px;
}

/* Liste des employés sous le titre */
.planner-bar-emps {
  font-size: 10px;
}

/* Boutons Vue jour / Vue semaine */
.btn {
  background: #4b8cfb;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 6px;
  font-size: 13px;
}
.btn:hover {
  background: #3b82f6;
}
.btn.active {
  background: #1d4ed8;
}
