/* ===== Layout admin avec sidebar ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #1e293b;
    color: #94a3b8;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sidebar-section {
    padding: .5rem 0;
    border-bottom: 1px solid #334155;
}

.sidebar-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #475569;
    padding: .6rem 1rem .2rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem;
    color: #94a3b8;
    font-size: .88rem;
    text-decoration: none;
    transition: background .1s, color .1s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #334155;
    color: #fff;
    text-decoration: none;
}

.sidebar-link .icon { font-size: 1rem; width: 1.2rem; text-align: center; }

/* ===== Zone principale ===== */
.admin-main {
    background: var(--bg);
    overflow-x: hidden;
}

.admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.admin-content { padding: 1.5rem; }

/* ===== Stats cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: .25rem;
}

.stat-label {
    font-size: .8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ===== Toolbar (recherche + actions) ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 180px;
    max-width: 320px;
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

select.filter-select {
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .88rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

select.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Actions rapides sur les lignes ===== */
.row-actions { display: flex; gap: .35rem; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 1rem;
    font-size: .88rem;
    color: var(--muted);
}

.page-btn {
    padding: .3rem .65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
    font-size: .85rem;
}

.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===== Responsive mobile : sidebar cachée ===== */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}
