@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Poppins:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

li {
    list-style: none;
}

:root {
    --background: #ffffff;
    --foreground: #171717;
    --poppins: 'Poppins', sans-serif;
    --lato: 'Lato', sans-serif;
    --light: #F9F9F9;
    --blue: #3C91E6;
    --light-blue: #CFE8FF;
    --grey: #eee;
    --dark-grey: #AAAAAA;
    --dark: #342E37;
    --red: #DB504A;
    --yellow: #FFCE26;
    --light-yellow: #FFF2C6;
    --orange: #FD7238;
    --light-orange: #FFE0D3;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #0a0a0a;
        --foreground: #ededed;
    }
}

html {
    overflow-x: hidden;
    overflow-y: visible; /* Allow dropdowns to extend beyond viewport if needed */
}

body {
    background: var(--grey);
    overflow-x: hidden;
    overflow-y: visible; /* Allow dropdowns to extend beyond viewport if needed */
    font-family: var(--lato);
}

body.dark {
    --light: #0C0C1E;
    --grey: #060714;
    --dark: #FBFBFB;
}

/* SIDEBAR */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: var(--light);
    z-index: 2000;
    font-family: var(--lato);
    transition: .3s ease;
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
    box-sizing: border-box;
}

#sidebar::-webkit-scrollbar {
    display: none;
}

/* Role Selector in Navbar */
.role-selector-nav {
    /* Remove position: relative - not needed since menu uses position: fixed */
    display: flex;
    align-items: center;
    overflow: visible !important; /* Ensure dropdown isn't clipped by parent */
}

.role-select-menu {
    display: none !important; /* Force hidden until JavaScript positions it */
    position: fixed; /* Use fixed instead of absolute to escape parent clipping */
    /* Calculate position relative to the trigger */
    /* Use -9999px to hide off-screen until JavaScript positions it */
    top: -9999px;
    right: -9999px;
    left: auto;
    background: var(--light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    width: 200px;
    /* No scroll, just grow to fit content */
    height: auto;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    z-index: 10001; /* Higher than nav (10000) */
    font-family: var(--lato);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.role-select-menu ul {
    list-style: none;
    padding: 10px;
    margin: 0;
    overflow: visible;
    height: auto !important;
    max-height: none !important;
}

.role-select-menu li {
    padding: 10px;
    border-bottom: 1px solid var(--grey);
    height: auto !important;
}

.role-select-menu li:hover {
    background-color: var(--light-blue);
}

.role-select-menu li a {
    color: var(--dark);
    font-size: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.role-select-menu li a i {
    margin-right: 10px;
}

.role-select-menu li:hover a {
    color: var(--blue);
}

.role-select-menu li:hover a i {
    color: var(--blue);
}

.role-select-menu.show {
    display: block !important; /* Override the !important from base rule */
    opacity: 1;
    visibility: visible;
}

#sidebar.hide {
    width: 60px;
}

#sidebar.hide .brand .brand-logo {
    display: none; /* Hide logo when sidebar is collapsed */
}

#sidebar .brand {
    font-size: 24px;
    font-weight: 700;
    height: 56px;
    display: flex;
    align-items: center;
    color: var(--blue);
    position: sticky;
    top: 0;
    left: 0;
    background: var(--light);
    z-index: 500;
    padding-bottom: 20px;
    box-sizing: content-box;
    padding-left: 20px;
    justify-content: flex-start;
}

#sidebar .brand .brand-logo {
    height: 48px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

#sidebar .brand .bx {
    min-width: 60px;
    display: flex;
    justify-content: center;
}

#sidebar .side-menu {
    width: 100%;
}

#sidebar .side-menu.top {
    margin-top: 48px;
    margin-bottom: 40px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

#sidebar .side-menu.top::-webkit-scrollbar {
    display: none;
}

#sidebar .side-menu li {
    height: 48px;
    background: transparent;
    margin-left: 6px;
    border-radius: 48px 0 0 48px;
    padding: 4px;
}


#sidebar .side-menu li.active {
    background: var(--grey);
    position: relative;
}

#sidebar .side-menu li.active::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    top: -40px;
    right: 0;
    box-shadow: 20px 20px 0 var(--grey);
    z-index: -1;
}

#sidebar .side-menu li.active::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    bottom: -40px;
    right: 0;
    box-shadow: 20px -20px 0 var(--grey);
    z-index: -1;
}

#sidebar .side-menu li a {
    width: 100%;
    height: 100%;
    background: var(--light);
    display: flex;
    align-items: center;
    border-radius: 48px;
    font-size: 16px;
    color: var(--dark);
    white-space: nowrap;
    overflow-x: hidden;
}

#sidebar .side-menu.top li.active a {
    color: var(--blue);
}

#sidebar.hide .side-menu li a {
    width: calc(48px - (4px * 2));
    transition: width .3s ease;
}

#sidebar .side-menu li a .bx {
    min-width: calc(60px - ((4px + 6px) * 2));
    display: flex;
    justify-content: center;
}

#sidebar .side-menu.bottom {
    width: 100%;
    padding: 10px 0 20px 0;
    flex-shrink: 0;
    margin-top: auto;
}

#sidebar .side-menu.bottom li {
    position: relative;
    margin-bottom: 8px;
    height: auto;
    min-height: auto;
    overflow: visible;
}

/* Role selector in sidebar bottom menu */
#sidebar .side-menu.bottom .role-selector-sidebar {
    width: calc(100% - 24px);
    margin: 0 12px;
    padding: 8px 0;
    position: relative;
    z-index: 10;
    height: auto;
    min-height: auto;
    overflow: visible;
}

#sidebar .side-menu.bottom .role-selector-sidebar .custom-select-wrapper {
    height: auto;
    min-height: auto;
    overflow: visible;
}

#sidebar .side-menu.bottom .role-selector-sidebar .custom-select-trigger {
    min-height: 44px;
    height: auto !important;
    padding: 10px 12px;
    padding-right: 32px;
    align-items: flex-start;
    box-sizing: border-box;
    overflow: visible;
    display: flex;
}

#sidebar .side-menu.bottom .role-selector-sidebar .custom-select-trigger span {
    padding-top: 0;
    display: block;
    width: 100%;
    line-height: 1.5;
    min-height: 20px;
}

/* Custom Select Dropup Styles */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    min-height: 44px;
    height: auto;
    padding: 10px 12px;
    padding-right: 32px;
    border: 1px solid var(--grey);
    border-radius: 8px;
    background: var(--light);
    color: var(--dark);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    font-family: var(--lato);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.custom-select-trigger span {
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.custom-select-trigger:hover {
    border-color: var(--blue);
}

.custom-select-trigger:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(60, 145, 230, 0.2);
}

.custom-select-trigger i {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: var(--dark-grey);
    flex-shrink: 0;
    margin-left: 8px;
    margin-top: 2px;
}

.custom-select-wrapper.open .custom-select-trigger i {
    transform: rotate(180deg);
}

.custom-select-dropup,
.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--light);
    border: 1px solid var(--grey);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10000;
}

/* For bottom menu, use dropup */
#sidebar .side-menu.bottom .custom-select-dropup {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.custom-select-wrapper.open .custom-select-dropup,
.custom-select-wrapper.open .custom-select-dropdown {
    display: block;
}

.custom-select-dropdown-nav .custom-select-options {
    list-style: none;
    padding: 4px 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.custom-select-options li {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--dark);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-options li:hover {
    background-color: var(--light-blue);
    color: var(--blue);
}

.custom-select-options li.selected {
    background-color: var(--blue);
    color: var(--light);
}

.custom-select-options li:first-child {
    border-radius: 8px 8px 0 0;
}

.custom-select-options li:last-child {
    border-radius: 0 0 8px 8px;
}

/* Role-specific menu items */
#sidebar .side-menu li.role-specific.hidden {
    display: none;
}

/* CONTENT */
#content {
    position: relative;
    width: calc(100% - 220px);
    left: 220px;
    transition: .3s ease;
    /* Ensure content doesn't clip absolutely-positioned dropdowns */
    overflow: visible !important;
}

#sidebar.hide ~ #content {
    width: calc(100% - 60px);
    left: 60px;
}

/* NAVBAR */
#content nav {
    height: 56px;
    background: var(--light);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-gap: 24px;
    font-family: var(--lato);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10000;
    /* Ensure nav doesn't clip absolutely-positioned dropdowns */
    overflow: visible !important;
}


#content nav::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    bottom: -40px;
    left: 0;
    border-radius: 50%;
    box-shadow: -20px -20px 0 var(--light);
}

#content nav a {
    color: var(--dark);
}

#content nav .bx.bx-menu {
    cursor: pointer;
    color: var(--dark);
}

#content nav .nav-link {
    font-size: 16px;
    transition: .3s ease;
}

#content nav .nav-link:hover {
    color: var(--blue);
}

.categories-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    font-family: var(--lato);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Custom scrollbar for categories menu - only show when needed (Webkit browsers) */
.categories-menu::-webkit-scrollbar {
    width: 4px;
}

.categories-menu::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 15px;
}

.categories-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.categories-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.categories-menu ul {
    list-style: none;
    padding: 10px;
    margin: 0;
    overflow: visible;
}

.categories-menu li {
    padding: 10px;
    border-bottom: 1px solid var(--grey);
}

.categories-menu li:hover {
    background-color: var(--light-blue);
}

.categories-menu li a {
    color: var(--dark);
    font-size: 16px;
    text-decoration: none;
}

.categories-menu li a i {
    margin-right: 10px;
}

.categories-menu.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

#content nav form {
    max-width: 400px;
    width: 100%;
    margin-right: auto;
}

#content nav form .form-input {
    display: flex;
    align-items: center;
    height: 36px;
}

#content nav form .form-input input {
    flex-grow: 1;
    padding: 0 16px;
    height: 100%;
    border: none;
    background: var(--grey);
    border-radius: 36px 0 0 36px;
    outline: none;
    width: 100%;
    color: var(--dark);
}

#content nav form .form-input button {
    width: 36px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--blue);
    color: var(--light);
    font-size: 18px;
    border: none;
    outline: none;
    border-radius: 0 36px 36px 0;
    cursor: pointer;
}

/* Toolbar form styles (seller and admin toolbars) */
.seller-toolbar form,
.admin-toolbar form {
    max-width: 400px;
    width: 100%;
}

.seller-toolbar form .form-input,
.admin-toolbar form .form-input {
    display: flex;
    align-items: center;
    height: 36px;
}

.seller-toolbar form .form-input input,
.admin-toolbar form .form-input input {
    flex-grow: 1;
    padding: 0 16px;
    height: 100%;
    border: none;
    background: var(--grey);
    border-radius: 36px 0 0 36px;
    outline: none;
    width: 100%;
    color: var(--dark);
}

.seller-toolbar form .form-input button,
.admin-toolbar form .form-input button {
    width: 36px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--blue);
    color: var(--light);
    font-size: 18px;
    border: none;
    outline: none;
    border-radius: 0 36px 36px 0;
    cursor: pointer;
}

.role-selector-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    width: 100%;
}

.role-selector-sidebar .role-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.role-selector-sidebar .role-select {
    width: 100%;
    padding: 10px 12px;
    padding-right: 32px;
    border: 1px solid var(--grey);
    border-radius: 8px;
    background: var(--light);
    color: var(--dark);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    font-family: var(--lato);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23342E37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.role-selector-sidebar .role-select:hover {
    border-color: var(--blue);
}

.role-selector-sidebar .role-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(60, 145, 230, 0.2);
    outline: none;
}

.role-select {
    padding: 8px 15px;
    border: 1px solid var(--grey);
    border-radius: 8px;
    background: var(--light);
    color: var(--dark);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.role-select:hover {
    border-color: var(--blue);
}

.role-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(60, 145, 230, 0.2);
}

#content nav .profile {
    font-size: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#content nav .profile-menu {
    display: none;
    position: fixed; /* Use fixed instead of absolute to escape parent clipping */
    /* Calculate position relative to the trigger */
    top: auto;
    right: auto;
    background: var(--light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    width: 200px;
    /* No fixed height or scrolling - let it grow naturally */
    height: auto;
    max-height: none;
    overflow: visible !important; /* Just in case something above is overriding it */
    z-index: 10001; /* Higher than nav (10000) */
    font-family: var(--lato);
}

/* Scrollbar styling removed - no scrolling needed */

#content nav .profile-menu ul {
    list-style: none;
    padding: 10px;
    margin: 0;
}

#content nav .profile-menu li {
    padding: 10px;
    border-bottom: 1px solid var(--grey);
}

#content nav .profile-menu li:hover {
    background-color: var(--light-blue);
    color: var(--dark);
}

#content nav .profile-menu li a {
    color: var(--dark);
    font-size: 16px;
}

#content nav .profile-menu li a.logout {
    color: var(--red);
}

#content nav .profile-menu li:hover a.logout {
    color: var(--red);
}

#content nav .profile-menu li a.back-to-store {
    color: var(--blue);
}

#content nav .profile-menu li:hover a.back-to-store {
    color: var(--blue);
}

#content nav .profile-menu.show {
    display: block;
}

#content nav .swith-lm {
    background-color: var(--grey);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px;
    position: relative;
    height: 21px;
    width: 45px;
    transform: scale(1.5);
}

#content nav .swith-lm .ball {
    background-color: var(--blue);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    height: 18px;
    width: 18px;
    transform: translateX(0px);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#content nav .checkbox:checked + .swith-lm .ball {
    transform: translateX(22px);
    background-color: var(--orange);
}

.bxs-moon {
    color: var(--yellow);
}

.bx-sun {
    color: var(--orange);
}

/* MAIN */
#content main {
    width: 100%;
    padding: 36px 24px;
    font-family: var(--poppins);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

#content main .head-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-gap: 16px;
    flex-wrap: wrap;
}

#content main .head-title .left h1 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

#content main .head-title .left .breadcrumb {
    display: flex;
    align-items: center;
    grid-gap: 16px;
}

#content main .head-title .left .breadcrumb li {
    color: var(--dark);
}

#content main .head-title .left .breadcrumb li a {
    color: var(--dark-grey);
    pointer-events: none;
}

#content main .head-title .left .breadcrumb li a.active {
    color: var(--blue);
    pointer-events: unset;
}

/* Button styles - consistent across all buttons */
.btn-download {
    height: 36px;
    padding: 0 16px;
    border-radius: 36px;
    background: var(--blue);
    color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    grid-gap: 10px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.btn-download:hover {
    background: #2a7bc8;
}

#content main .head-title .btn-download {
    height: 36px;
    padding: 0 16px;
    border-radius: 36px;
    background: var(--blue);
    color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    grid-gap: 10px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

#content main .head-title .btn-download:hover {
    background: #2a7bc8;
}

#content main .box-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-gap: 24px;
    margin-top: 36px;
}

#content main .box-info li {
    padding: 24px;
    background: var(--light);
    border-radius: 20px;
    display: flex;
    align-items: center;
    grid-gap: 24px;
}

#content main .box-info li .bx {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    font-size: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#content main .box-info li:nth-child(1) .bx {
    background: var(--light-blue);
    color: var(--blue);
}

#content main .box-info li:nth-child(2) .bx {
    background: var(--light-yellow);
    color: var(--yellow);
}

#content main .box-info li:nth-child(3) .bx {
    background: var(--light-orange);
    color: var(--orange);
}

#content main .box-info li .text h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

#content main .box-info li .text p {
    color: var(--dark);
}

#content main .table-data {
    display: flex;
    flex-wrap: wrap;
    grid-gap: 24px;
    margin-top: 24px;
    width: 100%;
    color: var(--dark);
}

#content main .table-data > div {
    border-radius: 20px;
    background: var(--light);
    padding: 24px;
    overflow-x: auto;
    width: 100%;
}

#content main .table-data .head {
    display: flex;
    align-items: center;
    grid-gap: 16px;
    margin-bottom: 24px;
}

#content main .table-data .head h3 {
    margin-right: auto;
    font-size: 24px;
    font-weight: 600;
}

#content main .table-data .head .bx {
    cursor: pointer;
}

#content main .table-data .order {
    flex-grow: 1;
    flex-basis: 500px;
}

#content main .table-data .order table {
    width: 100%;
    border-collapse: collapse;
}

#content main .table-data .order table th {
    padding-bottom: 12px;
    font-size: 13px;
    text-align: left;
    border-bottom: 1px solid var(--grey);
}

#content main .table-data .order table td {
    padding: 16px 0;
}

#content main .table-data .order table tr td:first-child {
    align-items: center;
    position: relative;
    grid-gap: 12px;
    padding-left: 6px;
    object-fit: cover;
}

#content main .table-data .order table tr td:last-child {
    align-items: center;
    position: relative;
    grid-gap: 12px;
    padding-left: 6px;
    object-fit: cover;
}

#content main .table-data .order table td img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

#content main .table-data .order table tbody tr:hover {
    background: var(--grey);
}

#content main .table-data .order table tr td .status {
    font-size: 10px;
    padding: 6px 16px;
    color: var(--light);
    border-radius: 20px;
    font-weight: 700;
}

#content main .table-data .order table tr td .status.completed {
    background: var(--blue);
}

#content main .table-data .order table tr td .status.process {
    background: var(--yellow);
}

#content main .table-data .order table tr td .status.pending {
    background: var(--orange);
}

#content main .order-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

#content main .order-filters input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--grey);
    border-radius: 8px;
    font-size: 14px;
    color: var(--dark);
    background-color: var(--light);
}

#content main .order-filters input[type="text"]:focus {
    border-color: var(--blue);
    outline: none;
}

#content main .order-filters select {
    padding: 8px 12px;
    border: 1px solid var(--grey);
    border-radius: 8px;
    font-size: 14px;
    color: var(--dark);
    background-color: var(--light);
    cursor: pointer;
}

#content main .order-filters select:focus {
    border-color: var(--blue);
    outline: none;
}

#content main .todo-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

#content main .todo-filters button {
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    margin-right: 10px;
    color: var(--dark);
    background: var(--grey);
    font-size: 14px;
    transition: all 0.3s;
}

#content main .todo-filters button.completed {
    background: var(--blue);
    color: var(--light);
}

#content main .todo-filters button.pending {
    background: var(--orange);
    color: var(--light);
}

#content main .todo-filters button.admin-filter {
    background: var(--red);
    color: var(--light);
}

#content main .todo-filters button:hover {
    opacity: 0.8;
}

#content main .table-data .todo {
    flex-grow: 1;
    flex-basis: 300px;
}

#content main .table-data .todo .todo-list {
    width: 100%;
}

#content main .table-data .todo .todo-list li {
    width: 100%;
    margin-bottom: 16px;
    background: var(--grey);
    border-radius: 10px;
    padding: 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

#content main .table-data .todo .todo-list li .bx {
    cursor: pointer;
}

#content main .table-data .todo .todo-list li.completed {
    border-left: 10px solid var(--blue);
    position: relative;
}

#content main .table-data .todo .todo-list li.not-completed {
    border-left: 10px solid var(--red);
    position: relative;
}

#content main .table-data .todo .todo-list li::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: var(--progress-width, 100%);
    height: 3px;
    background-color: #ddd;
}

#content main .table-data .todo .todo-list li.completed::before {
    background-color: var(--blue);
}

#content main .table-data .todo .todo-list li.not-completed::before {
    background-color: var(--red);
}

#content main .table-data .todo .todo-list li span {
    position: absolute;
    bottom: 0;
    left: 0;
    padding-left: -30px;
}

#content main .table-data .todo .todo-list li:last-child {
    margin-bottom: 0;
}

/* Section visibility */
.section.hidden {
    display: none;
}

/* Welcome Screen */
.welcome-card {
    background: var(--light);
    padding: 40px;
    border-radius: 20px;
    max-width: 900px;
    margin: 40px auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.welcome-card h1 {
    font-size: 32px;
    color: var(--blue);
    margin-bottom: 10px;
    text-align: center;
    font-family: var(--poppins);
}

.welcome-card .subtitle {
    color: var(--dark-grey);
    margin-bottom: 30px;
    text-align: center;
    font-size: 16px;
}

.welcome-content {
    text-align: center;
}

.welcome-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--dark);
    font-size: 24px;
    font-family: var(--poppins);
}

.welcome-content > p {
    color: var(--dark);
    margin-bottom: 30px;
    font-size: 16px;
}

.welcome-roles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 30px 0;
}

.welcome-role-card-buyer {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 280px;
}

.welcome-role-card-buyer > p {
    text-align: left;
}

.welcome-role-card {
    background: var(--grey);
    padding: 24px;
    border-radius: 15px;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.welcome-role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.welcome-role-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.welcome-role-card h3 {
    color: var(--blue);
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
    font-family: var(--poppins);
}

.welcome-role-card > p {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

.welcome-role-card ul {
    text-align: left;
    margin: 0;
    padding-left: 20px;
    color: var(--dark);
    font-size: 14px;
    line-height: 1.6;
}

.welcome-role-card ul li {
    margin-bottom: 8px;
}

.welcome-role-card ul li strong {
    color: var(--blue);
}

.welcome-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--grey);
}

.footer-note {
    margin-bottom: 15px;
    color: var(--dark-grey);
    font-style: italic;
    font-size: 16px;
}

.footer-tip {
    color: var(--dark-grey);
    font-size: 14px;
    line-height: 1.6;
}

.footer-tip strong {
    color: var(--blue);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: #FFFFFF;
    border: 2px solid var(--grey);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-image-container,
.product-image-placeholder {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card h4 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.product-description {
    color: var(--dark-grey);
    margin-bottom: 15px;
    font-size: 0.9em;
    min-height: 40px;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.price {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--blue);
}

.stock, .category {
    color: var(--dark-grey);
    font-size: 0.9em;
}

.seller {
    color: var(--dark);
    font-size: 0.95em;
    margin-bottom: 15px;
    padding: 8px;
    background: var(--grey);
    border-radius: 4px;
    border-left: 3px solid var(--blue);
}

.seller strong {
    color: var(--blue);
    font-weight: 600;
}

.add-to-cart {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
    padding: 12px;
    background: var(--grey);
    border-radius: 8px;
}

.quantity-input {
    width: 70px;
    padding: 10px;
    border: 2px solid var(--blue);
    border-radius: 8px;
    text-align: center;
    background: var(--light);
    color: var(--dark);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(60, 145, 230, 0.2);
    background: white;
}

.add-to-cart-btn {
    flex: 1;
    padding: 10px 20px;
    background: var(--blue);
    color: var(--light);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #2a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 145, 230, 0.3);
}

.add-to-cart-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(60, 145, 230, 0.2);
}

.add-to-cart-btn:disabled {
    background: var(--dark-grey);
    cursor: not-allowed;
    opacity: 0.6;
}

.add-to-cart-btn i {
    font-size: 16px;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.product-actions button {
    flex: 1;
    height: 36px;
    padding: 0 16px;
    border-radius: 36px;
    background: var(--blue);
    color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    grid-gap: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.product-actions button:hover {
    background: #2a7bc8;
}

.product-actions .delete-btn {
    background: var(--red);
}

.product-actions .delete-btn:hover {
    background: #c0392b;
}

/* Form Styles */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--grey);
    border-radius: 5px;
    font-size: 16px;
    color: var(--dark);
    background-color: var(--light);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--blue);
    outline: none;
}

.form-group textarea {
    resize: vertical;
}

.btn-submit {
    background-color: var(--blue);
    color: var(--light);
    height: 36px;
    padding: 0 20px;
    border: none;
    border-radius: 36px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    grid-gap: 8px;
}

.btn-submit:hover:not(:disabled) {
    background-color: #2a7bc8;
}

.btn-submit:disabled {
    background-color: var(--dark-grey);
    cursor: not-allowed;
}

/* Cart Styles */
.cart-items {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 100px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--grey);
    gap: 15px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
    padding: 15px 20px;
    border-radius: 8px;
}

#cartTotal {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--blue);
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.order-card {
    background: var(--light);
    border: 2px solid var(--grey);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-header h4 {
    color: var(--dark);
    font-size: 1.2em;
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--orange);
    color: white;
}

.order-buyer {
    color: var(--dark-grey);
    margin-bottom: 15px;
    font-style: italic;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--grey);
    gap: 15px;
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--blue);
    margin-bottom: 10px;
}

.order-date {
    color: var(--dark-grey);
    font-size: 0.9em;
}

/* Users Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.user-card {
    background: var(--grey);
    border: 2px solid var(--grey);
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.user-header h4 {
    color: var(--dark);
    margin: 0;
    font-size: 1.1em;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-badge {
    background: var(--red);
    color: white;
}

.seller-badge {
    background: var(--blue);
    color: white;
}

.buyer-badge {
    background: #2ecc71;
    color: white;
}

.user-email {
    color: var(--dark-grey);
    font-size: 0.9em;
    margin: 5px 0;
}

.user-id {
    color: var(--dark-grey);
    font-size: 0.8em;
    font-family: monospace;
    margin: 5px 0;
}

.user-date {
    color: var(--dark-grey);
    font-size: 0.85em;
    margin: 5px 0;
    font-style: italic;
}

.users-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--grey);
    border-radius: 6px;
    flex-wrap: wrap;
}

.user-count {
    color: var(--dark);
    font-size: 0.95em;
}

.user-count strong {
    color: var(--blue);
    margin-right: 5px;
}

/* Profile Display */
.profile-info {
    margin-bottom: 20px;
}

.profile-display {
    background: var(--grey);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--blue);
}

.profile-display p {
    margin: 8px 0;
    color: var(--dark);
}

.profile-display strong {
    color: var(--blue);
    font-weight: 600;
    margin-right: 8px;
}

/* Empty/Error Messages */
.empty-message {
    text-align: center;
    color: var(--dark-grey);
    padding: 40px;
    font-style: italic;
}

.error-message {
    text-align: center;
    color: var(--red);
    padding: 20px;
    background: #fee;
    border-radius: 6px;
    border: 2px solid var(--red);
}

/* Buyer Tabs */
.buyer-tabs {
    display: flex;
    gap: 10px;
    margin: 24px 0;
    border-bottom: 2px solid var(--grey);
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--dark-grey);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--blue);
    background: var(--grey);
}

.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: var(--light);
}

.tab-btn .cart-badge {
    background: var(--red);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--light);
    margin: auto;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    margin: 0;
    color: var(--dark);
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--dark-grey);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--grey);
    color: var(--dark);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-cancel {
    padding: 12px 24px;
    background: var(--grey);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: var(--dark-grey);
    color: var(--light);
}

/* Media Queries */
@media screen and (max-width: 768px) {
    #sidebar {
        width: 200px;
    }

    #content {
        width: calc(100% - 60px);
        left: 200px;
    }

    #content nav .nav-link {
        display: none;
    }

    .categories-menu {
        left: 20px;
        width: 180px;
    }

    #content main .box-info {
        grid-template-columns: 1fr;
    }

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

@media screen and (max-width: 576px) {
    #content nav form .form-input input {
        display: none;
    }

    #content nav form .form-input button {
        width: auto;
        height: auto;
        background: transparent;
        border-radius: none;
        color: var(--dark);
    }

    #content nav form.show .form-input input {
        display: block;
        width: 100%;
    }

    #content nav form.show .form-input button {
        width: 36px;
        height: 100%;
        border-radius: 0 36px 36px 0;
        color: var(--light);
        background: var(--red);
    }

    #content main .table-data .head {
        min-width: 420px;
    }

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

/* Nuclear override to prevent inline styles from breaking the menus */
#roleSelectMenu,
#profileMenu {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
}

/* Ensure nav and its container don't clip absolutely-positioned dropdowns */
#content,
#content nav,
#content nav > .role-selector-nav {
    overflow: visible !important;
}
