/* Cartes de statistiques du tableau de bord admin */

.stat-cards {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
}

.stat-cards > [class*="col-"] {
    display: flex;
    margin-bottom: 24px;
}

.stat-card {
    --accent: #4e73df;
    --accent-soft: rgba(78, 115, 223, 0.12);

    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 10px 24px rgba(16, 24, 40, 0.10);
}

.stat-card--green {
    --accent: #1a9f6e;
    --accent-soft: rgba(26, 159, 110, 0.12);
}

.stat-card--amber {
    --accent: #d68a00;
    --accent-soft: rgba(246, 166, 35, 0.15);
}

.stat-card__body {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    flex: 1;
}

.stat-card__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 24px;
}

.stat-card__label {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c757d;
}

.stat-card__value {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}

.stat-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid #f1f3f5;
    background: #fafbfc;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

a.stat-card__footer:hover,
a.stat-card__footer:focus {
    text-decoration: none;
    color: var(--accent);
    background: var(--accent-soft);
}

.stat-card__footer--muted {
    color: #9aa1a9;
    font-weight: 400;
}


/* ---------- Composants communs ---------- */

.page-header__sub {
    margin-left: 8px;
    font-size: 55%;
    color: #6c757d;
}

.admin-card {
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);
    overflow: hidden;
}

.admin-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f3f5;
}

.admin-card__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(78, 115, 223, 0.12);
    color: #4e73df;
    font-size: 17px;
}

.admin-card__icon--green {
    background: rgba(26, 159, 110, 0.12);
    color: #1a9f6e;
}

.admin-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

.admin-card__subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: #6c757d;
}

.admin-card__body {
    padding: 8px 24px 4px;
}

.admin-card__footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid #f1f3f5;
    background: #fafbfc;
}

.count-badge {
    display: inline-block;
    min-width: 24px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef1f4;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
}

.callout > .fa {
    margin-top: 2px;
}

.callout--warning {
    background: #fff8e6;
    border-color: #fde7b0;
    color: #8a5a00;
}

.callout--danger {
    background: #fdecec;
    border-color: #f8c9c9;
    color: #a12626;
}

.btn-modern {
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
}

.btn-modern .fa {
    margin-right: 4px;
}


/* ---------- Formulaires ---------- */

.form-section {
    padding: 18px 0;
    border-bottom: 1px dashed #edf0f2;
}

.form-section:last-child {
    border-bottom: 0;
}

.form-section__title {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c757d;
}

.admin-card .form-label,
.admin-card label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #343a40;
}

.admin-card .form-label .fa {
    width: 14px;
    color: #9aa1a9;
}

.admin-card .form-control {
    border-color: #dfe3e8;
    border-radius: 8px;
    box-shadow: none;
}

.admin-card .form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.15);
}

.admin-card .input-group .form-control:last-child {
    border-radius: 0 8px 8px 0;
}

.admin-card .input-group-addon {
    border-color: #dfe3e8;
    border-radius: 8px 0 0 8px;
    background: #f8f9fa;
}

.admin-card .file-input {
    height: auto;
    padding: 8px 10px;
    border-style: dashed;
    background: #fafbfc;
    cursor: pointer;
}

.form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #8a929a;
}


/* ---------- Tableaux ---------- */

.admin-card .table-responsive {
    margin: 0;
    border: 0;
}

.table-modern {
    margin: 0;
}

.table-modern > thead > tr > th {
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f2;
    background: #fafbfc;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c757d;
    white-space: nowrap;
}

.table-modern > tbody > tr > td {
    padding: 14px 16px;
    border-top: 1px solid #f1f3f5;
    vertical-align: middle;
    color: #343a40;
}

.table-modern > tbody > tr:hover > td {
    background: #fafbfd;
}

.cell-main {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

.cell-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #8a929a;
    white-space: nowrap;
}

.cell-comment {
    max-width: 260px;
    white-space: normal;
    word-wrap: break-word;
}

.doc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 999px;
    background: #fff;
    color: #343a40;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.doc-chip .fa {
    color: #d9534f;
}

.doc-chip .fa-list {
    color: #4e73df;
}

.doc-chip:hover,
.doc-chip:focus {
    border-color: #4e73df;
    background: rgba(78, 115, 223, 0.08);
    color: #1f2937;
    outline: none;
}

.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #c0392b;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-icon-danger:hover,
.btn-icon-danger:focus {
    border-color: #f8c9c9;
    background: #fdecec;
    outline: none;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: #8a929a;
}

.empty-state .fa {
    margin-bottom: 10px;
    font-size: 36px;
    color: #c4c9cf;
}

.empty-state p {
    margin: 0;
}


/* ---------- Modales ---------- */

.modal-modern .modal-content {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
    overflow: hidden;
}

.modal-modern .modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f3f5;
}

.modal-modern .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.modal-modern .modal-body {
    padding: 20px 24px;
}

.modal-modern .modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #f1f3f5;
    background: #fafbfc;
}

.modal-danger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fdecec;
    color: #c0392b;
    font-size: 15px;
}


/* ---------- Lecteur PDF ---------- */

#modal_pdf_viewer .pdf-viewer-dialog {
    width: 95vw;
    max-width: 1400px;
    height: 92vh;
    margin: 4vh auto 0;
}

#modal_pdf_viewer .pdf-viewer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
    overflow: hidden;
}

#modal_pdf_viewer .pdf-viewer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px 8px;
}

#modal_pdf_viewer .pdf-viewer-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

#modal_pdf_viewer .pdf-viewer-subtitle {
    margin-top: 2px;
    font-size: 13px;
    color: #6c757d;
}

#modal_pdf_viewer .pdf-viewer-close {
    padding: 4px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #8a929a;
    font-size: 18px;
    line-height: 1;
}

#modal_pdf_viewer .pdf-viewer-close:hover {
    background: #f1f3f5;
    color: #1f2937;
}

#modal_pdf_viewer .pdf-viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px 12px;
    border-bottom: 1px solid #f1f3f5;
}

#modal_pdf_viewer .pdf-viewer-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: #f1f3f5;
}

#modal_pdf_viewer .pdf-viewer-tab {
    padding: 6px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
}

#modal_pdf_viewer .pdf-viewer-tab:hover {
    color: #1f2937;
}

#modal_pdf_viewer .pdf-viewer-tab.active {
    background: #fff;
    color: #4e73df;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
}

#modal_pdf_viewer .pdf-viewer-actions {
    display: flex;
    gap: 6px;
}

#modal_pdf_viewer .pdf-viewer-action {
    padding: 6px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    color: #343a40;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

#modal_pdf_viewer .pdf-viewer-action:hover,
#modal_pdf_viewer .pdf-viewer-action:focus {
    border-color: #4e73df;
    background: rgba(78, 115, 223, 0.08);
    color: #1f2937;
    text-decoration: none;
}

#modal_pdf_viewer .pdf-viewer-body {
    position: relative;
    flex: 1;
    background: #525659;
}

#modal_pdf_viewer .pdf-viewer-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

#modal_pdf_viewer .pdf-viewer-loading {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
}


/* ---------- Gestion des accès ---------- */

.admin-card__icon--amber {
    background: rgba(246, 166, 35, 0.15);
    color: #d68a00;
}

.admin-card__heading {
    flex: 1;
    min-width: 0;
}

.person {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(78, 115, 223, 0.12);
    color: #4e73df;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef1f4;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.role-badge--super {
    background: rgba(246, 166, 35, 0.15);
    color: #a86a00;
}

.cell-link {
    color: #343a40;
}

.cell-link:hover,
.cell-link:focus {
    color: #4e73df;
}

.cell-actions {
    white-space: nowrap;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #fff;
    color: #343a40;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover,
.btn-ghost:focus {
    border-color: #4e73df;
    background: rgba(78, 115, 223, 0.08);
    outline: none;
}

/* ligne d'ajout insérée par accesAdmin.js */
.table-access #newMembreLine > td {
    background: #f5f8ff;
    border-top: 0;
}

.table-access #newMembreLine .form-control {
    min-width: 120px;
}

.table-access #newMembreLine .btn {
    border-radius: 8px;
    font-weight: 600;
}

.modal-warning-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff8e6;
    color: #d68a00;
    font-size: 15px;
}


/* ---------- Structure : barre du haut, menu latéral, fond ---------- */

body {
    background: #f5f7fb;
    color: #343a40;
    -webkit-font-smoothing: antialiased;
}

#wrapper,
#page-wrapper {
    background: #f5f7fb;
}

@media (min-width: 768px) {
    #page-wrapper {
        border-left: 0;
        padding: 0 32px 32px;
    }
}

.page-header {
    margin: 28px 0 22px;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4e73df, #2f4fb5);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(78, 115, 223, 0.30);
}

.brand-mark--sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: none;
}

.admin-topbar.navbar-default {
    min-height: 51px;
    border: 0;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.admin-brand.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 51px;
    padding: 0 20px;
    color: #1f2937;
    font-size: 16px;
    font-weight: 700;
}

.admin-brand.navbar-brand:hover,
.admin-brand.navbar-brand:focus {
    color: #1f2937;
}

.admin-brand__sub {
    margin-left: 4px;
    font-weight: 400;
    color: #8a929a;
}

.admin-topbar .navbar-top-links > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 51px;
    min-height: 51px;
    padding: 0 14px;
    color: #495057;
    font-size: 14px;
}

.admin-topbar .navbar-top-links > li > a:hover,
.admin-topbar .navbar-top-links > li > a:focus,
.admin-topbar .navbar-top-links > .open > a {
    background: #f5f7fb;
    color: #1f2937;
}

.topbar-user__name {
    font-weight: 600;
}

.avatar--sm {
    width: 30px;
    height: 30px;
    font-size: 11px;
}

.admin-topbar .dropdown-user {
    min-width: 230px;
    padding: 6px 0;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
}

.admin-topbar .dropdown-user .dropdown-header {
    padding: 8px 16px;
    font-size: 12px;
    line-height: 1.5;
    color: #6c757d;
}

.admin-topbar .dropdown-user > li > a {
    padding: 8px 16px;
    color: #343a40;
}

.admin-topbar .dropdown-user > li > a:hover {
    background: #f5f7fb;
}

.admin-topbar .navbar-toggle {
    margin-top: 8px;
    border-color: #dfe3e8;
    border-radius: 8px;
}

/* menu latéral */

.admin-sidebar {
    background: #fff;
}

@media (min-width: 768px) {
    .admin-sidebar {
        min-height: calc(100vh - 51px);
        border-right: 1px solid #e9ecef;
    }
}

.admin-sidebar .sidebar-nav {
    padding: 18px 12px !important;
}

.sidebar-label {
    margin: 0 12px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa1a9;
}

.admin-sidebar ul li {
    border-bottom: 0;
}

.admin-sidebar .nav > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
}

.admin-sidebar .nav > li > a .fa {
    color: #9aa1a9;
}

.admin-sidebar .nav > li > a:hover,
.admin-sidebar .nav > li > a:focus {
    background: #f5f7fb;
    color: #1f2937;
}

.admin-sidebar .nav > li > a.active,
.admin-sidebar .nav > li > a.active:hover {
    background: rgba(78, 115, 223, 0.10);
    color: #2f4fb5;
    font-weight: 600;
}

.admin-sidebar .nav > li > a.active .fa {
    color: #4e73df;
}

.admin-sidebar .sidebar-bottom {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f3f5;
}


/* ---------- Pages de connexion / mot de passe ---------- */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(78, 115, 223, 0.12), transparent 70%),
        #f5f7fb;
}

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 56px 16px 32px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand__name {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.auth-brand__sub {
    font-size: 13px;
    color: #6c757d;
}

.auth-card {
    width: 100%;
    padding: 28px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.08);
}

.auth-card__title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.auth-card__subtitle {
    margin: 0 0 22px;
    font-size: 14px;
    color: #6c757d;
}

.auth-card .form-label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #343a40;
}

.auth-card .form-control {
    height: 42px;
    border-color: #dfe3e8;
    border-radius: 8px;
    box-shadow: none;
}

.auth-card .form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.15);
}

.auth-card .alert {
    border-radius: 8px;
}

.auth-remember {
    margin: 4px 0 18px;
    color: #495057;
}

.auth-submit {
    padding: 11px 18px;
}

.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    font-size: 22px;
}

.auth-status--warning {
    background: #fff8e6;
    color: #d68a00;
}

.auth-back {
    margin-top: 20px;
    font-size: 13px;
    color: #6c757d;
}

.auth-back:hover,
.auth-back:focus {
    color: #4e73df;
    text-decoration: none;
}
