/* ==========================================================================
   GARDE - Design System & Thème officiel (Vert Forêt / Modern Gov)
   ========================================================================== */

:root {
  --garde-forest: #063a23;
  --garde-forest-dark: #042818;
  --garde-forest-light: #0b4d2e;
  --garde-forest-hover: #0e5a36;
  --garde-accent-mint: #22c55e;
  --garde-bg: #f8fafc;
  --garde-card-border: #e2e8f0;
  --garde-text-main: #1e293b;
  --garde-text-muted: #64748b;
  --garde-sidebar-width: 280px;
}

body {
  background-color: var(--garde-bg) !important;
  color: var(--garde-text-main);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Désactivation complète du loader/spinner */
#spinner,
.loader-container,
.loader-ring,
.loader-text,
.loader-logo {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
#header {
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--garde-card-border);
  box-shadow: none !important;
  padding: 0 24px;
  z-index: 997;
  transition: all 0.3s;
}

@media (min-width: 1200px) {
  #header {
    left: var(--garde-sidebar-width);
  }

  .toggle-sidebar #header {
    left: 0;
  }
}

@media (max-width: 1199px) {
  #header {
    left: 0;
  }
}

.header-brand-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #9a3412;
  border: 1px solid #fdba74;
  background-color: #fff7ed;
  border-radius: 4px;
  text-transform: uppercase;
}

.user-initials-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 700;
  font-size: 13px;
  border-radius: 6px;
}

.notification-dot-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #64748b;
  cursor: pointer;
}

.notification-dot-wrap .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background-color: #ef4444;
  border-radius: 50%;
}

.header-breadcrumb {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.header-breadcrumb span.current {
  color: #0f172a;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   SIDEBAR (Vert Forêt)
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--garde-sidebar-width);
  background-color: var(--garde-forest) !important;
  color: #ffffff;
  padding: 0;
  box-shadow: none;
  z-index: 998;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-header {
  padding: 24px 20px 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-brand-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  margin-bottom: 4px;
}

.sidebar-brand-subtitle {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.sidebar-nav-container {
  flex-grow: 1;
  padding: 12px 14px;
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav .nav-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 16px 8px 6px 8px;
}

.sidebar-nav .nav-item {
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82) !important;
  background-color: transparent !important;
  border-radius: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.sidebar-nav .nav-link-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav .nav-link i.icon {
  font-size: 15px;
  opacity: 0.75;
}

.sidebar-nav .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-nav .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.14) !important;
  font-weight: 600;
}

.sidebar-nav .nav-link.active .badge-count {
  background-color: #10b981;
  color: #ffffff;
}

.sidebar-nav .badge-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sidebar-footer-profile {
  padding: 16px 20px;
  background-color: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-profile .user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.sidebar-footer-profile .user-role {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
}

/* --------------------------------------------------------------------------
   MAIN CONTAINER ADJUSTMENTS & FOOTER
   -------------------------------------------------------------------------- */
#main {
  margin-left: var(--garde-sidebar-width);
  margin-top: 56px;
  padding: 24px 32px;
  background-color: var(--garde-bg);
  min-height: calc(100vh - 56px);
  transition: all 0.3s;
}

#footer {
  margin-left: var(--garde-sidebar-width);
  padding: 20px 0;
  font-size: 14px;
  transition: all 0.3s;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--garde-forest-dark);
  color: #ffffff;
}

#footer .copyright,
#footer .copyright span,
#footer .copyright strong {
  color: #ffffff !important;
}

#footer a {
  color: #ffffff !important;
  text-decoration: underline;
}

#footer a:hover {
  color: #e2e8f0 !important;
}

@media (min-width: 1200px) {

  .toggle-sidebar #main,
  .toggle-sidebar #footer {
    margin-left: 0;
  }

  .toggle-sidebar .sidebar {
    left: calc(-1 * var(--garde-sidebar-width));
  }
}

@media (max-width: 1199px) {
  .sidebar {
    left: calc(-1 * var(--garde-sidebar-width));
  }

  .toggle-sidebar .sidebar {
    left: 0;
  }

  #main,
  #footer {
    margin-left: 0;
  }

  .toggle-sidebar #main,
  .toggle-sidebar #footer {
    margin-left: 0;
  }
}

/* Protection contre imbrication <main> éventuelle */
#main #main,
.main .main {
  margin-left: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  min-height: auto !important;
  background: transparent !important;
}

/* --------------------------------------------------------------------------
   PAGES TITLES & HEADINGS
   -------------------------------------------------------------------------- */
.page-title-wrap {
  margin-bottom: 20px;
}

.page-title-wrap h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.page-title-wrap .subtitle {
  font-size: 13px;
  color: var(--garde-text-muted);
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn-garde-primary {
  background-color: var(--garde-forest-light);
  border-color: var(--garde-forest-light);
  color: #ffffff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease;
}

.btn-garde-primary:hover,
.btn-garde-primary:focus {
  background-color: var(--garde-forest-hover);
  border-color: var(--garde-forest-hover);
  color: #ffffff;
}

.btn-garde-outline {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-garde-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   CARDS & PANELS
   -------------------------------------------------------------------------- */
.garde-card {
  background: #ffffff;
  border: 1px solid var(--garde-card-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  margin-bottom: 20px;
}

.garde-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--garde-card-border);
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
}

.garde-card-body {
  padding: 20px;
}

/* --------------------------------------------------------------------------
   CALLOUT BOXES
   -------------------------------------------------------------------------- */
.callout-box {
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.callout-warning {
  background-color: #fff7ed;
  border-left: 4px solid #ea580c;
  color: #9a3412;
}

.callout-danger {
  background-color: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.callout-info {
  background-color: #f0fdf4;
  border-left: 4px solid #16a34a;
  color: #166534;
}

.callout-neutral {
  background-color: #f8fafc;
  border-left: 4px solid #94a3b8;
  color: #334155;
}

/* --------------------------------------------------------------------------
   BADGES (DECISIONS & RISQUES)
   -------------------------------------------------------------------------- */
.badge-decision {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-align: center;
  min-width: 26px;
  white-space: nowrap;
}

.badge-decision.A {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-decision.AC {
  background-color: #ccfbf1;
  color: #0f766e;
}

.badge-decision.R {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-decision.EC {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-risk {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
}

.badge-risk.courant {
  background-color: #f1f5f9;
  color: #475569;
}

.badge-risk.sensible {
  background-color: #f3e8ff;
  color: #7e22ce;
}

.badge-risk.strategique {
  background-color: #ffedd5;
  color: #c2410c;
}

.badge-deadline {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background-color: #fee2e2;
  color: #b91c1c;
}

/* --------------------------------------------------------------------------
   TABLES
   -------------------------------------------------------------------------- */
.table-garde {
  width: 100%;
  margin-bottom: 0;
  font-size: 13px;
  border-collapse: collapse;
}

.table-garde th {
  background-color: #ffffff;
  color: #64748b;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--garde-card-border);
  padding: 12px 14px;
  white-space: nowrap;
}

.table-garde td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.table-garde tbody tr:hover {
  background-color: #f8fafc;
}

/* --------------------------------------------------------------------------
   STEPPER WIZARD (CANEVAS 1)
   -------------------------------------------------------------------------- */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--garde-card-border);
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.wizard-step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #64748b;
  font-weight: 700;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-step-item.active {
  color: #0f172a;
  font-weight: 600;
}

.wizard-step-item.active .wizard-step-circle {
  background-color: var(--garde-forest-light);
  color: #ffffff;
}

.wizard-step-item.completed {
  color: var(--garde-forest-light);
  font-weight: 500;
}

.wizard-step-item.completed .wizard-step-circle {
  background-color: #dcfce7;
  color: #15803d;
}

/* --------------------------------------------------------------------------
   KPI CARDS (TABLEAU DE BORD)
   -------------------------------------------------------------------------- */
.kpi-card {
  background: #ffffff;
  border: 1px solid var(--garde-card-border);
  border-radius: 8px;
  padding: 18px 20px;
  height: 100%;
}

.kpi-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 8px;
}

.kpi-number {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-subtext {
  font-size: 12px;
  color: #64748b;
}

/* ==========================================================================
   PUBLIC THEME OVERRIDES (Harmonisation stricte avec l'espace admin GARDE)
   ========================================================================== */

.top-flag-bar {
  display: none !important;
}

.navbar {
  background-color: #1b5e3a !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12) !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-brand .brand-logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);*/
}

.navbar-brand .brand-logo-circle img {
  /*width: 28px;
  height: 28px;*/
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.navbar .brand-logo-right {
  height: 44px;
  width: auto;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar .brand-logo-right img {
  height: 40px;
  width: auto;
  max-width: 75px;
  object-fit: contain;
}

.navbar-brand .brand-name {
  font-family: 'Saira', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  color: #ffffff !important;
  line-height: 1;
}

.navbar-brand .brand-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #92400e;
  background-color: #fef08a;
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.navbar-brand .brand-sub {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.2px;
  margin-top: 3px;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.82) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 6px 14px !important;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.navbar .nav-link:hover {
  color: #ffffff !important;
}

.navbar .nav-link.active {
  color: #fde047 !important;
  font-weight: 600;
}

.btn-nav-connexion {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff !important;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-nav-connexion:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
}

.navbar-dark .navbar-toggler {
  border-color: #cbd5e1 !important;
}

.navbar-dark .navbar-toggler-icon {
  filter: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2830, 41, 59, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Footer public */
.footer {
  background-color: #063a23 !important;
  color: rgba(255, 255, 255, 0.8) !important;
  border-top: none !important;
}

.footer h1,
.footer h5 {
  color: #ffffff !important;
  font-weight: 700;
}

.footer a.btn-link {
  color: rgba(255, 255, 255, 0.75) !important;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer a.btn-link:hover {
  color: #fde68a !important;
  text-decoration: underline;
}

.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #042818 !important;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

/* Boutons primaires sur la partie publique */
.btn-primary {
  background-color: #0b4d2e !important;
  border-color: #0b4d2e !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #063a23 !important;
  border-color: #063a23 !important;
  color: #ffffff !important;
}

/* Cartes formulaires (Login / Register / Plainte / etc.) */
.login-card,
.register-card {
  background: #ffffff !important;
  border: 1px solid var(--garde-card-border) !important;
  border-top: 4px solid #063a23 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
  padding: 2.5rem !important;
}

.login-card h3,
.register-card h3 {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.form-control:focus,
.form-select:focus {
  border-color: #0b4d2e !important;
  box-shadow: 0 0 0 0.2rem rgba(11, 77, 46, 0.15) !important;
}

.hover-light:hover {
  color: #ffffff !important;
}

/* ==========================================================================
   Secondary color normalization (fixes white/unreadable text-secondary)
   ========================================================================== */
:root {
  --bs-secondary: #64748b;
  --bs-secondary-rgb: 100, 116, 139;
}

.text-secondary {
  color: #475569 !important;
}

.bg-secondary {
  background-color: #64748b !important;
  color: #ffffff !important;
}

.bg-secondary-subtle {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}

.border-secondary {
  border-color: #cbd5e1 !important;
}

.btn-secondary {
  background-color: #64748b !important;
  border-color: #64748b !important;
  color: #ffffff !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #475569 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

.btn-outline-secondary {
  color: #475569 !important;
  border-color: #cbd5e1 !important;
  background-color: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}