/* Closed Tickets styles extracted from provided markup */
:root {
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --border: #e8eaed;
    --text-primary: #1a1d26;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent-green: #22c55e;
    --accent-green-bg: #dcfce7;
    --accent-green-ring: #bbf7d0;
    --accent-orange: #f97316;
    --accent-orange-hover: #ea580c;
    --radius: 4px;
    --radius-sm: 4px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border: #e8eaed;
    --text-primary: #1a1d26;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent-green: #22c55e;
    --accent-green-bg: #dcfce7;
    --accent-orange: #f97316;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
} */

/*body {
    font-family:
        "DM Sans",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}*/

._closed-ticket-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.closedtickets-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.closedtickets-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    /* overflow: hidden; */
}

.closedtickets-main {
    display: flex;
    flex: 1;
    min-width: 0;
    /* overflow: hidden; */
}

.closedtickets-sidebar {
    display: flex;
    flex-direction: column;
    width: 320px;
    flex: 0 0 auto;
    border-right: 1px solid var(--bs-border-color);
    background: #ffffff;
    transition: width 0.18s ease;
    position: relative;
}

.closedtickets-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background-color: var(--bs-body-bg);
    height: 100%;
    min-height: 0;
}

.closedtickets-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

    .closedtickets-body .closedtickets-content-wrapper {
        flex: 1;
        min-width: 0;
    }

.closedtickets-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--bs-border-color);
    padding: var(--px-16) var(--px-24);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
    height: auto;
    min-height: 0;
}

.closedtickets-header-left {
    display: flex;
    align-items: center;
    gap: var(--px-16);
}

.closedtickets-back-btn {
    position: static;
    padding: var(--px-8, 8px);
    background: none;
    border: none;
    border-radius: var(--px-8, 8px);
    cursor: pointer;
    transition: background-color 0.2s;
    color: #6b7280;
}

    .closedtickets-back-btn:hover {
        background-color: var(--bs-body-bg);
    }

.closedtickets-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-text);
}

.closedtickets-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: var(--px-2, 2px);
    font-weight: 400;
}

.closedticket-settings-header-right {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.date-nav-filter-row{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end; 
    gap: 12px; 
    width: auto;
    flex: 1 1 auto;
    flex-wrap: nowrap;
}

.toolWrapper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.closedtickets-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 0 24px 16px;
    background-color: #ffffff;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-closed-ticket {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
    width: 20px;
    height: 20px;
}

.search-bar {
    width: 280px;
    height: 40px;
    padding: 0 12px 0 40px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background-color: #f9f9f9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

    .search-bar:focus {
        outline: none;
        border-color: #10b981;
        background-color: #ffffff;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

.search-wrapper:focus-within .search-icon-closed-ticket {
    color: #10b981;
}


/* Calendar picker wrapper & button */
.calendar-picker-wrapper {
    position: relative;
}

.date-calendar-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
}

    .date-calendar-btn:hover {
        background-color: var(--bs-body-bg);
        border-color: var(--accent-orange);
        color: var(--accent-orange);
    }

    .date-calendar-btn:active {
        transform: scale(0.95);
    }

/* Calendar dropdown (cuốn lịch) */
.calendar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 12px;
    display: none;
    flex-direction: column;
    z-index: 1001;
}

    .calendar-dropdown.is-open {
        display: flex;
    }

/* Calendar header: prev / month-year / next */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 4px 0;
}

.calendar-month-year {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

/* Reset override từ site.css button cho nút tháng */
.calendar-dropdown .calendar-prev-btn,
.calendar-dropdown .calendar-next-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    background: transparent !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

    .calendar-dropdown .calendar-prev-btn:hover,
    .calendar-dropdown .calendar-next-btn:hover {
        background-color: var(--bs-body-bg) !important;
        border-color: var(--accent-orange);
        color: var(--accent-orange) !important;
    }

    .calendar-dropdown .calendar-prev-btn:active,
    .calendar-dropdown .calendar-next-btn:active {
        transform: scale(0.95);
        background: #e5e7eb !important;
    }

/* Weekday labels */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
    text-align: center;
}

    .calendar-weekdays span {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
    }

/* Calendar days grid - tránh chồng chất, ô rõ ràng */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    min-width: 0;
}

/* Reset override từ site.css button (màu xanh, height cố định): ô lịch dùng style riêng */
.calendar-dropdown .calendar-day {
    /* Reset global button (site.css) */
    height: auto;
    min-height: 32px;
    width: 100%;
    min-width: 0;
    padding: 0;
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    aspect-ratio: 1;
    min-width: 32px;
    box-sizing: border-box;
}

    .calendar-dropdown .calendar-day:hover {
        background-color: var(--bs-body-bg) !important;
        color: var(--accent-orange) !important;
    }

    .calendar-dropdown .calendar-day.other-month {
        color: var(--text-muted) !important;
    }

    /* Today: xanh dương để phân biệt với selected (cam) */
    .calendar-dropdown .calendar-day.today {
        background-color: var(--bs-main, #1877f3) !important;
        color: #fff !important;
    }

        .calendar-dropdown .calendar-day.today:hover {
            background-color: var(--bs-main-700, #1562e0) !important;
            color: #fff !important;
        }

    /* Selected (Today btn / Yesterday btn / pick từ lịch): cam nhạt */
    .calendar-dropdown .calendar-day.selected {
        background-color: rgba(249, 115, 22, 0.15) !important;
        color: var(--accent-orange) !important;
        font-weight: 700;
    }

        .calendar-dropdown .calendar-day.selected:hover {
            background-color: rgba(249, 115, 22, 0.25) !important;
            color: var(--accent-orange) !important;
        }

    /* Today đồng thời được selected → giữ xanh dương (today thắng) */
    .calendar-dropdown .calendar-day.today.selected {
        background-color: var(--bs-main, #1877f3) !important;
        color: #fff !important;
        font-weight: 700;
    }

    .calendar-dropdown .calendar-day.empty {
        cursor: default;
        visibility: hidden;
        pointer-events: none;
    }

.calendar-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #acaeb1;
    border-radius: 8px;
    background-color: #f9ff31;
    color: #728098;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
}

    .calendar-btn:hover {
        background-color: var(--bs-body-bg);
        border-color: var(--accent-orange);
        color: var(--accent-orange);
    }

    .calendar-btn:active {
        transform: scale(0.95);
    }

/* Date Navigation Wrapper */
.date-navigation-wrapper {
    position: relative;
}

/* Date Navigation Bar */
.date-navigation-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background-color: #ffffff;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    width: auto;
    max-width: 100%;
    flex-shrink: 1;
    justify-self: end;
    overflow: visible;
    height: 40px;
}

.date-nav-btn {
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-right: 1px solid var(--bs-border-color);
    border-radius: 0;
    background-color: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    overflow: visible;
    /* override site.css button overflow:hidden */
}

    .date-nav-btn:first-child {
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
    }

    .date-nav-btn:last-child {
        border-top-right-radius: 8px;
        border-bottom-right-radius: 8px;
        border-right: none;
        border-left: 1px solid var(--bs-border-color);
    }

    .date-nav-btn:hover {
        background-color: var(--bs-body-bg);
        color: #f97316;
    }

    .date-nav-btn:active {
        transform: scale(0.95);
    }

.date-today-btn,
.date-preset-select {
    height: 40px;
    padding: 0 12px;
    border: none;
    border-right: 1px solid var(--bs-border-color);
    border-radius: 0;
    background-color: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    outline: none;
    appearance: auto;
}

    .date-today-btn:hover,
    .date-preset-select:hover {
        background-color: var(--bs-body-bg);
        color: #1e293b;
    }

    .date-today-btn.active {
        background-color: transparent;
        color: #1e293b;
    }

.date-display {
    font-size: 14px;
    font-weight: 500;
    color: #f97316;
    padding: 0 12px;
    white-space: nowrap;
    user-select: none;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    flex: 0 0 260px;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-display-clickable {
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

    .date-display-clickable:hover {
        background-color: rgba(249, 115, 22, 0.1);
    }

    .date-display-clickable:focus {
        outline: none;
        /* box-shadow: 0 0 0 2px var(--accent-orange); */
    }

/* ---- Period Select (GiftCardManager style) ---- */
.period-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.period-select {
    height: 40px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    background: #ffffff;
    color: var(--bs-text, #1e293b);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 80px;
}

.period-select:hover,
.period-select:focus {
    border-color: #9ca3af;
}

.select-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
}

.filter-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background-color: #22c55e;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

    .filter-icon-btn svg {
        stroke: #ffffff;
    }

    .filter-icon-btn:hover {
        background-color: #16a34a;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .filter-icon-btn:active {
        transform: scale(0.95);
    }

.filter-dropdown-wrapper {
    position: relative;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-height: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

    .filter-dropdown.is-open {
        display: flex;
    }

    /* Custom scrollbar styling */
    .filter-dropdown::-webkit-scrollbar {
        width: 8px;
    }

    .filter-dropdown::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
        margin: 10px 0;
    }

    .filter-dropdown::-webkit-scrollbar-thumb {
        background: #d6d6d6;
        border-radius: 10px;
        transition: background 0.2s;
    }

        .filter-dropdown::-webkit-scrollbar-thumb:hover {
            background: #888282;
        }

.filter-section {
    padding: 15px;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
}

    .filter-section:last-of-type {
        border-bottom: none;
    }

.filter-section-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

    .filter-section-header span {
        display: flex;
        align-items: center;
    }

    .filter-section-header:hover {
        background: var(--bs-body-bg);
    }

.section-arrow {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.filter-options:not(.is-expanded) ~ .filter-section-header .section-arrow,
.filter-options.is-expanded + .filter-section-header .section-arrow {
    transform: rotate(0deg);
}

.filter-section-header + .filter-options:not(.is-expanded) {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
}

.filter-section-header:has(+ .filter-options:not(.is-expanded)) .section-arrow {
    transform: rotate(-90deg);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

    .filter-options.is-expanded {
        max-height: 500px;
        opacity: 1;
    }

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

    .filter-option:hover {
        background: var(--bs-body-bg);
    }

    .filter-option input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        visibility: visible !important;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        border: 2px solid var(--bs-border-color);
        border-radius: 4px;
        background-color: #ffffff;
        position: relative;
        transition: all 0.2s;
        flex-shrink: 0;
    }

        .filter-option input[type="checkbox"]:hover {
            border-color: var(--accent-green);
        }

        .filter-option input[type="checkbox"]:checked {
            background-color: var(--accent-green);
            border-color: var(--accent-green);
        }

            .filter-option input[type="checkbox"]:checked::after {
                content: '';
                position: absolute;
                left: 5px;
                top: 2px;
                width: 4px;
                height: 8px;
                border: solid white;
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }

    .filter-option span {
        font-size: 14px;
        font-weight: 500;
        color: var(--text-primary);
        user-select: none;
    }

.filter-apply-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent-green);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

    .filter-apply-btn:hover {
        background: #16a34a;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    }

    .filter-apply-btn:active {
        transform: translateY(0);
    }

/* Date Filter Buttons */
.date-filter-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .date-filter-btn:hover {
        border-color: var(--accent-orange);
        color: var(--accent-orange);
    }

    .date-filter-btn.active {
        background-color: var(--accent-orange);
        border-color: var(--accent-orange);
        color: #ffffff;
    }

        .date-filter-btn.active:hover {
            background-color: var(--accent-orange-hover);
            border-color: var(--accent-orange-hover);
        }

/* Date Filter Buttons */
.date-filter-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .date-filter-btn:hover {
        border-color: var(--accent-orange);
        color: var(--accent-orange);
    }

    .date-filter-btn.active {
        background-color: var(--accent-orange);
        border-color: var(--accent-orange);
        color: #ffffff;
    }

        .date-filter-btn.active:hover {
            background-color: var(--accent-orange-hover);
            border-color: var(--accent-orange-hover);
        }


/* Loading indicator */
.ticket-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Empty state */
.ticket-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 64px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* List wrapper */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 16px 0;
    flex: 1;
    width: 100%;
}

/* Single ticket card */
.ticket-card {
    background: #ffffff;
    border-bottom: 1px solid #c8cbd0;
    padding: 14px 20px;
    transition: background 0.15s;
    position: relative; /* anchor for tip popup */
}

    .ticket-card.ticket-card--cancelled {
        background: #fff6f6
    }

    .ticket-card.ticket-card--voided {
        background: #fffbe5;
    }

    .ticket-card:first-child {
        border-top: 1px solid #c8cbd0;
    }

    .ticket-card:hover {
        background: #fafafa;
    }

    .ticket-card.ticket-card--cancelled:hover {
        background: #ffdede;
    }

    .ticket-card.ticket-card--voided:hover {
        background: #fff3b3;
    }

/* Load More Button Wrapper */
.ticket-load-more-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px 0px 0px;
    margin-top: 8px;
}

.ticket-load-more-btn {
    padding: 10px 24px;
    background-color: #ffffff;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

    .ticket-load-more-btn:hover {
        background-color: var(--bs-body-bg);
        border-color: #cbd5e1;
        color: #1e293b;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .ticket-load-more-btn:active {
        transform: scale(0.98);
    }

.ticket-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ticket-appt-badge {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #5dd33e;
    background: #deffd7;
    color: #21b206;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    user-select: none;
}

.ticket-info-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ticket-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 24px;
}

.ticket-content--with-photos .ticket-info-left {
    flex: 0 1 180px;
}

.ticket-photo-list {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.ticket-photo-thumbnail {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .ticket-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ticket-content--with-photos .ticket-info-left {
        flex: 1 1 auto;
    }

    .ticket-photo-list {
        gap: 10px;
    }

    .ticket-photo-thumbnail {
        width: 48px;
        height: 48px;
    }
}

.ticket-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.ticket-id {
    color: #343b43;
    font-weight: 400;
}

.ticket-photo-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #e8f2ff;
    color: #2563eb;
}

.ticket-action-btn .ticket-photo-indicator svg {
    stroke: currentColor;
}

.ticket-customer-name {
    color: var(--bs-text);
    font-weight: 700;
    opacity: 1;
    display: inline-flex;
    align-items: center;
}

.ticket-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}

.ticket-status-dot--green {
    background-color: #22c55e;
}

.ticket-status-dot--red {
    background-color: #ef4444;
}

.ticket-subtitle {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

.ticket-subtitle-value {
    color: #64748b;
    font-weight: 500;
}

.ticket-info-right {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ticket-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-green);
}

.ticket-tip {
    font-size: 13px;
    font-weight: 500;
    color: #000000eb;
}

.ticket-tip--clickable {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

    .ticket-tip--clickable:hover {
        color: var(--bs-text);
    }

.ct-tip-popup {
    position: absolute;
    z-index: 2200;
    top: 0;
    left: 0;
}

.ct-tip-popup-inner {
    min-width: 140px;
    max-width: 220px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 16px 50px rgba(0,0,0,0.18);
    font-size: 12px;
    line-height: 1.3;
    color: var(--bs-text);
}

.ct-tip-line {
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-tip-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ct-tip-divider {
    height: 1px;
    background: rgba(17, 24, 39, 0.12);
    margin: 8px 0;
}

.ct-tip-k {
    font-weight: 800;
}

.ct-tip-v {
    font-weight: 600;
}

.ct-tip-sep {
    margin-top: 6px;
    opacity: 0.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.ct-tip-empty {
    font-weight: 600;
    opacity: 0.8;
}

.ticket-payment-mode {
    font-size: 12px;
    color: #030405;
}

.ticket-meta {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* -------------------------------------------------------
   Receipt modal (Closed Tickets - View Details)
------------------------------------------------------- */
.ct-receipt-lock {
    overflow: hidden !important;
}

.ct-receipt-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

    .ct-receipt-modal.is-open {
        display: block;
    }

.ct-receipt-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.ct-receipt-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ct-receipt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--bs-border-color);
    background: #fff;
}

.ct-receipt-header-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--bs-text);
}

.ct-receipt-close {
    width: 32px;
    height: 32px;
    border: 1px solid #111827;
    border-radius: 9999px;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--bs-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    /* override site.css */
}

    .ct-receipt-close:hover {
        background: var(--bs-body-bg);
        color: var(--bs-text);
    }

.ct-receipt-body {
    padding: 14px;
    overflow: auto;
    /* background: #fafafa; */
}

.ct-receipt-photos[hidden] {
    display: none;
}

.ct-receipt-photos .tr-photos {
    padding: 12px 14px;
}

.ct-receipt-footer {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--bs-border-color);
    background: #fff;
}

.ct-receipt-btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    overflow: visible;
    /* override site.css */
}

.ct-receipt-btn-secondary {
    background: #ffffff;
    color: var(--bs-text);
    border: 1px solid #c7cbd1;
}

.ct-receipt-btn-primary {
    background: var(--bs-main);
    color: #fff;
}

.ct-receipt-loading,
.ct-receipt-error {
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: #374151;
    text-align: center;
}

/* Receipt paper */
.ct-receipt-paper {
    background: #fff;
    /* border: 1px solid #e5e7eb; */
    border-radius: 12px;
    padding: 14px 14px 12px;
    color: var(--bs-text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.ct-receipt-logo {
    display: flex;
    justify-content: center;
    padding-top: 6px;
    padding-bottom: 8px;
}

    .ct-receipt-logo img {
        max-width: 120px;
        max-height: 40px;
        object-fit: contain;
    }

.ct-receipt-points-earned {
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
    margin-top: 2px;
}

.ct-receipt-points-current {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    color: #ef4444;
    line-height: 1.05;
    margin-top: 6px;
}

    .ct-receipt-points-current span {
        display: block;
        font-size: 20px;
        font-weight: 600;
        color: var(--bs-text);
        margin-top: 2px;
    }

.ct-receipt-member {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.ct-receipt-sep {
    border-top: 1px dashed var(--bs-border-color);
    margin: 10px 0;
}

.ct-receipt-sep-light {
    border-top-style: solid;
    border-top-color: var(--bs-border-color);
    margin: 8px 0;
}

.ct-receipt-kv {
    font-size: 12px;
    color: var(--bs-text);
    display: grid;
    gap: 6px;
}

.ct-receipt-kv-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ct-receipt-kv-label {
    min-width: 90px;
    flex-shrink: 0;
}

.ct-receipt-kv-value {
    flex: 1;
}

.ct-receipt-table-header {
    display: grid;
    grid-template-columns: 1fr 48px 107px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 700;
    align-items: center;
}

.ct-receipt-row {
    display: grid;
    grid-template-columns: 1fr 48px 96px;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--bs-text);
    align-items: start;
}

.ct-receipt-item-desc {
    font-weight: 700;
}

.ct-receipt-item-tech {
    color: #6b7280;
    margin-top: 2px;
}

.ct-receipt-total-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 3px 0;
    font-size: 12px;
}

.ct-receipt-total-strong {
    font-weight: 800;
    font-size: 13px;
    margin-top: 4px;
}

.ct-receipt-section-title {
    font-size: 12px;
    font-weight: 800;
    color: #6b7280;
    margin-bottom: 6px;
}

.ct-receipt-store {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.ct-muted {
    color: #6b7280;
    font-weight: 500;
}

.ct-right {
    text-align: right;
    white-space: nowrap;
    min-width: 96px;
    font-variant-numeric: tabular-nums;
}

.ct-center {
    text-align: center;
    white-space: nowrap;
    min-width: 48px;
    font-variant-numeric: tabular-nums;
}

/* Action buttons row */
.ticket-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-left: 50px;
}

.ticket-action-btn {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    white-space: nowrap !important;
    gap: 6px;
    height: auto !important;
    min-height: unset !important;
    padding: 6px 12px !important;
    background: #ffffff !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bs-text) !important;
    cursor: pointer;
    transition: all 0.15s;
}

    .ticket-action-btn svg {
        width: 15px;
        height: 15px;
        stroke: #212529;
    }

    .ticket-action-btn:hover {
        border-color: #cbd5e1 !important;
        color: #1e3a8a !important;
        background-color: var(--bs-body-bg) !important;
    }

        .ticket-action-btn:hover svg {
            stroke: #1e3a8a;
        }

    .ticket-action-btn:active {
        transform: scale(0.98);
        background-color: var(--bs-body-bg) !important;
    }

.ticket-action-refund {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

    .ticket-action-refund svg {
        stroke: #dc2626;
    }

    .ticket-action-refund:hover {
        border-color: #fca5a5 !important;
        color: #b91c1c !important;
        background-color: #fee2e2 !important;
    }

        .ticket-action-refund:hover svg {
            stroke: #b91c1c;
        }

    .ticket-action-refund:active {
        background-color: #fecaca !important;
    }

/* Scrollable content area */
.closedtickets-body {
    overflow: hidden;
}

.closedtickets-content-wrapper {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* -------------------------------------------------------
   Calendar: Week Range Highlight (This Week) — cam nhạt đồng đều
------------------------------------------------------- */

.calendar-dropdown .calendar-day.week-range {
    background-color: rgba(249, 115, 22, 0.15) !important;
    color: var(--accent-orange) !important;
    font-weight: 600;
    border-radius: 8px !important;
}

    .calendar-dropdown .calendar-day.week-range:hover {
        background-color: rgba(249, 115, 22, 0.25) !important;
        color: var(--accent-orange) !important;
    }

/* Today nằm trong tuần → giữ xanh dương */
.calendar-dropdown .calendar-day.today.week-range {
    background-color: var(--bs-main, #1877f3) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

/* Ticket Details Modal (slide from right) */
.ct-ticket-details-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

    .ct-ticket-details-modal.is-open {
        display: block;
    }

.ct-ticket-details-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.2s ease-out;
}

.ct-ticket-details-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(500px, calc(100vw - 40px));
    max-width: 90vw;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ct-ticket-details-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bs-border-color);
    background: #fff;
}

.ct-ticket-details-header-content {
    flex: 1;
}

.ct-ticket-details-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--bs-text);
    margin: 0 0 8px 0;
}

.ct-ticket-details-id {
    font-size: 14px;
    color: #f97316;
    font-weight: 600;
}

.ct-ticket-details-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bs-body-bg);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    transition: background 0.2s, color 0.2s;
}

    .ct-ticket-details-close:hover {
        background: #e5e7eb;
        color: var(--bs-text);
    }

.ct-ticket-details-body {
    padding: 24px;
    overflow-y: auto;
    background: #f5f6fa;
    flex: 1;
}

.ct-ticket-details-loading,
.ct-ticket-details-error {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.ct-ticket-status-badge {
    display: inline-block;
    padding: 8px 193px; /* Desktop look (fixed width) */
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    text-align: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 24px;
}

.ct-ticket-status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.ct-ticket-status-voided {
    background: #fee2e2;
    color: #dc2626;
}

.ct-ticket-status-not-payment {
    background: #fee2e2;
    color: #dc2626;
}

.ct-ticket-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.ct-ticket-section-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--bs-text);
    margin: 0 0 16px 0;
}

.ct-ticket-reason-box {
    background: var(--bs-body-bg);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

    .ct-ticket-reason-box input[type="checkbox"] {
        margin-top: 2px;
        cursor: default;
    }

    .ct-ticket-reason-box span {
        font-size: 14px;
        color: var(--bs-text);
        line-height: 1.5;
    }

.ct-ticket-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

    .ct-ticket-info-row:last-child {
        margin-bottom: 0;
    }

.ct-ticket-info-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    min-width: 120px;
}

.ct-ticket-info-value {
    font-size: 14px;
    color: #111827;
    text-align: right;
    flex: 1;
}

.ct-ticket-info-value-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

    .ct-ticket-info-value-group strong {
        font-size: 14px;
        color: #111827;
        font-weight: 700;
    }

.ct-ticket-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.ct-ticket-badge-appointment {
    background: #dbeafe;
    color: #1e40af;
}

.ct-ticket-badge-tech {
    background: #f3f4f6;
    color: #374151;
}

.ct-ticket-service-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.ct-ticket-service-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.ct-ticket-service-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ct-ticket-service-name {
    font-size: 14px;
    color: #222428c9;
    font-weight: 500;
}

.ct-ticket-service-time {
    font-size: 13px;
    color: #6b7280;
}

.ct-ticket-service-price {
    font-size: 14px;
    color: var(--bs-text);
    font-weight: 600;
    white-space: nowrap;
}

.ct-ticket-amount-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .ct-ticket-amount-section .ct-ticket-section-title {
        margin: 0;
    }

.ct-ticket-amount-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--bs-text);
}

.ct-ticket-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--bs-border-color);
}

.ct-ticket-footer-text {
    font-size: 14px;
    color: #76797e;
    margin-bottom: 4px;
    text-align: center;
}

    .ct-ticket-footer-text:last-child {
        margin-bottom: 0;
    }

body.ct-ticket-details-lock {
    overflow: hidden;
}


/* Receipt Action Modal UI */
.ct-receipt-action-modal-popup {
    position: fixed;
    z-index: 2105;
    top: 0;
    left: 0;
}

.ct-receipt-action-popover {
    width: 110px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    position: relative;
}

.ct-receipt-action-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    text-align: left;
}

    .ct-receipt-action-item:hover {
        background: rgba(17, 24, 39, 0.04);
    }

    .ct-receipt-action-item:active {
        transform: translateY(1px);
    }

.ct-receipt-action-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ct-receipt-action-icon svg {
        width: 18px;
        height: 18px;
        display: block;
        color: #6b7280;
    }

.ct-receipt-action-label {
    font-size: 13px;
    color: var(--bs-text);
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* SMS Popup (Receipt -> SMS) */
.ct-sms-popup {
    position: absolute;
    left: 50%;
    bottom: 62px; /* sits above footer buttons */
    transform: translateX(-50%);
    z-index: 2110;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    padding: 10px 12px 12px;
    min-width: 220px;
    text-align: center;
}

.ct-sms-popup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-text);
    margin-bottom: 2px;
}

.ct-sms-popup-phone {
    font-size: 14px;
    font-weight: 800;
    color: var(--bs-text);
    margin-bottom: 10px;
}

.ct-sms-popup-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.ct-sms-btn {
    height: 26px;
    padding: 0 10px;
    border-radius: 9999px;
    border: 0;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.4px;
    cursor: pointer;
}

    .ct-sms-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.ct-sms-btn-cancel {
    background: #f59e0b;
    color: #111827;
}

.ct-sms-btn-change {
    background: var(--bs-main);
    color: #ffffff;
}

.ct-sms-btn-confirm {
    background: #22c55e;
    color: #ffffff;
}

/* SMS Change Popup (Submit Your Phone Number) */
.ct-sms-change-popup {
    position: absolute;
    inset: 0;
    z-index: 2120;
}

.ct-sms-change-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
}

.ct-sms-change-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 28px));
    background: #fff;
    border-radius: 10px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.22);
    text-align: center;
}

.ct-sms-change-title {
    font-size: 28px;
    font-weight: 400;
    color: var(--bs-text);
    margin-bottom: 18px;
}

.ct-sms-change-input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    padding: 0 12px;
    font-size: 18px;
    outline: none;
}

    .ct-sms-change-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96,165,250,0.25);
    }

.ct-sms-change-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.ct-sms-change-btn {
    min-width: 140px;
    height: 44px;
    border-radius: 4px;
    border: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.ct-sms-change-btn-send {
    background: var(--bs-main);
    color: #fff;
}

.ct-sms-change-btn-cancel {
    background: #9ca3af;
    color: #fff;
}

/* Email Popup (Receipt -> Email) */
.ct-email-popup {
    position: absolute;
    left: 50%;
    bottom: 62px;
    transform: translateX(-50%);
    z-index: 2110;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    padding: 10px 12px 12px;
    min-width: 260px;
    text-align: center;
}

.ct-email-popup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-text);
    margin-bottom: 2px;
}

.ct-email-popup-email {
    font-size: 14px;
    font-weight: 800;
    color: var(--bs-text);
    margin-bottom: 10px;
    word-break: break-word;
}

.ct-email-popup-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.ct-email-btn {
    height: 26px;
    padding: 0 10px;
    border-radius: 9999px;
    border: 0;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.4px;
    cursor: pointer;
}

    .ct-email-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.ct-email-btn-cancel {
    background: #f59e0b;
    color: #111827;
}

.ct-email-btn-change {
    background: var(--bs-main);
    color: #ffffff;
}

.ct-email-btn-confirm {
    background: #22c55e;
    color: #ffffff;
}

/* Email Change Popup (Submit Your Email) */
.ct-email-change-popup {
    position: absolute;
    inset: 0;
    z-index: 2120;
}

.ct-email-change-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
}

.ct-email-change-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 28px));
    background: #fff;
    border-radius: 10px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.22);
    text-align: center;
}

.ct-email-change-title {
    font-size: 28px;
    font-weight: 400;
    color: var(--bs-text);
    margin-bottom: 18px;
}

.ct-email-change-input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    padding: 0 12px;
    font-size: 18px;
    outline: none;
}

    .ct-email-change-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96,165,250,0.25);
    }

.ct-email-change-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.ct-email-change-btn {
    min-width: 140px;
    height: 44px;
    border-radius: 4px;
    border: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.ct-email-change-btn-send {
    background: var(--bs-main);
    color: #fff;
}

.ct-email-change-btn-cancel {
    background: #9ca3af;
    color: #fff;
}

/* =======================================================
   RESPONSIVE DESIGN FOR CLOSED TICKETS (TABLET & MOBILE)
======================================================= */

@media (max-width: 768px) {
    .closedtickets-header {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px 16px !important;
        gap: 12px !important;
    }

    .closedtickets-header-left {
        width: 100% !important;
        margin: 0 !important;
        gap: 12px !important;
    }

    .closedtickets-back-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }

    .closedtickets-title {
        font-size: 17px !important;
        font-weight: 700 !important;
    }

    .closedtickets-subtitle {
        font-size: 12px !important;
        margin-top: 1px !important;
    }

    .closedticket-settings-header-right {
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .search-wrapper {
        width: 100% !important;
    }

    .search-bar {
        width: 100% !important;
        max-width: 100% !important;
        height: 38px !important;
        font-size: 13.5px !important;
        padding: 0 12px 0 38px !important;
    }

    .search-icon-closed-ticket {
        left: 11px !important;
        width: 18px !important;
        height: 18px !important;
    }

    .date-nav-filter-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .date-navigation-wrapper {
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        position: relative !important;
    }

    .date-navigation-bar {
        width: 100% !important;
        max-width: 100% !important;
        height: 38px !important;
        display: flex !important;
        align-items: stretch !important;
        border-radius: 8px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .date-nav-btn {
        min-width: 32px !important;
        width: 32px !important;
        height: 100% !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .date-nav-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .date-today-btn,
    .date-preset-select {
        height: 100% !important;
        padding: 0 6px !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        flex-shrink: 0 !important;
    }

    .date-display {
        height: 100% !important;
        padding: 0 4px !important;
        font-size: 11.5px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 0 !important;
        display: block !important;
        line-height: 38px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: center !important;
    }

    .filter-dropdown-wrapper {
        flex-shrink: 0 !important;
        position: relative !important;
    }

    .filter-icon-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .period-select-wrapper {
        flex-shrink: 0 !important;
    }

    .period-select {
        height: 38px !important;
        font-size: 11.5px !important;
        padding: 0 20px 0 6px !important;
        min-width: 58px !important;
        width: auto !important;
    }

    .calendar-dropdown {
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        width: min(320px, calc(100vw - 24px)) !important;
        margin: 0 auto !important;
        z-index: 1050 !important;
    }

    .filter-dropdown {
        width: min(300px, calc(100vw - 24px)) !important;
        right: 0 !important;
        z-index: 1050 !important;
        max-height: 70vh !important;
    }

    .closedtickets-content-wrapper {
        padding: 0 16px 12px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    .ticket-card {
        padding: 14px 14px !important;
    }

    .ticket-actions {
        padding-left: 0 !important;
        margin-top: 12px !important;
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .ticket-action-btn {
        flex: 1 1 0 !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 8px 10px !important;
        font-size: 12.5px !important;
        white-space: nowrap !important;
    }

    .ct-ticket-details-panel {
        width: min(480px, 100vw) !important;
    }
}

@media (max-width: 540px) {
    .closedtickets-header {
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    .closedtickets-header-left {
        gap: 8px !important;
    }

    .closedtickets-back-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    .closedtickets-back-btn svg {
        width: 20px !important;
        height: 20px !important;
    }

    .closedtickets-title {
        font-size: 16px !important;
    }

    .closedtickets-subtitle {
        font-size: 11.5px !important;
    }

    .search-bar {
        height: 36px !important;
        font-size: 13px !important;
        padding: 0 10px 0 36px !important;
    }

    .search-icon-closed-ticket {
        left: 10px !important;
        width: 16px !important;
        height: 16px !important;
    }

    .date-navigation-bar {
        height: 34px !important;
    }

    .date-nav-btn {
        min-width: 28px !important;
        width: 28px !important;
    }

    .date-nav-btn svg {
        width: 15px !important;
        height: 15px !important;
    }

    .date-today-btn,
    .date-preset-select {
        padding: 0 4px !important;
        font-size: 10px !important;
    }

    .date-display {
        font-size: 11px !important;
        padding: 0 2px !important;
        line-height: 34px !important;
    }

    .filter-icon-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }

    .period-select {
        height: 34px !important;
        font-size: 11px !important;
        padding: 0 16px 0 4px !important;
        min-width: 52px !important;
    }

    .filter-icon-btn svg {
        width: 17px !important;
        height: 17px !important;
    }

    .closedtickets-content-wrapper {
        padding: 0 8px 12px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    .ticket-list {
        padding: 0 0 50px 0 !important;
    }

    .ticket-load-more-wrapper {
        margin-top: 8px !important;
        padding: 12px 0 20px !important;
    }

    .ticket-card {
        padding: 12px 8px !important;
    }

    .ticket-card-main {
        display: flex !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .ticket-appt-badge {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 11px !important;
        margin-top: 2px !important;
    }

    .ticket-info-left {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        gap: 2px !important;
    }

    .ticket-title {
        font-size: 13px !important;
        margin-bottom: 2px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .ticket-id {
        font-size: 12.5px !important;
        font-weight: 500 !important;
        color: #4b5563 !important;
    }

    .ticket-customer-name {
        font-size: 13px !important;
        font-weight: 700 !important;
    }

    .ticket-subtitle {
        font-size: 11px !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .ticket-subtitle-value {
        color: #475569 !important;
        font-weight: 500 !important;
    }

    .ticket-info-right {
        flex-shrink: 0 !important;
        text-align: right !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 2px !important;
        min-width: 85px !important;
        max-width: 135px !important;
    }

    .ticket-amount {
        font-size: 15.5px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
    }

    .ticket-tip {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .ticket-meta {
        font-size: 10.5px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
    }

    .ticket-payment-mode {
        font-size: 10.5px !important;
        line-height: 1.25 !important;
        word-break: break-word !important;
    }

    .ticket-actions {
        padding-left: 0 !important;
        margin-top: 10px !important;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
        width: 100% !important;
    }

    .ticket-action-btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 6px 2px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        border-radius: 6px !important;
        gap: 4px !important;
    }

    .ticket-action-btn svg {
        width: 13px !important;
        height: 13px !important;
        flex-shrink: 0 !important;
    }

    /* Modal dialogs on mobile */
    .ct-ticket-details-panel {
        width: 100% !important;
        max-width: 100% !important;
    }

    .ct-ticket-details-header {
        padding: 14px 16px !important;
    }

    .ct-ticket-details-title {
        font-size: 16px !important;
    }

    .ct-ticket-details-body {
        padding: 14px 12px !important;
    }

    .ct-receipt-dialog {
        width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 24px) !important;
        border-radius: 12px !important;
    }

    .ct-receipt-body {
        padding: 10px !important;
    }

    .ct-receipt-paper {
        padding: 10px 8px 8px !important;
    }

    .ct-receipt-footer {
        padding: 10px 12px !important;
    }

    .ct-receipt-btn {
        height: 38px !important;
        font-size: 12px !important;
    }

    .ct-email-change-panel,
    .ct-sms-change-panel {
        width: calc(100vw - 24px) !important;
        padding: 18px 14px !important;
    }

    .ct-email-change-title,
    .ct-sms-change-title {
        font-size: 20px !important;
        margin-bottom: 12px !important;
    }

    .ct-email-change-input,
    .ct-sms-change-input {
        height: 40px !important;
        font-size: 15px !important;
    }

    .ct-email-change-btn,
    .ct-sms-change-btn {
        min-width: 100px !important;
        height: 38px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 350px) {
    .ticket-actions {
        grid-template-columns: 1fr 1fr !important;
    }

    .ticket-action-refund {
        grid-column: 1 / -1 !important;
    }

    .date-today-btn {
        padding: 0 5px !important;
        font-size: 10px !important;
    }

    .date-display {
        font-size: 11px !important;
    }
}

/* =======================================================
   Closed Tickets redesign (2026-10-30)
   Header range picker, status tabs, summary cards, list/grid rows.
   Colours go through local custom properties so pos-theme.css only has to
   override the variables, not every rule.
   ======================================================= */

.closedtickets-container {
    --ct-canvas: #F5F6F8;
    --ct-surface: #FFFFFF;
    --ct-surface-2: #F9FAFB;
    --ct-track: #F3F4F6;
    --ct-border: #E5E7EB;
    --ct-border-soft: #EEF0F3;
    --ct-text: #111827;
    --ct-text-2: #4B5563;
    --ct-muted: #6B7280;
    --ct-accent: #15803D;
    --ct-accent-strong: #2E7D32;
    --ct-accent-soft: #E8F3E4;
    --ct-accent-ink: #1E5B22;
}

/* ---------- Header: period segmented control + range button ---------- */

.ct-range-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ct-period-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    padding: 4px;
    box-sizing: border-box;
    background: var(--ct-track);
    border: 1px solid var(--ct-border);
    border-radius: 12px;
}

.ct-period-btn {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ct-text-2);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .ct-period-btn.is-active {
        background: var(--ct-surface);
        color: var(--ct-text);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12);
    }

.ct-period-sep {
    width: 1px;
    height: 20px;
    margin: 0 6px;
    background: #D1D5DB;
}

.ct-range-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ct-text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ct-range-btn-cal { color: var(--ct-accent-strong); }
.ct-range-btn-chevron { color: var(--ct-muted); transition: transform 0.15s; }
.ct-range-btn[aria-expanded="true"] .ct-range-btn-chevron { transform: rotate(180deg); }

/* ---------- Date range picker ---------- */

.ct-range-panel {
    display: none;
    position: absolute;
    top: 52px;
    right: 0;
    z-index: 40;
    width: 760px;
    max-width: calc(100vw - 32px);
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16);
    overflow: hidden;
    flex-direction: column;
}

    .ct-range-panel.is-open { display: flex; }

.ct-range-panel-body {
    display: flex;
    flex-wrap: wrap;
}

.ct-preset-list {
    flex: 0 0 150px;
    padding: 12px;
    box-sizing: border-box;
    border-right: 1px solid var(--ct-border-soft);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ct-preset {
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ct-text-2);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

    .ct-preset.is-active {
        background: var(--ct-accent-soft);
        color: var(--ct-accent-ink);
        font-weight: 600;
    }

.ct-range-panel-main {
    flex: 1 1 520px;
    min-width: 0;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ct-draft-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: end;
}

.ct-draft-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ct-draft-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ct-text-2);
}

.ct-draft-value {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-size: 14px;
    color: var(--ct-text);
}

    .ct-draft-value svg { color: var(--ct-muted); flex-shrink: 0; }
    .ct-draft-value .is-placeholder { color: var(--ct-muted); }

.ct-draft-arrow {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ct-accent-strong);
}

.ct-months {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.ct-month {
    flex: 1 1 230px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ct-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
}

.ct-month-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ct-text);
}

.ct-month-nav {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .ct-month-nav:hover { background: var(--ct-track); }

.ct-month-nav-spacer { width: 36px; }

.ct-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    font-size: 12px;
    font-weight: 600;
    color: var(--ct-text-2);
    text-align: center;
}

.ct-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 4px;
}

.ct-day-band {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ct-day-band.is-in-range { background: var(--ct-accent-soft); }
    .ct-day-band.is-band-start { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
    .ct-day-band.is-band-end { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }

.ct-day {
    position: relative;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ct-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

    .ct-day:hover { background: rgba(46, 125, 50, 0.12); }

    .ct-day.is-today {
        color: var(--ct-accent-ink);
        font-weight: 700;
    }

    .ct-day.is-selected {
        background: var(--ct-accent-strong);
        color: #FFFFFF;
        font-weight: 700;
    }

.ct-range-panel-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--ct-border-soft);
}

.ct-draft-summary {
    font-size: 14px;
    color: var(--ct-muted);
}

    .ct-draft-summary strong { color: var(--ct-text); font-weight: 600; }

.ct-range-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-btn-ghost,
.ct-btn-outline,
.ct-btn-primary {
    height: 44px;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ct-btn-ghost {
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #374151;
}

.ct-btn-outline {
    padding: 0 18px;
    border: 1px solid #D1D5DB;
    border-radius: 999px;
    background: var(--ct-surface);
    color: var(--ct-text);
}

.ct-btn-primary {
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--ct-accent-strong);
    color: #FFFFFF;
    font-weight: 700;
}

/* ---------- Body layout: summary cards + panel ---------- */

.closedtickets-body {
    gap: 16px;
    padding: 16px 24px 0;
    background: var(--ct-canvas);
}

.ct-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    flex-shrink: 0;
}

.ct-kpi {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
}

.ct-kpi--loading {
    grid-column: 1 / -1;
    color: var(--ct-muted);
    font-size: 13px;
    align-items: center;
}

.ct-kpi-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ct-kpi-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ct-muted);
    white-space: nowrap;
}

.ct-kpi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .ct-kpi-dot.is-green { background: #16A34A; }
    .ct-kpi-dot.is-red { background: #B42318; border-radius: 2px; }

.ct-kpi-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ct-text);
    font-variant-numeric: tabular-nums;
}

.ct-kpi-sub {
    font-size: 12px;
    color: var(--ct-muted);
}

.ct-kpi-chart {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    flex-shrink: 0;
}

.ct-kpi-delta {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

    .ct-kpi-delta.is-good { background: #DCFCE7; color: #166534; }
    .ct-kpi-delta.is-bad { background: #FEE4E2; color: #B42318; }

.ct-spark { overflow: visible; }
    .ct-spark line { stroke: var(--ct-border-soft); stroke-width: 1; }
    .ct-spark polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
    .ct-spark-cur { stroke-width: 2; }
    .ct-spark-prev { stroke: #9CA3AF; stroke-width: 1.5; stroke-dasharray: 3 3; }

.ct-kpi-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--ct-muted);
    white-space: nowrap;
}

.ct-kpi-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.ct-kpi-legend-cur { width: 12px; height: 2px; border-radius: 2px; }
.ct-kpi-legend-prev { width: 12px; height: 0; border-top: 1.5px dashed #9CA3AF; }

.ct-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.ct-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ct-border);
    flex-shrink: 0;
}

.ct-panel-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.ct-sort-note { font-size: 13px; color: var(--ct-muted); }

/* ---------- Status tabs ---------- */

.ct-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--ct-track);
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}

    .ct-tabs::-webkit-scrollbar { display: none; }

.ct-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ct-text-2);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

    .ct-tab.is-active {
        background: var(--ct-surface);
        color: var(--ct-text);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12);
    }

.ct-tab-count {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #E5E7EB;
    color: #374151;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Per-status badge colours, same palette as .ct-pill */
.ct-tab--closed .ct-tab-count { background: #DCFCE7; color: #166534; }
.ct-tab--cancelled .ct-tab-count { background: #FEE4E2; color: #B42318; }
.ct-tab--voided .ct-tab-count { background: #E2E8F0; color: #334155; }
.ct-tab--notpayment .ct-tab-count { background: #FEF3C7; color: #92400E; }


/* ---------- Status corner flag + dotted wash (rows and cards) ---------- */

.ct-row, .ct-card {
    --ct-flag: #16A34A;
    --ct-dot: #E9877C;
    position: relative;
}

.ct-card { overflow: hidden; border-color: #D1D5DB; }
.ct-card.is-cancelled { border-color: #E8B4AD; }

.ct-row.is-cancelled, .ct-card.is-cancelled { --ct-flag: #D92D20; --ct-dot: #E9877C; }
.ct-row.is-voided, .ct-card.is-voided { --ct-flag: #64748B; --ct-dot: #94A3B8; }
.ct-row.is-notpayment, .ct-card.is-notpayment { --ct-flag: #D97706; --ct-dot: #E9B04C; }

.ct-row::after, .ct-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    z-index: 1;
    pointer-events: none;
    border-top-left-radius: 8px;
    background: linear-gradient(135deg, var(--ct-flag) 50%, transparent 50%);
}

.ct-row:not(.is-paid)::before, .ct-card:not(.is-paid)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 96px;
    pointer-events: none;
    background-image: radial-gradient(var(--ct-dot) 1px, transparent 1.4px);
    background-size: 7px 7px;
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at top left, #000 0%, rgba(0,0,0,0.6) 35%, transparent 75%);
    mask-image: radial-gradient(ellipse 100% 100% at top left, #000 0%, rgba(0,0,0,0.6) 35%, transparent 75%);
}

/* ---------- List / Grid toggle ---------- */

.ct-view-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--ct-track);
    border-radius: 10px;
}

.ct-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ct-text-2);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .ct-view-btn.is-active {
        background: var(--ct-surface);
        color: var(--ct-text);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12);
    }

/* ---------- Shared bits ---------- */

.ct-muted { color: var(--ct-muted); font-size: 13px; }
.ct-ta-right { text-align: right; }

.ct-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px 0 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

    .ct-pill--sm { height: 24px; font-size: 12px; padding: 0 9px 0 7px; }
    .ct-pill svg { flex-shrink: 0; }

.ct-row.is-paid .ct-pill,
.ct-card.is-paid .ct-pill { background: #DCFCE7; color: #166534; }

.ct-row.is-cancelled .ct-pill,
.ct-card.is-cancelled .ct-pill { background: #FEE4E2; color: #B42318; }

.ct-row.is-voided .ct-pill,
.ct-card.is-voided .ct-pill { background: #E2E8F0; color: #334155; }

.ct-row.is-notpayment .ct-pill,
.ct-card.is-notpayment .ct-pill { background: #FEF3C7; color: #92400E; }

.ct-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0 7px;
    border-radius: 6px;
    background: #EEF2FF;
    color: #3730A3;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ct-chip--photo { background: var(--ct-track); color: #374151; }

.ct-chip--pay {
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    background: transparent;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
}

.ct-amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--ct-text);
    font-variant-numeric: tabular-nums;
}

    .ct-amount--void {
        font-weight: 600;
        color: var(--ct-muted);
        text-decoration: line-through;
    }

.ct-amount-sub { font-size: 12px; color: var(--ct-muted); }

.ct-tip-link {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: 12px;
    color: var(--ct-muted);
    cursor: pointer;
    text-decoration: underline dotted;
}

.ct-row-no {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ct-track);
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-ticket-id { font-size: 12px; font-weight: 500; color: var(--ct-muted); }

.ct-client {
    font-size: 15px;
    font-weight: 600;
    color: var(--ct-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-details-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    background: var(--ct-surface);
    color: #374151;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .ct-details-btn:hover { background: var(--ct-surface-2); }
    .ct-details-btn--block { width: 100%; height: 40px; }

.ct-chevron {
    width: 36px;
    height: 36px;
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    background: var(--ct-surface);
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

    .ct-chevron svg { transition: transform 0.15s; }
    .is-open > .ct-row-main .ct-chevron svg { transform: rotate(180deg); }

/* ---------- List view ---------- */

.closedtickets-content-wrapper { padding: 0; background: var(--ct-surface); }

.ct-list-head {
    display: grid;
    grid-template-columns: 44px minmax(180px, 1.3fr) minmax(200px, 1.7fr) minmax(170px, 1.2fr) 80px 120px 128px 148px;
    gap: 16px;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    background: var(--ct-surface-2);
    border-bottom: 1px solid var(--ct-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--ct-text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 1200px;
}

.ticket-list.ct-list {
    display: block;
    padding: 0;
    min-width: 1200px;
}

.ticket-card.ct-row {
    padding: 0;
    border-bottom: 1px solid var(--ct-border);
    border-top: 0;
    background: var(--ct-surface);
}

    .ticket-card.ct-row:hover { background: var(--ct-surface-2); }

.ct-row-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding-right: 20px;
}

.ct-row-toggle {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(180px, 1.3fr) minmax(200px, 1.7fr) minmax(170px, 1.2fr) 80px 120px 128px;
    gap: 16px;
    align-items: center;
    min-height: 76px;
    padding: 0 0 0 20px;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

    .ct-row-toggle:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: -2px; }

.ct-col { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.ct-ticket-line { flex-direction: row; display: flex; align-items: center; gap: 8px; }

.ct-services {
    font-size: 14px;
    color: var(--ct-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-staff-names {
    font-size: 13px;
    color: var(--ct-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-col-payment, .ct-col-status { display: block; }
.ct-col-time { font-size: 14px; color: #374151; white-space: nowrap; display: block; }
.ct-col-amount { align-items: flex-end; gap: 3px; }

.ct-row-actions {
    width: 148px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.ct-row.is-cancelled .ct-services,
.ct-row.is-voided .ct-services,
.ct-row.is-notpayment .ct-services,
.ct-row.is-cancelled .ct-client,
.ct-row.is-voided .ct-client,
.ct-row.is-notpayment .ct-client { color: var(--ct-muted); }

/* ---------- Expanded breakdown ---------- */

.ct-row-expand { padding: 0 20px 16px 80px; }

.ct-expand {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 16px 20px;
    border: 1px solid var(--ct-border);
    border-radius: 12px;
    background: var(--ct-surface);
}

.ct-expand-col {
    flex: 1 1 220px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ct-expand-col + .ct-expand-col {
    padding-left: 24px;
    border-left: 1px solid var(--ct-border);
}

.ct-expand-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--ct-text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ct-service-list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: var(--ct-text);
}

    .ct-service-list li { padding: 2px 0; }

.ct-staff-list { display: flex; flex-wrap: wrap; gap: 8px; }

.ct-staff {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ct-text);
}

.ct-staff-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E0E7FF;
    color: #3730A3;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-sum-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #F1F2F4;
    font-size: 14px;
    color: #374151;
}

    .ct-sum-row--total {
        border-bottom: 0;
        font-size: 15px;
        font-weight: 600;
        color: var(--ct-text);
    }

.ct-expand-col--wide { flex: 2 1 360px; }

.ct-tech-group {
    display: flex;
    flex-direction: column;
    padding: 6px 0 8px;
    border-bottom: 1px solid #F1F2F4;
}

.ct-tech-head { display: flex; align-items: center; gap: 8px; height: 30px; }

.ct-tech-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #E0E7FF;
    color: #3730A3;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-tech-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ct-text); }
.ct-tech-count { font-size: 12px; }
.ct-tech-sub { font-size: 14px; font-weight: 600; color: var(--ct-text); font-variant-numeric: tabular-nums; }

.ct-tech-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0 3px 32px;
    font-size: 14px;
    color: var(--ct-text);
}

.ct-tech-price, .ct-sum-val { font-weight: 600; font-variant-numeric: tabular-nums; }

.ct-pay-none { font-size: 14px; }

/* Cancelled / voided: nothing was charged, so the amounts read as struck through. */
.ct-expand.is-void .ct-tech-sub,
.ct-expand.is-void .ct-tech-price,
.ct-expand.is-void .ct-sum-val { color: var(--ct-muted); text-decoration: line-through; }

.ct-expand-photos {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--ct-border);
}

/* ---------- Grid view ---------- */

.ticket-list.ct-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--ct-surface-2);
    align-items: stretch;
    min-width: 0;
    /* .ticket-list is flex:1, which squeezed the rows (and clipped the cards) to the panel height */
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    overflow: visible;
    /* .ticket-list sets width:100%, so the padding has to stay inside it */
    box-sizing: border-box;
}

.ticket-card.ct-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--ct-border);
    border-radius: 14px;
    background: var(--ct-surface);
}

.ct-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ct-card-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .ct-card-head-left .ct-row-no { width: 28px; height: 28px; font-size: 12px; }

.ct-card-client {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.ct-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--ct-surface-2);
}

.ct-card-services {
    font-size: 13px;
    color: var(--ct-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ct-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--ct-border-soft);
}

.ct-card-amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ct-list-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--ct-border);
}

/* ---------- Grid card (mockup layout) ---------- */

.ct-card-head-left .ct-ticket-id { font-size: 13px; }
.ct-card-head-left .ct-chip--photo { height: 22px; padding: 0 7px; font-size: 12px; }

.ct-card-time { flex-shrink: 0; font-size: 12px; color: var(--ct-muted); }

.ct-card-groups { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.ct-cg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--ct-surface-2);
    min-width: 0;
}

.ct-cg-head { display: flex; align-items: center; gap: 8px; min-width: 0; }

.ct-cg-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E0E7FF;
    color: #3730A3;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-cg-staff { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ct-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-cg-sub { flex-shrink: 0; font-size: 13px; font-weight: 600; color: #374151; font-variant-numeric: tabular-nums; }

.ct-cg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-cg-more { padding-left: 30px; font-size: 12px; font-weight: 600; color: #3730A3; }
.ct-cg-names { display: block; padding-left: 30px; font-size: 13px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ct-cg-item { display: flex; justify-content: space-between; gap: 12px; padding-left: 30px; font-size: 13px; color: var(--ct-text); }
.ct-card.is-void .ct-cg-name { color: var(--ct-muted); }
.ct-cg-price { flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.ct-card-more { font-size: 12px; font-weight: 600; color: #3730A3; padding-left: 2px; }

.ct-card.is-void .ct-cg-names { color: var(--ct-muted); }
.ct-card.is-void .ct-cg-sub,
.ct-card.is-void .ct-cg-price { color: var(--ct-muted); text-decoration: line-through; }

.ct-card-photos { display: flex; flex-direction: column; gap: 6px; }

.ct-card-split {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed var(--ct-border);
    font-size: 13px;
    color: #374151;
}

    .ct-card-split > div { display: flex; justify-content: space-between; gap: 12px; }

.ct-card-foot { padding-top: 12px; border-top: 1px solid var(--ct-border-soft); gap: 12px; }
.ct-card-pay { flex: 1 1 0; min-width: 0; }
.ct-card-pay .ct-chip--pay { max-width: 100%; box-sizing: border-box; }
.ct-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-card-pay .ct-muted { font-size: 12px; }

.ct-chip--pay-sm { height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; gap: 6px; }

.ct-split-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Tip and total stay on one line: the footer row used to squeeze them into wrapping. */
.ct-card-amount { flex-shrink: 0; white-space: nowrap; align-items: baseline; gap: 8px; }
.ct-card-amount .ct-amount { font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }
.ct-card-amount .ct-amount-sub { white-space: nowrap; }

.ct-card-actions { display: flex; gap: 8px; }
.ct-card-actions .ct-details-btn { flex: 1; width: auto; height: 40px; }

/* ---------- Photos inside the expanded row / grid card ---------- */

.ct-expand-photos .ticket-photo-list { flex: none; gap: 12px; align-items: flex-start; }

.ct-expand-photos .ticket-photo-thumbnail,
.ct-expand-photos .ct-photo-missing {
    width: 112px;
    height: 112px;
    border-radius: 10px;
    border: 1px solid var(--ct-border);
    box-sizing: border-box;
}

.ct-card-photos .ticket-photo-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }

.ct-card-photos .ticket-photo-thumbnail,
.ct-card-photos .ct-photo-missing {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 1px solid var(--ct-border);
    box-sizing: border-box;
}

.ct-photo-missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ECE7E2;
    color: #6B7280;
    font-size: 12px;
    font-weight: 600;
}

    .ct-photo-missing span { color: #374151; }
    .ct-card-photos .ct-photo-missing { gap: 4px; font-size: 10px; }
    .ct-card-photos .ct-photo-missing svg { width: 18px; height: 18px; }

.ct-skel {
    display: inline-block;
    flex-shrink: 0;
    width: 52px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
    background-size: 200% 100%;
    animation: ct-skel 1.2s ease-in-out infinite;
}

@keyframes ct-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { .ct-skel { animation: none; } }

/* ---------- Narrow screens ---------- */

@media (max-width: 1100px) {
    .ct-list-head { display: none; }

    .ticket-list.ct-list { min-width: 0; }

    .ticket-card.ct-row { padding: 12px 14px; }

    .ct-row-main {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding-right: 0;
        gap: 10px;
    }

    .ct-row-toggle {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas:
            "no ticket status"
            "no services amount"
            "no payment time";
        height: auto;
        padding: 0;
        row-gap: 6px;
    }

    .ct-row-no { grid-area: no; }
    .ct-col-ticket { grid-area: ticket; }
    .ct-col-services { grid-area: services; }
    .ct-col-payment { grid-area: payment; }
    .ct-col-time { grid-area: time; text-align: right; }
    .ct-col-amount { grid-area: amount; }
    .ct-col-status { grid-area: status; justify-self: end; }

    .ct-row-actions { width: auto; }
    .ct-details-btn { flex: 1; }

    .ct-row-expand { padding: 0 0 12px; }

    .ct-expand { gap: 14px; padding: 12px 14px; }

    .ct-expand-col + .ct-expand-col {
        padding-left: 0;
        border-left: 0;
        padding-top: 12px;
        border-top: 1px solid var(--ct-border);
    }
}

@media (max-width: 860px) {
    .closedtickets-body { padding: 12px 12px 0; }

    .ct-kpis {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

        .ct-kpis::-webkit-scrollbar { display: none; }

    .ct-kpi {
        flex: 0 0 170px;
        scroll-snap-align: start;
        padding: 10px 12px;
    }

    /* Keep the % badge on phones, drop the chart and its legend. */
    .ct-kpi-chart { justify-content: flex-start; }
    .ct-kpi-chart .ct-spark, .ct-kpi-legend { display: none; }
    .ct-kpi-delta { height: 18px; padding: 0 5px; border-radius: 4px; font-size: 10px; }
    .ct-kpi-value { font-size: 20px; }

    .ct-panel-toolbar { padding: 10px 12px; }
    .ct-sort-note { display: none; }

    .ct-period-bar { height: 40px; }
    .ct-period-btn, .ct-range-btn { height: 32px; font-size: 13px; padding: 0 10px; }

    .ct-range-panel {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        max-width: none;
        max-height: 80vh;
        overflow-y: auto;
    }

    .ct-preset-list {
        flex: 1 1 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--ct-border-soft);
        scrollbar-width: none;
    }

        .ct-preset-list::-webkit-scrollbar { display: none; }

    .ct-preset { flex-shrink: 0; }

    .ct-range-panel-main { padding: 12px; }

    .ct-months { gap: 12px; }
}

/* Day header shown above each day's tickets in Week / Month / custom ranges */
.ct-day-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--ct-surface-2);
    border-top: 1px solid var(--ct-border);
    border-bottom: 1px solid var(--ct-border);
    font-size: 13px;
    color: var(--ct-text-2);
}
.ct-day-head:first-child { border-top: 0; }
.ct-day-name { font-weight: 700; color: var(--ct-text); }
.ct-day-meta { color: var(--ct-muted); }
.ct-day-total { margin-left: auto; font-weight: 700; color: var(--ct-accent-ink); }
.ct-day-today { background: var(--ct-accent-soft); color: var(--ct-accent-ink); }
.ticket-list.ct-grid > .ct-day-head {
    grid-column: 1 / -1;
    border: 1px solid var(--ct-border);
    border-radius: 10px;
}
@media (max-width: 900px) {
    .ct-day-head { padding: 10px 14px; }
}

/* Next page loads when this comes into view (replaces the Load More button) */
.closedtickets-content-wrapper > .ticket-list { flex: 0 0 auto; }
.ct-load-sentinel {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ct-muted);
}
.ct-load-retry {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--ct-accent-ink);
    cursor: pointer;
}

/* Split-tender tickets: one chip per payment method, wrapping inside the column */
.ct-pay-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 6px 0;
}
