/* AGO — styles PROPRES AU MODULE.
 * La charte (tokens, base, fenêtre, navigation, primitives) vient de
 * shared/charte.css, chargée avant ce fichier. Ne pas y redéfinir les tokens.
 */

/* KARBON-BOX AGO — Charte graphique macOS
 * Source : maquette AGO-Bilans-macOS. Tout est piloté par les tokens ci-dessous :
 * les alias historiques (--wiki-*, --indigo-*) sont conservés et remappés, pour que
 * les règles existantes héritent de la charte sans réécriture.
 */

a { color: var(--wiki-link); text-decoration: none; }
a:hover { text-decoration: none; color: var(--wiki-link-hover); }
svg { display: inline-block; vertical-align: middle; }

@media (max-width: 900px) {
  .kb-window { margin: 0; border-radius: 0; min-height: 100vh; }
}

/* ===== MEGA HEADER — charte LM (blanc épuré, sticky) ===== */
.kb-mega-header {
  background: var(--kb-surface);
  border-bottom: 1px solid var(--kb-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky; top: 0; z-index: 100;
  color: var(--kb-text);
}
.mega-row {
  padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
}
.mega-row-top {
  min-height: 44px;
  padding-top: 6px; padding-bottom: 6px;
  border-bottom: 1px solid var(--kb-border);
  justify-content: space-between;
}
.mega-row-bottom {
  min-height: 40px;
  padding-top: 6px; padding-bottom: 6px;
  flex-wrap: wrap;
  background: var(--kb-toolbar);
  font-size: 12px; color: var(--kb-muted);
}
.mega-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.mega-right { display: flex; align-items: center; gap: 12px; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo:hover { text-decoration: none; }
.logo-img {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-primary-dark));
  color: white; display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
}
.logo-text {
  font-size: 14px; font-weight: 800; color: var(--kb-text);
  letter-spacing: 0.3px; line-height: 1.1;
}
.logo-text small {
  display: block; font-size: 9px; color: var(--kb-muted);
  font-weight: 600; letter-spacing: 0.5px; margin-top: 2px;
}

.section-divider {
  color: var(--kb-muted); font-size: 16px; font-weight: 300;
}
.section-title {
  font-size: 15px; font-weight: 700; color: var(--kb-primary-dark);
}

.cross-nav { display: flex; gap: 4px; }
.cross-nav a {
  color: var(--kb-muted); font-size: 12px;
  padding: 4px 10px; border-radius: 6px;
  transition: all 0.12s; font-weight: 600;
}
.cross-nav a:hover {
  background: #f0f0f2;
  color: var(--kb-text);
  text-decoration: none;
}

.vsep {
  width: 1px; height: 20px; background: var(--kb-border);
}

.user-info {
  font-size: 12px; color: var(--kb-muted); font-weight: 600;
}
.user-info strong { color: var(--kb-text); font-weight: 700; }

/* ===== Sélecteur de cabinet (header top) ===== */
.cabinet-selector label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--kb-muted);
  font-weight: 600; cursor: pointer;
}
.cabinet-selector label svg { color: var(--kb-muted) !important; }
.cabinet-selector select {
  padding: 5px 8px; border: 1px solid var(--kb-border);
  border-radius: 6px; background: white; font-size: 12px;
  font-family: inherit; font-weight: 700; color: var(--kb-text);
  cursor: pointer; min-width: 130px;
  transition: all 0.12s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 24px;
}
.cabinet-selector select option { color: var(--kb-text); background: white; }
.cabinet-selector select:hover { border-color: var(--kb-primary); }
.cabinet-selector select:focus {
  outline: none; border-color: var(--kb-primary);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.10);
}

.logout-link {
  color: var(--kb-danger); padding: 4px 8px;
  border-radius: 6px; text-decoration: none;
  display: inline-flex; align-items: center; font-size: 16px;
  transition: all 0.12s;
}
.logout-link svg { width: 14px; height: 14px; }
.logout-link:hover {
  background: #fee2e2;
  color: var(--kb-danger);
  text-decoration: none;
}

/* ===== MAIN ===== */
/* Même gouttière que l'en-tête (24px) : sinon le tableau paraît plus étroit
 * que le header. La largeur est plafonnée par .kb-window. */
.columns {
  padding: 16px 24px;
}
.main-content { min-width: 0; }

.toolbar-spacer { flex: 1; }

.year-selector {
  display: flex; align-items: center; gap: 4px;
}
.year-selector label {
  font-size: 11px; color: var(--kb-muted); font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.year-selector select {
  padding: 5px 8px; border: 1px solid var(--kb-border);
  border-radius: 6px; background: white; font-size: 12px;
  font-weight: 700; font-family: inherit; cursor: pointer;
  min-width: 64px; color: var(--kb-text);
  transition: all 0.12s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 24px;
}
.year-selector select option { color: var(--kb-text); background: white; }
.year-selector select:hover { border-color: var(--kb-primary); }
.year-selector select:focus {
  outline: none; border-color: var(--kb-primary);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.10);
}
.year-nav {
  width: 26px; height: 26px;
  background: white; border: 1px solid var(--kb-border);
  border-radius: 6px; cursor: pointer;
  color: var(--kb-muted);
  display: grid; place-items: center;
  transition: all 0.12s; padding: 0;
  font-size: 13px;
}
.year-nav svg { width: 12px; height: 12px; }
.year-nav:hover:not(:disabled) {
  background: var(--kb-primary-light);
  border-color: var(--kb-primary); color: var(--kb-primary-dark);
}
.year-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-relance {
  background: white; color: var(--kb-text);
  padding: 7px 12px; border: 1px solid var(--kb-border);
  border-radius: 6px;
  font-weight: 600; font-size: 12px; cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.15s;
}
.btn-relance svg { width: 13px; height: 13px; color: var(--kb-muted); }
.btn-relance:hover {
  background: #fbfbfc;
  color: var(--kb-primary); border-color: var(--kb-primary);
}
.btn-relance:hover svg { color: var(--kb-primary); }
.btn-relance:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-create {
  background: var(--kb-primary);
  color: white;
  padding: 6px 13px; border: none;
  border-radius: var(--kb-radius-sm);
  font-weight: 500; font-size: 12.5px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(10, 132, 255, 0.35);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.15s;
}
.btn-create svg { width: 12px; height: 12px; }
.btn-create:hover {
  background: var(--kb-primary-dark);
  color: white; text-decoration: none;
}

/* ===== DataTables controls ===== */
.dt-controls {
  display: flex; justify-content: space-between; align-items: center;
  margin: 8px 0; font-size: 12px;
}
.dt-length label { color: #6a6a6e; }
.dt-length select {
  padding: 3px 8px; border: 1px solid var(--indigo-200);
  border-radius: 4px; background: rgba(255,255,255,0.8); font-size: 12px;
  margin: 0 3px; cursor: pointer; font-family: inherit;
  transition: all 0.12s;
}
.dt-length select:hover { border-color: var(--indigo-400); }
.dt-length select:focus {
  outline: none; border-color: var(--indigo-600);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}
.dt-filter input {
  padding: 6px 10px; border: none;
  border-radius: var(--kb-radius-sm); font-size: 12.5px; width: 240px; height: 28px;
  background: var(--kb-fill); font-family: inherit; color: var(--kb-text);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  transition: all 0.12s; box-sizing: border-box;
}
.dt-filter input:focus {
  outline: none; border-color: var(--indigo-600);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
  background: white;
}

/* ===== TABLE ===== */
.table-wrap {
  border: 0.5px solid var(--kb-border);
  border-radius: var(--kb-radius);
  box-shadow: var(--shadow-sm);
  background: var(--kb-surface);
  overflow: auto;
  max-height: calc(100vh - 250px);
  position: relative;
}
table.ago {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: #333;
}
/* En-tête façon liste Finder : fond clair, libellés gris discrets. */
table.ago thead th {
  background: var(--wiki-thead);
  color: var(--kb-muted);
  text-align: center;
  font-weight: 600;
  padding: 8px 6px;
  border-right: none;
  border-bottom: 0.5px solid var(--kb-border);
  vertical-align: middle;
  font-size: 11px;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 3;
  text-transform: none;
  letter-spacing: 0;
}
table.ago thead th:last-child { border-right: none; }
table.ago thead th.date-column {
  padding: 8px 0 0 0;
  text-transform: none; letter-spacing: 0;
  font-size: 12px; font-weight: 600;
}
table.ago .suivi {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5px;
  table-layout: fixed;
}
table.ago .suivi td {
  border: 0.5px solid var(--kb-border);
  padding: 4px 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--kb-muted);
  text-align: center;
  background: #f0f0f2;
  letter-spacing: 0;
}

table.ago tbody td {
  padding: 9px 8px;
  border-right: none;
  border-top: 0.5px solid var(--wiki-border-light);
  border-bottom: none;
  vertical-align: middle;
}
table.ago tbody td:last-child { border-right: none; }
table.ago tbody tr.odd { background: var(--kb-surface); }
table.ago tbody tr.even { background: white; }
table.ago tbody tr:hover { background: var(--wiki-hover-row); }
table.ago tbody tr:hover td { transition: background-color 0.08s; }
table.ago td.sorting_1 { font-weight: 700; color: var(--wiki-text); }

/* Sticky 1ère colonne (N°) */
table.ago thead th:first-child,
table.ago tbody td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: white;
}
table.ago thead th:first-child { background: var(--wiki-thead); z-index: 4; }
table.ago tbody tr.odd td:first-child { background: var(--kb-surface); }
table.ago tbody tr:hover td:first-child { background: var(--wiki-hover-row); }

/* Sticky dernière colonne (Actions) — reste visible quand on scrolle horizontal */
table.ago thead th:last-child,
table.ago tbody td:last-child {
  position: sticky; right: 0; z-index: 2;
  background: white;
  min-width: 110px;
  border-left: 0.5px solid var(--wiki-border);
  box-shadow: -3px 0 4px -2px rgba(0,0,0,0.04);
}
table.ago thead th:last-child { background: var(--wiki-thead); z-index: 4; }
table.ago tbody tr.odd td:last-child { background: var(--kb-surface); }
table.ago tbody tr:hover td:last-child { background: var(--wiki-hover-row); }

table.ago .bank-name {
  font-size: 12px; line-height: 1.4;
  min-width: 230px; max-width: 280px;
  white-space: nowrap;
}
table.ago .bank-name strong {
  display: block; font-weight: 600; color: var(--wiki-text);
  overflow: hidden; text-overflow: ellipsis;
  max-width: 260px;
}
table.ago .bank-name small.iban-line {
  display: block; color: #777;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 11px; letter-spacing: 0.3px;
  margin-top: 2px;
  white-space: nowrap;        /* IBAN sur 1 ligne, jamais coupé */
  overflow: visible;
}

/* OCR / Cheque cell (legacy) */
td.ocr, td.cheque { padding: 4px !important; text-align: center; width: 32px; }
td.ocr > div, td.cheque > div {
  width: 22px; height: 22px;
  border-radius: 2px;
  margin: 0 auto;
}
td.ocr .green, td.cheque .green { background: var(--wiki-status-green); }
td.ocr .red, td.cheque .red { background: var(--wiki-status-red); }
td.ocr .gray, td.cheque .gray { background: var(--wiki-status-gray); }
td.ocr .blue, td.cheque .blue { background: var(--wiki-status-blue); }
td.ocr .orange, td.cheque .orange { background: var(--wiki-status-orange); }

/* EBICS + Chèque (nouvelles colonnes) */
th.ebics-h, th.cheque-h { width: 56px; min-width: 56px; padding: 9px 4px !important; }
td.ebics-c, td.cheque-c {
  width: 56px; min-width: 56px;
  text-align: center; padding: 6px 4px !important;
}
td.ebics-c .dot, td.cheque-c .dot {
  display: inline-block; width: 18px; height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  cursor: help;
}
.dot.gray   { background: linear-gradient(135deg, #d4d5da, #9ca3af); }
.dot.green  { background: linear-gradient(135deg, #4ade80, #1a9d54); }
.dot.red    { background: linear-gradient(135deg, #f87171, #d70015); }
.dot.blue   { background: linear-gradient(135deg, #9dc9ff, #0a84ff); }
.dot.orange { background: linear-gradient(135deg, #fb923c, #ea580c); }

/* Date columns (months sub-grid) — couleurs Wikitoria */
td.date-column { padding: 0 !important; }
td.date-column table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;      /* MÊME logique que .suivi : colonnes égales */
}
td.date-column td {
  /* PAS de width = auto-distribution équitable comme .suivi */
  height: 28px;
  border: 1px solid var(--wiki-border-light) !important;
  padding: 0 !important;
  text-align: center;
  cursor: pointer;
  font-size: 9px;
  color: #555;
  position: relative;
  transition: all 0.1s;
}
td.date-column td:hover {
  filter: brightness(0.9);
  outline: 2px solid var(--wiki-text);
  outline-offset: -2px;
  z-index: 1;
}
td.date-column td.closed  { background: var(--wiki-status-green);  color: white; }
td.date-column td.opened  { background: var(--wiki-status-orange); color: white; }
td.date-column td.pending { background: var(--wiki-status-blue);   color: white; }
td.date-column td.default { background: var(--wiki-status-red);    color: white; }
td.date-column td.empty   { background: var(--wiki-bg-alt); }
td.date-column .badge {
  position: absolute; top: 1px; right: 1px;
  background: rgba(0,0,0,0.45); color: white;
  font-size: 8px; padding: 0 3px; border-radius: 2px;
  font-weight: 600;
}

/* Actions column — style Wikitoria avec SVG stroke icons */
td.action { padding: 4px !important; }
.actions { display: flex; gap: 3px; justify-content: center; }
.actions button {
  width: 28px; height: 28px;
  border: 1px solid var(--wiki-border-light);
  background: white;
  border-radius: 3px;
  cursor: pointer;
  color: var(--wiki-text-muted);
  display: grid; place-items: center;
  transition: all 0.12s ease;
  padding: 0;
}
.actions button svg {
  width: 17px; height: 17px;
  display: block;
}
.actions button:hover {
  background: linear-gradient(135deg, #0a84ff, #0a84ff);
  border-color: #0a84ff;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(10, 132, 255, 0.32);
}
.actions button.disabled { opacity: 0.4; cursor: not-allowed; }
.actions button.disabled:hover { background: white; color: var(--wiki-text-muted); transform: none; box-shadow: none; }

/* DataTables footer */
.dt-info { font-size: 13px; color: #6a6a6e; }
.dt-paginate {
  display: flex; gap: 4px; justify-content: flex-end;
}
.dt-paginate a {
  padding: 6px 11px;
  border: 1px solid var(--indigo-200);
  background: rgba(255, 255, 255, 0.7);
  color: var(--wiki-text);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}
.dt-paginate a:hover {
  background: var(--indigo-50);
  border-color: var(--indigo-400);
  color: var(--indigo-700);
  text-decoration: none;
}
.dt-paginate a.current {
  background: linear-gradient(135deg, #0a84ff 0%, #0060df 100%);
  color: white; border-color: #0060df;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.35);
}
.dt-paginate a.current:hover {
  background: linear-gradient(135deg, #0060df 0%, #172554 100%);
  color: white;
}
.dt-paginate a.disabled { opacity: 0.4; cursor: not-allowed; }
.dt-paginate a.disabled:hover { background: rgba(255,255,255,0.7); border-color: var(--indigo-200); color: var(--wiki-text); }

/* Footer */
.page-footer {
  background: #2f2f2f; color: #adadad;
  padding: 24px 0; margin-top: 40px;
  font-size: 12px;
}
.footer-inner {
  padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-inner ul { display: flex; gap: 16px; list-style: none; }
.footer-inner a { color: #adadad; }
.footer-inner a:hover { color: white; }

/* Loading */
.kb-loading {
  text-align: center; padding: 60px 20px;
  color: #777; font-size: 14px;
}

/* Toast */
#kb-toast {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.kb-toast {
  background: #333; color: white;
  padding: 12px 18px; border-radius: 4px;
  font-size: 13px; max-width: 380px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: opacity 0.3s;
}
.kb-toast.ok { background: #4caf50; }
.kb-toast.err { background: #d32f2f; }

/* Cell menu */
#kb-cell-menu {
  position: fixed; z-index: 9000;
  background: white;
  border: 1px solid #c2c2c2;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  padding: 4px 0;
  min-width: 220px;
  font-size: 13px;
}
#kb-cell-menu .menu-header {
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  font-size: 11px; color: #6a6a6e;
}
#kb-cell-menu .menu-header strong { color: #333; }
#kb-cell-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px;
  background: white; border: none;
  text-align: left; cursor: pointer;
  font-size: 13px; font-family: inherit; color: #333;
}
#kb-cell-menu button:hover { background: #f5f5f5; }
#kb-cell-menu button .swatch {
  width: 12px; height: 12px; border-radius: 2px;
}

/* ───────────────────────────────────────────────────
   Vue Toggle (Liste / Dashboard) — header indigo
   ─────────────────────────────────────────────────── */
/* Segmented control macOS : rail gris, pastille blanche surélevée sur l'actif. */
.view-toggle {
  display: flex; gap: 0; align-items: center;
  background: var(--kb-control);
  border: none;
  border-radius: var(--kb-radius-sm); padding: 2px; margin-right: 6px;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.view-toggle .vt-btn {
  background: transparent; border: none;
  color: #4a4a4e;
  padding: 4px 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; border-radius: 5px;
  transition: all 0.12s;
  font-family: inherit;
}
.view-toggle .vt-btn:hover { color: var(--kb-text); }
.view-toggle .vt-btn.vt-active {
  background: var(--kb-surface);
  color: var(--kb-text);
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.2);
}

/* ───────────────────────────────────────────────────
   Dashboard 5 ans : KPI cards + matrice dossiers
   ─────────────────────────────────────────────────── */
.kb-dashboard { padding: 4px 0; }
.kpi-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-bottom: 16px;
}
/* Carte KPI macOS : hairline, pas d'accent latéral — la pastille porte la couleur. */
.kpi-card {
  background: var(--kb-surface); border: 0.5px solid var(--kb-border);
  border-radius: var(--kb-radius); padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-card .kpi-year {
  font-size: 11.5px; font-weight: 600; color: #6a6a6e;
  text-transform: none; letter-spacing: 0;
  display: flex; align-items: center; gap: 7px;
}
.kpi-card .kpi-year::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--kb-primary); flex: 0 0 8px;
}
.kpi-card .kpi-total {
  font-family: var(--kb-mono); font-variant-numeric: tabular-nums;
  font-size: 27px; font-weight: 600; color: var(--kb-text);
  line-height: 1; margin-top: 1px;
}
.kpi-card .kpi-breakdown {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-size: 10px; margin-top: 4px;
}
.kpi-pill {
  display: inline-block; padding: 2px 6px; border-radius: 9999px;
  font-weight: 700;
}
.kpi-pill.brouillon { background: #fef3e2; color: #c77700; }
.kpi-pill.genere    { background: #e6f0ff; color: #0a84ff; }
.kpi-pill.signe     { background: #dcfce7; color: #1a9d54; }
.kpi-pill.archive   { background: #f0f0f2; color: #6a6a6e; }

table.ago-matrix {
  width: 100%; border-collapse: collapse;
  font-size: 11px; background: white;
}
table.ago-matrix thead th {
  background: #fbfbfc;
  color: var(--kb-muted); font-weight: 700;
  padding: 6px 10px; text-transform: uppercase;
  letter-spacing: 0.4px; font-size: 10.5px;
  border-bottom: 1px solid var(--kb-border);
  position: sticky; top: 0; z-index: 3;
}
table.ago-matrix thead th.col-year { text-align: center; min-width: 110px; }
table.ago-matrix thead th.col-dossier { text-align: left; min-width: 220px; }
table.ago-matrix tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--wiki-border-light);
  vertical-align: middle;
}
/* Associés (parts) : au maximum 2 lignes, coupé proprement */
.ago-assoc-2l {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 300px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}
table.ago-matrix tbody tr.odd { background: var(--wiki-bg-faint); }
table.ago-matrix tbody tr:hover { background: var(--wiki-hover-row); }
table.ago-matrix tbody td.cell-dossier {
  font-weight: 600; color: var(--wiki-text); white-space: nowrap;
}
table.ago-matrix tbody td.cell-year {
  text-align: center; cursor: pointer; transition: all 0.1s;
}
table.ago-matrix tbody td.cell-year.has-ago:hover {
  background: rgba(10, 132, 255, 0.12);
}
.ago-pill {
  display: inline-block; min-width: 50px;
  padding: 3px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.ago-pill.brouillon { background: #fef3e2; color: #c77700; }
.ago-pill.genere    { background: #e6f0ff; color: #0a84ff; }
.ago-pill.signe     { background: #dcfce7; color: #1a9d54; }
.ago-pill.depose    { background: #eceef1; color: #5c6672; }
.ago-pill.archive   { background: #f0f0f2; color: #6a6a6e; }
.ago-pill.empty {
  background: transparent; color: #d4d5da;
  border: 1px dashed #d4d5da;
}

/* ═══════════════════════════════════════════════════════════════
   Tableau de bord style LM (kb-lm-*) — porté dans AGO (vue Liste)
   ═══════════════════════════════════════════════════════════════ */
#kb-ago-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin: 10px 0 12px;
}
.kb-lm-kpi {
  background: var(--kb-surface); border: 0.5px solid var(--kb-border);
  border-radius: var(--kb-radius);
  padding: 13px 15px; box-shadow: var(--shadow-sm);
}
.kb-lm-kpi-title { font-size: 11.5px; text-transform: none; letter-spacing: 0; color: #6a6a6e; font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 7px; }
.kb-lm-kpi-title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--kb-primary); flex: 0 0 8px; }
.kb-lm-kpi-value { font-family: var(--kb-mono); font-variant-numeric: tabular-nums; font-size: 27px; font-weight: 600; margin-bottom: 1px; line-height: 1; color: var(--kb-text); }
.kb-lm-kpi-sub { font-size: 10.5px; color: var(--kb-muted); line-height: 1.2; }

.kb-lm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.25; background: var(--kb-surface); }
/* Liste principale — style liste Finder (cf. maquette) : en-tête clair, libellés
 * gris non capitalisés, séparateurs hairline, survol bleuté. */
.kb-lm-table thead th {
  background: var(--wiki-thead); text-align: left; padding: 8px 14px;
  font-size: 11px; text-transform: none; letter-spacing: 0;
  color: var(--kb-muted); border-bottom: 0.5px solid var(--kb-border); font-weight: 600;
  position: sticky; top: 0; z-index: 3; white-space: nowrap;
}
.kb-lm-table thead th[data-sort] { cursor: pointer; user-select: none; }
.kb-lm-table thead th[data-sort]:hover { color: var(--kb-text); background: #f0f0f2; }
.kb-lm-table tbody td { padding: 9px 14px; border-top: 0.5px solid var(--wiki-border-light); border-bottom: none; vertical-align: middle; }
.kb-lm-table tbody tr:hover { background: var(--wiki-hover-row); }
.kb-lm-table tbody tr:last-child td { border-bottom: none; }
.kb-lm-name { font-weight: 600; line-height: 1.2; color: var(--kb-text); }
.kb-lm-sub { font-size: 10.5px; color: var(--kb-muted); line-height: 1.2; margin-top: 1px; }

.kb-lm-filter-row th { padding: 4px 6px !important; background: var(--kb-toolbar); position: sticky; top: 28px; z-index: 2; }
.kb-lm-col-filter { width: 100%; box-sizing: border-box; border: 1px solid var(--kb-border); border-radius: 4px; padding: 3px 6px; font-size: 11px; background: white; font-family: inherit; }
.kb-lm-col-filter:focus { outline: none; border-color: var(--kb-primary); box-shadow: 0 0 0 2px rgba(10, 132, 255,0.08); }
select.kb-lm-col-filter { padding: 2px 4px; }

.kb-lm-actions-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; justify-content: center; }
.kb-lm-actions-cell button {
  width: 28px; height: 28px; border: 1px solid var(--kb-border);
  background: white; border-radius: 4px; cursor: pointer;
  color: var(--kb-muted); display: grid; place-items: center;
  font-size: 14px; transition: all 0.12s;
}
.kb-lm-actions-cell button:hover { background: var(--kb-primary-light); border-color: var(--kb-primary); color: var(--kb-primary-dark); }

/* ══════════════════════════════════════════════════════════
   Charte macOS — badges, pastilles de statut, barre d'état
   ══════════════════════════════════════════════════════════ */

/* Compteurs de statut du bandeau : pastel + texte coloré (fini le fond plein). */

/* Identifiants / codes en chiffres alignés */
.kb-lm-code { font-family: var(--kb-mono); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--kb-muted); }

/* Boutons d'action de ligne : carrés hairline façon Finder */
.kb-lm-actions-cell button, .kb-lm-actions-cell a {
  border-radius: var(--kb-radius-xs);
  border: 0.5px solid var(--kb-border);
  background: var(--kb-surface);
}
.kb-lm-actions-cell button:hover, .kb-lm-actions-cell a:hover { background: #f0f0f2; }

/* Barre d'état en pied de fenêtre */
.page-footer {
  background: var(--kb-bg);
  border-top: 0.5px solid var(--kb-border);
  color: var(--kb-muted);
  font-size: 11.5px;
  margin-top: auto;
}
.page-footer a { color: var(--kb-muted); }
.page-footer a:hover { color: var(--kb-primary); }

/* Dashboard 5 ans — exercices dont les comptes sont déposés (source BODACC).
   Un dépôt confidentiel reste un dépôt : même vert, cadenas en plus. */
/* Année déposée : cellule grisée (comptes déjà déposés) */
table.ago-matrix td.cell-year.deposed { background: #eceef1 !important; }
table.ago-matrix td.cell-year.deposed .ago-pill { opacity: 0.5; filter: grayscale(1); }
table.ago-matrix tbody tr:hover td.cell-year.deposed { background: #e2e5e9 !important; }
td.cell-year .dep-mark {
  display: inline-block; margin-left: 4px;
  font-size: 10px; color: #1a9d54; vertical-align: middle;
}
td.cell-year.deposed:not(.has-ago) .dep-mark { font-size: 12px; margin-left: 0; }

/* Dashboard 5 ans — colonnes d'identification (n° dossier, société, clôture) */
table.ago-matrix th.col-code, table.ago-matrix td.cell-code { width: 90px; white-space: nowrap; }
table.ago-matrix th.col-cloture, table.ago-matrix td.cell-cloture { width: 80px; text-align: center; white-space: nowrap; color: var(--kb-muted); }
table.ago-matrix td.cell-cloture { font-family: var(--kb-mono); font-variant-numeric: tabular-nums; }

/* Compteurs de statut — sémantique AGO (forme dans shared/charte.css) */
.status-count .default { background: var(--kb-st-neutral-bg); color: var(--kb-st-neutral); }  /* Brouillon */
.status-count .opened  { background: var(--kb-st-info-bg);    color: var(--kb-st-info); }     /* Générée   */
.status-count .closed  { background: var(--kb-st-ok-bg);      color: var(--kb-st-ok); }       /* Signée    */
.status-count .pending { background: var(--kb-st-warn-bg);    color: var(--kb-st-warn); }     /* Archivée  */

/* Onglets par année (Vue d'ensemble + 2022…2026) */
.ago-tabs { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.ago-search { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.ago-search input { width: 100%; max-width: 480px; padding: 8px 13px; border: 1px solid var(--kb-border); border-radius: 8px; font-size: 13px; background: #fff; color: #1d1d1f; }
.ago-search input::placeholder { color: #9a9aa0; }
.ago-search input:focus { outline: none; border-color: #0a84ff; box-shadow: 0 0 0 3px rgba(10,132,255,.12); }
.ago-search-empty { color: #dc2626; font-size: 12px; font-weight: 600; }
.ago-filter-nomail { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--kb-muted); cursor: pointer; white-space: nowrap; user-select: none; }
.ago-filter-nomail input { cursor: pointer; margin: 0; }
.ago-io-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--kb-text); background: white; border: 1px solid var(--kb-border); border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; transition: all .12s; }
.ago-io-btn:hover { border-color: var(--kb-primary); color: var(--kb-primary); background: var(--kb-primary-light, #f0f7ff); }
.ago-tab { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px 8px 0 0; padding: 8px 16px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; }
.ago-tab:hover { background: #f7f9fc; }
.ago-tab.active { background: #0a84ff; color: #fff; border-color: #0a84ff; }
.ago-year-table th, .ago-year-table td { padding: 8px 10px; font-size: 13px; }
.ago-year-table tbody tr:hover { background: #f1f7ff; }
