/* Minification failed. Returning unminified contents.
(133,27): run-time error CSS1030: Expected identifier, found '.'
(133,51): run-time error CSS1031: Expected selector, found ')'
(133,51): run-time error CSS1025: Expected comma or open brace, found ')'
(2952,11): run-time error CSS1030: Expected identifier, found ' '
(2952,12): run-time error CSS1031: Expected selector, found '100%'
(2952,12): run-time error CSS1025: Expected comma or open brace, found '100%'
(2953,16): run-time error CSS1030: Expected identifier, found ' '
(2953,27): run-time error CSS1031: Expected selector, found ';'
(2953,27): run-time error CSS1025: Expected comma or open brace, found ';'
(2954,13): run-time error CSS1030: Expected identifier, found ' '
(2954,14): run-time error CSS1031: Expected selector, found '8px'
(2954,14): run-time error CSS1025: Expected comma or open brace, found '8px'
(2955,12): run-time error CSS1030: Expected identifier, found ' '
(2955,13): run-time error CSS1031: Expected selector, found '1px'
(2955,13): run-time error CSS1025: Expected comma or open brace, found '1px'
(2956,19): run-time error CSS1030: Expected identifier, found ' '
(2956,20): run-time error CSS1031: Expected selector, found '5px'
(2956,20): run-time error CSS1025: Expected comma or open brace, found '5px'
(2957,15): run-time error CSS1030: Expected identifier, found ' '
(2957,16): run-time error CSS1031: Expected selector, found '13px'
(2957,16): run-time error CSS1025: Expected comma or open brace, found '13px'
(2958,12): run-time error CSS1030: Expected identifier, found ' '
(2958,21): run-time error CSS1031: Expected selector, found ';'
(2958,21): run-time error CSS1025: Expected comma or open brace, found ';'
(2959,17): run-time error CSS1030: Expected identifier, found ' '
(2959,25): run-time error CSS1031: Expected selector, found ';'
(2959,25): run-time error CSS1025: Expected comma or open brace, found ';'
(2960,1): run-time error CSS1019: Unexpected token, found '}'
(3091,1): run-time error CSS1019: Unexpected token, found '@keyframes'
(3092,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '0%'
(3324,1): run-time error CSS1019: Unexpected token, found '@-webkit-keyframes'
(3324,33): run-time error CSS1035: Expected colon, found '{'
(3325,1): run-time error CSS1019: Unexpected token, found '@keyframes'
(3325,25): run-time error CSS1035: Expected colon, found '{'
 */
/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #333;
    background: #e4e7ec;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== Sidebar Navigation ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100%;
    background: #1e1e2d;
    color: #a2a3b7;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #2e2e3d;
}

.sidebar-logo {
    display: block;
    width: 100%;
    height: auto;
}

.nav-menu {
    list-style: none;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: #a2a3b7;
    transition: all 0.2s;
}

.nav-menu li a:hover {
    background: #2e2e3d;
    color: #fff;
}

.nav-menu li.active a {
    background: #3699ff;
    color: #fff;
    border-radius: 0;
}

.nav-badge {
    display: inline-block;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    padding: 3px 6px;
    border-radius: 10px;
    text-align: center;
    margin-left: 8px;
    vertical-align: middle;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #2e2e3d;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.sidebar-quick-actions {
    display: flex;
    gap: 6px;
    width: 100%;
    padding-bottom: 10px;
}

.sidebar-quick-btn {
    flex: 1;
    font-size: 12px;
    text-align: center;
}

.user-name {
    color: #fff;
    font-weight: 500;
    font-size: 13px;
}

.btn-logout {
    color: #f44336;
    font-size: 13px;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.8;
}

/* ===== Content Area ===== */
.content-with-sidebar {
    margin-left: 220px;
    padding: 30px;
    min-height: 100%;
}

/* ===== Website Embed ===== */
.content-with-sidebar:has(.website-embed-container) {
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.website-embed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.website-embed-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}

.content-full {
    padding: 0;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Notice Bar ===== */
.notice-bar {
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    background: #3699ff;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    z-index: 200;
}

/* ===== Login Page ===== */
.login-page {
    background: url('hoardBackground.png') center center / cover no-repeat fixed;
}

.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    width: 380px;
    max-width: 90%;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
    color: #1e1e2d;
}

.login-container .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
    font-size: 13px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3699ff;
}

.login-container .btn-primary {
    width: 100%;
    padding: 12px;
    background: #3699ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2d8ae6;
}

.error-message {
    background: #fff3f3;
    color: #e74c3c;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: center;
}

/* ===== Dashboard ===== */
.page-title {
    font-size: 22px;
    font-weight: 600;
    color: #1e1e2d;
    margin-bottom: 25px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e1e2d;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8f0;
}

.section-gap {
    margin-top: 40px;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    border: 1px solid #dde1e8;
}

.stat-card .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 600;
    color: #1e1e2d;
}

.stat-card.blue { border-left: 4px solid #3699ff; }
.stat-card.green { border-left: 4px solid #1bc5bd; }
.stat-card.orange { border-left: 4px solid #ffa800; }
.stat-card.red { border-left: 4px solid #f64e60; }
.stat-card.purple { border-left: 4px solid #8950fc; }

/* ===== Data Tables ===== */
.table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    border: 1px solid #dde1e8;
    overflow: hidden;
}

.table-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e2d;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #3699ff;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.data-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f2f4f7;
}

.data-table th.text-center {
    text-align: center;
}

.data-table td {
    padding: 8px 20px;
    font-size: 14px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-table td:first-child {
    border-left: 1px solid #f0f0f0;
    border-radius: 6px 0 0 6px;
    padding: 0;
}

.data-table td:last-child {
    border-right: 1px solid #f0f0f0;
    border-radius: 0 6px 6px 0;
}

/* Thumb cell — desktop only: shrink column to image width */
@media (min-width: 769px) {
    .td-thumb {
        width: 1px;
        white-space: nowrap;
    }

    .td-thumb .thumb {
        display: block;
        width: 48px;
        height: 100%;
        min-height: 48px;
        object-fit: cover;
        border-radius: 6px 0 0 6px;
    }

    .td-thumb .thumb-empty {
        display: block;
        width: 48px;
        min-height: 48px;
        background: #f0f0f0;
        border-radius: 6px 0 0 6px;
    }
}

/* Mobile: .thumb-empty bare rule (used outside tables too) */
.thumb-empty {
    background: #f0f0f0;
}

/* Thumb copy buttons — desktop only */
.thumb-copy-btns {
    display: none;
}

@media (min-width: 769px) {
    .thumb-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .thumb-copy-btns {
        display: flex;
        flex-direction: column;
        gap: 3px;
        opacity: 0;
        transition: opacity 0.15s;
    }

    tr:hover .thumb-copy-btns {
        opacity: 1;
    }

    .thumb-copy-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        padding: 0;
        border: 1px solid #d0d8ff;
        border-radius: 4px;
        background: #fff;
        color: #3a3f5c;
        font-size: 13px;
        cursor: pointer;
        line-height: 1;
        transition: background 0.1s, border-color 0.1s;
    }

    .thumb-copy-btn:hover {
        background: #eef1ff;
        border-color: #3a7bd5;
    }
}

.data-table tr:hover td {
    background: #eef1ff;
    border-top-color: #d0d8ff;
    border-bottom-color: #d0d8ff;
}

.data-table tr.clickable {
    cursor: pointer;
}

.text-center {
    text-align: center;
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active, .badge-Live { background: #d4edda; color: #155724; }
.badge-draft, .badge-Draft { background: #fff3cd; color: #856404; }
.badge-drawn, .badge-Drawn { background: #cce5ff; color: #004085; }
.badge-sold, .badge-Sold { background: #d1ecf1; color: #0c5460; }
.badge-won, .badge-Won { background: #d4edda; color: #155724; }
.badge-ended, .badge-Ended { background: #f8d7da; color: #721c24; }
.badge-default { background: #e2e3e5; color: #383d41; }

/* Stock status badges */
.badge-Available { background: #d4edda; color: #155724; }
.badge-Listed { background: #cce5ff; color: #004085; }
.badge-Won { background: #d1ecf1; color: #0c5460; }
.badge-Deleted { background: #f8d7da; color: #721c24; }
.badge-Insant_Win, .badge-Insant-Win { background: #e2d9f3; color: #4b2a8a; }
.badge-Loan { background: #fff3cd; color: #856404; }

/* ===== Image Thumbnails ===== */
.thumb {
    object-fit: cover;
    background: #eee;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .thumb {
        width: 40px;
        height: 40px;
        border-radius: 4px;
    }
}

/* ===== Loading Indicator ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ===== Connection Status Dot ===== */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.connected { background: #4caf50; }
.status-dot.disconnected { background: #f44336; }

/* ===== Hamburger Toggle (hidden on desktop) ===== */
.sidebar-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ===== Responsive ===== */
/* Status badge in title cell — hidden on desktop, shown on mobile only */
.title-status {
    display: none !important;
}

@media (max-width: 768px) {

    /* Sidebar slides in as drawer */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
        width: 220px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: all;
    }

    /* Hamburger button */
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 198;
        width: 38px;
        height: 38px;
        background: #1e1e2d;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    }

    /* Content fills full width, add top padding for the toggle button */
    .content-with-sidebar {
        margin-left: 0;
        padding: 16px;
        padding-top: 60px;
    }

    .notice-bar {
        left: 0;
    }

    /* Page title */
    .page-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    /* Stat cards — 2 columns */
    .stat-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .value {
        font-size: 18px;
    }

    /* Tab bar — two-row layout */
    .tab-bar {
        margin-bottom: 10px;
        border-radius: 8px;
        overflow: visible;
    }

    .tab-scroll {
        flex-wrap: wrap;
        justify-content: center;
        padding: 6px;
        gap: 4px;
        overflow-x: visible;
    }

    .tab-spacer {
        display: none;
    }

    /* Date tabs — equal-width wrapping buttons */
    .draw-tab {
        flex: 1 1 auto;
        min-width: 80px;
        padding: 9px 10px;
        border-bottom: none;
        border-radius: 6px;
        background: #f0f0f5;
        border-left: none;
    }

    .draw-tab.active {
        background: #1e1e2d;
        border-bottom: none;
    }

    .draw-tab.active .tab-label {
        color: #fff;
    }

    .draw-tab .tab-sub {
        font-size: 10px;
        color: #444;
    }

    .draw-tab.active .tab-sub {
        color: rgba(255,255,255,0.75);
    }

    .draw-tab .tab-label {
        font-size: 12px;
        color: #111;
    }

    /* Date picker tab */
    .draw-tab.tab-datepicker {
        border-left: none;
        background: #f0f0f5;
    }

    .draw-tab.tab-datepicker.active {
        background: #1e1e2d;
    }

    .draw-tab.tab-datepicker #customDrawDate {
        max-width: 90px;
        font-size: 10px;
    }

    /* Filter bar — stack vertically, full width inputs */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .search-input {
        width: 100%;
        box-sizing: border-box;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    /* Stats footer panel: stack vertically on mobile, cards wrap 2-col */
    .listings-page {
        display: flex;
        flex-direction: column;
    }

    /* On mobile: tabs first, stats panel below them */
    .tab-bar {
        order: -1;
    }

    #statsBar {
        order: 0;
        margin-top: 0;
        margin-bottom: 12px;
    }

    .listing-stats-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 10px;
    }

    /* Cards before the checkbox on mobile */
    .listing-stats {
        order: 1;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .listing-stats-check {
        order: 2;
    }

    /* Cards fill their grid cell fully */
    .listing-stats .stat-card {
        flex: unset !important;
        max-width: unset !important;
        min-width: 0 !important;
        width: 100%;
        padding: 14px;
        box-sizing: border-box;
    }

    .listing-stats .stat-card .value {
        font-size: 18px;
    }

    /* Results count */
    .results-count {
        margin-bottom: 6px;
    }

    /* ===== Card view for data tables ===== */

    /* Hide the thead on mobile */
    .data-table thead {
        display: none;
    }

    /* Each row becomes a card — reset desktop border-separate styles */
    .data-table tr {
        display: block;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.13);
        margin-bottom: 20px;
        padding: 0;
        overflow: hidden;
        border-bottom: none;
        border: 1px solid #e0e4ef;
    }

    /* Clearfix — prevents card collapsing when image cell is floated */
    .data-table tr::after {
        content: '';
        display: table;
        clear: both;
    }

    .data-table tr:last-child {
        margin-bottom: 0;
    }

    /* Reset desktop per-td borders, box-shadow and radius — card tr owns these */
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 14px;
        border-top: none;
        border-bottom: 1px solid #f0f0f0;
        border-left: none;
        border-right: none;
        border-radius: 0 !important;
        box-shadow: none;
        font-size: 13px;
        background: transparent;
        text-align: left !important;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    /* Reset desktop first/last-child overrides */
    .data-table td:first-child {
        border-left: none;
        border-radius: 0 !important;
        padding: 0;
    }

    /* Menu / Image cell — floats left so the Title cell sits alongside it */
    .data-table td[data-label="Menu"],
    .data-table td[data-label="Image"] {
        display: block;
        float: left;
        width: 90px;
        min-height: 90px;
        padding: 0;
        border-bottom: none;
        border-right: 1px solid #eee;
        background: #fff;
        border-radius: 10px 0 0 0;
        overflow: hidden;
    }

    .data-table td[data-label="Menu"] .thumb,
    .data-table td[data-label="Image"] .thumb {
        display: block;
        width: 90px;
        height: 90px;
        border-radius: 10px 0 0 0;
        object-fit: cover;
        object-position: center;
        min-height: unset;
        float: none;
    }

    .data-table td[data-label="Menu"] .thumb-empty,
    .data-table td[data-label="Image"] .thumb-empty {
        width: 90px;
        height: 90px;
        border-radius: 10px 0 0 0;
        display: block;
        min-height: unset;
        background: #f5f5f5;
    }

    /* Title cell — sits to the right of the floated image cell */
    .data-table td[data-label="Title"],
    .data-table td[data-label="Prize"] {
        display: block;
        position: relative;
        margin-left: 90px;
        min-height: 90px;
        font-weight: 600;
        font-size: 14px;
        padding: 10px 14px 28px;
        border-bottom: 2px solid #eee;
        box-sizing: border-box;
    }

    /* Badges on their own line below the title text */
    .data-table td[data-label="Title"] .title-badges {
        margin-top: 5px;
    }

    /* Clear the float after the title/prize so remaining cells stack normally */
    .data-table td[data-label="Title"] + td,
    .data-table td[data-label="Prize"] + td {
        clear: both;
    }

    /* Status badge embedded in title cell — pinned bottom-right on mobile */
    .title-status {
        display: inline-block !important;
        position: absolute;
        bottom: 7px;
        right: 10px;
        margin-left: 0;
    }

    /* Hide the standalone Status column on mobile */
    .data-table td[data-label="Status"] {
        display: none;
    }

    /* Label pulled from data-label attribute */
    .data-table td[data-label]:not([data-label="Menu"]):not([data-label="Image"]):not([data-label="Title"]):not([data-label="Prize"])::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex-shrink: 0;
        margin-right: 10px;
    }

    /* Tickets cell — reorder to (%) count/total on mobile */
    .data-table td[data-label="Tickets"] {
        align-items: center;
    }

    .data-table td[data-label="Tickets"] .tickets-desktop {
        display: none;
    }

    .data-table td[data-label="Tickets"] .tickets-mobile {
        display: inline;
    }

    .tickets-pct {
        display: inline;
        font-size: 11px;
        margin-top: 0;
        margin-left: 4px;
    }

    /* Gross cell — coloured background spans the full cell */
    .profit-positive,
    .profit-negative {
        margin: 0;
        padding: 8px 14px;
        border-radius: 0 0 10px 10px !important;
    }

    /* Table container becomes transparent on mobile so cards show cleanly */
    .table-container {
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }
}

/* ===== Draw Date Tab Bar ===== */
.tab-bar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    border: 1px solid #dde1e8;
    margin-bottom: 15px;
    overflow: hidden;
}

.tab-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-scroll::-webkit-scrollbar {
    display: none;
}

.tab-spacer {
    flex: 1;
}

.draw-tab {
    flex: 0 0 auto;
    padding: 10px 16px;
    text-align: center;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    min-width: 90px;
    user-select: none;
}

.draw-tab:hover {
    background: #f0f4ff;
}

.draw-tab.active {
    border-bottom-color: #1e1e2d;
    background: #1e1e2d;
}

.draw-tab .tab-label {
    font-size: 12px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
}

.draw-tab .tab-sub {
    font-size: 11px;
    color: #444;
    white-space: nowrap;
}

.draw-tab.active .tab-label {
    color: #fff;
}

.draw-tab.active .tab-sub {
    color: rgba(255,255,255,0.75);
}

.draw-tab.tab-special {
    border-left: 1px solid #eee;
}

.draw-tab.tab-datepicker {
    border-left: 1px solid #eee;
}

.draw-tab.tab-datepicker #customDrawDate {
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 4px;
    color: #555;
    background: #fafafa;
    cursor: pointer;
    max-width: 110px;
}

.draw-tab.tab-datepicker #customDrawDate:focus {
    outline: none;
    border-color: #3699ff;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    border: 1px solid #dde1e8;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-checks {
    gap: 12px;
}

.check-label {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.check-label input[type="checkbox"] {
    accent-color: #3699ff;
}

.th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.th-sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ===== Results Count ===== */
.results-count {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* ===== Listing Stats ===== */

/* Desktop: stats sit below the table, right-aligned in a row */
/* Desktop: listings-page is a plain column flow */
.listings-page {
    display: flex;
    flex-direction: column;
}

.listings-area {
    display: flex;
    flex-direction: column;
}

.listings-main {
    display: flex;
    flex-direction: column;
}

/* Footer panel: checkbox left, stat cards right */
.listing-stats-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    border: 1px solid #dde1e8;
    padding: 14px 20px;
    margin-bottom: 15px;
    gap: 20px;
}

.listing-stats-check {
    flex-shrink: 0;
}

.listing-stats {
    gap: 12px;
    margin: 0;
}

@media (min-width: 769px) {
    .listing-stats {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        flex: 1;
    }

    .listing-stats .stat-card {
        padding: 14px 18px;
        min-width: 120px;
        flex: 0 0 auto;
    }

    .listing-stats .stat-card .value {
        font-size: 20px;
    }
}

/* ===== Profit Colours ===== */
.profit-positive {
    background: #d4edda !important;
    color: inherit;
}

.profit-negative {
    background: #fde8e8 !important;
    color: inherit;
}

.tickets-pct {
    display: block;
    font-size: 11px;
    margin-top: 1px;
}

.tickets-mobile {
    display: none;
}

/* Badges wrapper — inline on desktop, block on mobile (see media query) */
.title-badges {
    display: inline;
}

/* ===== Listing auto/zap indicator badges ===== */
.listing-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
    margin-left: 5px;
}

.listing-badge-zap {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.listing-badge-auto {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.listing-badge-iw {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===== Badge additions ===== */
.badge-Closed { background: #f8d7da; color: #721c24; }
.badge-Complete { background: #d1ecf1; color: #0c5460; }
.badge-None { background: #e2e3e5; color: #383d41; }
.badge-Scheduled { background: #fff3cd; color: #856404; }

/* ===== Listing Detail Page ===== */
.ld-loading {
    text-align: center;
    padding: 80px 20px;
}

.ld-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: ld-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes ld-spin {
    to { transform: rotate(360deg); }
}

.ld-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ld-back {
    font-size: 13px;
    color: #3498db;
    white-space: nowrap;
}

.ld-back:hover {
    text-decoration: underline;
}

.ld-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ld-section-header h3 {
    margin: 0;
}

.ld-title-wrap {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.ld-title-wrap .page-title {
    margin: 0;
    font-size: 22px;
}

.ld-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ld-status,
.iwd-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.ld-stats {
    margin-bottom: 15px;
}

/* Notices */
.ld-notices {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
}

.ld-notice-item {
    font-size: 13px;
    color: #856404;
    padding: 2px 0;
}

/* Tab bar */
.ld-tab-bar {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    border: 1px solid #dde1e8;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ld-tab-bar::-webkit-scrollbar {
    display: none;
}

.ld-tab {
    flex: 0 0 auto;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    color: #111;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    user-select: none;
}

.ld-tab:hover {
    background: #f0f4ff;
}

.ld-tab.active {
    background: #1e1e2d;
    border-bottom-color: #1e1e2d;
    color: #fff;
}

.ld-tab-spacer {
    flex: 1;
}

/* Tab panels */
.ld-tab-panel {
    display: none;
}

.ld-tab-panel.active {
    display: block;
}

/* Form grid */
.ld-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .ld-form-grid { grid-template-columns: 1fr; }
}

.ld-form-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dde1e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.ld-form-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dde1e8;
}

.ld-form-section h3.ld-section-gap {
    margin-top: 28px;
}

.ld-field {
    margin-bottom: 12px;
}

.ld-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.ld-field input[type="text"],
.ld-field input[type="number"],
.ld-field input[type="datetime-local"],
.ld-field textarea,
.ld-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.ld-field textarea {
    resize: vertical;
}

.ld-field input:focus,
.ld-field textarea:focus,
.ld-field select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.ld-field-row {
    display: flex;
    gap: 15px;
}

.ld-field-row .ld-field {
    flex: 1;
}

/* Menu number — fixed small width so it doesn't stretch next to Friendly Title */
.ld-field-menu-number {
    flex: 0 0 80px !important;
    min-width: 0;
}

.ld-field-menu-number input {
    text-align: center;
}

/* Currency input wrapper */
.ld-currency-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.ld-currency-wrap:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.ld-currency-symbol {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: #f2f4f7;
    border-right: 1px solid #ddd;
    line-height: 34px;
    user-select: none;
}

.ld-currency-input {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 8px 10px !important;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    width: 100%;
    -moz-appearance: textfield;
}

.ld-currency-input::-webkit-outer-spin-button,
.ld-currency-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ld-currency-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Locked (non-draft) ticket count */
.ld-field-locked {
    background: #f4f4f4 !important;
    color: #888 !important;
    cursor: not-allowed !important;
}

/* Profit panel */
.ld-profit-panel {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #dde1e8;
}

.ld-profit-target {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ld-profit-target label {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.ld-profit-target-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ld-profit-target-row input[type="number"] {
    width: 72px;
    text-align: center;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.ld-profit-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f2f4f7;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ld-profit-btn:hover {
    background: #e2e8f0;
    border-color: #b0bac8;
}

.ld-profit-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 600px) {
    .ld-profit-stats { grid-template-columns: repeat(2, 1fr); }
}

.ld-profit-stat {
    background: #f8f9fb;
    border: 1px solid #dde1e8;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
}

.ld-profit-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.ld-profit-stat-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #222;
}

.ld-profit-positive { color: #1a7c3e !important; }
.ld-profit-negative { color: #b71c1c !important; }

.ld-check-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    cursor: pointer;
}

.ld-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Gallery */
.ld-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.ld-gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #fafafa;
    aspect-ratio: 1 / 1;
}

.ld-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ld-gallery-pos {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
}

/* Prizes */
.ld-prize-list {
    margin-bottom: 20px;
}

.ld-prize-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.ld-prize-item:hover {
    border-color: #3498db;
}

.ld-prize-item.selected {
    border-color: #3498db;
    background: #eaf4fd;
}

.ld-prize-name {
    flex: 1;
    font-weight: 500;
}

.ld-prize-cost {
    font-size: 13px;
    color: #666;
}

.ld-prize-detail {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.ld-prize-detail h4 {
    font-size: 16px;
    margin-bottom: 15px;
}

.ld-prize-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Winner */
.ld-winner-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 15px;
}

.ld-winner-info .ld-field label {
    color: #166534;
}

.ld-muted {
    color: #777;
    font-style: italic;
    font-size: 13px;
}

.iw-row-won td {
    color: #b71c1c;
}

.ld-pre-wrap {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 12px;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #ccc;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.ld-button-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Clickable table rows */
tr.clickable {
    cursor: pointer;
}

tr.clickable:hover {
    background: #eaf4fd !important;
}

/* ===== Instant Win Detail Page ===== */
.iwd-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.iwd-header .page-title {
    margin: 0;
    flex: 1;
}

.iwd-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iwd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 700px) {
    .iwd-grid { grid-template-columns: 1fr; }
}

.iwd-section {
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.iwd-section h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dde1e8;
    padding-bottom: 10px;
}

.iwd-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}

.iwd-row:last-child {
    border-bottom: none;
}

.iwd-label {
    color: #666;
    font-size: 12px;
    min-width: 90px;
    flex-shrink: 0;
}

.iwd-value {
    color: #222;
    font-weight: 500;
    word-break: break-word;
}

.iwd-value a {
    color: #3498db;
    text-decoration: none;
}

.iwd-value a:hover {
    text-decoration: underline;
}

.iwd-prize-name {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
}

.iwd-prize-cost {
    font-size: 18px;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 16px;
}

.iwd-status-block {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.iwd-status-text {
    font-size: 15px;
    font-weight: 600;
    color: #555;
}

.iwd-status-info {
    font-size: 13px;
    color: #555;
}

/* Action buttons section */
.iwd-actions {
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.iwd-actions h3 {
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dde1e8;
    padding-bottom: 10px;
}

.iwd-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Confirm panel */
.iwd-panel {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.iwd-panel h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #7b5800;
    font-weight: 700;
}

.iwd-panel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.iwd-panel label {
    font-size: 13px;
    color: #7b5800;
    min-width: 80px;
}

.iwd-panel input[type="text"],
.iwd-panel input[type="number"] {
    border: 1px solid #ffe082;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    width: 120px;
    background: #fffde7;
}

.iwd-panel .iwd-alt-total {
    font-size: 15px;
    font-weight: 700;
    color: #27ae60;
    margin: 8px 0 12px 0;
}

.iwd-panel-buttons {
    display: flex;
    gap: 8px;
}

/* Alt panel */
.iwd-alt-panel {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}

.iwd-alt-panel h4 {
    color: #1b5e20;
}

.iwd-alt-panel label {
    color: #2e7d32;
}

.iwd-alt-panel input[type="text"],
.iwd-alt-panel input[type="number"] {
    border-color: #a5d6a7;
    background: #f1f8e9;
}

.iwd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    color: #888;
}

.iwd-listing-pic {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

/* ===== Pagination ===== */
#iwPager {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    font-size: 13px;
}

.btn-pager {
    padding: 5px 14px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-pager:disabled {
    background: #ccc;
    cursor: default;
}

/* ==================== Sales Data Page ==================== */

.sd-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.sd-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sd-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.sd-date-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
}

.sd-checks {
    gap: 14px;
    flex-wrap: wrap;
}

.sd-check-label {
    font-size: 13px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.sd-check-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.sd-stats {
    margin-bottom: 20px;
}

.sd-chart-wrap {
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    min-height: 480px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

#sdChart {
    max-height: 540px;
    cursor: pointer;
}

.sd-empty {
    text-align: center;
    color: #666;
    font-size: 15px;
    padding: 60px 20px;
}

/* ===== ListingDetail Sales Chart ===== */
.ld-sales-controls {
    margin-top: 0;
}

.ld-sales-stats {
    margin-bottom: 20px;
}

.ld-sales-toggle {
    display: flex;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    overflow: hidden;
}

.ld-sales-toggle-btn {
    flex: 1;
    padding: 7px 18px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.ld-sales-toggle-btn:first-child {
    border-right: 1px solid #d0d0d0;
}

.ld-sales-toggle-btn.active {
    background: #1b66ff;
    color: #fff;
}

.ld-sales-toggle-btn:not(.active):hover {
    background: #f0f4ff;
    color: #1b66ff;
}

#ldSalesChart {
    max-height: 420px;
}

.ld-sales-raw {
    margin-top: 10px;
    margin-bottom: 10px;
}

.ld-sales-raw summary {
    cursor: pointer;
    font-size: 13px;
    color: #888;
    user-select: none;
    padding: 4px 0;
}

.ld-sales-raw summary:hover {
    color: #555;
}

.sd-stock-cards {
    margin-bottom: 20px;
}

.sd-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.sd-table-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.sd-table-close {
    font-size: 13px;
    padding: 4px 12px;
}

@media (max-width: 768px) {
    /* Statistics page — controls */
    .sd-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .sd-controls-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
    }

    .sd-date-input {
        width: 100%;
        font-size: 15px;
        padding: 8px 10px;
    }

    .sd-checks {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sd-stats,
    .sd-stock-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-chart-wrap {
        padding: 12px;
        min-height: 240px;
    }

    #sdChart {
        max-height: 220px;
    }

    #ldSalesChart {
        max-height: 220px;
    }

    .ld-sales-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-gap {
        margin-top: 28px;
    }

    /* Listing Detail — header stack */
    .ld-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ld-header .page-title {
        font-size: 18px;
    }

    .ld-header-right {
        flex-wrap: wrap;
    }

    .ld-button-row {
        flex-wrap: wrap;
    }

    /* Stock Detail — fix inline-width inputs */
    #sddEditName,
    #sddEditSupplier,
    #sddEditDescription {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* IWD header stack */
    .iwd-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .iwd-header-right {
        flex-wrap: wrap;
    }

    .iwd-action-buttons {
        flex-wrap: wrap;
    }

    /* Active campaign grid — single column */
    .mk-active-grid {
        grid-template-columns: 1fr;
    }

    /* Customers — stat grid 2 columns on small phones */
    .mk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Customers — list full height on mobile */
    .mk-customer-list {
        max-height: 340px;
    }

    /* Customers — detail grid single column */
    .mk-detail-grid {
        grid-template-columns: 1fr;
    }

    /* Customers — filter bar stretch date inputs */
    .mk-date-input {
        width: 100%;
    }

    .mk-result-count {
        margin-left: 0;
    }

    /* Campaign — summary bar wrap nicely */
    .mk-summary-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .mk-schedule-row {
        flex-wrap: wrap;
    }

    /* Campaign — num input full width when stacked */
    .mk-filter-sub {
        flex-wrap: wrap;
    }
}


/* ── Nav section header ────────────────────────────────────────────────── */
.nav-menu .nav-section-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    padding: 18px 20px 4px;
    pointer-events: none;
}

/* ── Marketing — Shared ────────────────────────────────────────────────── */
.mk-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.mk-search-input {
    flex: 1 1 220px;
    max-width: 320px;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.mk-date-input {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
}

.mk-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.mk-result-count {
    font-size: 12px;
    color: #666;
    margin-left: auto;
}

.mk-num-input {
    width: 70px;
    padding: 5px 7px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
}

/* ── Marketing — Statistics grid ──────────────────────────────────────── */
.mk-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.mk-stat-card {
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.mk-stat-label {
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.mk-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e1e2d;
}

/* ── Marketing — Customers layout ─────────────────────────────────────── */
.mk-content-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.mk-list-panel {
    flex: 0 0 340px;
    min-width: 240px;
}

.mk-detail-panel {
    flex: 1;
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* ── Customer List ─────────────────────────────────────────────────────── */
.mk-customer-list {
    border: 1px solid #dde1e8;
    border-radius: 6px;
    overflow-y: auto;
    max-height: 600px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.mk-customer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
    font-size: 13px;
    transition: background 0.1s;
}

.mk-customer-item:last-child { border-bottom: none; }
.mk-customer-item:hover { background: #f5f8ff; }
.mk-customer-item.mk-selected { background: #e8f0fe; }

.mk-opt-in  .mk-cust-name { color: #1a6b1a; }
.mk-opt-out .mk-cust-name { color: #b00000; }

.mk-cust-spend {
    font-size: 12px;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
}

.mk-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.mk-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
}

/* ── Customer Detail Panel ─────────────────────────────────────────────── */
.mk-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.mk-detail-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1e1e2d;
}

.mk-detail-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
}

.mk-detail-warning {
    background: #fff8e1;
    border: 1px solid #f0c040;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 12px;
    color: #7a5900;
    margin-bottom: 14px;
}

.mk-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.mk-detail-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    margin: 0 0 8px;
    border-bottom: 1px solid #dde1e8;
    padding-bottom: 4px;
}

.mk-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #333;
}

.mk-detail-row span:first-child {
    color: #555;
    font-size: 12px;
}

/* ── Preferences Section ───────────────────────────────────────────────── */
.mk-prefs-section {
    border-top: 1px solid #eee;
    padding-top: 14px;
}

.mk-prefs-section h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #1e1e2d;
}

.mk-prefs-section .mk-check-label {
    margin-right: 20px;
}

.mk-prefs-actions {
    margin-top: 12px;
}

/* ── Campaign Page ─────────────────────────────────────────────────────── */
.mk-campaign-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

/* Each column stacks its panels vertically */
.mk-campaign-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.mk-campaign-panel {
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.mk-campaign-panel h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
    margin: 0 0 14px;
    border-bottom: 1px solid #dde1e8;
    padding-bottom: 6px;
}

.mk-campaign-panel h3 + h3,
.mk-campaign-panel h3 ~ h3 {
    margin-top: 22px;
}

/* ── Filter blocks ─────────────────────────────────────────────────────── */
.mk-filter-block {
    margin-bottom: 10px;
}

.mk-filter-sub {
    margin-top: 6px;
    margin-left: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #444;
}

/* ── Message composer ──────────────────────────────────────────────────── */
.mk-msg-block {
    margin-bottom: 16px;
}

.mk-sms-input {
    width: 100%;
    min-height: 180px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.mk-sms-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.mk-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.mk-msg-header label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.mk-char-count {
    font-size: 12px;
    color: #888;
}

/* ===== Instant Win Creator ===== */
.iw-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.iw-list-col,
.iw-editor-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* List header */
.iw-list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.iw-list-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e1e2d;
    white-space: nowrap;
}

.iw-filter-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 13px;
}

.iw-filter-input:focus {
    outline: none;
    border-color: #1b66ff;
}

/* Prize list */
.iw-prize-list {
    border: 1px solid #dde1e8;
    border-radius: 8px;
    background: #fff;
    min-height: 240px;
    max-height: 840px;
    overflow-y: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.iw-prize-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}

.iw-prize-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.iw-prize-thumb--empty {
    background: #f3f3f3;
}

.iw-prize-row:last-child {
    border-bottom: none;
}

.iw-prize-row:hover {
    background: #f7f9ff;
}

.iw-prize-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iw-prize-meta {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
}

.iw-prize-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.iw-btn-edit,
.iw-btn-delete {
    padding: 3px 9px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s;
}

.iw-btn-edit {
    background: #e8f0fe;
    color: #1b66ff;
}

.iw-btn-edit:hover {
    background: #ccdafd;
}

.iw-btn-delete {
    background: #fde8e8;
    color: #d32f2f;
    font-size: 14px;
    line-height: 1;
}

.iw-btn-delete:hover {
    background: #fcc;
}

/* Stats strip */
.iw-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 10px;
}

.iw-stat {
    background: #f7f8fc;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
}

.iw-stat-label {
    font-size: 11px;
    color: #555;
    margin-bottom: 3px;
}

.iw-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #1e1e2d;
}

/* List action row */
.iw-list-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .iw-layout {
        grid-template-columns: 1fr;
    }

    .iw-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .iw-prize-list {
        max-height: 560px;
    }
}
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}

.mk-msg-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Schedule block ────────────────────────────────────────────────────── */
.mk-schedule-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mk-schedule-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.mk-schedule-row label {
    width: 90px;
    color: #666;
    font-size: 12px;
    flex-shrink: 0;
}

.mk-time-display {
    font-size: 16px;
    font-weight: 700;
    color: #1e1e2d;
    min-width: 48px;
    text-align: center;
}

.mk-eta-label {
    margin-left: 10px;
    font-size: 12px;
    color: #666;
}

/* ── Campaign Stats Panel (Recipients / Cost / Balance) ────────────────── */
.mk-campaign-panel--stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mk-summary-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mk-summary-label {
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    min-width: 110px;
}

.mk-summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e1e2d;
}

.mk-summary-value.mk-cost-over {
    color: #b00000;
}

/* ── Campaign Launch Panel ──────────────────────────────────────────────── */
.mk-campaign-panel--launch {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mk-start-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
}

/* ── Active Campaign Panel ─────────────────────────────────────────────── */
.mk-active-campaign {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

/* Header */
.mk-active-header {
    background: #1e1e2d;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mk-active-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mk-active-title h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.2px;
}

/* Pulsing live dot */
.mk-active-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    animation: mk-pulse 1.6s ease-in-out infinite;
}

@keyframes mk-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.75); }
}

.mk-active-status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #1e1e2d;
    background: #f0c040;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Progress section */
.mk-active-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mk-active-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.mk-active-progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 99px;
    overflow: hidden;
}

.mk-active-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3699ff, #1e88e5);
    border-radius: 99px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.mk-active-progress-fill--complete {
    background: linear-gradient(90deg, #4caf50, #388e3c);
}

.mk-active-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: #444;
    font-weight: 600;
}

.mk-active-progress-pct {
    font-size: 13px;
    font-weight: 700;
    color: #3699ff;
}

.mk-active-progress-fill--complete ~ .mk-active-progress-meta .mk-active-progress-pct {
    color: #4caf50;
}

/* Info stats row */
.mk-active-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #f0f0f0;
}

.mk-active-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 20px;
    border-right: 1px solid #f0f0f0;
}

.mk-active-stat:last-child {
    border-right: none;
}

.mk-active-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.mk-active-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e1e2d;
    line-height: 1.1;
}

.mk-active-stat-value--sm {
    font-size: 14px;
}

.mk-active-stat-value span {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    margin-left: 2px;
}

/* Messages */
.mk-active-messages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #f0f0f0;
}

.mk-active-msg-block {
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mk-active-msg-block:first-child {
    border-right: 1px solid #f0f0f0;
}

.mk-active-msg-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.mk-active-msg-text {
    margin: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

/* Actions */
.mk-active-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .mk-content-row { flex-direction: column; }
    .mk-list-panel { flex: none; width: 100%; }
    .mk-detail-panel { flex: none; width: 100%; box-sizing: border-box; }
    .mk-filter-bar { flex-direction: column; align-items: stretch; }
    .mk-search-input { flex: none; width: 100%; max-width: 100%; box-sizing: border-box; }
    .mk-result-count { margin-left: 0; }
    .mk-stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Campaign — each column goes full width and stacks */
    .mk-campaign-row { flex-direction: column; }
    .mk-campaign-col { width: 100%; }

    /* Campaign panel — tighter padding on small screens */
    .mk-campaign-panel { padding: 14px; }

    /* Filter sub-rows — reduce indent and let inputs grow */
    .mk-filter-sub { margin-left: 10px; gap: 6px; }
    .mk-filter-sub .mk-num-input { width: auto; flex: 1; min-width: 60px; max-width: 120px; }

    /* Schedule rows — stack label above controls */
    .mk-schedule-row { flex-wrap: wrap; }
    .mk-schedule-row label { width: 100%; margin-bottom: 2px; }

    /* Date input full-width on mobile */
    .mk-schedule-row .mk-date-input { flex: 1; width: 100%; box-sizing: border-box; }

    /* Delay row — keep num input constrained */
    .mk-schedule-row .mk-num-input { width: 90px; }

    /* ETA label on its own line */
    .mk-eta-label { margin-left: 0; width: 100%; }

    /* SMS textarea — taller on mobile */
    .mk-sms-input { height: 150px; min-height: 150px; }

    /* Message action buttons — each button stretches to fill row */
    .mk-msg-actions { gap: 6px; }
    .mk-msg-actions .btn-secondary { flex: 1 1 calc(50% - 6px); text-align: center; }

    /* Active campaign panel */
    .mk-active-stats { grid-template-columns: repeat(3, 1fr); }
    .mk-active-stat { padding: 10px 14px; }
    .mk-active-stat-value { font-size: 16px; }
    .mk-active-section { padding: 12px 14px; }
    .mk-active-messages { grid-template-columns: 1fr; }
    .mk-active-msg-block:first-child { border-right: none; border-bottom: 1px solid #f0f0f0; }
    .mk-active-actions { padding: 12px 14px; }

    /* Stats panel — larger values on mobile */
    .mk-summary-stat { gap: 6px; }
    .mk-summary-value { font-size: 22px; }
}

/* ── Loading spinner ───────────────────────────────────────────────────── */
.mk-loading {
    padding: 30px 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mk-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #555;
    border-radius: 50%;
    animation: mk-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@-webkit-keyframes mk-spin { to { -webkit-transform: rotate(360deg); } }
@keyframes mk-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Page title row (title + action button side by side)
   ===================================================================== */
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.page-title-row .page-title {
    margin: 0;
}

@media (max-width: 768px) {
    .page-title-row {
        gap: 6px;
    }
}

/* =====================================================================
   Modal overlay / box
   ===================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #eee;
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: #333; }
.modal-body {
    padding: 18px 20px;
}
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid #eee;
}
.modal-error {
    flex: 1;
    color: #c0392b;
    font-size: 13px;
}

.input-invalid {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 2px rgba(192,57,43,.15);
}

.input-valid {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 2px rgba(39,174,96,.12);
}

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #c0392b;
}

/* Form rows inside modals */
.form-row {
    margin-bottom: 14px;
}
.form-row:last-child { margin-bottom: 0; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}
.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.18);
}
textarea.form-control { resize: vertical; }

/* =====================================================================
   Bulk action bar (stock selection)
   ===================================================================== */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2c3e50;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.bulk-count {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* Checkbox column in tables */
.th-check, .td-check {
    width: 36px;
    text-align: center;
    padding: 0 6px !important;
}

@media (max-width: 768px) {
    .th-check, .td-check {
        display: none !important;
    }
}

/* =====================================================================
   Create-from-stock prize list inside modal
   ===================================================================== */
.cfs-prize-list {
    margin-bottom: 14px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 6px 10px;
}
.cfs-prize-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.cfs-prize-item:last-child { border-bottom: none; }
.cfs-prize-name { color: #333; font-weight: 500; }
.cfs-prize-cost { color: #27ae60; font-weight: 600; margin-left: 10px; white-space: nowrap; }

/* Mobile — full-width modals */
@media (max-width: 480px) {
    .modal-box { max-width: 100%; }
    .bulk-bar { gap: 8px; }
}

/* =====================================================================
   Template picker modal — wide box + card grid
   ===================================================================== */
.modal-box-wide {
    max-width: 820px;
}
.modal-box-wide .modal-body {
    max-height: 65vh;
    overflow-y: auto;
}

/* Grid of template cards */
.tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.tp-card {
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    display: flex;
    flex-direction: column;
    outline: none;
}
.tp-card:hover,
.tp-card:focus {
    border-color: #1b66ff;
    box-shadow: 0 2px 10px rgba(27,102,255,0.18);
}

.tp-card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background: #f3f3f3;
    flex-shrink: 0;
}
.tp-card-img-placeholder {
    background: #ebebeb;
}

.tp-card-body {
    padding: 8px 10px 10px;
    flex: 1;
}
.tp-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e1e2d;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tp-card-meta {
    font-size: 12px;
    color: #666;
}

/* Empty / loading state */
.tp-empty {
    padding: 28px 10px;
    text-align: center;
    color: #888;
    font-size: 13px;
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .modal-box-wide { max-width: 100%; }
    .tp-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .tp-card-img { height: 90px; }
}

/* =====================================================================
   Draw action buttons bar (between stats panel and search/filter row)
   ===================================================================== */
.listings-actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

#drawActionsRow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .listings-actions-bar {
        justify-content: center;
    }

    #drawActionsRow {
        gap: 6px;
    }

    .listings-actions-bar .btn,
    #drawActionsRow .btn {
        flex: 0 0 auto;
    }
}

/* =====================================================================
   Narrow modal (Set Draw Offset)
   ===================================================================== */
.modal-box-narrow {
    max-width: 380px;
}

/* =====================================================================
   Modal hint text
   ===================================================================== */
.modal-hint {
    font-size: 13px;
    color: #888;
    margin: 0 0 10px;
}

/* =====================================================================
   Toast notifications
   ===================================================================== */
.bk-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #2ecc71;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
}
.bk-toast.bk-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.bk-toast.bk-toast-error {
    background: #e74c3c;
}

