:root {
    --bg: #f4f5f7;
    --bg-panel: #ffffff;
    --bg-panel-hover: #eef0f4;
    --border: #dde1e8;
    --text: #1c1f26;
    --text-dim: #6b7280;
    --accent: #3b6fd4;
    --accent-hover: #2f5cb8;
    --accent-soft: rgba(59, 111, 212, 0.10);
    --green: #1f9d6b;
    --green-soft: rgba(31, 157, 107, 0.10);
    --orange: #b4790f;
    --orange-soft: rgba(180, 121, 15, 0.12);
    --red: #cf4444;
    --red-soft: rgba(207, 68, 68, 0.10);
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(20, 24, 32, 0.04), 0 1px 8px rgba(20, 24, 32, 0.03);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 32px;
    line-height: 1.4;
}

h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; }

a { color: var(--accent); }

.page-subtitle { color: var(--text-dim); margin-bottom: 24px; font-size: 14px; }

.back-link {
    color: var(--text-dim);
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
}
.back-link:hover { color: var(--text); }

/* ---------- Cartes / panneaux ---------- */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

/* ---------- Formulaires ---------- */
label { display: block; font-size: 12px; margin-bottom: 5px; color: var(--text-dim); font-weight: 600; }
input, select, textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 80px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    transition: filter 0.1s, background 0.1s, border-color 0.1s;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { filter: brightness(0.92); }

.btn-sm { padding: 5px 10px; font-size: 12px; gap: 4px; }
.btn-icon-only { padding: 6px; width: 30px; height: 30px; justify-content: center; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(0.92); }

.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-panel-hover); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: transparent; padding-left: 6px; padding-right: 6px; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }

.btn-danger { background: transparent; color: var(--red); border-color: var(--red-soft); }
.btn-danger:hover { background: var(--red-soft); }

.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { filter: brightness(0.92); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.btn-group-item, .btn-group form { display: inline-flex; margin: 0; }

/* ---------- Badges type de contrat ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.badge-bcp { background: var(--accent-soft); color: var(--accent); }
.badge-drp { background: var(--orange-soft); color: var(--orange); }

/* ---------- Statut (pastille + texte) ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}
.status-pill.realise { background: var(--green-soft); color: var(--green); }
.status-pill.planifie { background: var(--orange-soft); color: var(--orange); }
.status-pill.a-planifier { background: var(--red-soft); color: var(--red); }
.status-pill.annule { background: var(--bg); color: var(--text-dim); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-realise { background: var(--green); }
.dot-planifie { background: var(--orange); }
.dot-a-planifier { background: var(--red); }
.dot-annule { background: var(--text-dim); }

/* ---------- Tableau ---------- */
table { width: 100%; border-collapse: collapse; background: var(--bg-panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { color: var(--text-dim); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-panel-hover); }
.text-dim { color: var(--text-dim); }
.empty-row { text-align: center; color: var(--text-dim); padding: 30px; }

/* ---------- Alertes ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.alert-error { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* ---------- Toolbar générique ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar select { width: auto; margin: 0; }
.toolbar-spacer { flex: 1; }

/* ---------- Icônes inline (emoji, taille fixe) ---------- */
.ic { font-size: 13px; line-height: 1; }
