/* Interface BB2 commune : accueil, espaces, analyse et administration. */
:root {
  color-scheme: dark;
  --bg: #11151c;
  --surface: #1c232e;
  --surface-alt: #161c25;
  --border: #354052;
  --text: #edf2f7;
  --muted: #aebaca;
  --yellow: #f5b800;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at top left, rgba(245,184,0,.055), transparent 55%), var(--bg); }
button, select, input { font: inherit; }
a { color: var(--yellow); }
button, a, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(1.8rem,4vw,3rem); line-height: 1.15; }
h2 { font-size: 1.35rem; }
h3 { margin-bottom: 8px; font-size: 1.1rem; }
p { line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { margin-bottom: 12px; color: var(--yellow); font-size: .8rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; padding: 16px 28px; border-bottom: 1px solid var(--border); background: rgba(17,21,28,.95); }
.brand { color: var(--text); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.brand span { color: var(--yellow); }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.session-label { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--yellow); color: #171717; }
.button-primary:hover { background: #ffca28; }
.button-secondary { border-color: #4c596c; background: #293342; color: var(--text); }
.button-secondary:hover { background: #354257; }
.button-danger { background: #79323c; color: white; }
.button-danger:hover { background: #93404c; }
.button-small { min-height: 38px; padding: 8px 13px; font-size: .875rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.full-width { width: 100%; }
.card { padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.spaces-layout { display: grid; place-items: center; min-height: calc(100dvh - 78px); padding: 32px 20px; }
.space-picker { width: 100%; max-width: 680px; padding: 36px; border-top: 3px solid var(--yellow); }
.space-picker h1 { font-size: clamp(1.7rem,4vw,2.25rem); }
.space-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.space-grid:empty { display: none; }
.space-card { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 130px; padding: 22px; border: 1px solid #5d5229; border-radius: 10px; background: #282719; color: var(--text); text-align: center; text-decoration: none; }
.space-card:hover { border-color: var(--yellow); background: #34301b; }
.space-card-title { color: var(--yellow); font-size: 1.2rem; font-weight: 800; }
.space-card-description { color: var(--muted); font-size: .9rem; }
.identity { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); }
.identity p { margin-bottom: 6px; }
.identity-name { font-size: 1.1rem; font-weight: 750; overflow-wrap: anywhere; }
.role-label { color: #f5cb48; font-size: .875rem; }
.admin-link { margin-bottom: 18px; }
.app-layout { width: 100%; max-width: 1900px; margin: auto; padding: 32px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.heading-copy { flex: 1; min-width: 0; }
.session-card { flex: 0 0 270px; background: var(--surface-alt); }
.field-label { display: block; margin: 16px 0 8px; font-size: .85rem; font-weight: 750; }
select, input[type="text"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #4c596c; border-radius: 8px; background: var(--surface-alt); color: var(--text); }
select:disabled { opacity: .65; }
.back-link { display: inline-block; margin-top: 14px; font-size: .85rem; }
.status { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.status:empty { display: none; }
.status[data-error="true"] { color: #ffb4b4; }
.match-selection { margin-bottom: 24px; }
.section-divider { height: 1px; margin: 24px 0; background: var(--border); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading p { margin-bottom: 0; }
.empty-state { margin: 22px 0; padding: 22px; border: 1px dashed #4c596c; border-radius: 8px; color: var(--muted); line-height: 1.6; }
.tab-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tab-button { padding: 11px 15px; border: 1px solid #4c596c; border-radius: 8px; background: #293342; color: var(--text); font-weight: 700; cursor: pointer; }
.tab-button:hover { background: #354257; }
.tab-button.is-active { border-color: var(--yellow); background: var(--yellow); color: #171717; }
.analysis-view { margin-top: 26px; }
fieldset { margin: 20px 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; }
legend { padding: 0 8px; font-weight: 700; }
.check-label { display: inline-flex; align-items: center; gap: 10px; margin: 6px 22px 6px 0; min-height: 30px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--yellow); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.users-section { margin-top: 24px; }
.table-wrapper { overflow-x: auto; margin-top: 22px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .85rem; }
td code { display: block; margin-top: 7px; font-size: .8rem; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: .8rem; }
.badge-active { color: #f5cb48; }
.badge-disabled { color: #ffb4b4; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
@media (max-width: 800px) {
  .page-heading { align-items: stretch; flex-direction: column; }
  .session-card { flex: auto; }
  .app-layout { padding: 20px; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; padding: 16px; }
  .topbar-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .session-label { max-width: 160px; }
  .space-picker, .card { padding: 20px; }
  .space-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .tab-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
  .tab-button { flex-shrink: 0; }
  .action-row .button { width: 100%; }
}
