/* Viewer3D Dashboard – layout sidebar + carte */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: row;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #e2e8f0;
  background: #0f172a;
  overflow: hidden;
}

[hidden] { display: none !important; }

/* ── Topbar ── */

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 52px;
  padding: 0 1rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar__logo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.topbar__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

.topbar__logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.5rem;
  font-weight: 700;
  color: #64748b;
  background: #0f172a;
  border: 1px dashed #475569;
  border-radius: 6px;
}

.topbar__logo-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.5625rem;
  color: #fff;
  background: rgba(15, 23, 42, 0.8);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.topbar__logo-wrap:hover .topbar__logo-edit { opacity: 1; }
.topbar__logo-input { display: none; }

.topbar__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.topbar__subtitle {
  margin: 0;
  font-size: 0.6875rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.topbar__nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.topbar__nav-link {
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.topbar__nav-link:hover { background: #334155; color: #f1f5f9; }
.topbar__nav-link.is-active { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar__user { display: flex; align-items: center; gap: 0.4rem; }
.topbar__display-name { font-size: 0.8125rem; color: #cbd5e1; }

.topbar__btn {
  padding: 0.3rem 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: #e2e8f0;
  background: #334155;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.topbar__btn:hover { background: #475569; }
.topbar__btn--logout { color: #fca5a5; background: rgba(239, 68, 68, 0.15); }
.topbar__btn--logout:hover { background: rgba(239, 68, 68, 0.25); }
.topbar__btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Badges rôle */

.role-badge {
  display: inline-flex;
  padding: 0.1rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.role-badge--admin { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.4); }
.role-badge--contributor { background: rgba(249, 115, 22, 0.2); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.4); }
.role-badge--user { background: rgba(100, 116, 139, 0.25); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.45); }

/* ── Workspace ── */

.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ── */

.sidebar {
  display: flex;
  flex-direction: column;
  width: 300px;
  flex-shrink: 0;
  background: #1e293b;
  border-left: 1px solid #334155;
  overflow: hidden;
}

.sidebar__tabs {
  display: flex;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.sidebar__tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.sidebar__tab:hover { color: #cbd5e1; }
.sidebar__tab.is-active { color: #a5b4fc; border-bottom-color: #6366f1; }

.sidebar__panels {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.sidebar__panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar__empty {
  margin: 0;
  padding: 1.5rem 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}

/* Panneau Projet */

.project-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.project-empty__icon { color: #475569; margin-bottom: 1rem; }
.project-empty__title { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; color: #f1f5f9; }
.project-empty__text { margin: 0 0 1.25rem; font-size: 0.8125rem; color: #94a3b8; line-height: 1.5; }
.project-empty__hint { margin: 0; font-size: 0.8125rem; color: #64748b; }
.project-empty__actions { margin-bottom: 0.5rem; }

.project-import-message {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  min-height: 1.25rem;
  color: #94a3b8;
}

.project-import-message--error { color: #f87171; }
.project-import-message--success { color: #4ade80; }

.project-loaded { padding: 0.25rem 0; }

.project-form__field { margin-bottom: 0.85rem; }

.project-form__label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.project-form__input,
.project-form__textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.8125rem;
  color: #f1f5f9;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  resize: vertical;
}

.project-form__input:focus,
.project-form__textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.project-form__input:disabled,
.project-form__textarea:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #1e293b;
}

.project-form__actions { margin-top: 0.5rem; }

.cesium-ion-settings {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #334155;
}

.cesium-ion-settings__title {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
}

.cesium-ion-settings__intro {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #94a3b8;
}

.cesium-ion-settings__status {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.cesium-ion-settings__status.is-configured { color: #4ade80; }
.cesium-ion-settings__status.is-missing { color: #fbbf24; }

.cesium-ion-settings__hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.cesium-ion-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cesium-ion-settings__link {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
}

.cesium-ion-settings__link a {
  color: #a5b4fc;
  text-decoration: none;
}

.cesium-ion-settings__link a:hover { text-decoration: underline; }

/* Accès rapide simulation convoi */
.convoy-quick-access {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(56, 189, 248, 0.12) 100%);
  border: 1px solid rgba(99, 102, 241, 0.45);
}

.convoy-quick-access__title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f1f5f9;
}

.convoy-quick-access__status {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.convoy-quick-access__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.convoy-quick-access__actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.convoy-quick-access__hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

.project-save-message--error { color: #f87171; }
.project-save-message--success { color: #4ade80; }

.project-info__meta { margin: 0 0 0.75rem; font-size: 0.75rem; color: #64748b; }

.project-save-message {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  min-height: 1rem;
  color: #94a3b8;
}

.project-save-message--success { color: #4ade80; }
.project-save-message--error { color: #f87171; }

#btn-reimport-kml { margin-top: 0.75rem; }

/* Panneau Couches / Historique toolbar */

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.panel-toolbar__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.panel-toolbar__actions { display: flex; gap: 0.3rem; }

.panel-toolbar__btn {
  padding: 0.2rem 0.5rem;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.panel-toolbar__btn:hover { background: #334155; color: #f1f5f9; }

.panel-toolbar__btn.is-active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(129, 140, 248, 0.65);
  color: #c7d2fe;
}

.panel-toolbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.panel-toolbar__icon-btn:hover { background: #334155; color: #f1f5f9; }

/* Filtres (couches) */

.layers-import {
  margin: 0 0 0.75rem;
}

.upload-zone--compact {
  padding: 0.75rem 0.85rem;
  gap: 0.25rem;
}

.upload-zone--compact .upload-zone__text {
  font-size: 0.75rem;
}

.upload-zone--compact .upload-zone__hint {
  font-size: 0.625rem;
}

.layers-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.35rem;
}

.layers-group__header {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.layers-group.is-editable .layers-group__header {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 0.3rem;
}

.filter-list.is-reordering .layers-group {
  transition: transform 0.16s ease, margin 0.16s ease, box-shadow 0.12s ease;
}

.layers-group__handle {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  color: #94a3b8;
  background: rgba(51, 65, 85, 0.55);
  border: 1px solid rgba(71, 85, 105, 0.8);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: element;
}

.layers-group__handle:active {
  cursor: grabbing;
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(129, 140, 248, 0.55);
}

.layers-group.is-dragging {
  opacity: 0.35;
  transform: scale(0.98);
}

.layers-group.is-drop-before {
  box-shadow: 0 -3px 0 0 #818cf8;
  margin-top: 0.35rem;
}

.layers-group.is-drop-after {
  box-shadow: 0 3px 0 0 #818cf8;
  margin-bottom: 0.35rem;
}

.layers-group--ghost {
  position: absolute;
  top: -9999px;
  left: -9999px;
  pointer-events: none;
  opacity: 0.92;
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(129, 140, 248, 0.7);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  z-index: 9999;
}

.layers-group__header .filter-option--group {
  flex: 1;
  min-width: 0;
}

.layers-group__twist {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #94a3b8;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.layers-group__twist:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.layers-group:not(.is-collapsed) .layers-group__twist span {
  display: inline-block;
  transform: rotate(90deg);
}

.layers-group__children {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin: 0.1rem 0 0.25rem 0.85rem;
  padding-left: 0.45rem;
  border-left: 1px solid rgba(51, 65, 85, 0.8);
}

.layers-group.is-collapsed .layers-group__children {
  display: none;
}

.filter-option--group .filter-option__label {
  font-weight: 600;
}

.filter-option--section {
  flex: 0 0 auto;
  padding: 0.2rem 0.35rem;
  gap: 0.35rem;
}

.layers-section {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  border-radius: 0.3rem;
}

.layers-section__name {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.35rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layers-section__name:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #e2e8f0;
}

.layers-section__badge {
  flex-shrink: 0;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.layers-section__delete {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  background: transparent;
  color: #fca5a5;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
}

.layers-section__delete:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}

.standalone-import__intro {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.4;
}

.standalone-import__files {
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid #334155;
  font-size: 0.75rem;
  color: #cbd5e1;
  word-break: break-all;
}

.standalone-import__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.users-modal--compact {
  max-width: 28rem;
  width: calc(100% - 2rem);
}

.filter-list { display: flex; flex-direction: column; gap: 0.15rem; }

.filter-list--pointcloud {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.filter-option__swatch--pointcloud {
  background: repeating-linear-gradient(
    -45deg,
    #f59e0b,
    #f59e0b 3px,
    #1e293b 3px,
    #1e293b 6px
  ) !important;
  border: 1px dashed #fbbf24;
}

.filter-option--pointcloud .filter-option__label {
  font-weight: 500;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.35rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}

.filter-option:hover { background: rgba(51, 65, 85, 0.5); }

.filter-option__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.filter-option__box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid #475569;
  border-radius: 3px;
  background: #0f172a;
  position: relative;
  transition: border-color 0.12s, background 0.12s;
}

.filter-option__input:checked + .filter-option__box {
  border-color: #6366f1;
  background: #6366f1;
}

.filter-option__input:checked + .filter-option__box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-option__swatch {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.filter-option__label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-option__count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  background: #0f172a;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

/* Historique */

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

.history-item {
  display: flex;
  gap: 0.55rem;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

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

.history-item__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: #818cf8;
}

.history-item__icon svg { width: 16px; height: 16px; }

.history-item__details {
  margin: 0;
  font-size: 0.75rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.history-item__meta {
  margin: 0.1rem 0 0;
  font-size: 0.625rem;
  color: #64748b;
}

/* ── Carte ── */

.map-area {
  flex: 1;
  min-width: 0;
  position: relative;
}

.map {
  width: 100%;
  height: 100%;
  background: #0f172a;
}

.leaflet-container { font-family: inherit; background: #0f172a; }

.leaflet-tooltip {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.leaflet-tooltip::before { border-top-color: #475569; }

/* ── Drawer section ── */

.drawer-overlay {
  position: fixed;
  inset: 52px 300px 0 var(--app-nav-width);
  background: rgba(15, 23, 42, 0.45);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.drawer-overlay.is-visible { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 52px;
  left: var(--app-nav-width);
  bottom: 0;
  width: min(380px, calc(100vw - var(--app-nav-width) - 300px));
  z-index: 1200;
  padding: 1.25rem;
  background: #1e293b;
  border-right: 1px solid #334155;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.drawer.is-open { transform: translateX(0); }

.drawer__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.drawer__close:hover { background: #334155; color: #f1f5f9; }

.drawer__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-right: 2rem;
}

.drawer__title { margin: 0; font-size: 1.125rem; font-weight: 600; color: #f1f5f9; }

.trace-badge {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 999px;
}

.drawer__section { margin-bottom: 1.25rem; }

.drawer__label {
  margin: 0 0 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.drawer__status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.875rem;
  color: #cbd5e1;
}

.drawer__actions { display: flex; flex-direction: column; gap: 0.5rem; }
.drawer__actions .btn--secondary { margin-top: 0; }
.drawer__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #94a3b8;
}

.cloud-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cloud-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
}

.cloud-list__main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cloud-list__label {
  color: #f1f5f9;
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-word;
}

.cloud-list__meta {
  color: #94a3b8;
  font-size: 0.75rem;
}

.cloud-list__delete {
  flex-shrink: 0;
  border: 1px solid #475569;
  background: transparent;
  color: #fca5a5;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.cloud-list__delete:hover {
  background: #334155;
  color: #f87171;
}

.cloud-list__crs {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #334155;
}

.cloud-list__crs-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.cloud-list__crs-row {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.cloud-list__crs-select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.75rem;
}

.cloud-list__crs-apply {
  flex-shrink: 0;
  border: 1px solid #6366f1;
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border-radius: 0.375rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.cloud-list__crs-apply:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.28);
}

.cloud-list__crs-apply:disabled {
  opacity: 0.6;
  cursor: wait;
}

.cloud-list__crs-note {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #94a3b8;
}

.status-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; }
.status-dot--loading { background: #64748b; animation: pulse 1.2s ease-in-out infinite; }
.status-dot--custom { background: #22c55e; }
.status-dot--demo { background: #eab308; }

@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn--primary { background: #6366f1; color: #fff; }
.btn--primary:hover { background: #4f46e5; }
.btn--secondary { background: #334155; color: #e2e8f0; }
.btn--secondary:hover:not(:disabled) { background: #475569; }
.btn--secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--danger {
  background: transparent;
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.45);
}
.btn--danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.65);
}
.btn--compact { width: auto; padding: 0.4rem 0.75rem; font-size: 0.75rem; }
.btn:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }

/* Upload zone */

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.25rem 0.75rem;
  border: 2px dashed #475569;
  border-radius: 8px;
  background: #0f172a;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  text-align: center;
}

.upload-zone:hover, .upload-zone.is-dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
}

.upload-zone__icon { color: #64748b; }
.upload-zone__text { margin: 0; font-size: 0.8125rem; color: #cbd5e1; }
.upload-zone__text strong { color: #a5b4fc; }
.upload-zone__hint { margin: 0; font-size: 0.6875rem; color: #64748b; }
.upload-zone__input { display: none; }

.upload-filename { margin: 0.4rem 0 0; font-size: 0.75rem; color: #94a3b8; word-break: break-all; line-height: 1.45; }

.upload-progress {
  margin-top: 0.5rem;
  height: 4px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.copc-progress { margin-top: 0.65rem; }

.copc-progress__track {
  height: 6px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}

.copc-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.copc-progress__meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.cc-import-status {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.cc-import-status--success { border-color: rgba(74, 222, 128, 0.35); }
.cc-import-status--partial { border-color: rgba(251, 191, 36, 0.35); }
.cc-import-status--error { border-color: rgba(248, 113, 113, 0.35); }

.cc-import-status__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cc-import-status__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e2e8f0;
}

.cc-import-status__track {
  height: 6px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}

.cc-import-status__bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.cc-import-status--success .cc-import-status__bar {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.cc-import-status--partial .cc-import-status__bar {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.cc-import-status--error .cc-import-status__bar {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.cc-import-status__message {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.cc-import-skipped {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
}

.cc-import-skipped li + li { margin-top: 0.2rem; }
  line-height: 1.4;
}

.btn.btn--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.upload-message { margin: 0.5rem 0 0; font-size: 0.75rem; min-height: 1rem; }
.upload-message--success { color: #4ade80; }
.upload-message--error { color: #f87171; }

/* Modale utilisateurs */

.users-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.65);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.users-modal-overlay.is-visible { opacity: 1; pointer-events: auto; }

.users-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2100;
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  padding: 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
}

.users-modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.users-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.users-modal__close:hover { background: #334155; color: #f1f5f9; }
.users-modal__title { margin: 0 2rem 1rem 0; font-size: 1.0625rem; font-weight: 600; color: #f1f5f9; }
.users-modal__table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }

.users-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.users-table th, .users-table td { padding: 0.5rem 0.65rem; text-align: left; border-bottom: 1px solid #334155; }
.users-table th { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; background: #0f172a; }
.users-table__username { font-weight: 500; color: #f1f5f9; }
.users-table__actions { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.users-table__select { padding: 0.2rem 0.35rem; font-family: inherit; font-size: 0.6875rem; color: #e2e8f0; background: #0f172a; border: 1px solid #475569; border-radius: 4px; }
.users-table__btn { padding: 0.2rem 0.45rem; font-family: inherit; font-size: 0.625rem; font-weight: 500; border: none; border-radius: 4px; cursor: pointer; }
.users-table__btn--save { color: #e2e8f0; background: #334155; }
.users-table__btn--reset { color: #cbd5e1; background: rgba(99, 102, 241, 0.2); }
.users-table__btn--delete { color: #fca5a5; background: rgba(239, 68, 68, 0.15); }
.users-table__btn:disabled { opacity: 0.35; cursor: not-allowed; }

.users-modal__form { padding-top: 1rem; border-top: 1px solid #334155; }
.users-modal__form-title { margin: 0 0 0.85rem; font-size: 0.8125rem; font-weight: 600; color: #cbd5e1; }
.users-modal__form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-bottom: 0.65rem; }
.users-modal__field { display: flex; flex-direction: column; gap: 0.25rem; }
.users-modal__label { font-size: 0.6875rem; font-weight: 500; color: #64748b; }
.users-modal__input { padding: 0.45rem 0.55rem; font-family: inherit; font-size: 0.8125rem; color: #f1f5f9; background: #0f172a; border: 1px solid #475569; border-radius: 5px; }
.users-modal__input:focus { outline: none; border-color: #6366f1; }
.users-modal__form-message { margin: 0 0 0.65rem; font-size: 0.8125rem; }
.users-modal__form-message--success { color: #4ade80; }
.users-modal__form-message--error { color: #f87171; }
.users-modal__submit { width: auto; min-width: 100px; }

/* Responsive */

@media (max-width: 768px) {
  .workspace { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid #334155;
    order: 2;
  }
  .map-area { order: 1; }
  .drawer-overlay { inset: 52px 0 0 var(--app-nav-width); }
  .drawer { width: min(380px, calc(100vw - var(--app-nav-width))); }
  .topbar__display-name { display: none; }
  .users-modal__form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar__subtitle { display: none; }
}
