/* Direction visuelle : outil métier premium pour entreprise technique */
:root {
  --ink: #142129;
  --muted: #67747c;
  --bg: #f2f4f3;
  --line: #dce3e2;
  --white: #ffffff;
  --danger: #b5363d;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(15, 35, 45, .07);
}

html { background: #0b1f2a; }
body { font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif; font-size: 14px; letter-spacing: -.01em; }
h1, h2, h3, .brand { font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif; }
h1 { font-size: clamp(29px, 3vw, 40px); font-weight: 720; letter-spacing: -.045em; }
h2 { font-weight: 700; letter-spacing: -.025em; }
strong, dd, .metric strong { font-variant-numeric: tabular-nums; }

.app-shell { grid-template-columns: 276px minmax(0, 1fr); background: var(--bg); }
.sidebar {
  width: 276px;
  padding: 30px 20px 22px;
  background: #0b1f2a;
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 14px 0 35px rgba(3,20,29,.08);
}
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: #d8a646; }
.brand { gap: 13px; padding: 0 8px 32px; }
.brand-mark { width: 43px; height: 43px; border-radius: 9px; background: #d8a646; color: #102631; box-shadow: 0 8px 20px rgba(216,166,70,.22); font-weight: 900; }
.brand strong { display: block; max-width: 164px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.brand small { display: block; margin-top: 4px; color: #8fa1aa; font-size: 9px; letter-spacing: .055em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link { position: relative; min-height: 46px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; color: #9fb0b8; font-size: 13px; font-weight: 600; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: #143342; border-color: rgba(255,255,255,.08); box-shadow: inset 3px 0 #d8a646; }
.nav-icon { color: #78909b; }
.nav-link.active .nav-icon { color: #d8a646; }
.sidebar-account { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-user { margin-top: 0; padding: 0 8px 12px; border-top: 0; }
.avatar { background: #e6edf0; color: #15303d; }
.sidebar-logout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 40px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.045); color: #c4d0d5; cursor: pointer; font-size: 11px; font-weight: 750; }
.sidebar-logout:hover { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.09); color: #fff; }

.main { min-width: 0; }
.topbar { height: 76px; padding: 0 34px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px rgba(18,38,46,.025); backdrop-filter: blur(12px); }
.topbar-context { display: grid; gap: 2px; }
.topbar-context span { color: #8a969b; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.topbar-context strong { color: #263840; font-size: 13px; font-weight: 650; }
.content { width: min(100%, 1510px); margin: 0 auto; padding: 38px 42px 54px; }
.footer { padding: 24px 42px 30px; color: #849096; font-size: 11px; }

.page-head { margin-bottom: 28px; align-items: flex-end; }
.page-head h1 { margin: 0 0 7px; }
.page-head p { max-width: 680px; margin-bottom: 0; font-size: 14px; line-height: 1.55; }
.eyebrow { margin-bottom: 9px; color: #9a6b14; font-size: 10px; letter-spacing: .16em; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.card-head { border-bottom-color: #e8eceb; }
.btn { min-height: 42px; padding: 0 17px; border-radius: 9px; font-size: 12px; font-weight: 750; letter-spacing: .005em; box-shadow: none; }
.btn-primary { background: var(--primary); border: 1px solid var(--primary); box-shadow: 0 8px 18px rgba(23,63,95,.16); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(.92); box-shadow: 0 10px 23px rgba(23,63,95,.22); }
.btn-light { background: #fff; border: 1px solid #cfd8d9; color: #24363e; }
.btn-light:hover { background: #f6f8f7; border-color: #aebbbd; }
.btn-sm { min-height: 36px; padding: 0 13px; }
.icon-btn { border-radius: 9px; border: 1px solid #dbe2e2; background: #fff; }

.metric-grid { gap: 17px; margin-bottom: 24px; }
.metric { position: relative; overflow: hidden; min-height: 134px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.metric::after { content: ""; position: absolute; inset: auto 20px 0; height: 3px; border-radius: 3px 3px 0 0; background: #d8a646; opacity: .72; }
.metric-icon { width: 42px; height: 42px; border-radius: 10px; }
.metric small { color: #738088; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { margin: 6px 0 2px; color: #162832; font-size: 25px; letter-spacing: -.04em; }
.metric > div > span { color: #879299; font-size: 11px; }
.dashboard-grid { gap: 20px; }
.quick-card > a { min-height: 72px; transition: background .15s ease, transform .15s ease; }
.quick-card > a:hover { background: #f7f9f8; transform: translateX(2px); }
.quick-card > a > span:first-child { background: #eef2f2; color: #3b515b; border: 1px solid #dfe6e5; }

.toolbar { min-height: 72px; padding: 14px 18px; background: #fbfcfc; border-bottom: 1px solid #e7ebeb; border-radius: var(--radius) var(--radius) 0 0; }
.search { height: 41px; border-radius: 9px; border-color: #d6dede; background: #fff; padding-left: 39px; }
.table-wrap { scrollbar-color: #c2cccd transparent; }
table { font-size: 12px; }
thead th { height: 42px; padding: 0 17px; background: #f4f6f5; color: #68767c; border-bottom: 1px solid #dfe5e4; font-size: 9px; font-weight: 850; letter-spacing: .09em; }
tbody td { padding: 15px 17px; border-bottom-color: #e9edec; }
tbody tr { transition: background .13s ease; }
tbody tr:hover { background: #fafbfb; }
tbody td strong { color: #1e3139; }
tbody td small { margin-top: 5px; color: #839096; }
.doc-link { color: var(--primary); font-weight: 800; letter-spacing: .01em; }
.badge { border-radius: 999px; border: 1px solid transparent; font-size: 9px; font-weight: 800; letter-spacing: .035em; }
.badge.neutral { border-color: #dfe5e5; background: #f3f5f5; }

label { color: #34464e; font-size: 11px; font-weight: 750; letter-spacing: .01em; }
input, select, textarea { min-height: 44px; margin-top: 7px; border: 1px solid #ccd6d7; border-radius: 9px; background: #fff; color: #17282f; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease; }
textarea { min-height: auto; }
input:hover, select:hover, textarea:hover { border-color: #abb9bb; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,63,95,.11); }
.form-section { padding: 26px; }
.form-section > h2 { margin-bottom: 20px; }
.totals-card { border-top: 4px solid var(--primary); }
.sticky-actions { padding: 14px 20px; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 12px 35px rgba(16,37,46,.1); }

.modal { backdrop-filter: blur(3px); }
.modal-backdrop { background: rgba(5,20,28,.66); }
.modal-panel { border: 1px solid rgba(255,255,255,.25); border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal-panel > header { padding: 22px 24px; background: #f8faf9; border-radius: 18px 18px 0 0; }
.modal-panel > form { padding: 24px; }

.preview-card { overflow: hidden; border-top: 4px solid var(--primary); }
.preview-top { background: #f8faf9; border-bottom: 1px solid #e1e7e6; }
.preview-parties { padding: 27px; }
.preview-parties small { color: #8b979b; font-weight: 850; letter-spacing: .09em; }
.preview-summary { background: #f8faf9; }
.payment-summary > div { background: #fbfcfc; }
.conversion-card { border-top: 4px solid #d8a646; }
.workflow-note { box-shadow: none; background: #f8faf9; }

.auth-shell { min-height: 100vh; padding: 36px; background: #0b1f2a; }
.auth-card { width: min(1160px, 100%); min-height: 680px; border: 1px solid rgba(255,255,255,.1); border-radius: 24px; box-shadow: 0 34px 100px rgba(0,0,0,.34); overflow: hidden; }
.auth-visual { position: relative; padding: 68px 64px; background: #102d3b; color: #fff; }
.auth-visual::before { content: "GESTION PROFESSIONNELLE"; display: inline-flex; padding: 8px 11px; margin-bottom: 28px; border: 1px solid rgba(216,166,70,.4); border-radius: 999px; color: #e0b65e; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.auth-visual::after { content: ""; position: absolute; left: 64px; right: 64px; bottom: 54px; height: 1px; background: rgba(255,255,255,.12); }
.auth-visual > .eyebrow { display: none; }
.auth-visual h1 { max-width: 500px; color: #fff; font-size: clamp(38px, 4vw, 57px); line-height: 1.04; }
.auth-visual p { max-width: 520px; color: #b5c3c9; font-size: 15px; line-height: 1.7; }
.feature-list { display: grid; gap: 11px; margin-top: 40px; }
.feature-list span { display: flex; align-items: center; gap: 9px; color: #d9e1e4; font-size: 12px; }
.feature-list span::first-letter { color: #d8a646; }
.auth-form { padding: 60px 58px; background: #fff; }
.mini-brand { margin-bottom: 50px; color: #20343d; font-weight: 800; }
.auth-form h2 { font-size: 28px; }
.auth-form > p { margin-bottom: 26px; }
.auth-form label { margin-bottom: 15px; }
.auth-form .btn { margin-top: 12px; min-height: 48px; }
.auth-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #e5eaeb; color: #76858b; font-size: 12px; }
.auth-switch a { color: var(--primary); font-weight: 800; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.alert { border-radius: 10px; border: 1px solid currentColor; box-shadow: 0 10px 28px rgba(18,38,46,.09); }
.empty { padding: 42px 20px !important; color: #8a969b; }

.fiscal-head { align-items: flex-end; }
.year-filter label { display: flex; align-items: center; gap: 10px; color: #78858b; }
.year-filter select { width: 112px; margin: 0; }
.fiscal-notice { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; padding: 14px 17px; border: 1px solid #d8e1e2; border-left: 4px solid #d8a646; border-radius: 11px; background: #fff; color: #64737a; font-size: 12px; }
.fiscal-notice div { display: grid; gap: 3px; }
.fiscal-notice strong { color: #22363f; }
.fiscal-notice a { flex: 0 0 auto; color: var(--primary); font-weight: 750; }
.fiscal-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.fiscal-metrics article { min-height: 132px; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.fiscal-metrics small, .fiscal-metrics strong, .fiscal-metrics span { display: block; }
.fiscal-metrics small { color: #758289; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.fiscal-metrics strong { margin: 12px 0 6px; color: #172a33; font-size: 23px; letter-spacing: -.04em; }
.fiscal-metrics span { color: #879399; font-size: 10px; line-height: 1.4; }
.fiscal-metrics .fiscal-credit { color: #287a45; }
.fiscal-metrics .fiscal-balance-card { background: #102f3e; border-color: #102f3e; }
.fiscal-metrics .fiscal-balance-card small, .fiscal-metrics .fiscal-balance-card span { color: #a9bac1; }
.fiscal-metrics .fiscal-balance-card strong { color: #fff; }
.fiscal-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 20px; align-items: start; margin-bottom: 20px; }
.fiscal-monthly { overflow: hidden; }
.fiscal-entry-card { position: sticky; top: 94px; overflow: hidden; }
.fiscal-entry-card .stack-form { padding: 20px; }
.fiscal-history { overflow: hidden; }
.fiscal-history .card-head > strong { color: #287a45; font-size: 12px; }
.badge.warning { background: #fff4de; color: #9a650d; border-color: #f1dfba; }
.users-layout { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 20px; align-items: start; margin-bottom: 18px; }
.users-list { overflow: hidden; }
.user-form-card { position: sticky; top: 94px; overflow: hidden; }
.user-form-card .stack-form { padding: 20px; }
.user-form-card .check-label { display: flex; align-items: center; gap: 9px; }
.user-form-card .check-label input { width: auto; min-height: 0; margin: 0; }
.roles-note { padding: 17px 20px; color: #607077; font-size: 12px; line-height: 1.6; }
.roles-note strong { color: #22363f; }
.roles-note p { margin: 4px 0 0; }
.autofill-trap { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.audit-card { overflow: hidden; }
.audit-filters { display: flex; align-items: end; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.audit-filters label { min-width: 230px; }
.audit-filters select { margin-top: 6px; }
.audit-filters .btn { flex: 0 0 auto; }

@media (max-width: 1120px) {
  .content { padding-inline: 26px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .fiscal-metrics { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 276px; left: -286px; }
  .topbar { height: 66px; padding: 0 15px; }
  .topbar-context { display: none; }
  .content { padding: 26px 15px 42px; }
  .page-head { margin-bottom: 22px; }
  .page-head h1 { font-size: 31px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 116px; }
  .fiscal-head { align-items: flex-start; }
  .fiscal-notice { align-items: flex-start; flex-direction: column; }
  .fiscal-metrics { grid-template-columns: 1fr; }
  .fiscal-layout { grid-template-columns: 1fr; }
  .fiscal-entry-card { position: static; }
  .users-layout { grid-template-columns: 1fr; }
  .user-form-card { position: static; }
  .audit-filters { align-items: stretch; flex-direction: column; }
  .audit-filters label { min-width: 0; }
  .auth-shell { padding: 0; background: #fff; }
  .auth-card { min-height: 100vh; border: 0; border-radius: 0; }
  .auth-form { padding: 38px 24px; }
  .mini-brand { margin-bottom: 40px; }
}
.emcef-results{margin-top:20px}.emcef-capabilities{padding:6px 22px 22px;display:grid;gap:20px}.emcef-capabilities>div{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.emcef-capabilities>div>strong{width:100%;font-size:12px}.btn:disabled{opacity:.5;cursor:not-allowed;box-shadow:none}
