:root {
    --color-primary: #1d4ed8;
    --color-primary-dark: #1e3a8a;
    --color-bg: #f3f4f6;
    --color-card: #ffffff;
    --color-error: #b91c1c;
    --color-text: #111827;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.app-header {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 16px 24px;
}

.app-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.app-main {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 16px;
}

.card {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-top: 0;
}

.field {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-weight: 600;
}

select,
input[type="text"],
input[type="password"],
input[type="date"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    line-height: 1.4;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    max-width: 420px;
    box-sizing: border-box;
}

button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 1.05rem;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 8px;
    margin-right: 10px;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.error {
    color: var(--color-error);
    font-weight: 600;
}

.boucle-buttons button {
    min-width: 140px;
}

fieldset.group {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    margin-bottom: 20px;
    padding: 12px 16px 16px;
}

fieldset.group legend {
    font-weight: 700;
    padding: 0 8px;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.control-row:last-child {
    border-bottom: none;
}

.control-label {
    flex: 1 1 300px;
    font-weight: 500;
}

.control-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.radio-option:has(input:checked) {
    background: #dbeafe;
    outline: 1px solid var(--color-primary);
}

.date-auto {
    font-weight: 600;
}

/* --- Interface d'administration --- */

.admin-nav {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav a {
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: none;
}

.admin-logout-form {
    margin: 0;
}

.admin-logout-form button {
    background: none;
    color: #64748b;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.admin-logout-form button:hover {
    color: var(--color-primary-dark);
    background: none;
}

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.admin-filters .field {
    margin-bottom: 0;
}

.admin-filters select,
.admin-filters input[type="date"] {
    max-width: 200px;
}

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

.btn-link {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    padding: 12px 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.admin-total {
    font-weight: 600;
    color: #475569;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
    background: #f1f5f9;
    font-weight: 700;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

.admin-pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
}

.admin-pagination a {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--color-primary-dark);
    background: #f1f5f9;
}

.admin-pagination a.active {
    background: var(--color-primary);
    color: #fff;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

