/* ============================================================
   KAOZEAL DESIGN SYSTEM — V1
   Référence : "Le style de tous nos SaaS"
   Police Plus Jakarta Sans + JetBrains Mono · accent par produit
   Thème clair & sombre · pattern « fenêtre »
   ============================================================ */

:root {
  /* --- ACCENT : formule oklch(0.62 0.16 H), Hub = H255 (bleu #2A6FDB) --- */
  --accent-h: 260;
  --accent: oklch(0.58 0.19 var(--accent-h));
  --accent-strong: oklch(0.50 0.20 var(--accent-h));
  --accent-soft: oklch(0.95 0.045 var(--accent-h));
  --accent-ring: oklch(0.58 0.19 var(--accent-h) / 0.28);
  --on-accent: #ffffff;

  /* --- NEUTRES (thème clair, aéré) --- */
  --surface: #ffffff;
  --surface-2: #f3f5f9;
  --bg: #f1f3f6;
  --line: #eaecf1;
  --line-2: #e1e4ec;
  --ink: #1c2330;
  --ink-2: #5b6373;
  --ink-3: #9aa1b1;

  /* --- STATUTS (fixes) --- */
  --success: #16985a;  --success-soft: #e4f5ec;
  --warning: #e08a1e;  --warning-soft: #fbf0dd;
  --danger:  #dc3b47;  --danger-soft:  #fbe4e6;

  /* --- FORMES & OMBRES (douces, aérées) --- */
  --r-tag: 8px;
  --r-base: 12px;
  --r-card: 22px;
  --r-window: 22px;
  --r-pill: 999px;
  --shadow-soft: 0 4px 18px rgba(28, 35, 60, .05);
  --shadow-window: 0 10px 30px rgba(28, 35, 60, .07);
  --shadow-pop: 0 24px 60px rgba(28, 35, 60, .18);
  --dot-muted: #c3c9d4;

  /* --- TYPO --- */
  --font: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --accent: oklch(0.68 0.16 var(--accent-h));
  --accent-strong: oklch(0.74 0.15 var(--accent-h));
  --accent-soft: oklch(0.34 0.08 var(--accent-h));
  --accent-ring: oklch(0.68 0.16 var(--accent-h) / 0.40);
  --on-accent: #0b0e13;

  --surface: #1a1e25;
  --surface-2: #20242c;
  --bg: #121419;
  --line: #2c313b;
  --line-2: #353b46;
  --ink: #eceef2;
  --ink-2: #b7bdc7;
  --ink-3: #7e8591;

  --success-soft: #11271d;
  --warning-soft: #2c2110;
  --danger-soft: #2c1518;
  --dot-muted: #424956;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35);
  --shadow-window: 0 4px 14px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
  --shadow-pop: 0 12px 40px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; letter-spacing: -.3px; }
h1 { font-weight: 800; letter-spacing: -.7px; }
h2 { font-weight: 700; letter-spacing: -.4px; font-size: 17px; }
h3 { font-weight: 700; font-size: 14px; margin-top: 4px; }
p  { margin: 0; color: var(--ink-2); }
small { color: var(--ink-3); font-size: 12px; }
button, input, select, textarea { font-family: inherit; }

/* ============================================================
   BOUTONS — sm 30 · base 38 · lg 46 · rayon 10
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-base);
  border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
a.btn { text-decoration: none; }
.google-btn { gap: 10px; }

.btn.primary {
  background: var(--accent); color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 8px 18px var(--accent-ring);
}
.btn.primary:hover { background: var(--accent-strong); box-shadow: 0 10px 22px var(--accent-ring); }

.btn.soft { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.btn.soft:hover { filter: brightness(.98); }

.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.danger:hover { filter: brightness(.94); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 14px; }

.link-button {
  background: none; border: none; color: var(--accent-strong);
  font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0;
}
.link-button:hover { text-decoration: underline; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 30px; padding: 0 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink-2); font-size: 11.5px; font-weight: 600; cursor: pointer;
  font-family: var(--mono); letter-spacing: .3px; text-transform: uppercase;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }

/* ============================================================
   BADGES / STATUTS / PILLS
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; line-height: 1;
  background: var(--success-soft); color: var(--success);
}
.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
}
.pill.gold  { background: var(--warning-soft); color: var(--warning); }
.pill.red   { background: var(--danger-soft);  color: var(--danger); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }
.pill.neutral::before { background: var(--ink-3); }

/* badges de rôle — mono, rayon 6 */
.role {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .4px; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.role.owner { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }

/* ============================================================
   CHAMPS — rayon 10 · focus = anneau accent 3px
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], textarea, select {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: var(--r-base); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field input::placeholder, textarea::placeholder { color: var(--ink-3); }
.checkbox-field { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.checkbox-field input { width: 17px; height: 17px; accent-color: var(--accent); }

.notice { padding: 11px 14px; border-radius: var(--r-base); font-size: 13px; font-weight: 500; }
.notice.error   { background: var(--danger-soft);  color: var(--danger); }
.notice.success { background: var(--success-soft); color: var(--success); }

.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-3); font-size: 12px; }

/* ============================================================
   AUTH — split-screen SSO
   ============================================================ */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  max-width: 1100px; margin: 0 auto; padding: 24px; gap: 24px; align-items: center;
}
.auth-visual {
  position: relative; overflow: hidden; align-self: stretch;
  border-radius: var(--r-window); padding: 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  color: #fff; min-height: 520px;
  background:
    radial-gradient(120% 120% at 0% 0%, oklch(0.70 0.15 var(--accent-h)) 0%, transparent 55%),
    linear-gradient(150deg, var(--accent-strong), oklch(0.45 0.15 var(--accent-h)));
  box-shadow: var(--shadow-window);
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.auth-visual .brand strong, .auth-visual .brand span { color: #fff; }
.auth-visual .brand span { opacity: .8; }
.auth-visual h1 { font-size: 38px; color: #fff; }
.auth-visual p { color: rgba(255,255,255,.85); margin-top: 12px; max-width: 38ch; }
.auth-visual .mark { background: rgba(255,255,255,.18); color: #fff; }

.auth-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-window); padding: 36px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 18px;
}
.auth-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-2); border-radius: var(--r-base); padding: 4px;
}
.auth-switch button {
  height: 34px; border: none; border-radius: 7px; background: transparent;
  color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-switch button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { font-size: 16px; font-weight: 800; letter-spacing: -.4px; display: block; }
.brand span { font-size: 11px; color: var(--ink-3); }
.mark {
  width: 42px; height: 42px; border-radius: 32%; flex: none; position: relative; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  color: var(--on-accent);
  background: linear-gradient(145deg, oklch(0.68 0.16 var(--accent-h)), var(--accent-strong));
  box-shadow: 0 6px 16px var(--accent-ring);
}
.mark::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 25% 15%, rgba(255,255,255,.35), transparent 55%);
}
.title-block h1 { font-size: 22px; }
.title-block p { font-size: 13px; margin-top: 4px; }

/* ============================================================
   PATTERN « FENÊTRE » — app-window + shell
   ============================================================ */
.app-window {
  width: 100%; min-height: 100vh;
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.titlebar {
  height: 42px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; background: transparent;
  position: sticky; top: 0; z-index: 10;
}
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumb-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.crumb-root {
  border: none; background: none; cursor: pointer; padding: 0;
  font-weight: 700; font-size: 13px; letter-spacing: -.2px; color: var(--ink-2);
  transition: color .15s;
}
.crumb-root:hover { color: var(--ink); }
.crumb-sep { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.crumb-current {
  font-weight: 700; font-size: 13px; letter-spacing: -.2px; color: var(--accent-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.titlebar .win-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* sélecteur de langue segmenté */
.lang-seg { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px; }
.lang-seg button {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .5px;
  color: var(--ink-3); padding: 4px 10px; border-radius: var(--r-pill);
  transition: background .15s, color .15s;
}
.lang-seg button.active { background: var(--accent); color: var(--on-accent); }

.shell { display: grid; grid-template-columns: 268px 1fr; flex: 1; min-height: 0; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 16px;
}
.sidebar .brand { padding: 0 6px 4px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); padding: 6px 14px 2px; }
.nav-label + .nav-label, .nav .nav-label:not(:first-child) { margin-top: 8px; }
.workspace-select { display: none; }

/* Sélecteur d'entreprise */
.ws-switcher { position: relative; }
.ws-current {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r-base);
  background: var(--surface-2); cursor: pointer; text-align: left;
  transition: border-color .15s;
}
.ws-current:hover { border-color: var(--ink-3); }
.ws-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
  background: var(--accent);
}
.ws-logo.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.ws-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ws-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-caret { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ws-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.ws-menu-label { font-size: 10.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); padding: 6px 8px 2px; }
.ws-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: none; background: none; border-radius: 8px; cursor: pointer; text-align: left; width: 100%; }
.ws-item:hover { background: var(--surface-2); }
.ws-item.active { background: var(--accent-soft); }
.ws-item-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ws-item-meta strong { font-size: 13px; }
.ws-item-meta small { font-size: 11px; }
.ws-check { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ws-create { margin-top: 4px; padding: 9px; border: 1px dashed var(--line-2); border-radius: 8px; background: none; color: var(--accent-strong); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.ws-create:hover { background: var(--accent-soft); }

/* Bandeau espace actif (dashboard) */
.ctx-band {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line); box-shadow: none;
}
.ctx-logo {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  background: var(--accent);
}
.ctx-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ctx-info small { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.ctx-info h2 { font-size: 18px; }
.ctx-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.nav button {
  display: flex; align-items: center; gap: 13px; width: 100%;
  height: 46px; padding: 0 14px; border: none; border-radius: 14px;
  background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; text-align: left;
}
.nav button span.nav-ico {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center; color: var(--ink);
  transition: color .15s;
}
.nav-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.msr { line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.nav-ico .msr { font-size: 23px; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button:hover span.nav-ico { color: var(--ink-2); }
.nav button.active {
  background: var(--accent); color: #fff; font-weight: 700;
  box-shadow: 0 8px 18px var(--accent-ring);
}
.nav button.active span.nav-ico { color: #fff; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent-strong);
}

.main { overflow-y: auto; min-height: 0; background: transparent; }
.sb-backdrop { display: none; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 30px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar .title-block { min-width: 0; }
.topbar .title-block h1 { font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.topbar .title-block p { font-size: 13px; margin-top: 1px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* outils topbar (droite) : langue + thème + cloche + utilisateur */
.tb-tools { display: flex; align-items: center; gap: 12px; flex: none; margin-left: auto; }
.tb-icon {
  position: relative; width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); box-shadow: none;
  transition: background .15s, border-color .15s;
}
.tb-icon:hover { background: var(--surface); border-color: var(--line-2); }
.tb-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tb-icon .msr { font-size: 22px; }
.tb-icon.logout { color: var(--ink-3); }
.tb-icon.logout:hover { color: var(--danger); }
.tb-badge {
  position: absolute; top: -1px; right: -1px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border: 2px solid var(--bg);
}
.tb-user {
  display: flex; align-items: center; gap: 10px; flex: none; cursor: pointer;
  border: none; background: none; padding: 4px; border-radius: var(--r-pill);
  transition: background .15s;
}
.tb-user:hover { background: var(--surface-2); }
.tb-ava {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  background: var(--accent);
}
.tb-id { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.tb-id strong { font-size: 13.5px; color: var(--ink); }
.tb-id small { font-size: 11.5px; color: var(--ink-3); }
.tb-caret.msr { font-size: 20px; color: var(--ink-3); }

/* burger (mobile uniquement) */
.burger { display: none; width: 42px; height: 42px; border-radius: 12px; flex: none; place-items: center; cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.burger .msr { font-size: 24px; }

/* ============================================================
   CONTENU & GRILLES
   ============================================================ */
.content { padding: 30px 40px 52px; display: flex; flex-direction: column; gap: 24px; max-width: 1860px; margin: 0 auto; width: 100%; }
.grid { display: grid; gap: 22px; }
.stats { grid-template-columns: repeat(4, 1fr); }
.two-col { grid-template-columns: 1fr 1fr; align-items: start; }
.dash-row { grid-template-columns: 1.6fr 1fr; }
.app-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.hero-band {
  position: relative; overflow: hidden;
  border-radius: var(--r-card); padding: 24px 26px; color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), oklch(0.48 0.15 var(--accent-h)));
  box-shadow: var(--shadow-soft);
}
.hero-band::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 20px 20px; opacity: .55;
}
.hero-band h2 { color: #fff; font-size: 20px; position: relative; }
.hero-band p { color: rgba(255,255,255,.88); margin-top: 8px; max-width: 70ch; position: relative; }

/* ----- carte générique ----- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 26px; box-shadow: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

/* ----- carte stat (style SaaSBold : pastille colorée, grand nombre, libellé) ----- */
.stat { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.stat::before { display: none; }
.stat-ic { width: 58px; height: 58px; border-radius: 18px; flex: none; display: grid; place-items: center; margin-bottom: 12px; }
.stat-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-ic .msr { font-size: 30px; color: #fff; }
/* Tuiles pastel Fillow (fond teinté + icône colorée) */
.t-emerald { background: #0ea472; color: #fff; } .t-amber { background: #f2960c; color: #fff; }
.t-violet { background: #7c3aed; color: #fff; } .t-blue { background: #2563eb; color: #fff; }
.t-pink { background: #ec4899; color: #fff; } .t-cyan { background: #0891b2; color: #fff; }
.t-orange { background: #f97316; color: #fff; }
.stat strong { font-size: 40px; font-weight: 800; letter-spacing: -1.4px; color: var(--ink); line-height: 1; }
.stat span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.grid.stats .card:hover { border-color: var(--line-2); box-shadow: var(--shadow-soft); }

/* Carte héro : le chiffre clé qui claque (accent plein) */
.stat.hero { background: var(--accent); border-color: transparent; color: #fff; }
.stat.hero .stat-ic { background: rgba(255,255,255,.18); color: #fff; }
.stat.hero strong { color: #fff; }
.stat.hero span { color: rgba(255,255,255,.82); }
.grid.stats .card.stat.hero:hover { box-shadow: 0 10px 24px var(--accent-ring); }

/* ----- carte promo bleue (dashboard) ----- */
.promo-card {
  position: relative; overflow: hidden; border-radius: var(--r-card); padding: 26px;
  color: #fff; display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  background: var(--accent-strong);
  box-shadow: none;
}
.promo-card::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255,255,255,.10); pointer-events: none;
}
.promo-tag { position: relative; font-size: 10.5px; font-weight: 800; letter-spacing: 1px; padding: 5px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.22); }
.promo-card h2 { position: relative; color: #fff; font-size: 21px; line-height: 1.25; }
.promo-card p { position: relative; color: rgba(255,255,255,.9); font-size: 13.5px; line-height: 1.5; }
.promo-btn { position: relative; margin-top: 4px; background: #fff; color: var(--accent-strong); border-color: transparent; font-weight: 700; }
.promo-btn:hover { background: rgba(255,255,255,.92); }

/* ----- module « fenêtre » : barre 3 pastilles avant le titre ----- */
.panel { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.panel > h3 { margin-top: 4px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: center; gap: 10px; }
.panel > h2, .panel > h3 { font-size: 17px; }

/* ----- tuile app (marketplace) ----- */
.app-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); cursor: default; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-window); }
.app-head { display: flex; align-items: center; gap: 12px; }
.app-logo {
  width: 46px; height: 46px; border-radius: 30%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 14px rgba(28,35,60,.14);
}
.app-card strong { font-size: 14.5px; }
.app-card p { font-size: 13px; min-height: 40px; }
.app-card .meta-row span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.app-card .meta-row .pill { flex: none; }

/* Logos d'app : icône Material en blanc */
.app-logo .msr { font-size: 20px; color: #fff; }
.app-logo.lg .msr { font-size: 25px; }
.app-logo.sm .msr { font-size: 16px; }

/* Sélecteur icône + couleur (super-admin) */
.color-picker { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.color-picker input[type=color] { width: 54px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-sw { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; transition: transform .1s; }
.color-sw:hover { transform: scale(1.1); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.icon-opt { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.icon-opt .msr { font-size: 24px; }
.icon-opt:hover { border-color: var(--accent); color: var(--ink); }
.icon-opt.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ----- timeline activité ----- */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: none; }
.timeline-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-item strong { font-size: 13.5px; }
.timeline-item p { font-size: 13px; margin-top: 2px; }

/* ----- tableaux / listes ----- */
.table { display: flex; flex-direction: column; }
.table-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.table-row:last-child { border-bottom: none; }
.table-row > div:first-child { flex: 1; min-width: 160px; }
.table-row strong { font-size: 13px; }
.table-row .actions { margin-left: auto; }
.empty-state {
  padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--r-base);
  color: var(--ink-3); font-size: 12.5px; background: var(--surface-2);
}

/* ----- billing ----- */
.billing-plan { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.billing-plan .price { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.billing-plan .price span { font-size: 14px; font-weight: 600; color: var(--ink-3); }

/* ----- admin ----- */
.admin-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 4px;
}
.admin-tabs button {
  border: 1px solid var(--line-2); background: var(--surface);
  height: 32px; padding: 0 13px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-tabs button:hover { background: var(--surface-2); color: var(--ink); }
.admin-tabs button.active { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.color-chip { width: 26px; height: 18px; border-radius: 6px; display: inline-block; border: 1px solid var(--line-2); }
.admin-search {
  height: 32px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  padding: 0 14px; font-size: 12.5px; background: var(--surface); color: var(--ink);
  min-width: 150px; max-width: 220px;
}
.sub-status {
  height: 30px; padding: 0 8px; font-size: 12px; border-radius: var(--r-base);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); width: auto;
}
.imp-banner {
  position: sticky; top: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--success); color: #fff;
  font-size: 13px; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.imp-banner .imp-txt { display: inline-flex; align-items: center; gap: 8px; }
.imp-banner strong { font-weight: 800; }
.imp-banner .imp-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: impPulse 1.8s infinite; }
@keyframes impPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); } 70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.imp-banner .btn { background: #fff; color: var(--success); border: none; height: 30px; font-weight: 700; }
.imp-banner .btn:hover { background: rgba(255,255,255,.88); }
.impersonate-btn { color: var(--success); border-color: var(--success); }
/* Squelettes de chargement des apps (évite le flash des apps de l'autre entreprise au switch) */
.mk-skel { pointer-events: none; }
.mk-skel .mk-top { display: flex; align-items: center; }
.mk-skel .sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skShimmer 1.4s ease infinite; }
.mk-skel .sk-logo { width: 46px; height: 46px; border-radius: 30%; flex: none; }
.mk-skel .sk-title { width: 55%; height: 15px; margin-left: 12px; }
.mk-skel .sk-line { height: 12px; margin-top: 12px; width: 100%; }
.mk-skel .sk-line.short { width: 45%; }
.mk-skel .sk-btn { height: 38px; margin-top: 16px; border-radius: var(--r-base); }
@keyframes skShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.secret-box {
  font-family: var(--mono); font-size: 13px; word-break: break-all;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-base); padding: 14px; color: var(--ink);
}

/* ============================================================
   MODAL & TOAST
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 20, 30, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 22px;
  animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-window); padding: 22px;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 16px;
  animation: pop .18s ease;
}
.modal .section-head h2::before { display: none; }
.modal .section-head { background: transparent; padding: 0; border: none; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: var(--surface);
  padding: 12px 20px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-pop); animation: pop .18s ease;
}

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .dash-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .burger { display: grid; }
  /* sidebar en tiroir hors-écran */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 272px; z-index: 60;
    background: var(--surface);
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-pop);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .sb-backdrop {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(15, 20, 30, .42); backdrop-filter: blur(2px);
    animation: fade .15s ease;
  }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { min-height: 260px; }
  .crumb-root, .crumb-sep { display: none; }
  .topbar { padding: 14px 16px 4px; gap: 10px; }
  .tb-id { display: none; }
  .tb-tools { gap: 10px; }
  .content { padding: 20px 16px 36px; }
}
@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .lang-seg { display: none; }
}

/* ===== Support / FAQ / Chat (Hub) ===== */
.support-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .support-grid { grid-template-columns: 1fr; } }
.card-title { font-size: 1.05rem; margin: 0 0 14px; }
.faq-cat-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 16px 0 8px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; padding: 0; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 13px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--text-muted); font-size: 1.2rem; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-answer { padding: 0 16px 14px; color: var(--text-muted); line-height: 1.55; }
.support-aside .btn { width: 100%; margin-top: 10px; }
.wa-btn { background: #25D366; border-color: #25D366; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.wa-btn:hover { filter: brightness(.95); }
.btn.ghost.wa-btn { background: transparent; color: #128C4B; border-color: #25D366; }

.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 1200; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.chat-toggle { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; background: oklch(0.62 0.16 var(--accent-h, 255)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: 1.6rem; align-self: flex-end; }
.chat-panel { width: 340px; max-width: calc(100vw - 36px); height: 460px; max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { padding: 14px 16px; font-weight: 700; background: oklch(0.62 0.16 var(--accent-h, 255)); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.chat-x { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; line-height: 1.45; font-size: .9rem; }
.chat-msg.bot { background: var(--surface-2, rgba(125,125,125,.12)); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: oklch(0.62 0.16 var(--accent-h, 255)); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-wa { display: inline-block; margin-top: 6px; color: #128C4B; font-weight: 600; }
.chat-suggests { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.chat-suggest { text-align: left; background: var(--surface-2, rgba(125,125,125,.1)); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; cursor: pointer; font-size: .85rem; color: var(--text); }
.chat-suggest:hover { border-color: oklch(0.62 0.16 var(--accent-h, 255)); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--surface); color: var(--text); }

/* ===== Roles & permissions ===== */
.perm-grid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }
@media (max-width:640px){ .perm-grid{ grid-template-columns:1fr; } }
.perm-item{ display:flex; align-items:flex-start; gap:8px; padding:9px 11px; border:1px solid var(--border); border-radius:10px; font-size:.86rem; cursor:pointer; background:var(--surface); }
.perm-item input{ margin-top:2px; width:16px; height:16px; }
.perm-item:hover{ border-color:oklch(0.62 0.16 var(--accent-h,255)); }

/* ===== Mes apps / Marketplace achat ===== */
.app-logo.lg{ width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; }
.plan-list{ display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.plan-opt{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--line, #e3e7ee); border-radius:12px; }
.plan-opt small{ color:var(--ink-3, #8a909c); }
.plan-opt .actions{ display:flex; gap:6px; flex-wrap:wrap; }

/* ===== Gestion par app (admin) ===== */
.app-manage-head{ display:flex; align-items:center; gap:14px; margin:0 0 14px; }
.app-manage-head .app-logo{ border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; }
.app-manage-head h2{ font-size:1.2rem; }

/* ===== Formulaire de plan amélioré ===== */
.plan-form{ gap:12px; }
.plan-ctx{ display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--line,#e3e7ee); border-radius:12px; background:var(--surface-2,#f5f6fa); font-size:.9rem; }
.app-logo.sm{ width:30px; height:30px; min-width:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:12px; }
.form-sec{ font-size:.74rem; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-3,#8a909c); font-weight:700; border-top:1px solid var(--line,#e3e7ee); padding-top:12px; margin-top:4px; }
.form-sub{ font-size:.8rem; color:var(--ink-3,#8a909c); }
.toggle-row{ justify-content:space-between; }
.switch{ position:relative; display:inline-block; width:42px; height:24px; flex:none; }
.switch input{ opacity:0; width:0; height:0; position:absolute; }
.switch i{ position:absolute; inset:0; background:var(--line-2,#d7dce5); border-radius:999px; transition:.18s; cursor:pointer; }
.switch i::before{ content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.18s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i{ background:var(--accent); }
.switch input:checked + i::before{ transform:translateX(18px); }
.price-input{ position:relative; }
.price-input input{ padding-right:26px; }
.price-input em{ position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--ink-3,#8a909c); font-style:normal; }
.price-row.is-free input{ opacity:.5; }
.field .hint{ color:var(--ink-3,#8a909c); font-size:.72rem; margin-top:3px; }
.btn.lg{ height:46px; font-size:1rem; }

/* ===== Marketplace / Mes apps — refonte ===== */
.mk-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:18px; }
.mk-card{ display:flex; flex-direction:column; gap:12px; background:var(--surface,#fff); border:1px solid var(--line,#e3e7ee); border-radius:18px; padding:20px; box-shadow:var(--shadow-soft,0 1px 2px rgba(20,28,46,.04),0 6px 18px rgba(20,28,46,.06)); transition:.18s; }
.mk-card:hover{ transform:translateY(-2px); box-shadow:0 14px 36px rgba(20,28,46,.12); }
.mk-top{ display:flex; align-items:center; gap:12px; }
.mk-top .app-logo.lg{ width:52px; height:52px; border-radius:14px; font-size:18px; }
.mk-id{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.mk-id strong{ font-size:1.05rem; }
.mk-badge{ display:inline-flex; align-items:center; gap:4px; align-self:flex-start; font-size:.72rem; font-weight:700; padding:2px 9px; border-radius:999px; background:var(--surface-2,#f5f6fa); color:var(--ink-3,#8a909c); }
.mk-badge.ok{ background:var(--success-soft,#e4f5ec); color:var(--success,#16985a); }
.mk-desc{ color:var(--ink-2,#535a66); font-size:.88rem; line-height:1.5; margin:0; flex:1; }
.mk-open{ width:100%; height:42px; border-radius:12px; }
.mk-plans{ display:flex; flex-direction:column; gap:8px; }
.mk-plan{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 13px; border:1px solid var(--line,#e3e7ee); border-radius:12px; }
.mk-plan:hover{ border-color:var(--accent); }
.mk-plan-info{ display:flex; flex-direction:column; gap:2px; }
.mk-plan-info strong{ font-size:.92rem; }
.mk-price{ font-size:.85rem; font-weight:700; color:var(--ink); }
.mk-price em{ font-style:normal; font-weight:500; color:var(--ink-3,#8a909c); font-size:.78rem; }
.mk-free{ font-size:.8rem; color:var(--success,#16985a); font-weight:600; }
.mk-plan-cta{ display:flex; align-items:center; gap:6px; flex:none; }
.btn.xs.ghost{ background:transparent; border:1px solid var(--line-2,#d7dce5); color:var(--ink-2); padding:3px 8px; font-size:.72rem; border-radius:8px; }
.btn.xs.ghost:hover{ border-color:var(--accent); color:var(--accent-strong); }
.mk-soon{ text-align:center; padding:14px; border:1px dashed var(--line-2,#d7dce5); border-radius:12px; color:var(--ink-3,#8a909c); font-size:.85rem; }

/* ===== Marketplace : page de présentation ===== */
.mk-from{ font-size:.82rem; color:var(--ink-2,#535a66); }
.mk-from strong{ color:var(--ink); }
.mk-hero{ display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.mk-hero .app-logo.lg{ width:60px; height:60px; border-radius:16px; font-size:22px; }
.mk-seg{ width:auto; display:inline-flex; margin-bottom:16px; }
.plan-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; align-items:stretch; }
.plan-card{ position:relative; display:flex; flex-direction:column; gap:10px; background:var(--surface,#fff); border:1px solid var(--line,#e3e7ee); border-radius:18px; padding:22px; box-shadow:var(--shadow-soft); }
.plan-card.featured{ border:2px solid var(--accent); box-shadow:0 14px 36px rgba(20,28,46,.12); }
.plan-tag{ position:absolute; top:-11px; left:50%; transform:translateX(-50%); background:var(--accent); color:#fff; font-size:.7rem; font-weight:700; padding:3px 12px; border-radius:999px; }
.plan-card h3{ margin:0; font-size:1.1rem; }
.plan-price-big{ font-size:2rem; font-weight:800; letter-spacing:-1px; }
.plan-price-big em{ font-style:normal; font-size:.9rem; font-weight:500; color:var(--ink-3,#8a909c); }
.plan-trial{ font-size:.78rem; color:var(--ink-3,#8a909c); }
.plan-feats{ list-style:none; padding:0; margin:6px 0; display:flex; flex-direction:column; gap:7px; flex:1; }
.plan-feats li{ position:relative; padding-left:22px; font-size:.86rem; color:var(--ink-2,#535a66); }
.plan-feats li::before{ content:"✓"; position:absolute; left:0; color:var(--success,#16985a); font-weight:800; }
.plan-card .btn{ width:100%; height:42px; border-radius:12px; }

/* ===== Gestion abonnement client ===== */
.sub-row{ align-items:center; }
.sub-row .actions{ flex-wrap:wrap; gap:6px; }
.mk-mini{ display:flex; gap:6px; justify-content:center; margin-top:2px; }
.btn.xs.ghost.danger{ color:var(--danger,#dc3b47); border-color:var(--danger-soft,#fbe4e6); }
.btn.xs.ghost.danger:hover{ border-color:var(--danger,#dc3b47); }

/* ===== Drive (médiathèque) ===== */
.dropzone{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; text-align:center; padding:28px 18px; margin-bottom:20px; border:1.5px dashed var(--line-2); border-radius:var(--r-card); background:var(--surface); cursor:pointer; transition:.15s; }
.dropzone:hover,.dropzone.drag{ border-color:var(--accent); background:var(--accent-soft); }
.dropzone .dz-ic{ width:42px; height:42px; color:var(--accent); }
.dropzone .dz-ic svg{ width:42px; height:42px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.dropzone .dz-t{ font-size:14px; color:var(--ink); }
.drive-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.media-card{ border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); overflow:hidden; display:flex; flex-direction:column; }
.media-thumb{ height:130px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.media-thumb img{ width:100%; height:100%; object-fit:cover; }
.media-ext{ font-size:13px; font-weight:700; letter-spacing:.06em; color:var(--ink-3); }
.media-meta{ padding:10px 12px 4px; }
.media-meta strong{ display:block; font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.media-meta small{ font-size:11px; }
.media-actions{ display:flex; flex-wrap:wrap; gap:6px; padding:8px 12px 12px; }
.media-actions .btn.sm{ flex:1; min-width:0; }
.media-move{ width:calc(100% - 24px); margin:0 12px 8px; height:30px; font-size:12px; }
.drive-layout{ display:grid; grid-template-columns:230px 1fr; gap:18px; align-items:start; }
.drive-side{ display:flex; flex-direction:column; gap:3px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); padding:10px; position:sticky; top:80px; }
.df{ display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; text-align:left; border:none; background:transparent; color:var(--ink-2); font-size:13px; font-weight:600; padding:9px 10px; border-radius:9px; cursor:pointer; }
.df:hover{ background:var(--surface-2); }
.df.active{ background:var(--accent-soft); color:var(--accent-strong); }
.df .df-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.df-badge{ font-size:11px; opacity:.8; flex:none; }
.df-label{ font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-3); font-weight:700; margin:10px 4px 4px; }
.drive-main{ min-width:0; }
.drive-usage{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); padding:12px 14px; margin-bottom:14px; }
.drive-usage .du-top{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:600; color:var(--ink-2); margin-bottom:7px; }
.drive-usage .du-track{ height:8px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
.drive-usage .du-track>span{ display:block; height:100%; background:var(--accent); border-radius:999px; transition:width .3s; }
.drive-usage.full .du-track>span{ background:var(--danger); }
.drive-usage .du-warn{ display:block; margin-top:6px; color:var(--danger); font-size:11.5px; }
@media(max-width:760px){ .drive-layout{ grid-template-columns:1fr; } .drive-side{ position:static; } }

/* ============================================================
   Finition 2026 — micro-interactions + chargement + états vides
   ============================================================ */
.btn:active{ transform:translateY(1px) scale(.995); }
.card{ transition:box-shadow .18s ease, transform .18s ease; }
.table-row{ border-radius:10px; transition:background .12s ease; }
.table-row:hover{ background:var(--surface-2); }
.user-cos{ display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.user-cos.none{ font-size:.76rem; color:var(--muted,#8a97a2); margin-top:4px; }
.co-chip{ display:inline-flex; align-items:center; gap:5px; background:var(--surface-2,rgba(125,125,125,.1)); border:1px solid var(--line,#e5e7eb); border-radius:999px; padding:2px 9px; font-size:.74rem; font-weight:600; color:var(--ink,#1b2138); }
.co-chip em{ font-style:normal; opacity:.6; font-weight:500; }
.modal{ animation:uiPop .18s ease; }
.modal-backdrop{ animation:uiFade .15s ease; }
.toast{ animation:uiFade .2s ease; }
@keyframes uiFade{ from{ opacity:0 } }
@keyframes uiPop{ from{ opacity:0; transform:translateY(8px) scale(.98) } }
@keyframes uiSpin{ to{ transform:rotate(360deg) } }
.empty-state{ display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; }
.spinner{ width:32px; height:32px; border-radius:50%; border:3px solid var(--line-2); border-top-color:var(--accent); animation:uiSpin .7s linear infinite; }
.boot,.loading{ display:grid; place-items:center; min-height:60vh; gap:14px; color:var(--ink-3); font-size:14px; }

/* ============================================================
   Finition interne 2026 — scrollbars, sélection, champs, skeletons
   ============================================================ */
::selection{ background:var(--accent-soft); color:var(--accent-strong); }
*{ scrollbar-width:thin; scrollbar-color:var(--line-2) transparent; }
*::-webkit-scrollbar{ width:10px; height:10px; }
*::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:99px; border:2px solid transparent; background-clip:content-box; }
*::-webkit-scrollbar-thumb:hover{ background:var(--ink-3); background-clip:content-box; }
input:hover,select:hover,textarea:hover{ border-color:var(--ink-3); }
.sk{ position:relative; overflow:hidden; background:var(--surface-2); border-radius:8px; }
.sk::after{ content:""; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent); animation:skSh 1.2s infinite; }
@keyframes skSh{ to{ transform:translateX(100%) } }
.sk-line{ height:12px; margin:8px 0; }
.sk-line.w60{ width:60%; } .sk-line.w40{ width:40%; } .sk-line.w80{ width:80%; }
.sk-card{ height:96px; border-radius:var(--r-card,16px); }

/* ===== Bandeau d'accueil éditable (écrans de connexion) ===== */
.auth-visual { position: relative; }
.auth-illu { position: relative; z-index: 1; width: 100%; max-height: 280px; object-fit: contain; border-radius: 16px; margin: 8px 0 4px; }
.auth-visual.has-img { justify-content: flex-start; gap: 22px; }
.auth-visual-body { position: relative; z-index: 1; }
.auth-cta { display: inline-block; margin-top: 16px; background: rgba(255,255,255,.18); color: #fff; padding: 11px 18px; border-radius: var(--r-base); font-weight: 700; font-size: 13.5px; text-decoration: none; transition: background .15s; }
.auth-cta:hover { background: rgba(255,255,255,.30); }
.ab-preview { min-height: 320px; border-radius: var(--r-window); }

/* ===== Écran de connexion — finition (icônes champs, séparateur, décor) ===== */
.field-ic { position: relative; }
.field-ic svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.field-ic input { padding-left: 40px; }
.auth-logo { margin-bottom: 2px; }
.auth-logo .mark { width: 48px; height: 48px; border-radius: 16px; font-size: 22px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; font-weight: 600; margin: 2px 0; }
.auth-or::before, .auth-or::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-visual::before { content: ""; position: absolute; right: -70px; bottom: -90px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.10); pointer-events: none; }

/* Image de gauche en plein cadre (cover) + voile lisibilité */
.auth-visual.has-img{ justify-content:space-between; gap:18px; }
.auth-visual.has-img .auth-illu{ position:absolute; inset:0; width:100%; height:100%; max-height:none; object-fit:cover; border-radius:inherit; margin:0; z-index:0; }
.auth-visual.has-img::before{ display:none; }
.auth-visual.has-img::after{ content:""; position:absolute; inset:0; z-index:1; background:linear-gradient(180deg, rgba(12,20,40,.28), rgba(12,20,40,.66)); opacity:1; background-size:auto; }
.auth-visual.has-img .brand, .auth-visual.has-img .auth-visual-body{ position:relative; z-index:2; }

/* Connexion plein écran (edge-to-edge) au lieu d/un bloc centré */
.auth-wrap{ max-width:none; margin:0; padding:0; gap:0; grid-template-columns:1.05fr .95fr; min-height:100vh; align-items:stretch; }
.auth-visual{ border-radius:0; min-height:100vh; }
.auth-panel{ border-radius:0; border:none; box-shadow:none; min-height:100vh; display:flex; flex-direction:column; justify-content:center; padding:40px; }
.auth-panel > *{ width:100%; max-width:420px; margin-left:auto; margin-right:auto; }
@media(max-width:760px){ .auth-wrap{ grid-template-columns:1fr; } .auth-visual{ min-height:32vh; } .auth-panel{ min-height:auto; } }

/* Image seule à gauche : ni texte ni voile */
.auth-visual.has-img{ padding:0; }
.auth-visual.has-img .brand,
.auth-visual.has-img .auth-visual-body{ display:none; }
.auth-visual.has-img::after{ display:none; }
.auth-visual.has-img::before{ display:none; }

/* ===== Refonte page de connexion 2026 : carte centrée sur photo plein écran ===== */
.auth-scene{ min-height:100vh; display:grid; place-items:center end; padding:24px clamp(24px,7vw,96px); position:relative; background-color:#0e1730; background-size:cover; background-position:center; background-repeat:no-repeat; }
@media(max-width:640px){ .auth-scene{ place-items:center; padding:20px; } }
.auth-scene::before{ content:""; position:absolute; inset:0; background:linear-gradient(90deg, rgba(10,16,34,0) 40%, rgba(10,16,34,.28)); }
.auth-box{ position:relative; z-index:1; width:100%; max-width:430px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); box-shadow:var(--shadow-pop); padding:30px 30px 26px; display:flex; flex-direction:column; gap:15px; }
.auth-brand{ display:flex; align-items:center; gap:11px; }
.auth-brand .mark{ width:44px; height:44px; border-radius:14px; display:grid; place-items:center; font-weight:800; font-size:20px; background:linear-gradient(150deg,var(--accent),var(--accent-strong)); color:#fff; }
.auth-brand-txt strong{ display:block; font-size:15px; font-weight:800; }
.auth-brand-txt span{ font-size:12px; color:var(--ink-3); }
.auth-note{ background:var(--accent-soft); border:1px solid var(--line-2); border-radius:14px; padding:12px 14px; display:flex; flex-direction:column; gap:4px; }
.auth-note strong{ font-size:13.5px; font-weight:800; color:var(--accent-strong); }
.auth-note span{ font-size:13px; color:var(--ink-2); line-height:1.5; }
.auth-note a{ font-size:13px; font-weight:700; color:var(--accent-strong); text-decoration:none; margin-top:2px; }
.auth-box .title-block h1{ font-size:22px; letter-spacing:-.3px; }
.auth-box .title-block p{ color:var(--ink-3); font-size:13.5px; margin-top:3px; }
.auth-user{ display:flex; align-items:center; gap:10px; background:var(--surface-2); border-radius:12px; padding:10px 12px; }
.auth-user small{ color:var(--ink-3); font-size:11.5px; }
.auth-redir{ text-align:center; color:var(--ink-3); font-size:11.5px; }
.auth-box .actions{ display:flex; gap:10px; }
.auth-box .actions .btn{ flex:1; }
.btn.lg{ height:46px; font-size:14.5px; }
@media(max-width:480px){ .auth-box{ padding:24px 20px; border-radius:18px; } }

/* ===== Logo d'app uploadé (image / SVG) ===== */
.app-logo-img{ width:100%; height:100%; object-fit:contain; padding:15%; background:#fff; border-radius:inherit; display:block; box-sizing:border-box; }
.logo-field{ display:flex; align-items:center; gap:12px; margin-top:2px; }
.logo-prev{ width:56px; height:56px; border-radius:14px; overflow:hidden; flex:none; box-shadow:var(--shadow-soft); background:var(--surface-2); display:grid; place-items:center; }
.logo-prev img{ width:100%; height:100%; object-fit:contain; padding:8px; background:#fff; box-sizing:border-box; }
.logo-prev .app-logo{ width:100%; height:100%; border-radius:0; display:grid; place-items:center; color:#fff; font-size:22px; }
.logo-prev .app-logo .app-logo-img{ padding:15%; }

/* Logo du Hub uploadé, dans la pastille .mark */
.brand-logo-img{ width:100%; height:100%; object-fit:contain; padding:12%; background:#fff; border-radius:inherit; display:block; box-sizing:border-box; }
