/* ====================================
   🎨 INTERFACE ADMINISTRATEUR MODERNE
   ====================================*/

:root {
    /* Couleurs spécifiques admin */
    --admin-primary: #0066cc;
    --admin-secondary: #00d4ff;
    --admin-dark: #1e293b;
    --admin-light: #f8fafc;
    --admin-accent: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;

    /* Gradients admin */
    --admin-gradient: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-secondary) 100%);
    --admin-sidebar-gradient: linear-gradient(180deg, var(--admin-dark) 0%, #334155 100%);

    /* Dimensions */
    --admin-sidebar-width: 280px;
    --admin-header-height: 70px;
    --admin-mobile-tab-height: 70px;
}

/* ====================================
   📱 LAYOUT PRINCIPAL ADMIN
   ====================================*/

.admin-container {
    display: flex;
    min-height: 100vh;
    background: var(--admin-light);
}

.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: var(--admin-sidebar-gradient);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

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

.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

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

/* ====================================
   🎨 HEADER ADMIN
   ====================================*/

.admin-header {
    height: var(--admin-header-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

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

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--admin-dark);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--admin-light);
    color: var(--admin-primary);
}

.admin-breadcrumb {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-breadcrumb a {
    color: var(--admin-primary);
    text-decoration: none;
    font-weight: 500;
}

.admin-breadcrumb .separator {
    color: #cbd5e1;
}

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

.admin-search {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-search input {
    background: var(--admin-light);
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 0.875rem;
    width: 300px;
    transition: all 0.3s ease;
}

.admin-search input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    background: white;
}

.admin-search .search-icon {
    position: absolute;
    left: 1rem;
    color: #64748b;
    font-size: 1rem;
}

.admin-notifications {
    position: relative;
    cursor: pointer;
}

.admin-notifications .notification-icon {
    font-size: 1.25rem;
    color: #64748b;
    transition: color 0.3s ease;
}

.admin-notifications:hover .notification-icon {
    color: var(--admin-primary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--admin-danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.admin-user:hover {
    background: var(--admin-light);
}

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

.admin-user-info {
    display: flex;
    flex-direction: column;
}

.admin-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--admin-dark);
}

.admin-user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* ====================================
   🎨 SIDEBAR NAVIGATION
   ====================================*/

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.admin-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--admin-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.admin-nav {
    padding: 1.5rem 0;
}

.admin-nav-section {
    margin-bottom: 2rem;
}

.admin-nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

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

.admin-nav-item {
    margin-bottom: 0.25rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.admin-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.admin-nav-link.active {
    color: white;
    background: var(--admin-gradient);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.admin-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--admin-secondary);
    border-radius: 0 4px 4px 0;
}

.admin-nav-icon {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.admin-nav-text {
    font-size: 0.875rem;
}

.admin-nav-badge {
    margin-left: auto;
    background: var(--admin-accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

/* ====================================
   📊 CONTENT AREA
   ====================================*/

.admin-content {
    flex: 1;
    padding: 2rem;
    background: var(--admin-light);
    min-height: calc(100vh - var(--admin-header-height));
}

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

.admin-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-page-title .title-icon {
    width: 48px;
    height: 48px;
    background: var(--admin-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.admin-page-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.admin-page-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ====================================
   📊 CARDS & WIDGETS ADMIN
   ====================================*/

.admin-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.admin-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

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

.admin-card-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--admin-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-card-title .card-icon {
    width: 32px;
    height: 32px;
    background: var(--admin-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.admin-card-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-card-body {
    padding: 1.5rem;
}

.admin-stat-card {
    background: var(--admin-gradient);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(40px, -40px);
}

.admin-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.admin-stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.admin-stat-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 3rem;
    opacity: 0.3;
}

.admin-stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    z-index: 1;
}

.admin-stat-change.positive {
    color: #10b981;
}

.admin-stat-change.negative {
    color: #ef4444;
}

/* ====================================
   📋 TABLEAUX ADMIN
   ====================================*/

.admin-table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table thead {
    background: var(--admin-gradient);
}

.admin-table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

.admin-table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--admin-dark);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: var(--admin-light);
}

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

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

.admin-table .action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.admin-table .action-btn.edit {
    background: #e0f2fe;
    color: #0369a1;
}

.admin-table .action-btn.edit:hover {
    background: #0369a1;
    color: white;
}

.admin-table .action-btn.delete {
    background: #fef2f2;
    color: #dc2626;
}

.admin-table .action-btn.delete:hover {
    background: #dc2626;
    color: white;
}

.admin-table .action-btn.view {
    background: #f0fdf4;
    color: #15803d;
}

.admin-table .action-btn.view:hover {
    background: #15803d;
    color: white;
}

/* ====================================
   🔘 BOUTONS ADMIN
   ====================================*/

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.admin-btn-primary {
    background: var(--admin-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.admin-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}

.admin-btn-secondary {
    background: white;
    color: var(--admin-primary);
    border: 2px solid var(--admin-primary);
}

.admin-btn-secondary:hover {
    background: var(--admin-primary);
    color: white;
}

.admin-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.admin-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.admin-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

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

.admin-btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.admin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ====================================
   📱 MOBILE RESPONSIVENESS
   ====================================*/

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .admin-sidebar.mobile-visible {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-header {
        padding: 0 1rem;
    }

    .admin-search input {
        width: 200px;
    }

    .admin-content {
        padding: 1rem;
        padding-bottom: calc(var(--admin-mobile-tab-height) + 1rem);
    }

    .admin-page-title {
        font-size: 1.5rem;
    }

    .admin-page-actions {
        justify-content: stretch;
    }

    .admin-page-actions .admin-btn {
        flex: 1;
        justify-content: center;
    }

    .admin-card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-card-body {
        padding: 1rem;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 600px;
    }

    .admin-user-info {
        display: none;
    }
}

/* ====================================
   📱 MOBILE TAB BAR (Admin spécifique)
   ====================================*/

.admin-mobile-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--admin-mobile-tab-height);
    background: white;
    border-top: 1px solid #e2e8f0;
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.admin-mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 12px;
    min-width: 60px;
}

.admin-mobile-tab:hover,
.admin-mobile-tab.active {
    color: var(--admin-primary);
    background: rgba(0, 102, 204, 0.1);
}

.admin-mobile-tab .tab-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.admin-mobile-tab .tab-label {
    font-size: 0.75rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .admin-mobile-tabs {
        display: flex;
    }
}

/* ====================================
   🎨 FORMULAIRES ADMIN
   ====================================*/

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

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

.admin-form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.3s ease;
}

.admin-form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.admin-form-control.error {
    border-color: var(--admin-danger);
}

.admin-form-control.success {
    border-color: var(--admin-accent);
}

.admin-form-help {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.admin-form-error {
    font-size: 0.75rem;
    color: var(--admin-danger);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ====================================
   🎨 BADGES & STATUS
   ====================================*/

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-badge-primary {
    background: rgba(0, 102, 204, 0.1);
    color: var(--admin-primary);
}

.admin-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--admin-accent);
}

.admin-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--admin-warning);
}

.admin-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--admin-danger);
}

.admin-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.admin-status-dot.success {
    background: var(--admin-accent);
}

.admin-status-dot.warning {
    background: var(--admin-warning);
}

.admin-status-dot.danger {
    background: var(--admin-danger);
}

/* ====================================
   🎨 OVERLAY & MODALS
   ====================================*/

.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.admin-overlay.active {
    display: flex;
}

.admin-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.admin-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: between;
}

.admin-modal-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--admin-dark);
    flex: 1;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.admin-modal-close:hover {
    background: var(--admin-light);
    color: var(--admin-dark);
}

.admin-modal-body {
    padding: 1.5rem;
}

.admin-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ====================================
   🎨 ANIMATIONS & TRANSITIONS
   ====================================*/

.admin-fade-in {
    animation: adminFadeIn 0.5s ease-out;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-slide-in {
    animation: adminSlideIn 0.3s ease-out;
}

@keyframes adminSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ====================================
   🎨 DARK MODE SUPPORT
   ====================================*/

@media (prefers-color-scheme: dark) {
    :root {
        --admin-light: #1e293b;
        --admin-dark: #f1f5f9;
    }

    .admin-header {
        background: #334155;
        border-bottom-color: #475569;
    }

    .admin-card {
        background: #334155;
        border-color: #475569;
    }

    .admin-form-control {
        background: #475569;
        border-color: #64748b;
        color: white;
    }

    .admin-table-container {
        background: #334155;
    }

    .admin-modal {
        background: #334155;
    }
}