:root {
  color-scheme: light;
  --bg: #f4f5f2; --surface: #fcfcfb; --surface-2: #eef0ec; --border: #dcdfd8;
  --text: #0b0b0b; --text-2: #52514e; --muted: #76756f;
  --brand: #0f5132; --brand-ink: #ffffff; --brand-soft: #e3f0e8;
  --accent: #2a78d6; --good: #1a7f37; --bad: #c62828;
  --radius: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #242422; --border: #34342f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #9a998f;
    --brand: #3fb27f; --brand-ink: #08130d; --brand-soft: #18301f;
    --accent: #3987e5; --good: #4cc26f; --bad: #ef6b6b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #242422; --border: #34342f;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #9a998f;
  --brand: #3fb27f; --brand-ink: #08130d; --brand-soft: #18301f;
  --accent: #3987e5; --good: #4cc26f; --bad: #ef6b6b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; min-height: 100vh; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 12px; }
p { margin: 0 0 10px; }

.tete { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.marque { display: flex; align-items: center; gap: 10px; }
.marque img { border-radius: 8px; }
.marque div { display: flex; flex-direction: column; line-height: 1.2; }
.marque span { font-size: 12px; color: var(--muted); }
.outils { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.qui { font-size: 13px; color: var(--text-2); margin-right: 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-icone { width: 36px; height: 36px; padding: 0; justify-content: center; color: var(--text-2); }

.vue { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.chargement { color: var(--muted); text-align: center; margin-top: 18vh; }

.carte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.connexion { max-width: 400px; margin: 8vh auto 0; }
.connexion .logo { display: block; margin: 0 auto 12px; border-radius: 12px; }
.connexion h1 { text-align: center; }
.connexion .sous { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 18px; }

form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
input[type=text], input[type=password] { font: inherit; font-size: 15px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); width: 100%; }
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
form .btn.primary { width: 100%; justify-content: center; padding: 10px; margin-top: 4px; }
.cases { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 2px 0 14px; }
.cases label { flex-direction: row; align-items: center; gap: 7px; margin: 0; font-weight: 500; color: var(--text); font-size: 14px; }
.groupe-titre { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; }
.erreur { color: var(--bad); font-size: 14px; min-height: 1.2em; margin: 4px 0 0; }
.note { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 9px 12px; }
.alerte { font-size: 14px; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }

.bonjour { margin-bottom: 18px; }
.bonjour p { color: var(--text-2); }
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 26px; }
.app { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.app:hover { border-color: var(--brand); transform: translateY(-2px); }
.app strong { font-size: 18px; }
.app span { color: var(--text-2); font-size: 14px; }
.app em { margin-top: 6px; color: var(--brand); font-style: normal; font-weight: 650; font-size: 14px; }
.vide { color: var(--text-2); }

.section { margin-bottom: 22px; }
.section-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.section-tete h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--text-2); background: var(--surface-2); font-weight: 600; }
td.actions { text-align: right; }
.etiquette { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; margin-right: 4px;
  background: var(--brand-soft); color: var(--brand); }
.etiquette.off { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.etiquette.admin { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }

.dlg-fond { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.dlg { background: var(--surface); border-radius: var(--radius); width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg h2 { font-size: 18px; }
.dlg-boutons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg-boutons .btn.primary { width: auto; margin: 0; padding: 8px 16px; }

@media (max-width: 560px) {
  .qui { display: none; }
  .carte { padding: 18px; }
}
