/* shell.css — charte « shell » applicatif portée de x-structure sur x-geotechnique.
   Version MINIMALE : uniquement les classes réellement utilisées par le shell
   geotech (ruban m-ds-header, onglets de vue m-rib-tab, boutons d'icône, onglets
   par domaine m-mattab, états m-loading/m-card). Charge APRÈS le design-system
   et styles.css ; les tokens cuivre --m-copper sont remappés dans geo-overrides.css.
   Valeurs extraites verbatim de x-structure/src/styles.css. */

/* Tokens cuivre : définis par geo-overrides.css (chargé après, remap geotech). */

/* ═══════════════════════════════════════════════════════════════════════
   A. RUBAN / HEADER
   ═══════════════════════════════════════════════════════════════════════ */
.m-ds-header {
  position: relative;
  z-index: 1200;
  padding: 0; /* le retrait vient de .m-ds-header-inner (24px), pas du header (charte structure) */
  background: var(--surface, var(--color-card, #1e1e22));
  border-bottom: 1px solid var(--line, var(--color-border));
}
html[data-theme='dark'] .m-ds-header {
  background: rgba(28, 28, 33, 0.95);
}
.m-ds-header .m-ds-header-inner {
  max-width: none;
  width: 100%; /* annule le centrage 1280px/margin-auto du design-system */
  margin: 0;
  justify-content: flex-start; /* charte structure : logo à gauche, onglets à sa suite */
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.m-ds-header .m-ds-logo {
  min-width: 330px; /* charte structure : aligne le départ des onglets */
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.m-ds-logo-img {
  height: 26px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  display: block;
}
.m-ds-header .m-ds-logo-text {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tx, var(--color-text));
}
.m-ds-header .m-ds-logo-suffix {
  color: var(--m-copper-dark);
}
html[data-theme='dark'] .m-ds-header .m-ds-logo-suffix {
  color: var(--m-copper-light);
}
.m-ds-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

/* Ruban onglets de vue (parité site.madior.io) : 9px uppercase, soulignement cuivre. */
.m-rib-tabs {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 0;
  margin: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.m-rib-tabs::-webkit-scrollbar {
  height: 0;
}
.m-rib-tabs:empty {
  display: none;
}
.m-rib-tab {
  display: inline-flex;
  align-items: center;
  height: 100%;
  min-height: 36px; /* = min-height du header (charte structure) */
  padding: 0 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-muted, #8a8a94);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.12s,
    background 0.12s,
    border-color 0.12s;
}
.m-rib-tab:hover {
  color: var(--color-text, #e8e8ee);
  background: rgba(198, 142, 99, 0.06);
}
@media (max-width: 600px) {
  .m-rib-tab {
    padding: 0 8px;
    font-size: 8px;
    letter-spacing: 0.06em;
  }
}

/* Boutons d'icône du header (thème, plein écran) */
.m-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border, #2e2e34);
  border-radius: 8px;
  background: var(--color-bg, transparent);
  color: var(--color-muted, #8a8a94);
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.m-icon-btn:hover {
  border-color: var(--m-copper);
  color: var(--m-copper);
  background: var(--color-card);
}
.m-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════
   B. ÉTATS (chargement / carte / erreur)
   ═══════════════════════════════════════════════════════════════════════ */
.m-loading {
  padding: 2rem;
  text-align: center;
  color: var(--color-muted, #8a8a94);
  font-style: italic;
}
.m-card {
  background: var(--color-card, #1e1e22);
  border: 1px solid var(--color-border, #2e2e34);
  border-radius: var(--radius, 10px);
  padding: 1.5rem;
}
.m-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--color-primary, #d4a574);
}
.m-error {
  margin: 1.5rem; /* le reste (bordure, pre) vit dans geo-overrides.css */
}

/* ═══════════════════════════════════════════════════════════════════════
   C. ONGLETS PAR DOMAINE (lanceur sous-applications)
   ═══════════════════════════════════════════════════════════════════════ */
.m-mattabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.m-mattab {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--color-border, #2e2e34);
  background: transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted, #8a8a94);
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.m-mattab:hover {
  background: rgba(212, 165, 116, 0.08);
  color: var(--tx, var(--color-text));
}
.m-mattab-active {
  background: var(--cu, #d4a574);
  color: #1a1a1a;
  border-color: var(--cu, #d4a574);
}
