/* Admin Dashboard Modern Styles */
:root {
    /* Admin surfaces align with global theme */
    --admin-surface: var(--color-surface);
    --admin-bg: #f8fafc;
    --admin-accent: var(--color-primary);
    --admin-accent-light: var(--color-primary-light);
    --admin-accent-secondary: var(--color-secondary);
    
    /* Dashboard specific */
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --metric-bg: linear-gradient(135deg, var(--color-primary) 0%, #2c5282 100%);
    --sidebar-bg: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    --success-gradient: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    --warning-gradient: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    --info-gradient: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

/* Styles pour l'en-tête de l'administration */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.admin-profile:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.admin-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-avatar-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid var(--color-primary-light);
}

.admin-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.admin-name {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
}

.admin-role {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.admin-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: all 0.2s;
    text-decoration: none;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
}

/* Ajustements pour le contenu principal */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

body { 
    background: var(--admin-bg); 
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
}

/* Modern Header */
.admin-header { 
    background: var(--admin-surface); 
    color: var(--color-text);
    padding: 16px 30px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}

.admin-header h1 { 
    margin: 0; 
    font-size: 1.25rem; 
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-header a { 
    color: var(--color-text);
    text-decoration: none; 
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-header a:hover { 
    color: var(--admin-accent); 
    background: var(--color-bg);
    text-decoration: none; 
}

/* Modern Layout */
.admin-layout { 
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Modern Sidebar */
.admin-sidebar { 
    background: var(--sidebar-bg);
    color: white;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar nav { 
    padding: 30px 20px;
}

.admin-sidebar nav a { 
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px; 
    margin-bottom: 8px; 
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none; 
    border-radius: 12px; 
    font-weight: 600;
    transition: all var(--transition-fast);
    border: none;
}

.admin-sidebar nav a.active, 
.admin-sidebar nav a:hover { 
    background: rgba(255, 255, 255, 0.15); 
    color: #fff; 
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-sidebar nav a .badge {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: auto;
}

.admin-main { 
    padding: 30px;
    background: var(--admin-bg);
    max-width: 100%;
    overflow-x: hidden;
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -30px;
    padding: 0 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

/* Modern Section Cards */
.admin-section { 
    background: var(--admin-surface); 
    padding: 30px; 
    border-radius: 20px; 
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.admin-section:hover {
    box-shadow: var(--card-hover-shadow);
}

.admin-section h2 { 
    margin-top: 0; 
    color: var(--color-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-border);
}

/* Modern Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Modern Metrics */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--metric-bg);
    color: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card.success {
    background: var(--success-gradient);
}

.metric-card.warning {
    background: var(--warning-gradient);
}

.metric-card.info {
    background: var(--info-gradient);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.metric-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 600;
    position: relative;
}

.metric-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.8;
}

/* Quick Actions Modern */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.action-btn {
    background: var(--admin-surface);
    border: 2px solid var(--color-border);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    border-color: var(--admin-accent);
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
    text-decoration: none;
    color: var(--admin-accent);
}

.action-btn i {
    font-size: 2rem;
    margin-bottom: 8px;
}

.action-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Recent Activity Modern */
.recent-activity {
    background: var(--admin-surface);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.activity-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: between;
    align-items: center;
}

.activity-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 18px 25px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-fast);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--color-bg);
}

.activity-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Stats Grid Modern */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--admin-surface);
    padding: 25px;
    border-radius: 16px;
    border-left: 4px solid var(--admin-accent);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--admin-accent);
}

/* Modern Table Styles */
.table-responsive { 
    overflow: auto; 
    border-radius: 16px; 
    box-shadow: var(--card-shadow); 
    background: var(--admin-surface);
    border: 1px solid var(--color-border);
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.92rem; 
}

th, td { 
    padding: 16px 20px; 
    border-bottom: 1px solid var(--color-border); 
    text-align: left; 
    vertical-align: middle; 
}

th { 
    background: var(--color-bg); 
    font-weight: 700; 
    color: var(--color-text); 
    position: sticky; 
    top: 0; 
    z-index: 1;
    border-bottom: 2px solid var(--color-border);
    font-size: 0.9rem;
}

tbody tr:nth-child(even) { 
    background: rgba(0, 0, 0, 0.02); 
}

tbody tr:hover { 
    background: rgba(29, 58, 95, 0.05); 
    transform: scale(1.01);
}

td.actions { 
    white-space: nowrap; 
    text-align: right; 
}

.actions a { 
    color: var(--admin-accent-secondary); 
    font-weight: 700; 
    text-decoration: none; 
    margin-left: 12px; 
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.actions a:first-child { 
    margin-left: 0; 
}

.actions a:hover { 
    color: var(--admin-accent); 
    background: var(--color-bg);
    text-decoration: none; 
}

/* Modern Form Styles */
.form-row { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
}

.form-group { 
    margin-bottom: 20px; 
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    background: var(--admin-surface);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(29, 58, 95, 0.1);
}

/* Modern Gallery Grid */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 20px; 
}

.gallery-item { 
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-base);
    background: var(--admin-surface);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.gallery-item img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
    border-radius: 16px; 
}

/* Modern Badges */
.badge { 
    display: inline-flex;
    align-items: center;
    padding: 6px 12px; 
    border-radius: 20px; 
    background: var(--admin-accent-secondary); 
    color: #fff; 
    font-weight: 700; 
    font-size: 0.75rem; 
    gap: 4px;
}

/* Modern Alerts */
.admin-alert {
    margin: 16px 0 20px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
    color: #1e7e34;
}

.admin-alert-error {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #c0392b;
}

/* Empty State Modern */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 12px;
    color: var(--color-text);
    font-size: 1.3rem;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-metrics {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 250px 1fr;
    }
    
    .admin-main {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .admin-header {
        padding: 12px 20px;
    }
    
    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .admin-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .admin-main {
        padding: 15px;
    }

    .admin-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .admin-section h2 {
        font-size: 1.25rem;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .action-btn {
        padding: 16px;
    }

    .table-responsive {
        border-radius: 12px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 12px 15px;
    }

    td.actions {
        white-space: normal;
        text-align: left;
    }

    .actions a {
        display: inline-flex;
        margin: 4px 8px 4px 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .admin-main {
        padding: 10px;
    }

    .admin-section h2 {
        font-size: 1.125rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .gallery-item img {
        height: 150px;
    }

    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .activity-item {
        padding: 15px;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-section {
        padding: 16px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .activity-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .activity-icon {
        align-self: center;
    }
    
    .admin-header a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}