/* Calepinage Satellite — Complis v1.9.0
   Styles extraits du prototype-calepinage-satellite.html
   Préfixe : classes spécifiques à ce module, pas de conflit avec Complis existant */

/* Split carte / sidebar */
.calep-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 0;
  height: calc(100vh - 200px);
}
.map-area {
  position: relative;
  min-height: 0;
}
#calep-sat-map {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

/* Toolbar flottante sur la carte */
.map-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
}
.map-toolbar-row { display: flex; gap: 6px; align-items: center; }
.map-toolbar label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #64748B;
  font-weight: 600;
}
.map-toolbar select, .map-toolbar input[type="number"] {
  padding: 5px 8px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 12px;
  flex: 1;
}
.toolbar-btn {
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.toolbar-btn:hover { background: #e2e8f0; }
.toolbar-btn.primary {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
}
.toolbar-btn.primary:hover { background: #1D4ED8; }
.toolbar-btn.danger {
  background: #fff;
  color: #DC2626;
  border-color: #fca5a5;
}
.toolbar-btn.active {
  background: #EFF6FF;
  color: #2563EB;
  border-color: #2563EB;
  font-weight: 600;
}

/* Recherche adresse */
.search-box {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  padding: 6px;
  display: flex;
  gap: 6px;
  width: min(420px, calc(100% - 320px));
}
.search-box input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  font-family: inherit;
}
.search-box button {
  padding: 8px 14px;
  background: #2563EB;
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* Panneau latéral */
.calep-sidebar {
  background: #ffffff;
  border-left: 1px solid #E2E8F0;
  overflow-y: auto;
  padding: 16px;
}
.cs-section { margin-bottom: 20px; }
.cs-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #64748B;
  font-weight: 600;
  margin-bottom: 8px;
}
.cs-field { margin-bottom: 10px; }
.cs-field label {
  display: block;
  font-size: 12px;
  color: #64748B;
  margin-bottom: 3px;
}
.cs-field input, .cs-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  font-family: inherit;
}

/* KPI */
.kpi-mini {
  background: #EFF6FF;
  border: 1px solid #2563EB;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}
.kpi-mini-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #2563EB;
  font-weight: 600;
  letter-spacing: .4px;
}
.kpi-mini-value {
  font-size: 22px;
  font-weight: 700;
  color: #2563EB;
  margin-top: 2px;
}
.kpi-mini-hint { font-size: 11px; color: #64748B; margin-top: 2px; }

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.cs-btn-primary { background: #2563EB; color: #fff; }
.cs-btn-primary:hover { background: #1D4ED8; }
.cs-btn-ghost { background: #F8FAFC; color: #0F172A; border: 1px solid #E2E8F0; }
.cs-btn-ghost:hover { background: #e2e8f0; }
.cs-btn + .cs-btn { margin-top: 8px; }

.cs-empty-state {
  text-align: center;
  padding: 20px 12px;
  color: #64748B;
  font-size: 13px;
  background: #F8FAFC;
  border-radius: 6px;
  border: 1px dashed #E2E8F0;
}
.step-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #2563EB;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 6px;
}

/* Bannière multi-toits */
.cs-info-banner {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-left: 3px solid #D97706;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #78350F;
  margin-bottom: 12px;
  line-height: 1.45;
}
.cs-info-banner strong { color: #92400E; }
.roof-record-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.roof-record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 12px;
}
.roof-record-item .rri-name { font-weight: 600; color: #0F172A; }
.roof-record-item .rri-meta { color: #64748B; font-size: 11px; }
.roof-record-item .rri-actions button {
  padding: 3px 8px;
  font-size: 11px;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  background: #ffffff;
  margin-left: 4px;
  cursor: pointer;
  font-family: inherit;
}
.roof-record-item .rri-actions button:hover { background: #e2e8f0; }

/* Légende */
.cs-legend-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748B;
  padding-top: 6px;
}
.cs-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Nomenclature */
.cs-nomencl-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.cs-nomencl-table th { text-align: left; padding: 6px 4px; color: #64748B; font-weight: 600; border-bottom: 1px solid #E2E8F0; }
.cs-nomencl-table td { padding: 5px 4px; border-bottom: 1px solid #E2E8F0; }
.cs-nomencl-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Loader */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Message hors-ligne */
.cs-offline-banner {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #78350F;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 860px) {
  .calep-split { grid-template-columns: 1fr; }
  .calep-sidebar { max-height: 45vh; }
  .map-toolbar { max-width: 200px; padding: 8px; }
  .search-box { width: calc(100% - 220px); left: auto; right: 12px; transform: none; }
}
