/* ============================= */
/* RESET SIMPLE */
/* ============================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f4f6f8;
    color: #2c3e50;
    line-height: 1.5;
}

/* ============================= */
/* VARIABLES */
/* ============================= */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg-card: #ffffff;
    --border: #e5e7eb;

    --radius: 10px;
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ============================= */
/* LAYOUT */
/* ============================= */

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    box-shadow: var(--shadow);
}

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

/* ============================= */
/* CARDS */
/* ============================= */

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* ============================= */
/* BUTTONS */
/* ============================= */

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: 0.2s;
}

.btn-primary {
    background: #2c3e50;
    color: white;
}

.btn-primary:hover {
    opacity:0.85;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #fd7e14;
    color: white;
}

/* ============================= */
/* FORMULAIRES */
/* ============================= */

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 5px;
    margin-bottom: 15px;
}

label {
    font-weight: 600;
}

/* ============================= */
/* TABLE / PLANNING */
/* ============================= */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    background: #f9fafb;
}

/* ============================= */
/* ALERTES */
/* ============================= */

.alert {
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 14px;
}

.alert-warning {
    background: #fff7ed;
    color: #9a3412;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

/* ============================= */
/* FLEX UTILS */
/* ============================= */

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
}

.gap {
    gap: 10px;
}

/* ============================= */
/* BADGES */
/* ============================= */

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: #eef2ff;
}

/* =============================
   PLANNING BUTTONS (COMPACT)
============================= */

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    line-height: 1.2;
}

.btn-mini + .btn-mini {
    margin-top: 4px;
}

/* évite que les boutons prennent toute la largeur */
.card .btn-mini {
    width: auto;
}

/* ============================= */
/* POPUP CALENDAR */
/* ============================= */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
}

.popup-box {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

/* header popup */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* zone enfants dans popup */
.popup-children .card {
    margin-bottom: 15px;
}

/* bouton fermer */
.popup-close {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
}

.checkbox{
    display:flex;
    align-items:center;
    gap:10px;
    margin:10px 0;
    cursor:pointer;
}

.checkbox input{
    width:auto;
    margin:0;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 900px) {

    .container {
        padding: 12px;
    }

    .table {
        display: block;
        overflow-x: auto;
    }

    .header h1 {
        font-size: 18px;
    }
}

@media (max-width: 600px) {

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}