/**
 * Styles Espace Admin - La Patte Éduquée
 * Interface moderne et responsive
 * Fichier : /assets/css/admin.css
 */

:root {
    --admin-primary: #17a2b8;
    --admin-dark: #212529;
    --admin-light: #f8f9fa;
    --admin-border: #dee2e6;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--admin-light);
}

/* Layout Admin */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    background: linear-gradient(135deg, var(--admin-primary), #0d6efd);
}

.sidebar-header img {
    max-width: 50px;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    padding: 0.75rem 1.5rem;
    color: var(--admin-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(23, 162, 184, 0.1);
    border-left-color: var(--admin-primary);
    color: var(--admin-primary);
}

.menu-item.active {
    background: rgba(23, 162, 184, 0.15);
    border-left-color: var(--admin-primary);
    color: var(--admin-primary);
    font-weight: 600;
}

.menu-item i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.admin-sidebar.collapsed ~ .admin-main {
    margin-left: 0;
}

/* Topbar */
.admin-topbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--admin-dark);
    cursor: pointer;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--admin-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Content Area */
.admin-content {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-dark);
    margin-bottom: 0.5rem;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0;
}

/* Cards */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid var(--admin-primary);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.stat-icon.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--admin-primary);
}

.stat-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.stat-icon.danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-dark);
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table */
.table-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    padding: 1.5rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid var(--admin-border);
    color: var(--admin-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(23, 162, 184, 0.05);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #28a745;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-danger {
    background: #dc3545;
}

.badge-info {
    background: var(--admin-primary);
}

/* Forms */
.form-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--admin-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control,
.form-select {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--admin-border);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.15);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.btn-primary:hover {
    background: #138496;
    border-color: #117a8b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Modal */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--admin-border);
    padding: 1.5rem;
    background: var(--admin-light);
}

.modal-title {
    font-weight: 700;
    color: var(--admin-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--admin-border);
    padding: 1.5rem;
}

/* Calendar */
.calendar-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calendar-day {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 100px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.calendar-day:hover {
    background: rgba(23, 162, 184, 0.05);
    border-color: var(--admin-primary);
}

.calendar-event {
    background: var(--admin-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Search Bar */
.search-bar {
    position: relative;
    max-width: 400px;
}

.search-bar input {
    padding-left: 2.5rem;
    border-radius: 50px;
    border: 2px solid var(--admin-border);
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-content {
        padding: 1rem;
    }
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-color: var(--admin-primary);
    border-right-color: transparent;
}

/* Print Styles */
@media print {
    .admin-sidebar,
    .admin-topbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .admin-main {
        margin-left: 0;
    }
}