/* Main CSS - Consolidating styles from dashboard_runner.html */

:root {
    --primary: #2563EB;
    --primary-light: #EFF6FF;
    --primary-dark: #1E40AF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --bg-body: #F1F5F9;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --radius-xl: 20px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow: 0 4px 15px -5px rgba(0, 0, 0, 0.05);
    /* Softer, premium shadow */
    font-size: 15px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}


/* Better Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 1px solid var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    /* App-like feel, sub-containers scroll */
}

/* Global Responsive Adjustments */
@media screen and (max-height: 800px) {
    :root {
        font-size: 14px;
    }
}


/* TAB LINKS */
.tab-link {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    color: #64748B;
    cursor: pointer;
    position: relative;
}

.tab-link.active {
    color: #2563EB;
    font-weight: 600;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #2563EB;
}

/* SIDEBAR (Glassy Dark) */
.sidebar {
    width: 240px;
    background: #0F172A;
    /* Dark Sidebar */
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #F8FAFC;
    margin-bottom: 32px;
    padding-left: 10px;
    letter-spacing: -0.5px;
    position: relative;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #94A3B8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
    padding: 24px 12px;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .footer-text {
    display: none;
}

.sidebar.collapsed .brand {
    padding-left: 0;
    justify-content: center;
}

.sidebar.collapsed .brand-logo {
    justify-content: center;
}

.sidebar.collapsed .menu-toggle-btn {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    background: #2563EB;
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.sidebar.collapsed .menu-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item i {
    font-size: 1.5rem;
}

.brand i {
    color: #60A5FA;
    font-size: 1.6rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    /* avoid text overlap with scrollbar */
}

/* Custom Scrollbar for Dark Sidebar */
.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    border: none;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: #94A3B8;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 0.85rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #F8FAFC;
}

.nav-item.active {
    background: #2563EB;
    color: white;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item i {
    font-size: 1.35rem;
}

.nav-badge {
    margin-left: auto;
    background: #EF4444;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* TOP BAR */
.top-bar {
    height: 48px;
    /* Reduced from 56px */
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #E2E8F0;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* DASHBOARD AREA */
.dashboard-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* VIEW: DASHBOARD STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

/* CATALOG STYLES (Split View) */
.catalog-container {
    display: flex;
    gap: 32px;
    height: calc(100vh - 160px);
}

.cat-sidebar {
    width: 200px;
    flex-shrink: 0;
    padding-right: 16px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.cat-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.cat-menu-item:hover {
    background: #F1F5F9;
    color: var(--text-main);
}

.cat-menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.cat-menu-count {
    background: #E2E8F0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #64748B;
}

.cat-menu-item.active .cat-menu-count {
    background: #DBEAFE;
    color: var(--primary);
}

.catalog-main {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 40px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -5px rgba(0, 0, 0, 0.1);
    border-color: #CBD5E1;
}

.product-img {
    height: 140px;
    width: 100%;
    object-fit: cover;
    background: #f8fafc;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

.product-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

/* VIEW: PURCHASES (Split View) */
.split-view {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
}

.master-list {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow-y: auto;
}

.master-item {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: 0.1s;

}

.master-item:hover {
    background: #F8FAFC;
}

.master-item.selected {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
}

.detail-view {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* VIEW: SUPPLIERS (CRM Cards) */
.supplier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.supplier-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.supplier-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

/* VIEW: CATEGORIES (New) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.category-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    gap: 12px;
}

.cat-img-box {
    width: 100%;
    aspect-ratio: 1;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.category-wrapper:hover .cat-img-box {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.cat-icon-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.cat-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.3;
}

/* 
.cat-count {
    color: var(--text-muted);
    font-size: 0.9rem;
} 
*/
.cat-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.create-cat-card {
    border: 2px dashed var(--border);
    background: transparent;
}

.create-cat-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}


/* BUTTONS & INPUTS */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 8px;
}

.btn-text:hover {
    color: var(--primary);
    background: #EFF6FF;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.95rem;
    transition: 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.dyn-input {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s;
    font-family: inherit;
}

.dyn-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-update-pending {
    background: #F59E0B !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.star-rating {
    display: flex;
    gap: 2px;
    color: #F59E0B;
    font-size: 1.1rem;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: floatUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-body {
    margin-bottom: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* FLOATING SMART CART */
.smart-cart-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    /* Center horizontally */
    transform: translate(-50%, 120px) scale(0.9);
    /* Start state */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;

    /* Design from Screenshot */
    background: #0F172A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px 10px 10px;
    border-radius: 60px;
    gap: 20px;
    min-width: 360px;
    color: white;
}

.smart-cart-bar.visible {
    transform: translate(-50%, 0) scale(1);
    /* Visible state */
    opacity: 1;
}

.smart-cart-bar:hover {
    transform: translate(-50%, -5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.cart-avatars {
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.cart-avatars img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #0F172A;
    margin-left: -14px;
    object-fit: cover;
    background: white;
    transition: transform 0.2s;
}

.cart-avatars img:first-child {
    margin-left: 0;
    border: none;
}

.cart-avatars img:hover {
    transform: translateY(-4px) scale(1.1);
    z-index: 10;
}

.cart-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.cart-count {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
}

.cart-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #38BDF8;
}

.cart-arrow {
    background: rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PILL BUTTONS */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pill-btn {
    border: 1px solid var(--border);
    background: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.pill-btn:hover {
    background: #F8FAFC;
    border-color: #cbd5e1;
}

.pill-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

/* BOTTOM DRAWER */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1001;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(calc(100% + 40px));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.bottom-drawer.active {
    transform: translateY(0);
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-body {
    padding: 24px;
    overflow-y: auto;
}

.drawer-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    background: white;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* QTY CONTROL IN DRAWER */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

/* CHART TOOLS (Google Finance Style) */
.time-range-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5F6368;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.time-range-btn.active {
    background: #202124;
    color: white;
}

.chart-tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #5F6368;
    cursor: pointer;
    transition: 0.2s;
}

.chart-tool-btn:hover {
    background: #F1F3F4;
    color: #202124;
}

.time-range-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #5F6368;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-btn:hover {
    background: #F1F3F4;
    color: #202124;
}

.time-range-btn.active {
    background: #E8F0FE;
    color: #1967D2;
}

.qty-control button i {
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-main);
}

.qty-control button:hover {
    background: #E2E8F0;
}

.qty-control input {
    border: none;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    width: 60px;
    padding: 0;
}

/* MOBILE ADJ */
@media (min-width: 768px) {
    .bottom-drawer {
        left: 50%;
        margin-left: -300px;
        /* Half of width */
        width: 600px;
        bottom: 24px;
        border-radius: 24px;
    }
}

/* TABLE STYLES */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

/* SPECS TABLE STYLE */
.specs-box {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.specs-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.specs-row:last-child {
    border-bottom: none;
}

.specs-row:nth-child(even) {
    background: #F1F5F9;
    /* Gray for even rows matching image style somewhat, or user requested "like spcs" */
}

/* Image shows odd rows white, even rows gray? Or header gray? 
   Let's stick to standard striped. */

.specs-key {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    text-transform: uppercase;
}

.specs-val {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
    max-width: 60%;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Custom Search Dropdown */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.custom-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 4px;
    display: none;
    /* Hidden by default */
}

.custom-dropdown-list.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.focused {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-item strong {
    font-weight: 600;
}

.dropdown-message {
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* TOGGLE SWITCH */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* DYNAMIC VARIATIONS */
.variation-row {
    background: #F8FAFC;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.variation-row:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.option-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.option-pill input {
    border: none;
    padding: 0;
    width: auto;
    min-width: 60px;
    font-size: inherit;
    background: transparent;
}

.option-pill input:focus {
    box-shadow: none;
}

.btn-remove-opt {
    color: #EF4444;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.btn-add-opt {
    background: white;
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.btn-add-opt:hover {
    background: var(--primary-light);
}

.btn-delete-row {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #94A3B8;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-delete-row:hover {
    color: #EF4444;
}

/* INVENTORY EXPANSION */
.inventory-row {
    transition: background-color 0.2s;
}

.inventory-row:hover {
    background-color: #F8FAFC !important;
}

.expand-icon {
    display: inline-block;
    color: #64748B;
    cursor: pointer;
}

.variation-pricing-table {
    width: 100%;
    margin-top: 8px;
}

.variation-pricing-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94A3B8;
    padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}

.variation-pricing-table td {
    padding: 12px 0;
    font-size: 0.95rem;
}

/* Low Stock Alert Box */
.low-stock-box {
    border: 2px solid #EF4444 !important;
    background-color: #FEF2F2;
    color: #EF4444 !important;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-block;
}

.warning-stock-box {
    border: 2px solid #F59E0B !important;
    background-color: #FFFBEB;
    color: #D97706 !important;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-block;
}

/* CREDIT SCORE INDICATORS */
.credit-score-box {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    margin-top: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.credit-0-20 {
    background-color: #EF4444;
}

/* Red */
.credit-20-40 {
    background-color: #F97316;
}

/* Orange */
.credit-40-60 {
    background-color: #EAB308;
}

/* Yellow */
.credit-60-80 {
    background-color: #3B82F6;
}

/* Blue */
.credit-80-100 {
    background-color: #8B5CF6;
}

/* Purple */
.credit-100-plus {
    background-color: #10B981;
}

/* Green */

/* Supplier Product Grid */
.ss-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ss-product-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #F1F5F9;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #F8FAFC;
    position: relative;
}

.ss-product-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 2;
    border-color: var(--primary);
}

.ss-product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ss-product-item:hover img {
    transform: scale(1.1);
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }

    .brand span,
    .nav-item span,
    .nav-badge {
        display: none;
    }

    .brand {
        justify-content: center;
        margin-bottom: 30px;
        padding-left: 0;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
    }

    .nav-item i {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.05);
        display: flex !important;
        padding: 20px 16px;
        /* Revert padding */
    }

    .sidebar .brand span,
    .sidebar .nav-item span,
    .sidebar .nav-badge,
    .sidebar .footer-text {
        display: inline-block !important;
    }

    .sidebar .brand {
        justify-content: space-between;
        padding-left: 10px;
    }

    .sidebar .nav-item {
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .sidebar .nav-item i {
        font-size: 1.35rem;
        /* Revert icon size */
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-only,
    #desktopMenuBtn {
        display: flex !important;
    }

    .top-bar {
        padding: 0 16px;
        height: 50px;
        /* Reduced from 60px */
        gap: 12px;
    }

    .top-bar .user-profile {
        display: none !important;
    }

    .sidebar-profile {
        display: flex !important;
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        margin-top: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-profile .user-avatar {
        box-shadow: none;
        border: none;
        width: 32px;
        height: 32px;
    }

    .sidebar-profile .user-info-text {
        overflow: hidden;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .dashboard-container {
        padding: 16px;
    }

    .catalog-container {
        flex-direction: column;
        height: auto;
        gap: 20px;
    }

    .cat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 16px;
        display: flex;
        overflow-x: auto;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .cat-menu-item {
        white-space: nowrap;
        margin-bottom: 0;
        padding: 8px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .ss-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .product-img {
        height: 120px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .user-profile span {
        display: none;
    }
}

/* Fixed Action Bar for Single Product View */
.product-action-bar {
    position: fixed;
    bottom: 0;
    left: 240px;
    /* Sidebar width */
    right: 0;
    background: white;
    border-top: 1px solid #E2E8F0;
    padding: 12px 40px;
    z-index: 900;
    display: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    transition: left 0.3s ease;
}

.sidebar.collapsed~.product-action-bar {
    left: 80px;
}

.action-bar-btn {
    flex: 1;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    transition: transform 0.2s;
}

.action-bar-btn:active {
    transform: scale(0.98);
}

.btn-purch {
    background: #0F172A;
}

.btn-sale {
    background: var(--primary);
}

.btn-pricing {
    background: white;
    color: #334155 !important;
    /* Override action-bar-btn white color */
    border: 1px solid #CBD5E1 !important;
}

.btn-pricing:hover {
    background: #F8FAFC;
    color: #0F172A !important;
    border-color: #94A3B8 !important;
}

@media (max-width: 768px) {
    .product-action-bar {
        left: 0;
        padding: 12px 16px;
    }
}

/* HEADER FILTERS */
.th-filter-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.th-filter-icon {
    font-size: 0.9rem;
    color: #94A3B8;
    transition: color 0.2s;
    padding: 2px;
    border-radius: 4px;
}

.th-filter-icon:hover {
    color: var(--primary);
    background: #F1F5F9;
}

.th-filter-icon.active {
    color: var(--primary);
}

.header-filter-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 2000;
    padding: 16px;
    min-width: 220px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-filter-search {
    padding: 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 100%;
}

.header-filter-options {
    overflow-y: auto;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
}

.header-filter-option:hover {
    background: #F8FAFC;
}

.header-filter-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}