@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --admin-bg: #f5f7fb;
    --admin-surface: #ffffff;
    --admin-surface-soft: color-mix(in srgb, var(--secondaire, #e8eef8), white 72%);
    --admin-border: #e2e8f0;
    --admin-text: #111827;
    --admin-muted: #64748b;
    --admin-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.csv-guide {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: var(--admin-surface-soft);
    color: var(--admin-muted);
    font-size: 0.82rem;
}

.csv-guide strong,
.csv-guide p {
    display: block;
    margin-bottom: 6px;
}

.csv-guide code {
    color: var(--admin-text);
    font-family: Consolas, Monaco, monospace;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 18px;
    background: #0f172a;
    color: #ffffff;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.admin-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--primaire);
    color: #ffffff;
    font-weight: 800;
}

.admin-brand strong,
.admin-brand span {
    display: block;
}

.admin-brand strong {
    font-size: 0.98rem;
}

.admin-brand div span {
    color: #cbd5e1;
    font-size: 0.75rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-link,
.admin-logout {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #dbeafe;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease;
}

.admin-nav-link:hover,
.admin-nav-link.is-active,
.admin-logout:hover {
    background: var(--primaire);
    color: #ffffff;
}

.admin-logout {
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.admin-main {
    width: 100%;
    min-width: 0;
    padding: 28px;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-page-header h1,
h1 {
    margin: 2px 0 4px;
    color: var(--admin-text);
    font-size: 1.8rem;
    line-height: 1.2;
}

.admin-page-header p {
    max-width: 760px;
    color: var(--admin-muted);
}

.admin-kicker {
    color: var(--primaire) !important;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.container,
.containerImport {
    width: 100%;
    min-height: auto;
    display: block;
    border: 0;
    border-radius: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.card,
.cardList,
.divForm,
.cardImport,
.cardImportCatalogue {
    width: 100%;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: var(--admin-shadow);
}

.card {
    min-height: 176px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 22px;
}

.cardList,
.divForm {
    padding: 18px;
    overflow-x: auto;
}

.cardImport,
.cardImportCatalogue {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px;
    text-align: left;
}

.title {
    margin: 0 0 18px;
    font-size: 1.8rem;
}

.card h2,
form h2,
.h2Pb {
    margin: 0 0 10px;
    color: var(--admin-text);
    font-size: 1rem;
    font-weight: 700;
}

.h2Pb {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--admin-border);
}

.muted {
    color: var(--admin-muted);
}

.btn,
input.btn,
button.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--primaire);
    border-radius: 8px;
    background: var(--primaire);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.18s ease, transform 0.18s ease;
}

.btn:hover,
input.btn:hover,
button.btn:hover {
    filter: brightness(0.92);
}

.btnSecondary,
.retour,
.fournisseurs {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: var(--admin-surface);
    color: var(--admin-text);
    font-weight: 700;
    text-decoration: none;
}

.retour,
.fournisseurs {
    position: static;
    margin-bottom: 14px;
}

.admin-shell .container > .retour {
    display: none;
}

.retour:hover,
.fournisseurs:hover,
.btnSecondary:hover {
    border-color: var(--primaire);
    color: var(--primaire);
}

form {
    width: 100%;
    margin: 0;
}

div.whole {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

div.part,
div.full,
.zoneApi {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

div.full {
    margin-bottom: 18px;
}

label {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 40px;
    margin-top: 6px;
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: var(--admin-text);
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--primaire);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primaire), transparent 82%);
    outline: none;
}

input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0 8px 0 0;
}

input[type="color"] {
    width: 64px;
    min-height: 40px;
    padding: 4px;
}

input[type="file"] {
    padding: 7px;
}

#userType {
    max-width: 320px;
    margin-bottom: 18px;
}

.center {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--admin-border);
}

button.btn,
input.btn {
    margin-top: 0;
}

table {
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
}

.table thead tr {
    background: #f8fafc;
    color: #475569;
}

.table thead th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
}

.table tbody tr:nth-child(even),
.table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.table tbody tr:hover {
    background: var(--admin-surface-soft);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--admin-surface-soft);
    color: color-mix(in srgb, var(--primaire), #111827 20%);
    font-size: 0.75rem;
    font-weight: 800;
}

.admin-badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.list-a {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
}

.btnUser {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.btnUser:hover {
    border-color: var(--primaire);
    background: var(--admin-surface-soft);
}

.btnUser img {
    width: 18px;
    height: 18px;
}

.btnPb {
    margin-top: 12px;
}

.divForm.divFormImport {
    max-width: 560px;
}

.divForm.divFormImport form {
    display: block;
}

.tableModif,
.tableModif tr,
.tableModif th,
.tableModif td {
    border: 1px solid var(--admin-border);
    border-collapse: collapse;
}

.tableModif {
    width: 100%;
}

.dataTables_wrapper {
    width: 100%;
}

.dataTables_length label,
.dataTables_filter label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--admin-muted);
    font-weight: 600;
}

.dataTables_length select,
.dataTables_filter input {
    width: auto !important;
    display: inline-block !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border: 1px solid var(--primaire) !important;
    border-radius: 8px;
    background: var(--primaire) !important;
    color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    border: 1px solid var(--primaire) !important;
    border-radius: 8px;
    background: var(--admin-surface-soft) !important;
    color: var(--admin-text) !important;
}

#containerBoutons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.admin-status-card {
    display: grid;
    gap: 10px;
}

.admin-status-card p {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-status-card p:last-of-type {
    border-bottom: 0;
}

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-main {
        padding: 18px;
    }

    .admin-page-header,
    .grid,
    div.whole {
        grid-template-columns: 1fr;
    }

    .admin-page-header {
        display: grid;
    }
}

@media (max-width: 640px) {
    .admin-main {
        padding: 14px;
    }

    .cardList,
    .divForm,
    .card {
        padding: 14px;
    }
}

.admin-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #ffffff;
    font-weight: 700;
}

.admin-alert-success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.admin-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-section-gap {
    margin-top: 18px;
}

.admin-inline-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.admin-inline-controls label {
    min-width: 160px;
}

.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-test-result {
    white-space: pre-line;
    margin-top: 14px;
    padding: 11px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--admin-text);
    font-weight: 700;
}

.admin-test-result-success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.admin-test-result-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-funnel-config {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--admin-border);
}

.admin-funnel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.admin-funnel-heading h2 {
    margin-bottom: 6px;
}

.admin-funnel-rule-head,
.admin-funnel-rule {
    display: grid;
    grid-template-columns: 80px minmax(140px, 1fr) 130px 130px minmax(200px, 1.4fr) 90px 110px;
    gap: 10px;
    align-items: center;
}

.admin-funnel-rule-head {
    margin-bottom: 8px;
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-funnel-rules {
    display: grid;
    gap: 10px;
}

.admin-funnel-rule input,
.admin-funnel-rule select {
    margin-bottom: 0;
}

.admin-funnel-remove {
    width: 100%;
    min-height: 38px;
}

@media (max-width: 980px) {
    .admin-funnel-heading {
        display: grid;
    }

    .admin-funnel-rule-head,
    .admin-funnel-rule {
        grid-template-columns: 1fr;
    }

    .admin-funnel-rule-head {
        display: none;
    }
}
