@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --a: #e2006e;
    --a-dark: #be005c;
    --a-soft: #fff0f6;
    --t1: #111827;
    --t2: #4b5563;
    --t3: #9ca3af;
    --bd: #e5e7eb;
    --bg: #f3f4f6;
    --ps: #f7f8fa;
    --sidebar: #13041c;
    --success: #059669;
    --success-bg: #ecfdf5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #a16207;
    --warning-bg: #fffbeb;
    --r: 8px;
    --rl: 12px;
    --shadow: 0 1px 3px rgba(17, 24, 39, .05);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--t1); font: 14px/1.5 Inter, Arial, sans-serif; }
a { color: inherit; }
button, input { font: inherit; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 244px; height: 100vh; position: sticky; top: 0; align-self: flex-start; overflow-y: auto; flex: 0 0 244px; padding: 28px 16px; color: #f9fafb; background: var(--sidebar) url('../images/bg-menu.jpg') center / cover; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 34px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { position: relative; width: 26px; height: 26px; border-radius: 8px; background: var(--a); display: grid; place-items: center; color: white; font-size: 15px; }
.brand-mark img { position: absolute; top: 50%; left: 50%; display: block; width: 19px; height: 19px; transform: translate(-50%, -50%); }
.sidebar-label { padding: 0 12px; margin: 0 0 8px; color: #b9aeba; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-label--spaced { margin-top: 26px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin: 2px 0; border-radius: 8px; color: #ddd3df; text-decoration: none; font-size: 13px; font-weight: 500; transition: .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #fff; background: var(--a); box-shadow: 0 4px 12px rgba(226,0,110,.3); }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.sidebar-footer { margin-top: auto; padding: 20px 12px 0; color: #b9aeba; font-size: 11px; }
.sidebar-footer form { margin: 0; }
.logout-link { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.logout-link:hover { color: #fff; }

.app-main { flex: 1 1 auto; min-width: 0; padding: 38px 48px 56px; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #f7f7f5; }
.login-layout { width: 100%; max-width: 400px; }
.login-card { padding: 40px 36px; border: 1px solid #ebe9e7; border-radius: 18px; background: #fff; box-shadow: 0 16px 35px rgba(17, 24, 39, .13); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 33px; }
.login-brand-mark { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--a); color: #fff; font-size: 20px; font-weight: 700; }
.login-brand-mark img { position: absolute; top: 50%; left: 50%; display: block; width: 25px; height: 25px; transform: translate(-50%, -50%); }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { color: var(--t1); font-size: 16px; }
.login-brand span { margin-top: 1px; color: var(--t3); font-size: 12px; }
.login-card h1 { font-size: 24px; }
.login-intro { margin: 7px 0 26px; color: var(--t2); }
.login-alert { margin: 0 0 18px; padding: 10px 13px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #1d4f91; font-size: 13px; }
.login-alert.danger { border-color: #fecaca; background: var(--danger-bg); color: #b91c1c; }
.login-field { margin-bottom: 17px; }
.login-field label { display: block; margin-bottom: 6px; color: #475569; font-size: 12px; font-weight: 700; }
.login-field input { width: 100%; height: 42px; padding: 0 13px; border: 1px solid #d8dce2; border-radius: 9px; outline: none; color: var(--t1); background: #fff; }
.login-field input:focus { border-color: var(--a); box-shadow: 0 0 0 3px var(--a-soft); }
.login-submit { width: 100%; height: 42px; margin-top: 7px; border: 0; border-radius: 9px; background: var(--a); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.login-submit:hover { background: var(--a-dark); }
.login-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--bd); color: var(--t3); text-align: center; font-size: 11px; line-height: 1.4; }
.login-footer span { color: #aab0bb; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.page-head-actions form { margin: 0; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--a); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
.page-intro { max-width: 720px; margin: 9px 0 0; color: var(--t2); font-size: 14px; }

.pcard { border: 1px solid var(--bd); border-radius: var(--rl); background: #fff; box-shadow: var(--shadow); }
.pcard-body { padding: 26px; }
.section-title { margin: 0; font-size: 16px; font-weight: 700; }
.section-desc { margin: 5px 0 0; color: var(--t2); font-size: 13px; }
.form-separator { height: 1px; margin: 24px 0; background: var(--bd); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-field label { display: flex; gap: 4px; margin: 0 0 8px; color: #475569; font-size: 12px; font-weight: 700; }
.required { color: var(--a); }

.dropzone { position: relative; min-height: 155px; padding: 20px; cursor: pointer; border: 1.5px dashed #cbd5e1; border-radius: 10px; background: #fff; text-align: center; transition: .18s ease; }
.dropzone:hover, .dropzone-survol { border-color: var(--a); background: var(--a-soft); }
.dropzone-rempli { border-color: #6ee7b7; background: var(--success-bg); }
.dropzone-icon { width: 38px; height: 38px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 10px; color: var(--a); background: var(--a-soft); }
.dropzone-icon svg { display: block; flex: 0 0 auto; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.dropzone-title { display: block; color: var(--t1); font-size: 13px; font-weight: 600; }
.dropzone-help { display: block; margin-top: 4px; color: var(--t3); font-size: 11px; }
.nom-fichier { display: block; max-width: 100%; margin-top: 9px; color: var(--success); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.dropzone input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.button-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.btn { min-height: 38px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--bd); border-radius: var(--r); background: white; color: var(--t2); text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: .16s ease; }
.btn:hover { background: var(--ps); color: var(--t1); }
.btn-primary { border-color: var(--a); background: var(--a); color: white; }
.btn-primary:hover { border-color: var(--a-dark); background: var(--a-dark); color: white; }
.btn-success { border-color: var(--success); background: var(--success); color: white; }
.btn-danger { border-color: var(--danger); background: var(--danger); color: white; }
.btn-danger:hover { border-color: #b91c1c; background: #b91c1c; color: white; }
.btn-full { width: 100%; }
.btn:disabled { cursor: wait; opacity: .72; }
.spinner { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.48); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid; border-radius: 10px; }
.alert-success { border-color: #a7f3d0; background: var(--success-bg); color: #065f46; }
.alert-danger { border-color: #fecaca; background: var(--danger-bg); color: #991b1b; }
.alert-content { flex: 1; }
.alert-title { display: block; margin-bottom: 3px; font-weight: 700; }
.alert-close { border: 0; background: transparent; color: currentColor; cursor: pointer; font-size: 19px; line-height: 1; }

.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 13px 20px; border-bottom: 1px solid var(--bd); background: var(--ps); color: var(--t3); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.data-table th .sort-button { width: 100%; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit; text-transform: inherit; cursor: pointer; }
.data-table th .sort-button:hover { color: var(--t1); }
.data-table th .sort-button::after { content: '↕'; color: var(--t3); font-size: 12px; }
.data-table th[aria-sort="ascending"] .sort-button::after { content: '↑'; color: var(--a); }
.data-table th[aria-sort="descending"] .sort-button::after { content: '↓'; color: var(--a); }
.data-table td { padding: 16px 20px; border-bottom: 1px solid var(--bd); color: var(--t2); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfd; }
.table-actions { text-align: right; white-space: nowrap; }
.file-name { color: var(--t1); font-weight: 600; }
.pbadge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pbadge.success { border-color: #a7f3d0; background: var(--success-bg); color: var(--success); }
.pbadge.danger { border-color: #fecaca; background: var(--danger-bg); color: var(--danger); }
.pbadge.warning { border-color: #fde68a; background: var(--warning-bg); color: var(--warning); }
.empty-state { padding: 56px 24px; text-align: center; color: var(--t2); }
.empty-icon { width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 12px; background: var(--a-soft); color: var(--a); font-size: 20px; }
.empty-state h2 { margin: 0; color: var(--t1); font-size: 16px; }
.empty-state p { margin: 6px 0 20px; }

.result-layout { width: 100%; }
.result-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.result-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--success-bg); color: var(--success); font-size: 20px; }
.result-copy { flex: 1; }
.result-copy h2 { margin: 0; font-size: 17px; }
.result-copy p { margin: 4px 0 0; color: var(--t2); font-size: 13px; }
.anomaly-card { margin-top: 16px; overflow: hidden; }
.anomaly-head { padding: 13px 18px; border-bottom: 1px solid #fde68a; background: var(--warning-bg); color: var(--warning); font-size: 13px; font-weight: 700; }
.anomaly-list { margin: 0; padding: 0; list-style: none; }
.anomaly-list li { padding: 11px 18px; border-bottom: 1px solid var(--bd); color: var(--t2); font-size: 13px; }
.anomaly-list li:last-child { border: 0; }
.anomaly-table td { font-size: 13px; }
.anomaly-table td:nth-child(3), .anomaly-table td:nth-child(4) { white-space: nowrap; }
.back-link { margin-top: 22px; }

@media (max-width: 800px) { .app-shell { display: block; } .sidebar { width: 100%; height: auto; min-height: auto; position: static; padding: 16px; background-image: none; } .brand { padding: 0 6px 14px; } .sidebar-label, .sidebar-footer { display: none; } .sidebar nav { display: flex; gap: 6px; } .nav-link { margin: 0; padding: 8px 10px; } .app-main { padding: 28px 18px; } .page-head, .result-header { display: block; } .page-head .btn, .result-header .btn { margin-top: 16px; } .form-grid, .form-grid--three { grid-template-columns: 1fr; } .data-table { min-width: 700px; } .table-scroll { overflow-x: auto; } }
