/* ============================================================
   FAC Accounting Suite — design system
   Palette : bleu nuit #071A33 / marine FAC #003366 / or #C9A227
   ============================================================ */

:root {
  --navy-950: #050F1F;
  --navy-900: #071A33;
  --navy-800: #0A2547;
  --navy-700: #0F3161;
  --navy: #003366;
  --navy-soft: #F0F4F9;
  --gold: #C9A227;
  --gold-soft: #F7EFD8;
  --teal: #0E7490;
  --green: #008040;
  --red: #B42318;
  --orange: #B45309;
  --ink: #16202E;
  --muted: #5B6B7F;
  --line: #E3E8EF;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  /* Identité typographique FAC : Bookman sur l'ensemble de l'interface. */
  --serif: "Bookman Old Style", "URW Bookman", "TeX Gyre Bonum", "Bookman", "Bookman Old Style Bold", Georgia, "Times New Roman", serif;
  --sans: "Bookman Old Style", "URW Bookman", "TeX Gyre Bonum", "Bookman", Georgia, "Times New Roman", serif;
  --mono: "Bookman Old Style", "URW Bookman", "TeX Gyre Bonum", Georgia, serif;
  --shadow-sm: 0 1px 2px rgba(4, 20, 45, .05), 0 3px 10px rgba(4, 20, 45, .05);
  --shadow-md: 0 6px 24px rgba(4, 20, 45, .10);
  --shadow-lg: 0 18px 50px rgba(4, 20, 45, .22);
  --r: 10px;
  --r-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 13px; /* Bookman a un œil large : légèrement resserré pour les tableaux denses */
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums tabular-nums; /* chiffres alignés dans tout le logiciel */
}
#app { height: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--navy); text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 700; }
.num, td.right, th.right { font-variant-numeric: tabular-nums; }
.ic { vertical-align: -3px; flex: none; }

/* ============ ÉCRAN DE CONNEXION ============ */
.login { display: flex; min-height: 100vh; }
.login-left {
  flex: 1.1; background:
    radial-gradient(1100px 500px at -10% -20%, rgba(201, 162, 39, .16), transparent 55%),
    radial-gradient(900px 600px at 110% 110%, rgba(14, 116, 144, .25), transparent 55%),
    linear-gradient(160deg, var(--navy-900), var(--navy-950) 70%);
  color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-left::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='420' height='420' viewBox='0 0 420 420' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='1'%3E%3Ccircle cx='210' cy='210' r='100'/%3E%3Ccircle cx='210' cy='210' r='160'/%3E%3Ccircle cx='210' cy='210' r='220'/%3E%3C/g%3E%3C/svg%3E") right -80px bottom -80px no-repeat;
}
.login-logo { height: 58px; width: auto; align-self: flex-start; margin-bottom: 34px; }
.login-left h1 { color: #fff; font-size: 40px; letter-spacing: .5px; margin-bottom: 14px; }
.login-left h1 span { color: var(--gold); font-style: italic; }
.login-left p { color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.65; max-width: 520px; }
.login-feats { list-style: none; margin-top: 30px; display: grid; gap: 13px; }
.login-feats li { display: flex; gap: 11px; align-items: center; color: rgba(255, 255, 255, .9); font-size: 13.5px; }
.login-feats .ic { color: var(--gold); }
.login-foot { margin-top: 46px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.login-foot a { color: var(--gold); text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }
a.tb-bell { display: inline-flex; align-items: center; }
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-box { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 34px 36px; }
.login-box h2 { font-size: 21px; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.login-users { display: grid; gap: 8px; margin-bottom: 20px; max-height: 320px; overflow: auto; }
.login-user {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; transition: all .15s;
}
.login-user:hover { border-color: var(--navy); background: var(--navy-soft); }
.login-user.sel { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(201, 162, 39, .18); }
.login-user-client { border-style: dashed; }
.login-user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.login-user-info strong { font-size: 13.5px; }
.login-user-info em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.login-2fa { color: var(--green); }
.login-form { display: grid; gap: 12px; }
.login-note { margin-top: 18px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.inp-code { text-align: center; letter-spacing: 12px; font-size: 24px !important; }

/* --- Écrans d'accès : assistant, connexion, changement de mot de passe --- */
.login-right { overflow-y: auto; }
.login-box-wide { max-width: 520px; }
.login-box .field-label { margin-top: 2px; }
.login-err {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px;
  padding: 11px 13px; border-radius: var(--r); font-size: 12.5px; line-height: 1.5;
  background: #FBEAE8; color: #7c1a12; border: 1px solid #F2C4BE;
}
.login-err[hidden] { display: none; }
.login-err .ic { flex: none; margin-top: 1px; }
.login-help {
  display: block; margin: 14px auto 0; font-size: 12.5px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.login-help:hover { color: var(--navy); }
.auth-list { margin: 12px 0 14px 18px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.auth-list li { margin-bottom: 8px; }

/* Jauge de conformité du mot de passe */
.pol { margin: -4px 0 2px; }
.pol-bar { height: 5px; background: var(--line); border-radius: 4px; overflow: hidden; }
.pol-bar span { display: block; height: 100%; border-radius: 4px; transition: width .2s, background .2s; }
.pol-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin-top: 9px; }
.pol-list li { display: flex; align-items: center; gap: 5px; font-size: 11.5px; }
.pol-ko { color: var(--muted); }
.pol-ok { color: var(--green); }

/* Assistant de création de l'espace cabinet */
.wiz-step {
  display: inline-block; margin-bottom: 8px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.wiz-opts { display: grid; gap: 9px; }
.wiz-opt { align-items: flex-start; padding: 12px 13px; width: 100%; cursor: pointer; }
.wiz-opt .login-user-info { gap: 3px; }
.wiz-opt .login-user-info em { line-height: 1.5; white-space: normal; }
.wiz-opt-ic { flex: none; color: var(--navy); margin-top: 1px; }
.wiz-opt .wiz-check { flex: none; color: var(--line); }
.wiz-opt.sel .wiz-check { color: var(--green); }
.wiz-opt.sel .wiz-opt-ic { color: #8a6d12; }

/* ============ COQUILLE ============ */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 242px; flex: none; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: rgba(255, 255, 255, .85);
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sb-brand img { height: 36px; width: auto; }
.sb-brand-t { font-family: var(--serif); font-size: 13px; line-height: 1.25; color: var(--gold); letter-spacing: .04em; }
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sb-sec { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .38); padding: 14px 10px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 8.5px 11px; border-radius: 8px;
  color: rgba(255, 255, 255, .8); font-size: 13px; margin-bottom: 2px; transition: all .13s; position: relative;
}
.sb-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sb-link.active { background: rgba(201, 162, 39, .14); color: #fff; }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--gold); }
.sb-link.active .ic { color: var(--gold); }
.sb-badge {
  margin-left: auto; background: var(--gold); color: var(--navy-950);
  border-radius: 11px; font-size: 10.5px; font-weight: 700; padding: 1.5px 7.5px; line-height: 1.4;
}
.sb-badge:empty { display: none; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-user-main {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  text-align: left; padding: 4px 5px; margin: -4px -5px; border-radius: 8px; transition: background .15s;
}
.sb-user-main:hover { background: rgba(255, 255, 255, .09); }
.sb-user-i { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-user-i strong { font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-i em { font-style: normal; font-size: 11px; color: rgba(255, 255, 255, .5); }
.sb-logout { color: rgba(255, 255, 255, .55); padding: 6px; border-radius: 7px; }
.sb-logout:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; flex: none; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: relative; z-index: 30;
}
.tb-burger { display: none; color: var(--navy); padding: 6px; }
.tb-context { display: flex; align-items: center; gap: 10px; }
.tb-select {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--navy);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; cursor: pointer; max-width: 280px;
}
.tb-client { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.tb-client-dot { width: 9px; height: 9px; border-radius: 50%; }
.tb-client-vide { color: var(--muted); font-size: 12.5px; }
.tb-spacer { flex: 1; }
.tb-search { position: relative; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; width: 320px; color: var(--muted); }
.tb-search input { border: none; outline: none; background: none; font-family: inherit; font-size: 13px; flex: 1; color: var(--ink); }
.tb-search-res {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; max-height: 380px; overflow-y: auto;
}
.tb-search-res.open { display: block; }
.gs-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.gs-item:hover { background: var(--navy-soft); }
.gs-item span { display: flex; flex-direction: column; min-width: 0; }
.gs-item strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item em { font-style: normal; font-size: 11px; color: var(--muted); }
.gs-empty, .notif-empty { padding: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.tb-bell { position: relative; color: var(--navy); padding: 8px; border-radius: 8px; }
.tb-bell:hover { background: var(--bg); }
.tb-bell-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; display: none; }
.tb-notifs {
  display: none; position: absolute; top: calc(100% + 4px); right: 18px; width: 380px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60;
}
.tb-notifs.open { display: block; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif:hover { background: var(--navy-soft); }
.notif-new { background: var(--gold-soft); }
.notif-ic { color: var(--navy); margin-top: 1px; }
.notif-msg { display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink); }
.notif-ts { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.content { flex: 1; overflow-y: auto; padding: 26px 30px 60px; }

/* ============ PAGE ============ */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; letter-spacing: .2px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 720px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ CARTES & GRILLES ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card h2, .card-title { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-23 { grid-template-columns: 2fr 3fr; }
.grid-32 { grid-template-columns: 3fr 2fr; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ============ KPI ============ */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px 18px; min-width: 0; }
.kpi-click { cursor: pointer; transition: all .15s; }
.kpi-click:hover { border-color: var(--navy); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.kpi-label { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi-ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.kpi-ic-navy { background: var(--navy-soft); color: var(--navy); }
.kpi-ic-gold { background: var(--gold-soft); color: #8a6d12; }
.kpi-ic-teal { background: #E0F2F6; color: var(--teal); }
.kpi-ic-green { background: #E4F3EA; color: var(--green); }
.kpi-ic-red { background: #FBEAE8; color: var(--red); }
.kpi-ic-orange { background: #FBF0E4; color: var(--orange); }
.kpi-value { font-size: 23px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi-sub { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 11.5px; }
.kpi-delta.pos { color: var(--green); }
.kpi-delta.neg { color: var(--red); }

/* ============ BOUTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8.5px 15px; border-radius: 9px;
  font-size: 13px; font-weight: 600; border: 1px solid transparent; transition: all .14s; white-space: nowrap;
}
.btn-sm { padding: 5.5px 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 18px; font-size: 14px; justify-content: center; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold); color: var(--navy-950); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-success { background: var(--green); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============ BADGES ============ */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.badge-ok { background: #E4F3EA; color: var(--green); }
.badge-warn { background: #FBF3DC; color: #8a6d12; }
.badge-err { background: #FBEAE8; color: var(--red); }
.badge-info { background: #E0F2F6; color: var(--teal); }
.badge-navy { background: var(--navy-soft); color: var(--navy); }
.badge-muted { background: #EEF1F5; color: var(--muted); }
.badge-gold { background: var(--gold-soft); color: #8a6d12; }

/* ============ TABLEAUX ============ */
.dt { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.dt-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dt-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; color: var(--muted); flex: 0 1 280px; }
.dt-search input { border: none; outline: none; background: none; font-family: inherit; font-size: 12.5px; width: 100%; color: var(--ink); }
.dt-count { font-size: 12px; color: var(--muted); }
.dt-tools { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
.dt-scroll { overflow-x: auto; }
.dt table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.dt th {
  text-align: left; padding: 10px 14px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: #FAFBFC;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.dt th.right { text-align: right; }
.dt th.center, .dt td.center { text-align: center; }
.dt-arrow { color: var(--gold); font-size: 9px; }
.dt td { padding: 9.5px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dt td.right { text-align: right; font-variant-numeric: tabular-nums; }
.dt tbody tr:last-child td { border-bottom: none; }
.dt-dense td { padding: 6.5px 14px; font-size: 12.3px; }
.dt-row-click { cursor: pointer; }
.dt-row-click:hover td { background: var(--navy-soft); }
.dt tfoot td { padding: 10px 14px; font-weight: 700; background: var(--navy-soft); color: var(--navy); border-top: 2px solid var(--navy); }
.dt-empty { padding: 34px; text-align: center; color: var(--muted); font-size: 13px; }
.dt-pager { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
td .badge { vertical-align: middle; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ============ ONGLETS ============ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-count { background: var(--navy-soft); color: var(--navy); border-radius: 12px; padding: 1px 8px; font-size: 11px; }

/* ============ FORMULAIRES ============ */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.field-help { font-size: 11.5px; color: var(--muted); }
.inp {
  font-family: inherit; font-size: 13px; padding: 8.5px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); outline: none; width: 100%; transition: border .13s;
}
.inp:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 51, 102, .08); }
.inp-lg { padding: 11px 14px; font-size: 14px; }
textarea.inp { resize: vertical; min-height: 74px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ============ AVATAR ============ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--teal)); color: #fff;
  font-size: 11px; font-weight: 700; flex: none; letter-spacing: .03em;
}

/* ============ MODALES ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 15, 31, .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px; z-index: 100; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-x { color: var(--muted); padding: 5px; border-radius: 7px; }
.modal-x:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 20px 22px; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); background: #FAFBFC; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.confirm-msg { font-size: 13.5px; line-height: 1.6; }

/* Modale « Mon compte » */
.mc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mc-head strong { font-size: 14.5px; }
.mc-head .badge { margin-left: auto; }
.mc-grid { display: grid; gap: 2px; margin: 12px 0 4px; }
.mc-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.mc-row span { color: var(--muted); }
.mc-row strong { font-weight: 600; text-align: right; word-break: break-word; }
.mc-t { font-size: 14px; margin: 20px 0 12px; }
.mc-form { display: grid; gap: 12px; }

/* ============ TOASTS ============ */
.toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 9px; background: var(--navy-900); color: #fff;
  padding: 12px 17px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13px;
  opacity: 0; transform: translateY(8px); transition: all .25s; max-width: 420px;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok .ic { color: #4ADE80; }
.toast-warn .ic { color: var(--gold); }
.toast-err .ic { color: #F87171; }

/* ============ ÉTAT VIDE ============ */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .ic { color: #B9C3CF; }
.empty h3 { font-size: 15px; color: var(--ink); font-family: var(--sans); }
.empty p { font-size: 13px; max-width: 420px; }

/* ============ GRAPHIQUES ============ */
.chart svg { width: 100%; height: auto; display: block; }
.ch-axis { stroke: var(--line); stroke-width: 1; }
.ch-lb { font-size: 10.5px; fill: var(--muted); font-family: var(--sans); }
.ch-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.ch-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ch-legend-col { flex-direction: column; gap: 7px; margin: 0 0 0 18px; }
.chart-donut { display: flex; align-items: center; }
.chart-donut svg { width: auto; flex: none; }
.ch-centre { font-size: 17px; font-weight: 700; fill: var(--navy); font-family: var(--sans); }
.ch-centre-sub { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.spark { display: block; }

/* ============ DIVERS ============ */
.prog { height: 7px; background: var(--line); border-radius: 5px; overflow: hidden; min-width: 70px; }
.prog-bar { height: 100%; border-radius: 5px; transition: width .3s; }
.timeline { display: grid; gap: 0; }
.tl-item { display: flex; gap: 13px; position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; z-index: 1; }
.tl-body { flex: 1; min-width: 0; padding-top: 3px; }
.tl-t { font-size: 12.8px; }
.tl-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.stat-line:last-child { border-bottom: none; }
.stat-line b { font-variant-numeric: tabular-nums; }
.alert-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); font-size: 13px; line-height: 1.5; align-items: flex-start; }
.alert-warn { background: #FBF3DC; color: #6d5610; border: 1px solid #EDD9A3; }
.alert-err { background: #FBEAE8; color: #7c1a12; border: 1px solid #F2C4BE; }
.alert-info { background: #E0F2F6; color: #0b4f61; border: 1px solid #B8E0EA; }
.alert-box .ic { flex: none; margin-top: 1px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-23, .grid-32 { grid-template-columns: 1fr; }
  .tb-search { width: 220px; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 90; transform: translateX(-100%); transition: transform .22s; width: 258px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .tb-burger { display: block; }
  .content { padding: 18px 16px 50px; }
  .login { flex-direction: column; }
  .login-left { padding: 36px 28px; }
  .login-left h1 { font-size: 30px; }
  .tb-search { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .tb-notifs { right: 8px; width: calc(100vw - 16px); }
}
@media (max-width: 560px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 19px; }
  .tb-select { max-width: 160px; }
}

/* ============ IMPRESSION ============ */
@media print {
  .sidebar, .topbar, .page-actions, .dt-bar, .dt-pager, .toasts { display: none !important; }
  .content { overflow: visible; padding: 0; }
  body { background: #fff; }
  .card, .dt, .kpi { box-shadow: none; border-color: #ccc; }
}

/* ============ SYNCHRONISATION (indicateur + arbitrage des conflits) ============ */
.sy-hote { display: flex; align-items: center; }
.sy-ind {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 12px; line-height: 1;
  max-width: 260px; white-space: nowrap;
}
.sy-ind:hover { border-color: var(--navy); color: var(--ink); }
.sy-ind-t { overflow: hidden; text-overflow: ellipsis; }
.sy-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sy-ind-synchronise .sy-dot { background: var(--green); }
.sy-ind-encours .sy-dot { background: var(--teal); animation: sy-pulse 1.1s ease-in-out infinite; }
.sy-ind-attente .sy-dot { background: var(--gold); }
.sy-ind-conflits .sy-dot { background: var(--red); }
.sy-ind-horsligne .sy-dot, .sy-ind-indisponible .sy-dot { background: var(--muted); }
@keyframes sy-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.72); } }

.sy-kpi-etat { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }

/* Panneau détaillé ouvert au clic sur l'indicateur */
.sy-pan {
  position: fixed; top: 60px; right: 16px; z-index: 95; width: 320px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 14px 16px 12px;
}
.sy-pan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sy-pan-head strong { font-family: var(--serif); color: var(--navy); font-size: 14px; }
.sy-pan-alert { margin-bottom: 10px; }
.sy-pan-lignes .stat-line { font-size: 12.5px; }
.sy-pan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Comparateur de conflits : ma version | champ | version du serveur */
.sy-conflit .sy-cmp {
  display: grid; grid-template-columns: 1fr minmax(120px, 0.7fr) 1fr;
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.sy-cmp-h { background: var(--navy-soft); color: var(--navy); font-weight: 700; font-size: 11.5px; padding: 8px 10px; text-align: center; }
.sy-cmp-h-local { text-align: left; }
.sy-cmp-h-srv { text-align: right; }
.sy-cmp-k { background: var(--bg); color: var(--muted); font-size: 12px; padding: 7px 10px; text-align: center; }
.sy-cmp-c { background: var(--card); font-size: 12.5px; padding: 7px 10px; word-break: break-word; }
.sy-cmp-srv { text-align: right; }
.sy-cmp-c.sy-diff { background: var(--gold-soft); font-weight: 700; }
.sy-conflit-act { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Appareils et sessions */
.sy-sessions { display: grid; gap: 10px; }
.sy-session { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.sy-session-i { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sy-session-i strong { font-size: 13px; }
.sy-session-i em { font-style: normal; font-size: 11.5px; color: var(--muted); }

@media (max-width: 860px) {
  .sy-ind-t { display: none; }
  .sy-ind { padding: 6px; }
  .sy-conflit .sy-cmp { grid-template-columns: 1fr; }
  .sy-cmp-h, .sy-cmp-srv, .sy-cmp-h-srv { text-align: left; }
}
