/* CSMS — Espace d'administration */
body.admin { background: var(--bg); min-height: 100vh; }
.adm-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; z-index: 1045; display: flex; flex-direction: column; background: var(--surface-solid); border-right: 1px solid var(--border); overflow-y: auto; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.adm-sidebar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad-tri); }
.adm-nav { padding: 0 .8rem; }
.adm-sec { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 1.1rem .8rem .4rem; }
.adm-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .85rem; border-radius: 14px; color: var(--text); font-weight: 500; font-size: .9rem; margin-bottom: 2px; transition: all .2s; position: relative; }
.adm-nav a i { font-size: 1.1rem; color: var(--muted); transition: color .2s; }
.adm-nav a:hover { background: rgba(11, 95, 227, .07); color: var(--c-blue); }
.adm-nav a:hover i { color: var(--c-blue); }
.adm-nav a.active { background: var(--grad-main); color: #fff; box-shadow: 0 8px 22px rgba(11, 95, 227, .35); }
.adm-nav a.active i { color: #fff; }
.adm-main { margin-left: 270px; min-height: 100vh; display: flex; flex-direction: column; }
.adm-top { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem; background: var(--surface); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.adm-content { padding: 1.5rem; flex: 1; }
.adm-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.adm-backdrop { display: none; }
@media (max-width: 991.98px) {
  .adm-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .adm-main { margin-left: 0; }
  body.sb-open .adm-sidebar { transform: none; }
  body.sb-open .adm-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(6, 10, 24, .5); backdrop-filter: blur(3px); }
  .adm-content { padding: 1rem; }
  .adm-top { padding: .7rem 1rem; }
}

/* Cartes */
.panel { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.panel-h { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel-h h2, .panel-h h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.panel-b { padding: 1.25rem; }

/* KPI */
.kpi { padding: 1.2rem; display: flex; gap: 1rem; align-items: center; position: relative; overflow: hidden; height: 100%; }
.kpi .ki { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.45rem; color: #fff; flex: 0 0 auto; box-shadow: 0 10px 25px rgba(11, 95, 227, .25); }
.kpi .kv { font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; line-height: 1; }
.kpi .kl { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi .kt { font-size: .72rem; font-weight: 600; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--kc, var(--c-blue)); opacity: .07; }
.welcome { border-radius: 24px; padding: 1.6rem; color: #fff; position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(135deg, #0A2E7A, #0B5FE3 60%, #2F7BFF); }
.welcome .orb { opacity: .35; }

/* Tableaux */
.table-modern { margin: 0; --bs-table-bg: transparent; color: var(--text); }
.table-modern thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; padding: .8rem .75rem; position: sticky; top: 0; }
.table-modern thead th a { color: inherit; }
.table-modern thead th a:hover { color: var(--c-blue); }
.table-modern td { vertical-align: middle; border-color: var(--border); padding: .7rem .75rem; font-size: .88rem; }
.table-modern tbody tr { transition: background .15s; }
.table-modern tbody tr:hover { background: rgba(11, 95, 227, .04); }
.table-modern .thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.table-modern .cell-title { font-weight: 600; max-width: 340px; }
.row-actions { white-space: nowrap; }
.row-actions .btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; }
.status-dot { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .78rem; padding: .28rem .65rem; border-radius: 999px; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-success { background: rgba(0, 200, 83, .12); color: #00A048; }
.s-warning { background: rgba(255, 179, 0, .15); color: #B37A00; }
.s-danger { background: rgba(242, 35, 29, .12); color: #D21B16; }
.s-secondary { background: rgba(91, 103, 133, .12); color: var(--muted); }
.s-primary { background: rgba(11, 95, 227, .12); color: var(--c-blue); }
[data-bs-theme="dark"] .s-success { color: #3BE38A; } [data-bs-theme="dark"] .s-warning { color: #FFD45C; } [data-bs-theme="dark"] .s-danger { color: #FF6B66; }
button.status-dot { border: 0; cursor: pointer; }
.filters { background: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.filters .form-control, .filters .form-select { border-radius: 12px; border-color: var(--border); background-color: var(--surface-solid); min-height: 40px; font-size: .88rem; }
.filters label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.filters .select2-container--bootstrap-5 .select2-selection { min-height: 40px; border-radius: 12px !important; font-size: .88rem; }
.active-filter { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; padding: .25rem .6rem; border-radius: 999px; background: rgba(11, 95, 227, .1); color: var(--c-blue); font-weight: 600; }

/* Formulaires */
.form-panel .form-label { font-weight: 600; font-size: .85rem; }
.form-panel .form-control, .form-panel .form-select { border-radius: 12px; border-color: var(--border); background-color: var(--surface-solid); color: var(--text); }
.form-panel .form-control:focus { border-color: var(--c-blue); box-shadow: 0 0 0 4px rgba(11, 95, 227, .12); }
.form-panel .select2-container--bootstrap-5 .select2-selection { min-height: 40px; border-radius: 12px !important; }
.req::after { content: " *"; color: var(--c-red); }
.img-drop { border: 2px dashed var(--border); border-radius: 18px; padding: 1rem; text-align: center; cursor: pointer; transition: all .25s; position: relative; background: var(--bg); }
.img-drop:hover, .img-drop.drag { border-color: var(--c-blue); background: rgba(11, 95, 227, .05); }
.img-drop img.preview { max-height: 160px; border-radius: 12px; margin-bottom: .6rem; }
.img-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.gal-item { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-solid); position: relative; }
.gal-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gal-item .p-2 input { font-size: .75rem; }
.gal-item.del { opacity: .4; outline: 2px solid var(--c-red); }
.gal-new { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; margin-top: .6rem; }
.gal-new img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: var(--surface); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: .9rem 1.25rem; border-radius: 0 0 20px 20px; }

/* Summernote dans le thème */
.note-editor.note-frame { border-radius: 14px; border-color: var(--border) !important; overflow: hidden; }
.note-editor .note-toolbar { background: var(--bg) !important; border-color: var(--border) !important; }
.note-editor .note-editing-area .note-editable { background: var(--surface-solid); color: var(--text); min-height: 260px; }
[data-bs-theme="dark"] .note-btn { background: var(--surface-solid); color: var(--text); border-color: var(--border); }
.note-modal .note-modal-content { background: var(--surface-solid); color: var(--text); }

/* Matrice des permissions */
.perm-table td, .perm-table th { text-align: center; vertical-align: middle; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-table .form-check-input { width: 1.3em; height: 1.3em; cursor: pointer; }

/* Connexion */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 4rem; isolation: isolate;
  background: radial-gradient(800px 400px at 0% 0%, #2F7BFF 0, transparent 70%), linear-gradient(135deg, #0A2E7A, #0B5FE3); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { width: 100%; max-width: 420px; }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

@media print {
  .adm-sidebar, .adm-top, .adm-foot, .filters, .row-actions, .no-print, .pagination { display: none !important; }
  .adm-main { margin: 0; } .panel { box-shadow: none; border: 0; }
}
