/* ============================================
   Admin Portal CSS
   ============================================ */

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

:root {
    /* Brand Colors - Rose Gold & Warm Tones */
    --rose-gold: #D4A574;
    --rose-gold-light: #E8B4A8;
    --rose-gold-lighter: #F4D4C4;
    --rose-gold-dark: #C49A8A;
    --rose-gold-darker: #B88A7A;
    
    /* Warm Brown */
    --warm-brown: #8B6F5E;
    --warm-brown-light: #A68B7A;
    --warm-brown-dark: #6B5445;
    
    /* Cream/Beige */
    --cream: #FAF8F5;
    --cream-light: #FEFCF9;
    --beige: #F4EDE0;
    --beige-warm: #E8DCC6;
    
    /* Text Colors */
    --text-dark: #3A2E2A;
    --text-medium: #5A4A3A;
    --text-light: #6B5445;
    
    /* Neutrals */
    --black: #3A2E2A;
    --white: #FFFFFF;
    --background: #FAF5F2;
    
    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Admin Specific */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent text selection issues on mobile */
    -webkit-tap-highlight-color: transparent;
}

/* Improve touch scrolling */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Better touch targets */
button,
a,
input[type="checkbox"],
input[type="radio"] {
    touch-action: manipulation;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, rgba(244, 212, 196, 0.98) 0%, rgba(250, 240, 235, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(232, 180, 168, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(232, 180, 168, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Playfair Display', serif;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-medium);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item:hover {
    background-color: rgba(232, 180, 168, 0.2);
    color: var(--rose-gold-dark);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(232, 180, 168, 0.3) 0%, transparent 100%);
    color: var(--rose-gold-dark);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--rose-gold) 0%, var(--rose-gold-dark) 100%);
}

.badge {
    margin-left: auto;
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(232, 180, 168, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(232, 180, 168, 0.2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.main-site-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.main-site-btn:hover {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--info);
    transform: translateY(-1px);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: rgba(232, 180, 168, 0.2);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background-color: rgba(232, 180, 168, 0.3);
    color: var(--rose-gold-dark);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(232, 180, 168, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

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

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Playfair Display', serif;
}

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

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-medium);
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid rgba(232, 180, 168, 0.3);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--rose-gold);
    box-shadow: 0 0 0 3px rgba(232, 180, 168, 0.1);
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background-color: rgba(232, 180, 168, 0.1);
}

.notification-dot {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* ============================================
   Content Wrapper
   ============================================ */

.content-wrapper {
    padding: 2rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid rgba(232, 180, 168, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(232, 180, 168, 0.1);
    border-color: var(--rose-gold);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #DC2626;
}

/* ============================================
   Stats Cards
   ============================================ */

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

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid rgba(232, 180, 168, 0.1);
}

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

.stat-card.small {
    padding: 1.25rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.stat-change.positive {
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

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

.stat-change.neutral {
    color: var(--text-medium);
    background-color: rgba(0, 0, 0, 0.05);
}

/* ============================================
   Dashboard Cards
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(232, 180, 168, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(232, 180, 168, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Playfair Display', serif;
}

.period-select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(232, 180, 168, 0.3);
    border-radius: var(--border-radius);
    background-color: var(--white);
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
}

.view-all-link {
    color: var(--rose-gold-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: var(--rose-gold);
}

.card-body {
    padding: 1.5rem;
}

/* Chart Placeholder */
.chart-placeholder {
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--rose-gold-light), var(--rose-gold));
    border-radius: 4px 4px 0 0;
    min-height: 20px;
    transition: all 0.3s ease;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: rgba(232, 180, 168, 0.05);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.order-item:hover {
    background-color: rgba(232, 180, 168, 0.1);
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-id {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.order-customer {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.order-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-amount {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.order-status {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.status-processing {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-shipped {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-delivered {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(232, 180, 168, 0.05);
    border-radius: var(--border-radius);
}

.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.product-info {
    flex: 1;
}

.product-info h4 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.product-info p {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.product-revenue {
    font-weight: 600;
    color: var(--rose-gold-dark);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(232, 180, 168, 0.05);
    border-radius: var(--border-radius);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* ============================================
   Tables
   ============================================ */

.table-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(232, 180, 168, 0.1);
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.table-card .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-card .table-scroll::-webkit-scrollbar {
    height: 6px;
}

.table-card .table-scroll::-webkit-scrollbar-track {
    background: rgba(232, 180, 168, 0.1);
    border-radius: 3px;
}

.table-card .table-scroll::-webkit-scrollbar-thumb {
    background: rgba(232, 180, 168, 0.5);
    border-radius: 3px;
}

.table-card .table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 180, 168, 0.7);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

/* Mobile Table Card View */
.table-card-mobile {
    display: none;
}

.mobile-table-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(232, 180, 168, 0.1);
}

.mobile-table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(232, 180, 168, 0.1);
}

.mobile-table-card-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.mobile-table-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.mobile-table-label {
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 500;
}

.mobile-table-value {
    font-size: 0.9rem;
    color: var(--text-dark);
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

.mobile-table-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(232, 180, 168, 0.1);
}

.data-table thead {
    background-color: rgba(232, 180, 168, 0.1);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    border-bottom: 2px solid rgba(232, 180, 168, 0.2);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(232, 180, 168, 0.1);
    font-size: 0.9rem;
    color: var(--text-medium);
}

.data-table tbody tr:hover {
    background-color: rgba(232, 180, 168, 0.05);
}

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

/* Product Cell */
.product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.product-id {
    display: block;
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-top: 0.25rem;
}

/* Customer Cell */
.customer-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.customer-email {
    display: block;
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-top: 0.25rem;
}

.customer-id {
    display: block;
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-top: 0.25rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-inactive {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}

.status-vip {
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    color: var(--white);
}

/* Stock Badges */
.stock-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stock-high {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stock-medium {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stock-low {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stock-out {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-value {
    font-weight: 600;
    color: var(--text-dark);
}

.stock-unit {
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--border-radius);
    background-color: rgba(232, 180, 168, 0.1);
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: rgba(232, 180, 168, 0.2);
    transform: scale(1.1);
}

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

.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.view-btn:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Status Select */
.status-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid rgba(232, 180, 168, 0.3);
    border-radius: 20px;
    background-color: var(--white);
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-select:focus {
    outline: none;
    border-color: var(--rose-gold);
}

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

.status-select.status-processing {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.3);
}

.status-select.status-shipped {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.status-select.status-delivered {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

/* ============================================
   Filters
   ============================================ */

.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-medium);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(232, 180, 168, 0.3);
    border-radius: var(--border-radius);
    background-color: var(--white);
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--rose-gold);
    box-shadow: 0 0 0 3px rgba(232, 180, 168, 0.1);
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(232, 180, 168, 0.3);
    border-radius: var(--border-radius);
    background-color: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background-color: rgba(232, 180, 168, 0.1);
    border-color: var(--rose-gold);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
    color: var(--white);
    border-color: transparent;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Modals
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(232, 180, 168, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Playfair Display', serif;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--text-medium);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: rgba(232, 180, 168, 0.1);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(232, 180, 168, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ============================================
   Forms
   ============================================ */

.product-form,
.stock-form,
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(232, 180, 168, 0.3);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--text-dark);
    background-color: var(--white);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--rose-gold);
    box-shadow: 0 0 0 3px rgba(232, 180, 168, 0.1);
}

.form-control:read-only {
    background-color: rgba(232, 180, 168, 0.05);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-top: -0.25rem;
}

/* Image Upload */
.image-upload {
    position: relative;
}

.preview-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed rgba(232, 180, 168, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(232, 180, 168, 0.05);
}

.file-label:hover {
    border-color: var(--rose-gold);
    background-color: rgba(232, 180, 168, 0.1);
}

.file-label i {
    font-size: 2rem;
    color: var(--rose-gold);
    margin-bottom: 0.5rem;
}

.file-label span {
    color: var(--text-medium);
    font-size: 0.9rem;
}

/* ============================================
   Settings
   ============================================ */

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(232, 180, 168, 0.1);
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-medium);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.tab-btn:hover {
    color: var(--rose-gold-dark);
}

.tab-btn.active {
    color: var(--rose-gold-dark);
    border-bottom-color: var(--rose-gold);
}

.settings-content {
    display: none;
}

.settings-content.active {
    display: block;
}

.settings-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(232, 180, 168, 0.1);
}

.settings-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--rose-gold);
}

.shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shipping-method {
    padding: 1.5rem;
    border: 1px solid rgba(232, 180, 168, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(232, 180, 168, 0.05);
}

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

.method-header h4 {
    font-weight: 600;
    color: var(--text-dark);
}

.method-details {
    display: flex;
    justify-content: space-between;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, var(--rose-gold-light), var(--rose-gold));
}

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

.email-templates {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border: 1px solid rgba(232, 180, 168, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(232, 180, 168, 0.05);
}

.template-item h4 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.template-item p {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.security-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border: 1px solid rgba(232, 180, 168, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(232, 180, 168, 0.05);
}

.security-option h4 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.security-option p {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid rgba(232, 180, 168, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(232, 180, 168, 0.05);
}

.session-item strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.session-item p {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.session-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.session-badge.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Order Details */
.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.order-section {
    padding: 1.5rem;
    background-color: rgba(232, 180, 168, 0.05);
    border-radius: var(--border-radius);
}

.order-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.info-group label {
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 500;
}

.info-group span {
    color: var(--text-dark);
    font-weight: 500;
}

.order-items {
    margin-bottom: 1.5rem;
}

.order-item-detail {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.item-info {
    flex: 1;
}

.item-info strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.item-info span {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.item-total {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.order-totals {
    border-top: 2px solid rgba(232, 180, 168, 0.2);
    padding-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--text-medium);
}

.total-row.total-final {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(232, 180, 168, 0.2);
}

.items-count {
    color: var(--text-medium);
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
        font-size: 1.5rem;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .topbar {
        padding: 0 1rem;
        height: 60px;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .topbar-right {
        gap: 0.5rem;
    }
    
    .search-box {
        display: none;
    }
    
    .btn span {
        display: none;
    }
    
    .btn {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    /* Hide desktop table, show mobile cards */
    .table-card .table-scroll {
        display: none;
    }
    
    .table-card-mobile {
        display: block;
    }
    
    /* Show scroll hint for tables that need horizontal scroll */
    .table-card .table-scroll {
        position: relative;
    }
    
    .table-card .table-scroll::after {
        content: '← Scroll →';
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(232, 180, 168, 0.9);
        color: var(--white);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.75rem;
        pointer-events: none;
        opacity: 0.8;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 0;
        max-height: 95vh;
        width: 100%;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .modal-header {
        padding: 1.25rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .modal-footer {
        padding: 1.25rem;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .order-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        gap: 0.5rem;
    }
    
    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .pagination-btn {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .nav-item {
        padding: 1rem 1.5rem;
        min-height: 48px;
    }
    
    .sidebar-footer {
        padding: 1.25rem;
    }
    
    .main-site-btn,
    .logout-btn {
        padding: 1rem;
        min-height: 48px;
        font-size: 0.95rem;
    }
    
    .user-profile {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .settings-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .settings-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 0.875rem 1.25rem;
        white-space: nowrap;
        font-size: 0.9rem;
    }
    
    .settings-card {
        padding: 1.5rem;
    }
    
    .settings-card h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .topbar {
        padding: 0 0.75rem;
    }
    
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .stats-grid {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-content {
        text-align: center;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .product-cell,
    .customer-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .product-img,
    .customer-avatar {
        width: 60px;
        height: 60px;
    }
}

