/* ============================================
   BLOOMEBYLAV ADMIN PANEL STYLES
   ============================================ */

:root {
    --primary: #d4af37;
    --primary-dark: #b8972e;
    --secondary: #5a3c34;
    --bg-dark: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-card: #ffffff;
    --bg-light: #f8f9fa;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --info: #74b9ff;
    --border: #e1e5e9;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-sidebar) 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--secondary);
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

/* ============================================
   ADMIN DASHBOARD LAYOUT
   ============================================ */

.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 1.75rem;
    color: var(--primary);
}

.sidebar-header span {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    background: rgba(212, 175, 55, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(225, 112, 85, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

.top-bar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.user-info i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* ============================================
   TAB CONTENT
   ============================================ */

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    gap: 1rem;
}

.filter-group select,
.filter-group input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.orders {
    background: rgba(116, 185, 255, 0.2);
    color: var(--info);
}

.stat-icon.revenue {
    background: rgba(0, 184, 148, 0.2);
    color: var(--success);
}

.stat-icon.pending {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
}

.stat-icon.products {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-header a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.card-body {
    padding: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* ============================================
   DATA TABLES
   ============================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.03);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending {
    background: rgba(253, 203, 110, 0.2);
    color: #d68910;
}

.status-badge.processing {
    background: rgba(116, 185, 255, 0.2);
    color: #2980b9;
}

.status-badge.shipped {
    background: rgba(155, 89, 182, 0.2);
    color: #8e44ad;
}

.status-badge.delivered {
    background: rgba(0, 184, 148, 0.2);
    color: #00a884;
}

.status-badge.cancelled {
    background: rgba(225, 112, 85, 0.2);
    color: #c0392b;
}

.action-btn {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    transition: var(--transition);
}

.action-btn.view {
    background: rgba(116, 185, 255, 0.2);
    color: var(--info);
}

.action-btn.edit {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary);
}

.action-btn.delete {
    background: rgba(225, 112, 85, 0.2);
    color: var(--danger);
}

.action-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card-image {
    height: 150px;
    background: linear-gradient(135deg, #fff5f5 0%, #fdf5e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-card-body {
    padding: 1rem;
}

.product-card-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.product-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.product-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.product-status.active {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
}

.product-status.inactive {
    background: rgba(225, 112, 85, 0.15);
    color: var(--danger);
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 700px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Playfair Display', serif;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-content form {
    padding: 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--border);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending-confirmation {
    background: #fff3cd;
    color: #856404;
}

.status-badge.confirmed {
    background: #d4edda;
    color: #155724;
}

.status-badge.received {
    background: #cce5ff;
    color: #004085;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.processing {
    background: #cce5ff;
    color: #004085;
}

.status-badge.shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.delivered {
    background: #d4edda;
    color: #155724;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   IMAGE UPLOAD
   ============================================ */

.image-upload-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--bg-light);
}

.image-preview {
    width: 100%;
    height: 120px;
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.image-preview i {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.image-preview span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}






.image-preview.has-image {
    border: none;
    background: linear-gradient(135deg, #fff5f5 0%, #fdf5e6 100%);
}

.upload-zone {
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    background: rgba(212, 175, 55, 0.05);
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--primary-dark);
}

.upload-zone i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upload-zone p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-zone span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.upload-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0.75rem 0;
    transition: var(--transition);
}

.upload-btn:hover {
    background: var(--primary-dark);
}

.upload-hint {
    font-size: 0.75rem !important;
    color: var(--text-light) !important;
    margin-top: 0.5rem !important;
}

.upload-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.upload-divider span {
    padding: 0 1rem;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.url-input-group {
    display: flex;
    gap: 0.5rem;
}

.url-input-group input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.url-input-group button {
    padding: 0.6rem 1rem;
    white-space: nowrap;
}

/* ============================================
   CHECKBOX LABEL
   ============================================ */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE DESIGN (MOBILE)
   ============================================ */

.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Layout */
    .admin-dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Top Bar */
    .top-bar {
        padding: 0.75rem 1rem;
    }

    .menu-toggle-btn {
        display: block;
        margin-right: 0.5rem;
    }

    .top-bar h2 {
        font-size: 1.2rem;
    }

    .user-info span {
        display: none;
        /* Hide name on small screens */
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Tables - Horizontal Scroll */
    .card-body {
        padding: 1rem;
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
        /* Force scroll */
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modals */
    .modal {
        padding: 1rem;
    }

    .modal-content {
        max-height: 85vh;
    }

    .image-preview {
        height: 100px;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}