/* ====== RESET DE BASE ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
    font-family: 'Agrandir';
    src: url('./fonts/Agrandir-Regular.woff2') format('woff2');
    font-weight: normal; font-style: normal;
}
@font-face {
    font-family: 'AgrandirTextBold';
    src: url('./fonts/Agrandir-TextBold.woff2') format('woff2');
    font-weight: bold; font-style: normal;
}

body {
    font-family: 'Agrandir', sans-serif;
    background-color: #f4f6f8;
    color: #333;
    padding: 2rem;
}

/* ——— Overrides de layout ——— */
.card{
    max-width: none;     /* annule le 33% */
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.col{flex:1 0 30%}
.card{border-radius:14px;padding:16px;margin:12px 0}
.row{display:flex;gap:12px;flex-wrap:wrap}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-family: 'AgrandirTextBold', sans-serif;
    font-size: 1.1rem;
    margin-bottom: .5rem;
    color: #0B545B;
}

.card-price {
    font-weight: bold;
    margin-bottom: .5rem;
    color: #333;
}

.card-plan {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
}

.card button {
    background-color: #007bcc;
    padding: .4rem .8rem;
    border-radius: 8px;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.card button:hover {
    background-color: #005fb3;
}
.card-activity {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.card-activity .btn-inscrire {
    align-self: flex-end;
}

.plan-list { margin-top: .25rem; }
.plan-list .line { font-size: .9rem; }
.plan-list .line + .line { margin-top: .15rem; }
.card-activity { display:flex; flex-direction:column; gap:8px; }
.card-activity .btn-inscrire { align-self:flex-end; }

/* marge horizontale de 10px */
.ml-10 { margin-left: 10px; }

/* item de suggestion (à la place des styles inline) */
#filterSuggestions { list-style: none; margin: 0; padding: 0; }
#filterSuggestions .suggestion-item {
    cursor: pointer;
    padding: 5px;
}
#filterSuggestions .suggestion-item:hover {
    background: #f2f2f2;
}

h1 { font-family: 'AgrandirTextBold', sans-serif; }

/* utilitaires sans inline-style */
.justify-start { justify-content: flex-start; }
.gap-12 { gap: 12px; }
.mt-1 { margin-top: 1rem; }

input, button, textarea, select, table, th, td {
    font-family: 'Agrandir', sans-serif;
}

::placeholder {
    font-family: 'Agrandir', sans-serif;
    opacity: .6;
}

/* ====== HEADER ====== */
/* Logo de fond, fixe, discret (depuis /public/logo) */
body::before{
    content:"";
    position:fixed; inset:0;
    background:url('./logo/LogoHorizontal.jpg') center/contain no-repeat;
    opacity:.08; z-index:0; pointer-events:none;
}
/* Le contenu passe au-dessus du fond */
body > * { position: relative; z-index: 1; }
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.header h1 { margin: 0; }
.header .links {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.header .links a {
    display: block;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #ccc;
    border-left: 6px solid #007bcc;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    width: 250px;
}
.header .links a:hover {
    background-color: #eef6ff;
    border-left-color: #005fb3;
}

/* ====== NAVIGATION ====== */
.admin-nav {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    max-width: 100%;
    margin: 2rem auto 0 auto;
}
.admin-nav .btn-exit{ margin-left: auto; }
.admin-nav a {
    display: block;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #ccc;
    border-left: 6px solid #007bcc;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    width: 250px;
}
.admin-nav a:hover {
    background-color: #eef6ff;
    border-left-color: #005fb3;
}

/* ====== CONTAINER ====== */
.container {
    max-width: 85%;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

/* ====== FORMULAIRES & INPUTS ====== */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea,
input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus,
input[type="date"]:focus {
    border-color: #0B545B;
    box-shadow: 0 0 0 3px rgba(11,84,91,.12);
    outline: none;
}

/* Icône calendrier personnalisée */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(34%) sepia(99%) saturate(350%) hue-rotate(140deg);
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s;
}
input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* ====== BOUTONS ====== */
button, #backBtn, .logout-btn {
    padding: .5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    transition: background .2s, filter .2s;
}
button, #backBtn { background-color: #007bcc; opacity: .92; }
button:hover, #backBtn:hover { background-color: #005fb3; }
#backBtn { background-color: #6c757d; margin-bottom: 1em; }
#backBtn:hover { background-color: #5a6268; }
.logout-btn { float: right; margin-top: -2.5rem; background-color: #dc3545; }
.logout-btn:hover { background-color: #c82333; }

/* ====== TABLES ====== */
table, .styled-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0 0 0;
    font-size: .85rem;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,.05);
}
th, td {
    padding: .75rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}
th { background: #0B545B; color: #fff; font-weight: 700; }
tr:nth-child(even) { background-color: #f9f9f9; }
tr:hover { background-color: #eef6ff; }
table button { margin: 0 4px; padding: 6px 12px; }
thead th:first-child{ border-top-left-radius:12px; }
thead th:last-child { border-top-right-radius:12px; }
tbody tr:last-child td:first-child { border-bottom-left-radius:12px; }
tbody tr:last-child td:last-child  { border-bottom-right-radius:12px; }
tbody tr.tx-credit{ background:#e9f7ef; }
#viewModal thead th { position: sticky; top: 0; z-index: 1; }
#viewModal tbody td:nth-child(4),
#viewModal thead th:nth-child(4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
#viewModal tbody td.amount-neg { color: #b42318; font-weight: 600; }
#viewModal thead th:nth-child(6),
#viewModal tbody td:nth-child(6) {
    max-width: 360px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ====== PAGINATION ====== */
.pagination { text-align: center; margin-top: 1rem; }

/* ====== FILTRES ====== */
#addUserBtn { margin: 1rem 0; }
#filterStatus {
    margin-left: .5rem;
    padding: .5rem;
    border-radius: 10px;
    border: 1px solid #ccc;
}
#activeFilter {
    display: flex; justify-content: center; margin-bottom: 15px;
}
#activeFilter input {
    padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;
}

/* ====== MODALE ====== */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100vw; height: 100vh; overflow: auto; background: rgba(0,0,0,0.4);
}
.modal-content {
    background: #fff; margin: 5vh auto; padding: 20px; border-radius: 8px;
    max-width: 600px; max-height: 80vh; overflow-y: auto;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2); position: relative;
}
#viewModal .modal-content { max-width: 1100px; }
.modal .close {
    position: absolute; top: 12px; right: 14px; z-index: 2; cursor: pointer;
    width: 32px; height: 32px; line-height: 32px; text-align: center;
    border-radius: 9999px; color: #64748b; transition: background .15s, color .15s;
}
.modal .close:hover { color: #0f172a; }
.modal-content h2, .modal h2 { margin: 0 0 16px; text-align: center; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal .field label { display: block; margin-bottom: 6px; font-weight: 700; color: #0f172a; }
.modal form .actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.modal form .actions button[type="submit"]{ background: #0B545B; color: #fff; font-weight: 800; }
.modal form .actions button[type="button"]{ background: #e8eef0; color: #0f172a; font-weight: 700; }
.modal form .actions button:hover{ filter: brightness(.98); }

/* ====== CHECKBOXES ====== */
.checkbox-vertical { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.inline-controls{ display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 4px 0 6px; }
.inline-controls input[type="checkbox"]{ transform: scale(1.15); }
.inline-controls label{ font-weight: 700; user-select: none; }
#provenanceCheckboxes, #editProvenanceCheckboxes{
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px 16px; margin-top: 8px; border: 1px dashed #cbd5e1; padding: 14px; border-radius: 12px; background: #fbfdff;
}
#provenanceCheckboxes label, #editProvenanceCheckboxes label{
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
}
#provenanceCheckboxes input[type="checkbox"],
#editProvenanceCheckboxes input[type="checkbox"]{
    transform: scale(1.15); accent-color: #0B545B;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px){
    #provenanceCheckboxes, #editProvenanceCheckboxes{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px){
    #provenanceCheckboxes, #editProvenanceCheckboxes{ grid-template-columns: 1fr; }
}

.filter-bar {
    background-color: #f0f0f0; padding: 10px; border-radius: 8px;
    display: flex; justify-content: center; align-items: center; gap: 1rem;
    margin: 1rem 0; text-align: center; width: fit-content; margin-left: auto; margin-right: auto;
}
.preview-wrap { margin-top: .5rem; }
.preview-box  { max-height: 200px; overflow: auto; }
.preview-list { line-height: 1.35; }

.filter-bar input { padding: 5px; font-size: 1rem; width: 220px; }
.filter-bar button { padding: 5px 10px; font-size: 1rem; cursor: pointer; }
.filter-bar select { width: 100px; }