/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f3f0e8;
    --surface: #ffffff;
    --border: #dcd8cc;
    --text: #1a1a1a;
    --text-muted: #666;
    --primary: #5b8c35;
    --primary-hover: #4a7229;
    --danger: #dc2626;
    --green: #5b8c35;
    --orange: #ea580c;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    padding: 6px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    background: #edf4e6;
    color: var(--primary);
    text-decoration: none;
}

.nav-links a.active {
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
    text-decoration: none;
}

/* ── Main ── */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.subtitle { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.retour { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.retour:hover { color: var(--primary); }

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text);
}

/* ── Grids ── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ── Progression ── */
.progression-card {
    margin-bottom: 16px;
    border-top: 3px solid var(--primary);
}

.progression-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.revenu { font-size: 28px; font-weight: 700; }
.objectif { color: var(--text-muted); font-size: 16px; }
.pourcentage { margin-left: auto; font-size: 20px; font-weight: 600; color: var(--primary); }

.barre-container {
    background: var(--border);
    border-radius: 100px;
    height: 10px;
    overflow: hidden;
}

.barre {
    background: linear-gradient(90deg, #4a7229, #7ab648);
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
    min-width: 4px;
}

/* ── Lists ── */
.liste-simple {
    list-style: none;
}

.liste-simple li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.liste-simple li:last-child { border-bottom: none; }

.vide { color: var(--text-muted); font-size: 14px; }

/* ── Badges ── */
.badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.badge.vert { background: #dcfce7; color: var(--green); }
.badge.rouge { background: #fee2e2; color: var(--danger); }
.badge.date { background: #edf4e6; color: var(--primary); }

/* ── Table ── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf9f5; }

/* ── Filtres ── */
.filtres {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.filtres input[type="text"],
.filtres select {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
}

/* ── Client Grid ── */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.client-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: block;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.client-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(91,140,53,0.12);
    transform: translateY(-1px);
    text-decoration: none;
}

.client-card.archived { opacity: 0.5; }

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.client-nom { font-weight: 600; color: var(--text); }
.client-prix { font-weight: 600; color: var(--primary); font-size: 14px; }

.client-card-info {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.client-card-date {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Formulaires ── */
.form-client, .form-passage {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,140,53,0.1);
}

.checkbox-label {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
}

textarea { resize: vertical; }

.form-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

/* ── Info list ── */
.info-list {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 16px;
    font-size: 14px;
}

dt { color: var(--text-muted); font-weight: 500; }
dd { color: var(--text); }

.notes-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.notes-block p { margin-top: 6px; color: var(--text); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn:hover { background: var(--primary-hover); color: white; text-decoration: none; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-secondary:hover { background: var(--bg); text-decoration: none; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--surface);
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger:hover { background: #fee2e2; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn-ghost:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.btn-small {
    padding: 3px 10px;
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
}

.btn-small:hover { background: #edf4e6; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
