:root {
    --sidebar-width: 260px;
    --primary-color: #082b4a;
    --bg-light: #f5f7fb;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --radius: 16px;
}

/* APP LAYOUT */
.agent-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* SIDEBAR */
.agent-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #082b4a, #0d4d7c);
    color: #fff;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 999;
}

.sidebar-brand {
    margin-bottom: 30px;
    text-align: center;
}

.sidebar-brand h4 {
    color: #fff;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a,
.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s ease;
}

.sidebar-menu a:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* TOPBAR */
.agent-topbar {
    background: #fff;
    border-radius: 14px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.mobile-toggle {
    display: none;
    border: none;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    padding: 0;
}

/* PAGE CONTENT */
.page-wrapper {
    padding: 24px;
    width: 100%;
}

.page-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    width: 100%;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* TABLE */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

#salesHistoryTable {
    width: 100% !important;
    min-width: 1100px;
}

#salesHistoryTable th {
    white-space: nowrap;
    font-weight: 600;
}

#salesHistoryTable td {
    vertical-align: middle;
    white-space: nowrap;
}

/* BADGES */
.badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* BUTTONS */
.action-btn {
    border-radius: 10px;
    padding: 8px 14px;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
}

/* ALERTS */
.alert {
    border-radius: 12px;
    margin-bottom: 20px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 15px;
}

/* POS COMPONENTS */
.cart-sidebar {
    width: 100%;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.search-box {
    background: #fff;
    padding: 15px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
}

.stock-badge {
    background: #198754;
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.cart-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cart-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.totals-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .agent-sidebar {
        transform: translateX(-100%);
        z-index: 2000;
    }

    .agent-sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-wrapper {
        padding: 15px;
    }

    .page-card {
        padding: 18px;
    }

    .page-title {
        font-size: 22px;
    }

    #salesHistoryTable {
        min-width: 1000px;
    }
}

@media (max-width: 576px) {
    .page-wrapper {
        padding: 12px;
    }

    .page-card {
        padding: 15px;
        border-radius: 12px;
    }

    .page-title {
        font-size: 20px;
    }

    .btn {
        font-size: 14px;
    }
}