/* Laoud — espace entreprise (entreprise.html), en complément de style.css. Ordinateur d'abord, utilisable au téléphone (375 px).
   Blanc pur en clair (QUALITY §7) : cartes blanches à filet, aucun aplat gris ; l'état appuyé seul fonce (--pressed).
   Tableaux empilés en cartes sous 600 px (règle de style.css, td[data-label]). Impression : seule la synthèse de l'export. */

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.co-header .wrap { min-height: 60px; }
.co-head-actions { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; }
.co-tag { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.co-who { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }

.co-main { padding: 24px 0 48px; }
.co-main:focus { outline: none; }
.co-main .wrap { max-width: 1000px; }
.co-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin: 0 0 16px; }
.co-narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.co-card p { max-width: none; }
.co-title { font-size: clamp(24px, 5vw, 30px); line-height: 1.2; margin: 0 0 8px; overflow-wrap: anywhere; }
.co-title:focus { outline: none; }
.co-h2 { font-size: 21px; margin: 0 0 8px; padding: 0; }
.co-h3 { font-size: 18px; margin: 24px 0 8px; }
.co-h4 { font-size: 16px; margin: 18px 0 6px; }
.co-lead { color: var(--text-muted); margin: 0 0 16px; }
.co-meta { color: var(--text-muted); font-size: 15px; margin: 4px 0 0; }

/* Champs */
.co-field { display: block; margin: 14px 0 0; }
.co-field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.co-field input, .co-field select, .co-field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 17px;
}
.co-field textarea { min-height: 72px; resize: vertical; }
.co-field input:focus-visible, .co-field select:focus-visible, .co-field textarea:focus-visible, .co-check input:focus-visible {
  outline: 3px solid var(--brand-text); outline-offset: 2px;
}
.co-field input[aria-invalid='true'], .co-field textarea[aria-invalid='true'] { border-color: #B91C1C; }
.co-field-error, .co-form-error { color: #B91C1C; font-weight: 600; font-size: 15px; margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { .co-field-error, .co-form-error { color: #FCA5A5; } }
.co-field-static { margin: 14px 0 0; }
.co-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; margin: 8px 0 0; }
.co-check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.co-fieldset { border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px 12px; margin: 16px 0 0; }
.co-fieldset legend { font-weight: 600; padding: 0 6px; }
.co-checks { display: flex; flex-wrap: wrap; gap: 0 18px; }
.co-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 140px)); gap: 12px; }
.co-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 16px; }
.co-inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0 14px; align-items: end; }
.co-inline-form .button { margin-top: 14px; }
.co-span { grid-column: 1 / -1; }
.co-wide { width: 100%; margin-top: 18px; }

/* Boutons */
button.button { border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 17px; }
button.button:focus-visible, .co-secondary:focus-visible, .co-link-btn:focus-visible, .co-tabs a:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 3px; }
button.button:disabled, .co-secondary:disabled { cursor: not-allowed; opacity: 0.6; }
.co-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 17px; cursor: pointer; }
.co-secondary:hover:not(:disabled) { border-color: var(--brand-text); }
.co-secondary:active:not(:disabled), .co-link-btn:active { background: var(--pressed); }
.co-link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--brand-text); font: inherit; font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.co-link-btn:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }
.co-link-btn.co-danger { color: #B91C1C; }
@media (prefers-color-scheme: dark) { .co-link-btn.co-danger { color: #FCA5A5; } }
.co-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.co-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 12px 0 0; }

/* Messages */
.co-info { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 14px 0 0; background: var(--surface); }
.co-info p { margin: 0 0 6px; } .co-info p:last-child { margin-bottom: 0; }
.co-success { color: #15803D; font-weight: 600; margin: 10px 0; }
@media (prefers-color-scheme: dark) { .co-success { color: #86EFAC; } }
.co-status { color: var(--text-muted); margin: 8px 0 0; }
.co-problems { margin: 14px 0 0; padding-left: 20px; color: #B91C1C; font-weight: 600; }
.co-summary { margin: 10px 0 0; padding-left: 20px; }
.co-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 8px 16px; margin: 12px 0 0; }
.co-facts dt { color: var(--text-muted); font-size: 14px; }
.co-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.co-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.co-copy code { overflow-wrap: anywhere; font-size: 14px; }

/* En-tête entreprise et statut (le texte dit l'état : jamais la couleur seule) */
.co-company-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; }
.co-status-text, .co-reason { grid-column: 1 / -1; margin: 6px 0 0; }
.co-reason { color: var(--text-muted); }
.co-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 2px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  font-size: 14px; font-weight: 700; white-space: nowrap; background: var(--surface); color: var(--text); }
.co-badge[data-tone='success'] { border-color: #15803D; color: #15803D; }
.co-badge[data-tone='warning'] { border-color: #B45309; color: #92400E; }
.co-badge[data-tone='danger'] { border-color: #B91C1C; color: #B91C1C; }
@media (prefers-color-scheme: dark) {
  .co-badge[data-tone='success'] { color: #86EFAC; border-color: #86EFAC; }
  .co-badge[data-tone='warning'] { color: #FCD34D; border-color: #FCD34D; }
  .co-badge[data-tone='danger'] { color: #FCA5A5; border-color: #FCA5A5; }
}

/* Onglets : actif = couleur + soulignement (Active State), aucun aplat */
.co-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--border); }
.co-tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.co-tabs a:hover { color: var(--text); }
.co-tabs a[aria-current='page'] { color: var(--brand-text); border-bottom-color: var(--brand-text); }
.co-panel { margin-top: 0; }

/* Listes (invitations, domaines) */
.co-list { list-style: none; padding: 0; margin: 8px 0 0; max-width: none; }
.co-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.co-list li:last-child { border-bottom: 0; }
.co-list .co-item-main { min-width: 0; flex: 1 1 260px; overflow-wrap: anywhere; }
.co-list .co-item-meta { display: block; color: var(--text-muted); font-size: 14px; }
.co-table-wrap td { overflow-wrap: break-word; }
.co-table-wrap td[data-label='Depuis'] { white-space: nowrap; }
.co-table-wrap select { min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; padding: 4px 8px; }
.co-actions { white-space: nowrap; }
@media (max-width: 600px) { .co-actions { white-space: normal; } }
/* Membres : 6 colonnes, trop larges sous 900 px (tablette) : empilées en cartes comme sous 600 px, sans défilement horizontal */
@media (max-width: 900px) {
  #members-wrap { border: 0; overflow: visible; }
  #members-wrap table { min-width: 0; background: transparent; }
  #members-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #members-wrap table, #members-wrap tbody, #members-wrap tr, #members-wrap td { display: block; width: 100%; }
  #members-wrap tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 0 0 10px; padding: 4px 0; }
  #members-wrap td { border: 0; padding: 8px 16px; }
  #members-wrap td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 2px; }
  #members-wrap td.co-actions { white-space: normal; }
  #members-wrap td.co-actions::before { content: none; }
}

/* Squelette : blanc à filet (aplat seulement en sombre) */
.co-skeleton { display: grid; gap: 14px; }
.sk { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; }
.sk-title { height: 34px; width: 60%; } .sk-line { height: 18px; width: 45%; } .sk-field { height: 48px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: co-pulse 1.4s ease-in-out infinite; }
  @keyframes co-pulse { 50% { opacity: 0.55; } }
}

/* Boîte de confirmation */
.co-dialog { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 22px; max-width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); }
.co-dialog::backdrop { background: rgba(9, 15, 29, 0.45); }

@media (max-width: 480px) {
  .co-tag { display: none; }
  .co-header .wrap { gap: 4px 12px; }
  .co-main { padding: 16px 0 32px; }
  .co-card { padding: 18px 16px; border-radius: 16px; }
  .co-company-head { grid-template-columns: 1fr; }
  .co-tabs a { padding: 0 10px; }
}

.co-captcha { margin: 0 0 16px; min-height: 65px; }
.co-link { display: inline-flex; align-items: center; min-height: 44px; }

@media print {
  :root { --text: #0E1730; --text-muted: #4B5875; --brand-text: #090F1D; --bg: #FFFFFF; --surface: #FFFFFF; --surface-alt: #FFFFFF; --border: #DCE1EC; --border-strong: #B8C1D6; }
  .site-header, .site-footer, .co-tabs, .co-company-head, .co-noprint, .co-panel:not(#panel-exports) { display: none !important; }
  #panel-exports > :not(#export-result), #export-result > :not(#export-print) { display: none !important; }
  .co-card { border: 0; padding: 0; }
  body { background: #FFFFFF; color: #000; }
}
