/*
 * Supportix additions on top of the DashCode template.
 *
 * The template already ships cards, buttons, tables, forms, modals and
 * dropdowns, so this file only holds the few pieces Supportix needs that the
 * template does not have (count badges, floating live-chat popups, small
 * helpers). Keep it short and obvious.
 */

/* Small count badge used by the sidebar and top bar. */
.menu-link-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #fff;
}

.sidebar-menu .navItem {
    justify-content: space-between;
}

/* Round avatar chip used in the top bar and profile menu. */
.supportix-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Floating "a visitor started a chat" cards shown on every page. */
.live-chat-popup-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 340px;
    width: calc(100vw - 36px);
}

.live-chat-popup {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.dark .live-chat-popup {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.live-chat-popup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.live-chat-popup-body {
    flex: 1;
    min-width: 0;
}

.live-chat-popup-title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.live-chat-popup-name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.live-chat-popup-meta,
.live-chat-popup-page {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Keeps long tables usable on phones without breaking the page layout. */
.supportix-table-scroll {
    width: 100%;
    overflow-x: auto;
}

/* Status colours used by ticket chips and rows. */
.supportix-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 6px;
}

/*
 * Dense data tables (ticket queue, dashboard lists, logs).
 *
 * The demo tables in the template are roomy, which is fine for four columns.
 * Supportix tables carry up to twelve, so the cells are tightened and the table
 * keeps a sensible minimum width that the wrapper can scroll on phones.
 */
.supportix-table {
    /*
     * Fill the card, but never squash below a readable width - the wrapper
     * scrolls horizontally on phones. "width: 100%" is required because this
     * file loads after app.css, so the min-width here would otherwise beat
     * Bootstrap's .min-w-full and leave a gap of empty card to the right.
     */
    width: 100%;
    min-width: 1040px;
}

.supportix-table .table-th,
.supportix-table .table-td {
    padding: 0.75rem 0.85rem;
    vertical-align: middle;
}

.supportix-table td,
.supportix-table th {
    white-space: nowrap;
}

/* Long text columns wrap instead of stretching the whole table. */
.supportix-table .supportix-wrap {
    white-space: normal;
    min-width: 200px;
}

/* The template's select needs a little more room in the top bar on desktop. */
.supportix-brand-select {
    min-width: 190px;
}

/* Keeps the left half of the top bar from collapsing behind the page actions. */
.supportix-topbar-left {
    min-width: 160px;
}

@media (max-width: 1279px) {
    .supportix-brand-select {
        min-width: 110px;
        max-width: 170px;
    }
}

/* Printing a ticket should not include the navigation chrome. */
@media print {
    .sidebar-wrapper,
    .app-header,
    .site-footer,
    .live-chat-popup-stack {
        display: none !important;
    }

    #content_wrapper {
        margin-left: 0 !important;
    }
}

/*
 * Template utility gap-fills.
 *
 * The DashCode download ships a pre-built stylesheet, so it only contains the
 * Tailwind classes the demo pages use. The handful below are used by Supportix
 * screens but were not part of that build; they mirror the normal Tailwind
 * output so the markup stays readable.
 */
/* Bootstrap heading sizes, kept so legacy markup renders at the same scale. */
.h1 { font-size: 2.5rem; line-height: 1.2; font-weight: 500; }
.h2 { font-size: 2rem; line-height: 1.2; font-weight: 500; }
.h3 { font-size: 1.75rem; line-height: 1.2; font-weight: 500; }
.h4 { font-size: 1.5rem; line-height: 1.2; font-weight: 500; }
.h5 { font-size: 1.25rem; line-height: 1.2; font-weight: 500; }
.h6 { font-size: 1rem; line-height: 1.2; font-weight: 500; }

/* Bootstrap helpers the converted pages still rely on. */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check .form-check-input {
    margin: 0;
    flex: none;
}

.btn-group {
    display: inline-flex;
    align-items: stretch;
}

.btn-group > .btn:not(:first-child) {
    margin-left: -1px;
}

.btn-group > .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group > .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.tab-content > .tab-pane {
    display: none;
}

.tab-content > .tab-pane.active {
    display: block;
}

.progress {
    display: flex;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    font-size: 0.7rem;
}

.alert-dismissible {
    padding-right: 3rem;
}

.position-absolute {
    position: absolute;
}

/* Bootstrap navigation wrappers used by the tabbed screens. */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-item {
    list-style: none;
}

.btn-group-sm > .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    line-height: 1.2;
}

.form-check-label {
    cursor: pointer;
}

/*
 * Bootstrap component chrome that the template only styles partially.
 *
 * app.css colours and shapes modals, but it does not position them, so without
 * these rules an opened modal appears in the page flow instead of on top of it.
 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

.modal.fade .modal-dialog {
    transform: translate(0, -20px);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    outline: 0;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
}

.modal-header {
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.modal-title {
    margin: 0;
}

.dark .modal-content {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .modal-header,
.dark .modal-footer {
    border-color: #334155;
}

.btn-close {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    opacity: 0.6;
    cursor: pointer;
}

.btn-close::before {
    content: '\00d7';
    display: block;
    font-size: 1.35rem;
    line-height: 1;
}

.btn-close:hover {
    opacity: 1;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 3.5rem);
    }

    .modal-lg {
        max-width: 800px;
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100vw;
    height: 100vh;
    background-color: #0f172a;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

body.modal-open {
    overflow: hidden;
}

/* Bootstrap input groups: the template ships the addon styling only. */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:last-child,
.input-group > .form-select:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/*
 * The template only gives .form-select its dropdown arrow; the box itself is
 * styled here to match .form-control so selects line up with the inputs.
 */
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #0f172a;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    background-repeat: no-repeat;
}

.form-select:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.dark .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #ffffff;
}

/*
 * The dashboard font is set once, in the override block at the end of this
 * file, so that the signed-in pages use the same font as the reseller portal.
 */

/*
 * Bootstrap dropdown menus. The template positions its menus with utility
 * classes in the demo markup; the Supportix menus rely on the classic
 * `.dropdown` / `.dropdown-menu` behaviour instead.
 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    margin-top: 0.25rem;
    min-width: 10rem;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.dark .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.35rem;
    vertical-align: middle;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

/*
 * The template only styles .dropdown-item.active, so plain menu items had no
 * padding and sat inline. This restores the classic Bootstrap menu item.
 */
.dropdown-menu {
    padding: 0.35rem 0;
    min-width: 11rem;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-align: left;
    text-decoration: none;
    background-color: transparent;
    border: 0;
    cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f1f5f9;
    color: #0f172a;
}

.dark .dropdown-item {
    color: #cbd5e1;
}

.dark .dropdown-item:hover,
.dark .dropdown-item:focus {
    background-color: #334155;
    color: #ffffff;
}

.dropdown-item:disabled,
.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
}

/*
 * The template's light button stays white in dark mode, which is harsh against
 * a dark card. This softens the quiet buttons (menu triggers, modal cancels).
 */
.dark .btn-light {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .btn-light:hover,
.dark .btn-light:focus {
    background-color: #334155;
    color: #ffffff;
}

/*
 * Full-width anchor buttons.
 *
 * The template's .btn does not set a display, so a <button> is inline-block
 * (where width works) but an <a class="btn w-full"> stays inline and ignores
 * the width entirely. This makes the intent work for both.
 */
.btn.w-full {
    display: block;
    text-align: center;
}

/*
 * SweetAlert2 buttons.
 *
 * SweetAlert v11 styles its buttons with :where(...) selectors, which carry no
 * specificity. Tailwind's preflight rule for [type='button'] / [type='submit']
 * therefore wins on background-color and paints them transparent - while the
 * white label stays white, so "Yes, delete it" and "Cancel" were invisible.
 * These rules restore the button surfaces and follow the Supportix accent.
 * The var() fallbacks keep per-dialog confirmButtonColor overrides working.
 */
.swal2-container .swal2-styled {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: none;
    transition: filter 0.15s ease;
}

.swal2-container .swal2-styled.swal2-confirm {
    background-color: var(--swal2-confirm-button-background-color, #2563eb);
    color: var(--swal2-confirm-button-color, #ffffff);
}

.swal2-container .swal2-styled.swal2-deny {
    background-color: var(--swal2-deny-button-background-color, #dc3741);
    color: var(--swal2-deny-button-color, #ffffff);
}

.swal2-container .swal2-styled.swal2-cancel {
    background-color: var(--swal2-cancel-button-background-color, #6e7881);
    color: var(--swal2-cancel-button-color, #ffffff);
}

.swal2-container .swal2-styled:hover,
.swal2-container .swal2-styled:focus {
    filter: brightness(0.94);
}

.swal2-container .swal2-styled:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/*
 * SweetAlert defaults, re-pointed at the Supportix palette so confirmations
 * match the rest of the interface instead of SweetAlert's purple/grey.
 * A dialog that passes confirmButtonColor still wins: SweetAlert writes that
 * as an inline variable on the popup, and a declaration on the element beats
 * an inherited one.
 */
:root {
    --swal2-background: #ffffff !important;
    --swal2-color: #334155 !important;
    --swal2-title-color: #0f172a !important;
    --swal2-confirm-button-background-color: #2563eb !important;
    --swal2-confirm-button-color: #ffffff !important;
    --swal2-deny-button-background-color: #dc2626 !important;
    --swal2-deny-button-color: #ffffff !important;
    --swal2-cancel-button-background-color: #e2e8f0 !important;
    --swal2-cancel-button-color: #0f172a !important;
}

.dark {
    --swal2-background: #1e293b !important;
    --swal2-color: #cbd5e1 !important;
    --swal2-title-color: #f1f5f9 !important;
    --swal2-cancel-button-background-color: #334155 !important;
    --swal2-cancel-button-color: #e2e8f0 !important;
}

/*
 * The template paints .btn-outline-secondary with #a0aec0 for both border and
 * text - about 2.3:1 on white, which fails a readable contrast. It is used for
 * secondary actions such as "Test connection", the reply toolbar and the mail
 * log Reset, so it gets a legible slate instead.
 */
.btn-outline-secondary {
    border-color: #cbd5e1;
    color: #475569;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.dark .btn-outline-secondary {
    border-color: #475569;
    color: #cbd5e1;
}

.dark .btn-outline-secondary:hover,
.dark .btn-outline-secondary:focus {
    background-color: #334155;
    color: #ffffff;
}

/*
 * Sidebar brand.
 *
 * The template reserves a fixed 80px header and sizes the menu area with
 * h-[calc(100%-80px)]. A logo big enough to fill the sidebar makes that header
 * taller, so the wrapper becomes a flex column and the menu area simply takes
 * the remaining space - no magic number to keep in sync.
 */
.sidebar-wrapper {
    display: flex;
    flex-direction: column;
}

.sidebar-wrapper .logo-segment {
    flex: none;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.sidebar-wrapper .sidebar-menus {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.supportix-sidebar-brand {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.supportix-sidebar-logo {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
}

.supportix-sidebar-mark {
    display: none;
    flex: none;
    width: 36px;
    height: 36px;
}

/*
 * Collapsed rail: the wordmark is unreadable at 72px, so the mark takes over.
 * The template's collapse toggle is re-shown by jQuery after the stylesheet
 * hides it, which would squeeze the mark into a 24px column, so it is hidden
 * explicitly while the rail is not being hovered (hover still expands it).
 */
.collapsed .sidebar-wrapper:not(:hover) .logo-segment #sidebar_type {
    display: none !important;
}

.collapsed .sidebar-wrapper .logo-segment {
    justify-content: center;
}

.collapsed .sidebar-wrapper:hover .logo-segment {
    justify-content: space-between;
}

.collapsed .sidebar-wrapper .supportix-sidebar-brand {
    flex: none;
}

.collapsed .sidebar-wrapper .supportix-sidebar-logo {
    display: none;
}

.collapsed .sidebar-wrapper .supportix-sidebar-mark {
    display: block;
}

.collapsed .sidebar-wrapper:hover .supportix-sidebar-logo {
    display: block;
}

.collapsed .sidebar-wrapper:hover .supportix-sidebar-mark {
    display: none;
}

/*
 * The wordmark is dark ink, so it sits on a light chip (the same treatment the
 * sign-in page uses). The rail is dark in every theme, so this always applies.
 */
.supportix-sidebar-brand {
    padding: 0.35rem 0.5rem;
    border-radius: 0.6rem;
    background-color: rgba(255, 255, 255, 0.95);
}

/* Collapsed shows only the blue shield, which reads fine straight on the rail. */
.collapsed .sidebar-wrapper:not(:hover) .supportix-sidebar-brand {
    padding: 0;
    background-color: transparent;
}

/* ---- Live chat workspace ------------------------------------------------- */

/* The live numbers read as one strip rather than three separate cards. */
.supportix-live-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    font-size: 0.9375rem;
}

.supportix-live-dot {
    align-self: center;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
}

.supportix-live-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    color: #0f172a;
}

.dark .supportix-live-value {
    color: #f1f5f9;
}

.supportix-live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.supportix-live-status iconify-icon {
    font-size: 1rem;
}

/*
 * The search belongs with the tabs it filters, not in a metric card.
 * Sizing uses width, not flex-basis: the tab header turns into a column on
 * phones, where a 340px flex-basis would become a 340px-tall box.
 */
.live-search {
    flex: 0 1 auto;
    width: 340px;
    max-width: 100%;
    min-width: 200px;
}

@media (max-width: 991.98px) {
    .live-search {
        width: 100%;
        min-width: 0;
    }
}

/* Site-specific context column in the visitors table. */
.supportix-table .visitor-device {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

/* Visitor rail beside the conversation. */
.live-context-rail {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    background-color: #ffffff;
}

.dark .live-context-rail {
    background-color: #1e293b;
}

/*
 * The queue column must scroll inside the fixed-height console. The DashCode
 * conversion dropped the legacy base rule (the generator counts this class as
 * "known" because of the mobile rule below), so the queue's content height
 * stretched the whole grid and the reply composer was clipped out of view.
 */
.live-session-list {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

/*
 * The conversion swapped the console's Bootstrap `.row`/`.d-flex` wrappers for
 * Tailwind grid utilities. Keep the console height constraints attached to the
 * new classes (the old `.live-console > .row` helpers in the generated
 * supportix-extra.css no longer match anything).
 */
.live-console > .grid {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

.live-console > .grid > [class*="col-span-"] {
    min-height: 0;
}

.live-console .flex.flex-col {
    height: 100%;
    min-height: 0;
}

/*
 * The DashCode build ships no disabled styling for .btn (it even resets
 * ":disabled" to cursor: default), so a disabled action such as Accept on an
 * already-assigned chat looked exactly like an enabled one. Restore the
 * Bootstrap disabled affordance for every button on the portal.
 */
.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}

/*
 * Three-level section separation instead of one grey wash: white surfaces
 * (chat header, composer, visitor rail), a light queue strip, and the
 * conversation field as the deepest surface so white bubbles, the composer
 * card and the chat header each separate cleanly from what sits behind them.
 */
.live-status-card {
    background: linear-gradient(135deg, #e7f0fe 0%, #f1f5f9 55%, #f1f5f9 100%);
}

.live-tabs-header {
    background: #f1f5f9;
}

.live-session-list {
    background: #f4f6fa;
}

.live-chat-header {
    background: #ffffff;
}

.live-context-rail {
    background-color: #ffffff;
}

.live-message-thread {
    background: linear-gradient(180deg, #eaf0f8 0%, #e4ebf5 100%);
}

@media (max-width: 1023px) {
    /* Phones: open a chat and the queue steps aside, so the thread gets the screen. */
    .live-console.live-focus-chat .live-session-list {
        display: none;
    }

    /*
     * The desktop console is a fixed-height, internally scrolling panel. On a
     * phone the three stacked panes are taller than that box, and "overflow:
     * hidden" made the visitor rail unreachable - so phones scroll the page and
     * each pane keeps a sensible cap of its own.
     */
    .live-console {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .live-session-list {
        max-height: 55vh;
    }

    .live-message-thread {
        max-height: 60vh;
        min-height: 300px;
    }

    .live-context-rail {
        overflow: visible;
        max-height: none;
        border-left: 0;
        border-top: 1px solid #e2e8f0;
    }

    .dark .live-context-rail {
        border-top-color: #334155;
    }
}

.modal-title {
    margin: 0;
    line-height: 1.5;
}

.dropdown-divider {
    height: 0;
    margin: 0.4rem 0;
    border-top: 1px solid #e2e8f0;
}

.dark .dropdown-divider {
    border-top-color: #334155;
}

.dropdown-menu-end {
    left: auto;
    right: 0;
}

/*
 * The template hides closed dropdown menus with the "hidden" utility. This
 * safety rule makes sure any menu without that class still stays closed until
 * Bootstrap opens it, so it can never stretch a table row.
 */
.dropdown-menu:not(.show) {
    display: none;
}

.max-h-\[320px\] {
    max-height: 320px;
}

.max-w-\[140px\] {
    max-width: 140px;
}

.min-w-\[240px\] {
    min-width: 240px;
}

.text-\[\#7C3AED\] {
    color: #7c3aed;
}

.\!pl-10 {
    padding-left: 2.5rem !important;
}

.\!w-auto {
    width: auto !important;
}

.\!text-sm {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
}

@media (min-width: 640px) {
    .sm\:inline {
        display: inline;
    }

    .sm\:flex-row {
        flex-direction: row;
    }

    .sm\:w-auto {
        width: auto;
    }

    .sm\:ml-auto {
        margin-left: auto;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .lg\:flex-row {
        flex-direction: row;
    }

    .lg\:text-right {
        text-align: right;
    }

    .lg\:inline {
        display: inline;
    }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .xl\:px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.dark .dark\:inline-block {
    display: inline-block;
}

/* Small Bootstrap-style helpers used by the ticket screens. */
.my-4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.text-success {
    color: #10b981;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

.blesta-account-id {
    background: #e9fbf1;
    color: #059669;
}

/*
 * Ticket status switcher.
 *
 * The summary card used to show four fully coloured buttons plus three more
 * actions, which made seven competing colours. Only the *current* status keeps
 * a semantic tint; the other choices are quiet outlines that carry the status
 * colour on their dot, so the row reads as one control instead of seven.
 */
.supportix-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.supportix-status-btn:not(.is-current) {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

.supportix-status-btn:not(.is-current):hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.dark .supportix-status-btn:not(.is-current) {
    background-color: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

.dark .supportix-status-btn:not(.is-current):hover {
    background-color: #1e293b;
}

.supportix-status-btn.is-current {
    cursor: default;
}

/* The dot carries the semantic colour on the quiet buttons. */
.supportix-status-btn .supportix-status-dot {
    opacity: 0.65;
}

.supportix-status-btn.is-current .supportix-status-dot {
    opacity: 1;
}

/* Keeps the summary meta row aligned when it wraps on small screens. */
.supportix-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.25rem;
}

/*
 * Ticket conversation components.
 *
 * These are Supportix-specific (the DashCode template has no ticket thread),
 * so they are defined here rather than in the template stylesheet.
 */
.agent-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.reply-thread {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 760px;
    overflow-y: auto;
    padding: 0.25rem;
}

.reply-row {
    display: flex;
    width: 100%;
}

.reply-row-agent {
    justify-content: flex-end;
}

.reply-row-customer {
    justify-content: flex-start;
}

.reply-bubble {
    width: min(96%, 900px);
    max-width: 900px;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    overflow-wrap: anywhere;
}

.reply-bubble-agent {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 0.35rem;
}

.reply-bubble-customer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    border-bottom-left-radius: 0.35rem;
}

.dark .reply-bubble-customer {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.reply-message p:last-child,
.reply-message ul:last-child,
.reply-message ol:last-child,
.reply-message blockquote:last-child {
    margin-bottom: 0;
}

.reply-message blockquote {
    border-left: 3px solid currentColor;
    margin: 0;
    padding-left: 0.75rem;
    opacity: 0.9;
}

.reply-message img,
.reply-image {
    display: block;
    width: min(100%, 420px);
    max-height: 320px;
    object-fit: contain;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
}

.reply-attachments {
    display: grid;
    gap: 0.5rem;
}

.reply-attachment-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.78);
    color: inherit;
    text-decoration: none;
}

.reply-attachment-link:hover {
    border-color: rgba(37, 99, 235, 0.45);
    color: #2563eb;
}

.reply-attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 auto;
    border-radius: 0.55rem;
    background: #eef4ff;
    color: #2563eb;
}

.reply-attachment-name,
.reply-attachment-meta {
    display: block;
    overflow-wrap: anywhere;
}

.reply-attachment-name {
    font-weight: 700;
    line-height: 1.25;
}

.reply-attachment-meta {
    color: #64748b;
    font-size: 0.82rem;
}

.rich-reply-editor {
    min-height: 150px;
    height: auto;
    overflow-y: auto;
    outline: none;
}

.rich-reply-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.reply-toolbar .btn {
    min-width: 2.25rem;
}

.reply-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 132px;
    padding: 1rem;
    border: 1.5px dashed #9db7e8;
    border-radius: 0.9rem;
    background: #f8fbff;
    color: #0f172a;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.dark .reply-dropzone {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #475569;
}

.reply-dropzone:hover,
.reply-dropzone.is-dragover {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.reply-dropzone.has-file {
    border-style: solid;
    border-color: #10b981;
    background: #f0fdf4;
}

.reply-dropzone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e8f0ff;
    color: #2563eb;
    font-size: 1.25rem;
}

.reply-dropzone-name {
    color: #64748b;
    font-size: 0.85rem;
}

.ticket-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
}

.blesta-account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.55rem;
    background: #e9fbf1;
    color: #10b981;
}

.blesta-invoice-row {
    padding: 0.65rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    background-color: #ffffff;
}

.dark .blesta-invoice-row {
    border-color: #334155;
    background-color: #0f172a;
}

/*
 * Side-panel typography.
 *
 * The template gives bare <h2>/<h3> elements very large sizes, which made the
 * lazily rendered Blesta block shout. Panel headings carry their own size, and
 * every label/value pair uses the same two classes so the rail reads as a set
 * of tidy sections instead of a stack of boxes.
 */
.supportix-panel-title {
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 700;
}

.supportix-field-label {
    font-size: 0.7rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.supportix-field-value {
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 600;
    color: #1e293b;
}

.dark .supportix-field-value {
    color: #e2e8f0;
}

/* Merge search results behave like a simple list of choices. */
.supportix-choice {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    background: #fff;
    cursor: pointer;
}

.supportix-choice:hover {
    border-color: #2563eb;
    background: #f8fbff;
}

/*
 * Live chat console UI polish (2026-10-03).
 *
 * Sits on top of the layout rules above: queue rows gain avatars and tag
 * chips, the conversation header an avatar, messages day dividers and
 * avatars, system notes become compact pills, and the rail/queue headers
 * stick while their columns scroll. Surfaces stay white over the tinted
 * sections; cobalt remains the only accent.
 */

/* Chat queue rows. */
.live-session-item {
    padding: 0.8rem 0.9rem;
}
.live-session-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.live-session-avatar {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.68rem;
    flex: 0 0 auto;
    background: #e8f0fe;
    color: #1d4ed8;
}
.live-session-item.active .live-session-avatar,
.live-session-item:hover .live-session-avatar,
.live-session-item:focus .live-session-avatar {
    background: #2563eb;
    color: #ffffff;
}
.live-session-item:hover,
.live-session-item:focus,
.live-session-item.active {
    background: #eef4fd;
}
.live-session-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9rem;
}
.live-session-time {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}
.live-session-preview {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.live-session-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.live-session-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #526071;
    font-size: 0.68rem;
    font-weight: 600;
}

/* Queue and rail headers stay visible while their columns scroll. */
.live-session-list > div:first-child,
.live-context-rail > div:first-child {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Conversation header avatar. */
.live-header-avatar {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.85rem;
}

/* Message rows: avatars beside bubbles, compact system pills, day dividers. */
.live-msg-row {
    gap: 0.5rem;
    align-items: flex-end;
}
.live-msg-avatar {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.58rem;
    margin-bottom: 0.2rem;
}
.live-message-thread .live-system-bubble {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: none;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
}
.live-message-thread .live-system-bubble .live-message-meta {
    display: inline-flex;
    gap: 0.45rem;
    justify-content: center;
    margin-bottom: 0.1rem;
    font-size: 0.7rem;
}
.live-message-thread .live-system-bubble .live-message-meta span:first-child {
    color: #94a3b8;
    font-weight: 600;
}
.live-message-thread .live-system-bubble > div:last-child {
    font-size: 0.8rem;
    color: #526071;
}
.live-day-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0 0.9rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.live-day-divider::before,
.live-day-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: #d3dce9;
}
.live-day-divider span {
    flex: 0 0 auto;
}

/* Composer: the draft grows with its content instead of a resize handle. */
.live-composer-input {
    resize: none;
}

/*
 * Visitors/Chats switch: a segmented control instead of heavy pills.
 * One rounded track on the tinted toolbar; the active segment is a raised
 * white card with a solid cobalt count chip, inactive segments stay quiet.
 */
/* Live Chat and Brands share one segmented control. */
.live-workspace-tabs,
.brands-workspace-tabs {
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.25rem;
    background: #e6ebf3;
    border-radius: 999px;
}
.live-workspace-tabs .nav-item,
.brands-workspace-tabs .nav-item {
    display: flex;
}
.live-workspace-tabs .nav-link,
.brands-workspace-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto;
    padding: 0.42rem 0.95rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #5a6a7e;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.live-workspace-tabs .nav-link iconify-icon,
.brands-workspace-tabs .nav-link iconify-icon {
    margin-right: 0;
    font-size: 1.05rem;
}
.live-workspace-tabs .nav-link:hover,
.brands-workspace-tabs .nav-link:hover {
    color: #1d4ed8;
}
.live-workspace-tabs .nav-link.active,
.brands-workspace-tabs .nav-link.active {
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(37, 99, 235, 0.22);
}
.live-workspace-tabs .badge,
.brands-workspace-tabs .badge {
    margin-left: 0.15rem;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    background: #dbe3ed;
    color: #5a6a7e;
}
.live-workspace-tabs .nav-link.active .badge,
.brands-workspace-tabs .nav-link.active .badge {
    background: #2563eb !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Dashboard font
   --------------------------------------------------------------------------
   Supportix used to render with Inter, the DashCode template's default font.
   The reseller portal (reseller-new) uses the native system stack below, so
   the dashboard matches it here and both portals look and feel the same.

   Avenir Next is used on macOS and iOS, Avenir on older Apple devices, Segoe
   UI on Windows, and the browser's default sans-serif as the final fallback.
   Nothing is downloaded from a font service, so text paints immediately.

   The template hard-codes "Inter" in a handful of component rules. This file
   is loaded after the template CSS, so repeating those selectors here is
   enough to switch the whole dashboard over.
   ========================================================================== */
:root {
    /* Bootstrap components such as tooltips and popovers read this variable. */
    --bs-font-sans-serif: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

html,
body,
body.font-inter,
.font-inter,
.font-Inter,
.font-sans,
.btn,
.card-title,
.card-title2,
.card-text,
.card-subtitle,
.error,
.settings-modal h3,
.themeCustomization-checkInput-label,
.sidebar-menu > li,
.sidebar-menu .sidebar-menu-title,
.flatpickr-months .flatpickr-weekday,
.flatpickr-weekdays .flatpickr-weekday,
.flatpickr-day,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

/* The template marks its calendar buttons with !important, so we match it. */
.dashcode-app .fc-button {
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif !important;
}

/* ==========================================================================
   Blocked senders page
   --------------------------------------------------------------------------
   The blocklist mixes email rules and whole-domain rules, so each row needs to
   say which one it is at a glance. These styles add the type chips, the small
   metric icons, the add panel and the segmented email/domain switch.
   ========================================================================== */

/* Rounded icon tiles on the three summary cards. */
.blocked-metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.75rem;
    font-size: 1.25rem;
}
.blocked-metric-icon--neutral {
    background: #e2e8f0;
    color: #334155;
}
.blocked-metric-icon--danger {
    background: #fee2e2;
    color: #b91c1c;
}
.blocked-metric-icon--warning {
    background: #fef3c7;
    color: #b45309;
}
.dark .blocked-metric-icon--neutral {
    background: #1e293b;
    color: #cbd5e1;
}
.dark .blocked-metric-icon--danger {
    background: rgba(185, 28, 28, 0.25);
    color: #fca5a5;
}
.dark .blocked-metric-icon--warning {
    background: rgba(180, 83, 9, 0.25);
    color: #fcd34d;
}

/* Email / domain chip that prefixes every blocked sender. */
.blocked-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.blocked-type-chip--email {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}
.blocked-type-chip--domain {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}
.dark .blocked-type-chip--email {
    background: rgba(185, 28, 28, 0.25);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}
.dark .blocked-type-chip--domain {
    background: rgba(180, 83, 9, 0.25);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}

/*
 * The template's .table-td rule capitalizes cell text. Email addresses and
 * domains are case-insensitive, but they have to be shown exactly as they are
 * stored, so this column opts out of that transform and keeps a monospace
 * value that is easy to compare character by character.
 */
.blocked-sender-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
    text-transform: none;
    word-break: break-all;
}

/*
 * Every cell in this table shows literal data (sender, reason, staff name,
 * "1 day ago"), so the template's automatic capitalization is switched off for
 * the whole list instead of only for the sender column.
 */
.blocked-list-table .table-td,
.blocked-count-badge {
    text-transform: none;
}

/* A missing reason is a gap, not real content, so it reads quietly. */
.blocked-reason--empty {
    font-style: italic;
}

/* Panel that holds the add form, kept visually separate from the list. */
.blocked-add-panel {
    margin-bottom: 1rem;
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    padding: 1rem;
    background: #f8fafc;
}
.dark .blocked-add-panel {
    border-color: #1e293b;
    background: #0f172a;
}

/*
 * Progressive enhancement: only collapse the panel when the page script can
 * open it again, so the form is never unreachable without JavaScript.
 */
.has-js .blocked-add-panel:not(.is-open) {
    display: none;
}

/* Segmented email / domain switch; the radio itself stays focusable for keyboards. */
.blocked-type-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.blocked-type-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.blocked-type-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    background: #ffffff;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.blocked-type-option:hover {
    border-color: #2563eb;
    color: #1d4ed8;
}
.blocked-type-input:checked + .blocked-type-option {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
.blocked-type-input:focus-visible + .blocked-type-option {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.dark .blocked-type-option {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
.dark .blocked-type-input:checked + .blocked-type-option {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Small helper line under the value field. */
.blocked-field-hint {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.78rem;
}
.dark .blocked-field-hint {
    color: #94a3b8;
}

/* Friendly empty state used for "nothing blocked yet" and "no filter matches". */
.blocked-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.25rem 1rem;
    text-align: center;
    color: #64748b;
}
.blocked-empty iconify-icon {
    font-size: 2rem;
    color: #94a3b8;
}
.dark .blocked-empty {
    color: #94a3b8;
}
.dark .blocked-empty iconify-icon {
    color: #64748b;
}

/* ==========================================================================
   Brands & Categories page
   --------------------------------------------------------------------------
   Same treatment as the Live Chat page: a status readout at the top, a
   segmented section switch, then cards with a tinted header so both screens
   read as one product.
   ========================================================================== */

/* Faint blue wash, matching the Live Chat status strip. */
.brands-status-card {
    background: linear-gradient(135deg, #e7f0fe 0%, #f1f5f9 55%, #f1f5f9 100%);
}

/*
 * Dark mode needs its own wash for the status strips. The metric numbers turn
 * near-white in dark mode, so a light strip would hide them completely.
 * Applies to Live Chat and Brands, which share this component.
 */
.dark .live-status-card,
.dark .brands-status-card {
    background: linear-gradient(135deg, #17253e 0%, #0f172a 55%, #0f172a 100%);
}

.brands-tabs-card {
    overflow: hidden;
}
.brands-tabs-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
}

/* Helper text on the right of the section switch, like Live Chat's status note. */
.brands-tabs-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #64748b;
}
.brands-tabs-hint iconify-icon {
    font-size: 1rem;
}
.dark .brands-tabs-hint {
    color: #94a3b8;
}
/* Same story for the strip that holds the segmented switch. */
.dark .live-tabs-header,
.dark .brands-tabs-header {
    background: #0f172a;
}

/* Lift the grey helper text so it stays readable on the dark washes. */
.dark .supportix-live-status,
.dark .brands-status-card .text-slate-500 {
    color: #94a3b8;
}

/*
 * The generated stylesheet paints this table's header pale blue, which leaves
 * the light header text unreadable once the page switches to dark mode.
 */
.dark .brand-directory-table thead th,
.dark .brand-mini-table thead th {
    background: #0f172a;
    border-bottom-color: #1e293b;
    color: #94a3b8;
}

/* Channels is not usable yet, so it reads as clearly inactive rather than broken. */
.brands-workspace-tabs .nav-link.disabled,
.brands-workspace-tabs .nav-link[aria-disabled="true"] {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 1;
}
.brands-workspace-tabs .nav-link.disabled:hover {
    color: #94a3b8;
}
.brands-tab-soon {
    background: #e2e8f0 !important;
    color: #64748b !important;
}

/*
 * On phones the two segments stack instead of squeezing next to each other, and
 * the track turns into a rounded panel so the taller shape still reads as one
 * control.
 */
@media (max-width: 575px) {
    .brands-workspace-tabs {
        width: 100%;
        border-radius: 1rem;
    }
    .brands-workspace-tabs .nav-item {
        flex: 1 1 100%;
    }
    .brands-workspace-tabs .nav-link {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Card header for both tables: title on the left, search and action on the right. */
.brand-directory-header {
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #f8fafc;
}
.dark .brand-directory-header {
    background: #0f172a;
}

/*
 * Keep the search box and its button on one row. The generated stylesheet sizes
 * the input against its own parent, which used to push the button onto a second
 * line on a full-width screen.
 */
.brand-directory-tools {
    flex-wrap: nowrap;
}
.brand-directory-tools .input-group {
    flex: 0 1 340px;
    width: 340px;
    max-width: 100%;
}

/* On phones the tools take the full width and stack, which keeps them tappable. */
@media (max-width: 767px) {
    .brand-directory-tools {
        flex-wrap: wrap;
        width: 100%;
    }
    .brand-directory-tools .input-group,
    .brand-directory-tools .btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

/*
 * The template capitalizes every table cell, which turned support@acme.test into
 * "Support@Acme.Test". Sender addresses, SMTP hosts and names must show exactly
 * what was saved, so this directory opts out of that transform.
 */
.brand-directory-table .table-td {
    text-transform: none;
}

/* Empty state shared by the brand and category tables. */
.brands-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 0.75rem 0.75rem;
    padding: 2.25rem 1rem;
    text-align: center;
    color: #64748b;
}
.brands-empty iconify-icon {
    font-size: 2rem;
    color: #94a3b8;
}
.dark .brands-empty {
    color: #94a3b8;
}
/*
 * The page script shows and hides these blocks by toggling Tailwind's .hidden.
 * Without this guard the flex display above would win and the empty state would
 * stay visible on top of a populated table.
 */
.brands-empty.hidden {
    display: none;
}

/* ==========================================================================
   Sidebar
   --------------------------------------------------------------------------
   The Supportix rail is always a dark navy, in every theme. The template's own
   sidebar is white in the light theme and slate (#1e293b) in semi-dark, so the
   navigation looked different for every user depending on their saved theme.

   The selectors are prefixed with the body class and the html element so they
   beat the template's theme-scoped rules (.dark .sidebar-wrapper, .semiDark
   .sidebar-wrapper, .semiDark .navItem, ...) whichever theme class is present.
   ========================================================================== */
html body.dashcode-app .sidebar-wrapper {
    background: #1e293b;
    border-right: 1px solid rgba(148, 163, 184, 0.08);
}
html body.dashcode-app .sidebar-wrapper .logo-segment,
html body.dashcode-app .sidebar-wrapper .sidebar-menus {
    background: transparent;
}
html body.dashcode-app .sidebar-wrapper .logo-segment {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

/* Section headings: a small caps label followed by a hairline. */
html body.dashcode-app .sidebar-menu .sidebar-menu-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
    margin-bottom: 0.35rem;
    padding: 0 0.75rem;
    color: #7d8fab;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
}
html body.dashcode-app .sidebar-menu .sidebar-menu-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.14);
}
html body.dashcode-app .sidebar-menu > .sidebar-menu-title:first-child {
    margin-top: 0.4rem;
}

/* Menu rows: icon sits in its own chip, the row gets a soft hover. */
html body.dashcode-app .sidebar-menu .navItem {
    position: relative;
    margin-bottom: 2px;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    color: #c3cede;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body.dashcode-app .sidebar-menu .navItem .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 30px;
    height: 30px;
    margin-right: 0.7rem;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
    color: #93a4bb;
    font-size: 17px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body.dashcode-app .sidebar-menu .navItem:hover {
    background-color: rgba(148, 163, 184, 0.1);
    color: #ffffff;
}
html body.dashcode-app .sidebar-menu .navItem:hover .nav-icon {
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}
/*
 * Declared after the hover rule on purpose: both selectors have the same
 * weight, so the current page keeps its pill while hovered. The pill is a
 * solid blue tint with an accent bar; the icon chip turns solid blue.
 */
html body.dashcode-app .sidebar-menu .navItem.active {
    background: #2563eb;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
    color: #ffffff;
    font-weight: 600;
}
html body.dashcode-app .sidebar-menu .navItem.active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.7);
}
html body.dashcode-app .sidebar-menu .navItem.active .nav-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* Count badges get a ring so they lift off the tinted active pill. */
html body.dashcode-app .sidebar-menu .menu-link-badge {
    box-shadow: 0 0 0 2px #1e293b;
}

/* Second level links, which only appear inside an expanded section. */
html body.dashcode-app .sidebar-menu .sidebar-submenu > li > a {
    color: #a6b6cd;
}
html body.dashcode-app .sidebar-menu .sidebar-submenu > li > a:hover,
html body.dashcode-app .sidebar-menu .sidebar-submenu > li > a.active {
    color: #ffffff;
}
html body.dashcode-app .sidebar-menu .sidebar-submenu > li > a.active::before {
    background-color: #60a5fa;
}

/* Thin, quiet scrollbar for the menu area. */
html body.dashcode-app .sidebar-wrapper .sidebar-menus {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

/* Signed-in user card pinned to the bottom of the rail. */
.supportix-sidebar-user {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.5rem 0.75rem 0.75rem;
    padding: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.35);
}
.supportix-sidebar-user-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.supportix-sidebar-user-avatar::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 2px #1e293b;
}
.supportix-sidebar-user-text {
    min-width: 0;
    line-height: 1.25;
}
.supportix-sidebar-user-name {
    display: block;
    overflow: hidden;
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.supportix-sidebar-user-role {
    display: block;
    color: #7d8fab;
    font-size: 11.5px;
}
/* Collapsed 72px rail: only the avatar stays. */
.collapsed .sidebar-wrapper:not(:hover) .supportix-sidebar-user {
    justify-content: center;
    margin: 0.5rem;
    padding: 0.5rem 0;
    border-color: transparent;
    background: transparent;
}
.collapsed .sidebar-wrapper:not(:hover) .supportix-sidebar-user-text,
.collapsed .sidebar-wrapper:not(:hover) .sidebar-menu .sidebar-menu-title::after {
    display: none;
}
.collapsed .sidebar-wrapper:not(:hover) .sidebar-menu .navItem.active::before {
    left: -8px;
}
.collapsed .sidebar-wrapper:not(:hover) .sidebar-menu .navItem .nav-icon {
    margin-right: 0;
}

@media (prefers-reduced-motion: reduce) {
    html body.dashcode-app .sidebar-menu .navItem,
    html body.dashcode-app .sidebar-menu .navItem .nav-icon {
        transition: none;
    }
}

/*
 * Logo strip: a compact white chip for the dark-ink wordmark, and a square
 * collapse button that matches the menu icon chips.
 */
html body.dashcode-app .sidebar-wrapper .logo-segment {
    gap: 0.6rem;
    min-height: 68px;
    padding: 0.85rem 1rem;
}
html body.dashcode-app .supportix-sidebar-brand {
    flex: 0 1 auto;
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    background-color: #ffffff;
}
html body.dashcode-app .supportix-sidebar-logo {
    width: auto;
    max-width: 150px;
    height: 30px;
    object-fit: contain;
}
html body.dashcode-app .supportix-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
    color: #93a4bb;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body.dashcode-app .supportix-sidebar-toggle:hover {
    background: rgba(96, 165, 250, 0.18);
    color: #ffffff;
}
html body.dashcode-app .supportix-sidebar-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}
/* Collapsed (hover-expanded) rail: the chevron points the other way. */
.collapsed .supportix-sidebar-toggle iconify-icon {
    transform: rotate(180deg);
}
/* Collapsed 72px rail: just the shield mark, centred. */
.collapsed .sidebar-wrapper:not(:hover) .logo-segment {
    padding-left: 0;
    padding-right: 0;
}
.collapsed .sidebar-wrapper:not(:hover) .supportix-sidebar-mark {
    width: 32px;
    height: 32px;
}

/* ==========================================================================
   Blesta lookup in the Live Chat visitor rail
   --------------------------------------------------------------------------
   The billing shortcut sits on its own softly tinted panel between the visitor
   header and the detail rows, so it reads as an action rather than another
   fact about the visitor. The button only calls Blesta when clicked, and the
   answer is cached per chat so the ten-second poll never repeats the request.
   ========================================================================== */
.live-blesta-panel {
    margin: 0.25rem 0 1rem;
    border: 1px solid #dbe3ef;
    border-radius: 0.85rem;
    padding: 0.65rem;
    background: #f8fafc;
}
.dark .live-blesta-panel {
    border-color: #1e293b;
    background: #0f172a;
}

/* Account name, client number and icon share one row. */
.live-blesta-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ==========================================================================
   Live Chat console: fill the window and keep the conversation selectable
   --------------------------------------------------------------------------
   The generated stylesheet caps the console at 760px, so on a tall window the
   conversation stopped well above the bottom of the screen and left a band of
   empty page under it. The cap is lifted here so the console fills whatever
   space is left below the page header, with the composer sitting at the bottom.
   ========================================================================== */
.live-console {
    max-height: none;
}

/*
 * Conversation text exists to be copied into tickets, so it stays selectable.
 * This is explicit because the template ships a `.select-none` utility and the
 * poll used to rebuild the thread, which quietly cleared any highlight.
 */
.live-message-thread,
.live-message-thread * {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}
