/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f0f2f5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === LAYOUT === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* === HEADER (style formulaires-aid62) === */
.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 248, 255, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1e293b;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.brand:hover { text-decoration: none; }

.brand-logo {
    height: 34px;
    width: auto;
}

.brand-label {
    font-size: 16px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav .btn {
    font-size: 13px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.user-info {
    font-size: 13px;
    color: #64748b;
}

/* === BOUTONS === */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }

.btn-ghost { background: transparent; color: #2563eb; border: 1px solid #bfdbfe; }
.btn-ghost:hover { background: #eff6ff; text-decoration: none; }

.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; text-decoration: none; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }

.btn-small { padding: 4px 12px; font-size: 13px; }

.btn-full { width: 100%; }

/* === FORMULAIRES === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* === ALERTES === */
.alert {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* === CARTES === */
.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    margin-bottom: 16px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f3f4f6; color: #374151; }

/* === TABLES === */
table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover { background: #f9fafb; }

/* === SECTION === */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
}

.section-count {
    font-weight: 400;
    color: #6b7280;
    font-size: 15px;
}

/* Pastille rouge sur le bouton "Familles" du header — alerte orphelins globale */
.badge-orphan-header {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    background: #b91c1c;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}
