/**
 * ============================================================
 * ADMIN PANEL - Styles
 * ============================================================
 */

:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --admin-primary: #4e73df;
    --admin-secondary: #858796;
    --admin-success: #1cc88a;
    --admin-info: #36b9cc;
    --admin-warning: #f6c23e;
    --admin-danger: #e74a3b;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f4f6f9;
    font-size: 0.9rem;
}

/* ============================================================
   Layout
   ============================================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

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

.admin-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e3e6f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand:hover {
    color: #fff;
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav .nav-heading {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem 0.5rem;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--admin-primary);
    color: #fff;
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    color: var(--admin-secondary);
    padding: 0.25rem;
}

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

.topbar-stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--admin-secondary);
    text-decoration: none;
}

.admin-profile:hover {
    color: var(--admin-primary);
}

.admin-profile .avatar i {
    font-size: 1.75rem;
}

/* ============================================================
   Cards
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border-left: 4px solid var(--admin-primary);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.stat-card.primary { border-left-color: var(--admin-primary); }
.stat-card.success { border-left-color: var(--admin-success); }
.stat-card.warning { border-left-color: var(--admin-warning); }
.stat-card.danger { border-left-color: var(--admin-danger); }
.stat-card.info { border-left-color: var(--admin-info); }

.stat-card .stat-label {
    color: var(--admin-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-top: 0.25rem;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.3;
}

/* ============================================================
   Tables
   ============================================================ */
.admin-table {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    overflow: hidden;
}

.admin-table .table {
    margin-bottom: 0;
}

.admin-table .table th {
    background: #f8f9fc;
    border-top: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-secondary);
}

.admin-table .table td {
    vertical-align: middle;
}

/* ============================================================
   Forms
   ============================================================ */
.admin-form {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.admin-form .form-label {
    font-weight: 500;
    color: #333;
}

/* ============================================================
   Product Image Upload
   ============================================================ */
.image-upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-zone:hover {
    border-color: var(--admin-primary);
}

.image-upload-zone.dragover {
    border-color: var(--admin-primary);
    background: rgba(78, 115, 223, 0.05);
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid #dee2e6;
}

.image-preview-item.primary {
    border-color: var(--admin-success);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .image-actions {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25rem;
    display: flex;
    gap: 0.25rem;
}

.image-preview-item .btn-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
}

/* ============================================================
   Order Details Modal
   ============================================================ */
.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.order-items-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.payment-info-card {
    background: #f8f9fc;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* ============================================================
   Utilities
   ============================================================ */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
}

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

.text-taka::before {
    content: '৳ ';
}

/* Status badges */
.badge-pending { background-color: var(--admin-warning); color: #000; }
.badge-processing { background-color: var(--admin-info); }
.badge-shipped { background-color: var(--admin-primary); }
.badge-delivered { background-color: var(--admin-success); }
.badge-cancelled { background-color: var(--admin-danger); }
