/* ==================== Module: ERP & Supply Chain ==================== */
/* ERP / Comptabilité - styles spécifiques */
.dashboard-container { margin-top: 1rem; }

/* Supply chain : une colonne scrollable (pas d’onglets), sections empilées */
.erp-section-content.supplychain-scroll-page { gap: 1rem; }
.dashboard-container.supplychain-scroll-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ─── Supply Chain Cockpit ─── */
.sc-commerce-simple .sc-industrial-only { display: none !important; }
.supplychain-scroll-page:not(.sc-commerce-simple) .sc-commerce-only { display: none !important; }
.sc-commerce-simple .sc-kpis-hero { grid-template-columns: 1fr; max-width: 20rem; }
.sc-commerce-simple #scExportPdfBtn { display: none !important; }
#sc-suppliers .table td { vertical-align: middle; }
.sc-verdict {
    border-radius: 10px;
    padding: .85rem 1rem;
    background: #f8fafc;
}
.sc-verdict-inner { width: 100%; }
.sc-verdict--serein { border-color: #86efac; background: #f0fdf4; }
.sc-verdict--vigilance { border-color: #fcd34d; background: #fffbeb; }
.sc-verdict--critique { border-color: #fca5a5; background: #fef2f2; }
.sc-verdict--empty { border-color: #cbd5e1; background: #f1f5f9; }
.sc-verdict--loading { border-color: #e5e7eb; background: #f8fafc; }
.sc-verdict-badge { font-size: var(--font-size-2xs); text-transform: uppercase; letter-spacing: .04em; }
.sc-verdict--serein .sc-verdict-badge { background: #16a34a; color: #fff; }
.sc-verdict--vigilance .sc-verdict-badge { background: #d97706; color: #fff; }
.sc-verdict--critique .sc-verdict-badge { background: #dc2626; color: #fff; }
.sc-verdict--empty .sc-verdict-badge { background: #64748b; color: #fff; }
.sc-verdict-headline { font-size: var(--font-size-base); font-weight: 600; color: #1a1a2e; }
.sc-verdict-synthesis { font-size: var(--font-size-sm); color: #4b5563; }
.sc-verdict-actions { border-color: rgba(0, 0, 0, .06) !important; }
.sc-verdict-inner > .d-flex { flex-wrap: nowrap; align-items: flex-start; gap: .5rem; }
.sc-verdict-main { min-width: 0; }
.sc-verdict-toolbar {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-self: flex-start;
    align-items: center;
    gap: .5rem;
}
.supplychain-scroll-page .sc-verdict-toolbar .btn.btn-sm {
    padding: 0.3125rem 0.625rem;
    font-size: var(--font-size-sm);
    line-height: 1.35;
    min-height: 32px;
    white-space: nowrap;
}
.sc-ia-advanced-result { max-height: 220px; overflow-y: auto; }
.sc-ia-advanced-nav .sc-ia-adv { cursor: pointer; }
.sc-ia-advanced-nav .sc-ia-adv.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.sc-quick-order-panel { background: #f8fafc !important; }
.sc-services-notice { border-color: #cbd5e1; background: #f8fafc; }
.sc-quick-block:last-child { border-bottom: none !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
.sc-decision-banner {
    border-radius: 8px;
    background: #fff;
    padding: .65rem 1rem;
}
.sc-decision-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    font-size: var(--font-size-sm);
    color: #374151;
}
.sc-decision-list li::before { content: '• '; color: #64748b; }
.sc-onboard-inner { background: #f0f9ff; border-color: #bae6fd !important; }
.sc-onboard-steps li.sc-onboard-step--active { font-weight: 600; color: #1d4ed8; }
.sc-action-item .sf-list-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.sc-action-item .sf-list-row-title .badge {
  font-size: var(--font-size-2xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sc-action-list > li.text-muted {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.25rem 0;
}
.sc-action-list > li.text-muted:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}
.sc-action-cta { white-space: nowrap; flex-shrink: 0; }
.sc-cockpit { max-width: 1200px; }
.sc-onboard-steps li.sc-onboard-step--done { color: #16a34a; }
.sc-kpis-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-bottom: .5rem;
}
.sc-kpi-hero { background: #fff; border-radius: 10px; padding: .85rem 1rem; }
.sc-kpi-hero--risk { border-color: #fecaca; background: #fef2f2; }
.sc-kpi-hero .sc-kpi-value { font-size: var(--font-size-lg); }
.sc-kpis-ops-summary { cursor: pointer; user-select: none; }
.sc-actions-card { border-color: #e5e7eb; }
.sc-status-retry[data-error] { cursor: pointer; }
.sc-chart-empty { margin-bottom: .5rem; }
.sc-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .75rem;
}
.sc-kpi {
    background: #f8fafc;
    border-radius: 8px;
    padding: .65rem .75rem;
}
.sc-kpi--highlight { border-color: #93c5fd; background: #eff6ff; }
.sc-kpi-label { font-size: var(--font-size-2xs); color: #6b7280; text-transform: uppercase; letter-spacing: .04em; display: block; }
.sc-kpi-value { font-size: var(--font-size-base); font-weight: 700; color: #1a1a2e; line-height: 1.2; font-variant-numeric: tabular-nums; }
.sc-kpi-sub { display: block; font-size: var(--font-size-2xs); }
.sc-section-label { letter-spacing: .05em; font-size: var(--font-size-xs); color: var(--text-muted, #6b7280); }
.sc-chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
}
.sc-chart-title { font-size: var(--font-size-sm); font-weight: 600; color: #374151; margin-bottom: .75rem; }
.sc-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.sc-param-card {
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
}
.sc-details summary { cursor: pointer; color: #374151; }
.sc-details summary:hover { color: #1d4ed8; }

/* ─── Supply Chain Operations ─── */
.sc-ops-page {
    --sc-ops-accent: var(--sf-color-primary-accent, #2563eb);
    --sc-ops-border: color-mix(in srgb, var(--sf-color-primary, #0f172a) 8%, rgba(226, 232, 240, 0.95));
    gap: 1.25rem;
    padding-bottom: max(5rem, calc(4rem + env(safe-area-inset-bottom, 0px)));
}
/* CEO bar + contenu ops — pattern paie : la barre ne bloque pas les CTA scrollables */
.sc-ops-page .sf-ceo-next-bar {
    pointer-events: none;
    position: relative;
    z-index: 1;
}
.sc-ops-page .sf-ceo-next-bar :is(a, button) { pointer-events: auto; }
.sc-ops-page .sc-ops-command,
.sc-ops-page .sc-ops-toolbar,
.sc-ops-page .supplychain-scroll-stack,
.sc-ops-page .supplychain-section {
    position: relative;
    z-index: 2;
}
.sc-ops-page #production .sc-ops-section-body :is(a, button, input, select, summary) {
    position: relative;
    z-index: 3;
    pointer-events: auto;
}
#production {
    scroll-margin-top: calc(var(--header-height, 72px) + 4.5rem);
    padding-bottom: 1.25rem;
}
.sc-ops-page .sc-ops-section,
.sc-ops-page .sc-param-card,
.sc-ops-page [id^="sc-param-"] {
    scroll-margin-top: calc(var(--header-height, 72px) + 5rem);
}
.sc-ops-page .sc-ops-section-body {
    position: relative;
    z-index: 1;
}
/* Cockpit stocks : même pattern pour le lien Opérations */
.supplychain-scroll-page:not(.sc-ops-page) .sf-ceo-next-bar {
    pointer-events: none;
    position: relative;
    z-index: 1;
}
.supplychain-scroll-page:not(.sc-ops-page) .sf-ceo-next-bar :is(a, button) { pointer-events: auto; }
.supplychain-scroll-page:not(.sc-ops-page) .sc-main-cockpit,
.supplychain-scroll-page:not(.sc-ops-page) .sc-verdict-toolbar {
    position: relative;
    z-index: 2;
}
.sc-ops-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
}
.sc-ops-toolbar .btn {
    border-radius: 999px;
    font-weight: 600;
    font-size: var(--font-size-sm);
    letter-spacing: .01em;
    padding: .4rem 1rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.sc-ops-toolbar .btn:hover { transform: translateY(-1px); }
.sc-ops-toolbar .btn-primary {
    box-shadow: 0 4px 14px -4px rgba(37, 99, 235, .45);
}
.sc-ops-btn-back::before {
    content: '←';
    margin-right: .35rem;
    opacity: .65;
}
.sc-ops-command {
    position: relative;
    padding: clamp(1rem, 2.2vw, 1.5rem);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.92) 100%);
    border: 1px solid var(--sc-ops-border);
    border-radius: var(--sf-radius-lg, 20px);
    box-shadow: var(--sf-shadow-soft);
    overflow: hidden;
    transition: box-shadow .3s ease, border-color .3s ease;
}
.sc-ops-command::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--sc-ops-accent) 9%, transparent) 0%, transparent 44%),
        radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--sf-color-primary, #0f172a) 5%, transparent) 0%, transparent 40%);
}
.sc-ops-command:hover {
    border-color: color-mix(in srgb, var(--sc-ops-accent) 18%, rgba(226, 232, 240, 0.95));
    box-shadow: var(--sf-shadow-premium);
}
.sc-ops-command-head,
.sc-ops-verdict,
.sc-ops-pipeline,
.sc-ops-kpis-wrap,
.sc-ops-actions {
    position: relative;
    z-index: 1;
}
.sc-ops-eyebrow {
    margin: 0 0 .25rem;
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--sf-color-text-muted, #64748b);
}
.sc-ops-command-title {
    font-family: var(--sf-font-display, system-ui, sans-serif);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--sf-color-primary, #0f172a);
}
.sc-ops-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: .2rem .7rem;
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--sf-color-text-muted, #64748b);
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.sc-ops-status-pill.bg-success,
.sc-ops-status-pill[class*="bg-success"] {
    color: #fff !important;
    background: #16a34a !important;
    border-color: #16a34a !important;
}
.sc-ops-status-pill.bg-danger,
.sc-ops-status-pill[class*="bg-danger"] {
    color: #fff !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}
.sc-ops-page .sc-ops-verdict {
    margin-top: 1rem;
    padding: .75rem .85rem;
    background: var(--sf-color-bg, #fff);
    border: 1px solid var(--sf-color-border, #e2e8f0);
    border-radius: var(--sf-radius-md, 8px);
}
.sc-ops-page .sc-verdict-headline {
    font-family: var(--sf-font-display, system-ui, sans-serif);
    font-size: var(--font-size-base);
    letter-spacing: -.01em;
}
.sc-ops-pipeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .5rem;
    margin: 1.1rem 0 .35rem;
}
.sc-ops-pipeline-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: .7rem .5rem;
    min-height: 4.5rem;
    text-decoration: none;
    color: var(--sf-color-text, #0f172a);
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .88));
    border: 1px solid color-mix(in srgb, var(--sf-color-primary, #0f172a) 6%, var(--sf-color-border, #e2e8f0));
    border-radius: var(--sf-radius-md, 14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 12px -8px rgba(15, 23, 42, .12);
    transition: border-color .25s, box-shadow .25s, transform .2s;
}
.sc-ops-pipeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -.38rem;
    top: 50%;
    width: .45rem;
    height: 1px;
    background: color-mix(in srgb, var(--sc-ops-accent) 35%, #cbd5e1);
    transform: translateY(-50%);
    z-index: 2;
}
.sc-ops-pipeline-step:hover {
    border-color: color-mix(in srgb, var(--sc-ops-accent) 35%, #e2e8f0);
    box-shadow: var(--sf-shadow-soft);
    transform: translateY(-2px);
    color: var(--sc-ops-accent);
    text-decoration: none;
}
.sc-ops-pipeline-step:focus-visible {
    outline: 2px solid var(--sf-color-primary, #0f172a);
    outline-offset: 2px;
}
.sc-ops-pipeline-step--hot {
    border-color: color-mix(in srgb, #dc2626 28%, #fecaca);
    background: linear-gradient(145deg, #fffbfb, #fef2f2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(220, 38, 38, .06);
}
.sc-ops-pipeline-step--hot .sc-ops-pipeline-val { color: #b91c1c; }
.sc-ops-pipeline-val {
    font-family: var(--sf-font-display, system-ui, sans-serif);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--sf-color-primary, #0f172a);
}
.sc-ops-pipeline-label {
    font-size: var(--font-size-2xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--sf-color-text-muted, #64748b);
    text-align: center;
    line-height: 1.3;
}
.sc-ops-kpis-wrap { margin-top: 1rem; }
.sc-ops-page .sc-kpis-hero { gap: .65rem; }
.sc-ops-page .sc-kpi-hero {
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .9));
    border: 1px solid color-mix(in srgb, var(--sf-color-primary, #0f172a) 6%, #e5e7eb);
    border-radius: var(--sf-radius-md, 14px);
    padding: .95rem 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 14px -8px rgba(15, 23, 42, .1);
    transition: transform .25s ease, box-shadow .25s ease;
}
.sc-ops-page .sc-kpi-hero:hover {
    transform: translateY(-1px);
    box-shadow: var(--sf-shadow-soft);
}
.sc-ops-page .sc-kpi-hero--risk {
    border-color: color-mix(in srgb, #dc2626 22%, #fecaca);
    background: linear-gradient(145deg, #fff, #fef8f8);
}
.sc-ops-page .sc-kpi-label {
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: .1em;
}
.sc-ops-page .sc-kpi-value {
    font-family: var(--sf-font-display, system-ui, sans-serif);
    font-size: var(--font-size-2xl);
    letter-spacing: -.02em;
}
.sc-ops-page .sc-kpis .sc-kpi {
    background: rgba(255, 255, 255, .75);
    border: 1px solid var(--sf-color-border, #e2e8f0);
    border-radius: var(--sf-radius-sm, 8px);
    backdrop-filter: blur(6px);
}
.sc-ops-page .sc-kpis-ops-summary {
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--sf-color-text-muted, #64748b);
}
.sc-ops-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid color-mix(in srgb, var(--sf-color-primary, #0f172a) 6%, rgba(0, 0, 0, .06));
}
.sc-ops-actions-title {
    margin: 0 0 .65rem;
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--sf-color-text-muted, #64748b);
}
.sc-ops-section {
    background: var(--sf-color-bg, #fff);
    border: 1px solid var(--sf-color-border, rgba(226, 232, 240, .8));
    border-radius: var(--sf-radius-md, 8px);
    box-shadow: none;
    overflow: hidden;
    transition: border-color .15s ease;
}
.sc-ops-page .sc-ops-section:hover {
    box-shadow: none;
    border-color: color-mix(in srgb, var(--sc-ops-accent) 12%, var(--sf-color-border, #e2e8f0));
}
.sc-ops-section-head {
    padding: 1rem 1.2rem;
    background: linear-gradient(90deg, rgba(15, 23, 42, .025) 0%, transparent 55%);
    border-bottom: 1px solid var(--sf-color-border, #e2e8f0);
}
.sc-ops-section-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    font-family: var(--sf-font-display, system-ui, sans-serif);
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--sf-color-primary, #0f172a);
}
.sc-ops-section-num {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sf-color-cta, #2563eb), var(--sf-color-cta-hover, #1d4ed8));
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: .05rem;
    box-shadow: 0 3px 10px -2px rgba(37, 99, 235, .35);
}
.sc-ops-section-body { padding: 1.1rem 1.2rem 1.25rem; }
details.sc-ops-section--advanced > summary.sc-ops-section-head {
  cursor: pointer;
  list-style: none;
}
details.sc-ops-section--advanced > summary.sc-ops-section-head::-webkit-details-marker { display: none; }
details.sc-ops-section--advanced:not([open]) > .sc-ops-section-body {
  display: none !important;
}
.sc-ops-more {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--sf-radius-lg, 12px);
  background: #fff;
  padding: 0;
}
.sc-ops-more > .sc-ops-more-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
  padding: .85rem 1.15rem;
  font-weight: 600;
}
.sc-ops-more > .sc-ops-more-summary::-webkit-details-marker { display: none; }
.sc-ops-more > .sc-ops-more-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: .35rem;
  color: var(--sf-color-text-muted, #64748b);
  transition: transform .15s ease;
}
.sc-ops-more[open] > .sc-ops-more-summary::before { transform: rotate(90deg); }
.sc-ops-more-title { font-size: var(--font-size-base); color: var(--sf-color-primary, #0f172a); }
.sc-ops-more-hint { font-weight: 400; }
.sc-ops-more > .sc-ops-section { margin: 0 0.75rem 1rem; }
.sc-ops-section-desc {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--sf-color-text-muted, #64748b);
    margin: .2rem 0 0;
    letter-spacing: 0;
}
.sc-ops-count {
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: .04em;
    padding: .28rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(15, 23, 42, .08);
    color: var(--sf-color-primary, #0f172a);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.sc-ops-count--danger {
    background: linear-gradient(145deg, #fff5f5, #fee2e2);
    border-color: color-mix(in srgb, #dc2626 20%, #fecaca);
    color: #b91c1c;
}
.sc-ops-empty {
    padding: 1.75rem 1.25rem;
    text-align: center;
    color: var(--sf-color-text-muted, #64748b);
    font-size: var(--font-size-sm);
    font-style: italic;
    border: 1px dashed color-mix(in srgb, var(--sf-color-primary, #0f172a) 14%, #d1d5db);
    border-radius: var(--sf-radius-md, 14px);
    background: linear-gradient(145deg, rgba(248, 250, 252, .55), rgba(255, 255, 255, .85));
}
.sc-ops-page .sc-param-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .88));
    border: 1px solid var(--sf-color-border, #e2e8f0);
    border-radius: var(--sf-radius-md, 14px);
    padding: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 12px -10px rgba(15, 23, 42, .08);
    transition: box-shadow .25s;
}
.sc-ops-page .sc-param-card:hover { box-shadow: var(--sf-shadow-soft); }
.sc-ops-page .sc-param-card h3 {
    font-family: var(--sf-font-display, system-ui, sans-serif);
    letter-spacing: -.01em;
}
.sc-ops-page .reception-block,
.sc-ops-page .supply-form,
.sc-ops-page #createShipmentForm,
.sc-ops-page #completeProductionForm {
    background: linear-gradient(180deg, rgba(248, 250, 252, .92), rgba(255, 255, 255, .98)) !important;
    border: 1px solid var(--sf-color-border, #e2e8f0) !important;
    border-radius: var(--sf-radius-sm, 8px) !important;
}
.sc-ops-page .table.compact thead th {
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--sf-color-text-muted, #64748b);
    background: rgba(248, 250, 252, .95);
}
.sc-ops-page .badge.bg-light {
    background: rgba(255, 255, 255, .95) !important;
    border: 1px solid rgba(15, 23, 42, .08);
    font-weight: 600;
    font-size: var(--font-size-2xs);
    letter-spacing: .02em;
}
@media (max-width: 900px) {
    .sc-ops-pipeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sc-ops-pipeline-step:not(:last-child)::after { display: none; }
}
@media (max-width: 576px) {
    .sc-ops-pipeline { grid-template-columns: 1fr; }
    .sc-ops-pipeline-step {
        flex-direction: row;
        justify-content: space-between;
        min-height: auto;
        padding: .65rem .85rem;
    }
    .sc-ops-pipeline-label { text-align: right; max-width: 58%; }
    .sc-ops-page .sc-kpis-hero { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .sc-ops-pipeline-step:hover,
    .sc-ops-page .sc-kpi-hero:hover,
    .sc-ops-toolbar .btn:hover { transform: none; }
}
.sc-feed-table-wrap {
    border: 1px solid var(--sf-color-border, #e2e8f0); border-radius: var(--sf-radius-lg, 10px);
    background: #fff; box-shadow: var(--sf-shadow-soft); max-height: min(32rem, 70vh); overflow: auto;
}
.sc-feed-table {
    margin: 0; width: 100%; min-width: 48rem; table-layout: fixed;
    font-size: var(--font-size-sm); border-collapse: separate; border-spacing: 0;
}
.sc-feed-table thead th {
    position: sticky; top: 0; z-index: 2; padding: .55rem .5rem;
    font: 600 .68rem/1.2 inherit; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af;
    background: linear-gradient(180deg, #fcfcfd, #f8fafc); border-bottom: 1px solid #ececf1; white-space: nowrap;
}
.sc-feed-th-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: #cbd5e1; }
.sc-feed-table tbody tr { transition: background 160ms ease; }
.sc-feed-table tbody tr:not(:last-child) td { border-bottom: 1px solid #f1f5f9; }
.sc-feed-table td { vertical-align: middle; padding: .45rem .5rem; }
.sc-feed-table th:first-child,
.sc-feed-table td:first-child { width: 26%; }
.sc-feed-table .sc-feed-col-num { width: 5.25rem; }
.sc-feed-table .sc-feed-col-price { width: 6.25rem; }
.sc-feed-table .sc-feed-col-demand { width: 8.5rem; }
.sc-feed-table .sc-feed-col-shortfall { width: 4.75rem; }
.sc-feed-table .sc-feed-col-shortfall-eur { width: 5.5rem; }
.sc-feed-table td.sc-feed-col-actions { width: 4.75rem; white-space: nowrap; padding-right: .4rem; }
.sc-feed-table .sc-feed-inp {
    display: block; width: 100%; min-width: 0; min-height: 2.1rem; box-sizing: border-box;
    padding: .35rem .5rem; color: var(--sf-color-primary, #0f172a);
    background: #fff; border: 0; border-radius: var(--sf-radius-sm, 6px);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .95); transition: box-shadow 160ms ease;
}
.sc-feed-table .sc-feed-inp:hover { box-shadow: inset 0 0 0 1px #cbd5e1; }
.sc-feed-table .sc-feed-inp:focus {
    outline: none; box-shadow: inset 0 0 0 1px var(--sf-color-cta, #2563eb), 0 0 0 2px rgba(37, 99, 235, .12);
}
.sc-feed-table .sc-feed-inp::placeholder { color: #cbd5e1; }
.sc-feed-table input.sc-feed-name { font-weight: 500; }
.sc-feed-table .sc-feed-num {
    text-align: right; font-variant-numeric: tabular-nums;
    -moz-appearance: textfield; appearance: textfield;
}
.sc-feed-table .sc-feed-num::-webkit-inner-spin-button,
.sc-feed-table .sc-feed-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sc-feed-row-actions { display: inline-flex; align-items: center; gap: .15rem; }
.sc-feed-table tr.sc-feed-row--tension { background: linear-gradient(90deg, rgba(254, 242, 242, .55), #fff 12%); }
.sc-feed-table tr.sc-feed-row--dirty { background: #fffbeb; }
.sc-feed-table tr.sc-feed-row--dirty .sc-feed-inp { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .35); }
.sc-feed-table tr.sc-feed-row--saved { animation: scFeedFlash .6s ease; }
.sc-feed-row-status { font-size: var(--font-size-2xs); color: #9ca3af; white-space: nowrap; margin-left: .15rem; }
.sc-feed-demand-cell { display: flex; flex-direction: column; align-items: stretch; gap: .2rem; min-width: 0; }
.sc-feed-demand-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .3rem; min-width: 0; }
.sc-feed-src-badge {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--font-size-2xs); font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    padding: .1rem .35rem; border: 1px solid rgba(226, 232, 240, .95); border-radius: 999px; background: #f8fafc; color: #64748b;
}
.sc-feed-table input.form-control-sm { font-size: var(--font-size-base); }
@media (min-width: 768px) { .sc-feed-table input.form-control-sm { font-size: var(--font-size-sm); } }
@keyframes scFeedFlash { from { background: #dcfce7; } to { background: transparent; } }
@media (max-width: 576px) {
    .sc-kpis-hero { grid-template-columns: 1fr; }
    .sc-kpis { grid-template-columns: repeat(2, 1fr); }
    .sc-params-grid { grid-template-columns: 1fr; }
}

/* ─── Trésorerie ─── */
.treso-dashboard {
    display: flex; flex-direction: column; gap: var(--space-6);
    width: 100%; min-width: 0; overflow-x: clip;
}
.treso-dashboard > * { margin: 0 !important; }
.treso-dashboard .card { max-width: 100%; min-width: 0; padding: 1rem 1.15rem; }
.treso-dashboard .card.card--dense { padding: 0.75rem 0.9rem; }
.treso-rail { min-width: 0; }
.treso-dashboard #tresoEmptyBanner { padding: 0; border-style: dashed; }
.treso-dashboard #tresoEmptyBanner .empty-state-canvas {
    padding: var(--space-8) var(--space-6); background: transparent;
}
.treso-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}
@media (max-width: 1200px) {
    .treso-kpis { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); }
}
.treso-kpi {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .5rem;
    min-width: 0;
    min-height: 5.5rem;
    padding: 1.1rem 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.treso-kpi--primary {
    border-color: rgba(37, 99, 235, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 2px 6px -1px rgba(37, 99, 235, 0.06), inset 0 1px 0 rgba(255, 255, 255, 1);
}
.treso-kpi:hover {
    border-color: rgba(148, 163, 184, 0.7);
    box-shadow: 0 6px 16px -2px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
    transform: translateY(-2px);
}
.treso-kpi-label {
    font-size: var(--font-size-2xs, 0.6875rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    min-height: 1.7em;
}
.treso-kpi-value {
    margin: 0;
    margin-top: auto;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--text-color, #0f172a);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}
.treso-kpi-unit {
    font-size: var(--font-size-xs, 0.75rem);
    color: #94a3b8;
    font-weight: 500;
    margin-top: 0.1rem;
}
#cashCounselStrip {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 1.1rem 1.25rem;
}
#cashCounselStrip .sf-section-header,
#cashCounselStrip .card-title-row {
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}
#cashCounselStrip .sf-section-body {
    align-items: stretch;
    gap: 0.75rem;
}
#cashCounselStrip .crm-mini-stat {
    padding: 0.7rem 1rem;
    min-width: 6.5rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 #ffffff;
    align-items: flex-start;
}
.treso-ia-forecast { border: 2px solid var(--state-info-bg, #dbeafe); }
.treso-chart-wrap { position: relative; height: var(--sf-chart-height-lg, 22rem); margin-top: .5rem; }
.treso-chart-wrap canvas { width: 100% !important; max-height: 100%; }

.treso-two-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 0;
}
.treso-two-cols > * {
    min-width: 0;
}
.treso-two-cols .card {
    min-width: 0;
}
@media (max-width: 1024px) {
    .treso-two-cols { grid-template-columns: 1fr; }
}

.treso-sub-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: .75rem;
    max-width: 100%;
    min-width: 0;
}
.treso-sub-kpis > div { display: flex; flex-direction: column; gap: .15rem; }
.treso-sub-kpis strong { font-size: var(--font-size-lg); font-weight: 700; color: #1a1a2e; }
.treso-table-wrap,
.fact-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  max-height: min(28rem, 60vh);
  border: 1px solid var(--sf-color-border, var(--border-color));
  border-radius: var(--sf-radius-lg, var(--radius-md));
  background: var(--sf-color-surface, #fff);
  box-shadow: var(--sf-shadow-soft);
}
.treso-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sf-color-text-muted, #64748b);
  background: var(--sf-color-surface-subtle, #f8fafc);
  box-shadow: 0 1px 0 var(--sf-color-border, #e2e8f0);
  padding-block: 0.6rem;
}
.treso-table-wrap tbody td {
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--sf-color-border-subtle, #f1f5f9);
  vertical-align: middle;
  font-size: var(--font-size-sm);
}
.treso-table-wrap tbody tr:last-child td { border-bottom: none; }
.treso-table-wrap tbody tr:hover { background: var(--sf-color-surface-hover, #f8fafc); }
.treso-table-wrap .table {
  width: max-content;
  min-width: 100%;
}
.treso-table-wrap .table,
.fact-table-wrap .fact-table { margin-bottom: 0; }

.treso-pos { color: #16a34a; }
.treso-neg { color: #dc3545; }
.treso-row-late td { color: #dc3545; font-weight: 500; }

.loading {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    font-size: var(--font-size-sm);
    font-style: italic;
}

.empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #9ca3af;
    background: #fdfdfd;
    border-radius: 8px;
    border: 1px dashed #e5e7eb;
    margin: 1rem;
}

/* Trésorerie — mobile : scroll horizontal, pas de card-transform global */
@media (max-width: 768px) {
    .treso-dashboard .table-responsive table,
    .treso-dashboard .table-responsive thead,
    .treso-dashboard .table-responsive tbody,
    .treso-dashboard .table-responsive th,
    .treso-dashboard .table-responsive td,
    .treso-dashboard .table-responsive tr {
        display: revert;
    }
    .treso-dashboard .table-responsive thead tr {
        position: static;
        top: auto;
        left: auto;
    }
    .treso-dashboard .table-responsive tr {
        background: transparent;
        border: none;
        border-radius: 0;
        margin-bottom: 0;
        padding: 0;
        box-shadow: none;
    }
    .treso-dashboard .table-responsive td {
        border: revert;
        position: static;
        padding-left: revert !important;
        text-align: revert !important;
        min-height: auto;
        display: table-cell;
        justify-content: revert;
        border-bottom: revert;
    }
    .treso-dashboard .table-responsive td:before {
        content: none;
    }
    .treso-dashboard .table-responsive,
    .treso-dashboard .treso-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding: 0 0.25rem;
    }
    .treso-dashboard .table-responsive .table th,
    .treso-dashboard .table-responsive .table td {
        white-space: nowrap;
        padding: 0.45rem 0.5rem;
    }
    .treso-dashboard .table-responsive .table {
        font-size: var(--font-size-sm);
        width: max-content;
        min-width: 100%;
    }
}

/* Documents & compta — containment horizontale */
.erp-documents-compta {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
#inv-create { overflow: visible; margin-bottom: 1.5rem; }
#inv-create .sf-erp-compound-body { gap: 1.1rem; }
#inv-create .sf-erp-panel { padding: 0; }
#inv-create [hidden] { display: none !important; }
#inv-create .sf-form-grid { grid-template-columns: 1fr; }
#inv-create .sf-erp-journey-strip__step { cursor: default; border: 1px solid #ececf1; }
#inv-create .inv-type-switch {
    display: inline-flex; width: 100%; max-width: 22rem; padding: 0.2rem;
    border-radius: 999px; border: 1px solid var(--sf-color-border-subtle, #e8e8ec); background: var(--sf-color-surface-muted, #f8fafc);
}
#inv-create .inv-type-btn {
    flex: 1; border: 0; border-radius: 999px; padding: 0.45rem 0.85rem;
    font-size: var(--font-size-xs); font-weight: 600; color: var(--sf-color-text-muted, #64748b); background: transparent;
    min-height: var(--sf-control-height, 36px); cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
#inv-create .inv-type-btn:is(:hover, :focus-visible):not(.is-active) { color: var(--sf-color-cta, #2563eb); background: rgba(255, 255, 255, 0.85); }
#inv-create .inv-type-btn.is-active { background: var(--sf-color-cta, #2563eb); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28); }
#inv-create .inv-type-btn:focus-visible { outline: 2px solid var(--sf-color-cta, #2563eb); outline-offset: 2px; }
#inv-create details.sf-erp-panel--inset > summary {
    cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 0.35em;
    font-weight: 600; font-size: var(--font-size-sm); color: #374151; list-style: none;
}
#inv-create details.sf-erp-panel--inset > summary::-webkit-details-marker { display: none; }
#inv-create details.sf-erp-panel--inset .sf-form-grid { margin-top: 0.75rem; }
#inv-create .inv-customer-field { position: relative; }
#inv-create .inv-customer-results {
    position: fixed; z-index: 1200; max-height: min(280px, 40vh); overflow-y: auto;
    background: #fff; border-radius: 8px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
#inv-create .inv-customer-results button {
    display: block; width: 100%; text-align: left; background: transparent;
    padding: 0.55rem 0.75rem; font-size: var(--font-size-sm); min-height: 44px; cursor: pointer;
}
#inv-create .inv-customer-results button:is(:hover, :focus, .is-active) { background: #f3f4f6; }
#inv-create .inv-customer-results button.is-active { outline: 2px solid var(--sf-color-cta, #2563eb); outline-offset: -2px; }
#inv-create .inv-lines-wrap .il-desc { min-width: 10rem; }
#inv-create .inv-lines-wrap .il-qty,
#inv-create .inv-lines-wrap .il-price,
#inv-create .inv-lines-wrap .il-disc { width: 4.5rem; min-width: 4rem; }
#inv-create .inv-lines-wrap .il-vat { width: 5rem; min-width: 4.5rem; }
#inv-create .inv-lines-wrap td.il-ht,
#inv-create .inv-lines-wrap td.il-vatamt,
#inv-create .inv-lines-wrap td.il-ttc { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: var(--font-size-sm); }
#inv-create .inv-preview-box {
    font-size: var(--font-size-sm); padding: 0.65rem; margin-bottom: 0.75rem; border-radius: 8px;
    background: #fff; border: 1px dashed #d1d5db; max-height: 200px; overflow-y: auto;
}
#inv-create .inv-preview-totals { padding-top: 0.35rem; border-top: 1px solid #e5e7eb; line-height: 1.5; }
#inv-create .inv-vat-regime-banner { margin: 0 0 0.75rem; }
#inv-create .inv-vat-regime-banner__row {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
}
#inv-create .inv-vat-regime-banner__row > div { min-width: 0; flex: 1 1 14rem; }
#inv-create .inv-vat-regime-banner.sf-banner--warning { border-left-color: var(--sf-color-warning); background: var(--state-warning-bg); }
#inv-create .inv-success-panel { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #ececf1; }
@media (min-width: 768px) {
    #inv-create .sf-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #inv-create .inv-customer-field,
    #inv-create .inv-field-source { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { #inv-create .inv-type-btn { transition: none; } }

.erp-documents-compta .card {
    min-width: 0;
    max-width: 100%;
}
.erp-documents-compta .invoices-list,
.erp-documents-compta .transactions-list,
.erp-documents-compta .invoice-detail,
.erp-documents-compta .treso-table-wrap,
.erp-documents-compta .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
}
.erp-documents-compta .invoices-list table,
.erp-documents-compta .transactions-list table,
.erp-documents-compta .treso-table-wrap .table {
    width: max-content;
    min-width: 100%;
}

/* Documents & compta — mobile : défilement tactile et lisibilité */
@media (max-width: 768px) {
    .erp-documents-compta .treso-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .erp-documents-compta .treso-table-wrap .table {
        font-size: var(--font-size-sm);
    }
    .erp-documents-compta .treso-table-wrap .table th,
    .erp-documents-compta .treso-table-wrap .table td {
        padding: 0.45rem 0.5rem;
        white-space: nowrap;
    }
    .erp-documents-compta .sf-stat-strip,
    .erp-documents-compta .crm-mini-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .erp-documents-compta .crm-mini-stat {
        min-width: calc(50% - 0.25rem);
    }
}
@media (max-width: 480px) {
    .erp-documents-compta .card h2 {
        font-size: var(--font-size-lg);
    }
}

.erp-documents-compta .vat-result {
    margin-top: 0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1f2937;
    padding: 0.75rem 0.9rem;
    min-height: 44px;
}
.erp-documents-compta .vat-result:empty { display: none; }
.erp-documents-compta .vat-result.is-loading {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.erp-documents-compta .vat-result.is-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.erp-documents-compta .vat-result.is-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.erp-documents-compta .vat-result.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.erp-documents-compta .vat-result-title {
    font-weight: 600;
    line-height: 1.3;
}
.erp-documents-compta .vat-result-details {
    margin-top: 0.2rem;
    font-size: var(--font-size-sm);
    opacity: 0.95;
}
.erp-documents-compta .vat-anomalies-heading {
    margin-top: 0.65rem;
    font-weight: 600;
}
.erp-documents-compta .vat-result-list {
    margin: 0.45rem 0 0;
    padding-left: 1rem;
    font-size: var(--font-size-sm);
}
.erp-documents-compta .vat-result-list li + li {
    margin-top: 0.18rem;
}

.erp-documents-compta .vat-anomaly-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.erp-documents-compta .vat-anomaly-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.erp-documents-compta .vat-anomaly-content {
    flex-grow: 1;
}

.erp-documents-compta .vat-anomaly-severity-error {
    color: #b91c1c;
    border-left: 3px solid #ef4444;
}

.erp-documents-compta .vat-anomaly-severity-warning {
    color: #b45309;
    border-left: 3px solid #f59e0b;
}

.erp-documents-compta .vat-anomaly-meta {
    display: block;
    font-size: var(--font-size-xs);
    opacity: 0.7;
    margin-top: 0.15rem;
}

/* Volumes KPI : flex column (jamais display:block — sinon libellé+valeur collés) */
.sf-erp-exec-decision .crm-mini-stat.sf-erp-kpi-counts { display: none; }
@media (min-width: 1100px) {
    .sf-erp-exec-decision .crm-mini-stat.sf-erp-kpi-counts { display: flex; flex-direction: column; }
}

/* Ancrage et scrollIntoView : éviter la barre .main-nav fixe (~72px) */
.supplychain-section {
    scroll-margin-top: calc(72px + 1rem);
}
@media (max-width: 768px) {
    .supplychain-section {
        scroll-margin-top: calc(56px + 1rem + env(safe-area-inset-top, 0px));
    }
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

/* ─── Table Compact enhancements ─── */
.table.compact th {
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border-top: none;
}
.table.compact td {
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

.sf-followup-drafts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.sf-followup-draft {
  border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #fff, #eff6ffb3);
  transition: border-color .15s, box-shadow .15s;
}
.sf-followup-draft.is-open {
  background: #fff;
  border-color: color-mix(in srgb, var(--sf-color-primary-accent, #2563eb) 28%, #e2e8f0);
  box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .2);
}
.sf-followup-draft__hit {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: .55rem; padding: .55rem .7rem;
  border: 0; background: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.sf-followup-draft__hit:focus-visible { outline: 2px solid var(--sf-color-primary-accent, #2563eb); outline-offset: -2px; }
.sf-followup-draft__rank {
  width: 1.65rem; height: 1.65rem; display: grid; place-items: center;
  font-size: var(--font-size-2xs); font-weight: 700; letter-spacing: .06em; color: #64748b;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px;
}
.sf-followup-draft__copy { min-width: 0; display: flex; flex-direction: column; gap: .08rem; }
.sf-followup-draft__title { font-size: var(--font-size-sm); font-weight: 600; color: #0f172a; line-height: 1.35; }
.sf-followup-draft.is-open :is(.sf-followup-draft__title, .sf-followup-draft__go) { color: var(--sf-color-primary-accent, #2563eb); }
.sf-followup-draft__badge {
  display: inline-block; margin-right: .35rem; padding: .08rem .38rem;
  font-size: var(--font-size-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #1d4ed8; background: #dbeafe; border-radius: 999px; vertical-align: .05em;
}
.sf-followup-draft__sub,
.sf-followup-draft__facts,
.sf-followup-draft__label,
.sf-followup-draft__hint,
.sf-followup-draft__go { color: #64748b; }
.sf-followup-draft__sub { font-size: var(--font-size-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-followup-draft__go { font-size: var(--font-size-xs); font-weight: 600; white-space: nowrap; }
.sf-followup-draft__detail { padding: 0 .85rem .85rem; border-top: 1px solid #e2e8f0; }
.sf-followup-draft__facts { display: flex; flex-wrap: wrap; gap: .35rem .75rem; margin: .65rem 0 .35rem; font-size: var(--font-size-xs); }
.sf-followup-draft__label { display: block; margin: .45rem 0 .25rem; font-size: var(--font-size-xs); font-weight: 600; }
.sf-followup-draft__body { min-height: 8.5rem; resize: vertical; }
.sf-followup-draft__hint { margin: .35rem 0 .55rem; font-size: var(--font-size-xs); }
.sf-followup-draft__actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Seuils + échéancier rail */
.treso-rules .treso-rule-item {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--sf-color-border-subtle, #f1f5f9);
}
.treso-rules .treso-rule-item:last-child { border-bottom: 0; padding-bottom: 0; }
.treso-rules .treso-rule-ctrls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.treso-rules .treso-rule-input-group { display: inline-flex; flex: 1 1 9.5rem; max-width: 13rem; }
.treso-rules .treso-alert-threshold { min-width: 4rem; }
.treso-rules .treso-alert-save { white-space: nowrap; flex-shrink: 0; }
#scheduleTable table { table-layout: auto; width: 100%; margin: 0; font-size: var(--font-size-xs, 0.75rem); }
#scheduleTable :is(th, td) { padding: 0.35rem 0.45rem; }
/* Comptabilité (page dédiée) */
.compta-toolbar { margin-bottom: 1rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.compta-toolbar-label { font-size: var(--font-size-sm); font-weight: 600; color: #374151; }
.compta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .compta-grid { grid-template-columns: 1fr; } }
.compta-card { background: var(--sf-card-bg, #fff); border: 1px solid var(--sf-border, #e5e7eb); border-radius: 10px; padding: 1.5rem; }
.compta-card h2 { font-size: var(--font-size-base); font-weight: 600; margin: 0 0 1rem; color: var(--sf-text, #111); letter-spacing: 0.01em; }
.compta-kpi-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.compta-kpi-box { flex: 1; min-width: 100px; background: var(--sf-bg-subtle, #f9fafb); border-radius: 8px; padding: 0.9rem 1rem; }
.compta-kpi-box .compta-kpi-label { font-size: var(--font-size-xs); color: var(--sf-text-muted, #6b7280); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 0.25rem; }
.compta-kpi-box .compta-kpi-value { font-size: var(--font-size-lg); font-weight: 700; color: var(--sf-text, #111); font-variant-numeric: tabular-nums; }
.compta-kpi-box.positive .compta-kpi-value { color: #16a34a; }
.compta-kpi-box.negative .compta-kpi-value { color: #dc2626; }
.compta-kpi-box.neutral .compta-kpi-value { color: #2563eb; }
.compta-status-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: var(--font-size-xs); font-weight: 600; }
.compta-status-badge.ok { background: #dcfce7; color: #15803d; }
.compta-status-badge.warning { background: #fef9c3; color: #a16207; }
.compta-status-badge.error { background: #fee2e2; color: #b91c1c; }
.compta-status-badge.loading { background: #f3f4f6; color: #6b7280; }
.compta-check-list { list-style: none; margin: 0; padding: 0; }
.compta-check-list li { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--sf-border, #f0f0f0); font-size: var(--font-size-sm); }
.compta-check-list li:last-child { border-bottom: none; }
.compta-check-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.compta-anomaly-list { margin: 0; padding: 0; list-style: none; }
.compta-anomaly-item { padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 0.4rem; font-size: var(--font-size-sm); }
.compta-anomaly-item.error { background: #fee2e2; color: #7f1d1d; }
.compta-anomaly-item.warning { background: #fef9c3; color: #7c2d12; }
.compta-balance-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.compta-balance-table th { text-align: left; padding: 0.4rem 0.5rem; font-size: var(--font-size-xs); color: #6b7280; border-bottom: 2px solid #e5e7eb; }
.compta-balance-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid #f3f4f6; }
.compta-balance-table tr:hover td { background: #f9fafb; }
.compta-balance-table .text-end { text-align: right; }
.compta-reconcile-bar { height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; margin: 0.5rem 0; }
.compta-reconcile-fill { height: 100%; border-radius: 4px; background: #16a34a; }
.compta-year-select { border: 1px solid #d1d5db; border-radius: 6px; padding: 0.3rem 0.6rem; font-size: var(--font-size-sm); background: #fff; cursor: pointer; }
.compta-skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: compta-shimmer 1.2s infinite; border-radius: 4px; display: inline-block; }
@keyframes compta-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.compta-empty-note { color: #9ca3af; font-size: var(--font-size-sm); text-align: center; padding: 1rem; }
.compta-section-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.compta-card--spaced { margin-bottom: 1.5rem; }
.compta-card.is-hidden { display: none; }
.compta-balance-scroll { overflow-x: auto; }
.compta-balance-meta { margin-top: 0.5rem; font-size: var(--font-size-xs); color: #6b7280; }
.compta-balance-equilibrium { margin-top: 0.5rem; font-size: var(--font-size-xs); }
.compta-balance-totals { margin-top: 0.75rem; font-size: var(--font-size-sm); font-weight: 600; }
.compta-fec-btns.is-hidden { display: none; }
.compta-ca3-btn.is-hidden { display: none; }
.compta-page .sf-table-scroll { max-height: min(24rem, 55vh); }

/* Connexion bancaire YAXI */
.yaxi-bank-search { margin-bottom: 0.75rem; }
.yaxi-bank-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }
.yaxi-bank-chip {
    font-size: var(--font-size-xs); padding: 0.3rem 0.65rem; border-radius: 999px;
    border: 1px solid #e5e7eb; background: #fff; color: #374151; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.yaxi-bank-chip:hover { border-color: #1a1a2e; background: #fafafa; }
.yaxi-bank-list { display: flex; flex-direction: column; gap: 0.45rem; max-height: 22rem; overflow-y: auto; margin-top: 0.5rem; }
.yaxi-bank-item {
    display: flex; align-items: center; width: 100%; text-align: left;
    padding: 0.75rem 0.9rem; border-radius: 8px;
    background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.yaxi-bank-item:hover { border-color: #1a1a2e; box-shadow: 0 1px 4px rgba(26, 26, 46, 0.06); }
.yaxi-bank-item-name { font-size: var(--font-size-sm); font-weight: 500; color: #1a1a2e; }
.yaxi-bank-item-action { margin-left: auto; font-size: var(--font-size-xs); letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; }
.ponto-connect-panel {
    margin-top: 1rem; padding: 1.25rem 1.35rem; border-radius: 12px; background: linear-gradient(180deg, #fcfcfd 0%, #f8f8fa 100%);
}
.ponto-connect-eyebrow { font-size: var(--font-size-2xs); letter-spacing: 0.12em; text-transform: uppercase; color: #9ca3af; }
.ponto-connect-title { font-size: var(--font-size-lg); font-weight: 600; color: #1a1a2e; }
.ponto-connect-step { margin-top: 0.25rem; }
.yaxi-auth-bank { font-size: var(--font-size-xs); letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; }
.ponto-connect-progress { display: flex; align-items: center; gap: 0.85rem; padding: 0.5rem 0; }
.ponto-connect-spinner {
    width: 1.25rem; height: 1.25rem; border: 2px solid #e5e7eb; border-top-color: #1a1a2e;
    border-radius: 50%; animation: yaxi-spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes yaxi-spin { to { transform: rotate(360deg); } }

/* ─── ERP hub / compound (documents & compta) ─── */
.sf-erp-hub, .sf-erp-compound { padding: 0; overflow: hidden; border-color: #e8e8ec; }
.sf-erp-eyebrow, .sf-erp-panel-eyebrow {
    margin: 0 0 0.35rem; font-size: var(--font-size-2xs); letter-spacing: 0.12em;
    text-transform: uppercase; color: #9ca3af; font-weight: 600;
}
.sf-erp-hub-title, .sf-erp-compound-header h2 {
    margin: 0; font-size: var(--font-size-xl); font-weight: 600; color: #1a1a2e; letter-spacing: -0.01em; line-height: 1.25;
}
.sf-erp-hub-lead { margin: 0.45rem 0 0; max-width: 42rem; font-size: var(--font-size-sm); color: #6b7280; line-height: 1.5; }
.sf-erp-hub > .p-3, .sf-erp-compound-header {
    padding: 1.35rem 1.5rem 1.1rem; border-bottom: 1px solid #ececf1;
    background: linear-gradient(180deg, #fcfcfd 0%, #fff 100%);
}
.sf-erp-compound-header__action { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; flex-shrink: 0; }
.sf-erp-priorities-label { margin: 0 0 0.5rem; font-size: var(--font-size-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; }

.sf-erp-journey-strip {
    display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; list-style: none; margin: 0;
    padding: 0.85rem 1.5rem; border-bottom: 1px solid #f1f2f5; background: #fafbfc;
}
.sf-erp-journey-strip__step {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 999px; background: #fff; font-size: var(--font-size-xs); font-weight: 500; color: #6b7280;
}
.sf-erp-journey-strip__num {
    display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem;
    border-radius: 50%; font-size: var(--font-size-2xs); font-weight: 700; background: #f1f5f9; color: #64748b; flex-shrink: 0;
    margin-right: 0.35rem;
}
.sf-erp-journey-strip__step.is-active { border-color: var(--sf-color-cta, #2563eb); color: var(--sf-color-cta, #2563eb); box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12); }
.sf-erp-journey-strip__step.is-active .sf-erp-journey-strip__num { background: var(--sf-color-cta, #2563eb); color: #fff; }
.sf-erp-journey-strip__step.is-done { border-color: #d1fae5; color: #065f46; }
.sf-erp-journey-strip__step.is-done .sf-erp-journey-strip__num { background: #ecfdf5; color: #047857; }
.sf-erp-journey-strip__link {
    display: inline-flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none;
}
.sf-erp-journey-strip__link:hover { color: var(--sf-color-cta, #2563eb); text-decoration: none; }

.sf-erp-compound-body { padding: 1.2rem 1.75rem 1.6rem; display: flex; flex-direction: column; gap: 0.9rem; }
.sf-erp-compound-body > .crm-mini-stats { margin: 0 0 1rem; }
.sf-erp-compound-body > .crm-mini-stats:empty { display: none; }
.sf-erp-panel { padding: 1rem 1.5rem; }
.sf-erp-compound-body .sf-erp-panel { padding: 1rem 0 0; }
.sf-erp-panel--border { border-top: 1px solid #ececf1; margin-top: 1rem; padding-top: 1rem; }
.sf-erp-panel--inset { padding: 1.1rem 1.25rem; border-radius: 10px; background: #fafbfc; }
.sf-erp-panel-title {
    margin: 0 0 0.35rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sf-color-text-secondary, #334155);
}
.sf-erp-kpi-highlight .crm-mini-stat-value { color: #1a1a2e; font-weight: 700; }

.sf-erp-priority-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.sf-erp-row {
    --row-tone: #64748b;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem 1rem;
    padding: 0.55rem 0.95rem 0.55rem 1.1rem;
    background: #ffffff;
    border: 1px solid var(--sf-color-border, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    transition: border-color 160ms cubic-bezier(0.16, 1, 0.3, 1), background-color 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sf-erp-row[data-risk="low"] { --row-tone: #166534; }
.sf-erp-row[data-risk="medium"] { --row-tone: #b45309; }
.sf-erp-row[data-risk="high"],
.sf-erp-row[data-risk="critical"] { --row-tone: #991b1b; }
.sf-erp-row:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
.sf-erp-row__accent {
    position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--row-tone);
    border-radius: 3px 0 0 3px;
}
.sf-erp-row__main { min-width: 0; }
.sf-erp-row__head {
    display: flex; align-items: center; gap: 0.5rem; min-width: 0;
}
.sf-erp-row__title {
    margin: 0; font-size: var(--font-size-sm); font-weight: 600; letter-spacing: -0.01em;
    color: var(--sf-color-primary, #0f172a);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sf-erp-row__meta {
    display: flex; flex-wrap: wrap; align-items: center;
    margin: 0.15rem 0 0; font-size: var(--font-size-xs); line-height: 1.35;
    color: var(--sf-color-text-muted, #64748b);
}
.sf-erp-row__meta span { white-space: nowrap; }
.sf-erp-row__meta span:not(:last-child)::after {
    content: "·"; margin: 0 0.38rem; color: #cbd5e1; font-weight: 600;
}
.sf-erp-row__aside {
    display: flex; flex-direction: row; align-items: center; gap: 1.15rem; flex-shrink: 0;
}
.sf-erp-row__value {
    font-size: var(--font-size-base); font-weight: 600; letter-spacing: -0.02em;
    color: var(--sf-color-primary, #0f172a);
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sf-erp-row__action {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 1.85rem; height: 1.85rem; min-width: 5.5rem; padding: 0 0.85rem;
    font-size: var(--font-size-xs); font-weight: 600; letter-spacing: 0.01em; font-family: inherit; line-height: 1;
    color: #0f172a; background: #ffffff; appearance: none;
    border: 1px solid #cbd5e1; border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer; white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.sf-erp-row__action:hover {
    background: var(--sf-color-cta, #2563eb);
    color: #ffffff;
    border-color: var(--sf-color-cta, #2563eb);
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.22);
}
.sf-erp-row__action:focus-visible {
    outline: 2px solid var(--sf-color-cta, #2563eb); outline-offset: 2px;
}

.sf-erp-pill {
    display: inline-flex; align-items: center; flex-shrink: 0;
    padding: 0.12rem 0.45rem; border-radius: 4px;
    font-size: var(--font-size-2xs); font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; white-space: nowrap;
}
.sf-erp-pill--ok, .sf-erp-pill--paid, .sf-erp-pill--low { background: #f0fdf4; color: #166534; border: 1px solid rgba(22, 163, 74, 0.18); }
.sf-erp-pill--warning, .sf-erp-pill--medium, .sf-erp-pill--opened, .sf-erp-pill--clicked { background: #fffbeb; color: #b45309; border: 1px solid rgba(217, 119, 6, 0.18); }
.sf-erp-pill--error, .sf-erp-pill--high, .sf-erp-pill--critical { background: #fef2f2; color: #991b1b; border: 1px solid rgba(220, 38, 38, 0.18); }
.sf-erp-pill--info, .sf-erp-pill--pending, .sf-erp-pill--pending_review { background: #f8fafc; color: #475569; border: 1px solid rgba(100, 116, 139, 0.18); }
.sf-erp-pill--sent { background: #eff6ff; color: #1d4ed8; border: 1px solid rgba(29, 78, 216, 0.18); }
.sf-erp-pill--cancelled { background: #f8fafc; color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.18); }

.sf-erp-skeleton-row { height: 2.75rem; border-radius: 8px; background: var(--sf-color-surface, #f8fafc); }
.sf-erp-skeleton-table { height: 8rem; border-radius: 8px; }

.sf-erp-compound-body .treso-table-wrap .table { border: 1px solid #ececf1; border-radius: 10px; overflow: hidden; margin-bottom: 0; }
.sf-erp-compound-body .treso-table-wrap .table thead th {
    font-size: var(--font-size-2xs); letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af;
    font-weight: 600; border-bottom: 1px solid #ececf1; background: #fafbfc;
}

@media (max-width: 768px) {
    .sf-erp-compound-header, .sf-erp-compound-body, .sf-erp-panel, .sf-erp-journey-strip { padding-left: 1rem; padding-right: 1rem; }
    .sf-erp-compound-header__action { width: 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.5rem; }
    .sf-erp-compound-header__action .btn { flex: 1; min-width: 0; }
    .sf-erp-row { grid-template-columns: 1fr; gap: 0.5rem; }
    .sf-erp-row__aside { display: flex; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; gap: 0.75rem; margin-top: 0.15rem; }
    .sf-erp-row__value { text-align: left; }
    .sf-erp-row__action { min-width: auto; }
    .sc-feed-table { min-width: 36rem; }
}
@media (prefers-reduced-motion: reduce) {
    .sf-erp-row, .sf-erp-row__action, .sc-feed-table tbody tr, .sc-feed-table .sc-feed-inp { transition: none; }
    .sf-erp-row:hover { box-shadow: var(--sf-shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.04)); }
    .sc-feed-table tr.sc-feed-row--saved { animation: none; }
}

/* ─── Obligations fiscales (aligné hub ERP) ─── */
.sf-erp-regime-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.65rem; }
.sf-erp-regime-chip {
    display: inline-flex; align-items: center; padding: 0.28rem 0.65rem;
    font-size: var(--font-size-xs); color: #6b7280; border: 1px solid #e8e8ec; border-radius: 999px; background: #fafbfc;
}
.sf-erp-regime-chip--year { font-weight: 600; color: #374151; }
.sf-erp-oblig-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 920px) {
    .sf-erp-oblig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sf-erp-panel--full { grid-column: 1 / -1; }
}
/* Rythme unique : gap parent, marges enfants annulées */
.sf-erp-oblig-grid > .sf-erp-panel--inset {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding: var(--space-6) var(--space-6);
    border-radius: var(--sf-radius-lg);
    background: var(--sf-color-surface-subtle, #fafbfc);
    border: 1px solid var(--sf-color-border-subtle, rgba(226, 232, 240, 0.55));
    box-shadow: var(--sf-shadow-soft);
}
.sf-erp-oblig-grid > .sf-erp-panel--inset > * { margin: 0; }
.sf-erp-panel-head { display: flex; flex-direction: column; gap: var(--space-2); }
.sf-erp-panel-head .sf-erp-panel-title,
.sf-erp-panel-head .sf-erp-panel-lead { margin: 0; }
.sf-erp-panel-lead { max-width: 40rem; line-height: var(--sf-line-caption, 1.6); }
.sf-erp-oblig-grid .sf-form-grid { grid-template-columns: 1fr; }
.sf-erp-year-input { width: 6.25rem; font-variant-numeric: tabular-nums; }
.sf-erp-panel-head-split { margin-bottom: 0.85rem; }
.sf-oblig-result { margin-top: 0.65rem; }
.sf-oblig-download {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem 1rem;
    margin-top: 0.65rem; padding: 0.65rem 0.85rem; border-radius: 8px;
    background: #fafbfc;
}
.sf-oblig-download[hidden] { display: none !important; }
.sf-oblig-download__text { margin: 0; flex: 1 1 10rem; font-size: var(--font-size-sm); color: #6b7280; line-height: 1.45; }
.sf-oblig-checks { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.65rem; }
.sf-oblig-checks--grid { display: grid; grid-template-columns: 1fr; gap: 0.45rem; }
@media (min-width: 720px) {
    .sf-oblig-checks--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sf-oblig-check-skel { height: 3.75rem; border-radius: 8px; }
.sf-oblig-checks-empty {
    grid-column: 1 / -1; padding: 1rem; text-align: center; font-size: var(--font-size-sm); color: #9ca3af;
    border: 1px dashed #e5e7eb; border-radius: 8px; background: #fafbfc;
}
.sf-oblig-checks-empty--error { color: #b91c1c; border-color: #fecaca; background: #fef8f8; }
.sf-oblig-score {
    display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0.9rem; margin-bottom: 0.45rem;
    border-radius: 8px; background: #fafbfc; grid-column: 1 / -1;
}
.sf-oblig-score__ring { position: relative; width: 2.75rem; height: 2.75rem; flex-shrink: 0; }
.sf-oblig-score__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sf-oblig-score__ring-bg { fill: none; stroke: #e5e7eb; stroke-width: 2.5; }
.sf-oblig-score__ring-fill { fill: none; stroke: var(--sf-color-cta, #2563eb); stroke-width: 2.5; stroke-linecap: round; }
.sf-oblig-score__val {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: var(--font-size-2xs); font-weight: 700; color: #1a1a2e; font-variant-numeric: tabular-nums;
}
.sf-oblig-score__title { margin: 0; font-size: var(--font-size-sm); font-weight: 600; color: #1a1a2e; }
.sf-oblig-score__hint { margin: 0.12rem 0 0; font-size: var(--font-size-xs); color: #6b7280; }
.sf-oblig-check {
    display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.65rem 0.75rem;
    border-radius: 8px; background: #fff;
}
.sf-oblig-check__mark {
    width: 0.4rem; height: 0.4rem; margin-top: 0.4rem; border-radius: 50%; flex-shrink: 0; background: #cbd5e1;
}
.sf-oblig-check--ok .sf-oblig-check__mark { background: #10b981; }
.sf-oblig-check--warning .sf-oblig-check__mark { background: #f59e0b; }
.sf-oblig-check--error .sf-oblig-check__mark { background: #ef4444; }
.sf-oblig-check--info .sf-oblig-check__mark { background: #94a3b8; }
.sf-oblig-check__body { flex: 1; min-width: 0; }
.sf-oblig-check__label { font-size: var(--font-size-sm); font-weight: 600; color: #1a1a2e; line-height: 1.35; }
.sf-oblig-check__msg { margin: 0.15rem 0 0; font-size: var(--font-size-xs); color: #6b7280; line-height: 1.45; }
.sf-oblig-check__tag {
    flex-shrink: 0; font-size: var(--font-size-2xs); font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; color: #9ca3af; padding-top: 0.15rem;
}
.sf-oblig-check--ok .sf-oblig-check__tag { color: #047857; }
.sf-oblig-check--warning .sf-oblig-check__tag { color: #b45309; }
.sf-oblig-check--error .sf-oblig-check__tag { color: #b91c1c; }
.sf-oblig-check__link { margin-top: 0.35rem; font-size: var(--font-size-xs); }
.sf-cloture-agent { padding: 1rem; border-radius: 8px; background: #f8fafc; }
.sf-cloture-agent h4 { font-size: var(--font-size-sm); margin: 0 0 0.5rem; }
.sf-cloture-exercise {
    display: flex; flex-direction: column; gap: var(--space-5);
    padding-top: var(--sf-control-stack-gap, var(--space-5));
    border-top: 1px solid var(--sf-color-border-subtle, #ececf1);
}
.sf-cloture-exercise > * { margin: 0; }
.sf-oblig-next {
    grid-column: 1 / -1; padding: 0.7rem 0.85rem; border-radius: 8px;
    background: #fafbfc; font-size: var(--font-size-xs); color: #6b7280;
}
.sf-oblig-next strong {
    display: block; margin-bottom: 0.3rem; font-size: var(--font-size-2xs); letter-spacing: 0.08em;
    text-transform: uppercase; color: #9ca3af; font-weight: 600;
}
.sf-oblig-next ul { margin: 0; padding-left: 1.1rem; }
.sf-oblig-next li + li { margin-top: 0.2rem; }
.sf-fiscal-roles {
    margin: 0.85rem 1.25rem 0; padding: 0.75rem 0.9rem;
    border-radius: 8px; background: #f8fafc; border: 1px solid #ececf1;
}
.sf-fiscal-roles__list {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 0.35rem;
}
@media (min-width: 768px) {
    .sf-fiscal-roles__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
}
.sf-fiscal-roles__item {
    margin: 0; font-size: var(--font-size-xs); color: #4b5563; line-height: 1.4;
}
.sf-fiscal-roles__item strong { color: #1a1a2e; font-weight: 600; }
.sf-fiscal-roles__cost {
    margin-top: 0.55rem; font-size: var(--font-size-2xs); color: #6b7280; letter-spacing: 0.01em;
}
.sf-oblig-roles {
    display: grid; gap: 0.5rem; margin: 0.5rem 0 0.65rem;
    grid-column: 1 / -1;
}
@media (min-width: 768px) {
    .sf-oblig-roles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.sf-oblig-role {
    padding: 0.55rem 0.65rem; border-radius: 8px; background: #fafbfc;
    font-size: var(--font-size-xs); color: #4b5563;
}
.sf-oblig-role strong {
    display: block; margin-bottom: 0.25rem; font-size: var(--font-size-2xs);
    letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af;
}
.sf-oblig-role ul { margin: 0; padding-left: 1rem; }
.sf-inline-invite {
    display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; flex: 1 1 16rem;
}
.sf-inline-invite .form-control { max-width: 16rem; }
.sf-erp-advanced {
    margin-top: var(--sf-control-stack-gap, var(--space-5));
    padding-top: var(--sf-control-stack-gap, var(--space-5));
    border-top: 1px solid var(--sf-color-border-subtle, #ececf1);
}
.sf-erp-advanced > summary {
    cursor: pointer; font-size: var(--font-size-sm); font-weight: 600; color: #374151;
    list-style: none;
}
.sf-erp-advanced > summary::-webkit-details-marker { display: none; }
@media (max-width: 768px) {
    .sf-erp-panel-head-split { flex-direction: column; align-items: stretch; }
}
.treso-sepa-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.treso-sepa-modal[hidden] { display: none !important; }
.treso-sepa-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.treso-sepa-modal__panel { position: relative; z-index: 1; width: min(32rem, 100%); max-height: 90vh; overflow: auto; padding: 1rem 1.25rem; }

/* ─── Paramètres ERP ─── */
.erp-parametres {
    --ep-ink: #0f172a;
    --ep-hint: #64748b;
    --ep-muted: #94a3b8;
    --ep-line: #eef0f3;
    --ep-surface: #fafbfc;
    display: grid;
    gap: 0.75rem;
    align-items: start;
    padding-bottom: 1.5rem;
}
.erp-parametres > .card {
    margin: 0;
    padding: 0.85rem 1rem 0.95rem;
    border: 1px solid #e8e8ec;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    min-width: 0;
}
.erp-parametres h2 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ep-ink);
    line-height: 1.25;
}
.erp-param-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-bottom: 0.65rem;
    min-width: 0;
}
.erp-param-head > div:first-child { min-width: 0; flex: 1 1 10rem; }
.erp-param-head .sf-section-eyebrow { margin-bottom: 0.12rem; }
.erp-param-lead { margin: 0.2rem 0 0; font-size: var(--font-size-xs); line-height: 1.4; color: var(--ep-hint); }
.erp-param-muted { margin: 0; font-size: var(--font-size-xs); color: var(--ep-muted); }
.erp-param-head__tools {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: auto;
}
.erp-param-head__tools .btn-icon-refresh { width: 2rem; height: 2rem; }
.erp-param-head__tools .form-label,
.erp-param-add .form-label {
    margin: 0;
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ep-muted);
}
.erp-param-year { width: 4.5rem; font-variant-numeric: tabular-nums; }
.erp-param-table {
    max-height: 16.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 0.65rem;
    border: 1px solid var(--ep-line);
    border-radius: 8px;
}
.erp-parametres .erp-param-table table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    margin: 0;
}
.erp-parametres .erp-param-table :is(th, td) {
    padding: 0.35rem 0.45rem;
    vertical-align: middle;
}
.erp-param-table .sf-col-country { width: 2.25rem; text-align: center; }
.erp-param-table .sf-col-code { width: 4.75rem; font-variant-numeric: tabular-nums; font-weight: 500; }
.erp-param-table .sf-col-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-param-table .sf-col-type { width: 4.25rem; font-size: var(--font-size-2xs); color: var(--ep-muted); text-transform: capitalize; }
.erp-param-table .sf-col-action { width: 2rem; text-align: right; }
.erp-param-table .sf-col-action .btn-icon-del { width: 1.75rem; height: 1.75rem; }
.erp-param-table .sf-col-aux { width: 6.5rem; }
.erp-param-add { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 0.45rem 0.5rem; align-items: end; }
.erp-param-add .sf-form-field { gap: 0.2rem; }
.erp-param-add > .btn { justify-self: start; width: auto; max-width: none; min-width: max-content; }
.erp-parametres .sf-control-stack { gap: 0.55rem; }
.erp-parametres .sf-form-feedback { margin: 0.35rem 0 0; min-height: 0; }
.erp-period-grid { display: grid; gap: 0.4rem; }
.erp-period-grid > p { grid-column: 1 / -1; }
.erp-period-tile, .erp-parametres .sf-efi-empty, .erp-parametres .sf-erp-panel--inset {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--ep-line);
    border-radius: 8px;
    background: var(--ep-surface);
}
.erp-period-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}
.erp-period-tile.is-closed { background: #f8fafc; border-color: #e2e8f0; }
.erp-period-tile__meta { min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.erp-period-tile__name { font-size: var(--font-size-sm); font-weight: 600; color: var(--ep-ink); line-height: 1.2; }
.erp-period-tile__status { font-size: var(--font-size-2xs); color: #1d4ed8; line-height: 1.2; }
.erp-period-tile.is-closed .erp-period-tile__status { color: #047857; }
.erp-period-tile .btn {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 2rem;
    min-width: 0;
    max-width: none;
    padding: 0.25rem 0.55rem;
    font-size: var(--font-size-xs);
}

.erp-parametres .sf-efi-badge { margin-bottom: 0.65rem; }
.erp-parametres .sf-efi-grid { display: grid; gap: 0.65rem; }
.erp-parametres .sf-erp-panel-title { margin: 0 0 0.4rem; }
.erp-parametres .sf-efi-hero {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1rem;
    padding: 0.65rem 0.8rem; border-radius: 8px; background: linear-gradient(135deg, #fafbfc 0%, #f4f6f9 100%);
}
.erp-parametres .sf-efi-hero .erp-param-lead { margin-top: 0.3rem; }
.erp-parametres .sf-efi-hero__score {
    flex-shrink: 0; text-align: center; padding: 0.25rem 0.65rem; border-radius: 8px;
    background: #fff; min-width: 4rem; border: 1px solid var(--ep-line);
}
.erp-parametres .sf-efi-hero__score b { display: block; font-size: var(--font-size-xl); color: var(--ep-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.erp-parametres .sf-efi-hero__score small { font-size: var(--font-size-2xs); font-weight: 600; color: var(--ep-muted); }
.erp-parametres .sf-efi-hero__score span { display: block; margin-top: 0.1rem; font-size: var(--font-size-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ep-muted); }
.erp-parametres .sf-efi-checklist { display: flex; flex-direction: column; gap: 0.3rem; list-style: none; margin: 0; padding: 0; }
.erp-parametres .sf-efi-checklist__item {
    display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.45rem 0.55rem;
    border-radius: 8px; background: #fff; border: 1px solid var(--ep-line);
}
.erp-parametres .sf-efi-checklist__item.is-done { border-color: #d1fae5; background: #fafffe; }
.erp-parametres .sf-efi-checklist__item.is-pending { border-color: #fde68a; background: #fffdf7; }
.erp-parametres .sf-efi-checklist__item.is-optional { border-color: #e8e8ec; }
.erp-parametres .sf-efi-checklist__label { margin: 0; font-size: var(--font-size-sm); font-weight: 600; color: var(--ep-ink); }
.erp-parametres .sf-efi-checklist__action { margin: 0.2rem 0 0; font-size: var(--font-size-xs); }
.erp-parametres .sf-efi-checklist__action a { color: #1d4ed8; }
.erp-parametres .sf-efi-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; margin-bottom: 0.5rem; }
.erp-parametres .sf-efi-stats b { display: block; font-size: var(--font-size-lg); color: var(--ep-ink); font-variant-numeric: tabular-nums; }
.erp-parametres .sf-efi-stats span { display: block; font-size: var(--font-size-2xs); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ep-muted); }
.erp-parametres .sf-efi-empty { font-size: var(--font-size-xs); color: var(--ep-muted); }

.sf-entry-row td { vertical-align: top; }
.sf-entry-row.is-unbalanced { background: #fffbeb; }
.sf-entry-body { min-width: 12rem; }
.sf-entry-title { display: block; font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary, #0f172a); }
.sf-entry-origin { margin: 0.15rem 0 0.4rem; font-size: var(--font-size-xs); color: var(--sf-text-caption, #64748b); }
.sf-entry-origin-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sf-entry-badge {
    display: inline-block;
    font-size: var(--font-size-2xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #334155;
    background: #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.05rem 0.35rem;
    margin-right: 0.4rem;
    vertical-align: 0.05rem;
}
.sf-entry-mini { width: 100%; max-width: 36rem; margin: 0.2rem 0 0; border-collapse: collapse; }
.sf-entry-mini th,
.sf-entry-mini td { font-size: var(--font-size-xs); padding: 0.18rem 0.4rem; border: 0; border-bottom: 1px solid var(--border-color, #e2e8f0); }
.sf-table-scroll .sf-entry-mini thead th {
    position: static;
    box-shadow: none;
    background: transparent;
    color: var(--sf-text-caption, #64748b);
    font-weight: 600;
}
.sf-entry-mini th:nth-child(2),
.sf-entry-mini th:nth-child(3),
.sf-entry-mini .sf-entry-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 7.5rem; }
.sf-entry-analytic { font-size: var(--font-size-2xs); color: var(--sf-text-caption, #64748b); }
.sf-entry-date-cell { white-space: nowrap; min-width: 7.5rem; }
.sf-entry-amt-cell { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 6.5rem; }
.sf-entry-amt-cell .badge { display: block; margin-top: 0.25rem; width: fit-content; }
.sf-entry-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; min-width: 7.5rem; }
.sf-entry-actions .btn { min-height: 2.25rem; }
.sf-entry-edit-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.sf-entry-detail td { background: #f8fafc; }
.sf-entry-inline-head .sf-form-grid { max-width: 40rem; }
#entry-inbox-table .sf-entry-row.is-editing td:nth-child(2) { min-width: 18rem; }
#entry-inbox-table .sf-entry-mini { cursor: pointer; }

/* Grille saisie écriture — alignement head / lignes / totaux */
.sf-entry-lines {
  --sf-entry-cols: minmax(0, 1fr) 7.5rem 7.5rem 2.25rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  margin: 0.5rem 0;
}
.sf-entry-lines--analytic { --sf-entry-cols: minmax(0, 1fr) 7rem 7rem minmax(7rem, 9rem) 2.25rem; }
.sf-entry-lines__grid,
.sf-entry-line {
  display: grid;
  grid-template-columns: var(--sf-entry-cols);
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
}
.sf-entry-lines__head {
  background: var(--bg-secondary, #f8fafc);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted, #64748b);
}
.sf-entry-lines__head > :nth-child(n+2):not(:last-child),
.sf-entry-lines__foot > :nth-child(n+2):not(:last-child),
.sf-entry-lines .el-debit,
.sf-entry-lines .el-credit {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sf-entry-lines__body { max-height: 280px; overflow-y: auto; }
.sf-entry-line + .sf-entry-line { border-top: 1px solid var(--border-light, #e2e8f0); }
.sf-entry-lines__foot {
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8fafc);
}
.sf-entry-lines .el-debit,
.sf-entry-lines .el-credit { width: 100%; }
.sf-entry-lines .el-remove,
.sf-entry-lines [data-remove-line] {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
    .sf-entry-actions { min-width: 0; }
    .sf-entry-mini th:nth-child(2),
    .sf-entry-mini th:nth-child(3),
    .sf-entry-mini .sf-entry-num { width: auto; }
    .sf-entry-lines { --sf-entry-cols: minmax(0, 1fr) 5.75rem 5.75rem 2rem; }
    .sf-entry-lines--analytic { --sf-entry-cols: minmax(0, 1fr) 5.5rem 5.5rem minmax(5rem, 1fr) 2rem; }
}

@media (min-width: 640px) {
    .erp-period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) { .erp-parametres .sf-efi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
    .erp-parametres { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
    .erp-parametres > .card:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
    .erp-param-add { grid-template-columns: 1fr; }
    .erp-param-head { flex-direction: column; }
    .erp-param-head__tools { width: 100%; margin-left: 0; }
    .erp-param-add .btn, .erp-period-tile .btn, .sf-param-cta .btn,
    .erp-parametres .sf-form-actions > .btn { min-height: 2.75rem; }
    .erp-param-add .btn { width: 100%; max-width: none; }
    .erp-parametres .sf-form-actions > .btn { flex: 1 1 auto; }
}
@media (max-width: 768px) { .erp-parametres .sf-efi-hero { flex-direction: column; } .erp-parametres .sf-efi-hero__score { align-self: flex-start; } }

/* Échéanciers & contrats — densité / lookup / pages courtes */
#echeanciers.sf-eng-block .sf-list-toolbar { max-width: 22rem; }
#echeanciers .sf-eng-block__part + .sf-eng-block__part {
  margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid #ececf1;
}
#echeanciers .sf-eng-schedules,
#echeanciers #contractsList { display: flex; flex-direction: column; gap: 0.4rem; }
#echeanciers .sf-eng-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.55rem 0.7rem; margin: 0;
  border: 1px solid #ececf1; border-radius: 8px; background: #fff;
}
#echeanciers .sf-eng-card__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.75rem;
}
#echeanciers .sf-eng-card__title {
  display: flex; flex-direction: column; gap: 0.05rem; min-width: 0;
}
#echeanciers .sf-eng-card__meta {
  display: inline-flex; align-items: center; gap: 0.45rem;
  flex-wrap: nowrap; justify-self: end; flex-shrink: 0;
}
#echeanciers .sf-eng-card__meta .tabular-nums { white-space: nowrap; }
#echeanciers .sf-eng-progress { height: 3px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
#echeanciers .sf-eng-progress .progress-bar { height: 100%; background: var(--cta-color, #2563eb); }
#echeanciers .sf-eng-assign { width: 100%; }
#echeanciers .sf-eng-assign .sf-lookup-anchor { min-width: 10rem; max-width: 22rem; }
#echeanciers .sf-eng-lines { gap: 0; }
#echeanciers .sf-eng-lines .sf-list-row { padding-top: 0.2rem; padding-bottom: 0.2rem; }
#echeanciers .pagination-footer { margin-top: 0.35rem; }

/* ─── 1. Simulateur Prédictif What-If ─── */
.sf-what-if-card {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}
.sf-what-if-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.04) 0%, rgba(99, 102, 241, 0.04) 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.sf-what-if-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  background: #ffffff;
}
.sf-what-if-field label {
  font-size: var(--sf-font-size-xs, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}
.sf-what-if-results {
  padding: 1.25rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
/* Tuiles KPI partagées (What-If, Injonction, T&M) */
.sf-kpi-tiles, .sf-what-if-kpis, .sf-inj-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.sf-kpi-tile, .sf-what-if-kpi-item, .sf-what-if-kpi, .sf-inj-kpi-card {
  background: #fff;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.sf-kpi-tile__label, .sf-what-if-kpi-label, .sf-what-if-kpi__label, .sf-inj-kpi-card small {
  display: block;
  font-size: var(--sf-font-size-xs, 0.75rem);
  color: #64748b;
  margin-bottom: 0.2rem;
  font-weight: 600;
}
.sf-kpi-tile__value, .sf-what-if-kpi-val, .sf-what-if-kpi__value, .sf-inj-kpi-card h5 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}
.sf-kpi-tile--accent, .sf-inj-kpi-card--total {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.sf-kpi-tile--accent .sf-kpi-tile__label,
.sf-inj-kpi-card--total small { color: rgba(255, 255, 255, 0.85); }
.sf-kpi-tile--accent .sf-kpi-tile__value,
.sf-inj-kpi-card--total h5 { color: #fff; font-weight: 800; }
.sf-what-if-verdict {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: var(--sf-font-size-sm, 0.875rem);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.sf-what-if-verdict.safe {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}
.sf-what-if-verdict.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.sf-what-if-verdict.danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* ─── 2. 3-Way Matching Widget ─── */
.sf-3way-box {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}
.sf-3way-head {
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sf-3way-badge {
  font-size: var(--sf-font-size-2xs, 0.6875rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}
.sf-3way-badge--ok, .sf-3way-badge--match { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.sf-3way-badge--warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.sf-3way-badge--danger, .sf-3way-badge--mismatch { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.sf-3way-badge--info, .sf-3way-badge--neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.sf-3way-diff-table {
  width: 100%;
  font-size: var(--sf-font-size-xs, 0.75rem);
  margin-bottom: 0;
}
.sf-3way-diff-table th { background: #f1f5f9; color: #475569; font-weight: 600; padding: 0.5rem 0.65rem; }
.sf-3way-diff-table td { padding: 0.5rem 0.65rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.sf-3way-diff-row--alert { background: #fff5f5; }

/* ─── 3. Injonction de Payer Modal ─── */
.sf-inj-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.sf-inj-modal-dialog {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sfModalSlideUp 0.2s ease-out;
}
@keyframes sfModalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sf-inj-modal-head {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sf-inj-modal-head h3,
.sf-inj-modal-head .h5 {
  color: #ffffff !important;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.sf-inj-modal-head p,
.sf-inj-modal-head .text-white-50 {
  color: #94a3b8 !important;
  font-size: 0.8125rem;
}
.sf-inj-modal-head .btn-close-white,
.sf-inj-modal-head .btn-close {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
}
.sf-inj-modal-head .btn-close-white:hover {
  background: rgba(255, 255, 255, 0.15);
}
.sf-inj-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sf-inj-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.sf-inj-summary-box, .sf-inj-summary-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}
.sf-inj-summary-box--total {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.sf-inj-summary-box--total .sf-inj-val {
  color: #1d4ed8;
  font-weight: 800;
  font-size: 1.35rem;
}
.sf-inj-summary-label {
  font-size: var(--sf-font-size-2xs, 0.6875rem);
  text-transform: uppercase;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.sf-inj-summary-val {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}
.sf-inj-pieces-table {
  font-size: var(--sf-font-size-xs, 0.75rem);
  width: 100%;
}
.sf-inj-pieces-table th { background: #f1f5f9; color: #475569; padding: 0.5rem 0.65rem; }
.sf-inj-pieces-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid #f1f5f9; }

/* ─── 4. Scope Creep & T&M CRA Billing (BPM) ─── */
.sf-scope-creep-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: var(--sf-font-size-xs, 0.75rem);
  font-weight: 700;
}
.sf-scope-creep-badge.safe, .sf-scope-creep-badge--safe { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.sf-scope-creep-badge.warning, .sf-scope-creep-badge--warning { background: #fef3c7; color: #854d0e; border: 1px solid #fde68a; }
.sf-scope-creep-badge.critical, .sf-scope-creep-badge.danger, .sf-scope-creep-badge--danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.sf-cra-table {
  width: 100%;
  font-size: var(--sf-font-size-xs, 0.75rem);
}
.sf-cra-table th { background: #f8fafc; color: #475569; padding: 0.4rem 0.6rem; font-weight: 600; }
.sf-cra-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid #f1f5f9; }

/* ─── 5. Ergonomie Trésorerie : Spécificités Cockpit ─── */
.sf-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.sf-cockpit-grid > * {
  min-width: 0;
}
@media (max-width: 1200px) {
  .sf-cockpit-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── 6. Consolidation Groupe & Filiales : Ergonomie compacte & luxueuse ─── */
.sf-consol-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--sf-color-primary, #0f172a);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.sf-consol-step-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sf-color-text, #1e293b);
}

.sf-consol-empty {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--sf-radius-md, 8px);
  font-size: 0.82rem;
  color: var(--sf-color-text-muted, #64748b);
  line-height: 1.4;
}

.sf-consol-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  flex-shrink: 0;
}

.sf-consol-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sf-consol-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sf-consol-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--sf-color-border-subtle, #e2e8f0);
  border-radius: var(--sf-radius-md, 8px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sf-consol-item__info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.sf-consol-item__title {
  font-weight: 600;
  color: #0f172a;
}

.sf-consol-item__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sf-consol-form {
  background: #ffffff;
  border: 1px solid var(--sf-color-border-subtle, #e2e8f0);
  border-radius: var(--sf-radius-md, 8px);
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sf-consol-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: flex-end;
}

@media (min-width: 860px) {
  .sf-consol-form__grid {
    grid-template-columns: minmax(180px, 2.2fr) minmax(120px, 1.2fr) minmax(80px, 0.8fr) minmax(150px, 1.4fr) auto;
  }
}

.sf-consol-dock__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 860px) {
  .sf-consol-dock__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.sf-consol-dock__card {
  background: #ffffff;
  border: 1px solid var(--sf-color-border-subtle, #e2e8f0);
  border-radius: var(--sf-radius-md, 8px);
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
}

