:root {
  --abba-purple: #4c28d7;
  --abba-purple-dark: #3512a9;
  --abba-purple-soft: #ebe7ff;
  --abba-green: #7f961c;
  --abba-green-dark: #667a13;
  --abba-green-soft: #eef5d9;
  --abba-bg: #f8f6ee;
  --abba-text: #182033;
  --abba-muted: #667085;
  --abba-line: #deddf0;
  --abba-white: #ffffff;
  --abba-shadow: 0 22px 60px rgba(76,40,215,.08);
  --abba-radius: 18px;
}

.abba-extranet, .abba-extranet * { box-sizing: border-box; }
.abba-extranet { min-height: 86vh; display: grid; grid-template-columns: 310px 1fr; background: radial-gradient(circle at 70% 10%, #fff 0, var(--abba-bg) 56%, #f3f0e8 100%); color: var(--abba-text); font-family: Inter, Open Sans, Roboto, Arial, sans-serif; border-radius: 10px; overflow: hidden; }
.abba-sidebar { min-height: 86vh; background: linear-gradient(160deg, var(--abba-purple) 0%, var(--abba-purple-dark) 100%); color: #fff; padding: 46px 28px 30px; display: flex; flex-direction: column; position: relative; }
.abba-brand { margin-bottom: 58px; padding-left: 24px; position: relative; display: flex; flex-direction: column; gap: 4px; }
.abba-brand span { position: absolute; left: 0; top: 2px; width: 5px; height: 70px; border-radius: 20px; background: var(--abba-green); }
.abba-brand strong { font-size: 38px; line-height: 1; font-weight: 900; letter-spacing: .4px; }
.abba-brand small { color: #b6cf35; font-weight: 700; font-size: 13px; }
.abba-sidebar nav { display: flex; flex-direction: column; gap: 14px; }
.abba-sidebar nav a, .abba-sidebar-bottom a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: 11px; font-size: 17px; font-weight: 700; transition: background .18s ease, transform .18s ease; }
.abba-sidebar nav a:hover, .abba-sidebar nav a.is-active { background: rgba(255,255,255,.14); transform: translateX(2px); }
.abba-sidebar .dashicons { font-size: 23px; width: 24px; height: 24px; }
.abba-sidebar-bottom { margin-top: auto; }
.abba-main { padding: 48px 56px 60px; position: relative; }
.abba-topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 34px; }
.abba-breadcrumb { color: #566078; font-size: 14px; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .02em; }
.abba-topbar h1 { margin: 0; color: var(--abba-purple); font-size: clamp(32px, 3vw, 48px); line-height: 1; text-transform: uppercase; font-weight: 900; letter-spacing: -.02em; }
.abba-user-pill { display: flex; align-items: center; gap: 13px; font-weight: 800; text-align: right; }
.abba-user-pill span { display: block; max-width: 230px; line-height: 1.1; }
.abba-user-pill b { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--abba-purple), #7255ea); box-shadow: 0 9px 24px rgba(76,40,215,.25); }
.abba-count-pill { position: absolute; top: 64px; right: 170px; font-weight: 800; font-size: 19px; }

.abba-dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 22px; }
.abba-card, .abba-table-card, .abba-upload-card, .abba-folder-card, .abba-member-card, .abba-project-card, .abba-stats-row > div { background: rgba(255,255,255,.90); border: 1px solid var(--abba-line); border-radius: var(--abba-radius); box-shadow: var(--abba-shadow); }
.abba-card { padding: 26px 28px; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; }
.abba-card-wide { grid-column: span 2; }
.abba-card-title { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.abba-card-title .dashicons { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 12px; color: var(--abba-purple); background: var(--abba-purple-soft); font-size: 25px; }
.abba-card h3 { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 900; }
.abba-card p { color: #30374a; font-size: 15px; line-height: 1.45; margin: 0 0 20px; }
.abba-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.abba-tags span { background: #f0edff; color: var(--abba-purple); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.abba-btn { border: 0; border-radius: 9px; padding: 12px 18px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: #fff !important; text-decoration: none !important; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.abba-btn-purple { background: linear-gradient(135deg, #6a4be8, var(--abba-purple)); }
.abba-btn-green { background: linear-gradient(135deg, #93aa27, var(--abba-green-dark)); }
.abba-actions-row { display: flex; gap: 18px; margin-bottom: 36px; flex-wrap: wrap; }

.abba-filterbar { display: grid; grid-template-columns: 1fr 260px auto; gap: 18px; background: rgba(255,255,255,.82); border: 1px solid var(--abba-line); border-radius: 18px; padding: 20px; margin-bottom: 28px; }
.abba-filterbar input, .abba-filterbar select, .abba-upload-card input, .abba-upload-card select, .abba-upload-card textarea { width: 100%; border: 1px solid var(--abba-line); border-radius: 11px; padding: 13px 15px; min-height: 46px; background: #fff; color: var(--abba-text); font-size: 15px; }
.abba-directory-grid { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 18px; }
.abba-member-card { min-height: 248px; padding: 25px 18px 18px; text-align: center; }
.abba-avatar { width: 86px; height: 86px; margin: 0 auto 16px; border-radius: 999px; display: grid; place-items: center; background: linear-gradient(135deg, #eef0f7, #dfe2ec); color: #a4adbe; font-size: 27px; font-weight: 900; }
.abba-member-card h3 { margin: 0 0 6px; color: #143018; font-size: 20px; font-weight: 900; }
.abba-member-card strong { display: block; color: var(--abba-green-dark); font-size: 15px; margin-bottom: 11px; }
.abba-member-structure { display: inline-block; background: #f0efe9; color: #2f4627; border-radius: 999px; padding: 7px 12px; font-size: 13px; margin-bottom: 14px; }
.abba-member-actions { display: flex; justify-content: center; gap: 12px; }
.abba-member-actions a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--abba-line); border-radius: 10px; color: var(--abba-purple); text-decoration: none; background: #f7f5ff; }

.abba-folder-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 24px; margin-bottom: 34px; }
.abba-folder-card { padding: 30px 22px; min-height: 150px; display: grid; place-items: center; text-align: center; text-decoration: none !important; color: var(--abba-text); }
.abba-folder-card .dashicons { width: 68px; height: 68px; color: var(--abba-purple); font-size: 68px; margin-bottom: 14px; }
.abba-folder-card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 900; }
.abba-folder-card small { color: #566078; font-size: 14px; }
.abba-table-card { padding: 30px 38px; overflow-x: auto; }
.abba-table-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.abba-table-head h2 { margin: 0; color: var(--abba-purple); font-size: 24px; font-weight: 900; }
.abba-table-head a { color: var(--abba-purple); text-decoration: none; font-weight: 800; }
.abba-doc-table { width: 100%; border-collapse: collapse; }
.abba-doc-table th { text-align: left; padding: 14px 16px; color: #58627a; font-size: 12px; text-transform: uppercase; border-bottom: 1px solid var(--abba-line); }
.abba-doc-table td { padding: 16px; border-bottom: 1px solid #eceaf5; vertical-align: middle; }
.abba-file-icon { display: inline-grid; place-items: center; min-width: 26px; height: 28px; border-radius: 5px; background: #ff2e22; color: #fff; font-size: 9px; font-weight: 900; margin-right: 10px; }
.abba-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.abba-status-ok { background: #dff8e6; color: #198742; }
.abba-row-actions a { color: var(--abba-purple); text-decoration: none; margin-right: 10px; }
.abba-delete { color: #c0392b !important; }
.abba-empty { text-align: center; color: var(--abba-muted); padding: 30px !important; }
.abba-upload-card { padding: 28px; margin-bottom: 28px; }
.abba-upload-card h2 { margin-top: 0; color: var(--abba-purple); }
.abba-upload-card form { display: grid; grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 16px; }
.abba-upload-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; color: #344054; }
.abba-upload-card label:nth-child(6) { grid-column: span 2; }

.abba-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 30px; }
.abba-stats-row > div { min-height: 100px; padding: 22px; display: flex; align-items: center; gap: 18px; }
.abba-stats-row .dashicons { width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; color: var(--abba-purple); background: var(--abba-purple-soft); font-size: 34px; }
.abba-stats-row b { font-size: 34px; margin-right: 4px; }
.abba-stats-row small { display: block; color: #2e3344; font-size: 15px; }
.abba-project-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 22px; }
.abba-project-card { padding: 28px; }
.abba-project-meta { display: flex; justify-content: space-between; gap: 15px; align-items: center; color: var(--abba-green-dark); font-weight: 900; font-size: 13px; text-transform: uppercase; }
.abba-project-meta span { background: #dff8e6; color: #19a356; border-radius: 999px; padding: 7px 12px; }
.abba-project-card h3 { margin: 10px 0 18px; font-size: 24px; line-height: 1.18; font-weight: 900; }
.abba-project-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; background: #f1eefc; border-radius: 9px; padding: 10px 14px; margin-bottom: 20px; }
.abba-project-pills span { display: flex; align-items: center; gap: 7px; color: #28233c; font-weight: 700; }
.abba-project-card p { line-height: 1.5; color: #2f3548; min-height: 74px; }
.abba-project-download { border-top: 1px dashed var(--abba-line); padding-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }

.abba-login-box, .abba-access-denied { max-width: 460px; margin: 70px auto; background: #fff; border: 1px solid var(--abba-line); border-radius: 18px; padding: 34px; box-shadow: var(--abba-shadow); }
.abba-login-box h2, .abba-access-denied h2 { color: var(--abba-purple); margin-top: 0; }
.abba-login-box input { width: 100%; border-radius: 9px; border: 1px solid var(--abba-line); padding: 11px; }
.abba-login-box .button { background: var(--abba-purple); color: #fff; border: 0; padding: 10px 16px; border-radius: 8px; }

.abba-admin-wrap .abba-checkboxes label { display: inline-block; min-width: 210px; margin-bottom: 7px; }
.abba-access-table select { width: 100%; }

@media (max-width: 1180px) {
  .abba-extranet { grid-template-columns: 250px 1fr; }
  .abba-main { padding: 36px 28px; }
  .abba-dashboard-grid, .abba-directory-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .abba-folder-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 800px) {
  .abba-extranet { display: block; }
  .abba-sidebar { min-height: auto; padding: 26px; }
  .abba-sidebar nav { display: grid; grid-template-columns: repeat(2, 1fr); }
  .abba-dashboard-grid, .abba-directory-grid, .abba-project-grid, .abba-stats-row, .abba-filterbar, .abba-upload-card form { grid-template-columns: 1fr; }
  .abba-card-wide { grid-column: span 1; }
  .abba-topbar { flex-direction: column; }
  .abba-count-pill { position: static; margin-bottom: 18px; }
}

/* Version 1.1 — fiches adhérents */
.abba-member-profile-link { display: inline-flex; justify-content: center; align-items: center; width: 100%; margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--abba-purple-soft); color: var(--abba-purple) !important; text-decoration: none !important; font-weight: 900; }
.abba-profile-card { background: rgba(255,255,255,.92); border: 1px solid var(--abba-line); border-radius: var(--abba-radius); box-shadow: var(--abba-shadow); padding: 32px; margin-bottom: 28px; }
.abba-profile-hero { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.abba-profile-avatar { width: 112px; height: 112px; margin: 0; font-size: 36px; color: var(--abba-purple); background: var(--abba-purple-soft); }
.abba-profile-hero h2 { margin: 0 0 8px; color: var(--abba-purple); font-size: clamp(28px, 3vw, 42px); line-height: 1; font-weight: 900; }
.abba-profile-hero strong { display: block; color: var(--abba-green-dark); margin-bottom: 12px; font-size: 18px; }
.abba-profile-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.abba-profile-grid > div { background: #f8f7ff; border: 1px solid var(--abba-line); border-radius: 14px; padding: 16px; min-height: 94px; }
.abba-profile-grid small { display: block; color: var(--abba-muted); font-weight: 900; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; margin-bottom: 8px; }
.abba-profile-grid a { color: var(--abba-purple); text-decoration: none; font-weight: 800; overflow-wrap: anywhere; }
.abba-profile-grid span { color: var(--abba-muted); }
.abba-profile-presentation { border-top: 1px dashed var(--abba-line); padding-top: 24px; }
.abba-profile-presentation h3 { margin: 0 0 12px; color: var(--abba-purple); font-size: 24px; font-weight: 900; }
.abba-profile-presentation p { color: #30374a; font-size: 16px; line-height: 1.6; margin: 0; }
.abba-profile-form { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 16px; }
.abba-profile-form input, .abba-profile-form textarea { width: 100%; border: 1px solid var(--abba-line); border-radius: 11px; padding: 13px 15px; min-height: 46px; background: #fff; color: var(--abba-text); font-size: 15px; }
.abba-profile-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; color: #344054; }
.abba-form-full { grid-column: 1 / -1; }
.abba-profile-form small { color: var(--abba-muted); text-align: right; font-weight: 700; }
.abba-front-notice { background: #dff8e6; color: #198742; border: 1px solid #b8ebc6; border-radius: 12px; padding: 14px 18px; font-weight: 900; margin-bottom: 22px; }
.abba-muted-text { color: var(--abba-muted) !important; }

@media (max-width: 900px) {
  .abba-profile-grid, .abba-profile-form { grid-template-columns: 1fr; }
  .abba-profile-hero { align-items: flex-start; flex-direction: column; }
}

/* Version 1.2 — photo / logo adhérent */
.abba-avatar.abba-has-photo { overflow: hidden; background: #fff; border: 3px solid #fff; box-shadow: 0 8px 22px rgba(76,40,215,.12); }
.abba-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; display: block; }
.abba-photo-field { display: flex; align-items: center; gap: 18px; background: #f8f7ff; border: 1px solid var(--abba-line); border-radius: 16px; padding: 18px; }
.abba-photo-preview { width: 96px; height: 96px; flex: 0 0 96px; border-radius: 999px; overflow: hidden; display: grid; place-items: center; background: var(--abba-purple-soft); color: var(--abba-purple); font-size: 30px; font-weight: 900; border: 3px solid #fff; box-shadow: 0 8px 22px rgba(76,40,215,.12); }
.abba-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abba-photo-control { flex: 1; }
.abba-photo-control small { display: block; text-align: left; margin-top: 6px; }
.abba-photo-remove { margin-top: 10px; flex-direction: row !important; align-items: center; font-weight: 700 !important; color: var(--abba-muted) !important; }
.abba-photo-remove input { width: auto !important; min-height: auto !important; }

@media (max-width: 700px) {
  .abba-photo-field { align-items: flex-start; flex-direction: column; }
}

/* Version 1.3 — collège et projets dans l'annuaire */
.abba-filterbar-directory { grid-template-columns: minmax(220px, 1.2fr) minmax(190px, .9fr) minmax(220px, 1fr) minmax(170px, .8fr) auto; }
.abba-member-card { min-height: 338px; display: flex; flex-direction: column; align-items: center; }
.abba-member-card .abba-member-actions { margin-top: auto; }
.abba-member-college { display: inline-block; background: var(--abba-green-soft); color: var(--abba-green-dark); border: 1px solid rgba(127,150,28,.20); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 800; line-height: 1.25; margin: 0 0 10px; max-width: 100%; }
.abba-member-projects { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.abba-member-projects span { display: inline-flex; align-items: center; border-radius: 999px; background: #f0edff; color: var(--abba-purple); border: 1px solid rgba(76,40,215,.12); padding: 5px 9px; font-size: 11px; font-weight: 900; }
.abba-profile-projects { justify-content: flex-start; margin-top: 8px; }
.abba-profile-form select { width: 100%; border: 1px solid var(--abba-line); border-radius: 11px; padding: 13px 15px; min-height: 46px; background: #fff; color: var(--abba-text); font-size: 15px; }
.abba-profile-form select[multiple] { min-height: 160px; }
.abba-profile-grid > div:nth-child(5), .abba-profile-grid > div:nth-child(6) { grid-column: span 2; }

@media (max-width: 1180px) {
  .abba-filterbar-directory { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .abba-filterbar-directory .abba-btn { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .abba-filterbar-directory { grid-template-columns: 1fr; }
  .abba-profile-grid > div:nth-child(5), .abba-profile-grid > div:nth-child(6) { grid-column: span 1; }
}

/* Version 1.4 — statut adhérent + fonction distincts */
.abba-member-status { margin-bottom: 5px !important; }
.abba-member-function { display: block; color: #243047; font-size: 13px; font-weight: 800; line-height: 1.25; margin: 0 0 11px; }
.abba-profile-function { display: inline-block; margin: -4px 0 12px; font-size: 15px; color: #243047; }
.abba-profile-hero .abba-member-status { margin-bottom: 8px !important; }
.abba-profile-grid > div:nth-child(5), .abba-profile-grid > div:nth-child(6) { grid-column: span 1; }
.abba-profile-grid > div:nth-child(7), .abba-profile-grid > div:nth-child(8) { grid-column: span 2; }

@media (max-width: 800px) {
  .abba-profile-grid > div:nth-child(7), .abba-profile-grid > div:nth-child(8) { grid-column: span 1; }
}
