/* Variables CSS */
:root {
  --gradient-primary: linear-gradient(90deg, #244491 0%, #3965ce 100%);
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-secondary: #f59e0b;
  --color-accent: #06b6d4;
  --color-accent-dark: #0891b2;
  --color-hover: #ffdd57;
  --color-icons: #000000;
}

/* Reset et configuration de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  color: #333;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.settings-page {
  height: auto;
  min-height: 100vh;
  overflow: auto;
  background: #f5f7fb;
}

/* Header */
header {
  background: var(--gradient-primary);
  color: white;
  padding: 5px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), inset 0 3px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  /* Permet au contenu de passer sur 2 lignes avant le breakpoint */
  flex-wrap: wrap;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease, opacity 0.3s ease, padding 0.3s ease,
    max-height 0.3s ease;
}

header.header-collapsed {
  transform: translateY(-110%);
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

header.header-collapsed.header-peek {
  transform: translateY(0);
  opacity: 1;
  max-height: 400px;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow: visible;
  pointer-events: auto;
}

.header-title {
  /* Occupe l'espace disponible mais peut passer à la ligne */
  flex: 1 1 320px;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  height: 80px;
  width: auto;
  filter: brightness(0) invert(1); /* Rendre le logo blanc pour contraster avec le fond bleu */
}

/* Hamburger Menu Icon */
.menu-icon {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  transition: transform 0.3s;
}

.menu-icon:hover {
  transform: scale(1.1);
}

.menu-icon span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}

.menu-icon:hover span {
  background: var(--color-hover);
}

.header-visibility-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.header-visibility-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.header-visibility-btn:active {
  transform: scale(0.95);
}

.header-visibility-btn i {
  font-size: 18px;
}

/* App Name Section */
.app-name {
  flex: 1;
}

.header-title h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 5px;
}

.header-title p {
  font-size: 14px;
  opacity: 0.9;
}

/* Dropdown Menu */
.dropdown-menu {
  position: fixed !important;
  top: 100px !important;
  left: 20px !important;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none;
  z-index: 99999 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  pointer-events: none;
}

.dropdown-menu.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.dropdown-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dropdown-menu li {
  margin: 0;
  animation: slideInLeft 0.3s ease-out forwards;
  opacity: 0;
}

.dropdown-menu.active li:nth-child(1) {
  animation-delay: 0.05s;
}
.dropdown-menu.active li:nth-child(2) {
  animation-delay: 0.1s;
}
.dropdown-menu.active li:nth-child(3) {
  animation-delay: 0.15s;
}
.dropdown-menu.active li:nth-child(4) {
  animation-delay: 0.2s;
}
.dropdown-menu.active li:nth-child(5) {
  animation-delay: 0.25s;
}
.dropdown-menu.active li:nth-child(6) {
  animation-delay: 0.3s;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 56px;
  height: 56px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 28px;
  color: var(--color-icons);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  width: 200px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.dropdown-menu a:hover .menu-icon-text {
  color: var(--color-hover);
}

.dropdown-menu a:active {
  transform: scale(0.98);
}

.dropdown-menu .menu-icon-text {
  font-size: 22px;
  min-width: 22px;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

/* Texte du menu (caché par défaut) */
.dropdown-menu a::after {
  content: attr(data-tooltip);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.dropdown-menu a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Search Container in Header */
#search-container {
  /* Laisse plus de flexibilité pour passer en dessous du titre si nécessaire */
  flex: 2 1 420px;
  min-width: 260px;
  max-width: 720px;
  position: relative;
}

.search-header {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

#search-type {
  padding: 12px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: white;
  color: #374151;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  min-width: 110px;
}

#search-type:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

#search-type:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#address-search,
#owner-select {
  flex: 1;
  padding: 12px 15px;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  border: 1px solid #e5e7eb;
  background: white;
}

#address-search {
  color: #374151;
}

#address-search:hover {
  border-color: #d1d5db;
}

#address-search:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#owner-select {
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}

#owner-select:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

#owner-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Affichage des informations utilisateur dans le header */
.user-info-display {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 10px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.user-info-display i {
  font-size: 25px;
}

.user-info-display:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Ancien bouton Filtres - conservé pour compatibilité mais n'est plus utilisé */
.filter-btn {
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-btn:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  transform: scale(1.1);
}

.filter-btn:active {
  transform: scale(0.95);
}

.filter-btn i {
  font-size: 18px;
}

#search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

/* Parcelle navigator (pour la recherche par organisme) */
#parcel-nav {
  display: none; /* activé en JS */
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

#parcel-nav button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  min-width: 45px;
}

#parcel-nav button:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

#parcel-nav button:active {
  background: #f3f4f6;
}

#parcel-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #fafafa;
}

#parcel-label {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f8ff;
  color: #333;
  font-weight: 600;
  border: 1px solid #e6e9ff;
}

.search-result-item {
  padding: 8px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

.search-result-item strong {
  color: #333;
  display: block;
  margin-bottom: 2px;
}

.search-result-item small {
  color: #666;
  font-size: 12px;
}

.search-result-item small.city-info {
  display: none;
}

.search-result-item .owner-info {
  color: var(--color-accent);
  font-weight: 500;
}

/* Map Container */
#map {
  flex: 1;
  position: relative;
}

/* Footer */
footer {
  background: #2d3436;
  color: #dfe6e9;
  padding: 5px 20px;
  font-size: 12px;
  z-index: 1000;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-credits {
  margin: 0;
  flex: 1;
  text-align: left;
}

/* Coordonnées GPS */
.mouse-coordinates {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 500;
  color: #a8dadc;
  border: 1px solid rgba(168, 218, 220, 0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mouse-coordinates i {
  /*color: #ffdd57;
  font-size: 14px;*/
}

.mouse-coordinates:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(168, 218, 220, 0.4);
  transform: scale(1.02);
}

#coords-display {
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-credits {
    text-align: center;
  }
}

/* Popup Styles */
.parcel-popup h3 {
  color: var(--color-primary);
  font-size: 16px;
  margin-bottom: 10px;
}

.parcel-popup p {
  margin: 6px 0;
  font-size: 13px;
}

.parcel-popup strong {
  color: #555;
}

.parcel-popup .owner-name {
  color: var(--color-accent);
  font-weight: 600;
}

.parcel-popup .external-link {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.parcel-popup .external-link a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.parcel-popup .external-link a:hover {
  text-decoration: underline;
}

.parcel-popup .edit-button {
  margin-top: 8px;
}

.parcel-popup .btn-edit {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  width: 100%;
  transition: all 0.3s;
}

.parcel-popup .btn-edit:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 15px;
}

.section-label {
  background: rgba(0, 184, 148, 0.9);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 600;
  font-size: 12px;
  box-shadow: none;
}

.section-label::before {
  display: none;
}

/* Address markers */
.address-marker {
  background: transparent;
  border: none;
}

.address-dot {
  width: 8px;
  height: 8px;
  background: #ff6b6b;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.address-marker:hover .address-dot {
  transform: scale(1.5);
  background: #ff4757;
}

/* Address popup */
.address-popup {
  min-width: 200px;
}

.address-popup strong {
  color: #ff6b6b;
  font-size: 14px;
}

/* Scrollbar personnalisée */
#search-results::-webkit-scrollbar {
  width: 8px;
}

#search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#search-results::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

#search-results::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 15px;
  }

  /* Evite que le titre ne force une hauteur de 320px
       (flex-basis s'applique sur la hauteur en colonne) */
  .header-title {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .header-title h1 {
    font-size: 20px;
    margin-bottom: 3px;
  }

  .header-title p {
    font-size: 12px;
  }

  #search-container {
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .search-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  #address-search,
  #owner-select {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    padding: 10px 12px;
  }

  #search-type {
    font-size: 13px;
    padding: 10px 12px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 8px 10px;
    gap: 8px;
  }

  .header-title h1 {
    font-size: 18px;
  }

  .header-title p {
    font-size: 11px;
  }

  #search-type,
  #address-search,
  #owner-select {
    font-size: 12px;
    padding: 8px 10px;
  }

  .search-header {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
  }

  #address-search,
  #owner-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .filter-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .filter-btn i {
    font-size: 16px;
  }

  footer {
    font-size: 10px;
    padding: 8px 10px;
  }
}

/* Loading indicator */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Leaflet control customization */
.leaflet-top,
.leaflet-bottom {
  z-index: 999 !important;
}

.leaflet-control-layers {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.leaflet-bar a {
  border-radius: 4px;
}

.measure-node {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.custom-measure-control {
  margin-top: 6px;
}

.custom-measure-control a {
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
}

.custom-measure-control a:hover {
  background: var(--color-primary);
  color: #fff;
}

.custom-measure-control a.active {
  background: var(--color-primary);
  color: #fff;
}

.measure-append .leaflet-interactive {
  cursor: copy !important;
}

.measure-active .measure-node {
  cursor: move !important;
}

.measure-active .leaflet-interactive {
  cursor: crosshair !important;
}

.custom-measure-control a {
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
}

.custom-measure-control a:hover {
  background: var(--color-primary);
  color: #fff;
}

.custom-measure-control a.active {
  background: var(--color-primary);
  color: #fff;
}

.measure-append .leaflet-interactive {
  cursor: copy !important;
}

.measure-active .leaflet-interactive {
  cursor: crosshair !important;
}

/* Désactiver les effets visuels de survol sur les parcelles */
.leaflet-interactive:hover {
  opacity: inherit !important;
}

/* PPRN popup */
.pprn-popup h3 {
  color: #d63031;
  font-size: 16px;
  margin-bottom: 10px;
  border-bottom: 2px solid #d63031;
  padding-bottom: 5px;
}

.pprn-popup p {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.pprn-popup strong {
  color: #555;
  display: inline-block;
  min-width: 100px;
}

/* PLU popup */
.plu-popup h3 {
  color: var(--color-primary);
  font-size: 16px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 5px;
}

.plu-popup p {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.plu-popup strong {
  color: #555;
  display: inline-block;
  min-width: 110px;
}
#parcel-select {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 500;
}

#parcel-select:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

#parcel-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Modal d'édition */
.edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.edit-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #f0f0f0;
  background: var(--color-primary);
  color: white;
  border-radius: 12px 12px 0 0;
}

.edit-modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 32px;
  color: white;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.edit-form {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group label i {
  color: var(--color-primary);
  margin-right: 6px;
  width: 16px;
  display: inline-block;
  text-align: center;
}

.edit-modal-header h2 i {
  margin-right: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
}

.form-group select[multiple] {
  padding: 8px;
  height: auto;
}

.form-group select[multiple] option {
  padding: 8px 12px;
  border-radius: 4px;
  margin: 2px 0;
}

.form-group select[multiple] option:checked {
  background: var(--color-primary);
  color: white;
}

.custom-filter-summary {
  border: 1px dashed #d9d9d9;
  border-radius: 10px;
  padding: 14px;
  background: #fafafa;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.custom-filter-summary #custom-filter-summary-text {
  flex: 1 1 250px;
  font-weight: 500;
  color: #333;
}

.custom-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.advanced-filter-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.advanced-filter-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.advanced-filter-entry {
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.advanced-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.advanced-filter-row .logic-select {
  max-width: 110px;
}

.advanced-filter-row .advanced-filter-remove {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-weight: 600;
}

.btn-outline {
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid var(--color-primary);
  background: white;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-link {
  border: 1px dashed var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
  padding: 10px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-link:hover {
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid rgba(59, 130, 246, 0.3);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-secondary);
}

.custom-filter-modal .edit-modal-content {
  max-width: 860px;
}

.custom-filter-modal-header h2 {
  margin: 0;
}

.custom-filter-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.custom-filter-intro {
  margin-top: 0;
  margin-bottom: 10px;
  color: #555;
}

#custom-filter-value-container textarea,
#custom-filter-value-container input,
#custom-filter-value-container select {
  width: 100%;
}

#custom-filter-value-container textarea:disabled,
#custom-filter-value-container input:disabled,
#custom-filter-value-container select:disabled,
#custom-filter-field-page:disabled,
#custom-filter-operator-page:disabled,
#custom-filter-dataset:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.custom-filter-hint {
  display: block;
  margin-top: 6px;
  color: #666;
  font-size: 13px;
  min-height: 18px;
}

.form-actions.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

@media (max-width: 768px) {
  .custom-filter-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .custom-filter-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.form-group input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s;
  background: white;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.btn-cancel,
.btn-save {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-cancel {
  background: #e0e0e0;
  color: #555;
}

.btn-cancel:hover {
  background: #d0d0d0;
  transform: translateY(-1px);
}

.btn-save {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-save:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.btn-save:active {
  transform: translateY(0);
}

/* Scrollbar pour le modal */
.edit-modal-content::-webkit-scrollbar {
  width: 10px;
}

.edit-modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.edit-modal-content::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}

.edit-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* Responsive pour le modal */
@media (max-width: 768px) {
  .edit-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .edit-modal-header {
    padding: 16px 20px;
  }

  .edit-modal-header h2 {
    font-size: 18px;
  }

  .edit-form {
    padding: 20px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-cancel,
  .btn-save {
    width: 100%;
  }
}

/* ========================================
   BANDEAU D'INFORMATION
======================================== */

#info-banner,
#dossier-banner {
  background: var(--gradient-primary);
  color: white;
  padding: 5px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 3px 8px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out,
    max-height 0.3s ease-out;
  transform-origin: top;
  overflow: hidden;
  position: relative;
}

#info-banner.show,
#dossier-banner.show {
  animation: slideDown 0.3s ease-out;
}

#info-banner.hide,
#dossier-banner.hide {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

.info-banner-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: none;
  margin: 0;
}

.info-section {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.info-section i {
  font-size: 25px;
  opacity: 0.9;
}

.nav-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.nav-btn:hover {
  color: var(--color-hover);
  transform: scale(1.15);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-btn:disabled:hover {
  color: white;
  transform: scale(1);
}

#current-parcel-info {
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

.close-banner-btn {
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.close-banner-btn:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  transform: scale(1.1);
}

.close-banner-btn:active {
  transform: scale(0.95);
}

.close-banner-btn i {
  transition: transform 0.3s ease;
  font-size: 18px;
}

.close-banner-btn.collapsed i {
  transform: rotate(180deg);
}

#info-banner.dossier-mode .close-banner-btn {
  display: none;
}

/* Styles pour la section dossier */
.dossier-info {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
  line-height: 1.4;
}

/* Responsive pour le bandeau */
@media (max-width: 768px) {
  #info-banner {
    padding: 10px 15px;
  }

  .info-banner-content {
    gap: 10px;
  }

  .info-section {
    font-size: 12px;
    padding: 4px 10px;
    flex: 1 1 auto;
    min-width: fit-content;
  }

  #current-parcel-info {
    min-width: 80px;
    font-size: 12px;
  }

  .nav-btn {
    width: 28px;
    height: 28px;
  }
}

/* ========================================
   LISTE DÉROULANTE DES PARCELLES
======================================== */

.parcel-list-dropdown {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000;
  min-width: 200px;
}

.parcel-list-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.parcel-list-dropdown li {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: #333;
}

.parcel-list-dropdown li:last-child {
  border-bottom: none;
}

.parcel-list-dropdown li:hover {
  background-color: #f5f5f5;
}

.parcel-list-dropdown li.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.parcel-list-dropdown li.active:hover {
  background: linear-gradient(135deg, #5568d3 0%, #65408a 100%);
}

.parcel-list-dropdown li.active {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
}

.parcel-list-dropdown li.active:hover {
  background: var(--color-primary);
  filter: brightness(0.9);
}
/* ========================================
   PAGE PARAMÊTRES
======================================== */

.settings-page header {
  position: relative;
  overflow: visible;
}

.settings-header {
  background: white;
  color: #0f172a;
  padding: 32px clamp(20px, 5vw, 60px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.settings-title {
  flex: 1 1 320px;
}

.settings-title h1 {
  font-size: clamp(26px, 4vw, 36px);
  margin-bottom: 10px;
}

.settings-title p {
  color: #475569;
  line-height: 1.5;
}

.settings-kicker {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.settings-button {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.settings-button.primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.settings-button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.settings-button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.settings-button.ghost {
  background: transparent;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.settings-button.outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.settings-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.settings-main {
  padding: 40px clamp(20px, 5vw, 60px);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Onglets de navigation */
.settings-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  margin-bottom: 10px;
}

.settings-tab {
  background: transparent;
  border: none;
  padding: 5px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  position: relative;
}

.settings-tab i {
  font-size: 16px;
}

.settings-tab:hover {
  background: #f1f5f9;
  color: #334155;
}

.settings-tab.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.settings-tab.active:hover {
  background: var(--color-primary-dark);
  color: white;
}

.tab-panels {
  display: flex;
  flex-direction: column;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.settings-card h2 {
  font-size: clamp(20px, 3vw, 26px);
}

.settings-description {
  color: #475569;
  margin-bottom: 24px;
}

.settings-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.metric {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.metric strong {
  font-size: 28px;
  color: #0f172a;
}

.metric.wide p {
  color: #0f172a;
  margin: 0;
  font-weight: 600;
}

.settings-hint {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  color: #b45309;
  font-size: 15px;
}

.settings-hint i {
  margin-top: 2px;
}

.fields-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-empty {
  border: 2px dashed rgba(15, 23, 42, 0.2);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  color: #475569;
}

.settings-empty i {
  font-size: 32px;
  margin-bottom: 10px;
  color: var(--color-primary);
}

.field-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 20px;
  background: #fdfdfd;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.field-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 18px;
}

.field-order {
  font-size: 12px;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.field-title {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.field-card-actions {
  display: inline-flex;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0f172a;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-btn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.icon-btn.danger {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.4);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.field-grid label,
.field-options label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #475569;
}

.field-grid input,
.field-grid select,
.field-options textarea,
.field-options input {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  color: #0f172a;
}

.field-options {
  display: none;
}

.field-options.visible {
  display: block;
}

.field-options textarea {
  min-height: 110px;
  resize: vertical;
}

.settings-note {
  margin-top: 18px;
  font-size: 14px;
  color: #64748b;
}

.status-chip {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e2e8f0;
  color: #0f172a;
}

.status-chip.loading,
.status-chip.saving {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
}

.status-chip.dirty {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.status-chip.saved {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.status-chip.error {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

/* Onglet Données & Export */
.data-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.data-action-card {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.data-action-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.data-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.data-action-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-action-content h3 {
  font-size: 18px;
  color: #0f172a;
  margin: 0;
}

.data-action-content p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Onglet Cartes & Fonds */
.map-settings h3 {
  font-size: 18px;
  color: #0f172a;
  margin: 24px 0 16px;
}

.map-settings h3:first-child {
  margin-top: 0;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  border-color: var(--color-primary);
  background: #f1f5f9;
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkbox-content strong {
  font-size: 15px;
  color: #0f172a;
}

.checkbox-content span {
  font-size: 14px;
  color: #64748b;
}

.map-position-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-field span {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.input-field input {
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.input-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Styles pour le select */
.input-field select {
  padding: 12px 40px 12px 16px;
  border: 2px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.input-field select:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background-color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.input-field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background-color: white;
}

.input-field select option {
  padding: 12px;
  font-size: 15px;
  color: #0f172a;
  background: white;
}

.input-field select option:hover {
  background: #eff6ff;
}

.input-field small {
  font-size: 13px;
  color: #64748b;
  margin-top: -4px;
}

/* Onglet Avancé */
.advanced-settings h3 {
  font-size: 18px;
  color: #0f172a;
  margin: 24px 0 16px;
}

.advanced-settings h3:first-child {
  margin-top: 0;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.danger-zone {
  margin-top: 24px;
  padding: 20px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
}

.danger-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.danger-warning i {
  color: #dc2626;
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.danger-warning p {
  color: #991b1b;
  margin: 0;
}

.settings-button.danger {
  background: white;
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

.settings-button.danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* Onglet Thème */
.theme-card .theme-preview-chips {
  display: flex;
  gap: 8px;
}

.theme-chip {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.theme-chip[data-theme-chip="primary"] {
  background: var(--color-primary);
  color: white;
}

.theme-chip[data-theme-chip="secondary"] {
  background: var(--color-secondary);
  color: white;
}

.theme-chip[data-theme-chip="accent"] {
  background: var(--color-accent);
  color: white;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-field > span {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.color-input {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-input input[type="color"] {
  width: 60px;
  height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  cursor: pointer;
  padding: 4px;
}

.color-value {
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.gradient-section {
  margin: 24px 0;
}

.gradient-preview {
  height: 120px;
  border-radius: 16px;
  margin-bottom: 20px;
  background: var(--gradient-primary);
}

.gradient-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.angle-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.angle-control > span {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.angle-control input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  accent-color: var(--color-primary);
}

@media (max-width: 768px) {
  .settings-header {
    padding: 24px;
  }

  .settings-main {
    padding: 24px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    justify-content: flex-start;
  }
}
.advanced-filter-intro {
  margin-top: 0;
  margin-bottom: 12px;
  color: #444;
}

/* Page d'accueil pour dossier partagé */
#shared-dossier-welcome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in;
}

.shared-welcome-overlay {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-accent) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shared-welcome-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  padding: 40px;
  animation: slideUp 0.4s ease-out;
}

.shared-welcome-header {
  text-align: center;
  margin-bottom: 30px;
}

.shared-welcome-header h1 {
  font-size: 28px;
  color: #333;
  margin: 0;
}

.shared-welcome-body {
  margin-bottom: 30px;
}

.shared-info-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.shared-info-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.shared-info-row:last-child {
  margin-bottom: 0;
}

.shared-info-row i {
  font-size: 20px;
  color: var(--color-accent);
  margin-top: 2px;
  min-width: 20px;
}

.shared-info-row div {
  flex: 1;
}

.shared-info-row strong {
  display: block;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.shared-info-row p {
  color: #333;
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

.shared-welcome-message {
  background: #e0f2fe;
  border-left: 4px solid var(--color-accent);
  padding: 15px;
  border-radius: 4px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.shared-welcome-message i {
  color: var(--color-accent);
  font-size: 18px;
  margin-top: 2px;
}

.shared-welcome-message p {
  margin: 0;
  color: #0c4a6e;
  line-height: 1.6;
}

.shared-welcome-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.shared-welcome-actions button {
  padding: 12px 24px;
  font-size: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .shared-welcome-content {
    padding: 24px;
  }

  .shared-welcome-header h1 {
    font-size: 24px;
  }

  .shared-info-row p {
    font-size: 14px;
  }

  .shared-welcome-actions {
    flex-direction: column-reverse;
  }

  .shared-welcome-actions button {
    width: 100%;
  }
}

/* Menu de partage avec durée */
.share-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  animation: slideDown 0.2s ease-out;
  overflow: hidden;
}

.share-menu::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

.share-menu-header {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-menu-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #333;
}

.share-menu-item:hover {
  background: #f0f9ff;
  color: var(--color-primary);
}

.share-menu-item:active {
  background: #e0f2fe;
}

.share-menu-item i {
  color: var(--color-accent);
  font-size: 16px;
  min-width: 20px;
}

.share-menu-item span {
  flex: 1;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ==================== AUTHENTIFICATION & MODE LECTURE SEULE ==================== */

/* Style pour les boutons désactivés en mode lecture seule */
button.readonly-disabled,
a.readonly-disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

button.readonly-disabled:hover,
a.readonly-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Animation pour le spinner de chargement PDF */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Système de notifications toast */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: all;
  animation: slideIn 0.6s ease-out;
  border-left: 4px solid #3498db;
}

.toast.success {
  border-left-color: #27ae60;
}

.toast.error {
  border-left-color: #e74c3c;
}

.toast.warning {
  border-left-color: #f39c12;
}

.toast.info {
  border-left-color: #3498db;
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: #27ae60;
}

.toast.error .toast-icon {
  color: #e74c3c;
}

.toast.warning .toast-icon {
  color: #f39c12;
}

.toast.info .toast-icon {
  color: #3498db;
}

.toast-content {
  flex: 1;
}

.toast-message {
  color: #2c3e50;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.toast-close {
  background: none;
  border: none;
  color: #95a5a6;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.toast-close:hover {
  background: #ecf0f1;
  color: #7f8c8d;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOut 0.3s ease-in forwards;
}

@media (max-width: 768px) {
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }
}
