:root {
    /* User Colors */
    --primary-color: #044569;
    /* Deep Blue (Main Text/Header) */
    --secondary-color: #058F48;
    /* Vibrant Green (Accent/CTA) */

    /* Neumorphism & Background Base */
    --bg-color: #e0e5ec;
    /* Main background color */
    --dark-shadow: #a3b1c6;
    /* Dark shadow for depth */
    --white-shadow: #ffffff;
    /* Light shadow for highlights */

    /* Text & General */
    --text-dark: var(--primary-color);
    --text-subtle: #6b7280;
    /* Using a slightly darker subtle color for readability */
    --text-active: #ffffff;
    /* White text on accent backgrounds */
    --border-color: #c8d3e2;
    /* Mid-tone for soft dividers */

    /* Accent & Button Colors */
    --accent-color: var(--secondary-color);
    --accent-hover: #036b36;
    /* Darker green */
    --button-primary: var(--secondary-color);
    --button-success: #10b981;
    --button-danger: #ef4444;

    /* Neumorphic Shadows for Main Elements (Outset) */
    --neumorphic-out: 6px 6px 12px var(--dark-shadow), -6px -6px 12px var(--white-shadow);

    /* Neumorphic Shadows for Active/Pressed Elements (Inset) */
    --neumorphic-in: inset 3px 3px 6px var(--dark-shadow), inset -3px -3px 6px var(--white-shadow);

    /* Status Colors (kept vibrant for visibility) */
    --status-pending: #f59e0b;
    --status-processing: #3b82f6;
    --status-intransit: #10b981;
    --status-outfordelivery: #6366f1;
    /* Added for Out for Delivery */
    --status-delivered: #059669;
    --status-cancelled: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

/* 2. Base Dashboard Layout (Neumorphism applied) */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-dark);
}

/* 3. Sidebar Styles */
.sidebar {
    width: 250px;
    background: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 40px 0;
    display: flex;
    flex-direction: column;

    /* Soft Neumorphic separation from the main content */
    box-shadow: 2px 0 5px var(--dark-shadow);

    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu a {
    text-decoration: none;
    color: var(--text-dark);
}

.sidebar-menu li {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu li i {
    font-size: 18px;
}

/* Sidebar Hover/Active State (Subtle Inset) */
.sidebar-menu li:hover {
    color: var(--accent-color);
    background: #e9eef5;
}

.sidebar-menu li.active {
    /* Mimics a subtle press/selection */
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
    font-weight: 600;
    background: #e9eef5;
}

/* 4. Main Content Styles */
.main-content {
    flex-grow: 1;
    padding: 30px 40px;
    overflow-y: auto;
    /* Allows vertical scrolling for main content */
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* 5. KPI Cards (Neumorphic Outset Style) */
.user-achievement {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.achievement-card {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 24px;
    /* Using default radius */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;

    /* Neumorphic Outset Shadow */
    box-shadow: var(--neumorphic-out);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px var(--dark-shadow), -8px -8px 16px var(--white-shadow);
}

.achievement-icon {
    font-size: 2.2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.achievement-title {
    font-size: 0.9rem;
    color: var(--text-subtle);
    font-weight: 500;
    margin-bottom: 5px;
}

.achievement-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 6. Dashboard Table Styles */
/* Table Wrapper for Horizontal Scroll */
.table-wrapper {
    overflow-x: auto;
    /* Enables horizontal scrolling for the table */
    -webkit-overflow-scrolling: touch;
    /* Improves scrolling on iOS */
    border-radius: 24px;
    /* Apply to wrapper for consistent neumorphism */
    box-shadow: var(--neumorphic-out);
    /* Apply neumorphic shadow here */
}

.dashboard-table {
    width: 100%;
    /* Ensure table takes full width of its container */
    min-width: 900px;
    /* Minimum width to prevent excessive squeezing on larger screens before mobile breakpoint */
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-color);
    border-radius: 24px;
    /* Using default radius */
    overflow: hidden;
    /* Important for border-radius to apply */
    /* Removed shadow from table, now on wrapper */
}

.dashboard-table thead tr {
    background: #e9eef5;
    /* Slightly different background for header */
    text-align: left;
}

.dashboard-table th,
.dashboard-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.dashboard-table th {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.dashboard-table td {
    color: var(--text-subtle);
    font-size: 0.875rem;
}

.dashboard-table tbody tr:hover {
    background: #f0f3f7;
    /* Very light hover effect */
}

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges - Colors remain vibrant for contrast */
.status {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

/* Status classes using the provided structure (e.g. status-key-in-css) */
.status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-pending);
}

.status.processing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-processing);
}

.status.intransit {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-intransit);
}

.status.outfordelivery {
    background: rgba(99, 102, 241, 0.1);
    color: var(--status-outfordelivery);
}

.status.delivered,
.status.completed {
    background: rgba(5, 150, 105, 0.1);
    color: var(--status-delivered);
}

.status.cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-cancelled);
}

/* Action Buttons (Neumorphic Inset on press) */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, box-shadow 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    cursor: pointer;
    background: var(--bg-color);
    color: var(--text-dark);

    /* Default button look: Subtle Outset */
    box-shadow: 2px 2px 4px var(--dark-shadow), -2px -2px 4px var(--white-shadow);
}

/* General Pressed/Active/Focus State (The Inset Effect) */
.btn:active,
.btn.pressed {
    box-shadow: var(--neumorphic-in);
    transform: scale(0.98);
}

/* Color Overrides for specific button types */
.btn.primary {
    background: var(--button-primary);
    color: var(--text-active);
    border: none;
}

.btn.primary:hover {
    background: var(--accent-hover);
}

.btn.primary:active {
    background: var(--accent-hover);
    box-shadow: var(--neumorphic-in);
}

.btn.download {
    background: var(--button-success);
    color: var(--text-active);
    border: none;
}

.btn.download:hover {
    background: #0c9e70;
}

.btn.download:active {
    background: #0c9e70;
    box-shadow: var(--neumorphic-in);
}

.btn.cancel {
    background: var(--button-danger);
    color: var(--text-active);
    border: none;
}

.btn.cancel:hover {
    background: #d73a3a;
}

.btn.cancel:active {
    background: #d73a3a;
    box-shadow: var(--neumorphic-in);
}

.btn.photo-btn {
    background: #8b5cf6;
    color: var(--text-active);
    border: none;
}

.btn.photo-btn:hover {
    background: #7c3aed;
}

.btn.photo-btn:active {
    background: #7c3aed;
    box-shadow: var(--neumorphic-in);
}

.btn.track {
    color: var(--text-dark);
}

/* Use default neumorphic look */
.btn.track:hover {
    background: #f0f3f7;
}

.btn.disabled {
    background: var(--border-color);
    color: var(--text-subtle);
    cursor: not-allowed;
    box-shadow: none;
}

.text-muted {
    color: var(--text-subtle);
    font-style: italic;
    font-size: 0.8rem;
}

/* 7. Mobile Menu Toggle Button */
.menu-toggle {
    /* position: fixed; */
    /* top: 20px; */
    margin: 10px 0px 0px 20px;
    z-index: 110;
    background: var(--accent-color);
    color: var(--text-active);
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    /* Outset shadow for button */
    box-shadow: 3px 3px 6px var(--dark-shadow), -3px -3px 6px var(--white-shadow);
    display: none;
    width: max-content;
    transition: background 0.2s ease;
}

.menu-toggle:active {
    /* Inset shadow for press */
    box-shadow: var(--neumorphic-in);
    background: var(--accent-hover);
}

/* 8. Image Popup Modal */
#image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

#image-modal-content {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 24px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--neumorphic-out);
    position: relative;
    /* Needed for absolute positioning of close button */
}

#modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: var(--neumorphic-in);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.2rem;
    /* Larger 'x' */
    font-weight: normal;
    /* To prevent bolding the 'x' */
    color: var(--primary-color);
    cursor: pointer;
    line-height: 1;
    /* Adjust vertical alignment */
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--button-danger);
    /* Change color on hover */
}


/* 9. Responsive Media Queries */
@media (max-width: 1024px) {

    .menu-toggle {
        display: block;
    }

    /* Sidebar - Floating Overlay Logic */
    .sidebar {
        position: fixed;
        z-index: 100;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        min-height: 100vh;
        height: 100%;
        /* Mobile shadow is slightly stronger */
        box-shadow: 8px 0 15px rgba(0, 0, 0, 0.2);
    }

    .dashboard-container.sidebar-open .sidebar {
        transform: translateX(0);
    }

    /* Backdrop/Overlay for mobile */
    .dashboard-container.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        /* Light theme backdrop - less intense */
        background: rgba(0, 0, 0, 0.4);
        z-index: 90;
        cursor: pointer;
    }

    .main-content {
        width: 100%;
        padding-top: 30px;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Hide horizontal scroll for mobile as table is stacked */
    .table-wrapper {
        overflow-x: hidden;
        box-shadow: none;
        /* Remove wrapper shadow for stacked mobile view */
    }

    /* Adjust table layout for smaller screens */
    .dashboard-table {
        min-width: unset;
        /* Remove min-width on mobile */
        box-shadow: none;
        /* Remove table shadow on mobile */
    }

    .dashboard-table thead {
        display: none;
    }

    .dashboard-table,
    .dashboard-table tbody,
    .dashboard-table tr,
    .dashboard-table td {
        display: block;
        width: 100%;
    }

    .dashboard-table tr {
        margin-bottom: 20px;
        background: var(--bg-color);
        border-radius: 18px;
        padding: 10px;
        /* Neumorphic shadow for individual mobile row */
        box-shadow: 3px 3px 6px var(--dark-shadow), -3px -3px 6px var(--white-shadow);
    }

    .dashboard-table td {
        text-align: right;
        padding: 10px 15px;
        border-bottom: 1px dashed var(--border-color);
        position: relative;
        max-width: 100%;
    }

    .dashboard-table tr:last-child td {
        border-bottom: 1px dashed var(--border-color);
    }

    .dashboard-table tr:last-child td:last-child {
        border-bottom: none;
    }

    /* Add pseudo-element to display header label */
    .dashboard-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: 600;
        color: var(--primary-color);
    }

    .action-buttons {
        justify-content: flex-start;
        padding-top: 10px;
    }
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    color: var(--secondary-text);
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #444);
    background-color: var(--table-bg, #1a1a1a);
    color: var(--primary-text, #fff);
    outline: none;
    transition: border-color 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--highlight, #007bff);
}
