/* =====================================================================
   FICHIER : assets/css/app.css
   RÔLE    : design commun de toutes les pages (reprend le style GESTCMA :
             vert CMA, police Plus Jakarta Sans, cartes arrondies, mode sombre)

   SOMMAIRE
     1.  Couleurs et variables (clair / sombre)
     2.  Base de la page
     3.  Onglet latéral (sidebar)
     4.  Barre du haut
     5.  Zone de contenu et en-tête de page
     6.  Cartes et indicateurs (KPI)
     7.  Tableaux
     8.  Formulaires et boutons
     9.  Pastilles (badges) et avatars
     10. Éléments divers (onglets, état vide, calendrier…)
     11. Écrans mobiles
     12. Impression
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. COULEURS ET VARIABLES
   --------------------------------------------------------------------- */
:root {
    --cma-green: #2e7d32;
    --cma-green-dark: #1b5e20;
    --cma-green-light: #e8f5e9;
    --cma-blue: #1e88e5;
    --cma-orange: #fb8c00;
    --cma-purple: #8e24aa;
    --cma-red: #e53935;
    --cma-gold: #f9a825;

    --bg-body: #f4f7f5;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --kpi-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    --table-hover: #f8fafc;
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;

    --sidebar-bg: #0f2a14;
    --sidebar-text: #c8dccb;
    --sidebar-muted: #7fa287;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active: #2e7d32;
    --sidebar-width: 268px;
    --sidebar-mini: 78px;
    --topbar-height: 68px;
}

[data-theme="dark"] {
    --bg-body: #0a120c;
    --card-bg: #121e15;
    --card-border: rgba(46, 125, 50, 0.2);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --kpi-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    --table-hover: #17281c;
    --input-bg: #142118;
    --input-border: #26382b;
    --cma-green-light: rgba(46, 125, 50, 0.18);
    --sidebar-bg: #07110a;
}


/* ---------------------------------------------------------------------
   2. BASE DE LA PAGE
   --------------------------------------------------------------------- */
* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    font-size: 14px;
}

a { color: var(--cma-green); text-decoration: none; }
a:hover { color: var(--cma-green-dark); }
[data-theme="dark"] a { color: #81c784; }

.text-muted { color: var(--text-muted) !important; }
hr { border-color: var(--card-border); opacity: 1; }


/* ---------------------------------------------------------------------
   3. ONGLET LATÉRAL (SIDEBAR)
   --------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    background-image: linear-gradient(180deg, rgba(46, 125, 50, 0.22) 0%, rgba(46, 125, 50, 0) 40%);
    color: var(--sidebar-text);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 3px;
}

.sidebar-brand .brand-name {
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    line-height: 1.1;
    white-space: nowrap;
}

.sidebar-brand .brand-name span {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.menu-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-muted);
    padding: 16px 12px 6px;
    white-space: nowrap;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 12px;
    color: var(--sidebar-text) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.menu-link i.menu-icon {
    width: 22px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.menu-link:hover {
    background: var(--sidebar-hover);
    color: #fff !important;
}

.menu-link.active {
    background: var(--sidebar-active);
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.35);
}

.menu-link .menu-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s;
}

.menu-link[aria-expanded="true"] .menu-arrow { transform: rotate(90deg); }

.submenu {
    list-style: none;
    padding: 2px 0 6px 34px;
    margin: 0;
}

.submenu a {
    display: block;
    padding: 7px 12px;
    border-radius: 10px;
    color: var(--sidebar-muted) !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.submenu a::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    transform: translateY(-50%);
    opacity: 0.5;
}

.submenu a:hover { color: #fff !important; background: var(--sidebar-hover); }
.submenu a.active { color: #a5d6a7 !important; font-weight: 700; }
.submenu a.active::before { opacity: 1; background: #66bb6a; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11.5px;
    color: var(--sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
}

/* Menu réduit (icônes seules) sur grand écran */
body.sidebar-reduit .sidebar { width: var(--sidebar-mini); }
body.sidebar-reduit .sidebar .brand-name,
body.sidebar-reduit .sidebar .menu-title,
body.sidebar-reduit .sidebar .menu-text,
body.sidebar-reduit .sidebar .menu-arrow,
body.sidebar-reduit .sidebar .submenu,
body.sidebar-reduit .sidebar .sidebar-footer { display: none !important; }
body.sidebar-reduit .sidebar .menu-link { justify-content: center; padding: 12px 0; }
body.sidebar-reduit .sidebar-brand { justify-content: center; padding: 0; }
body.sidebar-reduit .main-wrapper { margin-left: var(--sidebar-mini); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}


/* ---------------------------------------------------------------------
   4. BARRE DU HAUT
   --------------------------------------------------------------------- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(46, 125, 50, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

[data-theme="dark"] .topbar {
    background: rgba(17, 28, 20, 0.92);
    border-bottom-color: rgba(46, 125, 50, 0.3);
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.topbar-btn:hover { background: var(--cma-green-light); color: var(--cma-green); }

.topbar-title {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eglise-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cma-green-light);
    border: 1px solid rgba(46, 125, 50, 0.2);
    border-radius: 14px;
    padding: 4px 6px 4px 12px;
    color: var(--cma-green-dark);
    font-weight: 600;
    font-size: 13px;
}

[data-theme="dark"] .eglise-switch { color: #a5d6a7; }

.eglise-switch select {
    border: none;
    background: transparent;
    font-weight: 700;
    color: inherit;
    padding: 4px 6px;
    outline: none;
    cursor: pointer;
}

.eglise-switch select option { color: #1e293b; }

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 14px;
    border: 1px solid rgba(46, 125, 50, 0.2);
    background: var(--card-bg);
    color: var(--text-main) !important;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

.user-badge:hover { background: var(--cma-green-light); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cma-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    object-fit: cover;
}

.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 110px; height: 110px; font-size: 36px; border: 4px solid var(--card-bg); box-shadow: var(--kpi-shadow); }

.dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
    background: var(--card-bg);
    padding: 6px;
}

.dropdown-item { border-radius: 10px; color: var(--text-main); font-size: 13.5px; padding: 8px 12px; }
.dropdown-item:hover { background: var(--cma-green-light); color: var(--cma-green); }


/* ---------------------------------------------------------------------
   5. ZONE DE CONTENU ET EN-TÊTE DE PAGE
   --------------------------------------------------------------------- */
.content {
    flex: 1;
    padding: 26px 26px 50px;
    max-width: 1440px;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.page-title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title .title-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--cma-green-light);
    color: var(--cma-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.page-subtitle { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 0 56px; }

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.footer-app {
    padding: 16px 26px;
    color: var(--text-muted);
    font-size: 12.5px;
    border-top: 1px solid var(--card-border);
}

/* Bannière d'accueil (tableau de bord) */
.hero-banner {
    background: linear-gradient(135deg, #1b5e20, #2e7d32 70%, #388e3c);
    color: #fff;
    border-radius: 24px;
    padding: 30px 34px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(27, 94, 32, 0.2);
    margin-bottom: 26px;
}

.hero-banner::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.hero-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.hero-subtitle { font-size: 14px; color: rgba(255, 255, 255, 0.85); max-width: 600px; margin: 0; }

.hero-pill {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    border-radius: 16px;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero {
    background: #fff;
    color: var(--cma-green-dark) !important;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 20px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transition: 0.25s;
}

.btn-hero:hover { transform: translateY(-2px); background: #f1f8e9; }


/* ---------------------------------------------------------------------
   6. CARTES ET INDICATEURS (KPI)
   --------------------------------------------------------------------- */
.card-app {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--kpi-shadow);
    margin-bottom: 22px;
}

.card-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.card-app-title {
    font-size: 16.5px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-app-title i { color: var(--cma-green); }

.card-kpi {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--kpi-shadow);
    height: 100%;
    transition: transform 0.25s, box-shadow 0.25s;
    text-decoration: none;
    color: var(--text-main);
    display: block;
}

a.card-kpi:hover, .card-kpi:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.09); color: var(--text-main); }

.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.kpi-green  { background: rgba(46, 125, 50, 0.12);  color: #2e7d32; }
.kpi-blue   { background: rgba(30, 136, 229, 0.12); color: #1e88e5; }
.kpi-orange { background: rgba(251, 140, 0, 0.12);  color: #fb8c00; }
.kpi-purple { background: rgba(142, 36, 170, 0.12); color: #8e24aa; }
.kpi-red    { background: rgba(229, 57, 53, 0.12);  color: #e53935; }
.kpi-gold   { background: rgba(249, 168, 37, 0.14); color: #c17900; }

.kpi-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.kpi-meta  { font-size: 12.5px; color: var(--text-muted); }

/* Carte d'accès rapide */
.quick-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main) !important;
    box-shadow: var(--kpi-shadow);
    transition: 0.25s;
    height: 100%;
}

.quick-card:hover { transform: translateY(-3px); border-color: rgba(46, 125, 50, 0.4); }
.quick-card .kpi-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 14px; }
.quick-card strong { display: block; font-size: 14px; }
.quick-card small { color: var(--text-muted); }

/* Bloc d'information (fiche détail) */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 22px; }
.info-item .info-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.info-item .info-value { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-word; }


/* ---------------------------------------------------------------------
   7. TABLEAUX
   --------------------------------------------------------------------- */
.table-app {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
    color: var(--text-main);
}

.table-app th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border: none;
    padding: 6px 14px;
    white-space: nowrap;
}

.table-app td {
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    padding: 12px 14px;
    font-size: 13.5px;
    vertical-align: middle;
}

.table-app tr td:first-child { border-left: 1px solid var(--card-border); border-radius: 12px 0 0 12px; }
.table-app tr td:last-child  { border-right: 1px solid var(--card-border); border-radius: 0 12px 12px 0; }
.table-app tbody tr:hover td { background: var(--table-hover); }

.table-compact td { padding: 8px 12px; }
.table-app .form-select-sm { min-width: 140px; }
.card-app-header .filter-bar .form-control { min-width: 0; width: auto; }

.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person strong { display: block; font-weight: 700; }
.cell-person small { color: var(--text-muted); }

.actions-cell { white-space: nowrap; text-align: right; }

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
    padding: 0;
}

.btn-icon:hover { background: var(--cma-green-light); color: var(--cma-green); }
.btn-icon.danger:hover { background: rgba(229, 57, 53, 0.1); color: var(--cma-red); }

.amount-pos { font-weight: 700; color: #2e7d32; }
.amount-neg { font-weight: 700; color: #e53935; }

/* Grille de pointage (présences, notes, cotisations) */
.grid-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.grid-check label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    background: var(--card-bg);
    font-weight: 600;
    font-size: 13px;
}

.grid-check label:has(input:checked) { border-color: var(--cma-green); background: var(--cma-green-light); }

.mois-grille { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mois-case {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 6px 4px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
}

.mois-case.paye { background: rgba(46, 125, 50, 0.14); color: #1b5e20; border-color: rgba(46, 125, 50, 0.4); }
.mois-case.du   { background: rgba(229, 57, 53, 0.08); color: #c62828; }
[data-theme="dark"] .mois-case.paye { color: #a5d6a7; }


/* ---------------------------------------------------------------------
   8. FORMULAIRES ET BOUTONS
   --------------------------------------------------------------------- */
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form-label .req { color: var(--cma-red); }

.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 9px 13px;
    font-size: 14px;
    color: var(--text-main);
}

.form-control:focus, .form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--cma-green);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
    color: var(--text-main);
}

.form-control::placeholder { color: #94a3b8; }
.form-check-input:checked { background-color: var(--cma-green); border-color: var(--cma-green); }
.form-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cma-green);
    margin: 22px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--card-border);
}

.form-section-title:first-child { margin-top: 0; }

.btn-app {
    background: var(--cma-green);
    color: #fff !important;
    border: none;
    font-weight: 700;
    border-radius: 12px;
    padding: 9px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
}

.btn-app:hover { background: var(--cma-green-dark); }

.btn-light-app {
    background: var(--card-bg);
    color: var(--text-main) !important;
    border: 1px solid var(--card-border);
    font-weight: 600;
    border-radius: 12px;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-light-app:hover { background: var(--cma-green-light); color: var(--cma-green) !important; }

.btn-danger-app {
    background: rgba(229, 57, 53, 0.1);
    color: #c62828 !important;
    border: 1px solid rgba(229, 57, 53, 0.25);
    font-weight: 700;
    border-radius: 12px;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-bar .form-control, .filter-bar .form-select { min-width: 160px; }

.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { padding-left: 38px; }


/* ---------------------------------------------------------------------
   9. PASTILLES (BADGES) ET AVATARS
   --------------------------------------------------------------------- */
.badge-soft {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.badge-soft-success   { background: rgba(46, 125, 50, 0.14);  color: #1b5e20; }
.badge-soft-warning   { background: rgba(251, 140, 0, 0.15);  color: #b45309; }
.badge-soft-info      { background: rgba(30, 136, 229, 0.14); color: #1565c0; }
.badge-soft-danger    { background: rgba(229, 57, 53, 0.14);  color: #c62828; }
.badge-soft-secondary { background: rgba(100, 116, 139, 0.14); color: #475569; }
.badge-soft-dark      { background: rgba(15, 23, 42, 0.12);   color: #0f172a; }
.badge-soft-purple    { background: rgba(142, 36, 170, 0.14); color: #6a1b9a; }

[data-theme="dark"] .badge-soft-success   { color: #a5d6a7; }
[data-theme="dark"] .badge-soft-warning   { color: #ffcc80; }
[data-theme="dark"] .badge-soft-info      { color: #90caf9; }
[data-theme="dark"] .badge-soft-danger    { color: #ef9a9a; }
[data-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }
[data-theme="dark"] .badge-soft-dark      { color: #e2e8f0; background: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .badge-soft-purple    { color: #ce93d8; }


/* ---------------------------------------------------------------------
   10. ÉLÉMENTS DIVERS
   --------------------------------------------------------------------- */
.alert-app { border-radius: 14px; border: none; font-weight: 500; }

/* Onglets internes à une page */
.tabs-app { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border: none; }
.tabs-app a {
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tabs-app a:hover { color: var(--cma-green); }
.tabs-app a.active { background: var(--cma-green); color: #fff; border-color: var(--cma-green); }

/* État vide */
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-muted); }
.empty-icon {
    width: 70px;
    height: 70px;
    border-radius: 22px;
    background: var(--cma-green-light);
    color: var(--cma-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

/* Petit calendrier (date d'un culte ou d'une activité) */
.cal-badge {
    min-width: 58px;
    border-radius: 14px;
    overflow: hidden;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cal-badge .cal-mois { background: var(--cma-green); color: #fff; font-size: 10.5px; font-weight: 800; text-transform: uppercase; padding: 2px 0; }
.cal-badge .cal-jour { font-size: 21px; font-weight: 800; padding: 3px 0 4px; }

.list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--card-border);
}

.list-row:last-child { border-bottom: none; }

.progress { height: 8px; border-radius: 8px; background: var(--input-bg); }
.progress-bar { background: var(--cma-green); }

.note-legende { font-size: 12px; color: var(--text-muted); }

.pagination .page-link { border-radius: 10px !important; margin: 0 2px; border: 1px solid var(--card-border); color: var(--text-main); background: var(--card-bg); }
.pagination .active .page-link { background: var(--cma-green); border-color: var(--cma-green); color: #fff; }


/* ---------------------------------------------------------------------
   11. ÉCRANS MOBILES
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
    body.sidebar-ouvert .sidebar { transform: translateX(0); }
    body.sidebar-ouvert .sidebar-overlay { display: block; }
    .main-wrapper, body.sidebar-reduit .main-wrapper { margin-left: 0; }
    body.sidebar-reduit .sidebar .brand-name,
    body.sidebar-reduit .sidebar .menu-title,
    body.sidebar-reduit .sidebar .menu-text,
    body.sidebar-reduit .sidebar .menu-arrow,
    body.sidebar-reduit .sidebar .sidebar-footer { display: block !important; }
    .content { padding: 18px 14px 40px; }
    .topbar { padding: 0 14px; }
    .page-subtitle { margin-left: 0; }
    .eglise-switch .switch-label { display: none; }
}

@media (max-width: 575.98px) {
    .user-badge .user-name { display: none; }
    .hero-banner { padding: 24px 20px; }
    .card-app { padding: 18px; }
    .table-responsive { margin: 0 -6px; }
    .mois-grille { grid-template-columns: repeat(4, 1fr); }
}


/* ---------------------------------------------------------------------
   12. IMPRESSION
   --------------------------------------------------------------------- */
@media print {
    .sidebar, .topbar, .footer-app, .no-print, .page-actions, .filter-bar, .btn, .alert-app { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    body { background: #fff; color: #000; }
    .card-app { box-shadow: none; border: 1px solid #ddd; }
    .content { padding: 0; }
}

/* Appel Présent / Absent (leçons et activités) */
.appel-table .appel-radio { width: 1.35em; height: 1.35em; cursor: pointer; }
.appel-table .appel-radio:checked { background-color: var(--cma-green); border-color: var(--cma-green); }
.appel-table .appel-radio-a:checked { background-color: #c62828; border-color: #c62828; }
.appel-table tr.appel-p td { background: rgba(30, 158, 69, .07); }
.appel-table tr.appel-a td { background: rgba(198, 40, 40, .07); }
.appel-table .appel-motif:disabled { opacity: .4; }

/* Pavé de signature du président */
.pave-signature-cadre { position: relative; height: 220px; border: 2px dashed var(--card-border); border-radius: 14px; background: #fff; touch-action: none; overflow: hidden; }
.pave-signature-cadre canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.pave-signature-ligne { position: absolute; left: 8%; right: 8%; bottom: 52px; border-bottom: 1px solid #c9ced6; pointer-events: none; }
.pave-signature-aide { position: absolute; left: 8%; bottom: 58px; color: #a0a7b2; font-style: italic; pointer-events: none; }
.apercu-signature { background: #fff; color: #111; border: 1px solid var(--card-border); border-radius: 12px; padding: 14px; text-align: center; }
.apercu-signature-image { height: 70px; display: grid; place-items: center; margin: 6px 0; }
.apercu-signature-image img { max-height: 66px; max-width: 220px; }
.apercu-signature-code { margin-top: 6px; font-size: 11px; color: #1e9e45; }
