:root {
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #dde3ee;
    --text: #1f2937;
    --green: #15803d;
    --red: #b91c1c;
    --amber: #b45309;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    font-weight: 700;
    font-size: 1.05rem;
    padding: 1.2rem 1.2rem 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-nav { display: flex; flex-direction: column; padding: 0.6rem 0; flex: 1; }
.sidebar-nav > a {
    color: white;
    text-decoration: none;
    padding: 0.65rem 1.2rem;
    font-size: 0.92rem;
}
.sidebar-nav > a:hover { background: rgba(255,255,255,0.1); }
.side-group-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: white;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.65rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.side-group-toggle:hover { background: rgba(255,255,255,0.1); }
.side-group .chevron { transition: transform 0.15s; font-size: 0.8rem; }
.side-group.open .chevron { transform: rotate(180deg); }
.side-group-menu { display: none; flex-direction: column; background: rgba(0,0,0,0.15); }
.side-group.open .side-group-menu { display: flex; }
.side-group-menu a {
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    padding: 0.55rem 1.2rem 0.55rem 2.2rem;
    font-size: 0.87rem;
}
.side-group-menu a:hover { background: rgba(255,255,255,0.1); }
.sidebar-user {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 0.9rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sidebar-user .user-pill {
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.82rem;
    text-align: center;
    margin-bottom: 0.3rem;
}
.sidebar-user a { color: white; text-decoration: none; font-size: 0.88rem; }
.sidebar-user a:hover { text-decoration: underline; }
.app-main { flex: 1; min-width: 0; }
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 60;
    background: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 40;
}
.sidebar-overlay.open { display: block; }
@media (max-width: 880px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 50;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .app-main { padding-top: 3.2rem; }
}
.user-pill {
    background: rgba(255,255,255,0.15);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    margin-left: 1.2rem;
    font-size: 0.85rem;
}
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.5rem; color: var(--primary-dark); margin-bottom: 1rem; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
select, input[type=text], input[type=password], input[type=email], input[type=file], input[type=number] {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: white;
}
.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions a.btn, .row-actions button.btn, .row-actions button {
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    margin-right: 0.35rem;
    margin-bottom: 0.2rem;
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-top: 1.2rem;
}
.pagination-info { font-size: 0.88rem; color: #6b7280; }
.statut-ligne { font-size: 0.78rem; color: #6b7280; margin-bottom: 0.8rem; }
.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
th, td {
    border: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    text-align: left;
}
th { background: #eef2fb; }
tr:nth-child(even) td { background: #fafbfd; }
.alert {
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: var(--green); border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: var(--red); border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: var(--amber); border: 1px solid #fde68a; }
.badge { padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; }
.badge-ok { background: #dcfce7; color: var(--green); }
.badge-missing { background: #fee2e2; color: var(--red); }
.login-wrap {
    max-width: 380px;
    margin: 4rem auto;
}
small.help { color: #6b7280; display: block; margin-top: -0.6rem; margin-bottom: 1rem; }
