/* ===========================
   AMBIOS.org - membres.css
   Interface espace membres
   =========================== */

/* ---------- Layout général ---------- */
.membres-wrapper {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    background-color: var(--color-bg);
}

/* Sidebar membres */
.membres-sidebar {
    width: 240px;
    background-color: var(--color-bg-alt);
    border-right: 3px solid var(--color-primary); /* Vert Mali */
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.membres-sidebar h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.membres-sidebar a {
    display: block;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.35rem;
    border-radius: var(--radius-sm);
    color: var(--color-dark);
    transition: 0.2s ease;
}

.membres-sidebar a:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* Contenu membres */
.membres-content {
    flex: 1;
    padding: 1.5rem;
}

/* ---------- Tableau de bord membre ---------- */
.member-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: 280px;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 20px 16px;
    overflow-y: auto;
    border-right: 1px solid rgba(18, 56, 43, 0.12);
    background:
        linear-gradient(180deg, #12382b 0%, #102f25 58%, #0d261e 100%);
    box-shadow: 12px 0 32px rgba(18, 56, 43, 0.14);
}

.member-sidebar-brand {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    text-decoration: none;
}

.member-sidebar-brand:hover {
    color: #fff;
}

.member-sidebar-logo,
.member-sidebar-avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #f4c542;
    color: #253016;
    font-weight: 950;
}

.member-sidebar-brand strong {
    display: block;
    color: #fff;
    font-size: 1.06rem;
    line-height: 1.15;
}

.member-sidebar-brand small,
.member-sidebar-account small {
    display: block;
    margin-top: 2px;
    color: #b8d0c5;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.member-sidebar-nav {
    display: grid;
    align-content: start;
    gap: 12px;
}

.member-sidebar-section {
    display: block;
    margin: 6px 8px 0;
    color: #8fb2a1;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-sidebar-nav ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.member-sidebar-link {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #e8f3ee;
    font-weight: 850;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.member-sidebar-link:hover,
.member-sidebar-link:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(2px);
}

.member-sidebar-link.active {
    background: #fff;
    color: #0b6b45;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.member-sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #f4c542;
}

.member-sidebar-link.danger {
    color: #ffd7d7;
}

.member-sidebar-link.danger:hover,
.member-sidebar-link.danger:focus {
    background: rgba(159, 29, 29, 0.2);
    color: #fff;
}

.member-sidebar-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #f4c542;
    font-size: 0.72rem;
    font-weight: 950;
}

.member-sidebar-link.active .member-sidebar-icon {
    background: #eef6f1;
    color: #0b6b45;
}

.member-sidebar-account {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.member-sidebar-account-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 0;
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: left;
}

.member-sidebar-account-toggle strong {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-sidebar-account .dropdown-menu {
    width: 100%;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
}

.member-sidebar .nav-link {
    border-radius: 6px;
    color: #263b32;
    font-weight: 750;
}

.member-sidebar .nav-link:hover,
.member-sidebar .nav-link:focus {
    background: #eef6f1;
    color: #0b6b45;
}

.member-dashboard {
    min-height: 100vh;
    margin-left: 280px;
    padding: 28px;
    background: #f4f7f5;
    overflow-x: hidden;
}

.member-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #12382b;
    color: #fff;
    box-shadow: 0 10px 28px rgba(18, 56, 43, 0.12);
}

.member-dashboard-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f4c542;
    color: #253016;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.member-dashboard-hero h1 {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.08;
}

.member-dashboard-hero p {
    max-width: 720px;
    margin: 0;
    color: #d9e8e1;
    line-height: 1.6;
}

.member-dashboard-primary,
.member-action-card a,
.member-profile-summary a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 11px 14px;
    font-weight: 900;
    text-decoration: none;
}

.member-dashboard-primary {
    flex: 0 0 auto;
    background: #f4c542;
    color: #253016;
}

.member-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.member-stat-card,
.member-panel,
.member-action-card {
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 56, 43, 0.08);
}

.member-stat-card {
    display: grid;
    gap: 6px;
    padding: 20px;
}

.member-stat-value {
    color: #0b6b45;
    font-size: 2rem;
    line-height: 1;
    font-weight: 950;
}

.member-stat-label {
    color: #5b6b64;
    font-weight: 750;
}

.member-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    gap: 20px;
    align-items: start;
}

.member-dashboard-main,
.member-dashboard-side {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.member-panel {
    overflow: hidden;
}

.member-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid #dfe8e3;
}

.member-panel-head.compact {
    padding-bottom: 14px;
}

.member-panel h2 {
    margin: 0;
    color: #12382b;
    font-size: 1.2rem;
}

.member-panel-head p {
    margin: 6px 0 0;
    color: #5b6b64;
}

.member-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
}

.member-action-card {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    padding: 20px;
    border-top: 4px solid #0b6b45;
    min-width: 0;
}

.member-action-card.highlight {
    border-top-color: #f4c542;
    background: #fbfaf3;
}

.member-action-card strong {
    margin-bottom: 8px;
    color: #12382b;
    font-size: 1.05rem;
}

.member-action-card p {
    margin: 0 0 16px;
    color: #5b6b64;
    line-height: 1.58;
}

.member-action-card a {
    margin-top: auto;
    background: #0b6b45;
    color: #fff;
}

.member-announcement-list {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.member-announcement {
    padding: 16px;
    border-radius: 8px;
    background: #f8fbf9;
    border-left: 4px solid #0b6b45;
}

.member-announcement.warning {
    border-left-color: #f4c542;
    background: #fffaf0;
}

.member-announcement-date {
    display: inline-flex;
    margin-bottom: 8px;
    color: #0b6b45;
    font-size: 0.84rem;
    font-weight: 900;
}

.member-announcement strong {
    display: block;
    margin-bottom: 6px;
    color: #12382b;
}

.member-announcement p {
    margin: 0;
    color: #5b6b64;
    line-height: 1.55;
}

.member-quick-list {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.member-quick-list a {
    display: grid;
    gap: 3px;
    padding: 13px 14px;
    border-radius: 6px;
    background: #f8fbf9;
    color: #12382b;
    text-decoration: none;
}

.member-quick-list a:hover {
    background: #eef6f1;
}

.member-quick-list span {
    font-weight: 900;
}

.member-quick-list small {
    color: #5b6b64;
}

.member-profile-summary {
    padding: 20px;
}

.member-profile-summary p {
    color: #5b6b64;
    line-height: 1.55;
}

.member-profile-summary a {
    background: #e8eeeb;
    color: #263b32;
}

/* ---------- Pages internes membres ---------- */
.member-page {
    min-height: 100vh;
    margin-left: 280px;
    padding: 28px;
    background: #f4f7f5;
    overflow-x: hidden;
}

.member-page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 26px 28px;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #12382b;
    color: #fff;
    box-shadow: 0 10px 28px rgba(18, 56, 43, 0.12);
}

.member-page-hero h1 {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.08;
}

.member-page-hero p {
    max-width: 760px;
    margin: 0;
    color: #d9e8e1;
    line-height: 1.6;
}

.member-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.member-resource-card {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    padding: 22px;
    border: 1px solid #dfe8e3;
    border-top: 4px solid #0b6b45;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 56, 43, 0.08);
}

.member-resource-status {
    align-self: flex-start;
    margin-bottom: 14px;
    border-radius: 999px;
    padding: 5px 10px;
    background: #eef6f1;
    color: #0b6b45;
    font-size: 0.82rem;
    font-weight: 900;
}

.member-resource-card h2 {
    margin: 0 0 10px;
    color: #12382b;
    font-size: 1.18rem;
}

.member-resource-card p {
    margin: 0 0 18px;
    color: #5b6b64;
    line-height: 1.58;
}

.member-resource-card a,
.member-document-item a,
.member-card-form button {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    padding: 11px 14px;
    background: #0b6b45;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.member-document-list {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.member-document-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #f8fbf9;
}

.member-document-item strong,
.member-document-item span {
    display: block;
}

.member-document-item strong {
    margin-bottom: 4px;
    color: #12382b;
}

.member-document-item span {
    color: #5b6b64;
    line-height: 1.45;
}

.member-card-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.member-id-preview {
    padding: 24px;
    border-radius: 8px;
    background: #12382b;
    color: #fff;
    box-shadow: 0 16px 38px rgba(18, 56, 43, 0.18);
}

.member-id-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 26px;
}

.member-id-top span {
    color: #f4c542;
    font-weight: 900;
}

.member-id-avatar {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #f4c542;
    color: #253016;
    font-size: 2.4rem;
    font-weight: 950;
}

.member-id-preview h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.5rem;
}

.member-id-preview p,
.member-id-preview small {
    color: #d9e8e1;
    line-height: 1.55;
}

.member-card-form {
    overflow: hidden;
}

.member-form-body {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.member-form-body label {
    display: grid;
    gap: 7px;
    color: #21362d;
    font-weight: 850;
}

.member-form-body input,
.member-form-body select,
.member-form-body textarea {
    width: 100%;
    border: 1px solid #cfd9d4;
    border-radius: 6px;
    padding: 11px 12px;
    background: #fff;
    font: inherit;
}

.member-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.member-form-alert {
    border-radius: 6px;
    padding: 12px 14px;
    font-weight: 800;
}

.member-form-alert.success {
    border: 1px solid #b8dfc9;
    background: #eef6f1;
    color: #0b6b45;
}

.member-form-alert.error {
    border: 1px solid #f1b6b6;
    background: #fff3f3;
    color: #9f1d1d;
}

.member-cotisation-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
    gap: 20px;
    align-items: start;
}

.member-cotisation-list {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.member-cotisation-item,
.member-cotisation-empty {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #fff;
}

.member-cotisation-empty {
    grid-template-columns: 1fr;
}

.member-cotisation-item strong,
.member-cotisation-empty strong {
    display: block;
    color: #12382b;
}

.member-cotisation-item span,
.member-cotisation-item small,
.member-cotisation-empty p {
    display: block;
    margin: 2px 0 0;
    color: #5d6c65;
}

.member-status-badge {
    display: inline-flex;
    justify-content: center;
    min-width: 112px;
    border-radius: 999px;
    padding: 7px 10px;
    background: #eef3f0;
    color: #40534a;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.member-status-badge.en_attente {
    background: #fff8df;
    color: #745700;
}

.member-status-badge.valide {
    background: #eef6f1;
    color: #0b6b45;
}

.member-status-badge.refuse {
    background: #fff3f3;
    color: #9f1d1d;
}

.member-status-badge.exempt {
    background: #eef2ff;
    color: #3443a5;
}

.member-profile-card {
    padding: 24px;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 56, 43, 0.08);
}

.member-profile-card h2 {
    margin: 0 0 8px;
    color: #12382b;
    font-size: 1.45rem;
}

.member-profile-card p {
    margin: 0 0 14px;
    color: #5b6b64;
}

.member-profile-card > span {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eef6f1;
    color: #0b6b45;
    font-weight: 900;
}

.member-info-list,
.member-message-list {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.member-info-list article,
.member-message-card {
    padding: 16px;
    border: 1px solid #dfe8e3;
    border-radius: 8px;
    background: #f8fbf9;
}

.member-info-list strong,
.member-info-list span,
.member-message-card strong,
.member-message-card span {
    display: block;
}

.member-info-list strong,
.member-message-card strong {
    margin-bottom: 6px;
    color: #12382b;
}

.member-info-list span,
.member-message-card p {
    margin: 0;
    color: #5b6b64;
    line-height: 1.55;
}

.member-message-card {
    border-left: 4px solid #0b6b45;
}

.member-message-card.warning {
    border-left-color: #f4c542;
    background: #fffaf0;
}

.member-message-card > span {
    margin-bottom: 8px;
    color: #0b6b45;
    font-size: 0.84rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* ---------- Profil membre ---------- */
.profil-card {
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
}

.profil-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profil-header img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
}

.profil-header h2 {
    font-size: 1.4rem;
    color: var(--color-dark);
}

.profil-info {
    margin-top: 1rem;
}

.profil-info p {
    margin-bottom: 0.4rem;
    color: var(--color-muted);
}

/* ---------- Documents membres ---------- */
.docs-list {
    margin-top: 1rem;
}

.docs-item {
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-item:hover {
    background-color: rgba(46, 204, 113, 0.08);
}

.docs-item .title {
    font-weight: 600;
    color: var(--color-dark);
}

.docs-item .actions a {
    margin-left: 0.5rem;
    color: var(--color-primary);
    font-weight: 600;
}

/* ---------- Notifications membres ---------- */
.notifications-box {
    background-color: var(--color-bg-alt);
    border-left: 4px solid var(--color-secondary); /* Jaune AMBIOS */
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
}

.notifications-box h4 {
    font-size: 1.1rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.notification-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item p {
    margin-bottom: 0.3rem;
}

.notification-item .date {
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* ---------- Formations membres ---------- */
.formation-card {
    background-color: var(--color-bg-alt);
    border-left: 4px solid var(--color-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
}

.formation-card h4 {
    font-size: 1.1rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.formation-card .status {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.formation-card .btn {
    margin-top: 0.75rem;
}

/* ---------- Responsive membres ---------- */
@media (max-width: 900px) {
    .member-sidebar {
        position: static;
        width: 100%;
        height: auto;
        display: block;
        padding: 16px;
        box-shadow: none;
        border-right: 0;
        border-bottom: 1px solid rgba(18, 56, 43, 0.16);
        background: #12382b;
    }

    .member-sidebar-brand {
        padding: 4px 2px 14px;
    }

    .member-sidebar-nav {
        gap: 10px;
    }

    .member-sidebar-nav ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .member-sidebar-link {
        min-height: 42px;
    }

    .member-sidebar-link.active::before {
        left: 8px;
        right: 8px;
        top: auto;
        bottom: -2px;
        width: auto;
        height: 3px;
        border-radius: 999px;
    }

    .member-sidebar-account {
        margin-top: 14px;
    }

    .membres-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 3px solid var(--color-primary);
    }

    .membres-content {
        margin-left: 0;
    }

    .profil-header {
        flex-direction: column;
        text-align: center;
    }

    .member-dashboard {
        margin-left: 0;
        padding: 18px;
    }

    .member-page {
        margin-left: 0;
        padding: 18px;
    }

    .member-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .member-cotisation-layout {
        grid-template-columns: 1fr;
    }

    .member-dashboard-hero,
    .member-page-hero {
        align-items: start;
        flex-direction: column;
    }

    .member-stat-grid,
    .member-action-grid,
    .member-page-grid,
    .member-card-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .member-sidebar-nav ul {
        grid-template-columns: 1fr;
    }

    .member-form-row,
    .member-cotisation-item {
        grid-template-columns: 1fr;
    }

    .member-status-badge {
        justify-self: start;
    }

    .member-stat-grid,
    .member-action-grid,
    .member-page-grid,
    .member-card-layout,
    .member-document-item {
        grid-template-columns: 1fr;
    }

    .member-dashboard-primary,
    .member-document-item a,
    .member-resource-card a {
        width: 100%;
    }
}
