/* =========================================================
   RESET & BASE
========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #f6f7f9;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #222;
}

/* =========================================================
   PAGE SERVICES
========================================================= */
#admin-services-page {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#admin-services-page .dashboard-section {
    width: 100%;
}

/* =========================================================
   CARD
========================================================= */
#admin-services-page .dashboard-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

/* =========================================================
   TITRE
========================================================= */
#admin-services-page h2 {
    margin: 0 0 14px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   FILTRES – MOBILE FIRST
========================================================= */
.caisse-filter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.caisse-filter-select,
.shortcut-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 10px;
}

.caisse-filter-select {
    border: 1px solid #ddd;
    background: #fff;
}

.shortcut-btn {
    background: #111;
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.shortcut-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* =========================================================
   TABLE – BASE
========================================================= */
.table-minimal {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-minimal th,
.table-minimal td {
    border: 1px solid #e5e7eb;
    padding: 10px 8px;
    text-align: left;
    vertical-align: middle;
}

.table-minimal th {
    background: #f8fafc;
    font-weight: 700;
}

.table-minimal tr:nth-child(even) {
    background: #fafbfc;
}

.table-minimal img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

/* =========================================================
   BADGES
========================================================= */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
}

.badge.oui { background: #16a34a; }
.badge.non { background: #dc2626; }

.badge-toggle-link {
    text-decoration: none;
}

/* =========================================================
   ACTIONS
========================================================= */
.action-dropdown {
    position: relative;
}

.action-btn {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.action-btn:hover {
    background: #e5e7eb;
}

.action-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 42px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-width: 150px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    z-index: 100;
}

.action-dropdown.open .action-menu {
    display: block;
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #222;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.action-menu-item:hover {
    background: #f3f4f6;
}

/* =========================================================
   MOBILE TABLE → CARDS
========================================================= */
@media (max-width: 700px) {

    .table-minimal thead {
        display: none;
    }

    .table-minimal tr {
        display: block;
        background: #fff;
        margin-bottom: 12px;
        border-radius: 12px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.06);
        padding: 6px 0;
    }

    .table-minimal td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #eee;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .table-minimal td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        flex: 0 0 45%;
    }

    .table-minimal tr td:last-child {
        border-bottom: none;
    }
}

/* =========================================================
   TABLETTE ≥ 768px
========================================================= */
@media (min-width: 768px) {

    #admin-services-page {
        padding: 24px;
    }

    .caisse-filter-form {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
    }

    .caisse-filter-select {
        flex: 1 1 180px;
    }

    .shortcut-btn {
        width: auto;
        padding: 10px 20px;
    }
}

/* =========================================================
   DESKTOP ≥ 1024px
========================================================= */
@media (min-width: 1024px) {

    .table-minimal {
        font-size: 0.95rem;
    }
}
/* --- Responsive Mobile First --- */
@media (max-width: 700px) {
    .dashboard-section, .dashboard-card {
        padding: 0 4px;
        margin: 0;
    }
    .caisse-table th, .caisse-table td {
        padding: 8px 4px;
        font-size: 0.98rem;
    }
    .caisse-table {
        font-size: 0.98rem;
        border-radius: 8px;
        box-shadow: none;
    }
    .caisse-table thead {
        font-size: 0.97rem;
    }
    .caisse-form, .caisse-form-inline {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 0;
    }
    .caisse-form-group {
        min-width: 0;
        width: 100%;
        gap: 2px;
    }
    .caisse-form-group label {
        font-size: 0.97rem;
    }
    .caisse-filter-btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }
    .caisse-filter-btn, .caisse-filter-select, .caisse-search-input, .shortcut-btn {
        width: 100%;
        min-width: 0;
        font-size: 1em;
        margin-bottom: 6px;
        box-sizing: border-box;
    }
    .caisse-filter-select, .caisse-search-input {
        padding: 8px 8px;
    }
    .shortcut-btn {
        padding: 10px 0;
        margin: 0;
    }
    .caisse-pagination-btn {
        width: 100%;
        margin-bottom: 6px;
        font-size: 1em;
    }
    .caisse-table thead {
        display: none;
    }
    .caisse-table tr {
        display: block;
        margin-bottom: 12px;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        background: #fff;
        padding: 6px 0;
    }
    .caisse-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px 6px;
        font-size: 0.98em;
    }
    .caisse-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #888;
        flex: 0 0 45%;
        text-align: left;
        padding-right: 8px;
    }
    .caisse-table tr:last-child td {
        border-bottom: none;
    }
}
/* Styles spécifiques caisse (hors dashboard global) */
.caisse-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background: #fff;
}
.caisse-table th, .caisse-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ededed;
    text-align: left;
}
.caisse-table th {
    background: #f5f5f5;
    font-weight: 700;
    color: #222;
    letter-spacing: 0.5px;
}
.caisse-entree td {
    background: #fafafa;
}
.caisse-sortie td {
    background: #fff5f5;
}
.caisse-table tr:last-child td {
    border-bottom: none;
}
.caisse-form-inline {
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}
.caisse-form-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}
.caisse-form-group label {
    font-size: 0.98rem;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 2px;
}
.caisse-action-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 6px;
    color: #222;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    margin: 0 2px;
    display: inline-block;
}
.caisse-action-btn:hover {
    background: #f5f5f5;
    color: #111;
}
.caisse-action-delete {
    color: #dc2626;
}
.caisse-action-delete:hover {
    background: #fff5f5;
    color: #fff;
}
.caisse-pagination-nav {
    margin-top: 0;
    margin-bottom: 0;
}
.caisse-pagination-btn {
    background: #f5f5f5;
    color: #222;
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    outline: none;
    text-decoration: none;
    margin: 0 2px;
    display: inline-block;
}
.caisse-pagination-btn.active, .caisse-pagination-btn:hover {
    background: #222;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    cursor: default;
}
.caisse-filter-btn-group {
    display: flex;
    gap: 8px;
}
.caisse-filter-btn {
    background: #f5f5f5;
    color: #222;
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    outline: none;
}
.caisse-filter-btn.active, .caisse-filter-btn:hover {
    background: #222;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.caisse-filter-select {
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 1rem;
    background: #fafbfc;
    color: #111;
    outline: none;
    transition: border 0.15s;
    min-width: 140px;
}
.caisse-filter-select:focus {
    border: 1.5px solid #222;
}
.caisse-search-input {
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 1rem;
    min-width: 220px;
    background: #fafbfc;
    color: #111;
    outline: none;
    transition: border 0.15s;
    resize: none;
}
.caisse-search-input:focus {
    border: 1.5px solid #222;
}
.caisse-form {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 0;
}
.caisse-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.98rem;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 0;
}
.caisse-form input, .caisse-form select {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    font-size: 1rem;
    background: #fafbfc;
    color: #111;
}
.shortcut-btn {
    background: #222;
    color: #fff;
    border: none;
    padding: 10px 16px;
    margin: 4px 0 0 0;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}
.shortcut-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
