/*
 * Charte et composants KABAW (refonte 2026-11-06/07) — extrait de base.html le 2026-11-07 pour
 * être partagé avec les pages autonomes (connexion, mot de passe, invitation, erreur).
 * Chargé AVANT app.css (Tailwind compilé), comme l'était le bloc <style> d'origine.
 * Après modification : ./scripts/build_css.sh (met à jour ?v= dans les gabarits).
 */
/* Police des titres de page et du logo (charte kabaw.ch) */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap;
             src: url('/static/fonts/Fraunces-SemiBold.ttf') format('truetype'); }

/* Jetons de la charte kabaw.ch — docs/refonte/GUIDE.md, source kabaw/core/brand.py */
:root {
    --background: 43 33% 96%;          /* papier #F8F6F1 */
    --foreground: 225 8% 10%;          /* encre 900 #17181B */
    --card: 0 0% 100%;
    --card-foreground: 225 8% 10%;
    --popover: 0 0% 100%;
    --popover-foreground: 225 8% 10%;
    --primary: 211 100% 28%;           /* bleu 700 #00468F (logo) */
    --primary-hover: 212 100% 25%;     /* bleu 800 #003D82 */
    --primary-foreground: 0 0% 100%;
    --secondary: 42 26% 93%;           /* papier alterné #F1EEE7 */
    --secondary-foreground: 225 8% 10%;
    --muted: 42 26% 93%;
    --muted-foreground: 216 10% 39%;   /* encre 500 #5A626E — 6,2:1 */
    --accent: 42 26% 93%;
    --accent-foreground: 225 8% 10%;
    --destructive: 353 71% 41%;        /* rouge 700 #B21E2F */
    --destructive-foreground: 0 0% 100%;
    --border: 42 17% 88%;              /* filet #E6E3DC (décor) */
    --input: 40 6% 53%;                /* bord de champ #8F8A80 — 3,2:1 */
    --ring: 211 100% 35%;              /* bleu 600 #0056B3 */
    --link: 211 100% 35%;
    --selected: 210 67% 96%;           /* bleu 50 #F0F6FC */
    --success-bg: 151 45% 91%;  --success-fg: 155 56% 27%;  --success-bd: 151 42% 79%;
    --warning-bg: 40 91% 91%;   --warning-fg: 35 100% 30%;  --warning-bd: 38 92% 80%;
    --danger-bg: 353 81% 96%;   --danger-fg: 353 71% 41%;   --danger-bd: 353 73% 84%;
    --info-bg: 210 67% 96%;     --info-fg: 211 100% 28%;    --info-bd: 209 62% 93%;
    --radius: 9px;
    --radius-sm: 6px;
    /* Flatpickr calendar */
    --cal-bg: white;
    --cal-fg: #17181B;
    --cal-muted: #5A626E;
    --cal-hover: #F1EEE7;
    --cal-today-bg: #F1EEE7;
    --cal-today-border: #E6E3DC;
    --cal-selected: #00468F;
    --cal-range: rgba(0,70,143,0.1);
    --cal-border: #E6E3DC;
    --cal-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 10px -4px rgba(0,0,0,0.08);
    --cal-prev: #E6E3DC;
}

/* Fondations : texte, titres, focus visible (WCAG 2.4.7 / 2.4.11) */
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; color: hsl(var(--foreground)); }
.page-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
@media (max-width: 767px) { .page-title { font-size: 1.5rem; } }
.brand-logo { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -0.01em; color: hsl(var(--primary)); }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0.5rem; z-index: 10000; }
.skip-link:focus { left: 0.5rem; background: hsl(var(--card)); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); }

* { border-color: hsl(var(--border)); }

dialog { background-color: hsl(var(--card)); color: hsl(var(--card-foreground)); }

/* Hide native date inputs until Flatpickr converts them (prevents yyyy-mm-dd flash) */
input[type="date"] {
    color: transparent !important;
}
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
input[type="date"]::-webkit-inner-spin-button { display: none; }

/* ========================================
   Flatpickr Theme — KABAW
   ======================================== */
.flatpickr-calendar {
    background: var(--cal-bg) !important;
    border: 1px solid var(--cal-border) !important;
    border-radius: 0.75rem !important;
    box-shadow: var(--cal-shadow) !important;
    font-family: 'Inter', sans-serif !important;
    padding: 0.75rem !important;
    width: auto !important;
}
.flatpickr-innerContainer { display: flex !important; }
.flatpickr-rContainer { width: auto !important; }
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after { display: none !important; }

.flatpickr-months { padding: 0.25rem 0 !important; }
.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--cal-fg) !important;
    height: 36px !important;
}
.flatpickr-current-month {
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: var(--cal-fg) !important;
    padding-top: 4px !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: var(--cal-fg) !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    -webkit-appearance: none;
    border: none;
}
.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--cal-bg);
    color: var(--cal-fg);
}
.flatpickr-current-month input.cur-year {
    color: var(--cal-fg) !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--cal-muted) !important;
    fill: var(--cal-muted) !important;
    padding: 0.5rem !important;
    border-radius: 0.375rem !important;
    transition: all 150ms !important;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--cal-fg) !important;
    fill: var(--cal-fg) !important;
    background: var(--cal-hover) !important;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 14px !important; height: 14px !important;
}
.flatpickr-weekdays {
    background: transparent !important;
    padding: 0.25rem 0 !important;
    width: 100% !important;
}
.flatpickr-weekdaycontainer {
    display: flex !important;
    width: 100% !important;
}
span.flatpickr-weekday {
    background: transparent !important;
    color: var(--cal-muted) !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    flex: 1 !important;
    max-width: none !important;
}
.flatpickr-days { border: none !important; width: auto !important; }
.dayContainer {
    padding: 0 !important;
    min-width: 280px !important;
    max-width: 280px !important;
    width: 280px !important;
}
.flatpickr-day {
    color: var(--cal-fg) !important;
    border: none !important;
    border-radius: 0.375rem !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    max-width: 40px !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 !important;
    flex-basis: 14.285% !important;
    transition: all 150ms !important;
}
.flatpickr-day:hover { background: var(--cal-hover) !important; }
.flatpickr-day.today {
    background: var(--cal-today-bg) !important;
    font-weight: 600 !important;
    border: 1px solid var(--cal-today-border) !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--cal-selected) !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 0 0 1px var(--cal-selected), 0 2px 8px rgba(59, 130, 246, 0.35) !important;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: var(--cal-prev) !important; }
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover { color: var(--cal-muted) !important; }
/* Padding days added by JS to fill the 6-row grid */
.flatpickr-day.cal-pad {
    cursor: default !important;
    pointer-events: none !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--cal-prev) !important;
    opacity: 0.4 !important;
    background: transparent !important;
}
.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange {
    background: var(--cal-range) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: var(--cal-fg) !important;
    opacity: 1 !important;
}
.flatpickr-day.inRange:hover {
    background: var(--cal-hover) !important;
}
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--cal-selected) !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}
.flatpickr-day.startRange {
    border-radius: 0.375rem 0 0 0.375rem !important;
}
.flatpickr-day.endRange {
    border-radius: 0 0.375rem 0.375rem 0 !important;
}
.flatpickr-day.startRange.endRange {
    border-radius: 0.375rem !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    -webkit-font-smoothing: antialiased;
}

/* shadcn/ui component classes */
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; min-height: 2.5rem; transition: background-color 150ms, color 150ms, border-color 150ms; }
.btn:disabled { pointer-events: none; opacity: 0.5; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: 0.5rem 1rem; }
.btn-primary:hover { background: hsl(var(--primary-hover)); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); padding: 0.5rem 1rem; }
.btn-secondary:hover { background: hsl(var(--accent)); }
.btn-outline { border: 1px solid hsl(var(--input)); background: hsl(var(--card)); padding: 0.5rem 1rem; }
.btn-outline:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-ghost { padding: 0.5rem 1rem; }
.btn-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); padding: 0.5rem 1rem; }
.btn-destructive:hover { opacity: 0.9; }
.btn-sm { min-height: 2rem; height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; }
@media (max-width: 767px) { .btn, .btn-sm { min-height: 2.75rem; height: auto; } }
.btn-lg { height: 2.75rem; padding: 0 2rem; }
.btn-icon { height: 2.5rem; width: 2.5rem; padding: 0; }

.input-field {
    display: flex; height: 2.5rem; width: 100%; border-radius: var(--radius-sm);
    border: 1px solid hsl(var(--input)); background: hsl(var(--card));
    padding: 0.5rem 0.75rem; font-size: 0.875rem; transition: all 150ms;
}
.input-field::placeholder { color: hsl(var(--muted-foreground)); }
.input-field:focus, .select-field:focus, .textarea-field:focus { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; box-shadow: none; }
@media (max-width: 767px) { .input-field, .select-field, .textarea-field { font-size: 16px; } .input-field, .select-field { height: 2.75rem; } }

.card { border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--card-foreground)); }

.badge { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 600; line-height: 1.25rem; }
.badge-default { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.badge-outline { border: 1px solid hsl(var(--border)); }
.badge-success { background: hsl(var(--success-bg)); color: hsl(var(--success-fg)); border: 1px solid hsl(var(--success-bd)); }
.badge-warning, .badge-amber { background: hsl(var(--warning-bg)); color: hsl(var(--warning-fg)); border: 1px solid hsl(var(--warning-bd)); }
.badge-info, .badge-purple { background: hsl(var(--info-bg)); color: hsl(var(--info-fg)); border: 1px solid hsl(var(--info-bd)); }
.badge-danger { background: hsl(var(--danger-bg)); color: hsl(var(--danger-fg)); border: 1px solid hsl(var(--danger-bd)); }

/* Alert component */
.alert { position: relative; width: 100%; border-radius: var(--radius); border: 1px solid hsl(var(--border)); padding: 0.75rem 1rem; font-size: 0.875rem; }
.alert-destructive { border-color: hsl(var(--danger-bd)); background: hsl(var(--danger-bg)); color: hsl(var(--danger-fg)); }
.alert-success { border-color: hsl(var(--success-bd)); background: hsl(var(--success-bg)); color: hsl(var(--success-fg)); }
.alert-warning { border-color: hsl(var(--warning-bd)); background: hsl(var(--warning-bg)); color: hsl(var(--warning-fg)); }
.alert-info { border-color: hsl(var(--info-bd)); background: hsl(var(--info-bg)); color: hsl(var(--info-fg)); }


/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Link style */
.link { color: hsl(var(--link)); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Table styles */
.table-header { border-bottom: 1px solid hsl(var(--border)); }
.table-header th { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); padding: 0.625rem 1rem; }
.table-row { border-bottom: 1px solid hsl(var(--border)); }
.table-row:hover { background: hsl(var(--muted) / 0.3); }
.table-row td { padding: 0.625rem 1rem; }
.table-header th.col-checkbox, .table-row td.col-checkbox { width: 2.5rem; padding-left: 1rem; padding-right: 0; text-align: left; }

/* Receipt status icon alignment */
.receipt-status { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 2rem; }
.receipt-status > span:empty { display: none; }

/* Select field (chevron unifié avec les icônes Lucide) */
.select-field {
    appearance: none; -webkit-appearance: none; padding-right: 2rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A626E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.625rem center; background-size: 1rem;
}
.select-field {
    display: flex; height: 2.5rem; width: 100%; border-radius: var(--radius-sm);
    border: 1px solid hsl(var(--input)); background: hsl(var(--card));
    padding: 0.5rem 0.75rem; font-size: 0.875rem; transition: all 150ms;
}
/* Liste ouverte (size > 1, ex. « Donateur à associer ») : hauteur selon le nombre de lignes, pas
   la hauteur d'un menu déroulant (09.11 : liste coupée à 1,5 ligne), ni chevron */
.select-field[size]:not([size="1"]), .select-field[multiple] {
    display: block; height: auto; min-height: 10rem; padding: 0.25rem !important; background-image: none;
}
.select-field[size]:not([size="1"]) option, .select-field[multiple] option { padding: 0.375rem 0.5rem; border-radius: var(--radius-sm); }

/* Textarea */
.textarea-field {
    display: flex; width: 100%; border-radius: var(--radius-sm);
    border: 1px solid hsl(var(--input)); background: hsl(var(--card));
    padding: 0.5rem 0.75rem; font-size: 0.875rem; transition: all 150ms; min-height: 5rem;
}

/* Label */
.label { display: block; font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); margin-bottom: 0.375rem; }
.label .required { color: hsl(var(--destructive)); margin-left: 0.125rem; }
.help-text { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }

/* Section header inside cards */
.section-title { font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 0.75rem; }

/* Progress bar */
.progress-bar { height: 0.5rem; width: 100%; border-radius: 9999px; background: hsl(var(--muted)); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 9999px; background: hsl(var(--primary)); transition: width 300ms; }

.separator { height: 1px; width: 100%; background: hsl(var(--border)); }

/* ── Composants LISTE (docs/refonte/GUIDE.md ; macros components/list.html) ── */
.k-page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.k-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1rem; }
.k-head-actions { display: flex; align-items: center; gap: 0.5rem; }
.k-menu { position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 30; min-width: 14rem; padding: 0.25rem 0; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--popover)); box-shadow: 0 8px 24px rgba(23,24,27,0.12); }
.k-menu-item { display: flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0 0.875rem; font-size: 0.875rem; color: hsl(var(--foreground)); white-space: nowrap; }   /* une entrée = une ligne */
.k-menu { width: max-content; max-width: min(22rem, calc(100vw - 2rem)); }
.k-menu-item:hover, .k-menu-item:focus-visible { background: hsl(var(--muted)); outline: none; }
.k-summary { margin-top: 0.25rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); display: flex; flex-wrap: wrap; column-gap: 0.5rem; }
.k-sum { white-space: nowrap; }
.k-sum:has(~ .k-sum:not([hidden]))::after { content: "·"; margin-left: 0.5rem; color: hsl(var(--muted-foreground)); }   /* en fin d'élément : jamais en début de ligne */
.k-summary-link { color: hsl(var(--warning-fg)); font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.k-summary-link.is-info { color: hsl(var(--link)); }
.k-summary-link:hover { text-decoration: underline; }
.k-filters { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: -0.5rem; }
.k-filter-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.k-filter-toggle { display: none; }
.k-chip { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0 0.625rem; border-radius: 999px; background: hsl(var(--selected)); color: hsl(var(--primary)); font-size: 0.8125rem; }
.k-chip a { display: inline-flex; color: inherit; }
.k-filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.k-search { position: relative; width: 16rem; max-width: 100%; }
.k-search > i, .k-search > svg { position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: hsl(var(--muted-foreground)); pointer-events: none; }
.k-search .input-field { padding-left: 2rem; padding-right: 2.5rem; }
.k-search-go { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: var(--radius-sm); color: hsl(var(--muted-foreground)); }
.k-search-go:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.k-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.k-pill { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; padding: 0 0.875rem; border: 1px solid hsl(var(--border)); border-radius: 999px; background: hsl(var(--card)); font-size: 0.875rem; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.k-pill:hover { color: hsl(var(--foreground)); border-color: hsl(var(--input)); }
.k-pill.is-active { background: hsl(var(--selected)); border-color: hsl(var(--primary) / 0.35); color: hsl(var(--primary)); font-weight: 500; }
.k-pill-count { font-weight: 600; color: hsl(var(--foreground)); }
.k-pill.is-active .k-pill-count { color: inherit; }
.k-note { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.625rem 0.75rem 0.625rem 1rem; border-radius: var(--radius); background: hsl(var(--selected)); color: hsl(var(--foreground)); font-size: 0.875rem; line-height: 1.45; }
.k-note > i, .k-note > svg { flex: none; margin-top: 0.15rem; color: hsl(var(--primary)); }
.k-note > p { flex: 1; min-width: 0; }
.k-note-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; margin: -0.125rem 0; border-radius: var(--radius-sm); color: hsl(var(--muted-foreground)); }
.k-note-close:hover { background: hsl(var(--card)); color: hsl(var(--foreground)); }
/* Barre d'actions groupées : n'apparaît qu'à la 1re case cochée (GUIDE « Actions en masse ») */
.k-bulkbar { position: sticky; bottom: 1rem; z-index: 20; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; padding: 0.625rem 0.75rem 0.625rem 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: 0 8px 24px rgba(23,24,27,0.12); font-size: 0.875rem; }
.k-bulkbar .btn { margin-left: auto; }
.k-check { width: 1.125rem; height: 1.125rem; accent-color: hsl(var(--primary)); }
.k-rowmenu { position: relative; z-index: 2; justify-self: end; }
.k-rowmenu.is-open { z-index: 40; }            /* le menu ouvert passe devant les ⋯ des lignes suivantes */
.k-rowmenu .k-menu { right: 0; }
.k-rowmenu.is-up .k-menu { top: auto; bottom: calc(100% + 0.25rem); }   /* peu de place en dessous */
.k-list:has(.k-rowmenu) { overflow: visible; } /* sinon le menu des dernières lignes est coupé */
/* Infobulle d'aide (components/tooltip.html) : cible ≥ 24 px, 44 px au toucher */
.k-tip-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; min-height: 1.5rem; margin-left: 0.125rem; border-radius: 999px; color: inherit; }
.k-tip-btn:hover { background: hsl(var(--muted)); }
@media (pointer: coarse) { .k-tip-btn { min-width: 2.75rem; min-height: 2.75rem; margin: -0.625rem -0.5rem -0.625rem -0.375rem; } }
/* ── Composants SAISIE (components/form.html) ── */
/* ── Type FICHE (components/fiche.html, maquette 2026-11-07) ── */
.k-fiche-page { max-width: 56rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.k-fiche-page.is-wide { max-width: 1180px; }   /* rapports à tableaux larges (bilan, balance, grand livre, fonds, projets) */
.k-fiche-head { flex-wrap: nowrap; }   /* ⋯ toujours à droite du titre, même si la ligne de contexte est longue */
.k-fiche-head > .min-w-0 { flex: 1 1 auto; } .k-fiche-head > .k-head-actions:not(:has(.k-fiche-primary)) { flex: 0 0 auto; width: auto; margin-left: auto; }
.k-fiche-card { padding: 1rem 1.25rem; }
.k-fiche-head .k-summary { align-items: center; }
.k-fiche-head .k-summary > span:has(~ span)::after { content: "·"; margin-left: 0.5rem; color: hsl(var(--muted-foreground)); }
.k-fiche-head .k-summary > .k-state::after { content: none; }
.k-fiche-page > .card, .k-fiche-page > div > .card { margin-bottom: 0; }   /* l'espacement vient du gap */
.k-facts.is-plain { background: none; padding: 0; gap: 0.875rem 1.5rem; }
.k-facts .is-wide { grid-column: 1 / -1; }
.k-facts dd a { color: hsl(var(--link)); }
.k-facts dd a:hover { text-decoration: underline; }
.k-todo { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.75rem 1rem; border: 1px solid hsl(var(--warning-bd)); border-radius: 0.5rem; background: hsl(var(--warning-bg)); color: hsl(var(--warning-fg)); font-size: 0.875rem; }
.k-todo > svg { margin-top: 0.125rem; }
.k-todo-body { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.k-todo-body .grow { flex: 1 1 14rem; }
.k-notice { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.5); }
.k-notice.is-danger { border-color: hsl(var(--danger-bd)); background: hsl(var(--danger-bg)); color: hsl(var(--danger-fg)); }
.k-notice.is-warning { border-color: hsl(var(--warning-bd)); background: hsl(var(--warning-bg)); color: hsl(var(--warning-fg)); }
.k-notice a { text-decoration: underline; }
.k-section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.k-section-title { font-size: 0.9375rem; font-weight: 600; color: hsl(var(--foreground)); }
.k-section-count { font-weight: 400; color: hsl(var(--muted-foreground)); margin-left: 0.25rem; }
.k-section > :not(.k-section-head) { margin-top: 0.75rem; }
.k-section > .k-list { margin: 0.75rem -1.25rem -1rem; border-width: 1px 0 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }   /* liste dans une section : pas de carte dans la carte */
details.k-fold > summary { cursor: pointer; list-style: none; }
details.k-fold > summary::-webkit-details-marker { display: none; }
details.k-fold > summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid hsl(var(--muted-foreground)); border-bottom: 2px solid hsl(var(--muted-foreground)); transform: rotate(45deg); transition: transform .15s; margin-right: 0.25rem; }
details.k-fold[open] > summary::after { transform: rotate(-135deg); }
.k-history { list-style: none; margin: 0; padding: 0; }
.k-history li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.125rem 0.75rem; padding: 0.625rem 0; border-top: 1px solid hsl(var(--border)); font-size: 0.875rem; }
.k-history li:first-child { border-top: 0; }
.k-history time { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.k-history .k-h-meta { grid-column: 2; color: hsl(var(--muted-foreground)); font-size: 0.8125rem; }
.k-menu-item.is-danger { color: hsl(var(--danger-fg)); }
button.k-menu-item { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; }
.k-files { list-style: none; margin: 0; padding: 0; }
.k-files-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid hsl(var(--border)); }
.k-files-row:first-child { border-top: 0; }
.k-files-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: hsl(var(--link)); font-size: 0.875rem; }
.k-files-meta { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; white-space: nowrap; }
.k-dropping { outline: 2px dashed hsl(var(--primary)); outline-offset: -4px; }
/* ── Frise des étapes (components/fiche.html, macro steps) ── */
.k-steps { list-style: none; margin: 0; padding: 0.875rem 1.25rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 10rem); justify-content: center; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); }
.k-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.375rem; text-align: center; cursor: default; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.k-step + .k-step::before { content: ""; position: absolute; top: 0.75rem; right: calc(50% + 0.95rem); width: calc(100% - 1.9rem); height: 2px; background: hsl(var(--border)); }
.k-step.is-done + .k-step::before, .k-step.is-done + .k-step.is-current::before { background: hsl(var(--primary)); }
.k-step-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; border: 2px solid hsl(var(--border)); background: hsl(var(--card)); font-size: 0.75rem; font-weight: 600; }
.k-step.is-done .k-step-dot { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: #fff; }
.k-step.is-current .k-step-dot { border-color: hsl(var(--primary)); color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15); }
.k-step.is-current .k-step-label { color: hsl(var(--foreground)); font-weight: 600; }
.k-step.is-done .k-step-label { color: hsl(var(--foreground)); }
.k-step-date { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.k-step.is-off .k-step-dot { background: hsl(var(--danger-bg)); border-color: hsl(var(--danger-fg)); color: hsl(var(--danger-fg)); }
.k-step.is-off .k-step-label { color: hsl(var(--danger-fg)); font-weight: 600; }
.k-step.is-done + .k-step.is-off::before { background: hsl(var(--primary)); }
@media (max-width: 640px) { .k-steps { padding: 0.75rem 0.5rem; } .k-step { font-size: 0.75rem; } .k-step-date { font-size: 0.6875rem; } }
/* ── Chiffres clés dans la carte (components/fiche.html, macro key_figures) ── */
.k-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid hsl(var(--border)); }
.k-fig { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.k-fig-label { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.k-fig-value { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; color: hsl(var(--foreground)); white-space: nowrap; }
.k-fig-value.is-in { color: hsl(var(--success-fg)); }
.k-fig-sub { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
@media (max-width: 640px) { .k-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .k-fig-value { font-size: 1.0625rem; } }
/* ── Écritures compactes (components/fiche.html, macro journal_entries) ── */
.k-je-entry + .k-je-entry { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid hsl(var(--border)); }
.k-je-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; font-size: 0.875rem; margin-bottom: 0.375rem; }
.k-je-meta { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.k-je-row { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 6.5rem 6.5rem; gap: 0.75rem; padding: 0.25rem 0; font-size: 0.875rem; }
.k-je-row > span:nth-child(3), .k-je-row > span:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.k-je-cols { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); padding: 0; }
@media (max-width: 640px) { .k-je-row { grid-template-columns: 3rem minmax(0, 1fr) 5rem 5rem; gap: 0.5rem; font-size: 0.8125rem; } }
/* ── Onglets de fiche (components/tabs.html) ── */
.k-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid hsl(var(--border)); overflow-x: auto; scrollbar-width: none; }
.k-tab { flex: none; display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; padding: 0 0.875rem; margin-bottom: -1px; border-bottom: 2px solid transparent; background: none; font-size: 0.875rem; color: hsl(var(--muted-foreground)); cursor: pointer; white-space: nowrap; }
.k-tab:hover { color: hsl(var(--foreground)); }
.k-tab.is-active { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); font-weight: 500; }
.k-tab:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }
.k-tab-count { font-size: 0.75rem; font-weight: 600; padding: 0 0.4rem; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.k-tab.is-active .k-tab-count { background: hsl(var(--selected)); color: hsl(var(--primary)); }
[role=tabpanel][hidden] { display: none !important; }
.k-panel-head { display: flex; justify-content: flex-end; gap: 0.5rem; margin-bottom: 0.75rem; }
.k-section[role=tabpanel] > .k-panel-head + .k-list { margin-top: 0; border-top: 1px solid hsl(var(--border)); }
.k-section[role=tabpanel] > .k-list:first-child { margin-top: -1rem; border-top: 0; border-radius: var(--radius); }   /* panneau sans titre : la liste remplit la carte */
.k-section[role=tabpanel] > .k-list:first-child > ul > li:first-child, .k-section[role=tabpanel] > .k-list:first-child > ul:first-child > li:first-child { border-top: 0; }
.k-more-row { display: flex; justify-content: center; padding: 0.625rem; border-top: 1px solid hsl(var(--border)); }
/* ── Type IMPORT (components/import_page.html) : une opération = une ligne ── */
.k-ops { list-style: none; margin: 0; padding: 0; }
.k-ops-card { padding-bottom: 0; }
.k-ops-card > .k-op-head, .k-ops-card > .k-ops, .k-section > .k-ops { margin-left: -1.25rem; margin-right: -1.25rem; }
.k-ops-card > .k-op-head { margin-bottom: 0; }
.k-ops-card > .k-ops { margin-top: 0; margin-bottom: 0; }
.k-section:not(.k-ops-card) > .k-ops { margin-bottom: -1rem; border-top: 1px solid hsl(var(--border)); }
.k-op { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 8rem minmax(9rem, 15rem) 2.25rem; column-gap: 1rem; row-gap: 0.25rem; align-items: center; padding: 0.625rem 1.25rem; }
.k-ops > li + li { border-top: 1px solid hsl(var(--border)); }
.k-op-head { padding-top: 0.5rem; padding-bottom: 0.5rem; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.5); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.k-op.is-cancelled > :not(.k-rowmenu):not(.k-op-extra) { opacity: 0.6; }
.k-op > .k-op-extra { grid-column: 2 / -1; }
.k-op-rec { min-width: 0; font-size: 0.875rem; }
/* Ligne d'opération cliquable comme une ligne de liste (Simon, 11.11.2026) : .k-link étiré sur la
   ligne ; menu ⋯, formulaires et boutons restent au-dessus */
.k-op.is-link { position: relative; }
.k-op.is-link:hover { background: hsl(var(--muted) / 0.5); }
.k-op.is-link a:not(.k-link), .k-op.is-link button, .k-op.is-link input, .k-op.is-link label, .k-op.is-link form, .k-op.is-link .k-rowmenu { position: relative; z-index: 1; }
.k-op-rec .k-l2 { white-space: nowrap; }
.k-op .k-amount small { display: block; font-weight: 400; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.k-lines { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.k-lines li { padding: 0.25rem 0; }
.k-meta { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
/* Aperçu : ligne avec case à cocher et choix (projet, compte…) */
.k-op.is-pick { grid-template-columns: 1.25rem 5.5rem minmax(0, 1fr) 8rem minmax(11rem, 16rem); }
.k-op.is-pick.k-op-head { grid-template-columns: 1.25rem 5.5rem minmax(0, 1fr) 8rem minmax(11rem, 16rem); }
.k-op-pick { min-width: 0; }
.k-op.is-pick.is-wide, .k-op.is-pick.is-wide.k-op-head { grid-template-columns: 1.25rem 5.5rem minmax(0, 1fr) 7.5rem minmax(17rem, 22rem); }
.k-op-pick .k-seg-opts { gap: 0.125rem; padding: 0.1875rem; margin-bottom: 0.375rem; }
.k-op-pick .k-seg-opt span { min-height: 2rem; padding: 0 0.625rem; font-size: 0.8125rem; }
.k-op-pick .k-op-field + .k-op-field { margin-top: 0.375rem; }
.k-op.is-choice { grid-template-columns: 5.5rem minmax(0, 1fr) 8rem minmax(14rem, 20rem); }
.k-op.is-pick .k-l2 { white-space: normal; }   /* le choix fiche donateur / anonyme reste visible */
.k-op-pick .select-field { height: 2.25rem; padding-top: 0; padding-bottom: 0; font-size: 0.875rem; }
.k-op-hint { margin-top: 0.25rem; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.k-op.is-off > :not(.k-sel) { opacity: 0.55; }
.k-toggle { border: 0; background: none; padding: 0; color: hsl(var(--link)); font-size: 0.8125rem; cursor: pointer; }
.k-toggle:hover { text-decoration: underline; }
.k-pbar { position: sticky; bottom: 1rem; z-index: 20; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.625rem 0.75rem 0.625rem 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: 0 8px 24px rgba(23,24,27,0.12); }
.k-pbar-state { flex: 1; min-width: 10rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
@media (max-width: 767px) {
    .k-op { grid-template-columns: minmax(0, 1fr) auto; padding: 0.75rem 1rem; }
    .k-ops-card > .k-ops, .k-section > .k-ops { margin-left: -1.25rem; margin-right: -1.25rem; }
    .k-op > .k-date { display: none; }   /* mobile : la date passe dans la 2e ligne (k-sm-only) */
    .k-op > .k-main { order: 1; }
    .k-op > .k-amount { order: 2; align-self: start; }
    .k-op > .k-op-rec { order: 4; grid-column: 1 / 2 !important; }
    .k-op > .k-rowmenu { order: 5; grid-column: 2 / 3; align-self: center; }
    .k-op > .k-op-extra { order: 6; grid-column: 1 / -1; }
    .k-op-head { display: none; }
    .k-op.is-pick { grid-template-columns: 1.25rem minmax(0, 1fr) auto; }
    .k-op.is-pick.is-wide { grid-template-columns: 1.25rem minmax(0, 1fr) auto; }
    .k-op-pick .k-seg-opts { display: flex; width: 100%; }
    .k-op-pick .k-seg-opt { flex: 1; }
    .k-op-pick .k-seg-opt span { justify-content: center; width: 100%; min-height: 2.75rem; }
    .k-op.is-pick > .k-sel { grid-row: 1 / 3; align-self: start; padding-top: 0.125rem; }
    .k-op.is-pick > .k-main { grid-column: 2; }
    .k-op.is-pick > .k-amount { grid-column: 3; }
    .k-op.is-pick > .k-op-pick { grid-column: 2 / -1; order: 4; }
    .k-op.is-choice { grid-template-columns: minmax(0, 1fr) auto; }
    .k-op.is-choice > .k-op-pick { grid-column: 1 / -1; order: 4; }
    .k-op-pick { min-width: 0; max-width: 100%; }
    .k-pbar { bottom: 0.5rem; }
    .k-pbar-state { flex-basis: 100%; }
    .k-pbar .btn-primary { flex: 1; }
}
@media (max-width: 640px) {
    .k-fiche-head .k-head-actions:has(.k-fiche-primary) { width: 100%; }
    .k-fiche-head:has(.k-fiche-primary) { flex-wrap: wrap; }
    .k-fiche-head .k-fiche-primary { flex: 1; }
    .k-facts.is-plain { grid-template-columns: 1fr; }
    .k-history li { grid-template-columns: 1fr; }
    .k-history .k-h-meta { grid-column: 1; }
}
.k-form-page { max-width: 42rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.k-form { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.5rem; scroll-padding-bottom: 5rem; }
.k-field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.k-field[hidden] { display: none; }
.k-label { font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; min-height: 1.5rem; }  /* même hauteur avec ou sans infobulle : champs côte à côte alignés */
.k-label-sub { font-size: 0.8125rem; font-weight: 400; color: hsl(var(--muted-foreground)); }
/* Données affichées sans être modifiables, dans un formulaire (ex. acquisition d'un actif) */
.k-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1rem; margin: 0; padding: 0.75rem 0.875rem; border-radius: 0.5rem; background: hsl(var(--muted) / 0.45); font-size: 0.875rem; }
.k-facts dt { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; }
.k-facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.k-optional { font-weight: 400; color: hsl(var(--muted-foreground)); }
.k-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.k-row3 { display: grid; grid-template-columns: 8rem 1fr 1fr; gap: 1rem; }
.k-row3.k-row3-eq { grid-template-columns: 1fr 1fr 1fr; }
.k-amount-input { position: relative; }
.k-amount-input > span { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.k-amount-input > input::-webkit-outer-spin-button, .k-amount-input > input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.k-amount-input > input { -moz-appearance: textfield; padding-left: 3.25rem; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.k-seg { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.k-seg-opts { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0.25rem; border-radius: var(--radius); background: hsl(var(--muted)); width: fit-content; max-width: 100%; }
.k-seg-opt { position: relative; }
.k-seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.k-seg-opt span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.k-seg-opt input:checked + span { background: hsl(var(--card)); color: hsl(var(--foreground)); font-weight: 500; box-shadow: 0 1px 2px rgba(23,24,27,0.12); }
.k-seg-opt input:focus-visible + span { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.k-receipt-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.k-receipt-btns .btn { cursor: pointer; }
.k-receipt-btns .btn:focus-within { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
#drop-zone.is-drag { border-color: hsl(var(--primary)); background: hsl(var(--selected)); }
.k-photo-btn { display: none; }
.k-files { display: flex; flex-direction: column; gap: 0.375rem; }
.k-files:empty { display: none; }
.k-file { display: flex; align-items: center; gap: 0.75rem; padding: 0.375rem 0.375rem 0.375rem 0.75rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); font-size: 0.875rem; }
.k-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-file-size { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; }
.k-form-error { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: hsl(var(--danger-bg)); border: 1px solid hsl(var(--danger-border)); color: hsl(var(--danger-fg)); font-size: 0.875rem; }
.k-form-error:focus { outline: 2px solid hsl(var(--danger-fg)); outline-offset: 2px; }
.k-more { border-top: 1px solid hsl(var(--border)); padding-top: 1rem; }
.k-more > summary { cursor: pointer; font-size: 0.875rem; color: hsl(var(--link)); width: fit-content; min-height: 1.5rem; }
.k-more-body { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.k-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid hsl(var(--border)); }
@media (max-width: 767px) {
    .k-form { padding: 1rem; }
    .k-row2, .k-row3, .k-row3.k-row3-eq { grid-template-columns: 1fr; }
    .k-photo-btn { display: inline-flex; }
    .k-form-actions { position: sticky; bottom: 0; z-index: 10; margin: 0 -1rem -1rem; padding: 0.75rem 1rem; background: hsl(var(--card)); box-shadow: 0 -4px 12px rgba(23,24,27,0.06); }
    .k-form-actions .k-submit { flex: 1; }
    .k-keyboard .k-form-actions { position: static; box-shadow: none; }
}
@media (pointer: coarse) { .k-photo-btn { display: inline-flex; } }
/* Panneau de la cloche : sur téléphone, toute la largeur (il débordait à gauche) */
@media (max-width: 639px) { .k-bell-panel { position: fixed; left: 0.5rem; right: 0.5rem; top: 3.5rem; width: auto; max-width: none; } }
.k-pills-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.k-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.k-reset { color: hsl(var(--link)); }
.k-reset:hover { text-decoration: underline; }
/* liste déroulante dont une valeur est choisie : visible d'un coup d'œil */
.k-filter-panel select:has(option:checked:not([value=""])) { background-color: hsl(var(--selected)); border-color: hsl(var(--primary) / 0.5); color: hsl(var(--primary)); }
.k-list { overflow-x: auto; }
/* en-têtes : tri (lien) et poignée de largeur (k-list.js) */
.k-th { position: relative; min-width: 0; white-space: nowrap; }
.k-th.is-right { text-align: right; }
.k-sort { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.k-sort:hover, .k-sort.is-active { color: hsl(var(--foreground)); }
.k-sort-ico { width: 0.875rem; height: 0.875rem; flex: none; opacity: 0; }
.k-th.is-right .k-sort-ico { order: -1; }      /* montant : la flèche ne décale pas le titre */
.k-sort:hover .k-sort-ico, .k-sort:focus-visible .k-sort-ico { opacity: 0.6; }
.k-sort.is-active .k-sort-ico { opacity: 1; }
.k-resize { position: absolute; top: -0.5rem; bottom: -0.5rem; right: -1rem; width: 0.75rem; cursor: col-resize; touch-action: none; z-index: 2; }
.k-resize::after { content: ""; position: absolute; left: calc(50% - 1px); top: 0.375rem; bottom: 0.375rem; width: 2px; border-radius: 1px; }
.k-row-head:hover .k-resize::after { background: hsl(var(--border)); }
.k-resize:hover::after, .k-resize.is-drag::after, .k-resize:focus-visible::after { background: hsl(var(--primary)); }
.k-resize:focus-visible { outline: none; }
.k-resize-reset { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; margin: -0.25rem 0 -0.25rem -0.25rem; border-radius: var(--radius-sm); color: hsl(var(--muted-foreground)); }
.k-resize-reset:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.k-resize-reset[hidden] { display: none; }
@media (pointer: coarse) { .k-resize, .k-resize-reset { display: none; } }
.k-row { position: relative; display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 1.25rem; padding: 0.625rem 1.25rem; min-height: 2.75rem; }
.k-row > .k-date { order: -1; }
.k-row > .k-date.k-date-col { order: 0; }
.k-num { text-align: right; font-variant-numeric: tabular-nums; }   /* montant secondaire (ex. Dépensé) */
.k-sm-only { display: none; }   /* date ordinaire (ex. adhésion), pas en tête */   /* ordinateur : date en 1re colonne ; dans le code, le nom vient d'abord (ordre de lecture) */
.k-list > .k-row + .k-row, .k-list > ul > li + li { border-top: 1px solid hsl(var(--border)); }
.k-row-head { min-height: 0; padding-top: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.5); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.k-list li.k-row:hover { background: hsl(var(--muted) / 0.5); }
.k-link { color: hsl(var(--foreground)); font-weight: 500; }
.k-link::after { content: ""; position: absolute; inset: 0; }        /* toute la ligne est cliquable */
.k-link:focus-visible { outline: none; }
.k-link:focus-visible::after { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; border-radius: 2px; }
.k-row a:not(.k-link), .k-row button, .k-row input, .k-row select { position: relative; z-index: 1; }
.k-row > .k-row-act { justify-self: end; }   /* action unique d'une ligne (macro row_action) */
.k-row-act { min-width: 6.5rem; justify-content: center; }   /* même largeur : montants alignés d'une liste à l'autre */
.k-main { min-width: 0; }
.k-l1 { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-l2 { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 0.125rem; }
.k-date { font-size: 0.875rem; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-amount { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.k-amount.is-in { color: hsl(var(--success-fg)); }
.k-state { padding: 0 0.5rem; font-weight: 500; white-space: nowrap; }
.k-end { display: flex; justify-content: flex-start; }
.k-end > :empty { display: none; }   /* emplacements vides (mis à jour en direct) : pas d'écart parasite avant la pastille */
.k-go { width: 1rem; height: 1rem; color: hsl(var(--muted-foreground)); justify-self: end; }
.k-bell-warn { background: hsl(var(--warning-fg)); color: #fff; }
.k-empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2.5rem 1rem; text-align: center; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.k-list .k-pagination { padding: 0.5rem 1.25rem 1rem; border-top: 1px solid hsl(var(--border)); }
@media (max-width: 767px) {
    .k-page { gap: 1rem; }
    .k-head-actions { width: 100%; } .k-head-action { flex: 1; }
    .k-search { width: 100%; }
    .k-sum { white-space: normal; }   /* résumé long : retour à la ligne, jamais coupé */
    .k-pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem; padding: 4px 1rem; scrollbar-width: none; }
    .k-filter-toggle { display: inline-flex; }
    .k-filter-panel { display: none; width: 100%; }
    .k-filter-panel.is-open { display: flex; }
    .k-filter-panel > label, .k-filter-panel > .w-48, .k-filter-panel > .w-56 { width: 100%; }
    .k-pill { min-height: 2.75rem; }
    .k-row-head { display: none; }
    /* mobile : 1) principal | montant  2) date | état */
    .k-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "date state"; row-gap: 0.25rem; padding: 0.75rem 1rem; }
    .k-row > .k-main { grid-area: main; } .k-row > .k-amount { grid-area: amount; align-self: start; line-height: 1.25rem; }
    .k-row > .k-date { grid-area: date; font-size: 0.8125rem; } .k-row > .k-end { grid-area: state; }
    .k-row:not(.has-sel):has(> .k-row-act) { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main amount act" "date state act"; }
    .k-row:not(.has-sel) > .k-row-act { grid-area: act; align-self: center; }
    .k-row > .k-hide-sm, .k-row > .k-go { display: none; }
    .k-sm-only { display: inline; }
    /* ligne avec case de sélection et menu ⋯ (ex. attestations) */
    .k-row.has-sel { grid-template-columns: 1.5rem minmax(0, 1fr) auto 2.25rem; grid-template-areas: "sel main amount menu" "sel state state menu"; column-gap: 0.75rem; }
    .k-row.has-sel > .k-end:empty, .k-row.has-sel > .k-end:not(:has(.badge:not([style*="none"]))) { display: none; }
    .k-row.has-sel > .k-sel { grid-area: sel; align-self: start; padding-top: 0.125rem; }
    .k-row.has-sel > .k-rowmenu { grid-area: menu; align-self: center; }
    .k-row.has-sel > .k-row-act { grid-area: menu; align-self: center; }   /* bouton d'action de ligne (ex. « Ajouter ») */
    .k-row.has-sel:has(> .k-row-act) { grid-template-columns: 1.5rem minmax(0, 1fr) auto auto; }
    .k-row.has-sel .k-l1, .k-row.has-sel .k-l2 { white-space: normal; }   /* nom lisible en entier sur mobile */
    .k-row > .k-num { text-align: left; }
}

/* ── Tom Select overrides ── */
/* 1. Neutralise .select-field on the wrapper (Tom Select copies original classes) */
.ts-wrapper.select-field {
    all: unset !important;
    display: block !important;
    width: 100% !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* 2. Control (the visible input box) */
.ts-wrapper .ts-control {
    border: 1px solid hsl(var(--input)) !important;
    border-radius: var(--radius-sm) !important;   /* comme .input-field (refonte 2026-11-06) */
    background: hsl(var(--card)) !important;      /* était --background : paraissait désactivé */
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    min-height: 2.5rem !important;
    box-shadow: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

@media (max-width: 767px) { .ts-wrapper .ts-control { min-height: 2.75rem !important; font-size: 1rem !important; } }

/* 3. Focus ring */
.ts-wrapper.focus .ts-control {
    outline: none !important;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)) !important;
    border-color: hsl(var(--ring)) !important;
}

/* 4. Search input inside control — aligned with placeholder */
.ts-wrapper .ts-control > input {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    color: hsl(var(--foreground)) !important;
}

/* 5. Placeholder text — hidden when user is typing */
.ts-wrapper .ts-control > .ts-placeholder {
    color: hsl(var(--muted-foreground));
}
.ts-wrapper.input-active .ts-control > .ts-placeholder {
    display: none !important;
}

/* 5b. Selected item — must be clearly visible */
.ts-wrapper .ts-control > .item {
    color: hsl(var(--foreground)) !important;
    background: hsl(var(--accent)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: calc(var(--radius) - 2px) !important;
    padding: 0.2rem 0.6rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

/* 6. Dropdown — fully themed for dark mode */
.ts-wrapper .ts-dropdown {
    border: 1px solid hsl(var(--border)) !important;
    border-radius: var(--radius) !important;
    background: hsl(var(--popover)) !important;
    color: hsl(var(--popover-foreground)) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    font-size: 0.875rem !important;
}
.ts-wrapper .ts-dropdown .ts-dropdown-content {
    background: hsl(var(--popover)) !important;
}
.ts-wrapper .ts-dropdown .option {
    color: hsl(var(--foreground)) !important;
    padding: 0.5rem 0.75rem !important;
}
.ts-wrapper .ts-dropdown .option.active,
.ts-wrapper .ts-dropdown .option:hover {
    background: hsl(var(--accent)) !important;
    color: hsl(var(--accent-foreground)) !important;
}
.ts-wrapper .ts-dropdown .option .highlight {
    background: hsl(var(--primary) / 0.3) !important;
    color: hsl(var(--foreground)) !important;
    border-radius: 2px !important;
}
.ts-wrapper .ts-dropdown .no-results {
    color: hsl(var(--muted-foreground)) !important;
    padding: 0.5rem 0.75rem !important;
}

/* 7. Clear button (✕) — small, subtle */
.ts-wrapper .clear-button {
    color: hsl(var(--muted-foreground)) !important;
    opacity: 0.6;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 2px 6px !important;
    margin-right: 0 !important;
    cursor: pointer !important;
    transition: opacity 0.15s, color 0.15s !important;
    background: none !important;
    border: none !important;
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
}
.ts-wrapper .clear-button:hover {
    opacity: 1;
    color: hsl(var(--destructive)) !important;
}

/* 8. When value is selected — item fills the control, no typing cursor */
.ts-wrapper.ts-has-value .ts-control {
    cursor: default !important;
    padding-right: 32px !important;
}
.ts-wrapper.ts-has-value .ts-control > .item {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 400 !important;
}

/* ── Type RAPPORT (2026-11-07, docs/refonte/GUIDE.md) : sobre — montants neutres et
   tabulaires, hiérarchie par la typographie (groupe → sous-total → total), une seule
   couleur : le résultat final, toujours avec le mot. ── */
.k-rep { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.k-rep caption { text-align: left; padding: 1rem 1.25rem 0.5rem; font-weight: 600; font-size: 0.9375rem; color: hsl(var(--foreground)); }   /* = titre de section des fiches */
.k-rep th, .k-rep td { padding: 0.6875rem 1.25rem; vertical-align: baseline; }   /* lignes ≈ 44 px (GUIDE §3) */
.k-sub { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }   /* texte secondaire des rapports : 13 px partout */
.k-rep .k-col-date { width: 6rem; white-space: nowrap; }
/* onglets d'un rapport : la légende du tableau n'est lue qu'à l'impression (l'onglet la porte à l'écran) */
@media screen { .k-tab-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.k-rep thead th { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); border-bottom: 1px solid hsl(var(--border)); }
.k-rep .num { width: 4.5rem; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-rep th.num { text-align: left; }
.k-rep .k-amt-box { display: inline-block; min-width: 4.5rem; text-align: right; }   /* pastilles « à vérifier » alignées d'une ligne à l'autre */   /* en-tête « N° » aligné sur les numéros */
.k-rep th.amt { text-align: right; }   /* en-têtes de montant alignés sur le bord droit des chiffres */
.k-rep th.amt .k-th-tip { display: inline-flex; align-items: center; gap: .125rem; flex-direction: row-reverse; }   /* ⓘ à gauche du libellé */
.k-rep-stair .num { width: 2.25rem; padding-right: 0; }   /* escalier sans n° de compte : signe près du libellé */
.k-rep-stair caption, .k-rep-stair td, .k-rep-stair th { padding-left: 1.25rem; }
.k-rep .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 9rem; }
.k-rep .amt.prev { color: hsl(var(--muted-foreground)); }
/* signe de calcul de l'escalier : en marge (colonne N°), ou devant le libellé sur mobile */
.k-rep tr > td.num.op { text-align: right; padding-right: .5rem; font-weight: 600; font-size: 1rem; color: hsl(var(--foreground) / .7); }
.k-rep .op-m { display: none; }
.k-rep tbody tr.k-rep-row:hover td { background: hsl(var(--muted) / .6); }
.k-rep .k-rep-group th { padding-top: 1rem; font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); text-align: left; }
.k-rep .k-rep-sub td, .k-rep .k-rep-sub th { font-weight: 600; border-top: 1px solid hsl(var(--border)); text-align: left; }
.k-rep .k-rep-sub td.amt { text-align: right; }
.k-rep .k-rep-total td, .k-rep .k-rep-total th { font-weight: 600; font-size: 0.9375rem; border-top: 3px double hsl(var(--foreground) / .35); padding-top: .75rem; padding-bottom: .75rem; text-align: left; }
.k-rep .k-rep-total td.amt { text-align: right; }
.k-rep .k-rep-step td, .k-rep .k-rep-step th { text-align: left; }
.k-rep .k-rep-step td.amt { text-align: right; }
.k-rep .k-rep-final td, .k-rep .k-rep-final th { font-weight: 700; font-size: 1.125rem; border-top: 3px double hsl(var(--foreground) / .5); padding-top: 1rem; padding-bottom: 1rem; text-align: left; }
.k-rep .k-rep-final td.amt { text-align: right; }
.k-rep-word { display: inline-block; margin-left: .5rem; font-size: .75rem; font-weight: 600; padding: .125rem .5rem; border-radius: 999px; vertical-align: middle; }
.k-rep-word.is-pos { background: hsl(var(--success-bg)); color: hsl(var(--success-fg)); }
.k-rep-word.is-neg { background: hsl(var(--danger-bg)); color: hsl(var(--danger-fg)); }
.k-rep-flag { display: inline-block; margin-right: .5rem; font-size: .75rem; font-weight: 500; padding: 0 .5rem; border-radius: 999px; background: hsl(var(--warning-bg)); color: hsl(var(--warning-fg)); border: 1px solid hsl(var(--warning-bd)); white-space: normal; text-align: left; }
.k-rep-flag .k-tip-btn { color: inherit; font: inherit; }
.k-rep-flag .border-dotted { border-bottom: 0; }   /* pastille : pas de soulignement (demande de Simon) */
@media (pointer: fine) { .k-rep-flag .k-tip-btn { min-width: 0; min-height: 0; margin-left: 0; } }
.k-rep-card { padding: 0; }
/* Page d'entrée des rapports : liste simple, une ligne = un rapport */
.k-hub { padding: 0; }
.k-hub-group { padding: 1rem 1.25rem .25rem; font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); }
.k-hub-row { display: flex; align-items: center; gap: 1rem; min-height: 3.5rem; padding: .75rem 1.25rem; color: inherit; text-decoration: none; transition: background-color 150ms; }
.k-hub-row + .k-hub-row { border-top: 1px solid hsl(var(--border)); }
.k-hub-row:hover, .k-hub-row:focus-visible { background: hsl(var(--muted) / .6); }
.k-hub-row .k-hub-t { font-weight: 500; color: hsl(var(--foreground)); }
.k-hub-row .k-hub-d { font-size: .8125rem; color: hsl(var(--muted-foreground)); margin-top: .125rem; }
.k-hub-row .k-hub-chev { margin-left: auto; color: hsl(var(--muted-foreground)); transition: transform 150ms; flex-shrink: 0; }
.k-hub-row:hover .k-hub-chev { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .k-hub-row:hover .k-hub-chev { transform: none; } }
/* Grand livre : un compte par ligne, dépliable */
.k-gl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.k-gl { padding: 0; }
.k-gl-acc + .k-gl-acc { border-top: 1px solid hsl(var(--border)); }
.k-gl-head { display: grid; grid-template-columns: 1rem 4.5rem minmax(0, 1fr) auto 9rem; align-items: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: .625rem 1.25rem; text-align: left; background: none; border: 0; cursor: pointer; color: inherit; font: inherit; font-size: .875rem; transition: background-color 150ms; }
.k-gl-head:hover { background: hsl(var(--muted) / .6); }
.k-gl-chev { color: hsl(var(--muted-foreground)); align-self: center; transition: transform 200ms; }
.k-gl-chev.is-open { transform: rotate(90deg); }
.k-gl-num { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; font-size: .875rem; }
.k-gl-name { font-weight: 500; min-width: 0; }
.k-gl-count { font-size: .8125rem; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.k-gl-bal { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.k-gl-detail { border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .25); }
.k-gl-table .amt { width: 8rem; }
.k-rep .m-only { display: none; }
@media (prefers-reduced-motion: reduce) { .k-gl-chev { transition: none; } }
@media screen and (max-width: 767px) {
    .k-gl-head { grid-template-columns: 1rem auto minmax(0, 1fr) auto; gap: .5rem; padding: .625rem 1rem; }
    .k-gl-count { display: none; }
    .k-rep .m-hide { display: none; }
    .k-rep .m-only { display: block; }
}
/* Montant cliquable vers le grand livre (bilan, compte de résultat) */
a.k-amt-link { color: inherit; text-decoration: none; border-radius: 3px; }
a.k-amt-link:hover, a.k-amt-link:focus-visible { color: hsl(var(--link)); text-decoration: underline; text-underline-offset: 3px; }
/* Rapport par projet : jauge fine du budget utilisé (décor ; le % est écrit à côté) */
.k-gauge { display: inline-block; width: 4rem; height: .375rem; border-radius: 999px; background: hsl(var(--border)); overflow: hidden; vertical-align: middle; margin-right: .5rem; }
.k-gauge > span { display: block; height: 100%; background: #5B8FC9; border-radius: 999px; transform-origin: left; animation: k-split-in .7s cubic-bezier(.2,.7,.2,1) both; }
.k-gauge.is-high > span { background: hsl(var(--warning-fg)); }
@media (prefers-reduced-motion: reduce) { .k-gauge > span { animation: none; } }
@media print { .k-gauge > span { animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* ── Type TABLEAU DE BORD (2026-11-07) ── */
.k-dash-card { padding: 1rem 1.25rem; }
.k-dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; }
.k-dash-title { font-size: .9375rem; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: .25rem; }
.k-dash-all { font-size: .8125rem; color: hsl(var(--link)); min-height: 2.75rem; display: inline-flex; align-items: center; }
.k-dash-all:hover { text-decoration: underline; }
.k-dash-list { margin: 0 -1.25rem -1rem; }
.k-dash-list > li + li { border-top: 1px solid hsl(var(--border)); }
.k-dash-row { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .5rem 1.25rem; color: inherit; font-size: .875rem; transition: background-color 150ms; }
.k-dash-row:hover, .k-dash-row:focus-visible { background: hsl(var(--muted) / .6); }
.k-dash-date { width: 5.25rem; flex: none; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.k-dash-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-dash-amt { flex: none; font-variant-numeric: tabular-nums; font-weight: 500; }
.k-dash-empty { font-size: .875rem; color: hsl(var(--muted-foreground)); padding: .5rem 0; }
.k-dash-dot { width: .5rem; height: .5rem; border-radius: 999px; background: hsl(var(--warning-fg)); flex: none; }
.k-dash-urgent { color: hsl(var(--warning-fg)); font-weight: 600; }
.k-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; align-items: start; }
.k-dash-figs .k-figs { border: 0; padding: 0; margin: 0; }
.k-fig.is-link { margin: -.5rem; padding: .5rem; border-radius: var(--radius-sm); color: inherit; transition: background-color 150ms; }
.k-fig.is-link:hover, .k-fig.is-link:focus-visible { background: hsl(var(--muted) / .6); }
/* Barres du graphique : décor (aria-hidden) ; les valeurs sont dans le tableau caché et au survol */
.k-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; height: 11rem; align-items: end; padding-top: 1.5rem; }
.k-bars-col { position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: .375rem; }
.k-bars-pair { display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.k-bar { display: block; width: .75rem; height: max(var(--h), 2px); border-radius: 3px 3px 0 0; transform-origin: bottom; animation: k-bar-in .7s cubic-bezier(.2,.7,.2,1) both; }
.k-bar.is-don { background: #00468F; } .k-bar.is-exp, .k-bar-exp-swatch { background: #B7CDE6; }
.k-bars-label { font-size: .75rem; color: hsl(var(--muted-foreground)); }
.k-bars-tip { position: absolute; bottom: calc(100% + .25rem); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .75rem; padding: .25rem .5rem; border-radius: var(--radius-sm); background: hsl(var(--foreground)); color: #fff; opacity: 0; pointer-events: none; transition: opacity 150ms; z-index: 5; }
.k-bars-col:hover .k-bars-tip { opacity: 1; }
.k-bars-legend { display: flex; gap: 1rem; font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.k-bars-legend i { display: inline-block; width: .625rem; height: .625rem; border-radius: 2px; margin-right: .375rem; }
@keyframes k-bar-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .k-bar { animation: none; } }
@media (max-width: 767px) {
    .k-dash-chart { display: none; }   /* graphique : ordinateur seulement (survol inutile au toucher) */
    .k-dash-grid { grid-template-columns: minmax(0, 1fr); }
    .k-dash-recent > li:nth-child(n+4) { display: none; }   /* listes « derniers » : 3 lignes sur téléphone (jamais « À faire ») */
}
@media print { .k-bar { animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.k-rep-side { display: flex; flex-direction: column; }
.k-rep-side > .k-rep-foot { margin-top: auto; }
/* colonnes fixes : numéros, libellés et montants alignés entre le tableau et son total */
.k-rep-side > table { table-layout: fixed; }
.k-rep-side col.c-num { width: 5rem; } .k-rep-side col.c-amt { width: 13rem; }
@media screen and (max-width: 767px) { .k-rep-side > table { table-layout: auto; } .k-rep-side col.c-num, .k-rep-side col.c-amt { width: auto; } }
/* escalier en deux cartes (rapport par projet, lot 4c 09.11) : colonne du signe + montant, comme .k-rep-stair .num / .k-rep .amt */
.k-rep-side > .k-rep-stair col.c-op { width: 2.25rem; } .k-rep-side > .k-rep-stair col.c-amt { width: 9rem; }
@media screen and (max-width: 767px) { .k-rep-side > .k-rep-stair col.c-op, .k-rep-side > .k-rep-stair col.c-amt { width: auto; } }
/* Barre de répartition : décor (aria-hidden), le chiffre est lu dans la légende */
.k-split { padding: .25rem 1.25rem 1rem; }
.k-split-bar { display: flex; height: .5rem; border-radius: 999px; overflow: hidden; background: hsl(var(--muted)); transform-origin: left; animation: k-split-in .7s cubic-bezier(.2,.7,.2,1) both; }
.k-split-bar > span { display: block; height: 100%; }
.k-split-bar > span + span { border-left: 2px solid hsl(var(--card)); }
.k-split-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: .5rem; font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.k-split-legend i { display: inline-block; width: .625rem; height: .625rem; border-radius: 2px; margin-right: .375rem; vertical-align: baseline; }
.k-split-legend b { color: hsl(var(--foreground)); font-weight: 600; font-variant-numeric: tabular-nums; }
.k-c1 { background: #00468F; } .k-c2 { background: #5B8FC9; } .k-c3 { background: #B7CDE6; }
@keyframes k-split-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .k-split-bar { animation: none; } }
@media screen and (max-width: 767px) {
    .k-rep th, .k-rep td { padding: .5rem 1rem; }
    .k-rep .num { display: none; }
    .k-rep .op-m { display: inline-block; width: 1rem; font-weight: 600; color: hsl(var(--foreground) / .7); }
    .k-rep .amt { width: auto; }
}
/* Impression commune (A4) : le rapport seul, sans navigation ni menus */
@media print {
    @page { size: A4; margin: 15mm; }
    #kabaw-topbar, aside, .k-head-actions, .k-print-hide, nav[aria-label] { display: none !important; }
    body, main#contenu { background: #fff !important; overflow: visible !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
    .k-rep tr { break-inside: avoid; }
    .k-split-bar { animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .k-print-only { display: block !important; }
    .k-gl-detail { display: block !important; height: auto !important; overflow: visible !important; }
    .k-rep-tabs .k-tabs { display: none !important; } .k-rep-tabs [role=tabpanel][hidden] { display: block !important; }
    .k-rep .amt { width: 6.5rem; } .k-more-row { display: none !important; } .k-rep [data-pager] > [hidden] { display: table-row !important; }
    .k-gl-acc { display: block !important; break-inside: auto; }
    .k-gl-head { padding: .3rem .6rem; grid-template-columns: 0 4rem minmax(0, 1fr) auto 8rem; } .k-gl-chev { visibility: hidden; } .k-gl-detail { background: none; }
    .k-gl-table .amt { width: 6.5rem; } .k-gl-head { break-after: avoid; }
    a.k-amt-link { text-decoration: none !important; color: inherit !important; }
    /* rapports : plus compact, une page quand c'est possible */
    .k-fiche-page { max-width: none !important; gap: .5rem !important; }
    .k-fiche-head .page-title { font-size: 18pt; }
    .k-rep { font-size: 9pt; }
    .k-rep caption { padding: .4rem .6rem .2rem; font-size: 10.5pt; }
    .k-rep th, .k-rep td { padding: .18rem .6rem; }
    .k-rep .k-rep-group th { padding-top: .45rem; }
    .k-rep .k-rep-total td, .k-rep .k-rep-total th, .k-rep .k-rep-final td, .k-rep .k-rep-final th { padding-top: .35rem; padding-bottom: .35rem; }
    .k-rep .k-rep-final td, .k-rep .k-rep-final th { font-size: 11pt; }
    .k-rep-flag { font-size: 7.5pt; padding: 0 .35rem; }
    .k-rep-flag i, .k-rep-flag svg, .k-rep .tooltip-host [role="tooltip"], .k-rep-final .k-tip-btn, .k-rep-group .k-tip-btn { display: none !important; }
    .k-split { padding: .1rem .6rem .4rem; }
    .k-rep-grid { grid-template-columns: 1fr 1fr !important; gap: .75rem !important; }
    .k-rep-side col.c-num { width: 3.5rem; } .k-rep-side col.c-amt { width: 11.5rem; }
    .sandbox-banner, [data-sandbox-banner] { display: none !important; }
}
.k-print-only { display: none; }
/* Mention imprimée à la place du bandeau pré-production / bac à sable (lot 5) : discrète, en haut à droite */
.k-sandbox-print-mark { font-size: 8pt; color: #555; text-align: right; margin: 0 0 .25rem; }

/* x-cloak rule is in a dedicated <style> tag above, before scripts */

/* Field-level validation error */
.input-field.is-invalid:focus, .select-field.is-invalid:focus, .textarea-field.is-invalid:focus {
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--destructive) / 0.4);
}

/* Submitting state */
.btn-submitting { position: relative; pointer-events: none; opacity: 0.7; }
.btn-submitting::after {
    content: '';
    position: absolute;
    width: 1rem; height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes notif-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    40% { transform: scale(1.25); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.notif-badge-pulse {
    animation: notif-pulse 1.5s ease-in-out infinite;
}

/* ── Type PAGE AUTONOME (base_auth.html, 2026-11-07) : carte centrée sur le papier ── */
.k-auth { min-height: 100vh; background: hsl(var(--background)); display: flex; flex-direction: column; }
.k-auth-sandbox { background: #dc2626; color: #fff; font-weight: 700; text-align: center; padding: .5rem 1rem; font-size: .875rem; }
.k-auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1rem; gap: 1.5rem; }
.k-auth-logo { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 2rem; letter-spacing: -0.01em; color: hsl(var(--primary)); text-decoration: none; }
.k-auth-logo span { color: #E8930C; }
.k-auth-card { width: 100%; max-width: 24rem; padding: 2rem 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; }
.k-auth-card h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.5rem; line-height: 1.2; color: hsl(var(--foreground)); }
.k-auth-lead { font-size: .875rem; color: hsl(var(--muted-foreground)); margin-top: .375rem; }
.k-auth-form { display: flex; flex-direction: column; gap: 1rem; }
.k-auth-field { display: flex; flex-direction: column; gap: .375rem; }
.k-auth-field label { font-size: .875rem; font-weight: 500; color: hsl(var(--foreground)); }
.k-auth-row { display: flex; justify-content: flex-end; margin-top: -.25rem; }
.k-auth-link { font-size: .875rem; color: hsl(var(--link)); }
.k-auth-link:hover { text-decoration: underline; }
.k-auth-card .btn-primary { width: 100%; min-height: 2.75rem; }
.k-auth-card .btn-primary:disabled { opacity: .6; }
/* Connexion par Touch ID (12.11.2026) : filet « ou » puis bouton secondaire pleine largeur */
.k-auth-or { display: flex; align-items: center; gap: .75rem; font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.k-auth-or::before, .k-auth-or::after { content: ""; flex: 1; border-top: 1px solid hsl(var(--border)); }
.k-auth-card .k-auth-passkey { width: 100%; min-height: 2.75rem; }
#pk-login-block[hidden], .k-notice[hidden], .k-passkey-add[hidden] { display: none; }
.k-passkeys { display: flex; flex-direction: column; }
/* Codes de secours (12.11.2026) : 2 colonnes, police à chasse fixe, faciles à recopier */
.k-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1.5rem; margin: 0.25rem 0; }
.k-recovery-codes code { font-size: 1rem; letter-spacing: 0.05em; user-select: all; }
.k-passkeys li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid hsl(var(--border)); }
.k-passkeys li:last-child { border-bottom: 0; }
.k-passkeys li .grow { display: flex; flex-direction: column; min-width: 0; }
.k-auth-back { text-align: center; }
.k-auth-hint { font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.k-auth-facts { font-size: .875rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); padding: .75rem 1rem; display: flex; flex-direction: column; gap: .25rem; background: hsl(var(--muted) / .4); }
.k-auth-facts span { color: hsl(var(--muted-foreground)); }
.k-auth-code { text-align: center; font-size: 1.5rem; letter-spacing: .5em; font-variant-numeric: tabular-nums; }
.k-auth-status { font-size: .8125rem; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.k-auth-foot { font-size: .75rem; color: hsl(var(--muted-foreground)); }
@media (max-width: 480px) { .k-auth-card { padding: 1.5rem 1.25rem; border-left: 0; border-right: 0; border-radius: 0; } .k-auth-main { padding: 1.5rem 0; } }

/* ── Type PARAMÈTRES (settings.html, 2026-11-07) : un formulaire, onglets, panneaux ── */
.k-settings-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.k-settings-panel[hidden], .k-settings-lang[hidden] { display: none; }
.k-settings-group { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid hsl(var(--border)); }
.k-settings-panel > .k-sub + .k-settings-group, .k-settings-panel > .k-settings-group:first-child { padding-top: 0; border-top: 0; }
.k-settings-lang { display: flex; flex-direction: column; gap: 1rem; }
.k-sub-title { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }
.k-checkline { display: inline-flex; align-items: center; gap: 0.625rem; min-height: 2.5rem; font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); cursor: pointer; }
.k-tab-dot { width: 0.4375rem; height: 0.4375rem; border-radius: 999px; background: #E8930C; }
.k-custom-dot { color: #C77800; font-weight: 700; }
.k-tpl-link { align-self: flex-start; font-size: 0.8125rem; color: hsl(var(--link)); min-height: 1.5rem; }
.k-tpl-link:hover { text-decoration: underline; }
[data-default]:has(:placeholder-shown) .k-tpl-link.is-reset, [data-default]:not(:has(:placeholder-shown)) .k-tpl-link.is-copy { display: none; }
.k-smtp-test { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.k-ok { color: hsl(var(--success-fg, 158 58% 30%)); font-weight: 500; }
.k-ko { color: hsl(var(--danger-fg)); font-weight: 500; }
.k-settings .k-facts dt { display: inline-flex; align-items: center; gap: 0.25rem; }
@media (max-width: 480px) { .k-settings .k-tab { padding: 0 0.625rem; } }

/* Fenêtre de saisie du site (ex. inviter un utilisateur) : carte centrée, même champs que SAISIE */
.k-dialog { width: min(36rem, calc(100vw - 2rem)); padding: 0; border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(23,24,27,0.18); }
.k-dialog::backdrop { background: rgba(23,24,27,0.45); }
.k-dialog > .k-form { padding: 1.5rem; }
.k-check-list { display: flex; flex-direction: column; gap: 0.125rem; max-height: 12rem; overflow-y: auto; }
button.k-menu-item { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; }
.k-cell { font-size: 0.875rem; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* cellule de texte d'une liste, sans place imposée (contrairement à .k-date) */

/* Mon profil / Sécurité (2026-11-07) : formulaire dans une carte, carte repliable, QR */
.k-form-inline { display: flex; flex-direction: column; gap: 1rem; }
.k-more-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.k-more-card > summary::-webkit-details-marker { display: none; }
.k-more-card > summary::before { content: "›"; display: inline-block; transition: transform .15s; color: hsl(var(--muted-foreground)); }
.k-more-card[open] > summary::before { transform: rotate(90deg); }
.k-qr { display: flex; } .k-qr img { background: #fff; padding: 0.5rem; border-radius: var(--radius-sm); border: 1px solid hsl(var(--border)); }
@media (prefers-reduced-motion: reduce) { .k-more-card > summary::before { transition: none; } }
.k-secret { display: block; padding: 0.75rem 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); background: hsl(var(--muted) / 0.5); font-size: 0.8125rem; word-break: break-all; }
/* Liste simple dans une carte (maintenance, sauvegardes…) : lignes séparées par un filet */
.k-plain-list { display: flex; flex-direction: column; }
.k-plain-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0; min-height: 2.75rem; }
.k-plain-row + .k-plain-row { border-top: 1px solid hsl(var(--border)); }

/* Matrice des rôles (roles.html, 2026-11-07) : tableau accessible, une section par groupe */
.k-roles-card { padding: 0; overflow: hidden; }
.k-roles-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.k-roles-table caption { text-align: left; padding: 1rem 1.25rem 0.5rem; }
.k-roles-table th, .k-roles-table td { padding: 0.5rem 0.75rem; border-top: 1px solid hsl(var(--border)); text-align: center; }
.k-roles-table thead th { font-size: 0.75rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.k-roles-table .k-roles-perm { text-align: left; font-weight: 400; color: hsl(var(--foreground)); padding-left: 1.25rem; width: 34%; }
.k-roles-table thead .k-roles-perm { color: hsl(var(--muted-foreground)); }
.k-roles-table tbody tr:hover { background: hsl(var(--muted) / 0.35); }
.k-roles-table .k-check:disabled { opacity: 0.55; cursor: not-allowed; }
.k-roles-pick { display: flex; flex-direction: column; gap: 0.375rem; max-width: 20rem; }
@media (max-width: 767px) { .k-roles-table .k-roles-perm { width: 75%; padding-left: 1rem; } .k-roles-table caption { padding: 0.875rem 1rem 0.5rem; } }
.k-plain-row { position: relative; }   /* borne toute zone cliquable d'une ligne (.k-link::after) à la ligne */

/* Barre de navigation du bas, téléphone seulement (2026-11-07, components/_bottom_nav.html).
   Dans le flux de la colonne principale : <main> se raccourcit, rien n'est recouvert. */
.k-tabbar { display: none; }
@media screen and (max-width: 767px) {
    .k-tabbar { display: flex; flex-shrink: 0; align-items: stretch; border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 0 0.25rem env(safe-area-inset-bottom, 0px); }
    .k-tabbar .k-tab { flex: 1 1 0; min-width: 0; min-height: 3.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1875rem; padding: 0.375rem 0.25rem; background: none; border: 0; cursor: pointer; color: hsl(var(--muted-foreground)); font-size: 0.6875rem; line-height: 1rem; font-weight: 500; text-decoration: none; -webkit-tap-highlight-color: transparent; }
    .k-tabbar .k-tab svg { width: 1.25rem; height: 1.25rem; flex: none; }
    .k-tabbar .k-tab > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .k-tabbar .k-tab[aria-current="page"] { color: hsl(var(--primary)); font-weight: 600; }
    .k-tabbar .k-tab[aria-current="page"] > span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
    .k-tabbar .k-tab:focus-visible { outline: 2px solid hsl(var(--ring, var(--primary))); outline-offset: -4px; border-radius: var(--radius-sm); }
    .k-tab-plus { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 9999px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: 0 2px 6px rgba(0,86,179,0.25); }
    .k-tab-plus svg { width: 1.375rem; height: 1.375rem; }
    .k-tab-new[aria-current="page"] .k-tab-plus { box-shadow: 0 0 0 3px hsl(var(--primary) / 0.25); }
    .k-keyboard .k-tabbar, .kabaw-embedded .k-tabbar { display: none; }
}
@media print { .k-tabbar { display: none !important; } }

/* ── Type CONFIRMATION (2026-11-07, lot 2) : suppression d'une dépense, annulation d'une
   cotisation, clôture d'un exercice. Page FICHE (56rem) : question, conséquence (bandeau rouge),
   récapitulatif, champs exigés, Retour + bouton rouge. Rien de fixé en bas (barre du téléphone). */
.k-confirm .k-confirm-word { max-width: 20rem; letter-spacing: 0.04em; }
.k-confirm .k-field:has(textarea:required) .k-optional { display: none; }   /* motif rendu obligatoire (événement réel) */
.k-confirm .k-checks { margin: 0; padding: 0; list-style: none; }
.k-confirm .k-check-row { align-items: flex-start; font-size: 0.875rem; }
.k-confirm .k-check-row .link { display: inline-block; margin-top: 0.25rem; }
.k-confirm .k-check-ok { flex: none; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.k-confirm .k-section > .k-more { margin-top: 0.75rem; }
.k-confirm .k-section > .k-checks + .k-more { border-top: 1px solid hsl(var(--border)); }
.k-confirm .k-confirm-tables { margin: 0.75rem -1.25rem -1rem; overflow-x: auto; }
.k-confirm .k-confirm-tables .k-rep caption { padding-top: 0.75rem; font-size: 0.875rem; }
.k-confirm .k-more .k-confirm-tables { margin-bottom: 0; }
.k-confirm .k-confirm-foot { padding: 0 1.25rem 1rem; }
.k-confirm .k-confirm-next { display: flex; flex-direction: column; gap: 1rem; }
.k-confirm .k-check-label { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; min-height: 1.5rem; cursor: pointer; width: fit-content; }
@media (max-width: 767px) {
    .k-confirm .k-check-label { min-height: 2.75rem; }
    .k-confirm .k-confirm-word { max-width: none; }
}
.k-confirm > .k-form { padding: 1.25rem; }   /* aligné sur la carte du récapitulatif */
@media (max-width: 767px) { .k-confirm > .k-form .k-form-actions { margin: 0 -1.25rem -1.25rem; padding: 0.75rem 1.25rem; } }

/* ── Lot 3 (2026-11-07) : listes comptables et journaux (journal, plan comptable, audit,
   connexions, e-mails). Variante accordéon du type LISTE : la ligne fermée suit le modèle
   (.k-row) ; son titre est un vrai bouton étiré sur la ligne (comme .k-link) ; le détail
   s'ouvre DANS la ligne, sur toute la largeur, au-dessus du bouton étiré. */
.k-row button.k-link { position: static; display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.k-acc-chev { transition: transform 200ms; }
.k-acc-item.is-open > .k-acc-chev { transform: rotate(90deg); }
.k-list li.k-acc-item.is-open:hover { background: none; }
.k-list li.k-acc-item.is-open > .k-main .k-link { color: hsl(var(--primary)); }
.k-acc-detail { order: 10; grid-column: 1 / -1; position: relative; z-index: 1; margin: 0.625rem -1.25rem -0.625rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.25); cursor: auto; }
.k-acc-detail .k-rep { background: transparent; }
.k-acc-meta { margin: 0; padding: 0.75rem 1.25rem 0; list-style: none; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.k-acc-meta:last-child { padding-bottom: 0.75rem; }
.k-acc-meta > div { display: flex; gap: 0.5rem; min-width: 0; }
.k-acc-meta dt { flex: none; min-width: 7rem; }
.k-acc-meta dd { margin: 0; min-width: 0; color: hsl(var(--foreground)); }
.k-au-val { overflow-wrap: anywhere; }
.k-au-key { color: hsl(var(--muted-foreground)); white-space: nowrap; width: 1%; }
.k-je-table .amt { width: 8rem; }
/* plan comptable : comptes d'une classe, alignés sur les colonnes de la liste */
.k-acc-rows { margin: 0; padding: 0; list-style: none; }
.k-acc-line { display: grid; grid-template-columns: var(--cols); column-gap: 1.25rem; align-items: center; min-height: 2.75rem; padding: 0.375rem 1.25rem; font-size: 0.875rem; }
.k-acc-line + .k-acc-line { border-top: 1px solid hsl(var(--border)); }
.k-acc-name { min-width: 0; }
.k-acc-num { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-acc-type { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
/* filtre de période des journaux : libellé court visible + champ date */
.k-date-filter { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.k-date-filter > .input-field { width: 9.5rem; }
/* e-mail non arrivé : pourquoi, replié sous la ligne */
.k-email-why { margin-top: 0.25rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); position: relative; z-index: 1; }
.k-email-why > summary { cursor: pointer; width: fit-content; color: hsl(var(--link)); }
.k-email-why > p { margin-top: 0.25rem; white-space: normal; }
@media (prefers-reduced-motion: reduce) { .k-acc-chev { transition: none; } }
@media (max-width: 767px) {
    .k-acc-detail { margin: 0.5rem -1rem -0.75rem; }
    .k-acc-meta { padding-left: 1rem; padding-right: 1rem; }
    .k-acc-meta > div { flex-direction: column; gap: 0; }
    .k-acc-detail .k-rep th, .k-acc-detail .k-rep td { padding-left: 1rem; padding-right: 0.5rem; }
    .k-acc-detail .k-rep th:last-child, .k-acc-detail .k-rep td:last-child { padding-right: 1rem; }
    .k-je-table .amt { width: auto; }
    .k-acc-line { grid-template-columns: minmax(0, 1fr) auto; padding: 0.5rem 1rem; }
    .k-date-filter { width: 100%; }
    .k-date-filter > .input-field { flex: 1; width: auto; }
}
.k-email-why > summary { list-style: none; }
.k-email-why > summary::-webkit-details-marker { display: none; }
@media (max-width: 767px) { .k-acc-item > .k-main .k-l2 { white-space: normal; } }   /* plan comptable : sous-titre de classe lisible en entier */
/* ── Lot 4 (2026-11-07) : ordres de paiement, cotisations, choix « erreur / événement réel » ── */
/* ligne avec case à cocher : la case reste en 1re colonne, avant la date (ordinateur) */
.k-row.has-sel > .k-sel { order: -2; }
/* aperçu calculé d'un formulaire : avertissement calme sous la liste de définitions */
.k-field-warn { font-size: 0.8125rem; color: hsl(var(--warning-fg)); }
.k-field-warn[hidden] { display: none; }
/* case à cocher avec libellé (formulaires) — même allure que dans les pages de confirmation */
.k-check-label { display: inline-flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; min-height: 1.5rem; cursor: pointer; width: fit-content; max-width: 100%; }
.k-check-label > .k-check { flex: none; margin-top: 0.0625rem; }
/* choix « erreur / événement réel » (components/_cancel_mode_fields.html) */
.k-cancel-mode .k-seg-opt span { white-space: normal; padding-top: 0.375rem; padding-bottom: 0.375rem; }
.k-cancel-mode .k-seg-opt { flex: 1 1 auto; }   /* fenêtre étroite : les deux choix passent l'un sous l'autre, pleine largeur */
.k-cancel-mode .k-seg-opt span { width: 100%; justify-content: center; text-align: center; }
/* Dans une fenêtre <dialog>, flatpickr ne s'applique pas (base.html) : la date native doit rester
   lisible (sinon transparente, cf. règle du haut de ce fichier) et garder son calendrier */
dialog input[type="date"] { color: hsl(var(--foreground)) !important; }
dialog input[type="date"]::-webkit-calendar-picker-indicator { display: block; }
.k-seg-hint { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); margin: 0.125rem 0 0; }
.k-seg-hint[hidden] { display: none; }
@media (max-width: 767px) {
    /* case de sélection sans menu ⋯ (ex. ordres de paiement) : pas de colonne vide à droite */
    .k-row.has-sel:not(:has(> .k-rowmenu, > .k-row-act)) { grid-template-columns: 1.5rem minmax(0, 1fr) auto; grid-template-areas: "sel main amount" "sel state state"; }
    /* ligne sans case avec menu ⋯ (ex. cotisations) : le menu à droite, sur les deux lignes */
    .k-row:not(.has-sel):has(> .k-rowmenu) { grid-template-columns: minmax(0, 1fr) auto 2.25rem; grid-template-areas: "main amount menu" "date state menu"; }
    .k-row:not(.has-sel) > .k-rowmenu { grid-area: menu; align-self: center; }
    .k-check-label { min-height: 2.75rem; padding-top: 0.625rem; }
    .k-cancel-mode .k-seg-opts { flex-direction: column; width: 100%; }
    .k-cancel-mode .k-seg-opt span { min-height: 2.75rem; }
}

/* ── Lot 5 (2026-11-07) : portail des membres, fenêtre d'annulation défilante ── */
/* Tableau de bord du membre : une demande sur deux lignes (objet, puis l'état en clair) */
.k-dash-main.is-2l { white-space: normal; }
.k-dash-main.is-2l > .k-dash-l2 { display: block; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-dash-row:has(.is-2l) > .k-dash-date, .k-dash-row:has(.is-2l) > .k-dash-amt { align-self: flex-start; line-height: 1.25rem; }
/* Fenêtre <dialog> plus haute que l'écran (annulation d'un don / d'une dépense) : le contenu
   défile dans la fenêtre, la barre d'actions reste visible en bas. */
.k-sheet { width: min(28rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(23,24,27,0.18); overflow: hidden; }
.k-sheet[open] { display: flex; flex-direction: column; }
.k-sheet::backdrop { background: rgba(23,24,27,0.45); }
.k-sheet-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.k-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.5rem; }
.k-sheet-actions { flex: none; display: flex; gap: 0.5rem; padding: 0.75rem 1.5rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
@media (max-width: 767px) {
    .k-sheet-body { padding: 1rem; }
    .k-sheet-actions { padding: 0.75rem 1rem; }
    .k-sheet-actions .btn { min-height: 2.75rem; }
}

/* ── Lot 6 (2026-11-07) : aperçus d'import « groupes par état » (modèle : aperçu Wise) ── */
/* Une opération = 2 niveaux : ① date · nom · montant ; ② champs étiquetés. Règles communes
   aux 4 aperçus (Wise, Raiffeisen, Revolut, RaiseNow) ; avant : dans wise_preview.html. */
.k-wl { display: grid; grid-template-columns: auto 5.25rem minmax(0, 1fr) auto; column-gap: 1rem; row-gap: .625rem; align-items: baseline; padding: .875rem 1.25rem; }
.k-wl + .k-wl { border-top: 1px solid hsl(var(--border)); }
.k-wl-list { list-style: none; padding: 0; margin: 0 -1.25rem; }
.k-wl-chk { grid-column: 1; grid-row: 1; display: none; }
.bulk-on .k-wl-chk, .k-wl.has-chk > .k-wl-chk { display: block; }
.k-wl-date { grid-column: 2; grid-row: 1; }
.k-wl-who { grid-column: 3; grid-row: 1; min-width: 0; }
.k-wl-amt { grid-column: 4; grid-row: 1; text-align: right; }
.k-wl-q { grid-column: 3 / -1; font-size: .875rem; color: hsl(var(--foreground)); margin: 0; }
.k-wl-fields { grid-column: 3 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.k-wl-fields > .label-cell { grid-column: 1 / -1; }
.k-wf-l { display: block; font-size: .75rem; color: hsl(var(--muted-foreground)); margin-bottom: .25rem; }
.k-wl .select-field { height: 2.5rem; font-size: .875rem; }
.k-wl .ro-cell { display: block; padding-top: .5rem; font-size: .875rem; color: hsl(var(--muted-foreground)); }
.k-ok { color: hsl(var(--success, 152 58% 39%)); font-weight: 600; margin-right: .375rem; }
.todo-item.is-later .k-wl-who, .todo-item.is-later .k-wl-amt { opacity: .6; }
.k-wl.is-off > :not(.k-wl-chk) { opacity: .55; }
.k-wl-sub { font-size: .75rem; color: hsl(var(--muted-foreground)); display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-top: .125rem; }
.k-wl-amt small { display: block; font-size: .75rem; font-weight: 400; color: hsl(var(--muted-foreground)); }
.k-nothing-sum { font-size: .875rem; color: hsl(var(--muted-foreground)); margin: .25rem 0 0; font-weight: 400; }
details[open] .k-nothing-sum { display: none; }
/* « Tout sélectionner » d'une section (cases « importer » des aperçus Raiffeisen / RaiseNow) */
.k-wl-all { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 400; color: hsl(var(--muted-foreground)); cursor: pointer; }
.k-wl-allrow { padding: .5rem 1.25rem; margin: 0 -1.25rem; border-bottom: 1px solid hsl(var(--border)); }
@media (max-width: 767px) {
    .k-wl { grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; padding: .875rem 1rem; }
    .k-wl-who { grid-column: 1; grid-row: 1; }
    .k-wl-amt { grid-column: 2; grid-row: 1; }
    .k-wl-date { grid-column: 1; grid-row: 2; font-size: .75rem; margin-top: -.5rem; }
    .k-wl-q, .k-wl-fields { grid-column: 1 / -1; }
    .k-wl-fields { grid-template-columns: minmax(0, 1fr); }
    .k-wl .select-field { height: 2.75rem; font-size: 1rem; }
    /* ligne avec case : la case à gauche sur deux lignes */
    .k-wl.has-chk { grid-template-columns: 1.5rem minmax(0, 1fr) auto; }
    .k-wl.has-chk > .k-wl-chk { grid-column: 1; grid-row: 1 / 3; padding-top: .125rem; }
    .k-wl.has-chk > .k-wl-who { grid-column: 2; }
    .k-wl.has-chk > .k-wl-amt { grid-column: 3; }
    .k-wl.has-chk > .k-wl-date { grid-column: 2; }
    .k-wl.has-chk > .k-wl-q, .k-wl.has-chk > .k-wl-fields { grid-column: 2 / -1; }
    .k-wl-allrow { padding: .625rem 1rem; }
    .k-wl-all { min-height: 2.75rem; }
}
.k-wf-wide { grid-column: span 2; }
.k-wf-full { grid-column: 1 / -1; }
.k-wl .ro-cell.is-flush { padding-top: 0; }
@media (max-width: 767px) { .k-wf-wide { grid-column: auto; } }

/* Masquage par l'attribut hidden (et non x-show) pour tout ce qui porte un id dans une liste
   remplacée par htmx : au remplacement, htmx rétablit l'attribut style des éléments de même id
   et effaçait le display:none d'Alpine (2026-11-07 : journal entièrement déplié, infobulle
   restée ouverte après un clic sur une pastille). */
.k-acc-detail[hidden], [role=tooltip][hidden] { display: none !important; }
.k-row2[hidden], .k-row3[hidden] { display: none; }
/* Résumé d'en-tête : l'infobulle ⓘ ne laisse pas de vide avant le « · » suivant (2026-11-08) */
@media (pointer: fine) { .k-summary .k-tip-btn { min-width: 1.125rem; } }
/* Nom et pays d'un projet par langue (2026-11-08) : choix court puis les champs de la langue */
.k-tr { display: flex; flex-direction: column; gap: 1.25rem; }
.k-tr-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.k-tr-panel[hidden] { display: none; }

/* 2026-11-08 — Aperçu Raiffeisen : « n à compléter » dans la barre du bas mène à la première
   ligne cochée sans réponse (le bouton Importer reste désactivé tant qu'il en reste). Même
   texte et même graisse que le compteur Wise, souligné parce qu'il est cliquable. */
.k-pbar-todo { font: inherit; font-weight: 500; color: hsl(var(--foreground)); background: none; border: 0; padding: 0.125rem 0; min-height: 24px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.k-pbar-todo:hover { color: hsl(var(--primary)); }
@media (max-width: 767px) { .k-pbar-todo { min-height: 44px; } }

/* Groupe de cases EN LIGNE (2026-11-08) : même composant que users.html (fieldset · k-check-list ·
   k-checkline), pour un choix multiple court (« Membres concernés » dans Nouvelles cotisations). */
.k-check-list.is-inline { flex-direction: row; flex-wrap: wrap; column-gap: 1.5rem; row-gap: 0; max-height: none; overflow: visible; }

/* Onglets des fiches (2026-11-08) : une section rechargée par htmx À L'INTÉRIEUR d'un panneau
   (articles d'un don en nature) se comporte comme un panneau sans titre : la liste remplit la carte. */
[role=tabpanel] .k-section > .k-list:first-child { margin-top: -1rem; border-top: 0; border-radius: var(--radius); }
[role=tabpanel] .k-section > .k-list:first-child > ul > li:first-child { border-top: 0; }

/* Revue du 08.11 — téléphone :
   - panneau de la cloche : la règle « fixed » (plus haut) était écrasée par les utilitaires Tailwind
     d'app.css chargé après (absolute, right-0, w-80, mt-2) → panneau coupé à droite. Sélecteur
     plus précis (élément + classe) ;
   - tâches « À faire » du tableau de bord : le texte passe à la ligne au lieu d'être coupé. */
@media (max-width: 639px) {
    div.k-bell-panel { position: fixed; left: 0.5rem; right: 0.5rem; top: 3.5rem; width: auto; max-width: none; margin-top: 0; }
}
.k-dash-todo .k-dash-main { white-space: normal; overflow: visible; text-overflow: clip; }

/* Ordres de paiement : ligne visée depuis la fiche (« Payer par virement », 08.11) */
.k-row:target { background: hsl(var(--selected)); box-shadow: inset 3px 0 0 hsl(var(--primary)); }

/* Ordres de paiement : carte de l'export Raiffeisen (action unique, 08.11) */
.k-export-card { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 1rem 1.25rem; margin-bottom: 1rem; }

/* ── Aide de la page (pilote du 11.11.2026) : panneau à droite, ouvert par le « ? » de l'en-tête ──
   Aéré (demande de Simon) : marges larges, rubriques séparées par un filet et un grand espace,
   lignes plus hautes, puces espacées. */
.k-help { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(30rem, 100vw); max-width: 100vw;
          padding: 0; border: 0; border-left: 1px solid hsl(var(--border)); background: hsl(var(--card));
          color: hsl(var(--foreground)); box-shadow: -12px 0 32px rgba(23,24,27,0.14); }
.k-help[open] { display: flex; flex-direction: column; animation: k-help-in .18s ease-out; }
.k-help::backdrop { background: rgba(23,24,27,0.25); }
@keyframes k-help-in { from { transform: translateX(1.5rem); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .k-help[open] { animation: none; } }
.k-help-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
               padding: 1rem 1.25rem 1rem 2rem; border-bottom: 1px solid hsl(var(--border)); }
.k-help-title { display: flex; align-items: center; gap: .5rem; font-size: 1.0625rem; font-weight: 600; margin: 0; }
.k-help-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2rem 2rem 3rem;
               font-size: .9375rem; line-height: 1.75; }
.k-help-body h3 { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
                  color: hsl(var(--muted-foreground)); margin: 2.25rem 0 .875rem; padding-top: 2rem;
                  border-top: 1px solid hsl(var(--border)); }
.k-help-body h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* Icône de rubrique (11.11, demande de Simon) : petite, couleur de la charte, pas de fond */
.k-help-body h3 { display: flex; align-items: center; gap: .5rem; }
.k-help-body h3 svg { width: 1rem; height: 1rem; flex: none; color: hsl(var(--primary)); stroke-width: 2; }
.k-help-body p { margin: 0 0 1rem; }
.k-help-body ul { margin: 0 0 1rem; padding-left: 1.25rem; list-style: disc; }
.k-help-body li { margin: 0 0 1rem; padding-left: .25rem; }
.k-help-body li:last-child { margin-bottom: 0; }
.k-help-body li::marker { color: hsl(var(--muted-foreground)); }
.k-help-body strong { font-weight: 600; }
@media (max-width: 767px) { .k-help-head { padding-left: 1.25rem; } .k-help-body { padding: 1.5rem 1.25rem 2.5rem; } }

/* ── Règle « fiche » (11.11.2026, pilote fiche Donateur) : ajout sur la ligne des onglets ── */
.k-tabs-bar { display: flex; align-items: flex-end; gap: 1rem; border-bottom: 1px solid hsl(var(--border)); }
.k-tabs-bar > .k-tabs { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
.k-tabs-actions { flex: none; display: flex; align-items: center; padding-bottom: .375rem; }
@media (max-width: 639px) {
    .k-tabs-bar { flex-direction: column; align-items: stretch; gap: .5rem; border-bottom: 0; }
    .k-tabs-bar > .k-tabs { border-bottom: 1px solid hsl(var(--border)); }
    .k-tabs-actions { justify-content: flex-end; padding-bottom: 0; order: 2; }
}
.k-empty-row { margin: 0; padding: .875rem 1.25rem; font-size: .875rem; color: hsl(var(--muted-foreground)); }
/* Règle « fiche » appliquée partout (11.11) : état vide et historique alignés sur les lignes de liste */
.k-section[role=tabpanel] > .k-empty-row:first-child { margin: -1rem -1.25rem; }
.k-section[role=tabpanel] .k-history { margin: -1rem -1.25rem; }
.k-section[role=tabpanel] .k-history li { grid-template-columns: 6rem minmax(0, 1fr); column-gap: 1.25rem; padding: .625rem 1.25rem; }
.k-section[role=tabpanel] .k-history li:first-child { border-top: 0; }
@media (max-width: 639px) { .k-section[role=tabpanel] .k-history li { grid-template-columns: 1fr; } }
.k-tab-slot, .k-tab-slot-inner { display: inline-flex; align-items: center; gap: .5rem; }
.k-tab-slot[hidden], .k-tab-slot-inner[style*="display: none"] { display: none; }
.k-section > .k-empty-row { margin: -1rem -1.25rem; }
