/* ============================================================
   ETHNICART — Base adhérents
   Palette : encre #1c1a22, papier #faf7f2, ocre #c8802e, sarcelle #2f6f63
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
    --ink: #1c1a22;
    --paper: #faf7f2;
    --card: #ffffff;
    --ochre: #c8802e;
    --ochre-deep: #9c5f1c;
    --teal: #2f6f63;
    --red: #a5402f;
    --line: #e4ddd0;
    --muted: #8a8378;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, Segoe UI, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    margin: 0;
    color: var(--ink);
    line-height: 1.5;
}

h1, h2 { font-family: var(--font-display); font-weight: 600; margin: 0 0 6px; }
h1 { font-size: 26px; }
h2 { font-size: 18px; margin-top: 28px; }

.container { max-width: 1000px; margin: 24px auto; padding: 0 20px; }
.container-wide { max-width: 1500px; margin: 24px auto; padding: 0 28px; }

.container-small {
    max-width: 380px; margin: 60px auto; padding: 28px;
    background: var(--card); border-radius: 12px; border: 1px solid var(--line);
    box-shadow: 0 4px 20px rgba(28,26,34,.06);
}

/* ---- Navigation ---- */
.topnav {
    display: flex; align-items: center; gap: 18px;
    background: var(--ink); color: var(--paper);
    padding: 12px 24px; flex-wrap: wrap;
}
.topnav a { color: #d9d3c6; text-decoration: none; font-size: 14px; font-weight: 500; }
.topnav a:hover { color: #fff; }
.topnav .brand { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: #fff; }
.topnav-logo { height: 34px; width: auto; border-radius: 4px; background: #fff; padding: 3px 7px; }
.topnav .spacer { flex: 1; }
.thread-bar {
    height: 5px;
    background: repeating-linear-gradient(90deg, var(--ochre) 0 16px, var(--teal) 16px 32px, var(--red) 32px 40px, transparent 40px 48px);
}

.login-logo { display: block; margin: 0 auto 18px; height: 58px; }

/* ---- Texte utilitaire ---- */
.lead { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }
.num { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity-list li:last-child { border-bottom: none; }
.activity-list .when { color: var(--muted); font-size: 12.5px; }

/* ---- Formulaires ---- */
label { display: block; margin: 12px 0 5px; font-weight: 600; font-size: 13.5px; }
input, textarea, select {
    width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 14px; font-family: var(--font-body); background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ochre); outline-offset: 1px; border-color: var(--ochre); }
fieldset { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
legend { font-size: 12.5px; color: var(--muted); padding: 0 6px; }

button, .btn {
    display: inline-block; margin-top: 16px; padding: 10px 18px;
    background: var(--ink); color: #fff; border: none; border-radius: 6px;
    cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 600;
    font-family: var(--font-body); transition: opacity .15s;
}
button:hover, .btn:hover { opacity: .88; }
.btn-valider { background: var(--teal); }
.btn-danger { background: var(--red); }
.btn-muted { background: #6b665c; }

/* ---- Panneaux ---- */
.panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 20px 22px; margin: 16px 0;
}

/* ---- Tableaux ---- */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); margin-top: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
.table-wrap table { margin-top: 0; border: none; border-radius: 0; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; white-space: nowrap; }
td:last-child, th:last-child { white-space: normal; }
th {
    background: #f1ece2; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 600;
}
tbody tr:hover { background: #faf6ee; }
tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge { padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.badge.big { font-size: 18px; padding: 8px 18px; }
.badge.green { background: var(--teal); }
.badge.orange { background: var(--ochre-deep); }
.badge.red { background: var(--red); }

/* ---- Cartes de stats (tableau de bord) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 18px 20px; text-align: left;
}
.card .nb { display: block; font-family: var(--font-mono); font-size: 30px; font-weight: 500; color: var(--ink); }
.card .lbl, .card > span:last-child { font-size: 12.5px; color: var(--muted); }
.card.green .nb { color: var(--teal); }
.card.orange .nb { color: var(--ochre-deep); }
.card.red .nb { color: var(--red); }

/* ---- Grilles de mise en page ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.layout-2col { display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

.inline-form { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; }

/* ---- Messages ---- */
.msg { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin: 14px 0; }
.msg.error { background: #f7e3df; color: var(--red); }
.msg.success { background: #e4efe9; color: var(--teal); }

.verify { text-align: center; margin-top: 100px; }

/* ---- Onglets de filtre (adhérents actifs / archivés) ---- */
.tabs-filtre { display: flex; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--line); }
.tabs-filtre a {
    padding: 9px 4px; margin-right: 20px; text-decoration: none; color: var(--muted);
    font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent;
}
.tabs-filtre a.actif { color: var(--ink); border-bottom-color: var(--ochre); }

/* ---- Barre d'actions groupées ---- */
.barre-actions {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 12px 16px; margin: 14px 0;
}
.barre-actions button, .barre-actions .btn { margin-top: 0; }
