/* WARPATH 030E2 — chrome du shell tenant. Réutilise les variables de
   thème déjà définies par public/dashboard.html (:root — --bg, --panel,
   --border, --text, --muted, --blue...) plutôt que d'en redéfinir une
   copie divergente. */

#tenant-shell-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  background: rgba(7,11,18,.9); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border, #1f2a44);
}
.shell-header h1 { margin: 0; font-size: 18px; letter-spacing: -.03em; color: var(--text, #e5e7eb); }
.shell-header .shell-header-meta { font-size: 12px; color: var(--muted, #94a3b8); }
.shell-header .shell-logout-btn {
  background: #334155; color: #e2e8f0; border: none; border-radius: 6px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
}

.shell-nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 24px; border-bottom: 1px solid var(--border, #1f2a44);
  background: rgba(15,23,42,.6);
}
.shell-nav-link {
  color: var(--muted, #94a3b8); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: 8px;
}
.shell-nav-link:hover { color: var(--text, #e5e7eb); background: rgba(148,163,184,.08); }
.shell-nav-link.active { color: #fff; background: var(--blue, #3b82f6); }
/* Spec V2 §6.5 — switch entre les deux MODES (Travail | Administration).
   Même famille visuelle que .shell-nav-link mais différenciée (bordure +
   fond) pour lire "changement d'espace", pas "une page de plus". */
.shell-mode-switch {
  color: var(--muted, #94a3b8); background: rgba(148,163,184,.08);
  border: 1px solid var(--border, #1f2a44); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; margin-left: 8px;
}
.shell-mode-switch:hover { color: var(--text, #e5e7eb); background: rgba(148,163,184,.14); }

#shell-notifications {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.shell-notification {
  padding: 10px 14px; border-radius: 10px; font-size: 13px;
  background: #1e293b; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.shell-notification-401, .shell-notification-403 { border-color: var(--bad, #ef4444); }
.shell-notification-429 { border-color: var(--warn, #f59e0b); }
/* Mission N3 — toasts d'événements métier (informatifs, jamais des erreurs). */
.shell-notification-info { border-color: var(--accent, #38bdf8); }
/* Mission N2 — wallboard (TV de plateau). Plein écran = fond opaque. */
.shell-wallboard { background: #0b1220; padding: 18px; border-radius: 8px; min-height: 60vh; }
.shell-wallboard:fullscreen { border-radius: 0; padding: 4vh 4vw; }
.shell-wallboard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.shell-wallboard-clock { font-size: 28px; font-variant-numeric: tabular-nums; color: var(--text, #e5e7eb); }
.shell-wallboard-head button { background: #0f172a; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.shell-wallboard-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.shell-wallboard-tile { background: #0f172a; border: 1px solid var(--border, #1f2a44); border-radius: 10px; padding: 18px; text-align: center; }
.shell-wallboard-tile.warn { border-color: var(--warn, #f59e0b); }
.shell-wallboard-tile.crit { border-color: var(--bad, #ef4444); }
.shell-wallboard-value { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text, #e5e7eb); line-height: 1.1; }
.shell-wallboard-label { font-size: 14px; color: var(--muted, #94a3b8); margin-top: 6px; }
.shell-wallboard-calls { display: flex; flex-direction: column; gap: 6px; }
.shell-wallboard-call { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; padding: 10px 14px; background: #0f172a; border: 1px solid var(--border, #1f2a44); border-radius: 8px; font-size: 18px; color: var(--text, #e5e7eb); }
.shell-wallboard-call .muted { color: var(--muted, #94a3b8); }
.shell-wallboard-call .mono { font-variant-numeric: tabular-nums; }
/* Spec V2 §6.3 — tuiles partagées wallboard/Vue d'ensemble (MOVE N2, zéro
   duplication). Même famille visuelle que .shell-wallboard-tile, échelle
   réduite pour tenir dans un bandeau cockpit plutôt qu'un plein écran TV. */
.shell-overview-tile { background: #0f172a; border: 1px solid var(--border, #1f2a44); border-radius: 8px; padding: 10px 14px; text-align: center; }
.shell-overview-tile.warn { border-color: var(--warn, #f59e0b); }
.shell-overview-tile.crit { border-color: var(--bad, #ef4444); }
.shell-overview-tile .shell-wallboard-value { font-size: 24px; }
.shell-overview-tile .shell-wallboard-label { font-size: 11px; }
/* Spec V2 §6.3 — raccourcis Administration (Vue d'ensemble, scope tenant).
   Même famille visuelle que .shell-nav-link. */
.shell-admin-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.shell-admin-shortcuts a {
  color: var(--muted, #94a3b8); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border, #1f2a44);
}
.shell-admin-shortcuts a:hover { color: var(--text, #e5e7eb); background: rgba(148,163,184,.08); }
/* Mission M6 — board kanban du pipeline (drag & drop borné aux transitions légales). */
.shell-pipeline-board { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 10px; align-items: start; overflow-x: auto; }
.shell-pipeline-col { background: #0b1220; border: 1px dashed transparent; border-radius: 8px; padding: 8px; min-height: 120px; }
.shell-pipeline-col.droppable { border-color: var(--accent, #38bdf8); }
.shell-pipeline-col-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted, #94a3b8); margin-bottom: 8px; }
.shell-pipeline-card { background: #0f172a; border: 1px solid var(--border, #1f2a44); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; color: var(--text, #e5e7eb); cursor: grab; }
.shell-pipeline-card .muted { color: var(--muted, #94a3b8); font-size: 12px; margin-top: 2px; }

.shell-body { display: flex; flex: 1; min-height: 0; }
#shell-page-outlet { flex: 1; padding: 20px 24px; overflow-y: auto; }
#shell-softphone-panel {
  width: 320px; flex-shrink: 0; border-left: 1px solid var(--border, #1f2a44);
  padding: 16px; overflow-y: auto;
}
.shell-softphone-frame { width: 100%; height: 640px; border: 0; border-radius: 12px; background: #0f172a; }

.shell-card {
  background: linear-gradient(180deg,rgba(15,23,42,.96),rgba(17,24,39,.9));
  border: 1px solid var(--border, #1f2a44); border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.shell-card h2 { margin: 0 0 12px; font-size: 14px; color: #cbd5e1; text-transform: uppercase; letter-spacing: .06em; }
.shell-home-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(148,163,184,.12); font-size: 13px; }
.shell-home-row:first-child { border-top: 0; }
.shell-home-label { color: var(--muted, #94a3b8); }
.shell-home-value { color: var(--text, #e5e7eb); text-align: right; }
.shell-home-permissions { display: flex; flex-wrap: wrap; gap: 6px; }
.shell-permission-pill {
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--border, #1f2a44); color: #cbd5e1;
}
.shell-placeholder p { color: var(--muted, #94a3b8); font-size: 13px; }

@media (max-width: 900px) {
  .shell-body { flex-direction: column; }
  #shell-softphone-panel { width: auto; border-left: 0; border-top: 1px solid var(--border, #1f2a44); }
}

/* WARPATH 030E3 — Live/Appels/Supervision/Files */
.shell-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.shell-tabs button {
  background: transparent; border: 1px solid var(--border, #1f2a44); color: var(--muted, #94a3b8);
  border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.shell-tabs button.active { background: var(--blue, #3b82f6); border-color: transparent; color: #fff; }

.shell-live-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.shell-live-controls { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted, #94a3b8); }
.shell-live-controls select { background: #0f172a; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb); border-radius: 6px; padding: 4px 8px; }
.live-status-ok { color: var(--good, #22c55e); border-color: var(--good, #22c55e); }

.live-call-row { padding: 12px 0; border-top: 1px solid rgba(148,163,184,.14); }
.live-call-row:first-child { border-top: 0; }
.live-call-supervision-controls { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.live-call-supervision-error { color: var(--bad, #ef4444); font-size: 12px; margin-top: 4px; }
.live-call-mode { background: rgba(148,163,184,.12); color: #cbd5e1; }
.live-call-supervision-unavailable button {
  background: #1e293b; color: #64748b; cursor: not-allowed;
}
.live-call-supervision-unavailable button:disabled { opacity: .6; }
.live-call-transcript-toggle { margin-top: 6px; }
.live-call-transcript-panel {
  margin-top: 8px; background: #020617; border-radius: 10px; padding: 10px;
  max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.live-call-transcript-bubble { max-width: 86%; padding: 7px 11px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.live-call-transcript-bubble.agent { align-self: flex-start; background: #1e3a5f; color: #bfdbfe; }
.live-call-transcript-bubble.prospect { align-self: flex-end; background: #1c2a1c; color: #bbf7d0; }
.live-call-transcript-bubble .role-label { font-size: 10px; opacity: .6; margin-bottom: 2px; }

.shell-supervision-feed-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid #1e293b; font-size: 13px; flex-wrap: wrap;
}
.shell-supervision-feed-action { color: var(--muted, #94a3b8); text-transform: uppercase; font-size: 11px; font-weight: 600; }

.shell-calls-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
/* Mission M5 — barre de vues nommées (savedViews.js), même langage visuel
   que la barre de filtres qu'elle précède. */
.shell-saved-views { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.shell-saved-views select, .shell-saved-views button {
  background: #0f172a; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.shell-calls-filters input, .shell-calls-filters select {
  background: #0f172a; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb);
  border-radius: 6px; padding: 6px 10px; font-size: 13px;
}
.shell-calls-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.shell-calls-table th { text-align: left; padding: 6px 10px; color: var(--muted, #94a3b8); border-bottom: 1px solid var(--border, #1f2a44); }
.shell-calls-table td { padding: 6px 10px; border-bottom: 1px solid #1e293b; color: var(--text, #e5e7eb); }
.shell-calls-pagination { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

/* WARPATH 030E4 — Commercial (CRM tenant) */
.shell-inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.shell-inline-form input, .shell-inline-form select {
  background: #0f172a; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb);
  border-radius: 6px; padding: 6px 10px; font-size: 13px;
}
.shell-lead-header { margin-bottom: 16px; }
.shell-timeline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.shell-timeline-section h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted, #94a3b8); }
.shell-timeline-section ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.shell-timeline-section li { padding: 4px 0; border-bottom: 1px solid #1e293b; }

/* Fix M5 (revue finale fiche 360) — pastilles de qualification, tags,
   résumé IA et lien fiche du board pipeline : mêmes tokens/idioms que le
   reste de ce fichier (var(--border)/var(--muted), .pill de dashboard.html
   pour la forme des pastilles/tags). */
.shell-lead-qualification { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shell-lead-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.shell-lead-tag { gap: 6px; }
.shell-lead-tag-remove {
  background: transparent; border: 0; color: var(--muted, #94a3b8); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0 2px;
}
.shell-lead-tag-remove:hover { color: var(--bad, #ef4444); }
.shell-lead-tag-add { margin: 0; }
.shell-lead-summary p { margin: 0 0 8px; font-size: 13px; }
.shell-lead-summary p:last-child { margin-bottom: 0; }
.shell-pipeline-card-link {
  display: inline-block; margin-top: 6px; font-size: 12px;
  color: var(--accent, #38bdf8); text-decoration: none;
}
.shell-pipeline-card-link:hover { text-decoration: underline; }

/* WARPATH 030E5A — Campagnes / dialer IA */
.shell-preflight-blockers { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.shell-preflight-blockers li { padding: 4px 8px; margin-bottom: 4px; background: rgba(239,68,68,.08); border-left: 2px solid var(--bad, #ef4444); border-radius: 4px; }
.shell-predictive-notice { margin-top: 16px; padding: 10px; border: 1px dashed var(--border, #1f2a44); border-radius: 6px; opacity: .7; }

/* WARPATH 030E7C1 — Agents IA / Scripts / Versions / Qualification / Outils */
.shell-two-col { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 20px; align-items: start; }
.pill-good { color: var(--good, #22c55e); border-color: var(--good, #22c55e); }
.pill-bad { color: var(--bad, #ef4444); border-color: var(--bad, #ef4444); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* WARPATH 030E7O1 — Vue d'ensemble (indicateurs), Analytics, Configuration,
   Platform Admin : grille de tuiles KPI et panneau détail générique,
   réutilisés par toutes les nouvelles pages de cette mission. */
.shell-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.shell-kpi-tile { background: rgba(148,163,184,.06); border: 1px solid var(--border, #1f2a44); border-radius: 12px; padding: 12px 14px; }
.shell-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #94a3b8); margin-bottom: 6px; }
.shell-kpi-value { font-size: 20px; font-weight: 700; color: var(--text, #e5e7eb); }
.shell-detail-panel { background: #020617; border: 1px solid var(--border, #1f2a44); border-radius: 10px; padding: 14px; margin-top: 10px; }
.shell-export-links { display: flex; flex-direction: column; gap: 8px; }
.shell-export-links a { color: var(--blue, #3b82f6); font-size: 13px; }
.shell-danger-btn { background: var(--bad, #ef4444); color: #fff; border: none; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.shell-sensitive-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 70px; width: 100%; background: #0f172a; border: 1px solid var(--border, #1f2a44); color: var(--text, #e5e7eb); border-radius: 6px; padding: 8px; }
