:root {
    --background-color: #f6f9fb;
    --primary-color: #007584;
    --secondary-color: #339ca8;
    --accent-color: #b68300;

    --text-color-dark: black;
    --text-color-light: white;

    --smaller-font-size: 0.8rem;
    --small-font-size: 1rem;
    --normal-font-size: 1.2rem;
    --large-font-size: 1.6rem;

    --heading-subtitle-font-size: 1.4rem;
    --heading-title-font-size: 2.4rem;

    --img-border-radius: 0.3rem;
    --btn-border-radius: 0.3rem;
    --card-border-radius: 0.3rem;

    --primary-font-family: "Nunito", sans-serif;

    /* Transition */
    --transition-time: 0.4s;
}

body {
    color: black;
}

.text {
    font-family: var(--primary-font-family);
    font-size: var(--normal-font-size);
    color: var(--text-color-dark);
}

.text.small {
    font-size: var(--small-font-size);
}

.text.smaller {
    font-size: var(--smaller-font-size);
}

.text.large {
    font-size: var(--large-font-size);
    font-weight: bold;
}

.text.title {
    color: var(--primary-color);
    font-size: var(--heading-title-font-size);
    font-weight: bold;
}

.text.subtitle {
    font-size: var(--heading-subtitle-font-size);
    /* color: var(--accent-color); */
    border-radius: 10rem;
    display: inline-block;
}

.text-white {
    color: var(--text-color-light);
}

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

.text-primary {
    color: var(--primary-color) !important;
}

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

.center {
    text-align: center;
}

.bold {
    font-weight: bold;
}

.justify {
    text-align: justify;
}

.center-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-viewport-80 {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text.error {
    color: red;
    font-size: small;
}

.text.success {
    color: green;
    font-size: small;
}

.text-end {
    text-align: end;
}

.cursor-pointer {
    cursor: pointer;
}

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

/* Top Bar */

.topbar #backBtn {
    width: 2rem;
    height: 2rem;
    margin-right: 1rem;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.topbar #backBtn::after {
    font-weight: 900;
    content: '\f104';
    font-family: 'Font Awesome 5 Free';
    font-size: 1.1rem;
    color: white;
}

/* Top Bar */

/* Product Page */

.card-v1 {
    background-color: white;
    padding: 1rem;
    border-radius: var(--card-border-radius);
    box-shadow: 0 1px 6px 0 var(--color-shadow, rgba(49, 53, 59, 0.12));
}

#dataTable.table {
    margin: 0 !important;
    table-layout: fixed;
}

#dataTable.table-borderless th,
#dataTable.table-borderless td {
    border: none !important;
}

#dataTable.table-borderless tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.data-table #lengthControl .dataTables_length label {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    margin-bottom: 0 !important;
}

.data-table #lengthControl .dataTables_length .custom-select {
    width: auto !important;
    display: inline-block !important;
    margin: 0 .5rem;
}

.data-table .dataTables_paginate ul {
    margin-bottom: 0 !important;
}

/* 1) Kill the default flex-gap/margins */
.data-table .dataTables_paginate .pagination {
    margin: 0;
}

/* 2) Give each <li> a bit of horizontal breathing-room */
.data-table .dataTables_paginate .pagination .page-item {
    margin: 0 0.25rem;
}

/* 3) Make every link look like a pill */
.data-table .dataTables_paginate .pagination .page-link {
    border: 1px solid #ccc;
    /* light border */
    border-radius: 8px;
    /* full pill shape */
    padding: 0.3rem 0.75rem;
    /* vertically tighter */
    background-color: #fff;
    /* white background */
    color: #333;
    /* dark text */
}

/* 4) Active page: blue pill with white text */
.data-table .dataTables_paginate .pagination .active .page-link {
    background-color: var(--primary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

/* 5) Disabled button: greyed out */
.data-table .dataTables_paginate .pagination .disabled .page-link {
    color: #aaa;
    cursor: not-allowed;
}

#dataTable tbody tr td {
    color: black;
    align-content: center;
}

.actions a {
    color: #858796;

    .fa-pen:hover {
        color: yellow;
        transition: color 0.3s ease;
    }

    .fa-eye:hover {
        color: blue;
        transition: color 0.3s ease;
    }

    .fa-trash:hover {
        color: red;
        transition: color 0.3s ease;
    }
}

/* Product Page */

/* Add Product Page */

.preview-image {
    aspect-ratio: 1/1;
    object-fit: cover;
}

.required {
    color: #f52222;
    margin-right: 4px;
    font-weight: 700;
    transform: translateY(2px);
}

/* highlight on hover/drag */
#dropZone.dragover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

/* keep the preview centered */
#previewImage {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

#addProductForm .form-control {
    color: black;
}

#productDesc {
    resize: none;
}

/* show pointer on list items */
#categoryList li,
#subCategoryList li {
    cursor: pointer;
}

/* highlight active parent */
#categoryList li.active a {
    background-color: #e9ecef;
    border-radius: 4px;
}

#subCategoryList li.active a {
    background-color: #e9ecef;
    border-radius: 4px;
}

/* ensure dropdown is full-width of form control */
.form-group .dropdown-menu {
    width: 100%;

    ul {
        margin-bottom: 0;
    }

    ul li a {
        color: black;
        font-size: 1rem;
    }

    #categoryList .fa-chevron-right {
        font-size: 0.75em;
    }

    #subCategoryList {
        border-left: none !important;
        padding-left: 0;
        margin-left: 0;
    }

    #categorySearchResults {
        max-height: 200px;
        overflow-y: auto;
        display: none;

        li {
            color: black;
            font-size: 1rem;
            cursor: pointer;
        }

        li:focus {
            outline: none;
            background: #e9ecef;
        }
    }

    #categoryPanes ul {
        width: 30%;
        max-height: 200px;
        overflow-y: auto;
    }
}

.dropdown-menu.with-divider #subCategoryList {
    border-left: 1px solid #e9ecef !important;
    padding-left: .5rem;
    margin-left: .5rem;
}

/* Make the category toggle act like a flex container */
.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: black;
}

/* the clear “×” */
.dropdown-clear {
    font-size: 1rem;
    cursor: pointer;
    color: black;
    padding: 1px 6px;
    margin-right: 8px;
}

/* hover color match Select2’s “×” */
.dropdown-clear:hover {
    color: red;
}

/* push the caret all the way right */
.dropdown-toggle::after {
    margin-left: auto;
}

#variantTable {
    margin-bottom: 0;
}

/* add a 1px border under every <td> */
#variantTable tbody {
    border-bottom: 1px solid #d3d4d5;
}

/* add a 1px border between all <td> except the last in each row */
#variantTable tbody td:not(:last-child) {
    border-right: 1px solid #d3d4d5;
}

.variant-field ul {
    li {
        color: black;
        font-size: 1rem;
    }

    li:focus {
        outline: none;
        background: #e9ecef;
    }
}


.product-weight .form-control:focus {
    box-shadow: none;
}

.product-weight.input-group:focus-within {
    color: #6e707e;
    background-color: #fff;
    border-color: #bac8f3;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(78, 115, 223, .25);
    border-radius: .35rem;
}

/* Add Product Page */

/* Order Page */

.v-line {
    border-left: 2px solid black;
    height: 1.5rem;
    margin: 0 1rem;
}

.text-btn {
    cursor: pointer;
}

.text-btn:hover:not(.active) {
    background-color: #e9ecef;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.text-btn.active {
    border-bottom: 2px solid var(--primary-color);
}

.ellipsis-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.order-table #dataTable tbody tr:hover {
    .order-id-col {
        cursor: pointer;
    }

    .order-id {
        width: fit-content;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

.product-overlay {
    position: fixed;
    /* anchored to viewport for stable positioning */
    z-index: 1055;
    /* above table; below bootstrap modal (1050 default) */
    width: 380px;
    max-width: 90vw;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    padding: 14px 14px 10px;
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .12s ease, transform .12s ease;
}

.product-overlay.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

#productList {
    img {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: cover;
        border-radius: 4px;
    }
}

.action-overlay {
    position: fixed;
    /* stick to viewport so it doesn't jitter on scroll */
    z-index: 1060;
    /* above product overlay (1055) but below bootstrap modal (1050 -> we go slightly higher) */
    min-width: 220px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .12s ease, transform .12s ease;
}

.action-overlay.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.action-overlay .menu-item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #212529;
    font-size: 0.95rem;
}

.action-overlay .menu-item:hover {
    background: #f1f3f5;
}

.action-overlay .divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 6px 4px;
}

/* Order Page */