/* Espaces de travail secondaires. Chargé après les styles métier. */
#view-container[data-view="agenda"],
#view-container[data-view="crm"],
#view-container[data-view="microsoft_hub"],
#view-container[data-view="integrations"],
#view-container[data-view="collaborateurs"],
#view-container[data-view="cabinet_settings"],
#view-container[data-view="admin_panel"] {
  color: #132b42;
}

/* Agenda : jours, événements et outils restent distincts au premier regard. */
[data-view="agenda"] #agenda-editor,
[data-view="agenda"] .ux-filter-panel,
[data-view="agenda"] > .card {
  border: 1px solid #d9e0e6 !important;
  background: #fff;
  border-radius: 8px !important;
  box-shadow: none !important;
}
[data-view="agenda"] #agenda-editor > summary {
  padding: 4px 0;
  color: #132b42;
  font-weight: 650;
}
[data-view="agenda"] #agenda-editor[open] > summary {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e8ec;
}
[data-view="agenda"] .ux-filter-panel label {
  min-width: 155px;
  color: #34485a;
  font-size: 13px;
  font-weight: 600;
}
[data-view="agenda"] .ux-filter-panel label:has([data-q]) { flex: 2 1 270px; }
[data-view="agenda"] .card > .border-bottom { min-width: 0; }
[data-view="agenda"] .card > .border-bottom > .text-center {
  flex: 0 0 58px;
  padding-right: 12px;
  border-right: 1px solid #e3e8ec;
  font-variant-numeric: tabular-nums;
}
[data-view="agenda"] .card > .border-bottom > .text-center strong { font-size: 22px; }
[data-view="agenda"] .card > .border-bottom > .flex-grow-1 { min-width: 0; overflow-wrap: anywhere; }
[data-view="agenda"] .card > .border-bottom:last-child { border-bottom: 0 !important; }
[data-view="agenda"] .badge { border: 1px solid #cbd6df; border-radius: 4px; }

/* CRM : filtres et actions restent utilisables quand la table défile. */
[data-view="crm"] .crm-heading { align-items: center; margin-bottom: 20px; }
[data-view="crm"] .crm-heading h1 { margin-bottom: 4px; }
[data-view="crm"] .crm-actions .btn { min-height: 38px; white-space: normal; }
[data-view="crm"] .crm-stats {
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  box-shadow: none;
}
[data-view="crm"] .crm-stats > div { min-width: 0; }
[data-view="crm"] .crm-stats > div:last-child { border-right: 0; }
[data-view="crm"] .crm-stats strong { color: #132b42; font-variant-numeric: tabular-nums; }
[data-view="crm"] .crm-client-select { margin-bottom: 16px; }
[data-view="crm"] .crm-client-select label { font-weight: 650; }
[data-view="crm"] .crm-filters { border-color: #d9e0e6; border-radius: 8px; }
[data-view="crm"] .crm-filters label { color: #34485a; font-weight: 600; }
[data-view="crm"] .crm-table { min-width: 820px; }
[data-view="crm"] .table-responsive { border: 1px solid #d9e0e6; border-radius: 8px; }
[data-view="crm"] .crm-table td { border-bottom: 1px solid #e3e8ec; }
[data-view="crm"] .crm-table tbody tr:last-child td { border-bottom: 0; }
[data-view="crm"] .crm-columns { margin-top: 24px; }
[data-view="crm"] .crm-columns > section { border-color: #d9e0e6; border-radius: 8px; }
[data-view="crm"] .crm-contact { border-color: #d9e0e6; border-radius: 6px; }
[data-view="crm"] .crm-timeline-entry { border-left-color: #375976; }

/* Microsoft 365 : le bandeau reste simple et les messages ont une surface stable. */
[data-view="microsoft_hub"] #ms-hub-tabs { border-bottom-color: #d9e0e6; }
[data-view="microsoft_hub"] #ms-hub-tabs .nav-link {
  border-radius: 0 !important;
  padding: 10px 0;
  white-space: nowrap;
}
[data-view="microsoft_hub"] #ms-hub-tabs .nav-link.active {
  background: transparent !important;
  color: #132b42 !important;
  box-shadow: inset 0 -2px #132b42 !important;
}
[data-view="microsoft_hub"] #ms-hub-content { min-width: 0; }
[data-view="microsoft_hub"] #ms-hub-content > .card,
[data-view="microsoft_hub"] #ms-hub-content .list-group {
  border: 1px solid #d9e0e6;
  border-radius: 8px !important;
  box-shadow: none !important;
}
[data-view="microsoft_hub"] #ms-hub-content .list-group-item {
  border-color: #e3e8ec;
  background: #fff;
  color: #132b42;
}
[data-view="microsoft_hub"] #ms-hub-content .list-group-item:hover { background: #f6f8fa; }
[data-view="microsoft_hub"] #ms-hub-content .list-group-item:last-child { border-bottom: 0; }
[data-view="microsoft_hub"] #ms-hub-content .list-group-item .d-flex > div:first-child { min-width: 0; overflow-wrap: anywhere; }
[data-view="microsoft_hub"] #ms-hub-content .input-group { min-width: 0; }
[data-view="microsoft_hub"] #ms-hub-content .btn-dark { border-radius: 6px !important; }

/* Connexions : états d'accès, résultats et commandes sur un même rythme. */
[data-view="integrations"] .integrations { max-width: 1500px; }
[data-view="integrations"] .integrations > h1 { margin-bottom: 18px; }
[data-view="integrations"] .metier-subnav {
  margin-bottom: 20px;
  border-bottom: 1px solid #d9e0e6;
  white-space: nowrap;
  overflow-x: auto;
}
[data-view="integrations"] .metier-subnav button { flex-shrink: 0; }
[data-view="integrations"] [data-pane] { min-width: 0; }
[data-view="integrations"] [data-connectors] > section,
[data-view="integrations"] [data-diagnostics] > section {
  border: 1px solid #d9e0e6 !important;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}
[data-view="integrations"] [data-diagnostics] > section > h3 { color: #132b42; font-size: 16px; }
[data-view="integrations"] .metier-table { max-width: 100%; overflow-x: auto; }
[data-view="integrations"] .metier-table table { min-width: 620px; }
[data-view="integrations"] [role="status"]:empty,
[data-view="integrations"] [role="alert"]:empty { display: none; }

/* Administration : sections lisibles, champs faciles à cibler. */
[data-view="collaborateurs"] .table-responsive,
[data-view="cabinet_settings"] .card,
[data-view="admin_panel"] .card {
  border: 1px solid #d9e0e6 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
[data-view="collaborateurs"] .table-responsive { overflow-x: auto; }
[data-view="collaborateurs"] .table { min-width: 690px; }
[data-view="collaborateurs"] .btn-group { gap: 2px; }
[data-view="collaborateurs"] .btn-group > .btn { min-width: 34px; min-height: 34px; border-radius: 5px !important; }
[data-view="cabinet_settings"] .ux-settings-nav button { min-height: 38px; border-radius: 6px; }
[data-view="cabinet_settings"] .card h6 { color: #132b42; }

@media (max-width: 767px) {
  [data-view="agenda"] .ux-filter-panel label { flex: 1 1 42%; min-width: 0; }
  [data-view="agenda"] .ux-filter-panel label:has([data-q]) { flex-basis: 100%; }
  [data-view="agenda"] .card > .border-bottom { align-items: flex-start !important; }
  [data-view="agenda"] .card > .border-bottom > .flex-grow-1 { flex: 1 1 calc(100% - 80px); }
  [data-view="agenda"] .card > .border-bottom > button { margin-left: 70px; }
  [data-view="crm"] .crm-actions { width: 100%; }
  [data-view="crm"] .crm-actions .btn { flex: 1 1 auto; }
  [data-view="crm"] .crm-stats > div:nth-child(2) { border-right: 0; }
  [data-view="crm"] .crm-stats > div:nth-child(-n+2) { border-bottom: 1px solid #d9e0e6; }
  [data-view="crm"] .crm-client-select { align-items: stretch; }
  [data-view="crm"] .crm-client-select label,
  [data-view="crm"] .crm-client-select select { width: 100%; max-width: none; }
  [data-view="crm"] .crm-filters label { flex: 1 1 42%; }
  [data-view="crm"] .crm-filters label:first-child { flex-basis: 100%; }
  [data-view="microsoft_hub"] #ms-hub-content > .d-flex:has(#ms-mail-search) { flex-wrap: wrap; }
  [data-view="microsoft_hub"] #ms-hub-content > .d-flex:has(#ms-mail-search) > .btn { width: 100%; }
  [data-view="microsoft_hub"] #ms-hub-content .list-group-item .d-flex > .text-end { min-width: 70px; }
  [data-view="integrations"] [data-diagnostics] > section { padding: 14px; }
  [data-view="integrations"] .metier-toolbar > label { flex: 1 1 100%; }
  [data-view="integrations"] .metier-actions > .btn { min-height: 38px; }
}
