/* ===== Layout principal ===== */
.admin-layout {
    display: flex;
    width: 100%;
}

/* ===== Menu latéral ===== */
.admin-sidebar {
    width: 220px;
    min-height: 10vh;
    background-color: #f8f9fa;
    padding: 0px;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.admin-sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar nav ul li {
    width: 100%;
    margin-bottom: 10px;
}

.admin-sidebar nav ul li a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.3s ease;
    text-align: left;
}

.admin-sidebar nav ul li a:hover {
    background-color: var(--bleuClair); /* bleu clair avec transparence */
    color: #fff;
    text-decoration: none;
}



/* ===== Contenu principal ===== */
.admin-main {
    flex: 1;
    padding: 20px;
    background-color: #fff;
}

/* ===== Titres ===== */
.admin-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bleu);
    padding-bottom: 8px;
    color: var(--bleu);
}

/* ===== Barre d'actions (boutons en haut) ===== */
.admin-toolbar {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
}

.btn-primary {
    background-color: var(--bleuClair);
    color: #fff;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* ===== Tableau ===== */
.admin-table {
    overflow-x: auto;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: var(--grisClair);
    color: #333;
    font-weight: bold;
}

/* ===== Boutons d’action dans les tableaux ===== */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions a {
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 4px;
    color: #fff;
    transition: background 0.2s ease;
}

.table-actions .edit {
    background-color: #28a745;
}

.table-actions .edit:hover {
    background-color: #218838;
}

.table-actions .delete {
    background-color: #dc3545;
}

.table-actions .delete:hover {
    background-color: #c82333;
}

/* ===== BODY & PAGE ===== */
body {
    background-color: #f8f9fa; /* Gris clair comme le menu */
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* ===== CONTENEUR DE PAGE ===== */
.admin-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    flex: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ===== TITRE DE PAGE ===== */
.admin-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}



/* === Conteneur page admin === */
.admin-content {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    width: calc(100% - 40px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

/* === Titre page admin === */




.admin-actions  {
    display: flex;
}

.admin-actions a {
    text-decoration: none;
    margin-left: 10px;
    font-size: 1.2rem;
    color: #333;
}
/* === Table admin === */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;

}

.admin-page-title {
    width: 100%;
    font-size: 1.5rem;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #222;
}

.admin-table thead th {
    font-weight: bold;
    color: #000;
    background-color: #f0f0f0;
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
}

.admin-table tbody td {
    padding: 10px;
    background-color: white;
    color: #000;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.admin-table tfoot td {
    padding: 10px;
    font-weight: bold;
    background-color: white;
    color: #333;
    text-align: left;
    border-top: 1px solid #ccc;
}

.admin-icon-button {
    font-size: 1rem;
    text-decoration: none;
    color: #333;
}

.admin-search-bar {
    margin-left: auto;
}

#search-input {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 220px;
    margin-left: 20px;
}

.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-search-bar input {
    padding: 8px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    flex: 1;
    font-size: 0.95rem;
}

.admin-search-bar button {
    padding: 8px 12px;
    background-color: var(--bleuClair);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.admin-search-bar button:hover {
    background-color: #0056b3;
}

.admin-search-container {
    position: relative;
    display: inline-block;
    width: 300px;
    margin-bottom: 20px;
}

#search-service {
    width: 100%;
    padding: 8px 28px 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#clear-search {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    font-size: 18px;
    display: none;
    user-select: none;
}

#clear-search:hover {
    color: #000;
}

/* === Barre de recherche === */
.search-wrapper {
    position: relative;
    display: inline-block;
    width: 300px; /* ou 100% si besoin */
}

#search-input {
    width: 95%;
    padding: 8px 32px 8px 10px; /* espace à droite pour la croix */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-right: 10px;
}

#reset-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    display: none;
}

#reset-search:hover {
    color: #000;
}

th.sorted-asc::after {
    content: " ▲";
    font-size: 0.8rem;
    color: var(--bleu);
}
th.sorted-desc::after {
    content: " ▼";
    font-size: 0.8rem;
    color: var(--bleu);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.pagination-controls select {
    padding: 5px 8px;
    font-size: 0.9rem;
}

#pagination-nav button {
    margin-left: 4px;
    padding: 5px 10px;
    font-size: 0.9rem;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

#pagination-nav button.active {
    background-color: var(--bleuClair);
    color: #fff;
    font-weight: bold;
    border-color: var(--bleuClair);
}

.column-filters input.filter-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    font-size: 0.85rem;
    border-radius: 4px;
}

#reset-column-filters {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.3s;
}

#reset-column-filters:hover {
    color: red;
}

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
}
.modal-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.btn-confirm { background: #c62828; color: white; padding: 5px 10px; border: none; border-radius: 4px; }
.btn-cancel  { background: #ccc; padding: 5px 10px; border: none; border-radius: 4px; }

.show-deleted-form {
    display: inline-block;
    margin-left: 1rem;
}

.toggle-deleted-label {
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.9em;
    background: #f3f3f3;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-deleted-label:hover {
    background: #eaeaea;
}

.toggle-deleted-label input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

.toggle-trash {
    font-size: 1.1em;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.toggle-trash:hover {
    background: #eee;
}

.toggle-trash.active {
    color: darkred;
    background: #ffecec;
}

.switch-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9em;
}

/* switch CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: darkred;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.switch-label {
    user-select: none;
}

.switch-form {
    display: inline-block;
    margin-left: 1rem;
}

/* Switch base */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* ✅ Bleu activé */
input:checked + .slider {
    background-color: #007BFF;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

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