:root {
    --main-bg-color: #f7f9fb;
    --main-text-color: #3b3b3b;
    --second-text-color: #7a7a7a;
    --second-bg-color: #ffffff;
    --primary-color: #339018;
    /* Paula Orange */
    --primary-hover: #339018e1;
    --sidebar-width: 280px;

    /* Platform Colors */
    --ml-yellow: #fff159;
    --ml-blue: #2d3277;
    --shopee-orange: #ee4d2d;
    --shein-black: #000000;
    --tiktok-black: #000000;
    --tiktok-red: #ff0050;
}

body {
    background-color: var(--main-bg-color);
    font-family: 'Outfit', sans-serif;
    color: var(--main-text-color);
    overflow-x: hidden;
}

/* Sidebar */
#wrapper {
    overflow-x: hidden;
    display: flex;
}

.crm-sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background-color: var(--second-bg-color);
    min-height: 100vh;
    border-right: 1px solid #eef2f5;
    transition: margin 0.25s ease-out;
}

.crm-sidebar .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.crm-sidebar .list-group-item {
    border: none;
    padding: 15px 30px;
    font-weight: 500;
    color: var(--second-text-color);
    transition: all 0.3s ease;
}

.crm-sidebar .list-group-item:hover,
.crm-sidebar .list-group-item.active {
    background-color: #fff4ec;
    /* Light Orange */
    color: var(--primary-color);
    border-right: 4px solid var(--primary-color);
}

/* Page Content */
#page-content-wrapper {
    width: 100%;
    min-height: 100vh;
}

/* Cards (CRM Style) */
.card {
    border: none;
    border-radius: 12px;
    background-color: var(--second-bg-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    color: var(--second-text-color);
    padding: 1.25rem;
}

/* Stats */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.9rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0 5px;
}

.table thead th {
    border-bottom: none;
    font-weight: 600;
    color: #95a5a6;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1rem;
}

.table tbody tr {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border: none;
}

.table tbody tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table tbody tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Platform Badges */
.badge-platform {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
}

.bg-ml {
    background-color: var(--ml-yellow);
    color: var(--ml-blue);
}

.bg-shopee {
    background-color: var(--shopee-orange);
    color: white;
}

.bg-shein {
    background-color: var(--shein-black);
    color: white;
}

.bg-tiktok {
    background: linear-gradient(90deg, #00f2ea, #ff0050);
    color: white;
}

/* Utilities */
.primary-text {
    color: var(--primary-color);
}

.second-text {
    color: var(--second-text-color);
}

.bg-light-orange {
    background-color: #ecf3ff;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Thermometer Override */
.thermometer-container .progress {
    height: 12px;
    border-radius: 6px;
    background-color: #e9ecef;
}

.thermometer-container .progress-bar {
    background-color: var(--primary-color);
}

/* Inputs */
.form-control {
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none !important;
}

.form-select {
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: none !important;
}

/* Media Query */
/* Responsive Sidebar */
@media (min-width: 768px) {

    /* Desktop: Visible by default, hidden when toggled */
    #wrapper.toggled .crm-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
}

@media (max-width: 768px) {

    /* Mobile: Hidden by default, visible when toggled */
    .crm-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #wrapper.toggled .crm-sidebar {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: -17rem;
    }
}

/* Glass Effect Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner-glass {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

body.loaded #page-loader {
    opacity: 0;
    visibility: hidden;
}

/* Premium Dashboard Extras */
.card-stat {
    border: none;
    border-radius: 16px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.card-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-soft-primary {
    background-color: rgba(51, 144, 24, 0.1);
    color: var(--primary-color);
}

.bg-soft-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.bg-soft-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.bg-soft-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.bg-soft-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* Premium Global Filters */
.filter-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

.filter-select-custom {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
}

.filter-select-custom:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(51, 144, 24, 0.1);
    outline: none;
}

.filter-date-input {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.filter-date-input:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(51, 144, 24, 0.1);
    outline: none;
}

.filter-submit-btn {
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

/* Modern Toast Notification */
.toast-container {
    padding: 20px;
    z-index: 1060 !important;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    max-width: 380px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-left: 4px solid transparent;
}

.toast-body {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    color: #334155;
    font-weight: 500;
}

.toast-icon {
    font-size: 1.25rem;
    margin-right: 12px;
}

/* Toast Variants */
.toast.bg-success {
    background: #fff !important;
    border-left-color: #10b981;
}
.toast.bg-success .toast-icon {
    color: #10b981;
}

.toast.bg-danger {
    background: #fff !important;
    border-left-color: #ef4444;
}
.toast.bg-danger .toast-icon {
    color: #ef4444;
}

.toast.bg-warning {
    background: #fff !important;
    border-left-color: #f59e0b;
}
.toast.bg-warning .toast-icon {
    color: #f59e0b;
}

.toast-message {
    flex-grow: 1;
    line-height: 1.5;
}

.toast-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    margin-left: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.toast-close-btn:hover {
    color: #475569;
}