/* Admin Dashboard Styles */

/* Custom Scrollbar for Admin Panel */
.admin-sidebar::-webkit-scrollbar,
.admin-sidebar .sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track,
.admin-sidebar .sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.admin-sidebar::-webkit-scrollbar-thumb,
.admin-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover,
.admin-sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
}

/* Firefox scrollbar */
.admin-sidebar,
.admin-sidebar .sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: #ff6b35 rgba(255, 255, 255, 0.05);
}
/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
        /* Prevent horizontal scroll */
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
        bottom: 0;
        right: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease, visibility 0.3s ease;
}

.admin-sidebar .sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar .sidebar-logo {
    font-size: 2rem;
}

.admin-sidebar .sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-sidebar .sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.admin-sidebar .nav-item {
    margin: 0.25rem 0.75rem;
}

.admin-sidebar .nav-section-title {
    padding: 1.25rem 1.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
}
.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #fff !important;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-sidebar .nav-link.active {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.admin-sidebar .nav-link i {
    font-size: 1.25rem;
}

.admin-sidebar .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar .sidebar-footer .nav-link {
    padding: 0.75rem 1rem;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-right: 260px;
        /* Space for sidebar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f7fa;
    transition: margin-right 0.3s ease;
        width: 100%;
}

/* Admin Header */
.admin-header {
    background: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header-left h5 {
    margin: 0;
    font-size: 1.1rem;
}
.admin-header-right .btn-link {
    color: #374151;
    text-decoration: none;
}

/* Content Area */
.admin-content {
    padding: 1.5rem;
    flex: 1;
}

/* Cards */
.admin-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        /* Better minimum width */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
        /* Prevent icon shrinking */
}

.stat-icon.orders {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.stat-icon.products {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.stat-icon.users {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #fff;
}

.stat-content {
    flex: 1;
    min-width: 0;
        /* Text truncation fix */
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Data Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f9fafb;
    padding: 0.875rem 1rem;
    text-align: right;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    border-bottom: 2px solid #e5e7eb;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    vertical-align: middle;
}

.admin-table tr:hover {
    background: #f9fafb;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.blocked {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

/* Search and Filters */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-search {
    flex: 1;
    min-width: 250px;
}

.admin-search input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.admin-search input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Responsive Breakpoints */
@media (max-width: 991.98px) {
    /* Hide Sidebar by default on mobile/tablet */
    .admin-sidebar {
        transform: translateX(100%);
        visibility: hidden;
    }
    
        /* Show Sidebar when active */
    .admin-sidebar.show {
        transform: translateX(0);
        visibility: visible;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
        /* Content takes full width */
    .admin-main {
        margin-right: 0;
    }
    
        /* Toggle button visible */
    .sidebar-toggle {
        display: block !important;
        font-size: 1.5rem;
            padding: 0;
            cursor: pointer;
            z-index: 101;
        }
        
        /* Overlay */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 900;
            cursor: pointer;
    }
}

/* Action Buttons */
/* Action Buttons */
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 0.15rem;
    background: transparent;
    color: #64748b;
    font-size: 1.2rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-btn.view {
    color: #3b82f6;
}

.action-btn.view:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.action-btn.edit {
    color: #f59e0b;
}

.action-btn.edit:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.action-btn.delete {
    color: #ef4444;
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.action-btn.invoice {
    color: #10b981;
}

.action-btn.invoice:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Admin Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-bottom: 1rem;
}

.admin-pagination button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.admin-pagination button:hover:not(:disabled) {
    border-color: #ff6b35;
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.04);
    transform: scale(1.05);
}

.admin-pagination button.active {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    border-color: #ff6b35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
}

.admin-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
}
@media (max-width: 767.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-filters {
        flex-direction: column;
    }
    
    .admin-search {
        width: 100%;
    }
        .admin-content {
            padding: 1rem;
        }
    
        .admin-card {
            padding: 1rem;
        }
    
        /* Adjust table for mobile if needed, or use scrolling */
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
                width: 100%;
                display: block;
        }
}

/* Print Styles */
@media print {
    /* Hide Sidebars, Headers, and Toggles */
    .admin-sidebar,
    .admin-header,
    .sidebar-toggle,
    .sidebar-overlay,
    .admin-layout>.admin-sidebar

    /* Double check specificity */
        {
        display: none !important;
    }

    /* Reset Main Content Layout */
    .admin-layout {
        display: block !important;
        /* Remove flex behavior */
    }

    .admin-main {
        margin: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        background: white !important;
    }

    .admin-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Card Styling for Print */
    .admin-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        /* Optional: adds a light border for clarity */
        margin-bottom: 20px !important;
        break-inside: avoid;
        /* Prevent breaking inside a card */
    }

    /* Page Header Modifications */
    .page-header {
        margin-bottom: 20px !important;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    /* Ensure text colors are dark for printing */
    .text-muted {
        color: #666 !important;
    }

    .text-primary,
    .text-danger,
    .text-success {
        color: #000 !important;
        /* Or keep colors if user has color printer, usually black is safer */
    }

    /* Grid Adjustments */
    .col-lg-8,
    .col-lg-4 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
        /* Stack columns */
    }

    /* Hide any explicitly marked print-hidden elements */
    .d-print-none {
        display: none !important;
    }
}