:root
{
  color-scheme: light;
  --bg: #f0f2f5;
  --panel: #fff;
  --text: #172332;
  --muted: #667587;
  --line: #e4e9ef;
  --blue: #1877f2;
  --soft: #edf5ff;
  --green: #178766;
}

html[data-theme="dark"]
{
  color-scheme: dark;
  --bg: #111820;
  --panel: #19232e;
  --text: #edf3fa;
  --muted: #99aabd;
  --line: #2a3847;
  --blue: #5b9dff;
  --soft: #20354e;
  --green: #67d4ac;
}

body,
.page-heading h1,
.section-title h2,
.checklist,
.logout-form,
.account-form input[type="checkbox"]
{
  margin: 0;
}

body,
.pill,
.theme-toggle,
.progress,
.account-form input:not([type="checkbox"]),.account-form select,
.tag.inactive
{
  background: var(--bg);
}

body,
.theme-toggle,
.sidebar-note strong,
.summary-row strong,
.account-form input:not([type="checkbox"]),.account-form select
{
  color: var(--text);
}

button,
.account-form .remember-option,
.account-form input[type="checkbox"]
{
  cursor: pointer;
}

.topbar,
.card,
.stat
{
  background: var(--panel);
}

.topbar,
.brand,
.top-right,
.nav a,.nav .future,
.page-heading,
.section-title,
.post-head,
.invoice,
.checklist li,
.summary-row,
.account-form .remember-option
{
  display: flex;
}

.topbar,
.brand,
.top-right,
.nav a,.nav .future,
.page-heading,
.button,
.section-title,
.post-head,
.invoice,
.account-form .remember-option
{
  align-items: center;
}

.topbar,
.page-heading,
.section-title,
.summary-row
{
  justify-content: space-between;
}

.brand-icon,
.layout,
.nav,
.stats,
.avatar,
.checklist,
.step,
.feature-grid,
.account-form,
.account-form label
{
  display: grid;
}

.brand-icon,
.avatar,
.step
{
  place-items: center;
}

.brand-icon,
.nav a,.nav .future,
.alert
{
  border-radius: 12px;
}

.pill,
.date,
.stat span,
.post-head small,
.file-icon,
.post-foot,
.summary-row,
.right p,
.feature-grid p,
.account-form small,
.text-button
{
  font-size: 12px;
}

.pill,
.nav-label,.eyebrow,
.nav .future,
.sidebar-note,
.date,
.stat span,
.stat small,
.post-head small,
.post p,
.invoice small,
.post-foot,
.checklist small,
.summary-row,
.right p,
.footer,
.feature-grid p,
.notice,
.auth-card p,
.account-form small,
.text-button,
.user-table th,
.user-table small,
.tag.inactive
{
  color: var(--muted);
}

.theme-toggle,
.card,
.stat,
.invoice,
.account-form input:not([type="checkbox"]),.account-form select
{
  border: 1px solid var(--line);
}

.theme-toggle,
.welcome::after,
.step
{
  border-radius: 50%;
}

.theme-toggle,
.nav .icon,
.post h3
{
  font-size: 20px;
}

.nav-label,.eyebrow,
.stat small,
.invoice small,
.status,
.step,
.footer,
.notice,
.user-table th,
.user-table small
{
  font-size: 11px;
}

.nav-label,.eyebrow,
.button,
.invoice .amount,
.step
{
  font-weight: 750;
}

.nav a.active,
.tag,
.avatar,
.file-icon,
.step
{
  background: var(--soft);
}

.nav a.active,
.tag,
.avatar,
.file-icon,
.step,
.login-link,
.user-table a
{
  color: var(--blue);
}

.sidebar-note,
.invoice strong,
.checklist li,
.feature-grid strong,
.account-form label,
.alert,
.login-link
{
  font-size: 13px;
}

.sidebar-note strong,
.stat strong,
.post-head strong,
.invoice strong,
.checklist small,
.progress span,
.user-table small
{
  display: block;
}

.button,
.stats,
.post-head,
.checklist li
{
  gap: 12px;
}

.button,
.file-icon,
.progress,
.progress span,
.account-form input:not([type="checkbox"]),.account-form select
{
  border-radius: 10px;
}

.checklist,
.feature-grid,
.account-form
{
  gap: 18px;
}

*
{
  box-sizing: border-box;
}

body
{
  font: 15px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a
{
  color: inherit;
  text-decoration: none;
}

button
{
  font: inherit;
}

button,a
{
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,button:focus-visible
{
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.topbar
{
  height: 74px;
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand
{
  gap: 10px;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -1px;
}

.brand-icon
{
  width: 39px;
  height: 39px;
  background: #1877f2;
  color: white;
  font-size: 25px;
}

.brand-icon.brand-company-logo
{
  background: transparent;
}


.top-right
{
  gap: 16px;
}

.pill
{
  border-radius: 30px;
  padding: 6px 12px;
}

.theme-toggle
{
  width: 42px;
  height: 42px;
}

.layout
{
  max-width: 1420px;
  margin: auto;
  grid-template-columns: 230px minmax(0,1fr) 300px;
  gap: 28px;
  padding: 30px 26px;
}

.sidebar
{
  position: sticky;
  top: 104px;
  align-self: start;
}

.nav-label,.eyebrow
{
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.nav
{
  gap: 7px;
  margin: 18px 0 32px;
}

.nav a,.nav .future
{
  gap: 13px;
  padding: 12px 15px;
  font-weight: 650;
}

.nav .icon
{
  width: 24px;
  text-align: center;
}

.soon
{
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
}

.sidebar-note
{
  padding: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-note strong
{
  margin-bottom: 5px;
}

.main
{
  min-width: 0;
}

.page-heading
{
  margin-bottom: 22px;
}

.page-heading h1
{
  font-size: 27px;
  letter-spacing: -1px;
}

.card
{
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
}

.welcome
{
  overflow: hidden;
  position: relative;
  background: linear-gradient(125deg,#123d82,#1877f2);
  color: white;
  padding: 34px;
}

.welcome .eyebrow
{
  color: #bfd9ff;
}

.welcome h2
{
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: -1.3px;
  max-width: 420px;
  margin: 15px 0;
}

.welcome p
{
  max-width: 400px;
  color: #e1ecff;
  margin-bottom: 24px;
}

.welcome::after
{
  content: "";
  position: absolute;
  right: -85px;
  top: -70px;
  width: 260px;
  height: 260px;
  border: 45px solid #ffffff0b;
  pointer-events: none;
}

.button
{
  display: inline-flex;
  padding: 11px 17px;
  background: #fff;
  color: #1359b1;
  border: 0;
}

.stats
{
  grid-template-columns: repeat(3,1fr);
  margin-bottom: 20px;
}

.stat
{
  border-radius: 15px;
  padding: 18px;
}

.stat strong
{
  font-size: 24px;
  letter-spacing: -.7px;
  margin: 8px 0 2px;
}

.section-title
{
  gap: 10px;
  margin-bottom: 22px;
}

.section-title h2
{
  font-size: 17px;
}

.tag
{
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.avatar
{
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-weight: 800;
}

.post-head strong
{
  font-size: 14px;
}

.post h3
{
  letter-spacing: -.4px;
  margin: 20px 0 8px;
}

.post p
{
  margin: 0 0 20px;
}

.invoice
{
  gap: 14px;
  border-radius: 13px;
  padding: 16px;
}

.file-icon
{
  padding: 12px;
  font-weight: 800;
}

.invoice .amount
{
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.status
{
  color: var(--green);
  font-weight: 600;
}

.post-foot
{
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 13px;
}

.right h2
{
  font-size: 15px;
  margin: 0 0 15px;
}

.right .card
{
  padding: 21px;
}

.checklist
{
  list-style: none;
  padding: 0;
}

.step
{
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.checklist small
{
  margin-top: 3px;
}

.summary-row
{
  margin: 12px 0;
}

.progress
{
  height: 7px;
  overflow: hidden;
  margin: 15px 0;
}

.progress span
{
  width: 72%;
  height: 100%;
  background: var(--blue);
}

.footer
{
  padding: 0 6px;
}

.feature-grid
{
  grid-template-columns: 1fr 1fr;
}

.feature-grid p
{
  margin: 5px 0;
}

.notice
{
  margin: 0 0 15px;
}

@media(min-width:1101px)
{
  .right
  {
    position: sticky;
    top: 104px;
    align-self: start;
  }
}

@media(max-width:1100px)
{
  .layout
  {
    grid-template-columns: 190px minmax(0,1fr);
    gap: 20px;
  }

  .right
  {
    grid-column: 2;
  }

  .right .card
  {
    display: inline-block;
    vertical-align: top;
    width: calc(50% - 12px);
    margin-right: 8px;
  }

  .right .footer
  {
    display: block;
  }
}

@media(max-width:700px)
{
  .topbar
  {
    padding: 0 18px;
    height: 65px;
  }

  .pill
  {
    display: none;
  }

  .layout
  {
    display: block;
    padding: 18px 14px;
  }

  .sidebar
  {
    position: static;
  }

  .nav-label,.sidebar-note
  {
    display: none;
  }

  .nav
  {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin: 0 0 22px;
  }

  .nav a,.nav .future
  {
    white-space: nowrap;
    padding: 9px 12px;
    font-size: 12px;
  }

  .nav .icon
  {
    font-size: 16px;
    width: auto;
  }

  .soon
  {
    display: none;
  }

  .page-heading h1
  {
    font-size: 23px;
  }

  .date
  {
    font-size: 10px;
  }

  .welcome
  {
    padding: 25px;
  }

  .welcome h2
  {
    font-size: 29px;
  }

  .stats
  {
    gap: 7px;
  }

  .stat
  {
    padding: 12px;
  }

  .stat strong
  {
    font-size: 20px;
  }

  .stat span
  {
    font-size: 10px;
  }

  .card
  {
    padding: 19px;
  }

  .right .card
  {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .invoice
  {
    padding: 11px;
    gap: 9px;
  }

  .invoice .amount
  {
    font-size: 13px;
  }

  .feature-grid
  {
    gap: 12px;
  }

  .top-right
  {
    gap: 8px;
  }

  .user-table
  {
    min-width: 440px;
  }

  .top-right .pill
  {
    display: none;
  }
}

.auth-card
{
  max-width: 540px;
  margin: auto;
}

.auth-card h1
{
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.7px;
}

.account-form
{
  margin: 24px 0;
}

.account-form label
{
  gap: 7px;
  font-weight: 650;
}

.account-form input:not([type="checkbox"]),.account-form select
{
  width: 100%;
  padding: 12px;
  font: inherit;
}

.button.primary
{
  background: var(--blue);
  color: var(--panel);
  justify-content: center;
}

.alert
{
  padding: 14px 17px;
  margin-bottom: 18px;
}

.error
{
  background: #fff0f0;
  color: #9f2020;
}

.success
{
  background: #e5f7ef;
  color: #146746;
}

.text-button
{
  background: none;
  border: 0;
  padding: 5px;
}

.login-link
{
  font-weight: 700;
}

.table-scroll
{
  overflow-x: auto;
}

.user-table
{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
}

.user-table th,.user-table td
{
  text-align: left;
  padding: 13px 9px;
  border-bottom: 1px solid var(--line);
}

.account-form .remember-option
{
  gap: 8px;
  font-weight: 400;
}

.account-form input[type="checkbox"]
{
  appearance: auto!important;
  -webkit-appearance: checkbox!important;
  display: inline-block!important;
  position: static!important;
  opacity: 1!important;
  visibility: visible!important;
  flex: 0 0 16px;
  width: 16px!important;
  height: 16px!important;
  min-width: 16px;
  padding: 0;
  border-radius: 3px;
  background-image: none!important;
  accent-color: var(--blue);
  transform: none!important;
}

.account-form input[type="checkbox"]::before,.account-form input[type="checkbox"]::after
{
  content: none!important;
  display: none!important;
}

.account-form input[type="checkbox"]:focus-visible
{
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.brand-dot
{
  color: var(--blue);
}

.session-item
{
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.session-user-agent
{
  overflow-wrap: anywhere;
}

/* Onglets de navigation réutilisables. */
.tabs
{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}

.tabs a
{
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.tabs a:hover,
.tabs a[aria-current="page"]
{
  border-color: var(--blue);
  background: var(--soft);
  color: var(--blue);
}

.tabs a[aria-current="page"]
{
  font-weight: 700;
}

.tabs a:has(.tab-count),
.nav a:has(.tab-count)
{
  position: relative;
}

.tab-count
{
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* Raccourcis QIMS dans la barre supérieure de FACBOX. */
.topbar {gap:22px}
.header-shortcuts {display:flex;align-items:center;justify-content:center;gap:5px;flex:1;min-width:0}
.header-shortcut {display:flex;align-items:center;gap:7px;padding:8px 10px;border-radius:8px;font-size:12px;font-weight:600;color:var(--muted);white-space:nowrap}
.header-shortcut svg {width:21px;height:21px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.header-shortcut:hover,.header-shortcut.active {background:var(--soft);color:var(--blue)}
@media(max-width:1150px){.topbar{gap:10px;padding:0 16px}.header-shortcut{padding:8px}.header-shortcut span{display:none}.header-shortcut svg{width:24px;height:24px}}
@media(max-width:700px){.topbar{gap:5px;padding:0 8px}.brand{font-size:19px;gap:4px}.brand-icon{width:30px;height:30px}.header-shortcuts{gap:0}.header-shortcut{padding:7px 5px}.header-shortcut svg{width:20px;height:20px}.top-right .login-link,.logout-form{display:none}.theme-toggle{width:34px;height:34px;font-size:17px}}

/* Mise en page commune : contenu seul, sans colonnes latérales. */
.layout,body.facbox-home .layout
{
  display: block;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}
.main
{
  min-width: 0;
  width: 100%;
}
@media(max-width:700px)
{
  .layout,body.facbox-home .layout
  {
    display: block;
    padding: 18px 12px 30px;
  }
}

/* Thème clair FACBOX : référence QIMS, contraste renforcé. */
html:not([data-theme="dark"])
{
  color-scheme: light;
  --bg: #e9edf1;
  --panel: #ffffff;
  --text: #202b38;
  --muted: #536273;
  --line: #cbd4dd;
  --blue: #185e99;
  --soft: #e2eef8;
  --green: #116d4e;
}
html:not([data-theme="dark"]) .topbar
{
  background: linear-gradient(180deg, #3c79ac 0%, #28669a 100%);
  border-bottom: 1px solid #1f507a;
  color: #ffffff;
  box-shadow: 0 2px 6px #1c32462b;
}
html:not([data-theme="dark"]) .brand,
html:not([data-theme="dark"]) .login-link,
html:not([data-theme="dark"]) .topbar .text-button,
html:not([data-theme="dark"]) .header-shortcut
{
  color: #ffffff;
}
html:not([data-theme="dark"]) .brand-dot
{
  color: #d8edff;
}
html:not([data-theme="dark"]) .header-shortcut:hover,
html:not([data-theme="dark"]) .header-shortcut.active
{
  color: #ffffff;
  background: #174a78;
}
html:not([data-theme="dark"]) .theme-toggle
{
  background: #ffffff17;
  border: 1px solid #ffffff66;
  color: #ffffff;
}
html:not([data-theme="dark"]) .theme-toggle:hover
{
  background: #ffffff30;
}
html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .stat
{
  border-color: #c7d0d9;
  box-shadow: 0 2px 7px #24394b12;
}
html:not([data-theme="dark"]) .account-form input:not([type="checkbox"]),
html:not([data-theme="dark"]) .account-form select,
html:not([data-theme="dark"]) .account-form textarea,
html:not([data-theme="dark"]) input[type="search"],
html:not([data-theme="dark"]) input[type="text"],
html:not([data-theme="dark"]) select
{
  background: #ffffff;
  color: #1e2b38;
  border-color: #aebdca;
}
html:not([data-theme="dark"]) input::placeholder,
html:not([data-theme="dark"]) textarea::placeholder
{
  color: #657586;
  opacity: 1;
}
html:not([data-theme="dark"]) .button.primary
{
  background: #185e99;
  color: #ffffff;
}
html:not([data-theme="dark"]) .button.primary:hover
{
  background: #104b7f;
}
html:not([data-theme="dark"]) .qhome-tile
{
  border-color: #1e5079;
  background: linear-gradient(to bottom, #347eaf 0%, #2f709f 50%, #235985 50%, #1b4e78 100%);
  color: #ffffff;
}
html:not([data-theme="dark"]) .qhome-create h2
{
  border-bottom-color: #bfcbd5;
}

/* Même pictogramme SVG dans l'accueil et dans le bandeau. */
.qhome-quick-tile .qhome-icon svg
{
  width: 35px;
  height: 35px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Menu Compte, bandeau supérieur. */
.facbox-top-menus {display:flex;align-items:center;flex-shrink:0}
.facbox-top-menu {position:relative}
.facbox-top-menu summary {list-style:none;cursor:pointer;display:flex;gap:7px;align-items:center;padding:9px 13px;border-radius:6px;font-size:13px;font-weight:650;white-space:nowrap}
.facbox-top-menu summary::-webkit-details-marker {display:none}
.facbox-top-menu[open] summary,.facbox-top-menu summary:hover {background:#ffffff25}
.facbox-top-dropdown {position:absolute;top:100%;left:0;z-index:30;min-width:245px;padding:7px;border-radius:9px;background:var(--panel);border:1px solid var(--line);box-shadow:0 10px 30px #0003;color:var(--text)}
.facbox-top-dropdown a {display:block;padding:10px 12px;font-size:13px;border-radius:5px}
.facbox-top-dropdown a:hover,.facbox-top-dropdown a[aria-current="page"] {background:var(--soft);color:var(--blue)}
.facbox-top-divider {height:1px;background:var(--line);margin:6px 8px}
html[data-theme="dark"] .facbox-top-menu[open] summary,html[data-theme="dark"] .facbox-top-menu summary:hover {background:var(--soft)}
@media(max-width:700px){.facbox-top-menu summary{padding:7px;font-size:12px}.facbox-top-dropdown{position:fixed;top:60px;left:8px;min-width:min(260px,calc(100vw - 16px))}}

/* Bandeau QIMS : raccourcis seuls puis menus sans encadrement. */
.topbar {gap:10px;overflow:visible}
.header-shortcuts {flex:0 0 auto;justify-content:flex-start;gap:2px}
.header-shortcut {position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:44px;padding:8px;border-radius:3px}
.header-shortcut svg {width:25px;height:25px}
.top-right {margin-left:auto}
.facbox-top-menus {gap:0}
.facbox-top-menu {position:relative;flex:0 0 auto}
.facbox-menu-trigger {appearance:none!important;display:flex!important;align-items:center;gap:7px;border:0!important;outline-offset:2px;border-radius:0!important;background:transparent!important;color:inherit!important;font:inherit;font-size:14px!important;font-weight:650!important;padding:12px 13px!important;min-height:44px;box-shadow:none!important;cursor:pointer}
.facbox-menu-trigger:hover,.facbox-top-menu.is-open .facbox-menu-trigger {background:#ffffff25!important;color:inherit!important}
.facbox-menu-trigger span {font-size:13px}
.facbox-top-dropdown {position:absolute;top:100%;left:0;z-index:90;min-width:235px;max-height:calc(100vh - 90px);overflow-y:auto;background:var(--panel)!important;color:var(--text)!important;border:1px solid var(--line);box-shadow:0 12px 30px #0003;border-radius:5px;padding:6px}
.facbox-top-dropdown[hidden] {display:none!important}
.facbox-top-dropdown a {display:block!important;color:var(--text)!important;text-align:left;padding:9px 12px;border:0!important;background:transparent!important;font-weight:400;white-space:nowrap}
.facbox-top-dropdown a:hover,.facbox-top-dropdown a[aria-current="page"] {background:var(--soft)!important;color:var(--blue)!important}
html[data-theme="dark"] .facbox-menu-trigger:hover,html[data-theme="dark"] .facbox-top-menu.is-open .facbox-menu-trigger {background:#ffffff1b!important}
@media(max-width:1150px){.header-shortcut{width:39px;flex-basis:39px;padding:7px}.header-shortcut svg{width:23px;height:23px}.facbox-menu-trigger{padding:9px!important}}
@media(max-width:700px){.topbar{gap:2px;padding:0 7px}.header-shortcuts{gap:0}.header-shortcut{width:28px;flex-basis:28px;height:38px;padding:4px}.header-shortcut svg{width:20px;height:20px}.facbox-menu-trigger{font-size:12px!important;padding:7px 5px!important}.facbox-top-dropdown{position:fixed;top:64px;left:8px;right:8px;min-width:0;max-height:75vh}.top-right{gap:4px}}

/* Menu utilisateur, aligné à droite du bandeau. */
.facbox-user-menu {position:relative}
.facbox-user-trigger {white-space:nowrap}
.facbox-user-dropdown {left:auto!important;right:0!important;min-width:215px}
.facbox-dropdown-logout {margin:0}
.facbox-dropdown-logout button {display:block;width:100%;padding:9px 12px;border:0!important;background:transparent!important;color:var(--text)!important;text-align:left;font-size:13px;font-weight:400;border-radius:5px;box-shadow:none!important}
.facbox-dropdown-logout button:hover {background:var(--soft)!important;color:var(--blue)!important}
@media(max-width:700px) {
  .facbox-user-trigger {max-width:100px;overflow:hidden;text-overflow:ellipsis}
  .facbox-user-dropdown {position:absolute!important;top:100%!important;right:0!important;left:auto!important;width:max-content;min-width:190px;max-width:calc(100vw - 16px)}
}

/* Navigation responsive FACBOX — uniquement les menus de gestion passent au burger. */
.facbox-nav-burger {display:none!important;align-items:center;justify-content:center;flex:0 0 auto;width:40px;height:42px;padding:8px;border:0!important;background:transparent!important;color:inherit!important;box-shadow:none!important;border-radius:4px;cursor:pointer}
.facbox-nav-burger svg {width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.facbox-nav-panel {display:flex;align-items:center;gap:0}
.facbox-user-icon {display:none;width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round}
@media(max-width:1050px) {
  .topbar {display:flex;flex-wrap:nowrap;gap:5px;min-width:0;overflow:visible;padding:0 10px}
  .brand {flex:0 0 auto}
  .header-shortcuts {flex:0 0 auto;gap:0;min-width:0}
  .header-shortcut {width:34px;flex-basis:34px;padding:5px}
  .header-shortcut svg {width:22px;height:22px}
  .facbox-top-menus {position:relative;flex:0 0 auto}
  .facbox-nav-burger {display:flex!important}
  .facbox-nav-burger:hover,.facbox-top-menus.is-open .facbox-nav-burger {background:#ffffff25!important}
  .facbox-nav-panel {display:none;position:absolute;z-index:100;top:100%;right:0;width:260px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 62px);overflow-y:auto;padding:6px;background:var(--panel);color:var(--text);border:1px solid var(--line);box-shadow:0 12px 30px #0003;border-radius:6px;align-items:stretch}
  .facbox-top-menus.is-open .facbox-nav-panel {display:flex;flex-direction:column}
  .facbox-nav-panel .facbox-top-menu {position:static;width:100%}
  .facbox-nav-panel .facbox-menu-trigger {display:flex!important;width:100%;justify-content:space-between;color:var(--text)!important;text-align:left;padding:12px!important;border-radius:4px!important}
  .facbox-nav-panel .facbox-menu-trigger:hover,.facbox-nav-panel .facbox-top-menu.is-open .facbox-menu-trigger {background:var(--soft)!important;color:var(--blue)!important}
  .facbox-nav-panel .facbox-top-dropdown {display:block;position:static!important;width:100%;min-width:0!important;max-width:none;max-height:none;overflow:visible;padding:2px 0 6px 9px;border:0!important;box-shadow:none!important;border-radius:0;background:var(--panel)!important}
  .facbox-nav-panel .facbox-top-dropdown[hidden] {display:none!important}
  .facbox-nav-panel .facbox-top-dropdown a {white-space:normal;padding:9px 10px}
  .top-right {flex:0 0 auto;gap:4px;margin-left:auto}
  .facbox-user-dropdown {z-index:110}
}
@media(max-width:700px) {
  .topbar {gap:2px;padding:0 6px}
  .brand {gap:3px;font-size:17px}
  .brand-icon {width:27px;height:27px}
  .header-shortcut {width:28px;flex-basis:28px;height:38px;padding:3px}
  .header-shortcut svg {width:20px;height:20px}
  .facbox-nav-burger {width:32px;height:38px;padding:4px}
  .facbox-nav-burger svg {width:23px;height:23px}
  .facbox-user-trigger {padding:6px 4px!important;min-height:38px;gap:3px}
  .facbox-user-name {display:none}
  .facbox-user-icon {display:block}
  .theme-toggle {flex:0 0 auto;width:30px;height:30px;font-size:16px}
  .facbox-user-dropdown {position:absolute!important;top:100%!important;left:auto!important;right:0!important}
}
@media(max-width:390px) {
  .brand {font-size:0;gap:0}
  .brand-dot {display:none}
  .brand-icon {width:30px;height:30px}
}

/* Burger en derniere position sur mobile et tablette. */
@media(max-width:1050px) {
  .topbar > .brand {order:0}
  .topbar > .header-shortcuts {order:1}
  .topbar > .top-right {order:2;margin-left:auto}
  .topbar > .facbox-top-menus {order:3;margin-left:0}
}

/* Rapprocher les titres du bandeau de navigation. */
/* Retirer la hauteur inutile sous le menu et rapprocher les titres d'une ligne. */
.layout, body.facbox-home .layout {padding-top:0;margin-top:-14px}
@media(max-width:700px) {
  .layout, body.facbox-home .layout {padding-top:0;margin-top:-8px}
}

/* Contraste renforce : page / panneaux / champs. */
html:not([data-theme="dark"]) {
  --bg: #dce3ea;
  --panel: #ffffff;
  --line: #b5c1cc;
}
html:not([data-theme="dark"]) .facbox-docs-search {
  background: #eef3f8;
  border: 1px solid #98aabb;
  box-shadow: 0 3px 11px #263b4d19;
}
html:not([data-theme="dark"]) .facbox-search-toolbar input,
html:not([data-theme="dark"]) .facbox-search-toolbar select,
html:not([data-theme="dark"]) .facbox-search-extra select {
  background: #ffffff;
  color: #172a3b;
  border: 1px solid #8599ab;
  box-shadow: 0 2px 5px #1b34401f;
}
html:not([data-theme="dark"]) .facbox-search-toolbar input::placeholder {
  color: #667788;
  opacity: 1;
}
html:not([data-theme="dark"]) .facbox-search-toolbar input:focus,
html:not([data-theme="dark"]) .facbox-search-toolbar select:focus,
html:not([data-theme="dark"]) .facbox-search-extra select:focus {
  outline: 2px solid #2879b7;
  outline-offset: 1px;
  border-color: #21679c;
}
html[data-theme="dark"] .facbox-docs-search {
  background: #223240;
  border: 1px solid #445e73;
}
html[data-theme="dark"] .facbox-search-toolbar input,
html[data-theme="dark"] .facbox-search-toolbar select,
html[data-theme="dark"] .facbox-search-extra select {
  background: #101c27;
  color: #f0f6fc;
  border: 1px solid #60798d;
  box-shadow: 0 2px 6px #0003;
}

/* Hierarchie globale des surfaces : page grise, carte teintee, champs blancs. */
html:not([data-theme="dark"]) .main .card,
html:not([data-theme="dark"]) main .card {
  background: #eef3f8;
  border: 1px solid #98aabb;
  box-shadow: 0 3px 11px #263b4d14;
}
html:not([data-theme="dark"]) main fieldset {
  background: #f5f8fc;
  border: 1px solid #c3ced8;
  border-radius: 6px;
}
html:not([data-theme="dark"]) main input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
html:not([data-theme="dark"]) main select,
html:not([data-theme="dark"]) main textarea {
  background: #fff;
  color: #172a3b;
  border: 1px solid #8599ab;
  box-shadow: 0 2px 5px #1b34401a;
}
html:not([data-theme="dark"]) main input:not([type="checkbox"]):not([type="radio"]):focus-visible,
html:not([data-theme="dark"]) main select:focus-visible,
html:not([data-theme="dark"]) main textarea:focus-visible {
  border-color: #21679c;
  outline: 2px solid #2879b7;
  outline-offset: 1px;
}
html[data-theme="dark"] main .card {
  background: #223240;
  border: 1px solid #445e73;
}
html[data-theme="dark"] main fieldset {
  background: #1b2a37;
  border: 1px solid #445e73;
}
html[data-theme="dark"] main input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
html[data-theme="dark"] main select,
html[data-theme="dark"] main textarea {
  background: #101c27;
  color: #f0f6fc;
  border: 1px solid #60798d;
}

/* Placeholders volontairement discrets, sans toucher aux valeurs saisies. */
html:not([data-theme="dark"]) main input::placeholder,
html:not([data-theme="dark"]) main textarea::placeholder {
  color: #aab3bd !important;
  opacity: .55 !important;
  font-weight: 400;
}
html[data-theme="dark"] main input::placeholder,
html[data-theme="dark"] main textarea::placeholder {
  color: #87919d !important;
  opacity: .40 !important;
  font-weight: 400;
}

/* Palette documentaire QIMS : 37 couleurs CSS prédéfinies. */
.facbox-doc-control.facbox-doc-color-palette{display:flex;flex-wrap:wrap;align-items:center;gap:6px;width:100%;max-width:1000px;padding:5px 0}
.facbox-doc-color-option{position:relative;display:inline-flex;cursor:pointer;flex:0 0 auto}
.facbox-doc-color-option input[type="radio"]{position:absolute;width:1px;height:1px;min-height:0;opacity:0;pointer-events:none}
.facbox-doc-color-swatch{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:50%;background:var(--swatch);color:var(--swatch-text);border:1px solid #0003;font-size:11px;font-weight:700;line-height:1;box-shadow:0 1px 2px #0002;transition:transform .12s ease}
.facbox-doc-color-option input:checked + .facbox-doc-color-swatch{outline:3px solid var(--blue);outline-offset:2px;transform:scale(1.07)}
.facbox-doc-color-option input:focus-visible + .facbox-doc-color-swatch{outline:3px solid var(--text);outline-offset:3px}
.facbox-doc-color-option input:disabled + .facbox-doc-color-swatch{opacity:.55;cursor:not-allowed}

/* Contraste automatique QIMS : blanc sur fond foncé, noir sur fond clair. */
.doc-card.facbox-result-card .facbox-result-head,
.doc-card.facbox-result-card .facbox-result-head .facbox-result-heading,
.doc-card.facbox-result-card .facbox-result-head .facbox-result-type,
.doc-card.facbox-result-card .facbox-result-head .facbox-result-title,
.doc-card.facbox-result-card .facbox-result-head .facbox-result-id,
.doc-card.facbox-result-card .facbox-result-head small,
.doc-card.facbox-result-card .facbox-result-head strong{
  color:var(--doc-head-text,#000)!important;
}
.doc-card.facbox-result-card .facbox-result-info a.facbox-related-badge,
.facbox-result-table a.facbox-related-badge{
  background-color:var(--related-color,#f8f8ff)!important;
  color:var(--related-text,#000)!important;
}

/* Compte dans l'en-tête : nom et société sur deux lignes. */
.facbox-user-lines{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-width:0;line-height:1.2;text-align:left}
.facbox-user-lines .facbox-user-name{display:block;font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;max-width:190px}
.facbox-user-company{display:block;font-size:11px;font-weight:400;opacity:.82;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px;margin-top:2px}
@media(max-width:700px){
 .facbox-user-lines{display:none}
}

/* Photo personnelle accolée au nom et à la société dans le bandeau. */
.facbox-header-avatar{display:block;flex:0 0 36px;width:36px;height:36px;border-radius:50%;object-fit:cover;object-position:center;border:1px solid rgba(255,255,255,.35)}
.facbox-user-trigger:has(.facbox-header-avatar) .facbox-user-icon{display:none}
@media(max-width:700px){.facbox-header-avatar{width:30px;height:30px;flex-basis:30px}}

/* En-tête mobile : cinq raccourcis agrandis, sans toucher à l'avatar ni au burger. */
@media (max-width:700px)
{
  .topbar .header-shortcuts{gap:1px;justify-content:flex-start}
  .topbar .header-shortcuts .header-shortcut{
    width:38px;
    min-width:38px;
    height:42px;
    flex:0 0 38px;
    padding:7px 6px;
    box-sizing:border-box;
    justify-content:center;
  }
  .topbar .header-shortcuts .header-shortcut svg{
    width:26px;
    height:26px;
    flex:0 0 26px;
  }
}

/* Mode support toujours visible, sans confondre son identité avec l'admin. */
.facbox-support-banner{
 position:sticky;top:0;z-index:80;
 display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;
 margin-bottom:14px;padding:12px 16px;border:2px solid #d39524;border-radius:8px;
 background:var(--panel);color:var(--text);box-shadow:0 2px 12px #0002;
 font-size:13px;
}
.facbox-support-banner strong{color:#d39524}
.facbox-support-banner form{margin:0}
.facbox-support-banner .button{white-space:nowrap}
.facbox-support-form{display:flex;flex-wrap:wrap;align-items:end;gap:12px}
.facbox-support-form label{display:flex;flex:1 1 220px;flex-direction:column;gap:5px;font-weight:600;font-size:13px}
.facbox-support-form select,.facbox-support-form input{
 box-sizing:border-box;width:100%;min-height:42px;padding:8px 11px;
 background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:6px;
}
.facbox-support-form button{min-height:42px}

/* Badge d'assistance dans le menu supérieur, à gauche du compte utilisateur. */
.facbox-support-badge{margin:0;display:flex;flex:0 0 auto;align-items:center}
.facbox-support-badge button{
 display:inline-flex!important;align-items:center;justify-content:center;gap:6px!important;
 width:auto!important;min-height:30px!important;height:auto!important;padding:5px 9px!important;
 border:1px solid #d39524!important;border-radius:99px!important;
 background:#d3952426!important;color:inherit!important;
 font-size:12px!important;line-height:1.2!important;font-weight:650!important;
 box-shadow:none!important;white-space:nowrap;cursor:pointer
}
.facbox-support-badge button:hover{background:#d3952440!important}
.facbox-support-badge-minutes{font-size:11px;opacity:.8}
@media(max-width:600px){.facbox-support-badge button{padding:5px 7px!important;font-size:11px!important}.facbox-support-badge-minutes{display:none}}


/* Bordures communes des champs de saisie (clair / sombre). */
:root{
  --facbox-field-radius:7px;
  --facbox-field-border:#8599ab;
  --facbox-field-min-height:43px;
}
html[data-theme="dark"]{--facbox-field-border:#60798d}
main :is(input[type="text"],input[type="email"],input[type="tel"],input[type="url"],
  input[type="number"],input[type="date"],input[type="datetime-local"],
  input[type="time"],input[type="search"],input[type="password"],textarea),
dialog.facbox-invoice-dialog :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),textarea){
  box-sizing:border-box;
  border:1px solid var(--facbox-field-border)!important;
  border-radius:var(--facbox-field-radius)!important;
}
main textarea:not(.facbox-detail-text):not(.facbox-detail-input):not([data-no-autogrow]),
dialog.facbox-invoice-dialog textarea:not([data-no-autogrow]){
  min-height:var(--facbox-field-min-height)!important;
  max-height:none;
  overflow-y:hidden!important;
  resize:none!important;
  line-height:1.5;
}
.facbox-profile-control textarea{min-height:var(--facbox-field-min-height)!important}

/* Menu principal : rubrique active et élément sélectionné. */
.facbox-top-menus .facbox-menu-trigger[aria-current="page"]{
  background:#ffffff30!important;
  box-shadow:inset 0 -3px 0 currentColor!important;
}
.facbox-top-dropdown a[aria-current="page"]{
  background:var(--soft)!important;
  color:var(--blue)!important;
  font-weight:700!important;
}
@media(max-width:1050px){
  .facbox-nav-panel .facbox-menu-trigger[aria-current="page"]{
    background:var(--soft)!important;
    color:var(--blue)!important;
    box-shadow:inset 3px 0 0 var(--blue)!important;
  }
}



/* Rappels QIMS sous la navigation : bulles discrètes sur toutes les pages connectées. */
/* Tâches sur la bordure nav/page, sans hauteur de ligne supplémentaire. */
.topbar .facbox-task-ribbon{
  position:absolute;
  box-sizing:border-box;
  top:100%;
  left:50%;
  transform:translate(-50%,-50%);
  z-index:2;
  width:max-content;
  max-width:calc(100% - 36px);
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:nowrap;
  white-space:nowrap;
  justify-content:flex-start;
  align-items:center;
  gap:6px;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  overscroll-behavior-x:contain;
}
.topbar .facbox-task-ribbon::-webkit-scrollbar{display:none}
.facbox-task-bubble{
  --task-bubble-color:#e2e8f0;
  --task-bubble-ink:#162436;
  display:inline-flex;
  align-items:center;
  gap:5px;
  max-width:min(100%,560px);
  box-sizing:border-box;
  min-height:27px;
  padding:4px 8px;
  border-radius:7px;
  background:var(--task-bubble-color);
  color:var(--task-bubble-ink)!important;
  font-size:12px;
  font-weight:600;
  line-height:1.3;
  text-decoration:none!important;
  opacity:.84;
  transition:opacity .15s ease,filter .15s ease;
}
.facbox-task-bubble:hover,.facbox-task-bubble:focus-visible{
  opacity:1;
  filter:saturate(1.07);
  text-decoration:none!important;
}
.facbox-task-bubble-icon{
  width:14px;
  height:14px;
  flex:0 0 14px;
  fill:currentColor;
}
.facbox-task-bubble-name{
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.facbox-task-bubble-due,.facbox-task-bubble-stars{flex:none;white-space:nowrap}
.facbox-task-bubble-stars{letter-spacing:1px;font-size:12px}
.facbox-task-more{
  display:inline-flex;align-items:center;
  min-height:27px;padding:4px 10px;
  border-radius:7px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--blue);
  opacity:.85;
  font-size:12px;
  text-decoration:none;
}
.facbox-task-more:hover{opacity:1}
@media(max-width:700px){
  .topbar .facbox-task-ribbon{max-width:calc(100% - 14px);padding:0;gap:5px}
  .facbox-task-bubble{max-width:100%;font-size:11px;min-height:26px}
  .facbox-task-bubble-stars{letter-spacing:0;font-size:11px}
}


/* FACBOX — mentions légales et confidentialité publiques. */
.facbox-legal{max-width:1020px;margin:0 auto 32px;color:var(--text);font-size:14px;line-height:1.72}
.facbox-legal-header{padding:26px clamp(18px,4vw,40px);border:1px solid var(--line);border-radius:14px;background:var(--panel);margin-bottom:15px}
.facbox-legal-overline{display:block;color:var(--blue);font-weight:750;text-transform:uppercase;letter-spacing:.11em;font-size:11px}
.facbox-legal-header h1{margin:8px 0 10px;font-size:clamp(26px,3.2vw,37px);letter-spacing:-.035em;line-height:1.22}
.facbox-legal-header p{max-width:780px;margin:0;color:var(--muted);font-size:15px}
.facbox-legal-meta{display:flex;gap:10px 18px;flex-wrap:wrap;align-items:center;margin-top:17px;font-size:12px;color:var(--muted)}
.facbox-legal a{color:var(--blue);text-underline-offset:3px}
.facbox-legal a:hover{text-decoration:underline}
.facbox-legal-toc{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 18px}
.facbox-legal-toc a{display:inline-flex;align-items:center;min-height:30px;padding:4px 11px;border:1px solid var(--line);border-radius:20px;background:var(--panel);text-decoration:none;font-size:12px;font-weight:600;color:var(--text)}
.facbox-legal-toc a:hover{border-color:var(--blue);color:var(--blue)}
.facbox-legal-section{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:23px clamp(17px,3.2vw,32px);margin-bottom:12px;scroll-margin-top:70px}
.facbox-legal-section h2{margin:0 0 14px;color:var(--text);font-size:19px;line-height:1.32}
.facbox-legal-section h3{font-size:15px;margin:18px 0 8px}
.facbox-legal-section p{margin:0 0 11px}
.facbox-legal-section p:last-child{margin-bottom:0}
.facbox-legal-section ul,.facbox-legal-section ol{margin:8px 0 14px;padding-left:23px}
.facbox-legal-section li{padding-left:2px;margin:5px 0}
.facbox-legal-details{margin:14px 0}
.facbox-legal-details>div{display:grid;grid-template-columns:minmax(145px,235px) minmax(0,1fr);gap:10px 22px;padding:11px 0;border-bottom:1px solid var(--line)}
.facbox-legal-details>div:last-child{border-bottom:0}
.facbox-legal-details dt{font-weight:700;color:var(--muted)}
.facbox-legal-details dd{margin:0;overflow-wrap:anywhere}
.facbox-legal-small{color:var(--muted);font-size:12px}
.facbox-legal-table-wrap{max-width:100%;overflow-x:auto;margin:15px 0}
.facbox-legal-table{border-collapse:collapse;width:100%;font-size:13px;line-height:1.55}
.facbox-legal-table th,.facbox-legal-table td{text-align:left;vertical-align:top;padding:10px 12px;border:1px solid var(--line)}
.facbox-legal-table th{background:var(--soft);font-weight:700}
.facbox-legal-next{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 5px}
.facbox-legal-next a{font-weight:650}
.facbox-site-footer{margin:10px auto 18px;max-width:1200px;display:flex;justify-content:center;align-items:center;gap:6px 16px;flex-wrap:wrap;padding:9px 12px;color:var(--muted);font-size:11px;line-height:1.5;text-align:center}
.facbox-site-footer a{color:var(--muted);text-decoration:none}
.facbox-site-footer a:hover{color:var(--blue);text-decoration:underline}
@media(max-width:620px){
  .facbox-legal-header{padding:22px 18px}
  .facbox-legal-section{padding:20px 17px}
  .facbox-legal-details>div{grid-template-columns:1fr;gap:2px;padding:10px 0}
  .facbox-legal-table{min-width:490px}
  .facbox-site-footer{margin-bottom:14px}
}

/* Confirmation d'enregistrement flottante : ne décale jamais la fiche. */
.facbox-save-toast{
  position:fixed;
  top:82px;
  left:32px;
  z-index:100;
  display:inline-flex;
  align-items:center;
  gap:8px;
  max-width:calc(100vw - 24px);
  padding:9px 14px;
  border:1px solid rgba(35,140,91,.35);
  border-radius:12px;
  background:rgba(224,247,234,.88);
  color:#176b43;
  box-shadow:0 6px 20px rgba(0,0,0,.12);
  backdrop-filter:blur(9px);
  -webkit-backdrop-filter:blur(9px);
  font-size:13px;
  font-weight:650;
  pointer-events:none;
  animation:facbox-save-toast-hide 4s ease-in-out forwards;
}
html[data-theme="dark"] .facbox-save-toast{
  border-color:rgba(109,211,157,.3);
  background:rgba(24,64,49,.86);
  color:#b8f3d1;
}
@keyframes facbox-save-toast-hide{
  0%{opacity:0;transform:translateY(-5px);visibility:visible}
  8%,78%{opacity:1;transform:translateY(0);visibility:visible}
  100%{opacity:0;transform:translateY(-5px);visibility:hidden}
}
@media(max-width:700px){
  .facbox-save-toast{top:72px;left:10px;padding:8px 11px}
}
@media(prefers-reduced-motion:reduce){
  .facbox-save-toast{animation-name:facbox-save-toast-hide;animation-timing-function:steps(1,end)}
}


/* Connexion : création de compte aussi visible et large que Se connecter. */
.auth-card .account-form > .facbox-register-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:43px;
  padding:11px 16px;
  text-align:center;
  font:inherit;
  font-weight:700;
}

/* Rappel discret Web Push, uniquement si ce navigateur n'est pas abonné. */
.facbox-push-reminder[hidden]{display:none!important}
.facbox-push-reminder{display:inline-flex;position:relative;flex:none;
  align-items:center;justify-content:center;width:33px;height:33px;
  border:1px solid var(--line);border-radius:8px;color:var(--muted);
  background:var(--panel);text-decoration:none}
.facbox-push-reminder:hover{color:var(--blue);border-color:var(--blue)}
.facbox-push-reminder svg{width:18px;height:18px;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.facbox-push-reminder-dot{position:absolute;top:4px;right:4px;width:7px;height:7px;
  border-radius:50%;background:#e49f32;border:1px solid var(--panel)}
