/* Utilitaires locaux — l’appli n’a pas besoin du CDN Tailwind */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.min-w-0 { min-width: 0; }
.relative { position: relative; }
.block { display: block; }
.hidden { display: none; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }

.w-full { width: 100%; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-none { max-width: none; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.h-64 { height: 16rem; }

.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-3 { padding-top: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.pb-24 { padding-bottom: 6rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mr-1 { margin-right: 0.25rem; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-sans { font-family: Inter, Segoe UI, system-ui, sans-serif; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracking-tight { letter-spacing: -0.025em; }
.whitespace-nowrap { white-space: nowrap; }
.no-underline { text-decoration: none; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }

.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-green-900 { color: #14532d; }
.text-red-600 { color: #dc2626; }
.text-red-800 { color: #991b1b; }
.text-amber-600 { color: #d97706; }
.text-blue-600 { color: #2563eb; }
.text-orange-500 { color: #f97316; }
.text-purple-600 { color: #9333ea; }
.text-white { color: #fff; }

.bg-white { background: #fff; }
.bg-gray-50 { background: #f9fafb; }
.bg-blue-50 { background: #eff6ff; }
.bg-green-50 { background: #ecfdf5; }
.bg-orange-50 { background: #fff7ed; }
.bg-purple-50 { background: #f5f3ff; }
.bg-red-50 { background: #fef2f2; }
.bg-green-800 { background: #166534; color: #fff; }

.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid #e5e7eb; }
.border-2 { border-width: 2px; border-style: solid; border-color: #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-gray-100 { border-color: #f3f4f6; }
.overflow-x-auto { overflow-x: auto; }

@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:mt-0 { margin-top: 0; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
}
@media (min-width: 1280px) {
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Formulaires — toujours visibles sans Tailwind */
input, select, textarea, button {
    font-family: inherit;
    font-size: 0.95rem;
}
.form-card,
form.bg-white {
    background: #fff;
    border: 1px solid #e8eee9;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}
.form-card label,
form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}
.form-control,
form input[type="text"],
form input[type="number"],
form input[type="password"],
form input[type="email"],
form input[type="date"],
form select,
form textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    margin-bottom: 0.9rem;
    padding: 0.8rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
form input:focus,
form select:focus,
form textarea:focus {
    border-color: #1a472a;
    box-shadow: 0 0 0 4px rgba(26, 71, 42, 0.12);
}
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #1a472a;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.btn-submit:hover { background: #0d1f12; }
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
}
.login-card .btn-submit,
.login-card button[type="submit"] {
    width: 100%;
    margin-top: 0.15rem;
    background: #1a472a;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.95rem 1.4rem;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}
.login-card .btn-submit:hover { background: #14532d; }

body.login-page,
.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    background-color: #0b1c12;
    background-repeat: no-repeat;
    font-family: Inter, Segoe UI, system-ui, sans-serif;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 28px;
    padding: 36px 32px 28px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
    text-align: center;
}
.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #1a472a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 1.05rem;
}
.login-org {
    margin: 0 0 6px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
}
.login-card h1 {
    text-align: center;
    color: #14532d;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 10px;
}
.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5ec;
    color: #166534;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}
.login-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    background: #eaf3ff;
    color: #1e3a8a;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 1.45;
}
.login-info i { color: #2563eb; margin-top: 2px; }
.login-info p { margin: 0; }
.login-info strong { color: #1e3a8a; }
.login-error {
    background: #fef2f2;
    color: #991b1b;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: left;
}
.login-error.is-warn {
    background: #fff7ed;
    color: #9a3412;
}
.login-flash {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: left;
}
.login-flash.is-ok { background: #ecfdf5; color: #166534; }
.login-flash.is-err { background: #fef2f2; color: #991b1b; }
.login-hint {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    margin: 10px 0 0;
}
.login-card form { margin: 0; }
.login-field {
    display: flex;
    align-items: center;
    margin: 0 0 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.login-field:focus-within {
    border-color: #1a472a;
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.12);
}
.login-field-ico {
    flex: 0 0 46px;
    width: 46px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
}
.login-card .login-field input,
.login-card form .login-field input[type="text"],
.login-card form .login-field input[type="password"] {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent;
    border-radius: 0;
    padding: 13px 14px 13px 0 !important;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    text-align: left;
    outline: none;
}
.login-forgot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px auto 0;
    background: none;
    border: 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    width: auto;
    padding: 0;
}
.login-forgot:hover { color: #1a472a; }
.login-forgot-form {
    margin-top: 12px;
    text-align: left;
}
.login-forgot-form input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-family: inherit;
}
.login-meta {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    color: #6b7280;
    font-size: 12.5px;
}
.login-meta p { margin: 0 0 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-meta i { color: #1a472a; }
.login-credit { color: #9ca3af !important; font-size: 11.5px; }
.login-credit span { font-family: ui-monospace, Consolas, monospace; color: #1a472a; font-weight: 700; }
.login-card .login-sub { display: none; }
