:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --card-bg: #f9fafb;
    --card-bg-alt: #eef2f7;
    --stroke: #cfd6e3;
    --stroke-strong: #b8c2d6;
    --text: #0f172a;
    --muted: #5b6677;
    --muted2: #7a8598;
    --primary: #2563eb;
    --primary-bg: #e8efff;
    --primary-bg-strong: #dbe7ff;
    --primary-border: #4f6edc;
    --hover: #edf2fb;
    --selected: #dbe7ff;
    --selected-border: #6b86f1;
    --focus: #1d4ed8;
    --focus-soft: rgba(29, 78, 216, .25);
    --warn: #f59e0b;
    --warn-bg: #fff6e5;
    --warn-border: #f59e0b;
    --bad: #dc2626;
    --bad-bg: #fdecec;
    --bad-border: #dc2626;
    --good: #16a34a;
    --good-bg: #eaf7ef;
    --good-border: #16a34a;
    --border-color: var(--stroke-strong);
    --border2-color: var(--stroke);
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --ui: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", "Noto Sans", "Liberation Sans", sans-serif;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--ui);
}

html, body {
    height: 100%;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

/* header */
    .header {
        background: var(--panel);
        flex-shrink: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        margin: 0;
        width: 100%;
        border: none;
        border-bottom: 1px solid var(--border2-color);
        /* Keep header content above the demo/read-only banner. */
        position: relative;
        z-index: 200;
    }

    /* name */
        .name_container 
        {
            display: flex;
            align-items: center;
        }

        .name_container .logo 
        {
            padding: 5px;
            background-color: var(--primary);
            color: var(--bg);
            font-size: 16px;
            font-weight: bolder;
        }

        .name_container .name_content
        {
            color: var(--text);
            padding-left: 10px;
        }

        .name_container .name_content .name
        {
            font-size: 14px;
            font-weight: bold;
        }

        .name_container .name_content .name .name_link
        {
            color: #000000;
            text-decoration: none;
        }

        .name_container .name_content .name .name_link:visited
        {
            color: #000000;
        }

        .name_container .name_content .name .name_link:hover,
        .name_container .name_content .name .name_link:focus
        {
            color: #000000;
            text-decoration: underline;
        }

        .name_container .name_content .sub_name
        {
            font-size: 12px;
            color: var(--muted2);
        }

    /*search */
        .header .search_bar
        {
            color: var(--text);
            border: 1px solid var(--border2-color);
            font-size: 14px;
            padding-left: 10px;
            flex: 1;
            max-width: 600px;
            margin: 0 20px;
            position: relative;
            /* Search wrapper sits above banner layer so results remain visible/clickable. */
            z-index: 220;
        }

        .header .search_bar form 
        {
            display: flex;
            align-items: center;
        }

        .header .search_bar form input[type="text"]
        {
            margin: 0 10px;
            flex: 1;
            border: none;
            padding: 5px 10px;
            font-size: 14px;
        }

        .header .search_bar form input[type="text"]:focus, .header .search_bar form input[type="text"]:active
        {
            outline: none;
            box-shadow: none;
        }

        .header .search_bar form button
        {
            background-color: var(--bg);
            color: var(--text);
            padding: 5px 10px;
            font-size: 14px;
            cursor: pointer;
            font-weight: bold;
            border: none;
            box-shadow: 0 0 1px 1px var(--border2-color);
        }

        .header .search_bar form button:hover
        {
            background-color: var(--hover);
            box-shadow: none;
            box-shadow: 0 0 1px 1px var(--border-color);
        }

        .header .search_bar form button:active, .header .search_bar form button:focus
        {
            background-color: var(--selected);
            box-shadow: 0 0 1px 1px var(--selected-border);
        }

        .header .search_bar .global-search-results
        {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            z-index: 230;
            background: var(--panel);
            border: 1px solid var(--border2-color);
            border-radius: 8px;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
            max-height: 420px;
            overflow: auto;
            display: none;
        }

        .header .search_bar .global-search-results.is-open
        {
            display: block;
        }

        .global-search-group
        {
            border-top: 1px solid var(--border2-color);
        }

        .global-search-group:first-child
        {
            border-top: none;
        }

        .global-search-group-title
        {
            padding: 8px 12px;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--muted2);
            background: var(--card-bg);
        }

        .global-search-item
        {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            cursor: pointer;
            background: var(--panel);
            border: none;
            width: 100%;
            text-align: left;
        }

        .global-search-item:hover,
        .global-search-item.active
        {
            background: var(--hover);
        }

        .global-search-item .title
        {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
        }

        .global-search-item .subtitle
        {
            font-size: 12px;
            color: var(--muted2);
        }

        .global-search-item .meta
        {
            font-size: 11px;
            color: var(--muted);
            padding: 2px 6px;
            border: 1px solid var(--border2-color);
            border-radius: 999px;
            background: var(--card-bg-alt);
            white-space: nowrap;
        }

        .global-search-empty,
        .global-search-loading
        {
            padding: 12px;
            font-size: 12px;
            color: var(--muted2);
        }

        .global-search-highlight
        {
            background: var(--primary-bg);
            color: var(--text);
            padding: 0 2px;
            border-radius: 2px;
        }

    /* button bar */
        .button_bar 
        {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 5px 10px;
    gap: 10px;
}

.weekday-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.weekday-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border2-color);
    border-radius: 0;
    background: var(--card-bg);
}
.weekday-row span:first-child {
    color: var(--text);
    font-weight: 600;
}
.weekday-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}
.weekday-inputs input[type="time"] {
    padding: 6px 8px;
    border: 1px solid var(--border2-color);
    border-radius: 0;
    min-width: 110px;
}

@media (max-width: 768px) {
    .settings_columns {
        grid-template-columns: 1fr;
    }
    .setting-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }
    .setting-row label {
        margin-bottom: 4px;
    }
}

        .button_bar button 
        {
            background-color: var(--bg);
            color: var(--text);
            border: none;
            padding: 5px 10px;
            font-size: 14px;
            cursor: pointer;
            border: 1px solid var(--border2-color);
            box-shadow: none;
        }

        .button_bar button:hover
        {
            background-color: var(--hover);
            border: 1px solid var(--border-color);
            box-shadow: none;
        }

        .button_bar .side_btn.active 
        {
            background-color: var(--selected);
            border: 1px solid var(--selected-border);
            box-shadow: none;
        }

        .button_bar .right-toggle
        {
            margin-left: auto;
            min-width: 34px;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            font-weight: 700;
            letter-spacing: 0.02em;
        }

/* main */
    .main {
        flex: 1;
        background-color: var(--panel);
        overflow: hidden;
        display: flex;
        justify-content: space-between;
        position: relative;
    }

    .access-blocker {
        position: absolute;
        inset: 0;
        z-index: 55;
        background: rgba(15, 23, 42, 0.52);
        backdrop-filter: blur(2px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px;
    }

    .access-blocker__panel {
        width: min(660px, 100%);
        border: 1px solid var(--border2-color);
        background: #ffffff;
        box-shadow: 0 30px 70px rgba(2, 6, 23, 0.32);
        padding: 18px;
        display: grid;
        gap: 10px;
    }

    .access-blocker__eyebrow {
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #1d4ed8;
    }

    .access-blocker__panel h2 {
        font-size: 24px;
        line-height: 1.15;
        color: #0f172a;
    }

    .access-blocker__panel p {
        font-size: 14px;
        color: #334155;
        line-height: 1.45;
    }

    .access-blocker__trial {
        display: inline-flex;
        align-items: center;
        padding: 6px 10px;
        border: 1px solid #bfdbfe;
        background: #eff6ff;
        color: #1e3a8a;
        font-size: 12px;
        font-weight: 700;
        width: fit-content;
    }

    .access-blocker__actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 4px;
    }

    .access-blocker__btn {
        padding: 10px 14px;
        border: 1px solid var(--border2-color);
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    }

    .access-blocker__btn.primary {
        background: var(--primary);
        border-color: var(--primary-border);
        color: #ffffff;
    }

    .access-blocker__btn.secondary {
        background: #f8fafc;
        color: #0f172a;
    }

    .access-blocker__btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    }

    /* Read-only banner for guest viewers. */
    .readonly-banner {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 8px 12px;
        background: #fff7ed;
        border-bottom: 1px solid #fed7aa;
        color: #92400e;
        font-size: 12px;
        font-weight: 700;
        position: relative;
        z-index: 120;
    }

    .readonly-banner__actions {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        position: relative;
        z-index: 2;
    }

    .readonly-banner__link {
        text-decoration: none;
        font-weight: 700;
        border: 1px solid transparent;
        padding: 7px 11px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        line-height: 1;
        min-height: 32px;
        cursor: pointer;
        pointer-events: auto;
        position: relative;
        transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
    }

    .readonly-banner__link i {
        font-size: 13px;
    }

    .readonly-banner__link--reset {
        color: #7c2d12;
        border-color: #fdba74;
        background: #ffedd5;
    }

    .readonly-banner__link--login {
        color: #ffffff;
        border-color: #1d4ed8;
        background: #2563eb;
    }

    .readonly-banner__link:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    }

    .readonly-banner__link--reset:hover {
        background: #fed7aa;
        border-color: #fb923c;
    }

    .readonly-banner__link--login:hover {
        background: #1d4ed8;
        border-color: #1e40af;
    }

    .readonly-banner__link:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
    }

    @media (max-width: 720px) {
        .readonly-banner {
            align-items: flex-start;
            flex-direction: column;
            gap: 10px;
        }

        .readonly-banner__actions {
            margin-left: 0;
            width: 100%;
        }

        .readonly-banner__link {
            justify-content: center;
            flex: 1;
        }
    }

    /* Read-only UI affordances to prevent edits while keeping views visible. */
    body[data-readonly="true"] [data-readonly-disabled],
    body[data-readonly="true"] [data-customer-action],
    body[data-readonly="true"] [data-status-trigger],
    body[data-readonly="true"] [data-status-option],
    body[data-readonly="true"] .status-picker,
    body[data-readonly="true"] [data-action="schedule-smart"],
    body[data-readonly="true"] [data-action="waitlist-smart"] {
        pointer-events: none;
        opacity: 0.55;
        cursor: not-allowed;
    }

    @media (max-width: 720px) {
        .access-blocker__panel h2 {
            font-size: 20px;
        }

        .access-blocker__actions {
            flex-direction: column;
        }

        .access-blocker__btn {
            width: 100%;
        }
    }

    /* left */
        .main .left {
            min-width: 250px;
            border-right: 1px solid var(--border2-color);
            display: flex;
            flex-direction: column;
        }

/* middle */
.main .middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow-y: auto;
}
    
/* right */
    .main .right {
        --right-start: 420px;
        flex: 0 0 var(--right-start);
        width: var(--right-start);
        min-width: 350px;
        border-left: 1px solid var(--border2-color);
    }

    .main .right .right-panel {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px;
        height: 100%;
        box-sizing: border-box;
    }

    .right-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
    }

    /* Allow header text to shrink so ellipsis can apply when needed. */
    .right-panel-header > div {
        min-width: 0;
    }

    .right-panel-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--text);
    }

    .right-panel-sub {
        font-size: 12px;
        color: var(--muted2);
    }

    .right-panel-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .right-panel-body.list {
        gap: 6px;
    }

    .right-list-item {
        padding: 8px;
        border: 1px solid var(--border2-color);
        background: var(--card-bg);
        font-size: 13px;
    }

    /* Allow non-detailed right-list items to be copied on click. */
    .right-list-item:not(.detailed) {
        cursor: copy;
    }

    .right-list-name {
        font-weight: 700;
        color: var(--text);
    }

    .right-list-meta {
        font-size: 12px;
        color: var(--muted2);
    }

    /* Reusable truncation helper for right-panel text that can overflow. */
    .overflow-ellipsis {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Tooltip bubble for overflowed right-panel text. */
    .overflow-tooltip {
        position: fixed;
        z-index: 1200;
        max-width: min(360px, calc(100vw - 16px));
        background: #0f172a;
        color: #ffffff;
        padding: 6px 8px;
        border-radius: 6px;
        font-size: 12px;
        line-height: 1.4;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
        opacity: 0;
        transform: translateY(2px);
        transition: opacity 0.12s ease, transform 0.12s ease;
        pointer-events: none;
    }

    .overflow-tooltip.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Tooltip arrow pointer. */
    .overflow-tooltip::after {
        content: "";
        position: absolute;
        width: 8px;
        height: 8px;
        background: #0f172a;
        transform: rotate(45deg);
    }

    .overflow-tooltip[data-placement="top"]::after {
        bottom: -4px;
        left: 14px;
    }

    .overflow-tooltip[data-placement="bottom"]::after {
        top: -4px;
        left: 14px;
    }

    /* Toast notification for successful copy actions. */
    .copy-toast {
        position: fixed;
        top: 16px;
        right: 16px;
        z-index: 1300;
        background: #0f172a;
        color: #ffffff;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.12s ease, transform 0.12s ease;
        pointer-events: none;
    }

    .copy-toast.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    .right-panel .field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .right-panel .field.two-col,
    .right-panel .field.three-col {
        flex-direction: row;
        gap: 8px;
    }

    .right-panel .field.two-col > div,
    .right-panel .field.three-col > div {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .right-panel .field label {
        font-size: 12px;
        color: var(--muted2);
    }

    .right-panel .field input,
    .right-panel .field textarea,
    .right-panel .field select {
        width: 100%;
        padding: 8px;
        border: 1px solid var(--border2-color);
        background: var(--card-bg);
        color: var(--text);
        font-size: 13px;
        border-radius: 4px;
        resize: vertical;
        min-height: 34px;
    }
    .auto-suggest-anchor {
        position: relative;
    }

    .auto-suggest {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: auto;
        z-index: 2000;
        background: #fff;
        border: 1px solid var(--border2-color);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        border-radius: 6px;
        display: none;
        max-height: 240px;
        overflow-y: auto;
    }

    .auto-suggest__item {
        padding: 10px 12px;
        border-bottom: 1px solid #f0f2f5;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .auto-suggest__item:last-child {
        border-bottom: none;
    }

    .auto-suggest__item:hover {
        background: #f8fafc;
    }

    .auto-suggest__name {
        font-weight: 700;
        color: var(--text);
        font-size: 13px;
    }

    .auto-suggest__meta {
        display: flex;
        gap: 12px;
        font-size: 12px;
        color: var(--muted2);
    }

    .right-panel .field input:focus,
    .right-panel .field textarea:focus,
    .right-panel .field select:focus {
        outline: none;
        border-color: var(--focus);
        box-shadow: 0 0 0 2px var(--focus-soft);
        background: var(--panel);
    }

    .right-panel textarea {
        min-height: 60px;
    }

    .right-panel-footer {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        padding-top: 6px;
        border-top: 1px solid var(--border2-color);
    }

    .main.right-collapsed .right,
    .main.right-collapsed .resize-handle[data-side="right"] {
        display: none;
    }

    .main.right-collapsed .middle {
        flex: 1;
    }

    /* resizers */
        .main .resize-handle {
            flex: 0 0 0;
            width: 0;
            cursor: col-resize;
            position: relative;
            background: transparent;
            touch-action: none;
        }

        .main .resize-handle::after {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            left: -6px;
            right: -6px;
            background: transparent;
        }

        .main.resizing {
            user-select: none;
        }

/* module switching */
.module_views {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.module_view {
    display: none;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.module_view.active {
    display: flex;
    flex-direction: column;
}

.module_placeholder {
    padding: 22px;
    color: var(--muted);
    line-height: 1.5;
}

.module_placeholder h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 16px;
}

/* Appointments + customer utilities */
.form-messages {
    margin-top: 8px;
    font-size: 12px;
    color: #667085;
    min-height: 16px;
}
.form-messages.error {
    color: #b42318;
}
.form-messages.success {
    color: #027a48;
}

.module-panel {
    background: #fff;
    border: 1px solid var(--border2-color);
    border-radius: 0;
    padding: 12px;
    box-shadow: none;
}
.module-panel-header {
    margin-bottom: 10px;
}
.module-panel-title {
    font-size: 15px;
    font-weight: 700;
}
.module-panel-sub {
    color: #475467;
    font-size: 12px;
}
.module-empty {
    color: #667085;
}
.table-filters {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.table-filters label {
    display: block;
    font-size: 12px;
    color: #475467;
    margin-bottom: 2px;
}
.table-filters input[type="month"],
.table-filters input[type="date"] {
    padding: 6px 7px;
    border: 1px solid var(--border2-color);
    border-radius: 0;
    font-size: 12px;
    background: #fff;
    min-height: 34px;
}
.table-filters input[type="text"],
.table-filters input[type="search"] {
    padding: 6px 7px;
    border: 1px solid var(--border2-color);
    border-radius: 0;
    font-size: 12px;
    background: #fff;
    min-height: 34px;
    min-width: 220px;
}
.table-filters .smallbtn {
    padding: 7px 10px;
}
.pager .smallbtn.active,
.pager .smallbtn[aria-current="page"] {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}
.table.like-table {
    display: grid;
    gap: 6px;
}
.table-head,
.table-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    column-gap: 12px;
}
.table-head.four-col,
.table-row.four-col {
    grid-template-columns: 1.2fr 1.2fr 1fr 0.8fr;
}
.table-head {
    font-weight: 600;
    color: #475467;
    padding: 6px 8px;
    border: 1px solid var(--border2-color);
    border-radius: 0;
    background: #f4f6f9;
}
.table-row {
    background: #f8f9fb;
    padding: 8px 10px;
    border-radius: 0;
    font-size: 13px;
    border: 1px solid var(--border2-color);
}
.customer-table .table-head,
.customer-table .table-row {
    align-items: center;
    column-gap: 12px;
}
.table.like-table.customer-table .table-row {
    transition: border-color 0.15s ease, box-shadow 0.12s ease, transform 0.1s ease, background 0.12s ease;
}
.table.like-table.customer-table .table-row:hover {
    border-color: var(--primary-border);
    background: var(--primary-bg);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.table.like-table.customer-table .table-row.status-open {
    border-color: var(--primary-border);
    background: var(--primary-bg);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
    position: relative;
    z-index: 3;
}

body.status-menu-open .table.like-table.customer-table .table-row:hover:not(.status-open) {
    border-color: var(--border2-color);
    background: #f8f9fb;
    box-shadow: none;
    transform: none;
}
.table.like-table .table-row {
    transition: border-color 0.15s ease, box-shadow 0.12s ease, transform 0.1s ease, background 0.12s ease;
}
.table.like-table .table-row:hover {
    border-color: var(--primary-border);
    background: var(--primary-bg);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2ff;
    color: #344054;
}
.badge.status-confirmed,
.badge.status-good {
    background: #ecfdf3;
    color: #027a48;
}
.badge.status-pending,
.badge.status-warn {
    background: #fff7ed;
    color: #b54708;
}
.badge.status-checked_in,
.badge.status-neutral {
    background: #e0f2fe;
    color: #075985;
}
.badge.status-canceled,
.badge.status-removed,
.badge.status-bad {
    background: #fef3f2;
    color: #b42318;
}
.badge.status-rescheduled {
    background: #eef2ff;
    color: #4338ca;
}

.customer-subtext {
    color: #475467;
    font-size: 12px;
}

.appointments-table .table-head,
.appointments-table .table-row {
    grid-template-columns: 1.3fr 1fr 1.2fr 1.4fr;
}

.cancellations-table .table-head,
.cancellations-table .table-row {
    grid-template-columns: 1.2fr 1.1fr 1fr 1fr 0.9fr;
}

.waitlist-table .table-head,
.waitlist-table .table-row {
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(0, 1.4fr)
        minmax(0, 1.2fr)
        minmax(0, 0.9fr)
        minmax(0, 1.5fr);
    padding: 8px 10px;
    align-items: start;
}

.waitlist-table .table-head {
    align-items: center;
}

.waitlist-table .table-head > div,
.waitlist-table .table-row > div {
    min-width: 0;
}

.waitlist-table .table-row .customer-subtext {
    overflow-wrap: anywhere;
}

.appointments-table .table-row,
.cancellations-table .table-row,
.waitlist-table .table-row {
    background: #f8f9fb;
}

.appointments-table .table-row:hover,
.cancellations-table .table-row:hover,
.waitlist-table .table-row:hover {
    cursor: pointer;
}

.appt-customer,
.appt-when {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-service {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.appt-notes {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.appt-provider {
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.status-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-picker.open {
    z-index: 6;
}

.status-trigger {
    border: 1px solid transparent;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.status-trigger::after {
    content: "v";
    font-size: 9px;
    margin-left: 6px;
    opacity: 0.7;
}

.status-picker.open .status-trigger {
    border-color: var(--border2-color);
}

.status-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border2-color);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    min-width: 170px;
    padding: 6px;
    display: none;
    z-index: 40;
}

.status-picker.open .status-menu {
    display: block;
}

.status-option {
    width: 100%;
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
}

.status-option:hover {
    background: var(--hover);
}

.status-msg {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #475467;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.status-msg.show {
    opacity: 1;
    transform: translateY(0);
}

.status-msg.success {
    background: #ecfdf3;
    color: #027a48;
    border-color: #abefc6;
}

.status-msg.error {
    background: #fef3f2;
    color: #b42318;
    border-color: #fecdca;
}

.status-picker.is-busy .status-trigger {
    opacity: 0.6;
    pointer-events: none;
}

.status-control {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin-top: 6px;
}

.status-control select {
    padding: 6px 8px;
    border: 1px solid var(--border2-color);
    border-radius: 4px;
    font-size: 12px;
}

.status-control .status-msg {
    font-size: 12px;
    color: #475467;
    grid-column: 1 / -1;
}

.status-control .smallbtn {
    justify-self: flex-end;
}

.status-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-list {
    display: grid;
    gap: 8px;
}

.card {
    border: 1px solid var(--border2-color);
    border-radius: 0;
    padding: 10px;
    background: #fff;
    box-shadow: none;
}

.card-title {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.card-sub {
    font-size: 12px;
    color: #475467;
    margin-top: 2px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 6px;
    font-size: 12px;
    color: #475467;
    align-items: center;
}

.card-notes {
    margin-top: 8px;
    font-size: 12px;
    color: #4b5563;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    padding: 8px;
    border-radius: 6px;
}

/* Premium modal */
.premium-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
}

.premium-modal.is-open {
    display: flex;
}

.premium-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.premium-modal__panel {
    position: relative;
    width: min(520px, 92vw);
    background: var(--panel);
    border: 1px solid var(--border2-color);
    border-radius: 0;
    box-shadow: none;
    z-index: 1;
    overflow: hidden;
}

.premium-modal__header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border2-color);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.premium-modal__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.premium-modal__subtitle {
    font-size: 12px;
    color: var(--muted2);
}

.premium-modal__close {
    border: 1px solid var(--border2-color);
    background: var(--panel);
    color: var(--text);
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.premium-modal__close:hover {
    background: var(--hover);
}

.premium-modal__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.premium-plan {
    border: 1px solid var(--border2-color);
    padding: 14px;
    background: var(--card-bg);
}

.premium-plan__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1f3faa;
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
}
/* Premium status badge now carries the status label directly. */

/* Status colors for the premium badge. */
.premium-plan__badge[data-status="premium"] {
    color: #1f3faa;
    background: var(--primary-bg);
    border-color: var(--primary-border);
}

.premium-plan__badge[data-status="trial"] {
    color: #92400e;
    background: var(--warn-bg);
    border-color: var(--warn-border);
}

.premium-plan__badge[data-status="inactive"] {
    color: var(--muted2);
    background: var(--card-bg);
    border-color: var(--border2-color);
}

.premium-plan__price {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.premium-plan__amount {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
}

.premium-plan__cycle {
    font-size: 12px;
    color: var(--muted2);
}

.premium-plan__note {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

/* Premium plan metadata rows for status/trial/billing. */
.premium-plan__meta {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.premium-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.premium-meta__label {
    color: var(--muted2);
}

.premium-meta__value {
    color: var(--text);
    font-weight: 600;
}

.premium-plan__note--muted {
    color: var(--muted2);
}

.premium-plan__note--muted:empty {
    display: none;
}

.premium-plan__features {
    margin: 10px 0 0;
    padding-left: 16px;
    font-size: 12px;
    color: var(--muted);
}

.premium-actions {
    display: flex;
    gap: 10px;
}

.premium-settings__title {
    font-size: 11px;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.premium-settings__stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.premium-btn {
    border: 1px solid var(--border2-color);
    background: var(--panel);
    color: var(--text);
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    text-align: center;
}

.premium-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.premium-btn.danger {
    border-color: rgba(220, 38, 38, .45);
    color: #7a0b0b;
}

/* Resume action styling for more visual emphasis. */
.premium-btn.resume {
    border-color: #22c55e;
    color: #14532d;
    background: #ecfdf3;
    position: relative;
    overflow: hidden;
}

.premium-btn.resume::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(34, 197, 94, 0.15) 45%, transparent 85%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
}

.premium-btn.resume:hover::after {
    transform: translateX(120%);
}

.premium-modal[data-prolong-eligible="false"] [data-premium-prolong] {
    display: none;
}

.premium-btn:hover {
    background: var(--hover);
}

.premium-btn.primary:hover {
    background: var(--primary);
    color: var(--bg);
    opacity: 0.92;
}

.premium-footnote {
    font-size: 11px;
    color: var(--muted2);
}
