/* =========================================================
   VARIABLES
========================================================= */
:root {
    --green: #198754;
    --green-dark: #126b42;
    --green-light: #eaf7ef;

    --red: #dc3545;
    --red-dark: #a92737;
    --red-light: #fff0f1;

    --orange: #d99000;
    --orange-light: #fff8e6;

    --text: #17212b;
    --muted: #71808d;

    --border: #e4e9ee;

    --background: #f5f7f9;
    --white: #ffffff;

    --shadow: 0 7px 25px rgba(20, 30, 40, .06);
}


/* =========================================================
   RESET
========================================================= */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

button,
input,
select {
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   SIDEBAR (fixed, brand pinned, menu scrolls)
========================================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    height: 100vh;
    height: 100dvh;               /* correct height on mobile browsers */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid var(--border);
    z-index: 100;
}

.brand {
    flex-shrink: 0;               /* never squashed by the menu */
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 21px;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 41px;
    height: 41px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: white;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 800;
    margin-right: 11px;
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
}

.brand-sub {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}


/* =========================================================
   NAVIGATION
========================================================= */
.nav {
    flex: 1;
    min-height: 0;               /* required so the flex child can scroll */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 20px 12px 30px;

    scrollbar-width: thin;                    /* Firefox */
    scrollbar-color: #d5dbe0 transparent;
}

.nav::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-track {
    background: transparent;
}

.nav::-webkit-scrollbar-thumb {
    background: #d5dbe0;
    border-radius: 10px;
}

.nav::-webkit-scrollbar-thumb:hover {
    background: #bcc5cc;
}

.nav-caption {
    padding: 8px 12px;
    color: #9aa4ae;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.nav-caption:not(:first-child) {
    margin-top: 14px;
}

.nav-gap {
    margin-top: 20px;
}

.nav-item {
    position: relative;
    height: 45px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    margin-bottom: 4px;
    border-radius: 10px;
    color: #596672;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s, color .15s;
}

.nav-item:hover {
    background: #f5f8f6;
    color: var(--green);
}

.nav-item.active {
    background: var(--green-light);
    color: var(--green-dark);
    font-weight: 700;
}

.nav-item.active:hover {
    background: var(--green-light);
    color: var(--green-dark);
}

/* left accent bar for the active item */
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--green);
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 17px;
}


/* =========================================================
   MAIN & TOPBAR
========================================================= */
.main {
    margin-left: 250px;
    min-height: 100vh;
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

/* Top right actions & dropdown menu */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 150px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    transition: background .15s;
}

.dropdown-item:hover {
    background: var(--red-light);
    color: var(--red-dark);
}

.mobile-menu {
    display: none;
}

.page-title {
    font-size: 20px;
    font-weight: 800;
}

.page-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   CONTENT
========================================================= */
.content {
    padding: 28px 30px 50px;
}


/* =========================================================
   ALERT
========================================================= */
.alert {
    padding: 13px 16px;
    margin-bottom: 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.alert.success {
    background: var(--green-light);
    border: 1px solid #cce8d7;
    color: var(--green-dark);
}

.alert.error {
    background: var(--red-light);
    border: 1px solid #f2c8ce;
    color: var(--red-dark);
}


/* =========================================================
   STATS
========================================================= */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    padding: 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.stat-number {
    margin-top: 9px;
    font-size: 27px;
    font-weight: 800;
}


/* =========================================================
   PANEL
========================================================= */
.panel {
    overflow: hidden;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}


/* =========================================================
   FILTERS
========================================================= */
.filter-area {
    padding: 17px;
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
}

.tab {
    white-space: nowrap;
    padding: 9px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #596672;
    font-size: 12px;
    font-weight: 800;
}

.tab:hover {
    background: #f6f8f9;
}

.tab.active {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 200px 130px;
    gap: 9px;
    margin-top: 14px;
}

.input,
.select {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    outline: none;
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 13px;
}

.input:focus,
.select:focus {
    border-color: #85c49f;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, .08);
}

.search-btn {
    height: 43px;
    border: 0;
    border-radius: 9px;
    background: var(--green);
    color: white;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--green-dark);
}


/* =========================================================
   TABLE
========================================================= */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
}

th {
    padding: 13px 15px;
    text-align: left;
    white-space: nowrap;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    color: #7d8892;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td {
    padding: 13px 15px;
    border-bottom: 1px solid #edf0f2;
    vertical-align: middle;
    font-size: 13px;
}

tr:hover td {
    background: #fcfdfd;
}


/* =========================================================
   PRODUCT
========================================================= */
.product {
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-img {
    width: 57px;
    height: 57px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.no-image {
    width: 57px;
    height: 57px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f5f7;
    border-radius: 10px;
    color: #99a3ac;
    font-size: 9px;
    font-weight: 700;
}

.product-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.product-code {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.seller {
    font-weight: 700;
}

.category {
    color: #5d6974;
    font-size: 12px;
}

.price {
    font-weight: 800;
}

.sale {
    margin-top: 3px;
    color: var(--green-dark);
    font-size: 11px;
}

.stock {
    font-weight: 700;
}


/* =========================================================
   STATUS
========================================================= */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 100px;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 800;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status.inreview {
    background: var(--orange-light);
    color: #a66e00;
}

.status.active {
    background: var(--green-light);
    color: #147343;
}

.status.rejected {
    background: var(--red-light);
    color: #b52c3b;
}


/* =========================================================
   ACTIONS
========================================================= */
.actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action {
    height: 33px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.action:hover {
    opacity: .85;
}

.approve-btn {
    color: #147343;
    background: var(--green-light);
    border-color: #cce8d7;
}

.reject-btn {
    color: #b52c3b;
    background: var(--red-light);
    border-color: #f0c7cd;
}


/* =========================================================
   EMPTY
========================================================= */
.empty {
    padding: 65px 20px;
    text-align: center;
}

.empty-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: #f3f5f7;
    color: #929da7;
    font-size: 22px;
}

.empty-title {
    font-weight: 800;
}

.empty-text {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   MODAL
========================================================= */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 20, 30, .55);
    z-index: 500;
}

.modal.show {
    display: flex;
}

.modal-box {
    width: min(900px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 21px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 17px;
    font-weight: 800;
}

.close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 19px;
    cursor: pointer;
}

.modal-body {
    padding: 22px;
}

.detail-top {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 23px;
}

.detail-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.detail-name {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
}

.detail-code {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 17px;
}

.detail-item {
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.detail-label {
    color: #89939c;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-value {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 700;
}

.detail-section {
    margin-top: 24px;
}

.detail-section-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
}

.description {
    color: #52606c;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-line;
}

.list {
    margin: 0;
    padding-left: 19px;
    color: #52606c;
    font-size: 13px;
    line-height: 1.8;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
}


/* =========================================================
   MOBILE
========================================================= */
@media (max-width: 900px) {

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, .18);
    }

    .main {
        margin-left: 0;
    }

    .mobile-menu {
        display: block;
        width: 38px;
        height: 38px;
        margin-right: 10px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 9px;
        cursor: pointer;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 20px 15px 40px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .detail-top {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 500px) {

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat {
        padding: 14px;
    }

    .stat-number {
        font-size: 22px;
    }

    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}