/* INTERGO — Dashboard (back-office) : styles spécifiques (en plus de tokens.css + components.css). */
body { margin: 0; }
[hidden] { display: none !important; }
.ig-boot { min-height: 100vh; display: grid; place-items: center; background: var(--ig-bg); }
.ig-spin { width: 34px; height: 34px; border: 3px solid var(--ig-line); border-top-color: var(--ig-accent); border-radius: 50%; animation: igspin .8s linear infinite; }
@keyframes igspin { to { transform: rotate(360deg); } }
/* Mini-spinner pour l'intérieur des boutons (adopte la couleur du texte du bouton). */
.ig-spin-sm { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor;
  border-radius: 50%; animation: igspin .7s linear infinite; }

/* ---- Login ---- */
.ig-login { min-height: 100vh; display: grid; place-items: center; background: var(--ig-bg); padding: 24px; }
.ig-login__card { width: 100%; max-width: 400px; background: var(--ig-surface); border: 1px solid var(--ig-line); border-radius: var(--ig-radius-xl); padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--ig-shadow-card); }
.ig-login__head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ig-login__sub { color: var(--ig-ink-3); font-size: 14px; margin: 0; }
.ig-oauth { display: flex; flex-direction: column; gap: 10px; }
.ig-oauth__btn { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ig-line-2); border-radius: var(--ig-radius); background: var(--ig-surface); color: var(--ig-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.ig-oauth__btn:hover { background: var(--ig-bg); }
.ig-sep { display: flex; align-items: center; gap: 12px; color: var(--ig-ink-3); font-size: 12px; }
.ig-sep::before, .ig-sep::after { content: ""; flex: 1; height: 1px; background: var(--ig-line); }

/* ---- Shell responsive ---- */
.ig-shell { align-items: stretch; }
.ig-sidebar { flex: 0 0 240px; position: sticky; top: 0; height: 100vh; overflow-y: auto; gap: 20px; }
.ig-sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--ig-dark-ink-2); }
.ig-main { flex: 1 1 0; min-width: 0; }
.ig-topbar { display: none; }

/* ---- Groupe nav secondaire : accès à l'interface classique (app.html) ---- */
.ig-nav-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ig-dark-line, rgba(255,255,255,.08)); }
.ig-nav-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ig-dark-ink-2); padding: 0 12px 8px; }
.ig-nav__item--ext { opacity: .78; }
.ig-nav__item--ext:hover { opacity: 1; }
.ig-nav__item--ext svg:last-child { margin-left: auto; width: 15px; height: 15px; opacity: .6; }

@media (max-width: 860px) {
  .ig-shell { flex-direction: column; }
  .ig-sidebar { position: static; height: auto; flex-basis: auto; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; overflow-x: auto; }
  .ig-sidebar .ig-nav { flex-direction: row; gap: 6px; }
  .ig-sidebar__brand-sub, .ig-sidebar__foot { display: none; }
  .ig-nav__item { white-space: nowrap; }
  .ig-main { padding: 20px 16px; }
}

/* ---- Bits ---- */
.ig-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--ig-accent-soft); color: var(--ig-info-fg); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.ig-avatar--sm { width: 34px; height: 34px; font-size: 13px; }
.ig-progress { height: 8px; border-radius: 999px; background: var(--ig-line); overflow: hidden; }
.ig-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--ig-accent); }
.ig-grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ig-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ig-logo-badge { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--ig-dark-ink-2); flex: none; overflow: hidden; }
.ig-logo-badge img { width: 100%; height: 100%; object-fit: cover; }
.ig-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ig-ink); color: #fff; padding: 12px 18px; border-radius: var(--ig-radius); font-size: 14px; font-weight: 600; z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.ig-empty { padding: 40px; text-align: center; color: var(--ig-ink-3); }
.ig-list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 60px; padding: 10px 16px; border: none; border-bottom: 1px solid var(--ig-line-3); background: var(--ig-surface); font: inherit; color: var(--ig-ink); cursor: pointer; text-align: left; width: 100%; }
.ig-list-item:last-child { border-bottom: none; }
.ig-list-item.is-active { background: var(--ig-accent-soft); box-shadow: inset 3px 0 0 var(--ig-accent); }
.ig-skel { background: linear-gradient(90deg, var(--ig-surface-2) 25%, #f6f8fa 50%, var(--ig-surface-2) 75%); background-size: 200% 100%; animation: igsk 1.2s infinite; border-radius: 8px; height: 14px; }
.ig-code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--ig-accent-soft, #EAF1FD); }
.ig-code { font-family: 'Space Grotesk', ui-monospace, monospace; font-size: 22px; font-weight: 700; letter-spacing: 3px; color: var(--ig-accent); }
.ig-onboard { margin-bottom: 20px; border-left: 4px solid var(--ig-accent); }
.ig-steps { display: flex; flex-direction: column; gap: 10px; }
.ig-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--ig-line); border-radius: 12px; background: var(--ig-bg); }
.ig-step > div { flex: 1; min-width: 0; font-size: 14px; }
.ig-step .ig-muted { font-size: 13px; }
.ig-step__n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ig-accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
@media (max-width: 560px) { .ig-step { flex-wrap: wrap; } }
.ig-modal { position: fixed; inset: 0; background: rgba(14,23,38,.5); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.ig-modal__card { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--ig-surface); border-radius: var(--ig-radius-xl, 20px); padding: 22px; box-shadow: 0 20px 60px rgba(14,23,38,.25); display: flex; flex-direction: column; gap: 12px; }
.ig-modal__head { display: flex; align-items: center; justify-content: space-between; }
.ig-modal__x { background: none; border: none; font-size: 18px; color: var(--ig-ink-3); cursor: pointer; padding: 4px 8px; }
.ig-modal__body { display: flex; flex-direction: column; gap: 12px; }

/* ---- Reflow mobile : les tableaux d'interventions deviennent des cartes (cellules avec data-label) ---- */
@media (max-width: 720px) {
  .ig-table-wrap:has(td[data-label]) { overflow: visible; border: none; }
  table.ig-table:has(td[data-label]) { min-width: 0 !important; }
  table.ig-table:has(td[data-label]) thead { display: none; }
  table.ig-table:has(td[data-label]) tr { display: block; border: 1px solid var(--ig-line); border-radius: 12px; margin-bottom: 10px; padding: 4px 12px; background: var(--ig-surface); }
  table.ig-table:has(td[data-label]) td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: none; padding: 7px 0; }
  table.ig-table:has(td[data-label]) td::before { content: attr(data-label); color: var(--ig-ink-3); font-size: 12px; font-weight: 600; flex: none; }
  table.ig-table:has(td[data-label]) td[colspan] { justify-content: center; text-align: center; flex-wrap: wrap; }
  table.ig-table:has(td[data-label]) td[colspan]::before { content: none; }
}
@keyframes igsk { to { background-position: -200% 0; } }
