/**
 * admin.css - Styles spécifiques au panneau d'administration
 * Groupement des Artisans de Lubumbashi (GAL)
 * Version Ultimate - Design SaaS Moderne
 */

/* ===== VARIABLES ADMIN ===== */
:root {
    --admin-sidebar-width: 280px;
    --admin-header-height: 70px;
    --admin-primary: #dc2626;
    /* GAL Red */
    --admin-primary-dark: #b91c1c;
    --admin-primary-light: #fee2e2;
    --admin-secondary: #475569;
    --admin-bg: #f8fafc;
    /* Light gray background */
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;

    --text-main: #0f172a;
    --text-muted: #64748b;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== GLOBAL & LAYOUT ===== */
body.admin-body {
    background-color: var(--admin-bg);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR (PRO STYLE) ===== */
.sidebar {
    width: var(--admin-sidebar-width);
    background: white;
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    height: var(--admin-header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-brand h2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.sidebar-brand p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Navigation Groups */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0.75rem;
}

.nav-label:first-child {
    margin-top: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    position: relative;
}

.nav-link i.nav-icon {
    font-size: 1.125rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-link:hover i.nav-icon {
    color: var(--text-main);
}

.nav-link.active {
    background: var(--admin-primary-light);
    color: var(--admin-primary-dark);
    font-weight: 600;
}

.nav-link.active i.nav-icon {
    color: var(--admin-primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--admin-border);
    background: #f8fafc;
}

/* ===== MAIN HEADER ===== */
.main-wrapper {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background: var(--admin-bg);
}

.admin-header {
    height: var(--admin-header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--admin-border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    /* Desktop */
    padding: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 6px;
}

.toggle-sidebar:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.breadcrumb-separator {
    color: #cbd5e1;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1.5rem;
    padding-right: 1.5rem;
    border-right: 1px solid var(--admin-border);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--admin-border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.icon-btn:hover {
    background: #f8fafc;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--admin-primary);
    border-radius: 50%;
    border: 1px solid white;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* ===== MAIN CONTENT AREA ===== */
.admin-main {
    padding: 2rem;
    flex: 1;
    max-width: 1140px;
    /* Réduit pour éviter l'effet "trop large" */
    margin: 0 auto;
    width: 100%;
}

/* ===== DASHBOARD V2 ===== */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.925rem;
}

/* Status Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid var(--admin-border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon--primary {
    background: var(--admin-primary-light);
    color: var(--admin-primary);
}

.stat-icon--success {
    background: #dcfce7;
    color: var(--success);
}

.stat-icon--warning {
    background: #fef3c7;
    color: var(--warning);
}

.stat-icon--info {
    background: #dbeafe;
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Cards & Charts */
.admin-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--admin-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

/* Activity Feed */
.activity-item {
    transition: background-color 0.2s;
}

.activity-item:hover {
    background-color: #f8fafc !important;
    /* Force override for hover effect interaction */
}

/* ===== TABLE STYLES ===== */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--admin-border);
    text-align: left;
}

.admin-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.875rem;
    color: var(--text-main);
}

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

.admin-table tr:hover td {
    background-color: #f8fafc;
}

/* ===== MODERN FORMS ===== */
.admin-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.admin-form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.admin-form-group:focus-within .admin-form-label {
    color: var(--admin-primary);
}

.admin-form-input,
.admin-form-select,
.admin-form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

.admin-form-input:hover,
.admin-form-select:hover,
.admin-form-textarea:hover {
    border-color: #cbd5e1;
    background-color: #fff;
}

.admin-form-input:focus,
.admin-form-select:focus,
.admin-form-textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.admin-form-input::placeholder,
.admin-form-textarea::placeholder {
    color: #cbd5e1;
}

/* Custom Select styling (avec chevron SVG) */
.admin-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' fill='%2364748b'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ===== COMPONENTS ===== */

/* Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.admin-btn--primary {
    background: var(--admin-primary);
    color: white;
    box-shadow: 0 2px 4px 0 rgba(220, 38, 38, 0.3);
}

.admin-btn--primary:hover {
    background: var(--admin-primary-dark);
    box-shadow: 0 4px 8px -1px rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
}

.admin-btn--outline {
    background: white;
    border-color: var(--admin-border);
    color: var(--text-main);
}

.admin-btn--outline:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-xs {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 8px;
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge--success {
    background: #dcfce7;
    color: #166534;
}

.badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge--info {
    background: #dbeafe;
    color: #1e40af;
}

.badge--pending {
    background: #f3f4f6;
    color: #4b5563;
}

/* Modal */
.admin-modal {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.admin-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.admin-modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.modal-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

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

    .toggle-sidebar {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}
/* ===== LOGIN PAGE (PORTRAIT) ===== */
.admin-login-body {
    background: #0f172a;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.login-glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 360px; /* Force portrait mode */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
    animation: slideUpLogin 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.admin-login-body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140vw;
    height: 140vh;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.1) 0%, transparent 60%);
    animation: rotateLogin 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotateLogin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Login Inputs Specifics */
.login-glass-card .admin-form-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.login-glass-card .admin-form-input:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25) !important;
}

.login-glass-card .admin-form-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.login-glass-card .input-icon {
    color: rgba(255, 255, 255, 0.3) !important;
}

.login-glass-card .input-icon-wrapper:focus-within .input-icon {
    color: var(--admin-primary) !important;
}

