/* Composants "Laragon Hub" pour l'admin : KPI, barre de recherche/filtres, lignes de liste. */
.cf-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cf-kpi-card { background: #fff; border: 1px solid var(--cf-border); border-radius: 18px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; text-decoration: none !important; box-shadow: 0 1px 3px rgba(15,23,42,.03); transition: all .2s; color: inherit; }
.cf-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.06); }
.cf-kpi-card.active { border-color: var(--primary); background: var(--primary-soft); }
.cf-kpi-icon-wrapper { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.cf-kpi-blue .cf-kpi-icon-wrapper { background: #e0f2fe; color: #0284c7; }
.cf-kpi-pink .cf-kpi-icon-wrapper { background: #fce7f3; color: #db2777; }
.cf-kpi-green .cf-kpi-icon-wrapper { background: #dcfce7; color: #16a34a; }
.cf-kpi-purple .cf-kpi-icon-wrapper { background: #ede9fe; color: #7c3aed; }
.cf-kpi-orange .cf-kpi-icon-wrapper { background: #fef3c7; color: #d97706; }
.cf-kpi-content { flex-grow: 1; min-width: 0; }
.cf-kpi-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; color: #0f172a; }
.cf-kpi-ratio { font-size: .95rem; font-weight: 500; color: #94a3b8; }
.cf-kpi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Liste « À traiter » du tableau de bord : une ligne = une tâche */
/* Miniature (image à la une) dans les listes de widgets */
.cf-thumb { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.cf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cf-thumb-round { border-radius: 50%; }
.cf-thumb-muted { background: #eef0f3; color: #9aa3ad; }
.cf-todo-list { max-height: 360px; overflow-y: auto; }
.cf-todo-item { padding-top: .75rem; padding-bottom: .75rem; }
.cf-todo-item:hover { background: #f8fafc; }
.cf-todo-chev { transition: transform .2s ease; }
.cf-todo [aria-expanded="false"] .cf-todo-chev { transform: rotate(-90deg); }
.cf-todo-check { color: #cbd5e1; font-size: 1.1rem; flex: 0 0 auto; }
.cf-todo-item:hover .cf-todo-check i::before { content: "\f058"; font-weight: 900; color: var(--primary); }
.cf-todo-ico { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; }
.cf-todo-orange { background: #fef3c7; color: #d97706; }
.cf-todo-pink { background: #fce7f3; color: #db2777; }
.cf-todo-green { background: #dcfce7; color: #16a34a; }
.cf-todo-purple { background: #ede9fe; color: #7c3aed; }
.cf-todo-blue { background: #e0f2fe; color: #0284c7; }
.cf-todo-count { font-size: 1.25rem; font-weight: 700; color: #0f172a; min-width: 3.2rem; text-align: right; }
.cf-kpi-sub { margin-top: 3px; font-size: .72rem; font-weight: 600; color: #16a34a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-kpi-sub i { font-size: .6rem; }
.cf-kpi-progress { height: 4px; background: #f1f5f9; border-radius: 9999px; margin-top: 6px; overflow: hidden; }
.cf-kpi-progress-bar { height: 100%; background: #7c3aed; border-radius: 9999px; }

.cf-filter-wrapper { margin-bottom: 1.25rem; }
.cf-omnibox-container { background: #fff; border: 1px solid var(--cf-border); border-radius: 20px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-search-pill { flex: 1 1 360px; display: flex; align-items: center; background: #fff; border: 1.5px solid var(--primary); border-radius: 9999px; padding: 6px 14px; transition: all .2s; }
.cf-search-pill:focus-within { box-shadow: 0 0 0 3px rgba(8,127,35,.15); }
.cf-search-icon { color: var(--primary); font-size: .95rem; margin-right: 10px; }
.cf-search-input { border: none; outline: none; background: transparent; width: 100%; font-size: .92rem; color: #0f172a; }
.cf-search-input::placeholder { color: #94a3b8; font-size: .88rem; }
.cf-search-clear { color: #94a3b8; padding: 2px 6px; text-decoration: none !important; }
.cf-kbd-shortcut { display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9; border: 1px solid #cbd5e1; color: #64748b; font-family: inherit; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 6px; margin-left: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.cf-chips-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9999px; border: 1px solid var(--cf-border); background: #fff; font-size: .86rem; font-weight: 500; color: #334155; cursor: pointer; outline: none !important; transition: all .15s; }
.cf-chip:hover { background: #f8fafc; border-color: #cbd5e1; }
.cf-chip-active { background: var(--primary-soft) !important; border-color: #81c784 !important; color: var(--primary-dark) !important; font-weight: 600; }
.cf-chip-icon { font-size: .8rem; color: #64748b; }
.cf-chip-active .cf-chip-icon { color: var(--primary-dark); }
.cf-chip-arrow { font-size: .68rem; color: #94a3b8; margin-left: 2px; }
.cf-chip-counter { background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 9999px; }
.cf-chip-reset { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--cf-border); background: #fff; color: #64748b; text-decoration: none !important; }
.cf-chip-reset:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.cf-md3-menu { border: 1px solid var(--cf-border); border-radius: 14px; padding: 6px 0; min-width: 220px; max-width: 320px; }
.cf-menu-wide { min-width: 280px; }
.cf-menu-header { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; padding: 8px 16px 4px; }
.cf-menu-scrollable { max-height: 260px; overflow-y: auto; }
.cf-md3-menu .dropdown-item { font-size: .86rem; padding: 7px 16px; color: #334155; }
.cf-md3-menu .dropdown-item:hover { background: #f1f5f9; color: #0f172a; }
.cf-md3-menu .dropdown-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.cf-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cf-dot-success { background: #16a34a; } .cf-dot-warning { background: #d97706; } .cf-dot-danger { background: #dc2626; }
.cf-filter-field-label { font-size: .76rem; font-weight: 600; color: #475569; margin-bottom: 3px; }
.cf-select { border-radius: 8px; font-size: .82rem; }
.cf-subbar-count { font-size: .9rem; color: #64748b; }
.cf-active-filter-indicator { display: inline-flex; align-items: center; background: var(--primary-soft); color: var(--primary-dark); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 9999px; margin-left: 8px; }
.cf-sort-btn { border: 1px solid var(--cf-border); border-radius: 10px; background: #fff; padding: 6px 14px; font-size: .84rem; color: #334155; font-weight: 500; outline: none !important; cursor: pointer; }
.cf-sort-btn:hover { background: #f8fafc; }
.cf-view-toggle { display: inline-flex; background: #fff; border: 1px solid var(--cf-border); border-radius: 10px; padding: 2px; }
.cf-view-toggle-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; border-radius: 8px; border: 0; background: transparent; padding: 0; cursor: pointer; outline: none !important; color: #64748b !important; text-decoration: none !important; }
.cf-view-toggle-btn:hover { background: #f1f5f9; }
.cf-view-toggle-btn.active { background: var(--primary); color: #fff !important; }

/* Liste en lignes-cartes (comme les projets de Laragon Hub) */
.cf-flat { border: 0 !important; box-shadow: none !important; background: transparent !important; }
.cf-flat > .card-header { border: 1px solid var(--cf-border); border-radius: 1rem; margin-bottom: .75rem; }
.cf-flat > .card-body { padding: 0 !important; overflow: visible !important; }
.cf-flat > .card-footer { background: transparent; border: 0; }
.cf-rows { display: flex; flex-direction: column; gap: 12px; }
.cf-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--cf-border); border-radius: 16px; padding: 14px 18px; transition: box-shadow .15s, border-color .15s; }
.cf-row:hover { box-shadow: 0 4px 14px rgba(15,23,42,.06); border-color: #cbd5e1; }
.cf-row.active { background: var(--primary-soft); border-color: #81c784; }
.cf-row-check { flex: 0 0 auto; margin: 0; }
.cf-row-avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; overflow: hidden; }
.cf-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cf-row-main { flex: 1 1 auto; min-width: 0; }
.cf-row-title { font-size: 1.05rem; font-weight: 600; color: #0f172a !important; text-decoration: none !important; margin-right: 6px; }
.cf-row-title:hover { color: var(--primary) !important; }
.cf-row-title { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.cf-row-sub { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-pill { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 9px; border-radius: 6px; border: 1px solid transparent; vertical-align: middle; margin-right: 4px; }
.cf-pill-green { background: #dcfce7; color: #166534; border-color: #86efac; }
.cf-pill-blue { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.cf-pill-orange { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.cf-pill-red { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.cf-pill-pink { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }
.cf-pill-grey { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.cf-row-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; font-size: .82rem; color: #94a3b8; white-space: nowrap; }
.cf-row-meta strong { color: #334155; }
.cf-meter { width: 70px; height: 5px; background: #f1f5f9; border-radius: 9999px; overflow: hidden; }
.cf-meter > span { display: block; height: 100%; border-radius: 9999px; }
/* Anneau de progression (score de complétude) : arc de cercle plein à 100 % */
.cf-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 42px; }
.cf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cf-ring-bg, .cf-ring-fg { fill: none; stroke-width: 3.4; }
.cf-ring-bg { stroke: #e2e8f0; }
.cf-ring-fg { stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.cf-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: #334155; }
.cf-row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.cf-row-actions form { margin: 0; }
.cf-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--cf-border); background: #fff; color: #64748b !important; cursor: pointer; text-decoration: none !important; padding: 0; transition: all .15s; }
.cf-icon-btn:hover { background: #f1f5f9; color: #0f172a !important; }
.cf-icon-btn.danger:hover { background: #fee2e2; color: #dc2626 !important; border-color: #fca5a5; }
.cf-icon-btn.success:hover { background: #dcfce7; color: #16a34a !important; border-color: #86efac; }
.cf-open-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: 10px; background: var(--primary); color: #fff !important; font-weight: 600; font-size: .85rem; text-decoration: none !important; }
.cf-open-btn:hover { background: var(--primary-dark); }
@media (max-width: 991.98px) {
  .cf-row { flex-wrap: wrap; }
  .cf-row-meta { order: 3; flex: 1 1 100%; flex-wrap: wrap; gap: 8px 14px; }
  .cf-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cf-search-pill { flex: 1 1 100%; }
  .cf-chips-group { width: 100%; overflow-x: auto; padding-bottom: 4px; }
}
@media (max-width: 480px) { .cf-kpi-grid { grid-template-columns: 1fr; } }

/* Vue GRILLE : chaque ligne devient une carte verticale */
.cf-rows.cf-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cf-view-grid .cf-row { position: relative; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
.cf-view-grid .cf-row-check { position: absolute; top: 14px; right: 14px; }
.cf-view-grid .cf-row-main { width: 100%; }
.cf-view-grid .cf-row-main > div:first-child { white-space: normal; }
.cf-view-grid .cf-row-title { white-space: normal; display: inline; }
.cf-view-grid .cf-row-sub { white-space: normal; word-break: break-word; }
.cf-view-grid .cf-row-meta { flex-wrap: wrap; white-space: normal; gap: 6px 12px; }
.cf-view-grid .cf-row-actions { width: 100%; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--cf-border); justify-content: flex-end; }

/* Médiathèque : en grille, la vignette occupe toute la largeur de la carte */
.cf-view-grid .cf-row-avatar.cf-media { width: 100%; height: 170px; flex: 0 0 170px; border-radius: 12px; font-size: 2.2rem; }
.cf-view-grid .cf-row-avatar.cf-media img { object-fit: cover; }

/* Vue TABLEAU : lignes denses alignées en colonnes, avec en-tête */
.cf-rows.cf-view-table { gap: 0; background: #fff; border: 1px solid var(--cf-border); border-radius: 16px; overflow: hidden; }
.cf-view-table .cf-row { border: 0; border-bottom: 1px solid var(--cf-border); border-radius: 0; box-shadow: none; padding: .55rem 1rem; gap: 12px; }
.cf-view-table .cf-row:last-child { border-bottom: 0; }
.cf-view-table .cf-row:hover { background: var(--primary-soft); }
.cf-view-table .cf-row-check { width: 28px; flex: 0 0 28px; }
.cf-view-table .cf-row-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font-size: .9rem; }
.cf-view-table .cf-row-title { font-size: .95rem; }
.cf-view-table .cf-row-meta { flex: 0 0 250px; }
.cf-view-table .cf-row-actions { flex: 0 0 190px; justify-content: flex-end; }
.cf-view-table .cf-open-btn { height: 30px; padding: 0 12px; }
.cf-view-table .cf-icon-btn { width: 30px; height: 30px; }
.cf-table-head { display: none; }
.cf-view-table > .cf-table-head { display: flex; gap: 12px; padding: .6rem 1rem; background: #f8fafc; border-bottom: 1px solid var(--cf-border); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; }
.cf-th-check { flex: 0 0 28px; } .cf-th-avatar { flex: 0 0 34px; } .cf-th-main { flex: 1 1 auto; } .cf-th-meta { flex: 0 0 250px; } .cf-th-actions { flex: 0 0 190px; text-align: right; }
@media (max-width: 991.98px) {
  .cf-rows.cf-view-table { overflow-x: auto; }
  .cf-view-table .cf-row-meta, .cf-view-table > .cf-table-head .cf-th-meta { display: none; }
}

/* Tiroir latéral de filtres (modal Bootstrap 4 collé à droite) */
.cf-drawer .modal-dialog { position: fixed; top: 0; right: 0; bottom: 0; margin: 0; width: 400px; max-width: 100%; height: 100%; transform: translateX(100%) !important; transition: transform .3s ease-out; }
.cf-drawer.show .modal-dialog { transform: translateX(0) !important; }
.cf-drawer .modal-content { height: 100%; border-radius: 1.5rem 0 0 1.5rem; }
.cf-drawer .modal-body { overflow-y: auto; }
.cf-drawer .modal-footer { justify-content: space-between; }

/* ===== Charte verte : bouton primaire + pagination (admin) ===== */
.btn-primary { background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%); border-color: #2E7D32; color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active { background: #1b5e20; border-color: #1b5e20; color: #fff; }
.btn-primary:focus { box-shadow: 0 0 0 .2rem rgba(76, 175, 80, .35); }
.btn-outline-primary { color: #2E7D32; border-color: #2E7D32; }
.btn-outline-primary:hover { background: #2E7D32; border-color: #2E7D32; color: #fff; }
.pagination { gap: .35rem; flex-wrap: wrap; }
.pagination .page-item .page-link { min-width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 .65rem; border: 1px solid #e3e8ee; border-radius: 999px !important; background: #fff; color: #2E7D32; font-weight: 600; font-size: .85rem; line-height: 1; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.pagination .page-item .page-link:hover { background: #f1f8f2; border-color: #a5d6a7; color: #1b5e20; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(46,125,50,.18); }
.pagination .page-item .page-link:focus { box-shadow: 0 0 0 .2rem rgba(76,175,80,.3); outline: 0; }
.pagination .page-item.active .page-link { background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(46,125,50,.35); }
.pagination .page-item.disabled .page-link { background: #f8f9fa; color: #adb5bd; border-color: #eef0f3; box-shadow: none; transform: none; }
.pagination .page-item.cf-gap .page-link { background: transparent; border-color: transparent; box-shadow: none; min-width: 1.25rem; padding: 0; }
@media (max-width: 575.98px) { .pagination .page-item.cf-edge { display: none; } }
.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus,
.pagination .page-item.active a { color: #fff !important; }
