* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #FFFFFF;
    --bg-muted: #FAFAF9;
    --bg-subtle: #F5F5F4;
    --border: #E7E5E4;
    --border-strong: #D6D3D1;
    --text: #18181B;
    --text-muted: #52525B;
    --text-subtle: #71717A;
    --brand: #0F172A;
    --brand-accent: #1E40AF;
    --brand-accent-hover: #1E3A8A;
    --brand-accent-bg: #EFF6FF;
    --success: #15803D;
    --success-bg: #DCFCE7;
    --warning: #B45309;
    --warning-bg: #FEF3C7;
    --danger: #B91C1C;
    --danger-bg: #FEE2E2;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

input, select, button, textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
}

/* Chiffres = IBM Plex Mono partout */
.mat-value, .field-value, .v, .stat-value, input[type="number"], input[type="text"][data-numeric="true"] {
    font-family: 'IBM Plex Mono', 'SF Mono', 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    font-feature-settings: "tnum" 1;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* === HEADER === */
.app-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.logo {
    width: 22px; height: 22px;
    background: var(--brand);
    color: white;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    font-family: Georgia, serif;
}
.brand-name {
    font-size: 14px;
    font-weight: 600;
}
.mission-meta {
    font-size: 11px;
    color: var(--text-subtle);
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}

/* === MATERIALITY STRIP === */
.mat-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border);
    background: var(--bg-muted);
}
.mat-cell {
    padding: 8px 12px;
    border-right: 1px solid var(--border);
}
.mat-cell:last-child { border-right: none; }
.mat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
    font-weight: 500;
    margin-bottom: 2px;
}
.mat-value {
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* === BODY: nav + content === */
.body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* === VERTICAL NAV === */
.step-nav {
    width: 78px;
    border-right: 1px solid var(--border);
    background: var(--bg-muted);
    padding: 14px 4px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}
.step-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 4px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}
.step-circle {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-subtle);
    margin-bottom: 5px;
    transition: all 0.2s;
    z-index: 1;
}
.step-btn.active .step-circle {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: white;
    box-shadow: 0 0 0 4px var(--brand-accent-bg);
}
.step-btn.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.step-label {
    font-size: 10px;
    color: var(--text-subtle);
    font-weight: 500;
    line-height: 1.25;
    max-width: 70px;
}
.step-btn.active .step-label {
    color: var(--brand-accent);
    font-weight: 600;
}
.step-btn.completed .step-label { color: var(--text); }
.step-btn:not(:first-child)::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 6px);
    left: 50%;
    width: 1.5px;
    height: 14px;
    background: var(--border-strong);
    transform: translateX(-50%);
    z-index: 0;
}
.step-btn.completed:not(:first-child)::before {
    background: var(--success);
}

/* === CONTENT === */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}
.screen { display: none; animation: fadeIn 0.2s ease; }
.screen.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    font-family: Georgia, serif;
}
.screen-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.placeholder {
    padding: 32px 16px;
    background: var(--bg-muted);
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    color: var(--text-subtle);
}

/* === FORM ELEMENTS === */
.field { margin-bottom: 14px; }
.field-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.field-value {
    color: var(--brand-accent);
    font-weight: 600;
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}
input[type="number"], select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 13px;
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    background: white;
    color: var(--text);
}
input[type="range"] {
    width: 100%;
    cursor: pointer;
}
input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px var(--brand-accent-bg);
}

.hint {
    font-size: 11px;
    color: var(--text-subtle);
    line-height: 1.5;
    margin-top: 8px;
}

.screen-action { margin-top: 4px; }

.btn-primary {
    width: 100%;
    padding: 10px 14px;
    background: var(--brand-accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.btn-primary:hover { background: var(--brand-accent-hover); }
.btn-primary:disabled { background: #A1A1AA; cursor: not-allowed; }

.status {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    display: none;
}
.status.show { display: block; }
.status.info { background: var(--brand-accent-bg); color: var(--brand-accent); border-left: 3px solid var(--brand-accent); }
.status.success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.status.error { background: var(--danger-bg); color: var(--danger); border-left: 3px solid var(--danger); }

.summary {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-top: 16px;
}
.summary h3 {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text);
}
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.summary-grid > div {
    padding: 8px 10px;
    background: var(--bg-muted);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

/* === RADIO GROUP === */
.radio-group {
    display: flex;
    gap: 8px;
}
.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    cursor: pointer;
    background: white;
    transition: all 0.15s;
    font-size: 12px;
}
.radio-option:hover {
    border-color: var(--brand-accent);
    background: var(--brand-accent-bg);
}
.radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}
.radio-option:has(input:checked) {
    border-color: var(--brand-accent);
    background: var(--brand-accent-bg);
    color: var(--brand-accent);
    font-weight: 600;
}

/* === SECTION CARDS === */
.sections-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.section-card {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 12px;
    background: white;
    transition: all 0.15s;
}
.section-card.checked {
    border-color: var(--brand-accent);
    background: var(--brand-accent-bg);
}
.section-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.section-checkbox {
    cursor: pointer;
    margin: 0;
}
.section-name {
    flex: 1;
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
}
.section-pop {
    font-size: 10px;
    color: var(--text-subtle);
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}
.section-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 60px 28px;
    gap: 4px;
    margin-top: 4px;
}
.section-controls select,
.section-controls input {
    padding: 4px 6px;
    font-size: 11px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: white;
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}
.section-controls input { text-align: right; }
.section-regen-btn {
    width: 28px;
    height: 26px;
    border-radius: 3px;
    background: white;
    border: 1px solid var(--border-strong);
    color: var(--text-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}
.section-regen-btn:hover {
    background: var(--brand-accent-bg);
    border-color: var(--brand-accent);
    color: var(--brand-accent);
    transform: rotate(90deg);
}
.section-disabled .section-controls {
    opacity: 0.4;
    pointer-events: none;
}
.k {
    font-size: 10px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.v {
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* === SETUP SECTIONS === */
.setup-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px 0;
}
.required {
    color: var(--danger);
    font-weight: 700;
}
.field-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--text-muted);
    color: white;
    margin-left: 6px;
    display: inline-block;
    height: 18px;
    line-height: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
}
.field-status.found {
    background: var(--success);
}
.field-status.missing {
    background: var(--warning);
}
.field-status.error {
    background: var(--danger);
}
.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-secondary:hover {
    background: var(--brand-accent-bg);
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

/* === STEP-BTN DISABLED === */
.step-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}
.step-btn.disabled .step-circle {
    background: var(--text-muted) !important;
    color: white !important;
}

/* === MULTI-SELECT DROPDOWN === */
.multiselect {
    position: relative;
    width: 100%;
}
.multiselect-trigger {
    width: 100%;
    padding: 8px 28px 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 13px;
    background: white;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    position: relative;
}
.multiselect-trigger:hover {
    border-color: var(--brand-accent);
}
.multiselect-trigger::after {
    content: '▾';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    font-size: 10px;
}
.multiselect-trigger.placeholder {
    color: var(--text-subtle);
    font-style: italic;
}
.multiselect-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    padding: 4px 0;
    display: none;
}
.multiselect.open .multiselect-panel {
    display: block;
}
.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
}
.multiselect-option:hover {
    background: var(--bg-muted);
}
.multiselect-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--brand-accent);
}
.multiselect-option .label-text {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text);
}
.multiselect-empty {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: var(--text-subtle);
    font-style: italic;
}

/* === SEGMENTED CONTROL === */
.segmented {
    display: flex;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}
.segment {
    flex: 1;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-subtle);
    cursor: pointer;
    transition: all 0.15s;
}
.segment:hover {
    color: var(--text-muted);
    background: rgba(0,0,0,0.03);
}
.segment.active {
    background: white;
    color: var(--brand-accent);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* === THRESHOLD ROW === */
.threshold-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.threshold-select, .threshold-value {
    width: 100%;
}

.threshold-value.locked {
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

.threshold-select {
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 13px;
    background: white;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}
.threshold-value {
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg-muted);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    text-align: right;
}
.threshold-value:not([readonly]) {
    background: white;
}
.threshold-value:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px var(--brand-accent-bg);
}

/* === SECTIONS LIST (Reversals) === */
.sections-list {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    max-height: 240px;
    overflow-y: auto;
}
.sections-list .section-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}
.sections-list .section-row:last-child {
    border-bottom: none;
}
.sections-list .section-row:hover {
    background: var(--bg-muted);
}
.sections-list input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--brand-accent);
    cursor: pointer;
    flex-shrink: 0;
}
.sections-list .section-name {
    flex: 1;
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}
.sections-list .section-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
}
.sections-list .section-row.unchecked .section-name,
.sections-list .section-row.unchecked .section-amount {
    color: var(--text-subtle);
    text-decoration: line-through;
    text-decoration-color: var(--border-strong);
}
.sections-summary {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--brand-accent-bg);
    color: var(--brand-accent);
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
}
.sections-summary .mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
}

/* === TOGGLE ROW === */
.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-accent);
    cursor: pointer;
    margin-top: 1px;
    flex-shrink: 0;
}
.toggle-label {
    flex: 1;
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}
.toggle-hint {
    display: block;
    font-size: 10px;
    color: var(--text-subtle);
    font-weight: 400;
    margin-top: 2px;
}

/* === BLOCK TITLES === */
.block-title {
    font-size: 13px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 4px;
    color: var(--text);
}
.block-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

/* === CARDBOX === */
.cardbox {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cardbox-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-subtle);
    font-style: italic;
    font-size: 12px;
}
.card-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}
.card-row .k {
    color: var(--text-subtle);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
}
.card-row .v {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text);
    font-weight: 500;
    font-size: 12px;
}
.card-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg-muted);
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}
.card-pair-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-pair-label {
    font-size: 9px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.card-pair-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text);
    font-weight: 500;
}
.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 12px;
}
.card-actions button {
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border: 1px solid;
    transition: all 0.1s;
}
.btn-validate {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}
.btn-validate:hover { background: var(--success); color: white; }
.btn-validate.active {
    background: var(--success);
    color: white;
    box-shadow: 0 0 0 2px var(--success-bg);
}
.btn-invalidate {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}
.btn-invalidate:hover { background: var(--danger); color: white; }
.btn-invalidate.active {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 0 2px var(--danger-bg);
}
.cardbox-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}
.btn-secondary {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}
.btn-secondary:hover { background: var(--bg-muted); color: var(--text); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.card-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-subtle);
    text-align: center;
    font-weight: 500;
}
.card-progress {
    margin-top: 6px;
    height: 3px;
    background: var(--bg-subtle);
    border-radius: 2px;
    overflow: hidden;
}
.card-progress-bar {
    height: 100%;
    background: var(--brand-accent);
    transition: width 0.3s;
}

/* === VALIDATION RECAP === */
.validation-recap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 11px;
}
.recap-item {
    padding: 6px 10px;
    background: var(--bg-muted);
    border-radius: 4px;
    border-left: 3px solid var(--border-strong);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.recap-item .recap-label {
    color: var(--text-muted);
    font-weight: 500;
}
.recap-item .recap-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: var(--text);
}
.recap-item.recap-certain { border-left-color: var(--danger); }
.recap-item.recap-validated { border-left-color: var(--danger); }
.recap-item.recap-invalidated { border-left-color: var(--success); }
.recap-item.recap-pending { border-left-color: var(--warning); }

/* === SCOPING REVIEW === */
.section-row .badge-override {
    display: inline-block;
    padding: 1px 6px;
    background: var(--warning-bg);
    color: var(--warning);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 3px;
    margin-left: 6px;
}
.section-row .badge-oos {
    display: inline-block;
    padding: 1px 6px;
    background: var(--bg-subtle);
    color: var(--text-subtle);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 3px;
    margin-left: 6px;
}

/* === SAMPLE CARDS (accordéon) === */
.sample-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    background: white;
    overflow: hidden;
    transition: border-color 0.15s;
}
.sample-card.expanded {
    border-color: var(--brand-accent);
    box-shadow: 0 1px 4px rgba(30, 64, 175, 0.08);
}
.sample-card.unchecked {
    opacity: 0.5;
}
.sample-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
}
.sample-card-header:hover {
    background: var(--bg-muted);
}
.sample-card-check {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-accent);
    cursor: pointer;
    flex-shrink: 0;
}
.sample-card-arrow {
    font-size: 10px;
    color: var(--text-subtle);
    width: 12px;
    flex-shrink: 0;
}
.sample-card-title {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sample-card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.stale-indicator {
    color: var(--warning);
    margin-left: 3px;
    cursor: help;
    font-weight: 600;
}
.sample-card-body {
    padding: 8px 12px 12px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}
.sample-card-field {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    font-size: 11px;
}
.sample-card-key {
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 9.5px;
    font-weight: 600;
}
.sample-card-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.sample-card-method,
.sample-card-risk,
.sample-card-accounts-btn {
    padding: 4px 6px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    width: 100%;
}
.sample-card-accounts-btn {
    text-align: left;
}
.sample-card-accounts-btn:hover {
    background: var(--bg-muted);
}
.sample-card-accounts-dropdown {
    grid-column: 1 / -1;
    margin-top: 4px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    padding: 4px;
}
.account-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 2px;
}
.account-option:hover {
    background: var(--bg-muted);
}
.account-option input {
    width: 13px;
    height: 13px;
    accent-color: var(--brand-accent);
    cursor: pointer;
}
.account-option .account-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text);
    min-width: 60px;
    flex-shrink: 0;
}
.account-option .account-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sample-card-titleblock {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.sample-card-titleblock .sample-card-title {
    flex: none;
    width: auto;
}
.sample-card-titleblock .sample-card-meta {
    font-size: 10.5px;
    color: var(--text-muted);
}
.sample-card-titleblock {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.sample-card-titleblock .sample-card-title {
    width: auto;
}
.sample-card-titleblock .sample-card-meta {
    font-size: 10.5px;
    color: var(--text-muted);
}

/* === FIELD ROW DOUBLE (PM + CTT côte à côte) === */
.field-row-double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.field-input-pct {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--text);
    background: white;
    transition: border-color 0.15s;
}
.field-input-pct:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.multiselect-empty-text {
    color: var(--text-subtle);
    font-style: italic;
}

/* === MAPPING ACCORDION === */
.mapping-accordion {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    background: white;
    overflow: hidden;
}
.mapping-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    background: white;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text);
    text-align: left;
    transition: background 0.1s;
}
.mapping-header:hover {
    background: var(--bg-muted);
}
.mapping-arrow {
    font-size: 10px;
    color: var(--text-subtle);
    width: 12px;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.mapping-accordion.expanded .mapping-arrow {
    transform: rotate(90deg);
}
.mapping-title {
    flex: 1;
    font-weight: 600;
}
.mapping-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
}
.mapping-dot.mapped {
    background: var(--success);
}
.mapping-status.mapped {
    background: var(--success-bg);
    color: var(--success);
}
.mapping-body {
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}
.mapping-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 0;
    font-size: 11px;
}
.mapping-field-label {
    color: var(--text-subtle);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 9.5px;
}
.mapping-field-select {
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    width: 100%;
}
.mapping-field-select.unset {
    border-color: var(--warning);
    background: var(--warning-bg);
}
.mapping-amount-mode {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.mapping-amount-mode button {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    color: var(--text-muted);
    cursor: pointer;
}
.mapping-amount-mode button.active {
    background: var(--brand-accent);
    color: white;
    border-color: var(--brand-accent);
}
.mapping-validate-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px 12px;
    background: var(--brand-accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.mapping-validate-btn:hover {
    opacity: 0.9;
}
.mapping-validate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === SETUP ACCORDION === */
.setup-accordion {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    background: white;
    overflow: hidden;
}
.setup-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: none;
    background: white;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text);
    text-align: left;
    transition: background 0.1s;
}
.setup-accordion-header:hover {
    background: var(--bg-muted);
}
.setup-arrow {
    font-size: 11px;
    color: var(--text-subtle);
    width: 12px;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.setup-accordion.expanded .setup-arrow {
    transform: rotate(0deg);
}
.setup-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}
.setup-title {
    flex: 1;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}
.setup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
}
.setup-dot.validated {
    background: var(--success);
}
.setup-accordion-body {
    padding: 12px 16px 16px 16px;
    border-top: 1px solid var(--border);
}
/* Cacher les pastilles internes detecte/absent — la pastille principale Données suffit */
.field-status {
    display: none;
}