/**
 * LUMIÈRE Admin Dashboard Styles
 * Admin layout, sidebar, stats, tables, forms
 */

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-body {
    background: var(--color-secondary);
    min-height: 100vh;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.dashboard-sidebar {
    width: 260px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: var(--z-fixed);
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-header .logo {
    color: var(--color-text-inverse);
    font-size: var(--text-xl);
}

.sidebar-header span {
    font-size: var(--text-xs);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: var(--space-4) 0;
}

.nav-section {
    margin-bottom: var(--space-4);
}

.nav-section-title {
    padding: var(--space-2) var(--space-6);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    font-weight: var(--font-semibold);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: rgba(255,255,255,0.7);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--color-text-inverse);
}

.nav-item.active {
    background: rgba(212,175,55,0.1);
    color: var(--color-accent);
    border-left: 3px solid var(--color-accent);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-accent);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    min-width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

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

.user-details h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.user-details p {
    font-size: var(--text-xs);
    opacity: 0.7;
}

/* ==================== MAIN CONTENT ==================== */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: var(--space-6);
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.top-bar h1 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.search-box {
    position: relative;
}

.search-box input {
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    width: 250px;
}

.search-box i {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--color-background);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

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

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.stat-change {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.stat-change.positive {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ==================== CONTENT CARDS ==================== */
.content-card {
    background: var(--color-background);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
    overflow: hidden;
}

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

.card-header h2 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
}

.card-header-actions {
    display: flex;
    gap: var(--space-3);
}

.card-body {
    padding: var(--space-6);
}

/* ==================== DATA TABLE ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th,
.data-table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.5px;
    background: var(--color-secondary);
}

.data-table tr:hover td {
    background: var(--color-secondary);
}

.data-table .product-thumb {
    width: 50px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: var(--space-3);
}

.data-table .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.status-badge.active::before {
    background: var(--color-success);
}

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

.status-badge.pending::before {
    background: var(--color-warning);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.status-badge.inactive::before {
    background: var(--color-error);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: var(--space-2);
}

.action-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.action-icon:hover {
    background: var(--color-secondary);
    color: var(--color-primary);
}

.action-icon.edit:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.action-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

/* ==================== PRODUCT FORM ==================== */
.product-form {
    max-width: 800px;
}

.form-section {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-border);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
}

.image-upload {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.image-upload:hover {
    border-color: var(--color-accent);
    background: rgba(212, 175, 55, 0.05);
}

.image-upload i {
    font-size: var(--text-4xl);
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.image-upload p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.image-upload .upload-hint {
    font-size: var(--text-xs);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 24px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-success);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(24px);
}

/* ==================== MOBILE SIDEBAR TOGGLE ==================== */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: var(--color-primary);
    font-size: var(--text-xl);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-fixed);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .card-header {
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }
    
    .data-table {
        font-size: var(--text-xs);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--space-2);
    }
}