/* main2.css - refonte moderne pour gestion devis / factures */

/* --------- Variables thème --------- */
:root{
  --brand-600: #0f4c6f;    /* bleu pétrole */
  --brand-500: #176c8a;
  --brand-400: #2a90b3;
  --muted: #6c757d;
  --bg: #f7f9fb;
  --card-bg: #ffffff;
  --surface: #eef3f7;
  --danger: #dc3545;
  --success: #28a745;
  --glass: rgba(255,255,255,0.6);
  --header-height: 100px;
  --transition: 0.18s ease-in-out;
  --radius: 8px;
  --max-content-width: 1320px;
}

/* Global reset / typography */
* { box-sizing: border-box; }
html,body { height:100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #212529;
  background: var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Ensure main content is not hidden under fixed header */
/* .site-header { height: var(--header-height); background: transparent; } */



/* -------- Header / Navbar -------- */
.site-header {
  height: 200px; 
  background-color: #fff; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;

  z-index: 1000; /* Pour garantir que le header soit au-dessus de tout le contenu */
  padding: 0.45rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Ombre discrète */
  backdrop-filter: none; /* Retirer l'effet flou */
}

.site-navbar {
  background-color: var(--brand-600); /* Fond solide pour la navbar */
  backdrop-filter: none; /* Retirer tout effet de flou ou de transparence */
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 1rem;
}

.site-header.fixed-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}

#main { 
  padding-top: calc(var(--header-height) + 24px); 
  padding-bottom: 40px; 
  padding-top: calc(var(--header-height) + 24px); /* Empêcher le contenu de se cacher sous le header */
}

/* #main { padding-top: calc(var(--header-height) + 24px); padding-bottom: 40px; } */

/* -------- Header / Navbar -------- */
.site-navbar {
  background: linear-gradient(90deg, rgba(15,76,111,0.95), rgba(23,108,138,0.95));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 0.45rem 1rem;
  --bs-navbar-padding-x: .5rem;
}

.site-navbar .navbar-brand img { border-radius: 6px; box-shadow: 0 2px 8px rgba(12,44,66,0.12); }
.site-navbar .nav-link { color: rgba(255,255,255,0.95); padding: .6rem .9rem; transition: color var(--transition), background var(--transition); }
.site-navbar .nav-link:hover, .site-navbar .nav-link:focus { color: #fff; background: rgba(255,255,255,0.03); border-radius: 6px; }
.site-navbar .dropdown-menu { min-width: 12rem; }

/* Project badge */
.project-badge {
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: .9rem;
}
.project-badge .project-name { max-width: 180px; white-space:nowrap; overflow:hidden; text-overflow: ellipsis; }



/* -------- Sidebar / actions -------- */
.sidebar-actions .module-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(17,24,39,0.06);
}
.module-title { font-size: 1rem; }

/* Action buttons (icons) */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap:.5rem;
  padding: .55rem .75rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(14,24,36,0.04);
  color: #212529;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  font-size: .95rem;
  min-width: 48px;
}
.action-btn i { font-size: 1.05rem; }

/* action variants */
.action-pdf { background: linear-gradient(90deg,#fff,#fff); border-left: 3px solid var(--brand-400); }
.action-dup { border-left: 3px solid #f6a623; }
.action-mail { border-left: 3px solid #17a2b8; }
.action-qual { border-left: 3px solid #ffd43b; }
.action-edit { border-left: 3px solid #6f42c1; }
.action-delete { border-left: 3px solid var(--danger); color: var(--danger); }
.action-admin { border-left: 3px solid rgba(108,117,125,0.25); }

/* Hover effect */
.action-btn:hover, .action-btn:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(12,44,66,0.08);
  text-decoration: none;
}

/* Dropdown and more actions */
.dropdown .btn { border-radius: 10px; }

/* -------- Cards / packing examples (from original inline styles) -------- */
.packing-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(13,24,36,0.06);
  border: 1px solid rgba(13,24,36,0.04);
  margin-bottom: 18px;
}
.packing-header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.packing-title { font-size: 1.125rem; font-weight:700; color: #0b394f; }
.packing-stats { font-size: .9rem; color: var(--muted); }
.btn-modifier { background: var(--brand-500); color: #fff; border: none; }
.btn-supprimer { background: var(--danger); color: #fff; border: none; }
.btn-telecharger { background: var(--success); color: #fff; border: none; }
.btn-ajouter-element { background: #ffc107; color: #212529; border: none; }

/* Packing count badge */
.packing-count {
  background: var(--brand-600);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  text-align:center;
  display:inline-block;
}

/* -------- Utility / helpers (cleans) -------- */
.text-muted { color: var(--muted) !important; }

/* Offcanvas */
.offcanvas { background: linear-gradient(180deg, #fff, #fbfdff); border: none; }
.offcanvas-header { border-bottom: 1px solid rgba(14,24,36,0.04); }
.list-group-item { border: none; border-radius: 6px; background: transparent; padding: 0.45rem 0.75rem; }

/* Buttons */
.btn-primary {
  background: var(--brand-500);
  border-color: rgba(14,24,36,0.06);
  border-radius: 8px;
  padding: .45rem .85rem;
  transition: transform var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); }

/* Icons sizing */
.bi, .fa { font-size: 1.05rem; }

/* Alerts */
.alert-light { background-color: #fff; border: 1px solid rgba(14,24,36,0.04); }

/* Footer */
.footer { border-top: 1px solid rgba(0,0,0,0.03); }

/* Responsive tweaks */
@media (max-width: 991px) {
  .project-badge { display:none; }
  .search-input { width: 100%; max-width:100%; }
  #main { padding-top: calc(var(--header-height) + 12px); }
  .action-btn span { display:none; }
}

@media (max-width: 575px) {
  .site-navbar { padding: .35rem .6rem; }
  .module-card { padding: .75rem; }
  .action-btn { padding: .45rem .5rem; min-width:42px; }
}

/* Small accessibility helpers */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* End of file */




/* ---- Barre de recherche intégrée dans la navbar ---- */
.navbar-search {
  flex: 1;
  max-width: 420px;
}

.search-navbar-input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.95rem;
  padding: .35rem .8rem;
  transition: all 0.2s ease-in-out;
}
.search-navbar-input::placeholder { color: rgba(255,255,255,0.75); }
.search-navbar-input:focus {
  outline: none;
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

.btn-search-nav {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 8px;
  height: 38px;
  width: 38px;
  transition: 0.2s ease-in-out;
}
.btn-search-nav:hover {
  background: rgba(255,255,255,0.25);
}

/* ---- Sélecteur de langue ---- */
.language-switcher .dropdown-menu {
  min-width: 9rem;
  font-size: .9rem;
}
.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
}

/* Mobile adaptation : la barre de recherche passe sous le logo */
@media (max-width: 991px) {
  .navbar-search {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: .5rem 0 0;
  }
  .search-navbar-input {
    width: 100%;
    background: rgba(255,255,255,0.12);
  }
}



/* Liste d'autocomplétion */
#autocomplete-list {
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    z-index: 1000;
    width: 100%;
    background-color: #f9f9f9; /* Gris clair légèrement chaud */
    border: 1px solid #ddd; /* Bordure subtile */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Ombre légère pour la profondeur */
    border-radius: 8px;
    display: none; /* Liste cachée par défaut */
    margin-top: 8px; /* Espacement avec l'input */
    padding: 0; /* Supprimer le padding pour une présentation plus propre */
}

/* Élément de la liste (les <li>) */
.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333; /* Texte gris foncé */
    background-color: #f1ece1; /* Sable gris clair */
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #e2b5a7; /* Bordure beige subtile */
    list-style-type: none;
}

/* Survol de l'élément */
.autocomplete-item:hover {
    background-color: #e2d1b0; /* Beige clair au survol, légèrement plus foncé */
}


/* En-tête de catégorie */
.category-header {
    background-color: #f1f1f1; /* Gris très pâle */
    color: #495057; /* Texte gris foncé pour les catégories */
    font-weight: bold;
    padding: 10px 12px;
    font-size: 16px;
    text-transform: uppercase;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}












/* Wrapper autocomplete */
.autocomplete-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: #f4f4f8; /* Gris très clair, fond discret */
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Ombre subtile */
  transition: background 0.3s ease;
  overflow: hidden;
}

/* Champ de recherche */
#globalSearch {
  width: 80%;
  padding: 12px 40px 12px 16px;
  font-size: 16px;
  border: 1px solid #ddd; /* Bordure subtile */
  border-radius: 8px;
  box-sizing: border-box;
  background: #f8f9fa; /* Gris très pâle (évite le blanc pur) */
  transition: all 0.3s ease;
  color: #333; /* Texte plus sombre pour une meilleure lisibilité */
}

#globalSearch:focus {
  outline: none;
  border-color: #0078d7; /* Bleu clair pour focus */
  box-shadow: 0 0 8px rgba(0, 120, 215, 0.3);
}

/* Croix pour réinitialiser */
.reset-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 22px;
  color: #0078d7;
  cursor: pointer;
  display: none;
  padding: 0;
}

.reset-btn:hover {
  color: #0056b3; /* Bleu foncé au hover */
}

/* Loader */
.loader {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #0078d7;
  display: none;
}

/* Liste des résultats */
.autocompleteGlobal-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #e9ecef; /* Gris clair mais plus marqué pour séparer les résultats */
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Ombre pour la profondeur */
  min-height: 620px;
  max-height: 800px;
  overflow-y: auto;
  z-index: 1000;
  padding: 0;
  list-style: none;
  display: none; /* Start hidden */
}

/* Catégorie des sources */
.autocomplete-group {
  background: #d6d8db; /* Gris plus foncé pour marquer la catégorie */
  color: #333;
  font-weight: 600;
  padding: 10px 16px;
  border-bottom: 1px solid #c3c6ca; /* Bordure subtile */
  font-size: 14px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px 6px 0 0;
}

.autocomplete-group span.icon {
  font-size: 18px;
  color: #0078d7; /* Icône colorée */
}

/* Élément de résultat */
.autocompleteGlobal-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
  border-bottom: 1px solid #f1f5f9;
}

.autocompleteGlobal-item small {
  color: #888;
  font-size: 13px;
}

.autocompleteGlobal-item:hover {
  background: #d6e4f1; /* Léger bleu clair au hover pour bien marquer l'interaction */
  color: #0078d7;
}

/* Aucun résultat */
.no-results {
  padding: 12px 16px;
  color: #777;
  font-style: italic;
  text-align: center;
  background: #e9ecef; /* Même fond clair que les résultats */
  border-top: 1px solid #ddd;
  border-radius: 0 0 6px 6px;
}

/* Responsiveness : améliorer l'apparence sur mobile */
@media (max-width: 600px) {
  .autocomplete-wrapper {
    max-width: 100%;
    padding: 12px;
  }

  #globalSearch {
    padding: 10px 32px 10px 12px;
    font-size: 14px;
  }

  .autocomplete-group {
    font-size: 12px;
    padding: 8px 12px;
  }

  .autocompleteGlobal-item {
    padding: 10px 12px;
    font-size: 14px;
  }

  .no-results {
    font-size: 14px;
    padding: 10px 12px;
  }
}


.progress-bar {
    transition: width 0.3s ease;
  }
  
  
