:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-tint: #e8f0fe;
    --surface: #ffffff;
    --bg: #f6f8fc;
    --border: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --success: #1e8e3e;
    --success-tint: #e6f4ea;
    --warning: #f9ab00;
    --warning-tint: #fef7e0;
    --warning-text: #a15c00;
    --danger: #d93025;
    --danger-tint: #fce8e6;
    --indigo: #6366f1;
    --indigo-tint: #eef0fe;
    --sidebar-width: 264px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-1: 0 1px 2px rgba(60,64,67,0.08), 0 1px 3px rgba(60,64,67,0.10);
    --shadow-2: 0 1px 3px rgba(60,64,67,0.12), 0 4px 8px rgba(60,64,67,0.10);
}

:root[data-theme="dark"] {
    --surface: #1f2023;
    --bg: #131417;
    --border: #3c4043;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --primary-tint: #1b2a41;
    --success-tint: #17281d;
    --warning-tint: #2d2410;
    --warning-text: #f9ab00;
    --danger-tint: #2d1917;
    --indigo-tint: #1e1f36;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --surface: #1f2023;
        --bg: #131417;
        --border: #3c4043;
        --text-primary: #e8eaed;
        --text-secondary: #9aa0a6;
        --primary-tint: #1b2a41;
        --success-tint: #17281d;
        --warning-tint: #2d2410;
        --warning-text: #f9ab00;
        --danger-tint: #2d1917;
        --indigo-tint: #1e1f36;
    }
}

* { box-sizing: border-box; }

body {
    font-family: "Open Sans", sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.65rem 1rem;
    border-radius: 20px;
    margin: 0.15rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg);
}

.sidebar .nav-link.active {
    color: var(--primary-dark);
    background: var(--primary-tint);
    font-weight: 700;
}

.sidebar .border-bottom,
.sidebar .border-top {
    border-color: var(--border) !important;
}

.main-content {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

.card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
    border-radius: var(--radius);
}

.stat-card {
    border-left: none;
    position: relative;
}

.product-card {
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
}

.product-img {
    height: 180px;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
}

.table>thead {
    vertical-align: middle;
}

.table thead th {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.table td, .table th {
    border-color: var(--border);
}

.table-hover>tbody>tr:hover>* {
    background-color: var(--bg);
}

.num {
    font-variant-numeric: tabular-nums;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.chip-muted { background: var(--bg); color: var(--text-secondary); }
.chip-success { background: var(--success-tint); color: var(--success); }
.chip-warning { background: var(--warning-tint); color: var(--warning-text); }
.chip-danger { background: var(--danger-tint); color: var(--danger); }

.pill {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pill:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.rate-chip {
    background: var(--primary-tint) !important;
    color: var(--primary-dark) !important;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.stat-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    float: right;
}

.mobile-bottom-nav {
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.mobile-bottom-nav .mobile-nav-item {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}
.mobile-bottom-nav .mobile-nav-item.active {
    color: var(--primary);
}
.mobile-bottom-nav .mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.login-bg {
    background:
        radial-gradient(circle at 15% 20%, rgba(26, 115, 232, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
}

/* Login card is always light-surface regardless of site theme — pin its
   tokens locally so it doesn't inherit dark-mode values from the bridge
   rules above (login.html never calls initTheme()). */
.login-card {
    --surface: #ffffff;
    --bg: #f6f8fc;
    --border: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    max-width: 440px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px -12px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
    background: var(--surface);
    position: relative;
    z-index: 1;
}

.login-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 20px -4px rgba(26, 115, 232, 0.45);
}

.login-input-group .input-group-text {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-secondary);
}

.login-input-group .form-control {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text-primary);
}

.login-input-group .form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15) !important;
}

.login-input-group:focus-within .input-group-text {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, #1765cc 100%);
    border: none;
    box-shadow: 0 8px 20px -6px rgba(26, 115, 232, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -6px rgba(26, 115, 232, 0.6);
}

@media (max-width: 767.98px) {
    body.has-mobile-nav {
        padding-bottom: 70px;
    }
    .product-img {
        height: 125px;
    }
    .product-card .card-body {
        padding: 0.65rem !important;
    }
    .product-card .card-title {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    .mobile-font-sm {
        font-size: 0.78rem !important;
    }
    .mobile-header-rate {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}

.draft-list {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.draft-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}
.draft-row:last-child {
    border-bottom: none;
}
.draft-row-main {
    flex: 1 1 auto;
    min-width: 0;
}
.draft-row-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.draft-row.active .draft-row-btn {
    background: var(--primary-tint);
    box-shadow: inset 3px 0 0 #d93025;
}
.draft-row-btn:hover {
    background: var(--primary-tint);
}
.draft-row-icon {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.draft-row-name {
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.draft-row-count {
    flex-shrink: 0;
}
.draft-row-price {
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}
.draft-row-close-form {
    flex: 0 0 auto;
    display: flex;
}
.draft-row-close {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--danger);
    cursor: pointer;
}
.draft-row-close:hover {
    background: var(--danger-tint);
}
@media (max-width: 480px) {
    .draft-row-price {
        min-width: 70px;
    }
    .draft-row-count {
        display: none;
    }
}

#adminCategoriesTableBody tr td button{
    float: left;
}

.my-auto {
    max-width: 480px;
    width: 100%;
    border-radius: 1rem;
}
@media (min-width: 992px) {
    .sidebar.collapsed {
        width: 90px;
    }
    .sidebar.collapsed .hide-on-collapse {
        display: none !important;
    }
    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding: 0.75rem 0;
        margin: 0.2rem 0.5rem;
    }
    .sidebar.collapsed .nav-link i {
        font-size: 1.25rem;
    }
}
.mbcenter {
    text-align: center;
}
.box-order {
    border: solid 1px #ccc;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}
.box-order .list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}
.feesNote {
    display: block;
    font-style: italic;
    color: red;
    font-size: 10px;
}
.d-flex-none {
    justify-content: left !important;
    flex-direction: column;
    align-items: inherit !important;
}

.btndelete {

}
.btndelete button {
    padding: 10px !important;
}

@media (max-width: 992px) {

    .sidebar {
        position: fixed;
        top: 0;
        left: calc(var(--sidebar-width) * -1);
        z-index: 1040;
        height: 100%;
    }
    .sidebar.show {
        left: 0;
    }
    .sidebar.collapsed {
        width: 70px;
    }
    .sidebar.collapsed .hide-on-collapse {
        display: none !important;
    }
    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding: 0.75rem 0;
        margin: 0.2rem 0.5rem;
    }
    .sidebar.collapsed .nav-link i {
        font-size: 1.25rem;
    }
}

.txtMb {
    display: none;
}
.blink {
    animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.2;
  }
}
.actionStatus_product {
    
}
.customerSelected {
    margin-top: 10px;
}
@media (max-width: 800px) {
    .pd5btn button {
        padding: 5px;
    }
    .mobile-bottom-nav {
        display: block !important;
    }
    .table-hover tr td {
        font-size: 15px;
    }
    .table-hover tr td button {
        margin: 3px;
    }
    .customerTable .table-light{
        display: none;
    }
    .customerMobileFill {}
    .customerMobileFill tr {
        display: flex;
        flex-direction: column;
        border: solid 1px #ccc;
        margin-bottom: 5px;
        border-radius: 5px;
    }
    .customerMobileFill tr td {
        border: none;
        padding: 5px;
    }
    .productTable .table-light {
        display: none;
    }
    .productMobileFill {}
    .productMobileFill tr {
        display: flex;
        flex-direction: column;
        border: solid 1px #ccc;
        border-radius: 5px;
        margin-bottom: 5px;
    }
    .productMobileFill tr td {
        border: none;
        padding: 5px;
    }
    .productMobileFill tr td img {
        width: 150px !important;
        height: 150px !important;
        display: block;
    }
    .flexCol {
        flex-direction: column;
        gap: 15px;
    }
    .txtMb {
        display: inline-block;
        margin-right: 5px;
        background: antiquewhite;
        padding: 0px 7px;
        font-weight: normal;
        border-radius: 3px;
        color: #000;
    }
    .orderTable .table-light, 
    .CommissionTable .table-light, 
    .saleTable .table-light {
        display: none;
    }
    .orderTable tr {}
    .orderTableBody {}
    .orderTableBody tr, 
    .CommissionTableBody tr,
    .saleTableBody tr  {
        display: flex;
        flex-direction: column;
        border: solid 1px #ccc;
        margin-bottom: 5px;
        border-radius: 5px;
    }
    .orderTableBody tr td, 
    .CommissionTableBody tr td, 
    .saleTableBody tr td {
        border:none;
        padding: 5px;
    }
    .chip-muted, .chip-success {
        background: none;
    }
    .orderTableBody tr td small {
        margin-top: 10px;
        display: block;
        padding-left: 15px;
    }
    .orderTableBody tr td small p {
        margin-bottom: 5px;
    }
    .fixedbt {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border: none;
        border-radius: 0;
    }
    .pdbt100 {
        padding-bottom: 100px !important;
    }
    .fixedbt .pd5btn {
        justify-content: center;
    }
}


/* Bridge Bootstrap hardcoded-color utilities to theme tokens (dark mode support) */
.bg-white {
    background-color: var(--surface) !important;
}

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

.bg-light {
    background-color: var(--bg) !important;
}

.modal-content {
    background-color: var(--surface);
    color: var(--text-primary);
}

.form-control,
.form-select {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    color: var(--text-primary);
}

.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
}

.table-light,
.table > thead.table-light {
    background-color: var(--bg);
    color: var(--text-primary);
    --bs-table-bg: var(--bg);
    --bs-table-color: var(--text-primary);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: transparent;
    color: var(--text-primary);
}

.card,
.card-body,
.card-header,
.card-footer {
    background-color: var(--surface);
    color: var(--text-primary);
}

.card-header,
.card-footer {
    border-color: var(--border);
}

.input-group-text {
    background-color: var(--bg);
    color: var(--text-secondary);
    border-color: var(--border);
}

.dropdown-menu {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: var(--shadow-2);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg);
    color: var(--text-primary);
}

.modal-content {
    border-color: var(--border);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

.btn-close {
    filter: var(--btn-close-filter, none);
}

:root[data-theme="dark"] {
    --btn-close-filter: invert(1) grayscale(100%) brightness(200%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --btn-close-filter: invert(1) grayscale(100%) brightness(200%);
    }
}

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

.img-thumbnail {
    background-color: var(--surface);
    border-color: var(--border);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background-color: var(--bg);
    color: var(--text-primary);
    border-color: var(--border);
}

.page-link {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.page-item.disabled .page-link {
    background-color: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}
