:root {
    /* Constant Colors */
    --bg-dark-header: #0B0B15;
    --bg-card-header: #161622;
    --primary-purple: #7459D9;
    /* Dynamic Theme Variables (Light Default) */
    --bg-body: #F4F5F9;
    --bg-card: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --sidebar-text: #1F2937;
    /* Status Colors */
    --status-new-bg: #EBE6FF;
    --status-new-text: #7459D9;
    --status-progress-bg: #FFF8E6;
    --status-progress-text: #F2A20D;
    --status-ready-bg: #E6F7ED;
    --status-ready-text: #22AD5C;
    --note-bg: #F9FAFB;
}

/* Dark Theme Variables */
.dark-theme {
    --bg-body: #0B0B15;
    --bg-card: #161622;
    --text-main: #FFFFFF;
    --text-muted: #A0AEC0;
    --border-color: #2D2D39;
    --sidebar-text: #E2E8F0;
    /* Adjust status colors for dark mode visibility if needed, 
               or keep them as "light pills" on dark background */
    --note-bg: #21212E;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    /*background: linear-gradient(129deg, rgba(144, 202, 249, 0.20) 14.58%, rgba(216, 232, 246, 0.20) 53.23%, rgba(254, 223, 173, 0.20) 84.73%)*/
}

/* Top Section - Always Dark */
.top-section {
    /*background-color: var(--bg-dark-header);*/
    background: linear-gradient(129deg, rgba(144, 202, 249, 0.20) 14.58%, rgba(216, 232, 246, 0.20) 53.23%, rgba(254, 223, 173, 0.20) 84.73%);
    color: white;
    padding-bottom: 80px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

/* Navbar */
.navbar {
    padding: 20px 0;
}

.brand-logo {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #A855F7, #7459D9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-link {
    color: black !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 20px;
    transition: all 0.3s;
}

    .nav-link.active {
        background-color: rgba(255,255,255,0.1);
        color: purple !important;
    }

/*.nav-icons .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    transition: background 0.2s;
}*/

.nav-icons .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #A855F7, #7459D9) !important;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

    .nav-icons .btn-icon:hover {
        background: rgba(255,255,255,0.15);
    }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 12px;
}

/* Stats Cards - Always Dark */
.stat-card {
    /*background-color: var(--bg-card-header);*/
    background: linear-gradient(83deg, rgba(122, 190, 247, 0.20) 1.73%, rgba(119, 71, 213, 0.20) 82.38%);
    border-radius: 5px;
    padding: 2px;
    /*height: 100%;*/
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-title {
    color: black;
    font-size: 12px;
    /*margin-bottom: 10px;*/
    margin: 0 5px;
    font-style: italic;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Main Content */
.main-content {
    margin-top: 30px;
}

/* Sidebar Filters */
.sidebar-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.filter-section-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 15px;
    margin-top: 25px;
}

/* Custom Checkbox */
.custom-check {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

    .custom-check input {
        display: none;
    }

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: var(--bg-card);
}

.custom-check input:checked + .checkmark {
    background-color: var(--text-main);
    border-color: var(--text-main);
    color: var(--bg-card);
}

/* In dark mode, invert checkmark logic for visibility */
.dark-theme .custom-check input:checked + .checkmark {
    background-color: #7459D9; /* Use purple in dark mode */
    border-color: #7459D9;
    color: white;
}

.check-label {
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Custom Radio */
.custom-radio {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

    .custom-radio input {
        display: none;
    }

.radio-mark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    margin-right: 12px;
    position: relative;
    background: var(--bg-card);
}

.custom-radio input:checked + .radio-mark {
    border-color: var(--text-main);
}

.dark-theme .custom-radio input:checked + .radio-mark {
    border-color: #7459D9;
}

.custom-radio input:checked + .radio-mark::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--text-main);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dark-theme .custom-radio input:checked + .radio-mark::after {
    background: #7459D9;
}

/* Order Cards */
.order-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid transparent; /* To prevent jumping on theme switch if needed */
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dark-theme .order-card {
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.order-card.featured {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: scale(1.02);
    position: relative;
    z-index: 10;
}

.dark-theme .order-card.featured {
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    gap: 12px;
}

    .user-info img {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        object-fit: cover;
    }

.user-name {
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    font-size: 1rem;
}

.order-id {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-new {
    background: var(--status-new-bg);
    color: var(--status-new-text);
}

.status-progress {
    background: var(--status-progress-bg);
    color: var(--status-progress-text);
}

.status-ready {
    background: var(--status-ready-bg);
    color: var(--status-ready-text);
}

.room-info {
    display: flex;
    justify-content: space-between;
    background: var(--note-bg);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    display: block;
}

.item-price {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.item-qty {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.more-items {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.order-notes {
    background: var(--note-bg);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.note-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.note-text {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 500;
}

.btn-order-details {
    width: 100%;
    background: #0B0B15;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.dark-theme .btn-order-details {
    background: #7459D9;
}

.btn-order-details:hover {
    background: #252530;
    color: white;
}

.dark-theme .btn-order-details:hover {
    background: #5b45b0;
}

/* Secondary button style (outlined in light, filled in dark) */
.btn-secondary-custom {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.dark-theme .btn-secondary-custom {
    background: transparent;
    color: white;
    border-color: var(--border-color);
}

    .dark-theme .btn-secondary-custom:hover {
        background: rgba(255,255,255,0.05);
    }

/* Toggle Switch for Card View */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
    background-color: var(--border-color);
    border-color: var(--border-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

    .form-switch .form-check-input:checked {
        background-color: var(--primary-purple);
        border-color: var(--primary-purple);
    }

.pb-5 {
    padding-bottom: 1rem !important;
}

.anchor-all {
    all: unset;
    cursor: pointer;
}

.mg-t {
    margin-top: 5px;
}

.user-circle {
    text-decoration: none;
    /*background: #2D2D39 !important;
    color: #F2A20D !important;*/
}

.log-out-circle {
    text-decoration: none;
    /*background: #2D2D39 !important;
    color: #f31164 !important;*/
}

.user-broadcast-circle {
    text-decoration: none;
    cursor: not-allowed !important;
    background: #297418 !important;
    color: #0ffb00 !important;
}

.generate-circle {
    text-decoration: none;
    /*background: #2D2D39 !important;
    color: #7459D9 !important;*/
}

.scrip-circle {
    border: 1px solid green;
    border-radius: 8px;
    padding: 5px;
    color: #ef9309;
    font-weight: 800;
}

.header-align {
    text-align: center !important;
    border-bottom: 1px solid #0c1c38;
    width: fit-content;
    float: left;
}

.a-right {
    float: right;
    height: 32px !important;
    border: 1px solid cornflowerblue;
    border-radius: 5px;
    padding: 4px 10px;
    text-decoration: none;
}

.a-btn {
    height: 32px !important;
    border: 1px solid cornflowerblue;
    border-radius: 5px;
    padding: 4px 10px;
    text-decoration: none;
    display: block;
    width: 100%;
}

.border-Custom-1 {
    border-radius: 5px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    margin: 10px 5px;
    background-color: white;
}

    .border-Custom-1 > div {
        margin: 10px 0;
    }

        .border-Custom-1 > div > .form-floating {
            margin: 10px 0;
        }

            .border-Custom-1 > div > .form-floating > label {
                margin-left: 10px;
            }

        .border-Custom-1 > div > div > span {
            font-size: 12px;
            font-style: italic;
        }

        .border-Custom-1 > div > div > select {
            border: 1px solid #aaa;
            border-radius: 5px;
            padding: 5px;
            height: 30px;
            font-size: 13px;
            /*margin-top: 5px;*/
        }

        .border-Custom-1 > div > div > em {
            text-align: left !important;
            border-bottom: 1px solid #dfd6d6;
        }

/*.border-Custom-1 > div > div > input {
            border: 1px solid #aaa;
            border-radius: 5px;
            padding: 5px;
            height: 30px;
            font-size: 13px;*/
/*margin-top: 5px;*/
/*}*/

.select2.select2-container {
    width: 100% !important;
}

.select2-results__option {
    font-size: 12px; /* or a specific size like 12px */
    color: black;
}

.navbar-dark {
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-toggler {
    border: none !important;
    /*background-color: #09080873;*/
    background: linear-gradient(83deg, rgba(122, 190, 247, 0.20) 1.73%, rgba(64, 128, 245, 0.20) 51.42%, rgba(119, 71, 213, 0.20) 82.38%, rgba(87, 42, 194, 0.20) 107.74%);
}

.custom-validation-error {
    border-left-width: 3px !important;
    border-left-style: solid !important;
    border-left-color: red !important;
}

.custom-validation-error-select {
    border-left-width: 3px !important;
    border-left-style: solid !important;
    border-left-color: red !important;
    border-radius: 5px !important;
}

.table-scroll {
    width: 100%;
    margin: 10px;
    background-color: white;
    overflow-y: auto;
}

.table-Custom-1 {
    width: 100%;
    font-family: 'FontAwesome' !important;
    font-size: .85em !important;
}

.scrip-buy {
    margin-left: 5px;
    color: white;
    background-color: green;
    padding: 3px;
    font-size: 10px;
    font-style: italic;
    border-radius: 6px;
}

.scrip-sell {
    margin-left: 5px;
    color: white;
    background-color: red;
    padding: 3px;
    font-size: 10px;
    font-style: italic;
    border-radius: 6px;
}

.scrip-going-on {
    text-align: center !important;
    font-size: 16px;
    color: green !important;
    font-weight: bold;
    background: linear-gradient(83deg, rgba(122, 190, 247, 0.20) 1.73%, rgba(64, 128, 245, 0.20) 51.42%);
    border-radius: 0px;
}

.scrip-triggered {
    text-align: center !important;
    font-size: 16px;
    color: green !important;
    font-weight: bold;
    background: linear-gradient(83deg, rgba(119, 71, 213, 0.20) 82.38%, rgba(87, 42, 194, 0.20) 107.74%);
    border-radius: 0px;
}

.scrip-ltp {
    border: 1px solid white;
    background: green;
    border-radius: 5px;
    padding: 1px 7px 1px 4px;
    color: white;
    font-weight: 100;
    font-style: italic;
}

.basket-live-off {
    text-decoration: none;
    float: right;
    background-color: #777;
    color: white;
    border: 1px solid #777;
    border-radius: 5px;
    padding: 0 5px;
}

.basket-live-on {
    text-decoration: none;
    float: right;
    background-color: green;
    color: white;
    border: 1px solid green;
    border-radius: 5px;
    padding: 0 5px;
}

.table-basket {
    max-height: 100px;
    overflow-x: auto;
}

    .table-basket + th {
        position: sticky;
        top: 0; /* Sticks to the top of the container */
        z-index: 2; /* Keeps headers above scrolling body rows */
        background: #fff; /* Mandatory: prevents body text from showing through */
    }

.mrgt-5 {
    margin-top: 5px;
}


.record-not-found {
    text-align: center;
    background: linear-gradient(83deg, rgba(122, 190, 247, 0.20) 1.73%, rgba(119, 71, 213, 0.20) 82.38%);
    border-radius: 15px;
}

.triggered-alert {
    color: black;
    font-size: 12px;
    margin: 0 5px;
    font-style: italic;
    background-color: #a5f1c3 !important;
    border-radius: 10px;
    padding: 2px 5px;
}

.scrip-price {
    display: flex;
    font-size: 18px;
    margin: 5px;
}