@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block");

.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga";
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

:root {
    --cf-font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --cf-bg: #f4f8fb;
    --cf-bg-elevated: #f8fbfe;
    --cf-surface: rgba(255, 255, 255, 0.96);
    --cf-surface-solid: #ffffff;
    --cf-surface-soft: #eef6fb;
    --cf-border: #d9e5f2;
    --cf-border-strong: #bfd8f0;
    --cf-text: #000000;
    --cf-text-muted: #9aa3af;
    --cf-text-soft: #b0b7c3;
    --cf-navy-950: #061126;
    --cf-navy-900: #07152f;
    --cf-navy-850: #081a39;
    --cf-navy-800: #0a2348;
    --cf-blue-700: #0b5ee8;
    --cf-blue-600: #0f6fff;
    --cf-blue-500: #1f8fff;
    --cf-cyan-400: #22c7ff;
    --cf-cyan-300: #7fe7ff;
    --cf-success-600: #0f9f6a;
    --cf-success-500: #18c47f;
    --cf-warning-600: #eb8f00;
    --cf-warning-500: #ffb020;
    --cf-danger-600: #db2f52;
    --cf-danger-500: #ff5a6f;
    --cf-primary-gradient: linear-gradient(135deg, #0b4fd4 0%, #0f6fff 45%, #22c7ff 100%);
    --cf-primary-gradient-soft: linear-gradient(135deg, rgba(11, 79, 212, 0.12) 0%, rgba(34, 199, 255, 0.18) 100%);
    --cf-sidebar-gradient: linear-gradient(180deg, #081731 0%, #0a2348 45%, #0c1f56 100%);
    --cf-auth-gradient: radial-gradient(circle at top left, rgba(15, 111, 255, 0.18), transparent 28%), radial-gradient(circle at bottom right, rgba(34, 199, 255, 0.14), transparent 34%), linear-gradient(180deg, #f5f9fd 0%, #eef5fb 100%);
    --cf-card-shadow: 0 18px 40px rgba(7, 21, 47, 0.08);
    --cf-soft-shadow: 0 10px 28px rgba(15, 111, 255, 0.16);
    --cf-topbar-shadow: 0 8px 22px rgba(7, 21, 47, 0.05);
    --cf-radius-xs: 10px;
    --cf-radius-sm: 12px;
    --cf-radius-md: 14px;
    --cf-radius-lg: 18px;
    --cf-radius-xl: 22px;
    --cf-radius-2xl: 24px;
    --cf-transition: all 0.18s ease;
    --cf-primary-rgb: 11, 79, 212;
    --cf-primary-rgb-soft: 34, 199, 255;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: var(--cf-font-sans);
    background: var(--cf-bg);
    color: var(--cf-text);
}

body {
    height: 100%;
}

body,
p,
label,
small,
strong,
td,
th,
li,
input,
select,
textarea,
button {
    color: var(--cf-text);
}

.cf-sidebar,
.cf-sidebar *,
.cf-sidebar a,
.cf-sidebar a:link,
.cf-sidebar a:visited,
.cf-sidebar a:hover,
.cf-sidebar a:active,
.cf-nav-link,
.cf-nav-link span,
.cf-nav-title,
.cf-sidebar-brand,
.cf-sidebar-subtitle,
.cf-logout-btn,
.cf-nav-badge {
    color: #ffffff !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
    color: var(--cf-text);
}

a,
.btn-link {
    color: var(--cf-blue-700);
    text-decoration: none;
}

    a:hover,
    .btn-link:hover {
        color: var(--cf-blue-500);
    }

h1:focus {
    outline: none;
}

.content {
    padding-top: 1.1rem;
}

.display-6 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.14);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--cf-radius-md);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Base Bootstrap button overrides */
.btn,
.btn-primary,
.btn-secondary {
    border-radius: var(--cf-radius-sm);
    font-weight: 600;
    transition: var(--cf-transition);
}

.btn-primary {
    color: white;
    background: var(--cf-primary-gradient);
    border: none;
    box-shadow: none;
}

    .btn-primary:hover {
        color: white;
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: none;
    }

/* App favorites */

.cf-app-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.cf-app-favorite-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: #ffffff;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

    .cf-app-favorite-btn:hover {
        color: #f59e0b;
        border-color: rgba(245, 158, 11, 0.42);
        background: rgba(245, 158, 11, 0.08);
        transform: translateY(-1px);
    }

    .cf-app-favorite-btn.is-favorite {
        color: #facc15;
        border-color: rgba(250, 204, 21, 0.5);
        background: rgba(250, 204, 21, 0.12);
        box-shadow: 0 10px 24px rgba(250, 204, 21, 0.16);
    }

        .cf-app-favorite-btn.is-favorite svg {
            fill: currentColor;
        }

    .cf-app-favorite-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
    }

/* Sidebar favorites */

.cf-nav-favorites-group {
    padding-bottom: 8px;
}

.cf-nav-link.cf-nav-favorite-link {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.cf-nav-favorite-icon {
    width: 18px;
    height: 18px;
    color: #facc15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
}

    .cf-nav-favorite-icon svg {
        display: block;
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

.cf-nav-favorite-label {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.cf-nav-favorite-label-text {
    display: inline-block;
    min-width: max-content;
    white-space: nowrap;
    transform: translateX(0);
    will-change: transform;
}

/*
 * Only overflowing favorites receive this class from JS.
 * Hover waits briefly, smoothly reveals the rest of the text,
 * then remains at the end while the pointer stays over the item.
 */
.cf-nav-favorite-label.is-overflowing:hover
.cf-nav-favorite-label-text {
    animation: cf-nav-favorite-text-reveal var(--cf-favorite-scroll-duration, 2.8s) ease-in-out forwards;
}

@keyframes cf-nav-favorite-text-reveal {
    0%, 12% {
        transform: translateX(0);
    }

    88%, 100% {
        transform: translateX( calc(-1 * var(--cf-favorite-overflow, 0px)) );
    }
}

@media (prefers-reduced-motion: reduce) {
    .cf-nav-favorite-label.is-overflowing:hover
    .cf-nav-favorite-label-text {
        animation: none;
    }
}

/* App shell */

#app,
.app,
main {
    min-height: 0;
}

.cf-app-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--cf-bg);
}

.cf-sidebar {
    width: 260px;
    flex: 0 0 260px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: visible;
    background: var(--cf-sidebar-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 130;
}

.cf-sidebar-header {
    height: 76px;
    flex: 0 0 76px;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.cf-sidebar-logo {
    display: block;
    width: 220px;
    max-width: 100%;
    max-height: 58px;
    height: auto;
    object-fit: contain;
}

.cf-sidebar-brand {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.cf-sidebar-subtitle {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 6px;
}

.cf-sidebar-body {
    padding: 18px 14px;
    position: relative;
    overflow: visible;
}

.cf-nav-group {
    margin-bottom: 24px;
}

.cf-nav-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 8px;
    padding: 0 10px;
    font-weight: 600;
}

.cf-nav-link {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 10px 14px;
    border-radius: var(--cf-radius-md);
    margin-bottom: 4px;
    transition: var(--cf-transition);
}

.cf-nav-apps-shell {
    position: relative;
}

    .cf-nav-apps-shell.open {
        z-index: 600;
    }

.cf-nav-apps-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 6px;
    align-items: stretch;
}

.cf-nav-link-apps {
    margin-bottom: 0;
}

.cf-nav-expand-btn {
    width: 48px;
    min-width: 48px;
    height: 100%;
    min-height: 42px;
    border: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    border-radius: var(--cf-radius-md);
    margin-bottom: 0;
    transition: var(--cf-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

    .cf-nav-expand-btn:hover {
        background: rgba(var(--cf-primary-rgb-soft), 0.16);
        color: #ffffff;
    }

    .cf-nav-expand-btn:focus-visible {
        box-shadow: 0 0 0 3px rgba(var(--cf-primary-rgb-soft), 0.22);
    }

.cf-nav-expand-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
    transition: transform 0.18s ease;
}

    .cf-nav-expand-chevron.open {
        transform: rotate(90deg);
    }

.cf-nav-apps-section + .cf-nav-apps-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cf-nav-apps-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.60);
    margin-bottom: 8px;
    padding: 0 8px;
    font-weight: 600;
}

.cf-nav-apps-item {
    width: 100%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    text-align: left;
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 12px;
    transition: var(--cf-transition);
    display: block;
}

    .cf-nav-apps-item:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
    }

    .cf-nav-apps-item:focus-visible {
        outline: none;
        background: rgba(255, 255, 255, 0.14);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
        color: #ffffff;
    }

    .cf-nav-apps-item:active {
        filter: brightness(0.98);
    }

.cf-nav-apps-empty {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.86rem;
    padding: 8px 10px;
}

.cf-nav-apps-portal-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 699;
}

.cf-nav-apps-flyout-portal {
    position: fixed;
    width: 280px;
    max-width: calc(100vw - 24px);
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--cf-blue-700) 42%, rgba(6, 17, 38, 0.86));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 42px rgba(7, 21, 47, 0.30);
    backdrop-filter: blur(14px);
    z-index: 700;
}

.cf-nav-children {
    padding-left: 12px;
}

.cf-logout-btn {
    width: 100%;
    min-width: 0;
    text-align: left;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: var(--cf-radius-md);
    transition: var(--cf-transition);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
}

    .cf-logout-btn:hover {
        background: rgba(255, 255, 255, 0.16);
    }

.cf-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: 76px minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    overflow: hidden;
}

.cf-content {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    position: relative;
}

    .cf-content h1,
    .cf-content h2,
    .cf-content h3,
    .cf-content h4,
    .cf-content h5 {
        color: var(--cf-text);
        font-weight: 600;
        letter-spacing: -0.02em;
    }

    .cf-content .card,
    .card,
    .login-card,
    .cf-platform-card {
        background: var(--cf-surface);
        border: 1px solid var(--cf-border);
        border-radius: var(--cf-radius-xl);
        box-shadow: var(--cf-card-shadow);
        color: var(--cf-text);
    }

    .cf-content .btn {
        border-radius: var(--cf-radius-sm);
        font-weight: 600;
    }

    .cf-content .form-control,
    .cf-content .form-select,
    .cf-content textarea,
    .form-control,
    .form-select,
    textarea {
        border-radius: var(--cf-radius-sm);
        border: 1px solid var(--cf-border);
        padding: 8px 14px;
        min-height: 42px;
        background-color: var(--cf-surface-solid);
        box-shadow: none;
        color: var(--cf-text);
        font-size: 0.9rem;
        font-weight: 400;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    }

        .cf-content .form-control:hover,
        .cf-content .form-select:hover,
        .cf-content textarea:hover,
        .form-control:hover,
        .form-select:hover,
        textarea:hover {
            border-color: var(--cf-border-strong);
            background-color: var(--cf-surface-solid);
        }

        .cf-content .form-control:focus,
        .cf-content .form-select:focus,
        .cf-content textarea:focus,
        .form-control:focus,
        .form-select:focus,
        textarea:focus {
            border-color: var(--cf-border-strong);
            background-color: var(--cf-surface-solid);
            box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.14);
            outline: none;
        }

        .cf-content .form-control:disabled,
        .cf-content .form-select:disabled,
        .cf-content textarea:disabled,
        .form-control:disabled,
        .form-select:disabled,
        textarea:disabled {
            background-color: #f3f6f9;
            border-color: #d8e2ec;
            color: #9aa3af;
            cursor: not-allowed;
            opacity: 1;
        }

.form-select {
    cursor: pointer;
    background-position: right 14px center;
    padding-right: 40px;
}

    .form-select:disabled {
        cursor: not-allowed;
    }

.form-control-color {
    width: 100%;
    max-width: 120px;
    padding: 6px;
    border-radius: var(--cf-radius-sm);
    cursor: pointer;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--cf-blue-500);
    box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.14);
}

.cf-inbox-table-card .table-responsive {
    border-radius: inherit;
    overflow: hidden;
    background: #ffffff;
}

.cf-content .table,
.table {
    background: white;
    overflow: hidden;
    color: var(--cf-text);
}

/* Topbar */
.cf-topbar {
    height: 76px;
    flex: 0 0 76px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--cf-border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: var(--cf-topbar-shadow);
    position: relative;
    z-index: 1800;
}

.cf-topbar-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

    .cf-topbar-left .cf-tenant-picker-wrap {
        display: flex;
        align-items: center;
    }

.cf-topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cf-text);
}

.cf-topbar-subtitle {
    color: var(--cf-text-muted);
    font-size: 0.9rem;
    margin-top: 2px;
}

.cf-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cf-topbar-icon-btn,
.cf-tenant-picker,
.cf-page-back-btn,
.cf-page-btn,
.cf-btn-secondary {
    border: 1px solid var(--cf-border);
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    box-shadow: none;
}

.cf-btn-secondary-disabled {
    background: #f3f6f9 !important;
    color: #9aa3af !important;
    border-color: #d8e2ec !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

    .cf-btn-secondary-disabled:hover {
        background: #f3f6f9 !important;
        color: #9aa3af !important;
        border-color: #d8e2ec !important;
    }

.cf-topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--cf-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--cf-transition);
}

    .cf-topbar-icon-btn:hover,
    .cf-page-back-btn:hover,
    .cf-page-btn:hover,
    .cf-btn-secondary:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-topbar-icon-wrap {
    position: relative;
    display: inline-flex;
}

.cf-topbar-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--cf-danger-600);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cf-topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cf-topbar-user-label {
    font-size: 0.75rem;
    color: var(--cf-text-muted);
}

.cf-topbar-user-email {
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--cf-text);
}

.cf-topbar-logout,
.cf-btn-primary,
button.cf-btn-primary,
.btn.btn-primary {
    border: none;
    color: white;
    background: var(--cf-primary-gradient);
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cf-topbar-logout {
    border-radius: var(--cf-radius-sm);
    padding: 10px 16px;
    font-weight: 600;
}

    .cf-topbar-logout:hover,
    .cf-btn-primary:hover,
    button.cf-btn-primary:hover,
    .btn.btn-primary:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: none;
    }

.cf-tenant-dropdown-host {
    position: relative;
}

.cf-tenant-dropdown-trigger {
    min-width: 260px;
    height: 42px;
    border-radius: var(--cf-radius-sm);
    border: 1px solid var(--cf-border);
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    box-shadow: 0 6px 18px rgba(7, 21, 47, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 0 16px;
    font-weight: 400;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, border-radius 0.15s ease;
}

    .cf-tenant-dropdown-trigger:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-tenant-dropdown-trigger.open {
        border-color: var(--cf-border-strong);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 10px 24px rgba(7, 21, 47, 0.08);
    }

.cf-tenant-dropdown-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-tenant-dropdown-chevron {
    font-size: 0.9rem;
    line-height: 1;
    color: var(--cf-text-muted);
    flex: 0 0 auto;
}

.cf-tenant-dropdown-menu {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    min-width: 260px;
    background: var(--cf-surface-solid);
    border: 1px solid var(--cf-border-strong);
    border-top: none;
    border-bottom-left-radius: var(--cf-radius-sm);
    border-bottom-right-radius: var(--cf-radius-sm);
    box-shadow: 0 16px 32px rgba(7, 21, 47, 0.10);
    overflow: hidden;
    z-index: 40;
}

.cf-tenant-dropdown-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 12px 16px;
    color: var(--cf-text);
    font-weight: 400;
    transition: background 0.15s ease, color 0.15s ease;
}

    .cf-tenant-dropdown-item:hover {
        background: var(--cf-surface-soft);
    }

    .cf-tenant-dropdown-item.selected {
        background: var(--cf-surface-soft);
        color: var(--cf-text);
    }

/* Shared custom select */

.cf-select-host {
    position: relative;
    width: 100%;
}

    .cf-select-host.disabled {
        opacity: 1;
    }

.cf-select-trigger {
    width: 100%;
    min-height: 42px;
    border-radius: var(--cf-radius-sm);
    border: 1px solid var(--cf-border);
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    box-shadow: 0 6px 18px rgba(7, 21, 47, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 0 16px;
    font-size: 0.9rem;
    font-weight: 400;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, border-radius 0.15s ease, background-color 0.15s ease;
}

    .cf-select-trigger:hover:not(:disabled) {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-select-trigger:focus-visible {
        outline: none;
        border-color: var(--cf-border-strong);
        box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.14);
    }

    .cf-select-trigger.open {
        border-color: var(--cf-border-strong);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 10px 24px rgba(7, 21, 47, 0.08);
    }

    .cf-select-trigger:disabled {
        background: #f3f6f9;
        border-color: #d8e2ec;
        color: #9aa3af;
        cursor: not-allowed;
        box-shadow: none;
    }

.cf-select-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-select-chevron {
    font-size: 0.9rem;
    line-height: 1;
    color: var(--cf-text-muted);
    flex: 0 0 auto;
}

.cf-select-menu {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--cf-surface-solid);
    border: 1px solid var(--cf-border-strong);
    border-top: none;
    border-bottom-left-radius: var(--cf-radius-sm);
    border-bottom-right-radius: var(--cf-radius-sm);
    box-shadow: 0 16px 32px rgba(7, 21, 47, 0.10);
    z-index: 2500;
}

.cf-select-item {
    width: 100%;
    min-height: 40px;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 16px;
    color: var(--cf-text);
    font-size: 0.9rem;
    font-weight: 400;
    transition: background 0.15s ease, color 0.15s ease;
}

    .cf-select-item:hover,
    .cf-select-item.selected {
        background: var(--cf-surface-soft);
        color: var(--cf-text);
    }

.cf-select-menu::-webkit-scrollbar {
    width: 10px;
}

.cf-select-menu::-webkit-scrollbar-track {
    background: transparent;
}

.cf-select-menu::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.38);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    .cf-select-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(94, 115, 140, 0.62);
        border: 2px solid transparent;
        background-clip: padding-box;
    }

/* Topbar profile */

.cf-topbar-profile-trigger {
    width: 40px;
    height: 40px;
    border: 1px solid var(--cf-border);
    background: var(--cf-surface-solid);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    transition: var(--cf-transition);
    overflow: hidden;
}

    .cf-topbar-profile-trigger:hover,
    .cf-topbar-profile-trigger.open {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-topbar-profile-avatar,
.cf-profile-popover-avatar {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.cf-topbar-profile-avatar-image,
.cf-profile-popover-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    display: block;
}

.cf-profile-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-lg);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    z-index: 1900;
}

.cf-profile-popover-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #eef2f7;
    background: #fcfdff;
}

.cf-profile-popover-avatar,
.cf-profile-popover-avatar-image {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.cf-profile-popover-user {
    min-width: 0;
}

.cf-profile-popover-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cf-text);
    line-height: 1.2;
    word-break: break-word;
}

.cf-profile-popover-email {
    margin-top: 3px;
    font-size: 0.8rem;
    color: var(--cf-text-muted);
    line-height: 1.25;
    word-break: break-word;
}

.cf-profile-popover-menu {
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.cf-profile-popover-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--cf-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--cf-transition);
}

    .cf-profile-popover-item:hover {
        background: #f8fafc;
    }

.cf-profile-popover-footer {
    padding: 12px 16px;
    border-top: 1px solid #eef2f7;
    background: #fcfdff;
}

.cf-profile-popover-logout {
    width: 100%;
    min-height: 38px;
    border: none;
    border-radius: 10px;
    color: white;
    background: var(--cf-primary-gradient);
    box-shadow: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

    .cf-profile-popover-logout:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: none;
    }

@media (max-width: 640px) {
    .cf-profile-popover {
        width: 260px;
        right: 0;
    }
}

/* Account profile page */

.cf-account-profile-avatar-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 4px;
}

.cf-account-profile-avatar,
.cf-account-profile-avatar-image {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 112px;
}

.cf-account-profile-avatar {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    user-select: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.cf-account-profile-avatar-image {
    object-fit: cover;
    display: block;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.cf-upload-btn {
    display: inline-flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cf-transition);
    box-shadow: none;
    text-align: center;
}

    .cf-upload-btn:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-upload-input-hidden {
    display: none !important;
}

/* Theme page */

.cf-theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cf-theme-card {
    width: 100%;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: var(--cf-transition);
    box-shadow: none;
}

    .cf-theme-card:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-theme-card.selected {
        border-color: var(--cf-blue-600);
        box-shadow: inset 0 0 0 1px rgba(var(--cf-primary-rgb), 0.18);
        background: rgba(var(--cf-primary-rgb), 0.04);
    }

.cf-theme-swatch {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    flex: 0 0 54px;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.cf-theme-card-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cf-theme-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cf-text);
    line-height: 1.2;
}

.cf-theme-card-subtitle {
    font-size: 0.8rem;
    color: var(--cf-text-muted);
    line-height: 1.3;
}

.cf-theme-preview-card {
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(7, 21, 47, 0.06);
}

.cf-theme-preview-bar {
    height: 64px;
    width: 100%;
}

.cf-theme-preview-body {
    padding: 14px;
}

.cf-theme-preview-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cf-text);
    line-height: 1.2;
}

.cf-theme-preview-subtitle {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--cf-text-muted);
    line-height: 1.35;
}

.cf-theme-grid,
.cf-theme-card,
.cf-theme-preview-card {
    position: relative;
    z-index: 1;
}

.cf-theme-actions {
    position: relative;
    z-index: 5;
}

    .cf-theme-actions .cf-btn-primary,
    .cf-theme-actions .cf-btn-secondary {
        position: relative;
        z-index: 6;
    }

.cf-btn-primary-disabled {
    background: #f3f6f9 !important;
    color: #9aa3af !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    border: none !important;
}

    .cf-btn-primary-disabled:hover {
        background: #f3f6f9 !important;
        color: #9aa3af !important;
        box-shadow: none !important;
        transform: none !important;
        filter: none !important;
    }

@media (max-width: 768px) {
    .cf-theme-grid {
        grid-template-columns: 1fr;
    }
}

/* Home */
.cf-home {
    min-height: calc(100vh - 128px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-home-card {
    background: white;
    border-radius: var(--cf-radius-2xl);
    box-shadow: var(--cf-card-shadow);
    padding: 48px;
    max-width: 760px;
    width: 100%;
    border: 1px solid var(--cf-border);
}

.cf-home-badge,
.brand-badge,
.cf-platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--cf-primary-gradient-soft);
    color: var(--cf-blue-700);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(15, 111, 255, 0.1);
}

.cf-home-title,
.cf-platform-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--cf-text);
    margin-bottom: 14px;
    letter-spacing: -0.03em;
}

.cf-home-subtitle,
.cf-platform-subtitle {
    font-size: 1.05rem;
    color: var(--cf-text-muted);
    margin-bottom: 24px;
    max-width: 620px;
}

.cf-home-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.cf-btn-primary,
.cf-btn-secondary {
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 0;
    min-height: 38px;
}

.cf-btn-secondary {
    background: var(--cf-surface-solid);
    color: var(--cf-text);
}

    .cf-btn-secondary:hover {
        background: var(--cf-surface-soft);
    }

/* MFA login portal */

.cf-mfa-portal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3200;
    background: rgba(6, 17, 38, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
}

.cf-mfa-portal-dialog {
    width: min(460px, 96vw);
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.34);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cf-mfa-portal-accent {
    display: none;
}

.cf-mfa-portal-header {
    padding: 22px 24px 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfe 100%);
}

.cf-mfa-portal-eyebrow {
    color: var(--cf-blue-700);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.cf-mfa-portal-title {
    margin: 0;
    color: var(--cf-text);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.cf-mfa-portal-subtitle {
    margin: 8px 0 0;
    color: var(--cf-text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

    .cf-mfa-portal-subtitle strong {
        color: var(--cf-text);
        font-weight: 700;
    }

.cf-mfa-portal-body {
    padding: 4px 24px 20px;
}

.cf-mfa-code-input {
    min-height: 54px;
    text-align: center;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.28em;
    padding-left: 0.28em !important;
}

.cf-mfa-remember-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cf-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

    .cf-mfa-remember-row input {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
    }

.cf-mfa-expiry-note {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    color: var(--cf-text-muted);
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.cf-mfa-error {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(219, 47, 82, 0.22);
    background: #fff1f2;
    color: #9f1239;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
}

.cf-mfa-portal-footer {
    padding: 16px 24px 22px;
    border-top: 1px solid var(--cf-border);
    background: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

    .cf-mfa-portal-footer .cf-btn-primary,
    .cf-mfa-portal-footer .cf-btn-secondary {
        min-height: 40px;
        padding: 9px 14px;
    }

@media (max-width: 640px) {
    .cf-mfa-portal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .cf-mfa-portal-dialog {
        width: 100%;
        border-radius: 22px;
    }

    .cf-mfa-portal-footer {
        flex-direction: column-reverse;
    }

        .cf-mfa-portal-footer .cf-btn-primary,
        .cf-mfa-portal-footer .cf-btn-secondary {
            width: 100%;
        }
}

/* Auth */
.cf-auth-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef4fa 0%, #eaf2f9 100%);
    padding: 0;
    overflow: hidden;
}

.cf-auth-panel,
.login-card {
    width: 100%;
    max-width: 520px;
    padding: 40px;
}

.cf-login-wrap .form-label,
.form-label {
    font-weight: 600;
    color: var(--cf-text);
    margin-bottom: 4px;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.cf-password-wrap {
    position: relative;
}

.cf-password-input {
    padding-right: 52px;
}

.cf-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    color: var(--cf-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .cf-password-toggle:hover {
        color: var(--cf-text);
    }

.cf-password-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.cf-microsoft-login-btn {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 16px;
    background: #ffffff;
    color: #1f1f1f;
    border: 1px solid #d0d7e2;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.18s ease;
}

    .cf-microsoft-login-btn:hover {
        background: #f8fafc;
        border-color: #b9c7db;
    }

    .cf-microsoft-login-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.cf-microsoft-login-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 auto;
}

/* Compact workspace tables */

.cf-content .table thead th,
.cf-content table thead th {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cf-content .table tbody td,
.cf-content table tbody td {
    font-size: 0.88rem;
    line-height: 1.25;
}

/* Actions / status */
.cf-user-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.cf-action-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--cf-text-muted);
    border-radius: var(--cf-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--cf-transition);
}

    .cf-action-icon-btn:hover {
        background: #f1f5f9;
        color: var(--cf-text);
    }

.cf-action-icon-btn-danger {
    color: #dc2626;
}

    .cf-action-icon-btn-danger:hover {
        background: #fef2f2;
        color: #b91c1c;
    }

.cf-status-pill {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    transition: var(--cf-transition);
}

.cf-status-pill-active {
    background: linear-gradient(135deg, var(--cf-success-600) 0%, var(--cf-success-500) 100%);
    color: white;
}

    .cf-status-pill-active:hover {
        filter: brightness(0.96);
    }

.cf-status-pill-inactive {
    background: #64748b;
    color: white;
}

    .cf-status-pill-inactive:hover {
        background: #475569;
    }

.cf-status-pill-overdue {
    background: linear-gradient(135deg, var(--cf-danger-600) 0%, var(--cf-danger-500) 100%);
    color: white;
}

.cf-status-pill-attention {
    background: linear-gradient(135deg, var(--cf-warning-600) 0%, var(--cf-warning-500) 100%);
    color: white;
}

.cf-status-pill-normal {
    background: #e2e8f0;
    color: var(--cf-text);
}

.cf-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
}

.cf-unread-badge-alert {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.18);
}

.cf-unread-empty {
    display: inline-block;
    min-width: 16px;
    color: var(--cf-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
}

.cf-highlight-pill,
.cf-scope-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--cf-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: 0 6px 16px rgba(7, 21, 47, 0.08);
}

.cf-user-mfa-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .cf-user-mfa-compact .cf-dashboard-switch {
        width: 42px;
        height: 24px;
        flex: 0 0 42px;
    }

        .cf-user-mfa-compact .cf-dashboard-switch span::before {
            width: 18px;
            height: 18px;
        }

        .cf-user-mfa-compact .cf-dashboard-switch input:checked + span::before {
            transform: translateX(18px);
        }

.cf-user-mfa-state {
    color: var(--cf-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.cf-format-rule-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
    box-shadow: none;
}

.cf-format-rule-modal {
    width: min(980px, 96vw);
    max-height: min(880px, 92vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 0;
    padding-bottom: 0;
}

.cf-format-rule-modal-header {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-left: -1px;
    margin-right: -1px;
    padding: 20px 1px 14px;
    background: #ffffff;
    border-bottom: 1px solid rgba(217, 229, 242, 0.86);
}

.cf-format-rule-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin-top: 18px;
    margin-left: -1px;
    margin-right: -1px;
    padding: 14px 1px 20px;
    background: #ffffff;
    border-top: 1px solid rgba(217, 229, 242, 0.86);
}

.cf-format-editor-section {
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
}

.cf-format-editor-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--cf-text);
}

.cf-format-icon-picker {
    display: block;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: #f8fbfe;
    padding: 12px;
}

.cf-format-icon-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cf-format-icon-selected {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--cf-text);
}

.cf-format-icon-selected-glyph {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: #ffffff;
    color: inherit;
    font-size: 21px;
}

.cf-format-icon-selected-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: capitalize;
}

.cf-format-icon-selected-empty {
    color: var(--cf-text-muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.cf-format-icon-search {
    width: 100%;
    margin-bottom: 10px;
}

.cf-format-icon-categories {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 10px;
    scrollbar-width: thin;
}

.cf-format-icon-category {
    flex: 0 0 auto;
    min-height: 32px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-text-muted);
    padding: 5px 11px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-format-icon-category:hover:not(:disabled) {
        border-color: var(--cf-border-strong);
        background: var(--cf-surface-soft);
        color: var(--cf-text);
    }

    .cf-format-icon-category.selected {
        border-color: rgba(var(--cf-primary-rgb), 0.34);
        background: rgba(var(--cf-primary-rgb), 0.08);
        color: var(--cf-blue-700);
        box-shadow: inset 0 0 0 1px rgba(var(--cf-primary-rgb), 0.08);
    }

    .cf-format-icon-category:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.cf-format-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 6px;
    max-height: 246px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 115, 140, 0.42) transparent;
}

    .cf-format-icon-grid::-webkit-scrollbar {
        width: 10px;
    }

    .cf-format-icon-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-format-icon-grid::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.42);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

.cf-format-icon-option {
    width: 100%;
    min-width: 42px;
    height: 42px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--cf-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-format-icon-option .material-symbols-outlined {
        font-size: 22px;
        color: inherit;
    }

    .cf-format-icon-option:hover:not(:disabled) {
        border-color: var(--cf-border);
        background: var(--cf-surface-soft);
        color: var(--cf-blue-700);
        transform: translateY(-1px);
    }

    .cf-format-icon-option.selected {
        border-color: var(--cf-blue-600);
        background: rgba(var(--cf-primary-rgb), 0.09);
        color: var(--cf-blue-700);
        box-shadow: 0 0 0 3px rgba(var(--cf-primary-rgb-soft), 0.14);
    }

    .cf-format-icon-option:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.cf-format-icon-empty {
    border: 1px dashed var(--cf-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--cf-text-muted);
    padding: 12px;
    text-align: center;
    font-size: 0.84rem;
}

.cf-format-icon-help {
    margin-top: 9px;
    color: var(--cf-text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

/* Action Table Price/Currency type details */
.cf-price-format-panel {
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: #f8fbfe;
    padding: 14px;
}

.cf-price-format-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cf-price-format-title {
    color: var(--cf-text);
    font-size: 0.9rem;
    font-weight: 700;
}

.cf-price-format-subtitle {
    margin-top: 3px;
    color: var(--cf-text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.cf-price-currency-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--cf-text);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

    .cf-price-currency-toggle input {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
    }

.cf-price-format-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.62fr);
    gap: 14px;
    align-items: stretch;
}

.cf-price-format-field {
    min-width: 0;
}

.cf-price-preview-card {
    min-width: 0;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #ffffff;
    padding: 13px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cf-price-preview-label {
    color: var(--cf-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cf-price-preview-value {
    margin-top: 5px;
    color: var(--cf-text);
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-price-preview-note {
    margin-top: 5px;
    color: var(--cf-text-muted);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
    .cf-price-format-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .cf-price-currency-toggle {
        width: 100%;
    }

    .cf-price-format-grid {
        grid-template-columns: 1fr;
    }
}

.cf-format-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-format-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
    cursor: pointer;
}

    .cf-format-color-swatch.selected {
        border-color: var(--cf-blue-600);
        box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.16);
    }

.cf-format-color-input {
    width: 52px;
    min-width: 52px;
    height: 34px;
    padding: 4px;
}

.cf-format-size-control {
    display: inline-grid;
    grid-template-columns: 42px 110px 42px;
    gap: 8px;
    align-items: center;
}

.cf-format-editor-preview {
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    padding: 14px 16px;
    background: #ffffff;
    font-weight: 600;
}

.cf-format-rule-preview {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--cf-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 46px;
}

.cf-format-rule-preview-icon {
    color: inherit;
    font-size: 24px;
    font-weight: inherit;
}

.cf-format-rule-condition {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qf-grid-table tbody tr.qf-format-rule-row > td {
    background-color: inherit;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    text-transform: inherit;
}

    .qf-grid-table tbody tr.qf-format-rule-row > td .qf-cell-text {
        color: inherit;
        font-size: inherit;
        font-weight: inherit;
        font-style: inherit;
        text-decoration: inherit;
        text-transform: inherit;
    }

/* Inbox */
.cf-inbox-sort-trigger {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    font: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    text-align: left;
}

    .cf-inbox-sort-trigger:hover {
        color: var(--cf-blue-700);
    }

    .cf-inbox-sort-trigger:focus-visible {
        outline: none;
        color: var(--cf-blue-700);
    }

.cf-inbox-sort-arrow {
    font-size: 19px;
    line-height: 1;
    color: var(--cf-text-muted);
    opacity: 0.45;
}

    .cf-inbox-sort-arrow.active {
        color: var(--cf-blue-700);
        opacity: 1;
    }

.cf-inbox-table thead th.cf-inbox-sort-active {
    background: rgba(var(--cf-primary-rgb), 0.06);
    box-shadow: inset 0 -2px 0 var(--cf-blue-600);
}

.cf-content:has(.cf-inbox-page) {
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 16px;
    padding-bottom: 16px;
}

.cf-inbox-page {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-inbox-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cf-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: #f8fbfe;
    color: var(--cf-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--cf-transition);
    box-shadow: none;
}

    .cf-icon-btn:hover:not(:disabled) {
        background: rgba(15, 111, 255, 0.06);
        color: var(--cf-blue-600);
        border-color: rgba(15, 111, 255, 0.18);
    }

    .cf-icon-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.cf-inbox-filter-card {
    margin-bottom: 0 !important;
    background: transparent;
    box-shadow: none !important;
    border: 1px solid var(--cf-border);
}

    .cf-inbox-filter-card .card-body {
        padding: 10px 12px;
    }

.cf-inbox-filter-bar-my-view {
    grid-template-columns: minmax(240px, 1.45fr) auto auto;
}

.cf-inbox-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.cf-inbox-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 2px;
}

.cf-inbox-content-card {
    min-height: 0;
    overflow: hidden;
}

.cf-inbox-table-card {
    overflow: hidden;
    box-shadow: none;
    border-radius: var(--cf-radius-xl);
    background: var(--cf-surface);
}

.cf-inbox-table {
    margin-bottom: 0;
}

    .cf-inbox-table thead th {
        background: #f8fbfe;
        color: var(--cf-text);
        font-weight: 600;
        white-space: nowrap;
        box-shadow: inset 0 -1px 0 #dbe5ef;
        padding: 8px 12px;
        font-size: 0.92rem;
    }

        .cf-inbox-table thead th:first-child {
            border-top-left-radius: var(--cf-radius-xl);
        }

        .cf-inbox-table thead th:last-child {
            border-top-right-radius: var(--cf-radius-xl);
        }

    .cf-inbox-table tbody tr {
        transition: background-color 0.18s ease;
    }

    .cf-inbox-table tbody td {
        vertical-align: middle;
        padding: 6px 12px;
        font-size: 0.93rem;
        line-height: 1.12;
        color: var(--cf-text);
    }

    .cf-inbox-table tbody .fw-semibold {
        line-height: 1.1;
    }

    .cf-inbox-table tbody .small {
        font-size: 0.74rem;
        margin-top: 1px;
        color: var(--cf-text-muted);
    }

.cf-inbox-row-overdue {
    background: linear-gradient(0deg, rgba(255, 84, 104, 0.08), rgba(255, 84, 104, 0.08)), #fff5f5;
}

    .cf-inbox-row-overdue td {
        background: transparent !important;
        border-color: rgba(255, 84, 104, 0.18);
    }

    .cf-inbox-row-overdue:hover {
        background: linear-gradient(0deg, rgba(255, 84, 104, 0.12), rgba(255, 84, 104, 0.12)), #fff1f2;
    }

.cf-inbox-row-unread {
    background: #f8fbff;
}

    .cf-inbox-row-unread:hover {
        background: #f2f8ff;
    }

.cf-page-btn {
    border-radius: var(--cf-radius-xs);
    padding: 6px 11px;
    font-weight: 600;
    min-height: 36px;
}

    .cf-page-btn:disabled {
        opacity: 0.5;
    }

.cf-page-label {
    font-size: 0.9rem;
    color: var(--cf-text);
    font-weight: 600;
}

.cf-inbox-filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1.35fr) minmax(180px, 0.95fr) auto auto;
    gap: 12px;
    align-items: end;
}

.cf-inbox-filter-search,
.cf-inbox-filter-select {
    min-width: 0;
}

.cf-inbox-filter-bar .form-control,
.cf-inbox-filter-bar .form-select {
    min-height: 42px;
    padding: 8px 14px;
    border-radius: var(--cf-radius-sm);
}

.cf-inbox-filter-toggles {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.cf-inbox-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: var(--cf-text);
    margin: 0;
    white-space: nowrap;
}

    .cf-inbox-check input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

.cf-inbox-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

    .cf-inbox-filter-actions .cf-btn-secondary,
    .cf-inbox-filter-actions .cf-btn-primary {
        min-width: 106px;
        padding: 7px 14px;
        min-height: 40px;
    }

.cf-scope-btn {
    border: none;
    background: transparent;
    color: var(--cf-text-muted);
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 12px;
    transition: var(--cf-transition);
}

    .cf-scope-btn.active {
        color: white;
        background: var(--cf-primary-gradient);
        box-shadow: none;
    }

    .cf-scope-btn:hover:not(.active) {
        background: rgba(var(--cf-primary-rgb), 0.08);
        color: var(--cf-text);
    }

.cf-inbox-table .cf-btn-secondary {
    min-width: 74px;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}

.cf-inbox-table .cf-status-pill {
    padding: 4px 10px;
    font-size: 0.8rem;
    line-height: 1;
}

.cf-inbox-table .cf-unread-badge {
    min-width: 28px;
    height: 28px;
    font-size: 0.84rem;
}

.cf-conversation-customer-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cf-conversation-channel-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    object-fit: contain;
    opacity: 0.92;
}

.cf-conversation-customer-text {
    min-width: 0;
}

@media (max-width: 1200px) {
    .cf-inbox-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .cf-inbox-filter-actions {
        justify-content: flex-start;
    }

    .cf-inbox-filter-bar-my-view {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .cf-content:has(.cf-inbox-page) {
        overflow: visible;
    }

    .cf-inbox-filter-bar {
        grid-template-columns: 1fr;
    }

    .cf-inbox-filter-toggles,
    .cf-inbox-filter-actions {
        padding-bottom: 0;
    }
}

/* Email conversation reader */
.cf-email-page {
    height: calc(100vh - 76px);
    background: #eef4fb;
    padding: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cf-email-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
}

.cf-email-reader {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.cf-email-subject-strip {
    background: #ffffff;
    border: 1px solid #d9e4f2;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
}

    .cf-email-subject-strip h2 {
        font-size: 1.05rem;
        line-height: 1.3;
        margin: 0;
        font-weight: 700;
        color: #111827;
    }

.cf-email-summary-btn {
    border: 0;
    background: transparent;
    color: #111827;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.65;
}

.cf-email-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.cf-email-card {
    background: #ffffff;
    border: 1px solid #d9e4f2;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    padding: 1rem;
    flex: 0 0 auto;
}

.cf-email-message-header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 1rem;
}

.cf-email-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #d79ad6;
    color: #5b215b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.cf-email-message-meta {
    min-width: 0;
}

.cf-email-from-line {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    flex-wrap: wrap;
    color: #111827;
}

.cf-email-from-name {
    color: #111827;
    font-size: 0.875rem;
    font-weight: 400;
}

.cf-email-from-line span,
.cf-email-to-line {
    color: #4b5563;
    font-size: 0.875rem;
}

.cf-email-date {
    color: #4b5563;
    font-size: 0.82rem;
    text-align: right;
    white-space: nowrap;
}

.cf-email-body {
    color: #111827;
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 0.95rem;
    max-width: 1100px;
    margin-left: 50px;
}

.cf-email-attachments {
    margin-left: 50px;
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cf-email-attachment-chip {
    border: 1px solid #d9e4f2;
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #111827;
}

    .cf-email-attachment-chip small {
        color: #6b7280;
    }

.cf-email-reply-card {
    background: #ffffff;
    border: 1px solid #d9e4f2;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    padding: 1rem;
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.cf-email-reply-textarea {
    min-height: 120px;
    resize: vertical;
}

.cf-email-reply-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cf-email-tools-strip {
    align-items: flex-start;
}

.cf-email-thread-heading {
    min-width: 0;
}

.cf-email-thread-eyebrow {
    color: var(--cf-blue-700);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cf-email-thread-subtitle {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.82rem;
}

.cf-email-thread-tools {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    min-width: min(620px, 100%);
    flex: 0 1 720px;
}

.cf-email-search-host {
    position: relative;
    min-width: 280px;
    flex: 1 1 auto;
}

.cf-email-search-input {
    min-height: 40px;
    padding-left: 14px;
    padding-right: 14px;
}

.cf-email-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 2600;
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    box-shadow: 0 22px 48px rgba(7, 21, 47, 0.16);
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}

.cf-email-search-result {
    width: 100%;
    border: none;
    background: #ffffff;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    transition: var(--cf-transition);
}

    .cf-email-search-result:last-child {
        border-bottom: none;
    }

    .cf-email-search-result:hover {
        background: #f8fbfe;
    }

.cf-email-search-result-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.cf-email-search-result-subject {
    min-width: 0;
    color: var(--cf-text);
    font-size: 0.88rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-email-search-result-time {
    flex: 0 0 auto;
    color: var(--cf-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.cf-email-search-result-meta {
    margin-top: 3px;
    color: var(--cf-text-muted);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-email-search-result-snippet {
    margin-top: 6px;
    color: var(--cf-text);
    font-size: 0.8rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.cf-email-search-empty {
    padding: 14px;
    color: var(--cf-text-muted);
    font-size: 0.86rem;
}

.cf-email-sort-switch {
    flex: 0 0 auto;
}

    .cf-email-sort-switch .cf-scope-btn {
        min-height: 40px;
        padding: 7px 12px;
        font-size: 0.82rem;
    }

.cf-email-message-subject-top {
    margin: 0 0 0.75rem 50px;
    color: var(--cf-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.cf-email-bcc-line {
    margin-left: 50px;
    margin-bottom: 0.5rem;
    color: var(--cf-text-muted);
    font-size: 0.84rem;
}

.cf-email-card-search-focus {
    animation: cf-email-search-focus 1.8s ease;
}

.cf-conversation-detail-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cf-conversation-detail-heading-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: contain;
    opacity: 0.92;
}

.cf-conversation-detail-heading-text {
    min-width: 0;
}

    .cf-conversation-detail-heading-text h2,
    .cf-conversation-detail-heading-text .cf-chat-customer-name {
        margin-bottom: 0;
    }

.cf-chat-header-modern {
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cf-chat-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-left: auto;
}

.cf-conversation-header-assignee {
    color: var(--cf-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: right;
    max-width: 420px;
}

    .cf-conversation-header-assignee span {
        font-weight: 600;
        margin-right: 4px;
    }

    .cf-conversation-header-assignee strong {
        color: var(--cf-text-muted);
        font-weight: 600;
    }

.cf-conversation-shell-whatsapp .cf-conversation-main {
    width: 100%;
}

.cf-conversation-shell-whatsapp {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 768px) {
    .cf-chat-header-modern {
        flex-direction: column;
        align-items: stretch;
    }

    .cf-chat-header-right {
        align-items: flex-start;
        width: 100%;
    }

    .cf-conversation-header-assignee {
        text-align: left;
        max-width: 100%;
    }

    .cf-email-thread-tools .cf-conversation-header-assignee {
        width: 100%;
        text-align: left;
    }
}

@keyframes cf-email-search-focus {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--cf-primary-rgb), 0.0), 0 1px 4px rgba(15, 23, 42, 0.08);
        border-color: #d9e4f2;
    }

    20% {
        box-shadow: 0 0 0 5px rgba(var(--cf-primary-rgb-soft), 0.22), 0 12px 28px rgba(15, 23, 42, 0.12);
        border-color: rgba(var(--cf-primary-rgb), 0.38);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--cf-primary-rgb), 0.0), 0 1px 4px rgba(15, 23, 42, 0.08);
        border-color: #d9e4f2;
    }
}

@media (max-width: 768px) {
    .cf-email-page {
        height: auto;
        min-height: calc(100vh - 76px);
        overflow: visible;
    }

    .cf-email-reader {
        overflow: visible;
    }

    .cf-email-thread {
        overflow: visible;
    }

    .cf-email-subject-strip {
        flex-direction: column;
        align-items: flex-start;
    }

    .cf-email-message-header {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .cf-email-date {
        grid-column: 2;
        text-align: left;
        white-space: normal;
    }

    .cf-email-body,
    .cf-email-attachments {
        margin-left: 0;
    }

    .cf-email-reply-card {
        position: static;
    }

    .cf-email-thread-tools {
        width: 100%;
        flex-direction: column;
    }

    .cf-email-search-host {
        width: 100%;
        min-width: 0;
    }

    .cf-email-sort-switch {
        width: 100%;
    }

        .cf-email-sort-switch .cf-scope-btn {
            flex: 1 1 0;
        }

    .cf-email-message-subject-top,
    .cf-email-bcc-line {
        margin-left: 0;
    }
}

/* Conversation */
.cf-conversation-page {
    height: calc(100vh - 132px);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cf-conversation-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.cf-conversation-shell-whatsapp .cf-conversation-main,
.cf-conversation-shell-whatsapp .cf-conversation-side {
    min-width: 0;
    min-height: 0;
}

.cf-conversation-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.cf-chat-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: var(--cf-surface-solid);
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    box-shadow: var(--cf-card-shadow);
}

.cf-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid #d8e2ec;
    background: rgba(255, 255, 255, 0.92);
}

.cf-chat-header-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cf-chat-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-chat-customer-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.1;
}

.cf-chat-subtitle {
    color: var(--cf-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-chat-thread-wrap {
    min-height: 0;
    overflow: hidden;
    padding: 16px;
    background: var(--cf-surface);
}

.cf-message-thread {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-message-row {
    display: flex;
}

.cf-message-row-incoming {
    justify-content: flex-start;
}

.cf-message-row-outgoing {
    justify-content: flex-end;
}

.cf-message-bubble {
    max-width: min(72%, 760px);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.cf-message-bubble-incoming {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--cf-text);
}

.cf-message-bubble-outgoing {
    background: var(--cf-primary-gradient);
    border: none;
    color: white;
}

    .cf-message-bubble-outgoing,
    .cf-message-bubble-outgoing .cf-message-text,
    .cf-message-bubble-outgoing .cf-message-meta,
    .cf-message-bubble-outgoing .cf-message-status,
    .cf-message-bubble-outgoing .cf-message-attachment-file {
        color: #ffffff !important;
    }

.cf-messaging-message-bubble.outgoing,
.cf-messaging-message-bubble.outgoing .cf-messaging-message-text,
.cf-messaging-message-bubble.outgoing .cf-messaging-message-time,
.cf-messaging-message-bubble.outgoing .cf-messaging-message-sender {
    color: #ffffff !important;
}

.cf-message-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.72rem;
    opacity: 0.75;
    margin-bottom: 6px;
}

.cf-message-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    font-size: 0.94rem;
}

.cf-chat-composer {
    border-top: 1px solid #d8e2ec;
    background: rgba(255, 255, 255, 0.96);
    padding: 12px 14px 14px;
}

.cf-chat-textarea {
    min-height: 92px;
    max-height: 180px;
    resize: vertical;
    font-size: 0.94rem;
}

.cf-chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-pending-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cf-pending-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    border-radius: 12px;
    padding: 8px 10px;
}

.cf-pending-attachment-meta {
    min-width: 0;
}

.cf-conversation-side {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    background: transparent;
}

    .cf-conversation-side .card {
        background: var(--cf-surface-solid);
        border: 1px solid var(--cf-border);
        box-shadow: none;
    }

.cf-side-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-side-list-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.9rem;
}

.cf-break-all {
    word-break: break-all;
    text-align: right;
}

.cf-btn-primary-sm,
.cf-btn-secondary-sm {
    min-width: 0;
    padding: 9px 14px;
    font-size: 0.9rem;
    border-radius: 12px;
}

.cf-btn-primary,
.cf-btn-secondary {
    font-size: 0.95rem;
}

.cf-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.cf-message-attachment {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
}

.cf-message-attachment-image {
    max-width: 240px;
    max-height: 240px;
    border-radius: 12px;
    border: 1px solid var(--cf-border);
    object-fit: cover;
    background: white;
}

.cf-message-attachment-file {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    word-break: break-word;
    font-size: 0.88rem;
}

.cf-message-bubble-incoming .cf-message-attachment-file {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--cf-text);
}

.cf-message-bubble-outgoing .cf-message-attachment-file {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
}

.cf-message-thread::-webkit-scrollbar,
.cf-conversation-side::-webkit-scrollbar {
    width: 10px;
}

.cf-message-thread::-webkit-scrollbar-track,
.cf-conversation-side::-webkit-scrollbar-track {
    background: transparent;
}

.cf-message-thread::-webkit-scrollbar-thumb,
.cf-conversation-side::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.45);
    border-radius: 999px;
}

    .cf-message-thread::-webkit-scrollbar-thumb:hover,
    .cf-conversation-side::-webkit-scrollbar-thumb:hover {
        background: rgba(94, 115, 140, 0.7);
    }

@media (max-width: 1200px) {
    .cf-conversation-page {
        height: auto;
        min-height: 0;
    }

    .cf-conversation-shell {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .cf-conversation-main,
    .cf-conversation-side {
        min-height: auto;
        overflow: visible;
    }

    .cf-chat-panel {
        min-height: 720px;
    }

    .cf-conversation-side {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .cf-chat-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cf-chat-header-actions {
        width: 100%;
    }

    .cf-message-bubble {
        max-width: 88%;
    }

    .cf-chat-textarea {
        min-height: 84px;
    }
}
/* Contact rename trigger and portal */

.cf-contact-edit-trigger {
    width: 100%;
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 0;
    cursor: pointer;
}

    .cf-contact-edit-trigger:hover .cf-contact-edit-hint,
    .cf-contact-edit-trigger:focus-visible .cf-contact-edit-hint {
        opacity: 1;
        transform: translateX(0);
    }

    .cf-contact-edit-trigger:focus-visible {
        outline: 2px solid rgba(var(--cf-primary-rgb), 0.35);
        outline-offset: 4px;
        border-radius: 14px;
    }

.cf-contact-edit-trigger-detail {
    display: flex;
}

.cf-contact-edit-hint {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(var(--cf-primary-rgb), 0.08);
    color: var(--cf-blue-700);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.cf-contact-edit-portal {
    width: min(560px, 94vw);
    max-height: min(620px, 92vh);
    border-radius: var(--cf-radius-xl);
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.28);
}

    .cf-contact-edit-portal .cf-wizard-panel {
        margin: 0;
        padding: 18px;
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: none;
    }

    .cf-contact-edit-portal .cf-portal-header {
        margin: 0;
        border-top-left-radius: var(--cf-radius-xl);
        border-top-right-radius: var(--cf-radius-xl);
    }

    .cf-contact-edit-portal .cf-portal-footer {
        margin: 0;
        border-bottom-left-radius: var(--cf-radius-xl);
        border-bottom-right-radius: var(--cf-radius-xl);
    }

@media (hover: none) {
    .cf-contact-edit-hint {
        opacity: 1;
        transform: none;
    }
}

/* Channels admin page */

.cf-channels-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cf-channel-tabs-card {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    padding: 12px;
}

.cf-channel-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cf-channel-tab {
    width: 100%;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    transition: var(--cf-transition);
    box-shadow: 0 8px 18px rgba(7, 21, 47, 0.04);
}

    .cf-channel-tab:hover {
        background: #f8fbfe;
        border-color: var(--cf-border-strong);
        transform: translateY(-1px);
    }

    .cf-channel-tab.active {
        border-color: rgba(var(--cf-primary-rgb), 0.34);
        background: linear-gradient(135deg, rgba(var(--cf-primary-rgb), 0.06), rgba(var(--cf-primary-rgb-soft), 0.10));
        box-shadow: 0 12px 28px rgba(7, 21, 47, 0.08);
    }

.cf-channel-tab-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: #f8fbfe;
    border: 1px solid var(--cf-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cf-report-card-icon-text {
    color: var(--cf-blue-700);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.cf-channel-tab.active .cf-channel-tab-icon {
    background: #ffffff;
    border-color: rgba(var(--cf-primary-rgb), 0.18);
}

.cf-channel-tab-icon img {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    display: block;
}

.cf-channel-tab strong {
    display: block;
    color: var(--cf-text);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.15;
}

.cf-channel-tab small {
    display: block;
    margin-top: 3px;
    color: var(--cf-text-muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.cf-channel-section-card {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    overflow: hidden;
}

.cf-channel-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--cf-border);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfe 100%);
}

.cf-channel-section-title-wrap {
    min-width: 0;
}

.cf-channel-section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--cf-blue-700);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cf-channel-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cf-text);
    letter-spacing: -0.02em;
}

.cf-channel-section-subtitle {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.cf-channel-section-body {
    padding: 18px 20px 20px;
}

.cf-channel-setup-grid,
.cf-channel-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 16px;
}

.cf-channel-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cf-channel-inner-panel {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: var(--cf-radius-lg);
    padding: 16px;
    min-width: 0;
}

.cf-channel-inner-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.cf-channel-inner-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--cf-text);
    margin-bottom: 3px;
}

.cf-channel-inner-subtitle {
    color: var(--cf-text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.cf-channel-account-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.cf-channel-account-card {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 10px 26px rgba(7, 21, 47, 0.05);
    overflow: hidden;
}

.cf-channel-account-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(135deg, #ffffff 0%, #f9fcff 100%);
}

.cf-channel-account-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.cf-channel-account-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--cf-text);
}

.cf-channel-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    color: var(--cf-text);
}

.cf-channel-type-pill-email {
    background: rgba(15, 111, 255, 0.08);
    border-color: rgba(15, 111, 255, 0.18);
    color: var(--cf-blue-700);
}

.cf-channel-type-pill-whatsapp {
    background: rgba(15, 159, 106, 0.08);
    border-color: rgba(15, 159, 106, 0.18);
    color: var(--cf-success-600);
}

.cf-channel-type-pill-voip,
.cf-channel-type-pill-default {
    background: #f8fbfe;
    border-color: var(--cf-border);
    color: var(--cf-text-muted);
}

.cf-channel-account-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    margin-top: 8px;
}

.cf-channel-meta-item {
    min-width: 0;
    color: var(--cf-text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

    .cf-channel-meta-item strong {
        color: var(--cf-text);
        font-weight: 600;
    }

.cf-channel-account-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-channel-account-body {
    padding: 16px 18px 18px;
}

.cf-channel-mailbox-panel {
    margin-bottom: 16px;
    border: 1px solid rgba(var(--cf-primary-rgb), 0.14);
    background: linear-gradient(135deg, rgba(var(--cf-primary-rgb), 0.035), rgba(var(--cf-primary-rgb-soft), 0.07));
    border-radius: var(--cf-radius-lg);
    padding: 16px;
}

.cf-channel-mailbox-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.25fr) minmax(220px, 0.9fr) auto;
    gap: 12px;
    align-items: end;
}

.cf-channel-user-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    padding-right: 6px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 115, 140, 0.4) transparent;
}

    .cf-channel-user-check-grid::-webkit-scrollbar {
        width: 10px;
    }

    .cf-channel-user-check-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-channel-user-check-grid::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.4);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

        .cf-channel-user-check-grid::-webkit-scrollbar-thumb:hover {
            background: rgba(94, 115, 140, 0.65);
            border: 2px solid transparent;
            background-clip: padding-box;
        }

.cf-channel-table-wrap {
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-lg);
    overflow: hidden;
    background: #ffffff;
}

.cf-channel-table {
    margin-bottom: 0;
}

    .cf-channel-table thead th {
        background: #f8fbfe;
        border-bottom: 1px solid var(--cf-border);
        color: #667085;
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .cf-channel-table tbody td {
        vertical-align: middle;
        font-size: 0.86rem;
    }

.cf-channel-empty {
    border: 1px dashed var(--cf-border);
    background: #f8fbfe;
    border-radius: var(--cf-radius-lg);
    padding: 18px;
    color: var(--cf-text-muted);
    font-size: 0.9rem;
}

.cf-channel-validation-text {
    margin-top: 4px;
    font-size: 0.76rem;
    line-height: 1.35;
}

.cf-channel-validation-valid {
    color: var(--cf-success-600);
}

.cf-channel-validation-invalid {
    color: var(--cf-danger-600);
}

@media (max-width: 1200px) {
    .cf-channel-setup-grid,
    .cf-channel-info-grid {
        grid-template-columns: 1fr;
    }

    .cf-channel-mailbox-grid {
        grid-template-columns: 1fr 1fr;
    }

        .cf-channel-mailbox-grid .cf-channel-mailbox-action {
            grid-column: 1 / -1;
        }

    .cf-channel-user-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .cf-channel-tabs {
        grid-template-columns: 1fr;
    }

    .cf-channel-tab {
        padding: 12px;
    }

    .cf-channel-tab-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

        .cf-channel-tab-icon img {
            width: 22px !important;
            height: 22px !important;
            max-width: 22px !important;
            max-height: 22px !important;
        }

    .cf-channel-section-header,
    .cf-channel-account-card-header {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .cf-channel-account-meta-grid,
    .cf-channel-mailbox-grid,
    .cf-channel-user-check-grid {
        grid-template-columns: 1fr;
    }

    .cf-channel-account-actions {
        justify-content: flex-start;
    }
}

/* WhatsApp manual channel wizard */

.cf-channel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-channel-manual-portal {
    width: min(860px, 96vw);
}

.cf-wizard-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.cf-wizard-step {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-wizard-step span {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #eef4ff;
        color: var(--cf-blue-700);
        font-weight: 800;
        font-size: 0.82rem;
    }

    .cf-wizard-step strong {
        color: var(--cf-text);
        font-size: 0.88rem;
    }

    .cf-wizard-step.active {
        border-color: rgba(var(--cf-primary-rgb), 0.36);
        background: linear-gradient(135deg, rgba(var(--cf-primary-rgb), 0.06), rgba(var(--cf-primary-rgb-soft), 0.10));
        box-shadow: 0 12px 28px rgba(7, 21, 47, 0.08);
    }

    .cf-wizard-step.complete span {
        background: rgba(42, 181, 125, 0.14);
        color: var(--cf-success-600);
    }

.cf-wizard-panel {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: var(--cf-radius-xl);
    padding: 18px;
}

.cf-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cf-review-item {
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    border-radius: 14px;
    padding: 12px;
    min-width: 0;
}

    .cf-review-item span {
        display: block;
        color: var(--cf-text-muted);
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 4px;
    }

    .cf-review-item strong {
        display: block;
        color: var(--cf-text);
        font-size: 0.9rem;
        word-break: break-word;
    }

@media (max-width: 768px) {
    .cf-channel-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .cf-wizard-steps,
    .cf-review-grid {
        grid-template-columns: 1fr;
    }
}

/* Templates page */

.cf-template-preview-bubble {
    max-width: 520px;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.06);
    color: var(--cf-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.cf-template-preview-header {
    color: var(--cf-text);
    font-size: 0.94rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.cf-template-preview-body {
    color: var(--cf-text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.cf-template-preview-footer {
    margin-top: 10px;
    color: var(--cf-text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.cf-template-preview-buttons {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
}

.cf-template-preview-button {
    min-height: 34px;
    border: 1px solid rgba(var(--cf-primary-rgb), 0.16);
    background: rgba(var(--cf-primary-rgb), 0.045);
    color: var(--cf-blue-700);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
}

.cf-template-preview-phone {
    border: 1px solid var(--cf-border);
    background: linear-gradient(180deg, #f8fbfe 0%, #eef6fb 100%);
    border-radius: var(--cf-radius-xl);
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(7, 21, 47, 0.08);
}

.cf-template-preview-phone-header {
    min-height: 46px;
    border-bottom: 1px solid var(--cf-border);
    background: #ffffff;
    color: var(--cf-text);
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 800;
}

.cf-template-preview-phone .cf-template-preview-bubble {
    margin: 18px;
    max-width: none;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.08);
}

.cf-template-email-preview {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.05);
}

.cf-template-email-subject {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fbfe;
    color: var(--cf-text);
    font-size: 0.92rem;
    font-weight: 800;
}

.cf-template-email-body {
    padding: 14px;
    color: var(--cf-text);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 80px;
}

.cf-template-builder-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-template-button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cf-template-button-card {
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    border-radius: 16px;
    padding: 12px;
}

.cf-template-button-type {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(var(--cf-primary-rgb), 0.08);
    color: var(--cf-blue-700);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.cf-template-selected-preview {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 8px 18px rgba(7, 21, 47, 0.05);
}

.cf-template-selected-preview-name {
    color: var(--cf-text);
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.cf-template-selected-preview-body {
    color: var(--cf-text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .cf-template-button-grid {
        grid-template-columns: 1fr;
    }

    .cf-template-preview-phone .cf-template-preview-bubble {
        margin: 12px;
    }
}

/* WhatsApp template builder portal */

.cf-template-builder-portal {
    width: min(980px, 96vw);
    max-height: min(820px, 94vh);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.28);
}

    .cf-template-builder-portal .cf-portal-header {
        border-top-left-radius: var(--cf-radius-xl);
        border-top-right-radius: var(--cf-radius-xl);
    }

    .cf-template-builder-portal .cf-wizard-steps {
        margin: 0;
        padding: 14px 20px;
        border-bottom: 1px solid var(--cf-border);
        background: #ffffff;
    }

    .cf-template-builder-portal .cf-wizard-panel {
        margin: 18px 20px;
        overflow: visible;
        box-shadow: none;
    }

    .cf-template-builder-portal .cf-portal-footer {
        border-bottom-left-radius: var(--cf-radius-xl);
        border-bottom-right-radius: var(--cf-radius-xl);
    }

    .cf-template-builder-portal .cf-select-host {
        position: relative;
        z-index: 20;
    }

    .cf-template-builder-portal .cf-select-menu {
        z-index: 3600;
    }

    .cf-template-builder-portal .row {
        overflow: visible;
    }

@media (max-width: 768px) {
    .cf-template-builder-portal {
        width: 100%;
        max-height: 92vh;
    }

        .cf-template-builder-portal .cf-wizard-steps,
        .cf-template-builder-portal .cf-wizard-panel {
            margin-left: 14px;
            margin-right: 14px;
        }

        .cf-template-builder-portal .cf-wizard-steps {
            padding-left: 14px;
            padding-right: 14px;
        }
}

/* Email template builder portal */

.cf-email-template-builder-portal {
    width: min(980px, 96vw);
    max-height: min(820px, 94vh);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .cf-email-template-builder-portal .cf-portal-header {
        flex: 0 0 auto;
        border-top-left-radius: var(--cf-radius-xl);
        border-top-right-radius: var(--cf-radius-xl);
    }

    .cf-email-template-builder-portal .cf-wizard-panel {
        margin: 0;
        padding: 18px;
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .cf-email-template-builder-portal .cf-portal-footer {
        flex: 0 0 auto;
        border-bottom-left-radius: var(--cf-radius-xl);
        border-bottom-right-radius: var(--cf-radius-xl);
    }

    .cf-email-template-builder-portal textarea.form-control {
        min-height: 176px;
    }

    .cf-email-template-builder-portal .cf-template-email-preview {
        box-shadow: none;
    }

/* Template modal border cleanup */

.cf-template-builder-portal,
.cf-email-template-builder-portal,
.cf-template-parameter-portal {
    background: #ffffff;
}

    .cf-template-builder-portal .cf-portal-header,
    .cf-email-template-builder-portal .cf-portal-header,
    .cf-template-parameter-portal .cf-portal-header {
        margin: 0;
    }

    .cf-template-builder-portal .cf-portal-footer,
    .cf-email-template-builder-portal .cf-portal-footer,
    .cf-template-parameter-portal .cf-portal-footer {
        margin: 0;
    }

/* Template parameter mapping portal */

.cf-template-parameter-portal {
    width: min(980px, 96vw);
    max-height: min(820px, 94vh);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

    .cf-template-parameter-portal .cf-portal-header {
        flex: 0 0 auto;
        margin: 0;
        border-top-left-radius: var(--cf-radius-xl);
        border-top-right-radius: var(--cf-radius-xl);
    }

    .cf-template-parameter-portal .cf-wizard-panel {
        flex: 1 1 auto;
        min-height: 0;
        margin: 0;
        padding: 18px 18px 110px;
        border-left: none;
        border-right: none;
        border-radius: 0;
        overflow-y: auto;
        overflow-x: hidden;
        background: #ffffff;
        box-shadow: none;
    }

    .cf-template-parameter-portal .cf-portal-footer {
        flex: 0 0 auto;
        margin: 0;
        border-bottom-left-radius: var(--cf-radius-xl);
        border-bottom-right-radius: var(--cf-radius-xl);
    }

.cf-template-parameter-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cf-template-parameter-list {
    display: grid;
    gap: 12px;
    overflow: visible;
    position: relative;
}

.cf-template-parameter-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.045);
    overflow: visible;
    position: relative;
    z-index: 1;
}

    .cf-template-parameter-row:has(.cf-select-trigger.open) {
        z-index: 80;
    }

.cf-template-parameter-index {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 14px;
    background: rgba(var(--cf-primary-rgb), 0.07);
    color: var(--cf-blue-700);
    font-size: 0.95rem;
    font-weight: 900;
}

/* Compact variable badges inside the Action Table Automation Settings panel. */
.cf-automation-settings-panel .cf-template-parameter-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
}

.cf-automation-settings-panel .cf-template-parameter-index {
    width: 48px;
    min-width: 48px;
    min-height: 34px;
    height: 34px;
    padding: 0 7px;
    justify-self: start;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1;
}

.cf-template-parameter-fields {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    overflow: visible;
    position: relative;
}

    .cf-template-parameter-fields > div {
        min-width: 0;
    }

    .cf-template-parameter-fields .cf-select-host,
    .cf-template-parameter-fields .cf-select-trigger,
    .cf-template-parameter-fields .form-control {
        min-width: 0;
    }

    .cf-template-parameter-fields .cf-select-menu {
        z-index: 3900;
        max-width: 100%;
        max-height: 220px;
    }

.cf-template-parameter-field-cell {
    min-width: 0;
}

.cf-template-parameter-portal .cf-select-host {
    position: relative;
    z-index: 2;
}

    .cf-template-parameter-portal .cf-select-host:has(.cf-select-trigger.open) {
        z-index: 90;
    }

.cf-template-parameter-portal .cf-portal-footer {
    position: relative;
    z-index: 20;
}

@media (max-width: 1180px) {
    .cf-template-parameter-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .cf-template-parameter-summary,
    .cf-template-parameter-fields,
    .cf-template-parameter-row {
        grid-template-columns: 1fr;
    }

    .cf-template-parameter-index {
        justify-content: flex-start;
        padding: 0 14px;
    }
}

/* Session expiry portal */

.cf-session-portal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(6, 17, 38, 0.56);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
}

.cf-session-portal-dialog {
    width: min(460px, 96vw);
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.32);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.cf-session-portal-accent {
    height: 5px;
    width: 100%;
    background: var(--cf-primary-gradient);
}

.cf-session-portal-header {
    padding: 20px 22px 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfe 100%);
}

.cf-session-portal-eyebrow {
    color: var(--cf-blue-700);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 7px;
}

.cf-session-portal-title {
    margin: 0;
    color: var(--cf-text);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.cf-session-portal-subtitle {
    margin: 6px 0 0;
    color: var(--cf-text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.cf-session-portal-body {
    padding: 0 22px 18px;
    color: var(--cf-text);
    font-size: 0.92rem;
    line-height: 1.5;
}

    .cf-session-portal-body p {
        margin: 0;
    }

.cf-session-portal-message {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(219, 47, 82, 0.22);
    background: #fff1f2;
    color: #9f1239;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
}

.cf-session-portal-time {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    color: var(--cf-text-muted);
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.cf-session-portal-footer {
    padding: 16px 22px 20px;
    border-top: 1px solid var(--cf-border);
    background: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

    .cf-session-portal-footer .cf-btn-primary,
    .cf-session-portal-footer .cf-btn-secondary {
        min-height: 40px;
        padding: 9px 14px;
    }

@media (max-width: 640px) {
    .cf-session-portal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .cf-session-portal-dialog {
        width: 100%;
        border-radius: 22px;
    }

    .cf-session-portal-footer {
        flex-direction: column-reverse;
    }

        .cf-session-portal-footer .cf-btn-primary,
        .cf-session-portal-footer .cf-btn-secondary {
            width: 100%;
        }
}

/* Channels portal actions */

.cf-portal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2800;
    background: rgba(6, 17, 38, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cf-portal-dialog {
    width: min(980px, 96vw);
    max-height: min(820px, 92vh);
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cf-channel-mailbox-portal {
    width: min(1120px, 96vw);
}

.cf-portal-header {
    flex: 0 0 auto;
    padding: 18px 20px;
    border-bottom: 1px solid var(--cf-border);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfe 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.cf-portal-eyebrow {
    color: var(--cf-blue-700);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.cf-portal-title {
    margin: 0;
    color: var(--cf-text);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cf-portal-subtitle {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.cf-portal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-text);
    font-size: 1.3rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--cf-transition);
}

    .cf-portal-close:hover:not(:disabled) {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-portal-close:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.cf-portal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px;
    background: #f8fbfe;
}

.cf-portal-footer {
    flex: 0 0 auto;
    padding: 14px 20px;
    border-top: 1px solid var(--cf-border);
    background: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cf-mailbox-portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.cf-mailbox-search-panel,
.cf-mailbox-side-panel {
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: var(--cf-radius-lg);
    padding: 16px;
    min-width: 0;
}

.cf-mailbox-side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cf-side-panel-section + .cf-side-panel-section {
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.cf-panel-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.cf-panel-title {
    color: var(--cf-text);
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.cf-panel-subtitle {
    color: var(--cf-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.cf-domain-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.cf-domain-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(var(--cf-primary-rgb), 0.07);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.12);
    color: var(--cf-blue-700);
    font-size: 0.74rem;
    font-weight: 700;
}

.cf-mailbox-result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.cf-mailbox-result-card {
    width: 100%;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: var(--cf-transition);
}

    .cf-mailbox-result-card:hover {
        background: #f8fbfe;
        border-color: var(--cf-border-strong);
    }

    .cf-mailbox-result-card.selected {
        border-color: rgba(var(--cf-primary-rgb), 0.36);
        background: rgba(var(--cf-primary-rgb), 0.05);
        box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.08);
    }

.cf-mailbox-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--cf-primary-gradient);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    flex: 0 0 42px;
}

.cf-mailbox-avatar-lg {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
}

.cf-mailbox-result-main,
.cf-selected-mailbox-main,
.cf-user-picker-main {
    min-width: 0;
}

.cf-mailbox-result-title,
.cf-selected-mailbox-title {
    color: var(--cf-text);
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-mailbox-result-address,
.cf-selected-mailbox-address {
    margin-top: 3px;
    color: var(--cf-text-muted);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-mailbox-selected-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--cf-primary-gradient);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

.cf-selected-mailbox-empty {
    border: 1px dashed var(--cf-border);
    background: #f8fbfe;
    border-radius: 16px;
    padding: 14px;
    color: var(--cf-text-muted);
    font-size: 0.86rem;
}

.cf-selected-mailbox-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    border-radius: 16px;
    padding: 12px;
}

.cf-selected-user-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cf-selected-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 8px 5px 10px;
    border-radius: 999px;
    background: rgba(var(--cf-primary-rgb), 0.08);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.14);
    color: var(--cf-text);
    font-size: 0.8rem;
    font-weight: 700;
}

    .cf-selected-user-chip button {
        width: 20px;
        height: 20px;
        border: none;
        border-radius: 999px;
        background: rgba(7, 21, 47, 0.08);
        color: var(--cf-text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding: 0;
    }

        .cf-selected-user-chip button:hover:not(:disabled) {
            background: rgba(219, 47, 82, 0.12);
            color: var(--cf-danger-600);
        }

.cf-user-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.cf-user-picker-row {
    width: 100%;
    border: 1px solid var(--cf-border);
    background: #ffffff;
    border-radius: 14px;
    padding: 10px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    text-align: left;
    transition: var(--cf-transition);
}

    .cf-user-picker-row:hover:not(:disabled) {
        background: #f8fbfe;
        border-color: var(--cf-border-strong);
    }

    .cf-user-picker-row:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

.cf-user-picker-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #64748b, #94a3b8);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 800;
}

.cf-user-picker-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cf-user-picker-name {
    color: var(--cf-text);
    font-size: 0.86rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-user-picker-meta {
    color: var(--cf-text-muted);
    font-size: 0.76rem;
}

.cf-user-picker-add {
    color: var(--cf-blue-700);
    font-size: 0.78rem;
    font-weight: 800;
}

@media (max-width: 980px) {
    .cf-portal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .cf-portal-dialog,
    .cf-channel-mailbox-portal {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px;
    }

    .cf-mailbox-portal-grid {
        grid-template-columns: 1fr;
    }

    .cf-mailbox-result-list,
    .cf-user-picker-list {
        max-height: 300px;
    }
}

@media (max-width: 640px) {
    .cf-portal-header,
    .cf-portal-body,
    .cf-portal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .cf-portal-footer {
        flex-direction: column-reverse;
    }

        .cf-portal-footer .cf-btn-primary,
        .cf-portal-footer .cf-btn-secondary {
            width: 100%;
        }

    .cf-mailbox-result-card {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .cf-mailbox-selected-pill {
        grid-column: 2;
        justify-self: flex-start;
    }
}

/* Channel number edit portal */

.cf-channel-number-edit-portal {
    width: min(980px, 96vw);
    max-height: min(760px, 92vh);
}

    .cf-channel-number-edit-portal .cf-portal-body {
        min-height: 420px;
        overflow: visible;
    }

    .cf-channel-number-edit-portal .cf-select-menu {
        z-index: 3200;
    }

@media (max-width: 980px) {
    .cf-channel-number-edit-portal .cf-portal-body {
        overflow-y: auto;
    }
}

/* Tenant users portal */

.cf-user-portal-dialog {
    width: min(980px, 96vw);
    max-height: min(760px, 92vh);
}

    .cf-user-portal-dialog .cf-portal-body {
        min-height: 360px;
        overflow: visible;
    }

    .cf-user-portal-dialog .cf-select-menu {
        z-index: 3200;
    }

@media (max-width: 980px) {
    .cf-user-portal-dialog .cf-portal-body {
        overflow-y: auto;
    }
}

/* Page header / breadcrumbs */
.cf-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.cf-page-header-left {
    min-width: 0;
}

.cf-page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-page-header-title-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.cf-page-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--cf-text);
    letter-spacing: -0.02em;
}

.cf-page-subtitle {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.85rem;
}

.cf-page-back-btn {
    border-radius: var(--cf-radius-sm);
    padding: 10px 14px;
    font-weight: 600;
    transition: var(--cf-transition);
}

.cf-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.cf-breadcrumb-link {
    color: var(--cf-text-muted);
    text-decoration: none;
}

    .cf-breadcrumb-link:hover {
        color: var(--cf-text);
    }

.cf-breadcrumb-current {
    color: var(--cf-text);
    font-weight: 600;
}

.cf-breadcrumb-separator {
    color: var(--cf-text-muted);
}

.cf-content:has(.cf-team-page-v2) {
    overflow: hidden;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Shared Messaging Layout */
.cf-messaging-page {
    padding: 16px 18px 18px;
    height: calc(100vh - 128px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cf-messaging-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 0;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.cf-messaging-page-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--cf-text);
    line-height: 1.05;
}

.cf-messaging-page-subtitle {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.92rem;
}

.cf-messaging-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-left: 0;
}

.cf-messaging-sidebar-card,
.cf-messaging-chat-card {
    border-radius: 24px;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    background: transparent !important;
    border: 1px solid var(--cf-border) !important;
    box-shadow: none !important;
}

.cf-messaging-sidebar-card {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    min-width: 0;
}

.cf-messaging-chat-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: transparent !important;
}

/* Shared Messaging Sidebar */
.cf-messaging-sidebar-top {
    padding: 14px;
    border-bottom: 1px solid var(--cf-border);
    background: transparent;
    flex: 0 0 auto;
}

.cf-messaging-sidebar-scroll {
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
    background: transparent;
    padding: 6px 6px 12px 0;
}

.cf-messaging-sidebar-section {
    padding: 8px 0;
}

.cf-messaging-sidebar-divider {
    height: 1px;
    background: var(--cf-border);
    margin: 8px 12px;
}

.cf-messaging-section-toggle {
    width: calc(100% - 24px);
    margin: 0 12px 10px 12px;
    padding: 10px 12px;
    border: 1px solid #e3eaf2;
    border-radius: 12px;
    background: #f1f4f8;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cf-text);
    text-transform: none;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-messaging-section-toggle:hover {
        background: #e9eef5;
    }

.cf-messaging-section-chevron {
    width: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--cf-text-muted);
    flex-shrink: 0;
}

.cf-messaging-section-content {
    padding-top: 2px;
}

/* Shared Messaging List Rows */
.cf-messaging-row {
    width: calc(100% - 16px);
    margin: 0 8px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
    transition: var(--cf-transition);
    border-bottom: 1px solid #f2f5f9;
    border-radius: 14px;
}

    .cf-messaging-row:hover,
    .cf-messaging-row.active {
        background: rgba(var(--cf-primary-rgb), 0.06);
    }

.cf-messaging-row-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
    color: #fff;
}

.cf-messaging-row-avatar-company,
.cf-messaging-row-avatar-group,
.cf-messaging-row-avatar-direct,
.cf-messaging-row-avatar-person {
    background: var(--cf-primary-gradient);
}

.cf-messaging-row-main {
    min-width: 0;
    flex: 1;
}

.cf-messaging-row-top,
.cf-messaging-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cf-messaging-row-title {
    font-weight: 600;
    color: var(--cf-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-messaging-row-time,
.cf-messaging-row-preview {
    color: var(--cf-text-muted);
    font-size: 0.82rem;
}

.cf-messaging-row-time {
    flex-shrink: 0;
}

.cf-messaging-row-preview {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.cf-messaging-empty-list {
    padding: 0 16px 12px;
    color: var(--cf-text-muted);
}

/* Shared Messaging Chat */
.cf-messaging-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cf-border);
    background: transparent;
    flex: 0 0 auto;
}

.cf-messaging-chat-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cf-messaging-chat-header-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cf-messaging-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    background: var(--cf-primary-gradient);
    flex-shrink: 0;
}

.cf-messaging-row-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.cf-messaging-chat-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.cf-messaging-chat-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cf-text);
    line-height: 1.15;
}

.cf-messaging-chat-subtitle {
    font-size: 0.82rem;
    color: var(--cf-text-muted);
}

.cf-messaging-chat-subtitle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.cf-messaging-chat-detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-messaging-chat-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--cf-text);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

.cf-messaging-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
    background: transparent;
}

.cf-messaging-empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 100%;
    text-align: center;
    color: var(--cf-text-muted);
    padding: 24px;
}

.cf-messaging-empty-chat-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--cf-text);
    margin-bottom: 8px;
}

.cf-messaging-empty-thread {
    color: var(--cf-text-muted);
}

.cf-messaging-date-divider {
    display: flex;
    justify-content: center;
    margin: 10px 0 16px;
}

    .cf-messaging-date-divider span {
        padding: 4px 10px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.06);
        color: var(--cf-text-muted);
        font-size: 0.78rem;
        font-weight: 600;
    }

.cf-messaging-message-row {
    display: flex;
    margin-bottom: 12px;
}

    .cf-messaging-message-row.incoming {
        justify-content: flex-start;
    }

    .cf-messaging-message-row.outgoing {
        justify-content: flex-end;
    }

.cf-messaging-message-bubble {
    max-width: min(76%, 760px);
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

    .cf-messaging-message-bubble.incoming {
        background: #fff;
        color: var(--cf-text);
    }

    .cf-messaging-message-bubble.outgoing {
        background: var(--cf-primary-gradient);
        color: #fff;
    }

.cf-messaging-message-sender {
    font-size: 0.76rem;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.78;
}

.cf-messaging-message-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.42;
}

.cf-messaging-message-time {
    margin-top: 6px;
    font-size: 0.72rem;
    opacity: 0.75;
    text-align: right;
}

.cf-messaging-composer {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--cf-border);
    background: transparent;
    flex: 0 0 auto;
}

.cf-messaging-textarea {
    resize: none;
    min-height: 96px;
}

.cf-messaging-composer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.cf-messaging-inline-panel {
    padding: 0 16px 12px;
}

.cf-messaging-side-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 10px;
}

.cf-messaging-side-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: #fff;
}

.cf-messaging-side-panel-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cf-messaging-side-panel-name {
    font-weight: 600;
    color: var(--cf-text);
}

.cf-messaging-side-panel-meta {
    font-size: 0.82rem;
    color: var(--cf-text-muted);
}

.cf-messaging-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
}

.cf-messaging-row-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 6px;
}

    .cf-messaging-row-wrap .cf-messaging-row {
        width: 100%;
    }

.cf-messaging-row-trash {
    width: 36px;
    min-width: 36px;
    height: auto;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .cf-messaging-row-trash:hover {
        background: rgba(239, 68, 68, 0.08);
        color: #dc2626;
    }

    .cf-messaging-row-trash svg {
        width: 17px;
        height: 17px;
    }

/* Shared Alerts / Badges */
.cf-messaging-alert {
    padding: 12px;
    border-radius: 12px;
    white-space: pre-wrap;
}

.cf-messaging-alert-error {
    border: 1px solid #efb2b2;
    background: #ffe8e8;
    color: #8d1f1f;
}

.cf-messaging-alert-info {
    border: 1px solid #b8d7e6;
    background: #dff5ff;
    color: #184b63;
}

.cf-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

/* Scrollbars */
.cf-messaging-sidebar-scroll::-webkit-scrollbar,
.cf-messaging-thread::-webkit-scrollbar,
.cf-messaging-side-panel::-webkit-scrollbar {
    width: 10px;
}

.cf-messaging-sidebar-scroll::-webkit-scrollbar-track,
.cf-messaging-thread::-webkit-scrollbar-track,
.cf-messaging-side-panel::-webkit-scrollbar-track {
    background: transparent;
}

.cf-messaging-sidebar-scroll::-webkit-scrollbar-thumb,
.cf-messaging-thread::-webkit-scrollbar-thumb,
.cf-messaging-side-panel::-webkit-scrollbar-thumb {
    background: #c7d2df;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    .cf-messaging-sidebar-scroll::-webkit-scrollbar-thumb:hover,
    .cf-messaging-thread::-webkit-scrollbar-thumb:hover,
    .cf-messaging-side-panel::-webkit-scrollbar-thumb:hover {
        background: #aebdce;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

/* Responsive */
@media (max-width: 1100px) {
    .cf-messaging-shell {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .cf-messaging-row-preview {
        max-width: 180px;
    }
}

@media (max-width: 1200px) {
    .cf-messaging-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .cf-messaging-row-preview {
        max-width: 160px;
    }

    .cf-messaging-message-bubble {
        max-width: 82%;
    }
}

@media (max-width: 980px) {
    .cf-content:has(.cf-messaging-page) {
        overflow-y: auto;
    }

    .cf-messaging-page {
        padding: 14px;
        height: auto;
        min-height: calc(100vh - 110px);
    }

    .cf-messaging-page-header {
        align-items: flex-start;
    }

    .cf-messaging-shell {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .cf-messaging-sidebar-card {
        min-height: 320px;
        max-height: 380px;
    }

    .cf-messaging-chat-card {
        min-height: 640px;
    }

    .cf-messaging-thread {
        min-height: 360px;
    }

    .cf-nav-apps-flyout-portal {
        width: min(320px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        max-height: min(62vh, 460px);
    }
}

@media (max-width: 640px) {
    .cf-messaging-page {
        padding: 12px;
    }

    .cf-messaging-page-title {
        font-size: 1.3rem;
    }

    .cf-messaging-page-subtitle {
        font-size: 0.86rem;
    }

    .cf-messaging-chat-header {
        padding: 12px 14px;
    }

    .cf-messaging-chat-header-main {
        align-items: flex-start;
    }

    .cf-messaging-chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.78rem;
    }

    .cf-messaging-chat-title {
        font-size: 0.96rem;
    }

    .cf-messaging-chat-detail {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .cf-messaging-thread {
        padding: 12px;
        min-height: 320px;
    }

    .cf-messaging-message-bubble {
        max-width: 90%;
        padding: 9px 11px;
    }

    .cf-messaging-composer {
        padding: 12px;
    }

    .cf-chat-textarea {
        min-height: 84px;
    }

    .cf-chat-composer-actions > div {
        width: 100%;
    }

    .cf-chat-composer-actions .cf-btn-primary,
    .cf-chat-composer-actions .cf-btn-secondary {
        min-width: 0;
    }
}

/* Nav badge styling */
.cf-nav-link-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cf-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

.cf-unread-badge-alert {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
}

@media (max-width: 980px) {
    .cf-team-layout {
        grid-template-columns: 1fr;
    }

    .cf-team-main-body {
        min-height: 520px;
    }
}

/* Notifications page */

.cf-notifications-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cf-notifications-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.cf-notification-summary-card {
    border: 1px solid var(--cf-border);
    background: var(--cf-surface);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    padding: 16px;
    text-align: left;
    transition: var(--cf-transition);
    min-height: 118px;
}

    .cf-notification-summary-card:hover {
        transform: translateY(-1px);
        border-color: var(--cf-border-strong);
    }

    .cf-notification-summary-card.active {
        border-color: rgba(var(--cf-primary-rgb), 0.35);
        background: linear-gradient(135deg, rgba(var(--cf-primary-rgb), 0.07), rgba(var(--cf-primary-rgb-soft), 0.10));
        box-shadow: 0 16px 34px rgba(7, 21, 47, 0.08);
    }

.cf-notification-summary-label {
    color: var(--cf-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cf-notification-summary-value {
    margin-top: 10px;
    color: var(--cf-text);
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.cf-notification-summary-subtitle {
    margin-top: 8px;
    color: var(--cf-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.cf-notification-filter-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    border: 1px solid var(--cf-border);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfe 100%);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    padding: 16px;
}

.cf-notification-filter-left {
    min-width: 0;
}

.cf-notification-filter-title {
    color: var(--cf-text);
    font-size: 0.98rem;
    font-weight: 700;
}

.cf-notification-filter-subtitle {
    margin-top: 3px;
    color: var(--cf-text-muted);
    font-size: 0.84rem;
}

.cf-notification-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-notification-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-text);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-notification-toggle:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-notification-toggle input {
        width: 16px;
        height: 16px;
    }

.cf-notifications-list-shell {
    border: 1px solid var(--cf-border);
    background: var(--cf-surface);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    overflow: hidden;
}

.cf-notifications-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-bottom: 1px solid var(--cf-border);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfe 100%);
}

.cf-notifications-list-title {
    color: var(--cf-text);
    font-size: 1rem;
    font-weight: 800;
}

.cf-notifications-list-subtitle {
    margin-top: 3px;
    color: var(--cf-text-muted);
    font-size: 0.82rem;
}

.cf-notifications-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-notification-list {
    display: flex;
    flex-direction: column;
}

.cf-notification-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
    transition: var(--cf-transition);
}

    .cf-notification-card:last-child {
        border-bottom: none;
    }

    .cf-notification-card:hover {
        background: #f8fbfe;
    }

    .cf-notification-card.unread {
        background: linear-gradient(90deg, rgba(var(--cf-primary-rgb), 0.045), #ffffff 42%);
    }

    .cf-notification-card.read {
        opacity: 0.78;
    }

.cf-notification-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    background: var(--cf-primary-gradient);
}

    .cf-notification-card-icon.team {
        background: linear-gradient(135deg, #475569, #94a3b8);
    }

    .cf-notification-card-icon.whatsapp {
        background: linear-gradient(135deg, #0f9f6a, #18c47f);
    }

    .cf-notification-card-icon.email {
        background: linear-gradient(135deg, #0b5ee8, #22c7ff);
    }

    .cf-notification-card-icon.alert {
        background: linear-gradient(135deg, #eb8f00, #ffb020);
    }

    .cf-notification-card-icon.message {
        background: linear-gradient(135deg, #7c3aed, #a78bfa);
    }

.cf-notification-card-main {
    min-width: 0;
}

.cf-notification-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.cf-notification-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cf-notification-card-title {
    min-width: 0;
    color: var(--cf-text);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-notification-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--cf-danger-600);
    flex: 0 0 8px;
    box-shadow: 0 0 0 4px rgba(219, 47, 82, 0.10);
}

.cf-notification-card-message {
    margin-top: 5px;
    color: var(--cf-text);
    font-size: 0.88rem;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cf-notification-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 7px;
    color: var(--cf-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.cf-notification-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    color: var(--cf-text);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

    .cf-notification-type-pill.team {
        background: rgba(71, 85, 105, 0.08);
        border-color: rgba(71, 85, 105, 0.16);
        color: #475569;
    }

    .cf-notification-type-pill.whatsapp {
        background: rgba(15, 159, 106, 0.08);
        border-color: rgba(15, 159, 106, 0.18);
        color: var(--cf-success-600);
    }

    .cf-notification-type-pill.email {
        background: rgba(15, 111, 255, 0.08);
        border-color: rgba(15, 111, 255, 0.18);
        color: var(--cf-blue-700);
    }

    .cf-notification-type-pill.alert {
        background: rgba(235, 143, 0, 0.10);
        border-color: rgba(235, 143, 0, 0.20);
        color: var(--cf-warning-600);
    }

    .cf-notification-type-pill.message {
        background: rgba(124, 58, 237, 0.08);
        border-color: rgba(124, 58, 237, 0.18);
        color: #7c3aed;
    }

.cf-notification-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-notification-state-card {
    border: 1px solid var(--cf-border);
    background: var(--cf-surface);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    padding: 22px;
}

.cf-notification-state-error {
    border-color: rgba(219, 47, 82, 0.25);
    background: #fff1f2;
}

.cf-notification-state-title {
    color: var(--cf-text);
    font-size: 1rem;
    font-weight: 800;
}

.cf-notification-state-message {
    margin-top: 5px;
    color: var(--cf-text-muted);
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .cf-notifications-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cf-notification-card {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .cf-notification-card-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .cf-notifications-summary-grid {
        grid-template-columns: 1fr;
    }

    .cf-notification-filter-card,
    .cf-notifications-list-header {
        align-items: stretch;
    }

    .cf-notification-filter-actions,
    .cf-notifications-pagination {
        width: 100%;
        justify-content: flex-start;
    }

    .cf-notification-card {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 12px;
    }

    .cf-notification-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .cf-notification-card-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cf-notification-card-title {
        white-space: normal;
    }

    .cf-notification-card-actions {
        grid-column: 1 / -1;
    }

        .cf-notification-card-actions .cf-btn-secondary {
            flex: 1 1 0;
        }
}

/* Notification popover */
.cf-topbar-popover-host {
    position: relative;
}

.cf-notification-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: white;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-lg);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    z-index: 200;
}

.cf-notification-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}

.cf-notification-popover-list {
    max-height: 360px;
    overflow-y: auto;
}

.cf-notification-popover-empty {
    padding: 18px 16px;
    color: var(--cf-text-muted);
    font-size: 0.95rem;
}

.cf-notification-item {
    width: 100%;
    border: none;
    background: white;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.18s ease;
}

    .cf-notification-item:hover {
        background: #f8fafc;
    }

.cf-notification-item-title {
    font-weight: 600;
    color: var(--cf-text);
    margin-bottom: 4px;
}

.cf-notification-item-message {
    color: var(--cf-text);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.cf-notification-item-time {
    color: var(--cf-text-muted);
    font-size: 0.8rem;
}

.cf-notification-popover-footer {
    padding: 12px 16px;
    border-top: 1px solid #eef2f7;
    background: #fcfdff;
}

.cf-link-btn {
    border: none;
    background: transparent;
    color: var(--cf-blue-600);
    font-weight: 600;
    padding: 0;
}

    .cf-link-btn:hover {
        color: var(--cf-blue-700);
    }

/* Tenant Dashboard */

.cf-dashboard-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-dashboard-page {
    min-width: 0;
}

.cf-dashboard-widget-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.cf-dashboard-widget-cell {
    min-width: 0;
}

.cf-dashboard-widget-small {
    grid-column: span 3;
}

.cf-dashboard-widget-medium {
    grid-column: span 6;
}

.cf-dashboard-widget-large {
    grid-column: span 12;
}

.cf-dashboard-widget-card {
    position: relative;
    height: 100%;
    min-height: 150px;
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: var(--cf-card-shadow);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

    .cf-dashboard-widget-card:hover {
        border-color: var(--cf-border-strong);
    }

.cf-dashboard-editing .cf-dashboard-widget-card {
    border-style: dashed;
    box-shadow: 0 12px 28px rgba(7, 21, 47, 0.08);
}

    .cf-dashboard-editing .cf-dashboard-widget-card:hover {
        transform: translateY(-1px);
    }

.cf-dashboard-widget-cell[draggable="True"],
.cf-dashboard-widget-cell[draggable="true"] {
    cursor: grab;
}

    .cf-dashboard-widget-cell[draggable="True"]:active,
    .cf-dashboard-widget-cell[draggable="true"]:active {
        cursor: grabbing;
    }

.cf-dashboard-widget-card-drag-over {
    border-color: rgba(var(--cf-primary-rgb), 0.52) !important;
    box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.16), var(--cf-card-shadow) !important;
    transform: translateY(-2px);
}

    .cf-dashboard-widget-card-drag-over::after {
        content: "";
        position: absolute;
        inset: 8px;
        border: 2px dashed rgba(var(--cf-primary-rgb), 0.42);
        border-radius: calc(var(--cf-radius-xl) - 6px);
        pointer-events: none;
    }

.cf-dashboard-widget-edit-bar {
    height: 34px;
    padding: 6px 8px;
    border-bottom: 1px dashed var(--cf-border);
    background: #f8fbfe;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cf-dashboard-widget-drag {
    color: var(--cf-text-muted);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.08em;
    cursor: grab;
    user-select: none;
}

.cf-dashboard-widget-edit-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cf-dashboard-widget-edit {
    min-height: 24px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-text);
    padding: 2px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    transition: var(--cf-transition);
}

    .cf-dashboard-widget-edit:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-dashboard-widget-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: #fff1f2;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    font-weight: 700;
    transition: var(--cf-transition);
}

    .cf-dashboard-widget-remove:hover {
        background: #ffe4e6;
        color: #b91c1c;
    }

.cf-dashboard-widget-body {
    padding: 20px;
}

.cf-dashboard-widget-label {
    color: var(--cf-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.cf-dashboard-widget-value {
    color: var(--cf-text);
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.cf-dashboard-widget-value-danger {
    color: var(--cf-danger-600);
}

.cf-dashboard-widget-subtitle {
    color: var(--cf-text-muted);
    font-size: 0.82rem;
    margin-top: 10px;
}

.cf-dashboard-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.cf-dashboard-bar-row {
    display: grid;
    grid-template-columns: minmax(72px, 0.9fr) minmax(90px, 2fr) auto;
    align-items: center;
    gap: 10px;
}

.cf-dashboard-bar-label {
    min-width: 0;
    color: var(--cf-text);
    font-size: 0.78rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-dashboard-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #edf4fb;
    overflow: hidden;
}

.cf-dashboard-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--cf-primary-gradient);
    min-width: 3px;
}

.cf-dashboard-bar-value {
    color: var(--cf-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.cf-dashboard-line-chart {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cf-dashboard-line-svg-wrap {
    height: 96px;
    border-radius: 16px;
    background: #f8fbfe;
    border: 1px solid var(--cf-border);
    padding: 10px;
}

.cf-dashboard-line-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.cf-dashboard-line-polyline {
    fill: none;
    stroke: rgb(var(--cf-primary-rgb));
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.cf-dashboard-line-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--cf-text-muted);
    font-size: 0.76rem;
}

    .cf-dashboard-line-summary strong {
        color: var(--cf-text);
        font-size: 0.9rem;
    }

.cf-dashboard-widget-placeholder {
    min-height: 78px;
    border-radius: 16px;
    background: #f8fbfe;
    border: 1px dashed var(--cf-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cf-text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.cf-dashboard-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2600;
    background: rgba(6, 17, 38, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cf-dashboard-modal {
    width: min(560px, 96vw);
    max-height: min(720px, 92vh);
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 24px 70px rgba(7, 21, 47, 0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cf-dashboard-modal-header,
.cf-dashboard-modal-footer {
    flex: 0 0 auto;
    padding: 16px 18px;
    background: #fcfdff;
}

.cf-dashboard-modal-header {
    border-bottom: 1px solid var(--cf-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cf-dashboard-modal-footer {
    border-top: 1px solid var(--cf-border);
    display: flex;
    justify-content: flex-end;
}

.cf-dashboard-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
}

.cf-dashboard-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    transition: var(--cf-transition);
}

    .cf-dashboard-modal-close:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-dashboard-widget-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    transition: var(--cf-transition);
}

    .cf-dashboard-widget-toggle-row:hover {
        background: #f8fbfe;
    }

.cf-dashboard-switch {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 26px;
    flex: 0 0 46px;
}

    .cf-dashboard-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .cf-dashboard-switch span {
        position: absolute;
        inset: 0;
        cursor: pointer;
        background: #d7e2ee;
        border-radius: 999px;
        transition: var(--cf-transition);
    }

        .cf-dashboard-switch span::before {
            content: "";
            position: absolute;
            width: 20px;
            height: 20px;
            top: 3px;
            left: 3px;
            background: #ffffff;
            border-radius: 999px;
            box-shadow: 0 3px 8px rgba(7, 21, 47, 0.18);
            transition: var(--cf-transition);
        }

    .cf-dashboard-switch input:checked + span {
        background: var(--cf-primary-gradient);
    }

        .cf-dashboard-switch input:checked + span::before {
            transform: translateX(20px);
        }

@media (max-width: 1200px) {
    .cf-dashboard-widget-small {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .cf-dashboard-header-actions {
        width: 100%;
    }

        .cf-dashboard-header-actions .cf-scope-switch {
            width: 100%;
        }

        .cf-dashboard-header-actions .cf-scope-btn {
            flex: 1 1 0;
        }

    .cf-dashboard-widget-grid {
        grid-template-columns: 1fr;
    }

    .cf-dashboard-widget-small,
    .cf-dashboard-widget-medium,
    .cf-dashboard-widget-large {
        grid-column: span 1;
    }

    .cf-dashboard-modal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .cf-dashboard-modal {
        width: 100%;
        max-height: 88vh;
        border-radius: 22px;
    }
}

/* Scope switch */
.cf-scope-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: linear-gradient(135deg, #eaf4fb 0%, #eef8ff 100%);
    border-radius: var(--cf-radius-md);
    border: 1px solid var(--cf-border);
}

.cf-scope-btn {
    border: none;
    background: transparent;
    color: var(--cf-text);
    border-radius: var(--cf-radius-xs);
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--cf-transition);
}

    .cf-scope-btn.active {
        background: var(--cf-primary-gradient);
        color: white;
        box-shadow: var(--cf-soft-shadow);
    }

/* Platform */
.cf-platform-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 32px;
}

.cf-platform-main {
    width: 100%;
    max-width: 1200px;
}

.cf-platform-card {
    padding: 32px;
}

/* Loading */
.cf-loading-shell {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
}

.cf-loading-brand {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-loading-orb {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--cf-primary-gradient);
    box-shadow: 0 0 30px rgba(34, 199, 255, 0.45);
    animation: cf-pulse 1.8s ease-in-out infinite;
}

.cf-loading-ring {
    position: absolute;
    border-radius: 999px;
    border: 2px solid transparent;
    border-top-color: #0f6fff;
    border-right-color: rgba(34, 199, 255, 0.7);
}

.cf-loading-ring-one {
    width: 58px;
    height: 58px;
    animation: cf-spin 1.2s linear infinite;
}

.cf-loading-ring-two {
    width: 84px;
    height: 84px;
    border-top-color: rgba(127, 231, 255, 0.9);
    border-right-color: rgba(15, 111, 255, 0.5);
    animation: cf-spin-reverse 1.8s linear infinite;
}

.cf-loading-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cf-text);
}

.cf-loading-message {
    color: var(--cf-text-muted);
    font-size: 0.95rem;
}

.cf-loading-shell-compact {
    min-height: 180px;
    padding: 20px 8px;
    gap: 10px;
}

    .cf-loading-shell-compact .cf-loading-brand {
        width: 64px;
        height: 64px;
    }

    .cf-loading-shell-compact .cf-loading-orb {
        width: 18px;
        height: 18px;
    }

    .cf-loading-shell-compact .cf-loading-ring-one {
        width: 44px;
        height: 44px;
    }

    .cf-loading-shell-compact .cf-loading-ring-two {
        width: 64px;
        height: 64px;
    }

    .cf-loading-shell-compact .cf-loading-title {
        font-size: 0.92rem;
        text-align: center;
    }

    .cf-loading-shell-compact .cf-loading-message {
        font-size: 0.8rem;
        text-align: center;
    }

/* Responsive */
@media (max-width: 1200px) {
    .cf-conversation-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .cf-conversation-main,
    .cf-conversation-side {
        height: auto;
    }

    .cf-conversation-side,
    .cf-message-thread {
        overflow: visible;
        max-height: none;
    }
}

.cf-mobile-nav-toggle {
    display: none;
    margin-right: 12px;
    flex: 0 0 auto;
}

.cf-mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 17, 38, 0.52);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 120;
}

@media (max-width: 980px) {
    .cf-mobile-nav-toggle {
        display: inline-flex;
    }

    .cf-app-shell {
        display: flex;
        flex-direction: row;
        width: 100%;
        height: 100vh;
        overflow: hidden;
    }

    .cf-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(320px, 86vw);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 0 24px 50px rgba(7, 21, 47, 0.35);
        overflow-y: auto;
        overflow-x: visible;
        z-index: 130;
    }

        .cf-sidebar.cf-sidebar-mobile-open {
            transform: translateX(0);
        }

    .cf-mobile-sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .cf-main {
        width: 100%;
        min-width: 0;
        height: 100vh;
        overflow: hidden;
        grid-template-rows: 76px minmax(0, 1fr) auto;
    }

    .cf-topbar {
        padding: 0 16px;
        gap: 12px;
    }

    .cf-topbar-left {
        min-width: 0;
    }

    .cf-topbar-user {
        display: none;
    }

    .cf-tenant-dropdown-trigger {
        min-width: 200px;
        max-width: min(240px, 52vw);
    }

    .cf-content {
        padding: 16px;
    }

    .cf-legal-footer {
        padding: 12px 16px;
    }

    .cf-legal-footer-inner {
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .cf-topbar {
        height: auto;
        min-height: 76px;
        padding-top: 10px;
        padding-bottom: 10px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .cf-topbar-left,
    .cf-topbar-actions {
        width: 100%;
    }

    .cf-topbar-actions {
        justify-content: flex-end;
    }

    .cf-tenant-dropdown-trigger {
        min-width: 0;
        width: 100%;
        max-width: none;
    }

    .cf-content {
        padding: 12px;
    }

    .cf-legal-footer {
        padding: 10px 12px;
    }

    .cf-legal-footer-inner {
        gap: 12px;
        font-size: 10px;
    }
}

@media (max-width: 640px) {
    .cf-notification-popover {
        width: 320px;
        right: -20px;
    }

    .cf-topbar-actions {
        gap: 10px;
    }

    .cf-tenant-picker {
        min-width: 200px;
    }

    .cf-page-title {
        font-size: 1.7rem;
    }

    .cf-home-card,
    .cf-auth-panel,
    .login-card,
    .cf-platform-card {
        padding: 24px;
    }
}

/* Animations */
@keyframes cf-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes cf-spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes cf-pulse {
    0%, 100% {
        transform: scale(0.92);
        opacity: 0.82;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* Page transition */

.cf-page-transition {
    min-width: 0;
    min-height: 100%;
    animation: cf-page-enter 0.22s cubic-bezier(.22, 1, .36, 1);
}

@keyframes cf-page-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cf-page-transition {
        animation: none;
    }
}

.cf-login-screen {
    --cf-login-split: 44%;
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: var(--cf-login-split) minmax(0, 1fr);
    background: linear-gradient( 90deg, #07152f 0%, #0a2348 var(--cf-login-split), #eaf2f9 var(--cf-login-split), #eef4fa 100% );
    overflow: hidden;
    position: relative;
}

    .cf-login-screen::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(90deg, rgba(127, 231, 255, 0.03) 0, rgba(127, 231, 255, 0.03) 1px, transparent 1px, transparent 120px), linear-gradient(rgba(127, 231, 255, 0.02) 0, rgba(127, 231, 255, 0.02) 1px, transparent 1px, transparent 120px);
        mask-image: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 90%);
    }

.cf-login-hero,
.cf-login-panel-wrap {
    position: relative;
    z-index: 1;
}

.cf-login-hero {
    display: flex;
    align-items: center;
    padding: 64px 72px;
    min-width: 0;
    box-sizing: border-box;
}

.cf-login-hero-inner {
    width: 100%;
    max-width: 620px;
    min-width: 0;
}

.cf-login-hero-logo {
    display: block;
    width: 320px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 0 18px;
}

.cf-login-brand-mark {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(127, 231, 255, 0.08);
    border: 1px solid rgba(127, 231, 255, 0.18);
    color: #b9f3ff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 22px;
}

.cf-login-hero-title {
    margin: 0 0 12px;
    font-size: 1.8rem;
    line-height: 1.01;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: white;
}

.cf-login-hero-text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.76);
    max-width: 520px;
}

.cf-login-hero-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-login-hero-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(127, 231, 255, 0.14);
    color: #d9f8ff;
    font-size: 0.9rem;
    font-weight: 600;
}

.cf-login-panel-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 48px 24px 56px;
    background: transparent;
    backdrop-filter: none;
}

.cf-login-card {
    width: 100%;
    max-width: 500px;
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 22px 46px rgba(7, 21, 47, 0.10), 0 6px 18px rgba(15, 111, 255, 0.06);
    border: 1px solid rgba(191, 216, 240, 0.82);
}

.cf-login-card-title {
    margin: 0 0 10px;
    font-size: 2.3rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--cf-text);
}

.cf-login-card-subtitle {
    margin: 0 0 28px;
    font-size: 1rem;
    color: var(--cf-text-muted);
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .cf-login-screen {
        grid-template-columns: 1fr;
        background: linear-gradient(180deg, #07152f 0%, #0a2348 55%, #0c1f56 100%);
        min-height: 100vh;
        height: auto;
    }

        .cf-login-screen::before {
            background: linear-gradient(90deg, rgba(127, 231, 255, 0.03) 0, rgba(127, 231, 255, 0.03) 1px, transparent 1px, transparent 120px), linear-gradient(rgba(127, 231, 255, 0.02) 0, rgba(127, 231, 255, 0.02) 1px, transparent 1px, transparent 120px);
            mask-image: linear-gradient(180deg, rgba(255,255,255,0.16), transparent 90%);
        }

    .cf-login-hero {
        padding: 40px 32px 20px;
        align-items: flex-start;
    }

    .cf-login-hero-inner {
        max-width: 640px;
    }

    .cf-login-hero-title {
        font-size: 2.35rem;
        line-height: 1.04;
        max-width: 16ch;
    }

    .cf-login-hero-text {
        max-width: 620px;
    }

    .cf-login-panel-wrap {
        padding: 0 24px 32px;
        justify-content: flex-start;
        background: transparent;
    }

    .cf-login-card {
        max-width: 640px;
    }
}

@media (max-width: 640px) {
    .cf-login-screen {
        background: linear-gradient(180deg, #07152f 0%, #0a2348 55%, #0c1f56 100%);
    }

    .cf-login-hero {
        padding: 24px 20px 14px;
    }

    .cf-login-panel-wrap {
        padding: 0 16px 24px;
    }

    .cf-login-card {
        padding: 24px 20px;
        border-radius: 22px;
        max-width: none;
    }

    .cf-login-hero-title {
        font-size: 1.95rem;
        line-height: 1.06;
        max-width: 13ch;
    }

    .cf-login-hero-text {
        font-size: 0.95rem;
        line-height: 1.55;
        max-width: 100%;
    }

    .cf-login-card-title {
        font-size: 1.85rem;
    }

    .cf-login-hero-logo {
        width: 220px;
        max-width: 100%;
        margin-bottom: 14px;
    }
}

.cf-content::-webkit-scrollbar,
.cf-sidebar::-webkit-scrollbar {
    width: 10px;
}

.cf-content::-webkit-scrollbar-track,
.cf-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.cf-content::-webkit-scrollbar-thumb,
.cf-sidebar::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.45);
    border-radius: 999px;
}

    .cf-content::-webkit-scrollbar-thumb:hover,
    .cf-sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(94, 115, 140, 0.7);
    }

.cf-attach-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-md);
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    cursor: pointer;
    box-shadow: none;
    transition: var(--cf-transition);
}

    .cf-attach-btn:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-attach-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.cf-message-attachment {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
}

.cf-message-attachment-image {
    max-width: 260px;
    max-height: 260px;
    border-radius: 14px;
    border: 1px solid var(--cf-border);
    object-fit: cover;
    background: white;
}

.cf-message-attachment-file {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    word-break: break-word;
}

.cf-message-bubble-incoming .cf-message-attachment-file {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--cf-text);
}

.cf-message-attachment-image-btn {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.cf-image-viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 17, 38, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 3000;
}

.cf-image-viewer-dialog {
    width: min(1100px, 96vw);
    max-height: 92vh;
    background: var(--cf-surface-solid);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cf-image-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cf-border);
    background: var(--cf-surface);
}

.cf-image-viewer-title {
    font-weight: 600;
    color: var(--cf-text);
    word-break: break-word;
}

.cf-image-viewer-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    background: #f8fbfe;
}

.cf-image-viewer-image {
    max-width: 100%;
    max-height: calc(92vh - 100px);
    object-fit: contain;
    border-radius: 14px;
    background: white;
}

.cf-message-status {
    margin-top: 6px;
    font-size: 0.76rem;
    line-height: 1.2;
    color: var(--cf-text-muted);
}

.cf-inbox-graph-host {
    width: 100%;
    height: calc(100vh - 360px);
    min-height: 620px;
    background: #061126;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
}

    .cf-inbox-graph-host canvas {
        display: block;
        outline: none;
    }

.cf-graph-tooltip {
    position: absolute;
    z-index: 20;
    width: 340px;
    max-width: calc(100% - 24px);
    min-height: 180px;
    background: rgba(9, 18, 38, 0.96);
    border: 1px solid rgba(127, 231, 255, 0.18);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
    color: #fff;
    overflow: hidden;
    pointer-events: none;
}

.cf-graph-tooltip-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(15,111,255,0.22), rgba(15,111,255,0.08));
}

.cf-graph-tooltip-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.cf-graph-tooltip-subtitle {
    margin-top: 4px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.72);
}

.cf-graph-tooltip-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-graph-tooltip-message {
    display: flex;
    width: 100%;
}

    .cf-graph-tooltip-message.incoming {
        justify-content: flex-start;
    }

    .cf-graph-tooltip-message.outgoing {
        justify-content: flex-end;
    }

.cf-graph-tooltip-bubble {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 0.84rem;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
    color: #fff;
}

.cf-graph-tooltip-message.incoming .cf-graph-tooltip-bubble {
    background: rgba(255,255,255,0.1);
    border-top-left-radius: 8px;
}

.cf-graph-tooltip-message.outgoing .cf-graph-tooltip-bubble {
    background: linear-gradient(135deg, rgba(15,111,255,0.92), rgba(34,199,255,0.92));
    border-top-right-radius: 8px;
}

.cf-graph-tooltip-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: #fff;
}

.cf-graph-tooltip-meta {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.72);
}

.cf-graph-tooltip-status {
    color: rgba(255,255,255,0.82);
}

.cf-graph-tooltip-empty {
    color: rgba(255,255,255,0.68);
    font-size: 0.84rem;
}

@media (max-width: 1200px) {
    .cf-inbox-graph-host {
        min-height: 560px;
        height: 70vh;
    }
}

@media (max-width: 768px) {
    .cf-inbox-graph-host {
        min-height: 480px;
        height: 62vh;
    }

    .cf-graph-tooltip {
        width: min(320px, calc(100% - 24px));
        height: 320px;
    }

    .cf-graph-tooltip-date {
        margin-top: 24px;
        font-size: 0.42rem;
        color: rgba(255,255,255,0.62);
        font-weight: 600;
    }
}

/* Emoji picker */
.cf-emoji-picker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cf-emoji-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-md);
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    cursor: pointer;
    box-shadow: none;
    transition: var(--cf-transition);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
}

    .cf-emoji-toggle-btn:hover:not(:disabled) {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-emoji-toggle-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.cf-emoji-picker-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 340px;
    max-width: min(340px, 90vw);
    background: var(--cf-surface-solid);
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    box-shadow: 0 22px 48px rgba(7, 21, 47, 0.16);
    z-index: 2500;
    overflow: hidden;
}

.cf-emoji-picker-header {
    padding: 12px;
    border-bottom: 1px solid var(--cf-border);
    background: #fcfdff;
}

.cf-emoji-search {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.cf-emoji-category-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    scrollbar-width: thin;
}

    .cf-emoji-category-tabs::-webkit-scrollbar {
        height: 8px;
    }

    .cf-emoji-category-tabs::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-emoji-category-tabs::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.35);
        border-radius: 999px;
    }

.cf-emoji-category-tab {
    flex: 0 0 auto;
    border: 1px solid transparent;
    background: transparent;
    color: var(--cf-text-muted);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 1rem;
    line-height: 1;
    transition: var(--cf-transition);
}

    .cf-emoji-category-tab:hover {
        background: rgba(15, 111, 255, 0.06);
        color: var(--cf-text);
    }

    .cf-emoji-category-tab.active {
        background: var(--cf-primary-gradient-soft);
        border-color: rgba(15, 111, 255, 0.12);
        color: var(--cf-blue-700);
    }

.cf-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
}

    .cf-emoji-grid::-webkit-scrollbar {
        width: 10px;
    }

    .cf-emoji-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-emoji-grid::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.4);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

        .cf-emoji-grid::-webkit-scrollbar-thumb:hover {
            background: rgba(94, 115, 140, 0.65);
            border: 2px solid transparent;
            background-clip: padding-box;
        }

.cf-emoji-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 34px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--cf-transition);
    padding: 0;
}

    .cf-emoji-item:hover {
        background: rgba(15, 111, 255, 0.08);
        border-color: rgba(15, 111, 255, 0.12);
        transform: translateY(-1px);
    }

.cf-emoji-empty {
    grid-column: 1 / -1;
    padding: 18px 8px;
    text-align: center;
    color: var(--cf-text-muted);
    font-size: 0.92rem;
}

@media (max-width: 640px) {
    .cf-emoji-picker-panel {
        width: min(340px, 86vw);
        left: 0;
    }

    .cf-emoji-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

/* Legal pages */

.legal-page,
.privacy-policy-page {
    height: 100%;
    overflow-y: auto;
    padding: 40px 20px;
}

.legal-container,
.privacy-policy-container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

    .legal-container h1,
    .legal-container h2,
    .privacy-policy-container h1,
    .privacy-policy-container h2 {
        margin-top: 24px;
        margin-bottom: 12px;
        color: var(--cf-text);
    }

    .legal-container p,
    .legal-container li,
    .privacy-policy-container p,
    .privacy-policy-container li {
        line-height: 1.7;
        color: var(--cf-text);
    }

/* Public shell */

.cf-public-shell {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f6f8fb;
}

.cf-public-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Footer */

.cf-legal-footer {
    flex: 0 0 auto;
    background: #ffffff;
    border-top: 1px solid #eceff3;
    padding: 14px 20px;
    z-index: 5;
}

.cf-legal-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #9aa3af;
    line-height: 1;
}

.cf-legal-footer-copy {
    color: #9aa3af;
    white-space: nowrap;
}

.cf-legal-footer a {
    color: #9aa3af;
    text-decoration: none;
    white-space: nowrap;
}

    .cf-legal-footer a:hover {
        color: #6b7280;
        text-decoration: none;
    }
/* Power BI Workspace */

.cf-content:has(.cf-pbi-workspace-page) {
    overflow: hidden;
    padding-top: 12px;
    padding-bottom: 12px;
}

.cf-pbi-workspace-page {
    min-height: calc(100vh - 110px);
    height: auto;
    overflow: visible;
}

.cf-pbi-workspace-shell {
    display: grid;
    position: relative;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    height: auto;
    min-height: calc(100vh - 140px);
    overflow: visible;
    align-items: start;
    transition: grid-template-columns 0.22s ease;
}

    .cf-pbi-workspace-shell:has(.cf-pbi-sidebar.cf-pbi-sidebar-collapsed) {
        grid-template-columns: 0 minmax(0, 1fr);
    }

.cf-pbi-sidebar-toggle {
    position: absolute;
    top: 50%;
    left: 340px;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 72px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.10);
    z-index: 5;
    transition: left 0.22s ease, transform 0.22s ease, background 0.18s ease, border-color 0.18s ease;
}

    .cf-pbi-sidebar-toggle:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

.cf-pbi-sidebar.cf-pbi-sidebar-collapsed {
    width: 0;
    min-width: 0;
    border: 0 !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.cf-pbi-workspace-shell:has(.cf-pbi-sidebar.cf-pbi-sidebar-collapsed) .cf-pbi-sidebar-toggle {
    left: 0;
    transform: translate(50%, -50%);
}

.cf-pbi-sidebar,
.cf-pbi-main-card {
    min-width: 0;
    min-height: 0;
    align-self: start;
    box-shadow: none !important;
}

.cf-pbi-sidebar {
    height: calc(100vh - 170px);
    overflow: hidden;
}

.cf-pbi-main-card {
    height: auto;
    overflow: visible;
}

    .cf-pbi-sidebar .card-body,
    .cf-pbi-main-card .card-body {
        min-height: 0;
    }

.cf-pbi-sidebar-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.cf-pbi-report-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

    .cf-pbi-report-list::-webkit-scrollbar {
        width: 10px;
    }

    .cf-pbi-report-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-pbi-report-list::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.45);
        border-radius: 999px;
    }

.cf-pbi-report-group + .cf-pbi-report-group {
    margin-top: 10px;
}

.cf-pbi-report-btn,
.cf-pbi-page-btn {
    width: 100%;
    border: none;
    outline: none;
    text-align: left;
    transition: var(--cf-transition);
}

.cf-pbi-report-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 14px;
    padding: 14px 16px;
    background: #f5f8fc;
    color: var(--cf-text);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px #e1e9f2;
}

    .cf-pbi-report-btn:hover {
        background: #eef4fb;
    }

    .cf-pbi-report-btn.active {
        background: var(--cf-primary-gradient);
        color: white;
        box-shadow: none;
    }

.cf-pbi-report-btn-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-pbi-report-btn-toggle {
    flex: 0 0 auto;
    font-size: 1.1rem;
    line-height: 1;
}

.cf-pbi-page-list {
    margin-top: 8px;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-pbi-page-btn {
    border-radius: 12px;
    padding: 10px 12px;
    background: transparent;
    color: var(--cf-text-muted);
    font-weight: 600;
    box-shadow: none;
}

    .cf-pbi-page-btn:hover {
        background: rgba(15, 111, 255, 0.06);
        color: var(--cf-text);
    }

    .cf-pbi-page-btn.active {
        background: rgba(15, 111, 255, 0.10);
        color: var(--cf-blue-700);
    }

.cf-pbi-sidebar-footer {
    flex: 0 0 auto;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e9eef5;
}

.cf-pbi-back-btn {
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border: none;
    border-radius: 14px;
    background: var(--cf-primary-gradient);
    color: #ffffff;
    padding: 0 18px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

    .cf-pbi-back-btn:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: none;
    }

.cf-pbi-back-btn-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.cf-pbi-main-card .card-body.cf-pbi-main-body {
    height: auto;
    min-height: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.cf-pbi-report-stage,
.cf-pbi-report-stage.cf-pbi-report-stage-full {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100vh - 210px);
    overflow: hidden;
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: #f8fafc;
}

.cf-pbi-report-scroll-host {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: #f8fafc;
}

.cf-pbi-report-host {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #f8fafc;
    position: relative;
}

    .cf-pbi-report-host iframe,
    .cf-pbi-report-host > div,
    .cf-pbi-report-host .report,
    .cf-pbi-report-host .visualContainerHost {
        width: 100% !important;
        height: 100% !important;
    }

.cf-pbi-report-scroll-host::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.cf-pbi-report-scroll-host::-webkit-scrollbar-track {
    background: transparent;
}

.cf-pbi-report-scroll-host::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.45);
    border-radius: 999px;
}

    .cf-pbi-report-scroll-host::-webkit-scrollbar-thumb:hover {
        background: rgba(94, 115, 140, 0.7);
    }

@media (max-width: 1200px) {
    .cf-pbi-workspace-shell {
        grid-template-columns: 300px minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .cf-pbi-workspace-shell {
        display: block;
        position: relative;
        height: auto;
        overflow: visible;
        min-height: 0;
    }

    .cf-pbi-sidebar-toggle {
        position: fixed;
        top: 50%;
        left: 16px;
        transform: translateY(-50%);
        z-index: 140;
        width: 40px;
        height: 72px;
    }

    .cf-pbi-sidebar {
        position: fixed;
        top: 12px;
        left: 12px;
        width: min(320px, calc(86vw - 12px));
        height: calc(100dvh - 24px);
        z-index: 135;
        transform: translateX(calc(-100% - 16px));
        transition: transform 0.22s ease;
        box-shadow: 0 24px 50px rgba(7, 21, 47, 0.22);
        opacity: 1;
        pointer-events: auto;
    }

        .cf-pbi-sidebar.cf-pbi-sidebar-mobile-open {
            transform: translateX(0);
        }

        .cf-pbi-sidebar.cf-pbi-sidebar-collapsed {
            transform: translateX(calc(-100% - 16px));
            width: min(320px, calc(86vw - 12px));
            min-width: 0;
            opacity: 1;
            pointer-events: none;
            border: 1px solid var(--cf-border) !important;
        }

    .cf-pbi-main-card {
        height: auto;
        min-height: 0;
    }

        .cf-pbi-main-card .card-body.cf-pbi-main-body {
            height: auto;
            min-height: 0;
        }

    .cf-pbi-report-stage,
    .cf-pbi-report-stage.cf-pbi-report-stage-full {
        height: calc(100vh - 220px);
        min-height: 420px;
        overflow: hidden;
    }

    .cf-pbi-report-scroll-host,
    .cf-pbi-report-host {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
}

/* Workspace View header colour accent.
   The colour strip sits inside the card border while the
   rest of the card remains free to show dropdown menus. */

.cf-workspace-view-header-card {
    position: relative;
}

/* Action Table / Input Form Workspace Editor */

.action-table-header-card {
    position: relative;
    overflow: visible;
    z-index: 20;
}

    /* Keep the Action Table export menu above its transparent close backdrop. */
    .action-table-header-card:has(.cf-report-export-menu) {
        z-index: 1400;
    }

    .action-table-header-card:has(.cf-select-trigger.open) {
        z-index: 3000;
    }

    .action-table-header-card .card-body {
        position: relative;
        overflow: visible;
        z-index: 5;
    }

    .action-table-header-card .row,
    .action-table-header-card [class*="col-"] {
        overflow: visible;
    }

    .action-table-header-card .cf-select-host {
        position: relative;
        z-index: 50;
    }

        .action-table-header-card .cf-select-host:has(.cf-select-trigger.open) {
            z-index: 3500;
        }

    .action-table-header-card .cf-select-menu {
        z-index: 4000;
    }

.action-table-header-accent {
    height: 6px;
    width: calc(100% - 2px);
    margin-left: 1px;
    margin-right: 1px;
    border-top-left-radius: var(--cf-radius-xl);
    border-top-right-radius: var(--cf-radius-xl);
    flex: 0 0 auto;
}

.column-mapping-row {
    display: grid;
    grid-template-columns: 128px minmax(120px, 0.75fr) minmax(115px, 145px) minmax(140px, 0.75fr) minmax(165px, 0.8fr) minmax(188px, auto);
    gap: 10px;
    align-items: end;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.column-mapping-row-drop-target {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.cf-row-detail-config {
    border-top: 1px solid var(--cf-border);
    padding-top: 14px;
}

.cf-row-detail-config-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 115, 140, 0.4) transparent;
}

    .cf-row-detail-config-list::-webkit-scrollbar {
        width: 10px;
    }

    .cf-row-detail-config-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-row-detail-config-list::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.4);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

.cf-row-detail-config-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #ffffff;
}

    .cf-row-detail-config-row.drop-target {
        border-color: #60a5fa;
        background: #eff6ff;
        box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
    }

.cf-row-detail-config-check {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

    .cf-row-detail-config-check input {
        flex: 0 0 auto;
    }

.cf-row-detail-config-name,
.cf-row-detail-config-source {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-row-detail-config-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cf-text);
}

.cf-row-detail-config-source {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--cf-text-muted);
}

.cf-row-detail-only-badge,
.cf-row-detail-table-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.cf-row-detail-only-badge {
    color: var(--cf-blue-700);
    background: rgba(var(--cf-primary-rgb), 0.08);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.14);
}

.cf-row-detail-table-badge {
    color: var(--cf-text-muted);
    background: #f8fafc;
    border: 1px solid var(--cf-border);
}

.column-mapping-handle-wrap,
.column-mapping-source,
.column-mapping-type,
.column-mapping-display,
.column-mapping-formula,
.column-mapping-options {
    grid-column: auto;
    min-width: 0;
}

    .column-mapping-handle-wrap .d-flex {
        flex-wrap: nowrap;
    }

.column-mapping-row .form-control,
.column-mapping-row .cf-select-host,
.column-mapping-row .cf-select-trigger,
.column-mapping-row .cf-formula-bar {
    width: 100%;
    min-height: 38px;
    height: 38px;
}

.column-mapping-row .form-control,
.column-mapping-row .cf-select-trigger {
    padding-top: 7px;
    padding-bottom: 7px;
}

.column-mapping-check {
    min-width: 110px;
    max-width: 140px;
}

.column-mapping-check-label {
    min-height: 38px;
    align-items: center;
}

.column-drag-handle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
}

    .column-drag-handle:active {
        cursor: grabbing;
    }

.column-mapping-handle-wrap .cf-icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex: 0 0 38px;
    border-radius: 0.85rem;
}

.cf-field-option-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-height: 38px;
}

.cf-field-option-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: var(--cf-surface-solid);
    color: var(--cf-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: var(--cf-transition);
    box-shadow: 0 6px 18px rgba(7, 21, 47, 0.04);
}

    .cf-field-option-pill:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-field-option-pill.selected {
        background: rgba(var(--cf-primary-rgb), 0.06);
        border-color: rgba(var(--cf-primary-rgb), 0.22);
        color: var(--cf-text);
    }

    .cf-field-option-pill input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.cf-field-option-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef6fb;
    color: var(--cf-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
}

.cf-field-option-pill.selected .cf-field-option-dot {
    background: var(--cf-primary-gradient);
    color: #ffffff;
}

@media (min-width: 1181px) and (max-width: 1440px) {
    .column-mapping-row {
        grid-template-columns: 128px minmax(110px, 0.7fr) minmax(110px, 140px) minmax(130px, 0.7fr) minmax(155px, 0.8fr) minmax(180px, auto);
        gap: 8px;
    }

    .cf-field-option-pill {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 0.78rem;
    }
}

@media (min-width: 981px) and (max-width: 1180px) {
    .column-mapping-row {
        grid-template-columns: 128px minmax(130px, 1fr) minmax(115px, 145px) minmax(140px, 1fr);
    }

    .column-mapping-handle-wrap {
        grid-column: 1;
    }

    .column-mapping-source {
        grid-column: 2;
    }

    .column-mapping-type {
        grid-column: 3;
    }

    .column-mapping-display {
        grid-column: 4;
    }

    .column-mapping-formula {
        grid-column: 2 / 4;
    }

    .column-mapping-options {
        grid-column: 4;
    }

    .cf-field-option-group {
        flex-wrap: nowrap;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    .column-mapping-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .column-mapping-handle-wrap,
    .column-mapping-source,
    .column-mapping-type,
    .column-mapping-display,
    .column-mapping-formula {
        grid-column: auto;
    }

    .column-mapping-options {
        grid-column: 2;
    }

    .cf-field-option-group {
        flex-wrap: nowrap;
        width: 100%;
    }

    .cf-field-option-pill {
        flex: 1 1 0;
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 768px) {
    .column-mapping-row {
        grid-template-columns: 1fr;
    }

    .column-mapping-handle-wrap,
    .column-mapping-source,
    .column-mapping-type,
    .column-mapping-display,
    .column-mapping-formula,
    .column-mapping-options {
        grid-column: auto;
    }

        .column-mapping-handle-wrap .d-flex {
            width: 100%;
        }

        .column-mapping-handle-wrap .column-drag-handle,
        .column-mapping-handle-wrap .cf-icon-btn {
            flex: 1 1 0;
            width: auto;
        }

    .cf-field-option-group {
        flex-wrap: nowrap;
        width: 100%;
    }

    .cf-field-option-pill {
        flex: 1 1 0;
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Action Table Workspace */

.cf-content:has(.qf-action-table-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px;
    min-height: 0;
}

.qf-action-table-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

    .qf-action-table-page > .action-table-header-card {
        flex: 0 0 auto;
    }

    .qf-action-table-page .card,
    .qf-action-table-page .action-table-header-card,
    .qf-action-table-page .qf-table-card {
        box-shadow: none !important;
    }

    .qf-action-table-page .action-table-header-card {
        border-radius: var(--cf-radius-xl);
        overflow: visible;
    }

.qf-table-card {
    flex: 1 1 auto;
    min-height: 220px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: var(--cf-radius-xl);
    background: #ffffff;
}

.qf-table-card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.qf-grid-scroll {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--cf-radius-xl);
    background: #ffffff;
    position: relative;
    border: none;
    box-shadow: none !important;
}

.qf-grid-table {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    overflow: visible !important;
}

    .qf-grid-table th,
    .qf-grid-table td {
        white-space: nowrap;
        vertical-align: middle;
        border-bottom: 1px solid #dbe5ef;
        background: #ffffff;
        overflow: visible;
    }

    .qf-grid-table thead th {
        position: sticky;
        top: 0;
        z-index: 30;
        background: #f8fbfe;
        color: var(--cf-text);
        font-weight: 600;
        white-space: nowrap;
        padding: 6px 8px;
        vertical-align: middle;
        box-shadow: inset 0 -1px 0 #dbe5ef;
    }

    .qf-grid-table tbody td {
        padding: 6px 8px;
        color: var(--cf-text);
        font-size: 0.88rem;
        line-height: 1.25;
    }

.qf-action-column,
.qf-action-cell {
    position: sticky !important;
    right: 0 !important;
    left: auto !important;
    width: 176px !important;
    min-width: 176px !important;
    max-width: 176px !important;
    background: #ffffff !important;
    border-left: 1px solid #dbe5ef;
    box-shadow: -8px 0 14px rgba(15, 23, 42, 0.08);
}

.qf-action-column {
    z-index: 120 !important;
    background: #f8fbfe !important;
    text-align: right;
}

.qf-action-cell {
    z-index: 110 !important;
}

    .qf-action-cell .cf-btn-secondary {
        width: 100%;
        justify-content: center;
        white-space: nowrap;
    }

.qf-grid-table thead th.qf-action-column::after {
    display: none;
}

.qf-header-cell {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    min-width: 0;
    min-height: 42px;
    padding-right: 18px;
}

.qf-header-sort-trigger {
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    text-align: left;
    cursor: pointer;
}

.qf-header-title {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 700;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.qf-header-sort-arrow {
    width: 22px;
    height: 13px;
    margin-left: -5px;
    margin-top: -1px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    color: #94a3b8;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.14s ease, transform 0.14s ease, color 0.14s ease;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.qf-grid-table thead th:hover .qf-header-sort-arrow,
.qf-grid-table thead th.qf-sort-active .qf-header-sort-arrow {
    opacity: 1;
    transform: translateY(0);
}

.qf-header-sort-arrow.active {
    color: var(--qf-sort-color, var(--cf-blue-700));
    opacity: 1;
    transform: translateY(0);
}

.qf-header-sort-trigger:hover .qf-header-title,
.qf-grid-table thead th.qf-sort-active .qf-header-title {
    color: var(--cf-text);
}

.qf-header-sort-trigger:focus-visible {
    outline: none;
}

    .qf-header-sort-trigger:focus-visible .qf-header-title {
        color: var(--cf-blue-700);
    }

    .qf-header-sort-trigger:focus-visible .qf-header-sort-arrow {
        opacity: 1;
        color: var(--qf-sort-color, var(--cf-blue-700));
        transform: translateY(0);
    }

.qf-column-resizer {
    position: absolute;
    top: -8px;
    right: -7px;
    width: 14px;
    height: calc(100% + 16px);
    cursor: col-resize;
    z-index: 3;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

    .qf-column-resizer::before {
        content: "";
        width: 2px;
        margin: 6px 0;
        border-radius: 999px;
        background: transparent;
        transition: background 0.15s ease-in-out;
    }

    .qf-grid-table thead th:hover .qf-column-resizer::before,
    .qf-column-resizer.qf-column-resizer-active::before {
        background: #94a3b8;
    }

.qf-grid-table thead th:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 0;
    bottom: 10px;
    width: 1px;
    background: #dbe5ef;
}

.qf-cell-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    line-height: 1.25;
}

.qf-cell-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    text-transform: inherit;
}

.qf-format-rule-cell-icon {
    flex: 0 0 auto;
    color: inherit;
    font-size: 18px;
    font-weight: inherit;
    text-decoration: none;
    text-transform: none;
}

.qf-cell-content .qf-cell-text {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    text-transform: inherit;
}

/* =========================================================
   Action Table inline cell editing
   ========================================================= */

.qf-required-indicator {
    margin-left: 2px;
    color: var(--cf-danger-600);
    font-weight: 800;
    text-transform: none;
}

.qf-inline-editable-cell {
    position: relative;
    padding: 0 !important;
}

    .qf-inline-editable-cell.is-editing {
        z-index: 25;
        background: #ffffff !important;
        box-shadow: inset 0 0 0 2px rgba(var(--cf-primary-rgb), 0.34);
    }

.qf-inline-cell-trigger {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: text;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

    .qf-inline-cell-trigger:hover {
        background: rgba(var(--cf-primary-rgb), 0.045);
        box-shadow: inset 0 0 0 1px rgba(var(--cf-primary-rgb), 0.12);
    }

    .qf-inline-cell-trigger:focus-visible {
        outline: none;
        background: rgba(var(--cf-primary-rgb), 0.055);
        box-shadow: inset 0 0 0 2px rgba(var(--cf-primary-rgb), 0.24);
    }

    .qf-inline-cell-trigger .qf-cell-text {
        flex: 1 1 auto;
        min-width: 0;
        color: inherit;
        font-size: inherit;
        font-weight: inherit;
        font-style: inherit;
        text-decoration: inherit;
        text-transform: inherit;
    }

.qf-inline-cell-edit-indicator {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cf-blue-700);
    opacity: 0;
    transform: translateX(2px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

    .qf-inline-cell-edit-indicator svg {
        width: 15px;
        height: 15px;
        display: block;
    }

.qf-inline-cell-trigger:hover
.qf-inline-cell-edit-indicator,
.qf-inline-cell-trigger:focus-visible
.qf-inline-cell-edit-indicator {
    opacity: 1;
    transform: translateX(0);
}

.qf-inline-cell-editor {
    position: relative;
    width: 100%;
    min-width: 0;
    padding: 4px 6px;
    background: #ffffff;
}

.qf-inline-cell-input {
    width: 100%;
    min-width: 0;
    min-height: 34px !important;
    height: 34px;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    font-family: inherit;
    font-size: 0.88rem !important;
    line-height: 1.2;
}

.qf-inline-cell-editor .cf-select-host {
    min-width: 0;
}

.qf-inline-cell-editor .cf-select-trigger {
    min-height: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.88rem;
    box-shadow: none;
}

    .qf-inline-cell-editor .cf-select-trigger.open {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

.qf-inline-cell-editor .cf-select-menu {
    z-index: 3200;
}

.qf-inline-cell-status {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.qf-inline-cell-error {
    margin-top: 4px;
    color: var(--cf-danger-600);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
}

.qf-cell-text-wrap {
    display: block;
    white-space: normal;
    word-break: break-word;
}

.qf-row-action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

    .qf-row-action-stack .cf-btn-secondary {
        width: 100%;
        justify-content: center;
    }

.qf-action-table-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.qf-action-table-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.qf-filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qf-filter-toggle-icon {
    width: 18px;
    height: 18px;
    font-size: 22px;
    line-height: 1;
    color: var(--qf-sort-color, var(--cf-blue-700));
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.qf-filter-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

    .qf-filter-panel.collapsed {
        display: none;
    }

@media (max-width: 768px) {
    .cf-content:has(.qf-action-table-page) {
        padding: 12px;
    }

    .qf-action-table-page {
        gap: 12px;
    }

    .qf-action-table-header-top {
        align-items: stretch;
    }

    .qf-action-table-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

        .qf-filter-toggle-btn,
        .qf-action-table-header-actions .cf-btn-secondary {
            flex: 1 1 auto;
            justify-content: center;
        }

    .action-table-header-card .card-body {
        padding: 14px;
    }

    .qf-action-column,
    .qf-action-cell {
        width: 132px !important;
        min-width: 132px !important;
        max-width: 132px !important;
    }

        .qf-action-cell .cf-btn-secondary {
            min-width: 0;
            width: 100%;
            padding-left: 8px;
            padding-right: 8px;
            font-size: 0.74rem;
        }

    .qf-row-action-stack {
        gap: 6px;
    }

        .qf-row-action-stack .cf-btn-secondary {
            font-size: 0.74rem;
            padding-left: 8px;
            padding-right: 8px;
        }
}

.cf-btn-disabled-soft {
    opacity: 0.55;
    cursor: not-allowed;
}

    .cf-btn-disabled-soft:hover {
        transform: none;
        box-shadow: none;
    }

/* Action Table row editor modal */

.cf-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2900;
    background: rgba(6, 17, 38, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.cf-modal-card {
    width: min(980px, 96vw);
    max-height: min(820px, 92vh);
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.28);
    padding: 20px;
    overflow-y: auto;
}

.cf-row-editor-modal {
    width: min(1040px, 96vw);
}

@media (max-width: 768px) {
    .cf-modal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .cf-modal-card,
    .cf-row-editor-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px;
    }
}

/* Workspace Automation Builder */

.automation-activity-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: #ffffff;
    cursor: grab;
    transition: var(--cf-transition);
    box-shadow: 0 8px 18px rgba(7, 21, 47, 0.05);
}

    .automation-activity-card:hover {
        border-color: var(--cf-border-strong);
        background: #f8fbfe;
        transform: translateY(-1px);
        box-shadow: 0 12px 26px rgba(7, 21, 47, 0.08);
    }

    .automation-activity-card:active {
        cursor: grabbing;
    }

.automation-activity-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8fafc;
    box-shadow: none;
}

    .automation-activity-card-disabled:hover {
        transform: none;
        border-color: var(--cf-border);
        background: #f8fafc;
        box-shadow: none;
    }

.automation-activity-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: var(--cf-primary-gradient);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 22px rgba(15, 111, 255, 0.18);
}

.automation-flow-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.06);
}

.automation-flow-card-selected {
    border-color: rgba(var(--cf-primary-rgb), 0.28);
    background: linear-gradient(135deg, rgba(15, 111, 255, 0.06), rgba(34, 199, 255, 0.08));
    box-shadow: 0 14px 30px rgba(15, 111, 255, 0.10);
}

.automation-flow-pill {
    min-width: 86px;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--cf-primary-gradient-soft);
    color: var(--cf-blue-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid rgba(15, 111, 255, 0.10);
}

.automation-flow-connector {
    width: 2px;
    height: 28px;
    margin: 8px auto;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(15, 111, 255, 0.12), rgba(34, 199, 255, 0.48));
}

.automation-drop-zone {
    width: 100%;
    min-height: 44px;
    margin: 2px 0;
    padding: 0;
    border: 1px dashed transparent;
    border-radius: 14px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: min-height 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

    .automation-drop-zone:hover {
        background: rgba(var(--cf-primary-rgb), 0.025);
    }

.automation-drop-zone-plus {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--cf-primary-rgb), 0.34);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-blue-700);
    box-shadow: 0 4px 12px rgba(var(--cf-primary-rgb), 0.10);
    transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

    .automation-drop-zone-plus::before,
    .automation-drop-zone-plus::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        border-radius: 999px;
        background: currentColor;
        transform: translate(-50%, -50%);
    }

    .automation-drop-zone-plus::before {
        width: 12px;
        height: 2px;
    }

    .automation-drop-zone-plus::after {
        width: 2px;
        height: 12px;
    }

.automation-drop-zone:hover .automation-drop-zone-plus {
    border-color: rgba(var(--cf-primary-rgb), 0.58);
    background: var(--cf-primary-gradient-soft);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(var(--cf-primary-rgb), 0.16);
}

.automation-drop-zone-active {
    min-height: 52px;
    border-color: rgba(var(--cf-primary-rgb), 0.52);
    background: var(--cf-primary-gradient-soft);
    box-shadow: inset 0 0 0 1px rgba(var(--cf-primary-rgb), 0.06);
}

    .automation-drop-zone-active .automation-drop-zone-plus {
        border-color: transparent;
        background: var(--cf-primary-gradient);
        color: #ffffff;
        transform: scale(1.08);
        box-shadow: 0 7px 18px rgba(var(--cf-primary-rgb), 0.22);
    }

.automation-drop-zone-filled {
    align-items: stretch;
    justify-content: stretch;
    border-style: solid;
    border-color: rgba(var(--cf-primary-rgb), 0.18);
    background: #ffffff;
}

    .automation-drop-zone-filled .automation-flow-card {
        width: 100%;
    }

.cf-automation-action-button-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-automation-action-button {
    width: 100%;
    border: 1px solid var(--cf-border);
    background: var(--cf-surface);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

    .cf-automation-action-button:hover {
        border-color: rgba(var(--cf-primary-rgb), 0.45);
        box-shadow: 0 10px 24px rgba(var(--cf-primary-rgb), 0.12);
        transform: translateY(-1px);
    }

    .cf-automation-action-button.selected {
        border-color: rgba(var(--cf-primary-rgb), 0.7);
        background: var(--cf-primary-gradient-soft);
        box-shadow: 0 10px 24px rgba(var(--cf-primary-rgb), 0.16);
    }

.cf-automation-action-button-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 1199.98px) {
    .automation-flow-card {
        align-items: flex-start;
    }

    .automation-flow-pill {
        min-width: 76px;
    }
}

@media (max-width: 575.98px) {
    .automation-activity-card,
    .automation-flow-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .automation-flow-pill {
        min-width: 0;
    }

    .automation-drop-zone {
        min-height: 44px;
    }
}

/* =========================================================
   Compact fixed-height messaging pages
   Applies to WhatsApp, Team, Conversation Detail, and Email Detail.
   Outer page must not scroll. Internal panels scroll only.
   ========================================================= */

.cf-main:has(.cf-messaging-page),
.cf-main:has(.cf-conversation-page),
.cf-main:has(.cf-email-page) {
    grid-template-rows: 76px minmax(0, 1fr) 34px;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

    .cf-main:has(.cf-messaging-page) .cf-content,
    .cf-main:has(.cf-conversation-page) .cf-content,
    .cf-main:has(.cf-email-page) .cf-content {
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden !important;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
    }

    /* Smaller footer on chat/email-style pages */
    .cf-main:has(.cf-messaging-page) .cf-legal-footer,
    .cf-main:has(.cf-conversation-page) .cf-legal-footer,
    .cf-main:has(.cf-email-page) .cf-legal-footer {
        height: 34px;
        min-height: 34px;
        padding: 6px 12px;
        overflow: hidden;
    }

    .cf-main:has(.cf-messaging-page) .cf-legal-footer-inner,
    .cf-main:has(.cf-conversation-page) .cf-legal-footer-inner,
    .cf-main:has(.cf-email-page) .cf-legal-footer-inner {
        font-size: 10px;
        line-height: 1;
    }

    /* Shared messaging page: WhatsApp + Team */
    .cf-main:has(.cf-messaging-page) .cf-page-transition {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-page {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        padding: 0;
        gap: 8px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-page-header {
        flex: 0 0 auto;
        min-height: 0;
        gap: 10px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-page-title {
        font-size: 1.2rem;
        line-height: 1.05;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-page-subtitle {
        font-size: 0.78rem;
        margin-top: 2px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-shell {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        gap: 10px;
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-sidebar-card,
    .cf-main:has(.cf-messaging-page) .cf-messaging-chat-card {
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        border-radius: 18px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-sidebar-top {
        padding: 10px;
    }

        .cf-main:has(.cf-messaging-page) .cf-messaging-sidebar-top .form-control {
            min-height: 36px;
            height: 36px;
            font-size: 0.82rem;
            padding: 6px 12px;
        }

    .cf-main:has(.cf-messaging-page) .cf-messaging-section-toggle {
        min-height: 38px;
        padding: 8px 10px;
        margin-bottom: 6px;
        font-size: 0.78rem;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-row {
        padding: 9px 10px;
        gap: 10px;
        border-radius: 12px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-row-avatar,
    .cf-main:has(.cf-messaging-page) .cf-messaging-chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.74rem;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-row-title,
    .cf-main:has(.cf-messaging-page) .cf-messaging-chat-title {
        font-size: 0.88rem;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-row-preview,
    .cf-main:has(.cf-messaging-page) .cf-messaging-row-time,
    .cf-main:has(.cf-messaging-page) .cf-messaging-chat-subtitle {
        font-size: 0.74rem;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-chat-header {
        padding: 10px 12px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-thread {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px 12px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-sidebar-scroll {
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-message-bubble {
        max-width: min(74%, 720px);
        border-radius: 14px;
        padding: 8px 10px;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-message-text {
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-message-sender,
    .cf-main:has(.cf-messaging-page) .cf-messaging-message-time {
        font-size: 0.68rem;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-composer {
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    .cf-main:has(.cf-messaging-page) .cf-scope-switch {
        margin-bottom: 8px !important;
    }

    .cf-main:has(.cf-messaging-page) .cf-scope-btn {
        min-height: 34px;
        padding: 6px 12px;
        font-size: 0.82rem;
    }

    .cf-main:has(.cf-messaging-page) .cf-chat-textarea,
    .cf-main:has(.cf-messaging-page) .cf-messaging-textarea {
        min-height: 58px;
        max-height: 92px;
        font-size: 0.84rem;
        padding: 8px 12px;
    }

    .cf-main:has(.cf-messaging-page) .cf-btn-primary,
    .cf-main:has(.cf-messaging-page) .cf-btn-secondary,
    .cf-main:has(.cf-messaging-page) .cf-btn-primary-sm,
    .cf-main:has(.cf-messaging-page) .cf-btn-secondary-sm {
        min-height: 34px;
        padding: 6px 12px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .cf-main:has(.cf-messaging-page) .cf-attach-btn,
    .cf-main:has(.cf-messaging-page) .cf-emoji-toggle-btn {
        width: 38px;
        height: 38px;
    }

.cf-email-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
    gap: 10px;
    margin-top: 14px;
}

.cf-email-media-card,
.cf-email-document-card {
    border: 1px solid var(--cf-border);
    background: var(--cf-surface);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

button.cf-email-media-card {
    text-align: left;
    cursor: pointer;
}

.cf-email-media-preview {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: var(--cf-soft-bg);
}

.cf-email-image-preview {
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    display: block;
}

.cf-email-video-preview {
    width: 100%;
    max-height: 240px;
    border-radius: 12px;
    background: #000;
}

.cf-email-audio-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-email-audio-preview {
    width: 100%;
}

.cf-email-media-placeholder {
    min-height: 72px;
    min-width: 72px;
    border-radius: 12px;
    background: var(--cf-primary-gradient-soft);
    color: var(--cf-blue-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.cf-email-media-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    min-width: 0;
}

    .cf-email-media-footer strong,
    .cf-email-document-info strong {
        font-size: 0.84rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cf-email-media-footer span,
    .cf-email-document-info span {
        color: var(--cf-text-muted);
        font-size: 0.74rem;
    }

.cf-email-document-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.cf-email-document-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--cf-primary-gradient-soft);
    color: var(--cf-blue-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.cf-email-document-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 768px) {
    .cf-email-attachments-grid {
        grid-template-columns: 1fr;
    }

    .cf-email-document-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

        .cf-email-document-card .cf-btn-secondary {
            grid-column: span 2;
        }
}

/* Conversation Detail */

.cf-main:has(.cf-conversation-page) .cf-page-transition {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cf-main:has(.cf-conversation-page) .cf-conversation-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

    .cf-main:has(.cf-conversation-page) .cf-conversation-page > .d-flex:first-child {
        flex: 0 0 auto;
        margin-bottom: 10px !important;
    }

.cf-main:has(.cf-conversation-page) .cf-conversation-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: none;
}

    .cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp .cf-conversation-main,
    .cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp .cf-chat-panel,
    .cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp .cf-chat-thread-wrap,
    .cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp .cf-message-thread,
    .cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp .cf-chat-composer {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

.cf-main:has(.cf-conversation-page) .cf-conversation-main,
.cf-main:has(.cf-conversation-page) .cf-chat-panel {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.cf-main:has(.cf-conversation-page) .cf-chat-header {
    padding: 10px 12px;
}

.cf-main:has(.cf-conversation-page) .cf-chat-customer-name {
    font-size: 1rem;
}

.cf-main:has(.cf-conversation-page) .cf-chat-subtitle {
    font-size: 0.78rem;
}

.cf-main:has(.cf-conversation-page) .cf-chat-thread-wrap {
    min-height: 0;
    overflow: hidden;
    padding: 10px 12px;
}

.cf-main:has(.cf-conversation-page) .cf-message-thread {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 8px;
}

.cf-main:has(.cf-conversation-page) .cf-message-row {
    width: 100%;
    display: flex;
}

.cf-main:has(.cf-conversation-page) .cf-message-row-incoming {
    justify-content: flex-start;
}

.cf-main:has(.cf-conversation-page) .cf-message-row-outgoing {
    justify-content: flex-end;
}

.cf-main:has(.cf-conversation-page) .cf-message-bubble {
    max-width: min(72%, 700px);
    padding: 8px 10px;
    border-radius: 12px;
}

.cf-main:has(.cf-conversation-page) .cf-conversation-shell-whatsapp .cf-message-bubble {
    max-width: min(92%, 1180px);
}

.cf-main:has(.cf-conversation-page) .cf-message-text {
    font-size: 0.86rem;
    line-height: 1.35;
}

.cf-main:has(.cf-conversation-page) .cf-message-meta,
.cf-main:has(.cf-conversation-page) .cf-message-status {
    font-size: 0.68rem;
}

.cf-main:has(.cf-conversation-page) .cf-chat-composer {
    flex: 0 0 auto;
    padding: 10px 12px;
}

.cf-main:has(.cf-conversation-page) .cf-chat-textarea {
    min-height: 58px;
    max-height: 92px;
    font-size: 0.84rem;
}

.cf-main:has(.cf-conversation-page) .cf-conversation-side {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

    .cf-main:has(.cf-conversation-page) .cf-conversation-side .card {
        border-radius: 16px;
        margin-bottom: 10px !important;
    }

    .cf-main:has(.cf-conversation-page) .cf-conversation-side .card-body {
        padding: 14px;
    }

    .cf-main:has(.cf-conversation-page) .cf-conversation-side h5 {
        font-size: 1rem;
        margin-bottom: 10px !important;
    }

.cf-main:has(.cf-conversation-page) .cf-side-list-row {
    font-size: 0.82rem;
}

.cf-main:has(.cf-conversation-page) .cf-page-back-btn,
.cf-main:has(.cf-conversation-page) .cf-btn-primary,
.cf-main:has(.cf-conversation-page) .cf-btn-secondary,
.cf-main:has(.cf-conversation-page) .cf-btn-primary-sm,
.cf-main:has(.cf-conversation-page) .cf-btn-secondary-sm {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 10px;
}

.cf-chat-header-actions-hidden {
    display: none;
}

/* Email Detail */
.cf-main:has(.cf-email-page) .cf-page-transition {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cf-main:has(.cf-email-page) .cf-email-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    padding: 0;
}

.cf-main:has(.cf-email-page) .cf-email-topbar {
    flex: 0 0 auto;
    margin-bottom: 8px;
}

.cf-main:has(.cf-email-page) .cf-email-reader {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    gap: 8px;
}

.cf-main:has(.cf-email-page) .cf-email-subject-strip {
    flex: 0 0 auto;
}

.cf-main:has(.cf-email-page) .cf-email-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.cf-main:has(.cf-email-page) .cf-email-reply-card {
    flex: 0 0 auto;
    position: relative;
    bottom: auto;
    z-index: 10;
    padding: 12px 14px;
}

.cf-main:has(.cf-email-page) .cf-email-reply-textarea {
    min-height: 58px;
    max-height: 120px;
    font-size: 0.84rem;
}

.cf-main:has(.cf-email-page) .cf-email-reply-actions {
    margin-top: 8px;
}

.cf-main:has(.cf-email-page) .cf-btn-primary,
.cf-main:has(.cf-email-page) .cf-btn-secondary,
.cf-main:has(.cf-email-page) .cf-btn-primary-sm,
.cf-main:has(.cf-email-page) .cf-btn-secondary-sm {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 10px;
}

.cf-main:has(.cf-email-page) .cf-attach-btn,
.cf-main:has(.cf-email-page) .cf-emoji-toggle-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
}

.cf-main:has(.cf-email-page) .cf-email-thread::-webkit-scrollbar {
    width: 10px;
}

.cf-main:has(.cf-email-page) .cf-email-thread::-webkit-scrollbar-track {
    background: transparent;
}

.cf-main:has(.cf-email-page) .cf-email-thread::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.45);
    border-radius: 999px;
}

    .cf-main:has(.cf-email-page) .cf-email-thread::-webkit-scrollbar-thumb:hover {
        background: rgba(94, 115, 140, 0.7);
    }

/* Responsive fallback: on smaller screens, allow page scrolling because stacked panels need space */
@media (max-width: 980px) {
    .cf-main:has(.cf-messaging-page) .cf-content,
    .cf-main:has(.cf-conversation-page) .cf-content,
    .cf-main:has(.cf-email-page) .cf-content {
        overflow-y: auto !important;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-shell,
    .cf-main:has(.cf-conversation-page) .cf-conversation-shell {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .cf-main:has(.cf-messaging-page) .cf-messaging-page,
    .cf-main:has(.cf-conversation-page) .cf-conversation-page,
    .cf-main:has(.cf-email-page) .cf-email-page {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .cf-main:has(.cf-email-page) .cf-email-reader,
    .cf-main:has(.cf-email-page) .cf-email-thread {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* =========================================================
   Mobile topbar cleanup
   Keeps hamburger, tenant picker, notification bell, and profile
   inside one clean responsive row.
   ========================================================= */

@media (max-width: 640px) {
    .cf-topbar {
        min-height: 72px;
        height: 72px;
        padding: 10px 14px;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        overflow: visible;
    }

    .cf-topbar-left {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .cf-topbar-actions {
        width: auto;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        margin-left: auto;
    }

    .cf-topbar-popover-host {
        position: relative;
        z-index: 1900;
    }

    .cf-mobile-nav-toggle {
        width: 38px;
        height: 38px;
        min-width: 38px;
        margin-right: 0;
        border-radius: 12px;
    }

    .cf-tenant-dropdown-host {
        min-width: 0;
        flex: 1 1 auto;
    }

    .cf-tenant-dropdown-trigger {
        min-width: 0;
        width: 100%;
        max-width: 170px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9rem;
    }

    .cf-topbar-icon-btn,
    .cf-topbar-profile-trigger {
        width: 38px;
        height: 38px;
        min-width: 38px;
        flex: 0 0 38px;
    }

    .cf-topbar-badge {
        top: -6px;
        right: -6px;
        min-width: 17px;
        height: 17px;
        padding: 0 5px;
        font-size: 0.68rem;
    }

    .cf-profile-popover {
        right: 0;
        width: min(260px, calc(100vw - 24px));
    }

    .cf-notification-popover {
        right: 0;
        width: min(320px, calc(100vw - 24px));
    }
}

/* =========================================================
   ChannelFlow global UI sizing consistency overrides
   Place this at the absolute bottom of ChannelFlow.Client/wwwroot/app.css
   ========================================================= */

:root {
    --cf-control-height: 38px;
    --cf-control-height-sm: 34px;
    --cf-control-padding-x: 12px;
    --cf-control-font-size: 0.84rem;
    --cf-page-title-size: 1.25rem;
    --cf-page-subtitle-size: 0.82rem;
    --cf-card-body-padding: 16px;
    --cf-card-body-padding-compact: 14px;
}

/* Global page density */
.cf-content {
    padding: 20px;
}

.cf-page-header {
    margin-bottom: 16px;
    gap: 12px;
}

.cf-page-title,
.cf-content h1,
.cf-content h2,
.cf-content h3 {
    font-size: var(--cf-page-title-size);
    line-height: 1.12;
    font-weight: 600;
}

.cf-page-subtitle,
.cf-content .text-muted {
    font-size: var(--cf-page-subtitle-size);
}

.cf-content .card,
.card {
    border-radius: 18px;
}

.cf-content .card-body,
.card-body {
    padding: var(--cf-card-body-padding);
}

/* One standard button size across the app */
.cf-btn-primary,
.cf-btn-secondary,
.cf-page-btn,
.cf-page-back-btn,
.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-outline-primary,
.btn.btn-outline-secondary,
button.cf-btn-primary,
button.cf-btn-secondary {
    min-height: var(--cf-control-height);
    height: auto;
    padding: 7px var(--cf-control-padding-x);
    font-size: var(--cf-control-font-size);
    font-weight: 600;
    line-height: 1.15;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.cf-btn-primary-sm,
.cf-btn-secondary-sm,
.cf-inbox-table .cf-btn-secondary,
.qf-action-cell .cf-btn-secondary,
.cf-profile-popover-logout {
    min-height: var(--cf-control-height-sm);
    padding: 6px 11px;
    font-size: 0.8rem;
    border-radius: 10px;
}

.cf-btn-primary:disabled,
.cf-btn-secondary:disabled,
.btn:disabled,
.cf-page-btn:disabled,
.cf-page-back-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none !important;
    filter: none !important;
}

/* Icon-only buttons */
.cf-icon-btn,
.cf-action-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 10px;
}

.cf-topbar-icon-btn,
.cf-topbar-profile-trigger {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

/* Forms / selects */
.cf-content .form-control,
.cf-content .form-select,
.cf-content textarea,
.form-control,
.form-select,
textarea,
.cf-select-trigger,
.cf-tenant-dropdown-trigger {
    min-height: var(--cf-control-height);
    padding: 7px 12px;
    font-size: var(--cf-control-font-size);
    border-radius: 10px;
}

.form-select {
    padding-right: 36px;
}

.cf-select-item,
.cf-tenant-dropdown-item {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.84rem;
}

.form-label {
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.form-text,
.small,
small {
    font-size: 0.76rem;
}

/* Pills / badges */
.cf-status-pill,
.cf-highlight-pill,
.cf-scope-pill {
    min-height: 24px;
    padding: 5px 9px;
    font-size: 0.75rem;
    line-height: 1;
}

.cf-unread-badge,
.cf-nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.72rem;
}

/* Tables */
.cf-content .table thead th,
.cf-content table thead th,
.qf-grid-table thead th {
    padding: 8px 10px;
    font-size: 0.76rem;
}

.cf-content .table tbody td,
.cf-content table tbody td,
.qf-grid-table tbody td {
    padding: 7px 10px;
    font-size: 0.84rem;
    line-height: 1.22;
}

/* Apps page/card density */
.cf-content .row.g-3 {
    --bs-gutter-x: 0.85rem;
    --bs-gutter-y: 0.85rem;
}

.cf-content .card.overflow-hidden .card-body,
.cf-content .card.h-100 .card-body,
.action-table-header-card .card-body {
    padding: var(--cf-card-body-padding-compact);
}

.cf-content .card h4,
.cf-content .card h5,
.cf-content .fw-semibold {
    font-size: 0.92rem;
    line-height: 1.2;
}

.cf-content .card .text-muted,
.cf-content .card .small {
    font-size: 0.78rem;
    line-height: 1.3;
}

/* App tiles and workspace cards */
.cf-content .card img[style*="width: 56px"],
.cf-content .card img[style*="width: 52px"],
.cf-content .card img[style*="width: 48px"] {
    width: 42px !important;
    height: 42px !important;
    border-radius: 11px !important;
    padding: 5px !important;
}

.cf-content .card div[style*="width: 56px"],
.cf-content .card div[style*="width: 52px"],
.cf-content .card div[style*="width: 48px"] {
    width: 42px !important;
    height: 42px !important;
    border-radius: 11px !important;
}

/* Scope/tab buttons */
.cf-scope-btn {
    min-height: var(--cf-control-height-sm);
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 10px;
}

/* Chat-style pages keep their compact WhatsApp-like density */
.cf-main:has(.cf-messaging-page) .cf-btn-primary,
.cf-main:has(.cf-messaging-page) .cf-btn-secondary,
.cf-main:has(.cf-conversation-page) .cf-btn-primary,
.cf-main:has(.cf-conversation-page) .cf-btn-secondary {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* Power BI workspace controls */
.cf-pbi-report-btn,
.cf-pbi-page-btn,
.cf-pbi-back-btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.84rem;
    border-radius: 10px;
}

.cf-pbi-back-btn {
    justify-content: center;
}

/* Keep existing mobile responsiveness, only reduce spacing/sizes */
@media (max-width: 768px) {
    .cf-content {
        padding: 14px;
    }

        .cf-content .card-body,
        .card-body {
            padding: 14px;
        }

        .cf-page-title,
        .cf-content h1,
        .cf-content h2,
        .cf-content h3 {
            font-size: 1.15rem;
        }

    .cf-btn-primary,
    .cf-btn-secondary,
    .cf-page-btn,
    .cf-page-back-btn,
    .btn.btn-primary,
    .btn.btn-secondary,
    button.cf-btn-primary,
    button.cf-btn-secondary {
        min-height: 36px;
        padding: 6px 11px;
        font-size: 0.82rem;
    }
}

/* =========================================================
   Compact notification popover
   Keeps notifications aligned with the smaller app-wide UI scale.
   ========================================================= */

.cf-notification-popover {
    width: 340px;
    border-radius: 16px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
}

.cf-notification-popover-header {
    padding: 12px 14px;
}

    .cf-notification-popover-header h6,
    .cf-notification-popover-header .fw-semibold,
    .cf-notification-popover-header strong {
        font-size: 0.92rem;
        line-height: 1.15;
    }

    .cf-notification-popover-header .small,
    .cf-notification-popover-header small,
    .cf-notification-popover-header .text-muted {
        font-size: 0.74rem;
    }

    .cf-notification-popover-header .cf-link-btn {
        font-size: 0.82rem;
    }

.cf-notification-popover-list {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

.cf-notification-item {
    padding: 10px 14px;
}

.cf-notification-item-title {
    font-size: 0.86rem;
    line-height: 1.22;
    margin-bottom: 4px;
}

.cf-notification-item-message {
    font-size: 0.8rem;
    line-height: 1.32;
    margin-bottom: 5px;
    max-height: 42px;
    overflow: hidden;
}

.cf-notification-item-time {
    font-size: 0.72rem;
}

.cf-notification-popover-empty {
    padding: 16px 14px;
    font-size: 0.82rem;
}

.cf-notification-popover-footer {
    padding: 10px 14px;
}

    .cf-notification-popover-footer a,
    .cf-notification-popover-footer .cf-link-btn {
        font-size: 0.84rem;
        font-weight: 600;
    }

.cf-notification-popover-list::-webkit-scrollbar {
    width: 8px;
}

.cf-notification-popover-list::-webkit-scrollbar-track {
    background: transparent;
}

.cf-notification-popover-list::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.38);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    .cf-notification-popover-list::-webkit-scrollbar-thumb:hover {
        background: rgba(94, 115, 140, 0.62);
        border: 2px solid transparent;
        background-clip: padding-box;
    }

@media (max-width: 640px) {
    .cf-notification-popover {
        width: min(320px, calc(100vw - 24px));
        right: 0;
    }

    .cf-notification-popover-list {
        max-height: 300px;
    }
}

/* =========================================================
   Composer action repair
   Keeps WhatsApp, Team, and Conversation Detail controls
   aligned consistently after global sizing cleanup.
   ========================================================= */

.cf-chat-composer-actions,
.cf-messaging-composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

    .cf-chat-composer-actions > .d-flex,
    .cf-messaging-composer-actions > .d-flex {
        width: auto;
        justify-content: flex-start;
        align-items: center;
    }

    .cf-chat-composer-actions .cf-btn-primary,
    .cf-chat-composer-actions .cf-btn-secondary,
    .cf-messaging-composer-actions .cf-btn-primary,
    .cf-messaging-composer-actions .cf-btn-secondary {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .cf-chat-composer-actions .cf-attach-btn,
    .cf-chat-composer-actions .cf-emoji-toggle-btn,
    .cf-messaging-composer-actions .cf-attach-btn,
    .cf-messaging-composer-actions .cf-emoji-toggle-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
    }

    /* Disabled primary buttons should still look like primary buttons, not broken grey buttons */
    .cf-chat-composer-actions .cf-btn-primary:disabled,
    .cf-messaging-composer-actions .cf-btn-primary:disabled {
        background: var(--cf-primary-gradient);
        color: #ffffff;
        opacity: 0.58;
        cursor: not-allowed;
        transform: none !important;
        filter: none !important;
    }

/* =========================================================
   Conversation display name read/unread weight
   Names are regular by default and bold only when unread.
   ========================================================= */

.cf-conversation-display-name {
    font-weight: 400 !important;
}

.cf-conversation-display-name-unread {
    font-weight: 700 !important;
}

/* =========================================================
   WhatsApp audio / voice note attachment preview
   ========================================================= */

.cf-message-audio-attachment {
    width: min(320px, 100%);
}

.cf-message-audio-player {
    width: 100%;
    max-width: 320px;
    height: 38px;
    display: block;
}

.cf-messaging-message-bubble.outgoing .cf-message-audio-player,
.cf-message-bubble-outgoing .cf-message-audio-player {
    filter: none;
}

/* =========================================================
   WhatsApp message context: replies, forwards, reactions
   Used by WhatsApp.razor and WhatsAppConversationDetail.razor
   ========================================================= */

.cf-message-attachment-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cf-message-forwarded-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 6px;
    padding: 2px 0;
    color: var(--cf-text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.cf-message-reply-preview {
    display: block;
    max-width: 100%;
    margin: 2px 0 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border-left: 3px solid rgba(var(--cf-primary-rgb), 0.68);
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.cf-message-reply-preview-label {
    color: var(--cf-blue-700);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 3px;
}

.cf-message-reply-preview-text {
    color: var(--cf-text);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.28;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-message-reaction-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 26px;
    min-height: 22px;
    margin-top: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
    font-size: 0.98rem;
    line-height: 1;
}

.cf-messaging-message-bubble.outgoing .cf-message-forwarded-label,
.cf-message-bubble-outgoing .cf-message-forwarded-label {
    color: rgba(255, 255, 255, 0.78);
}

.cf-messaging-message-bubble.outgoing .cf-message-reply-preview,
.cf-message-bubble-outgoing .cf-message-reply-preview {
    background: rgba(255, 255, 255, 0.18);
    border-left-color: rgba(255, 255, 255, 0.72);
}

.cf-messaging-message-bubble.outgoing .cf-message-reply-preview-label,
.cf-message-bubble-outgoing .cf-message-reply-preview-label {
    color: rgba(255, 255, 255, 0.92);
}

.cf-messaging-message-bubble.outgoing .cf-message-reply-preview-text,
.cf-message-bubble-outgoing .cf-message-reply-preview-text {
    color: rgba(255, 255, 255, 0.96);
}

.cf-messaging-message-bubble.outgoing .cf-message-reaction-chip,
.cf-message-bubble-outgoing .cf-message-reaction-chip {
    background: rgba(255, 255, 255, 0.96);
    color: var(--cf-text);
    border-color: rgba(255, 255, 255, 0.56);
}

.cf-messaging-message-bubble.incoming .cf-message-reply-preview,
.cf-message-bubble-incoming .cf-message-reply-preview {
    background: #f8fafc;
    border-left-color: rgba(var(--cf-primary-rgb), 0.68);
}

.cf-wa-media-card,
.cf-wa-document-wrap,
.cf-wa-audio-card {
    width: min(360px, 100%);
    overflow: hidden;
}

.cf-wa-image-btn {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.cf-wa-image-preview,
.cf-wa-video-preview {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.08);
}

.cf-wa-video-preview {
    object-fit: contain;
}

.cf-wa-audio-card {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 10px;
}

.cf-wa-audio-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-wa-audio-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--cf-primary, #243f99);
    color: #ffffff;
}

    .cf-wa-audio-icon svg {
        width: 22px;
        height: 22px;
    }

.cf-wa-audio-player {
    width: 100%;
    height: 38px;
    min-width: 180px;
}

.cf-wa-audio-download {
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 600;
    padding: 0;
}

.cf-wa-document-wrap {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
}

.cf-wa-document-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.16);
    text-align: left;
    color: inherit;
}

.cf-wa-document-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.92);
    color: var(--cf-primary, #243f99);
    font-size: 0.72rem;
    font-weight: 800;
}

.cf-wa-document-info {
    min-width: 0;
    flex: 1 1 auto;
}

.cf-wa-document-name {
    color: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
}

.cf-wa-document-meta {
    margin-top: 2px;
    font-size: 0.7rem;
    opacity: 0.75;
}

.cf-wa-document-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.92);
}

.cf-wa-document-action {
    border: 0;
    background: transparent;
    color: var(--cf-primary, #243f99);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 10px;
    cursor: pointer;
}

    .cf-wa-document-action + .cf-wa-document-action {
        border-left: 1px solid rgba(15, 23, 42, 0.08);
    }

.cf-wa-attachment-footer {
    margin-top: 4px;
    color: inherit;
    opacity: 0.78;
    font-size: 0.68rem;
    line-height: 1.1;
    text-align: right;
}

.cf-messaging-message-bubble.outgoing .cf-wa-document-card,
.cf-messaging-message-bubble.outgoing .cf-wa-audio-card,
.cf-message-bubble-outgoing .cf-wa-document-card,
.cf-message-bubble-outgoing .cf-wa-audio-card {
    color: #ffffff;
}

.cf-messaging-message-bubble.outgoing .cf-wa-document-name,
.cf-messaging-message-bubble.outgoing .cf-wa-document-meta,
.cf-message-bubble-outgoing .cf-wa-document-name,
.cf-message-bubble-outgoing .cf-wa-document-meta {
    color: #ffffff;
}

.cf-messaging-message-bubble.incoming .cf-wa-document-wrap,
.cf-messaging-message-bubble.incoming .cf-wa-audio-card,
.cf-message-bubble-incoming .cf-wa-document-wrap,
.cf-message-bubble-incoming .cf-wa-audio-card {
    background: rgba(15, 23, 42, 0.04);
}

.cf-messaging-message-bubble.incoming .cf-wa-document-card,
.cf-message-bubble-incoming .cf-wa-document-card {
    background: rgba(15, 23, 42, 0.04);
}

@media (max-width: 640px) {
    .cf-wa-media-card,
    .cf-wa-document-wrap,
    .cf-wa-audio-card {
        width: 100%;
    }

    .cf-wa-image-preview,
    .cf-wa-video-preview {
        max-height: 220px;
    }
}

/ /* =========================================================
   WhatsApp attachment polish
   Keeps file/media bubbles tight around their content.
   Applies to both WhatsApp.razor and Conversation Detail.
   ========================================================= */
/*
 * Main WhatsApp page + Conversation Detail.
 * The border-box width of 382px gives us:
 *     370px attachment content
 *     + 6px left/right bubble padding.
 */
.cf-messaging-message-bubble:has(.cf-message-attachment-stack),
.cf-message-bubble:has(.cf-message-attachment-stack) {
    box-sizing: border-box;
    width: fit-content;
    max-width: min(382px, 92%);
    padding: 6px;
}

/*
 * Conversation Detail has a much more specific rule allowing
 * WhatsApp bubbles up to 1180px wide. Override that specifically
 * for messages containing attachments.
 */
.cf-main:has(.cf-conversation-page)
.cf-conversation-shell-whatsapp
.cf-message-bubble:has(.cf-message-attachment-stack) {
    box-sizing: border-box;
    width: fit-content;
    max-width: min(382px, 92%);
    padding: 6px;
}

.cf-message-attachment-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 370px;
    max-width: 100%;
    min-width: 0;
}

.cf-wa-media-card,
.cf-wa-document-wrap,
.cf-wa-audio-card {
    width: 100%;
    max-width: 370px;
    min-width: 0;
}

.cf-wa-image-preview,
.cf-wa-video-preview {
    width: 100%;
    max-width: 370px;
    border-radius: 10px;
}

.cf-wa-document-wrap {
    overflow: hidden;
    padding-bottom: 0;
    border-radius: 12px;
}

.cf-wa-document-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    border-radius: 10px 10px 0 0;
}

.cf-wa-document-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.cf-wa-document-name {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cf-wa-document-actions {
    width: 100%;
    border-radius: 0;
}

.cf-wa-attachment-footer {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 0 4px 2px;
    line-height: 1.25;
    white-space: nowrap;
}

.cf-messaging-message-bubble.outgoing .cf-wa-attachment-footer,
.cf-message-bubble-outgoing .cf-wa-attachment-footer {
    color: #ffffff;
    opacity: 0.86;
}

.cf-messaging-message-bubble.incoming .cf-wa-attachment-footer,
.cf-message-bubble-incoming .cf-wa-attachment-footer {
    color: var(--cf-text-muted);
    opacity: 1;
}

.cf-wa-document-action {
    color: var(--cf-primary, #243f99);
    font-weight: 700;
}

@media (max-width: 640px) {
    .cf-messaging-message-bubble:has(.cf-message-attachment-stack),
    .cf-message-bubble:has(.cf-message-attachment-stack),
    .cf-main:has(.cf-conversation-page)
    .cf-conversation-shell-whatsapp
    .cf-message-bubble:has(.cf-message-attachment-stack) {
        max-width: 92%;
    }

    .cf-message-attachment-stack,
    .cf-wa-media-card,
    .cf-wa-document-wrap,
    .cf-wa-audio-card {
        width: 100%;
        max-width: 100%;
    }

    .cf-wa-image-preview,
    .cf-wa-video-preview {
        max-height: 220px;
    }
}

/* =========================================================
   Voice note playback / recording
   ========================================================= */

.cf-wa-audio-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
}

    .cf-wa-audio-actions .cf-wa-document-action {
        width: 100%;
    }

.cf-voice-recording-active {
    color: #ffffff !important;
    background: var(--cf-primary-gradient) !important;
    border-color: transparent !important;
}

.cf-voice-recording-bar {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-voice-recording-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--cf-danger-600);
    animation: cf-voice-pulse 1s ease-in-out infinite;
}

.cf-voice-recording-text {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--cf-text);
}

.cf-voice-recording-time {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--cf-text-muted);
    margin-right: auto;
}

@keyframes cf-voice-pulse {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0.55;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* Input Form app view */

.cf-input-form-view-shell {
    width: 100%;
}

.cf-input-form-view-card {
    width: 100%;
    min-height: 420px;
}

    .cf-input-form-view-card .card-body {
        padding: 22px;
    }

    .cf-input-form-view-card form {
        width: 100%;
    }

    .cf-input-form-view-card .form-label {
        font-size: 0.82rem;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .cf-input-form-view-card .form-control,
    .cf-input-form-view-card .form-select {
        min-height: 42px;
    }

.cf-action-definition-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: var(--cf-surface-solid);
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.04);
}

@media (max-width: 768px) {
    .cf-action-definition-card {
        align-items: stretch;
        flex-direction: column;
    }

        .cf-action-definition-card .cf-btn-secondary {
            flex: 1 1 auto;
        }
}

.cf-action-summary-card,
.cf-automation-step-settings {
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: var(--cf-surface-solid);
    padding: 14px;
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.04);
}

    .cf-automation-step-settings + .cf-automation-step-settings {
        margin-top: 12px;
    }

.qf-row-action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

    .qf-row-action-stack .cf-btn-secondary {
        width: 100%;
        justify-content: center;
    }

@media (max-width: 768px) {
    .qf-row-action-stack {
        gap: 6px;
    }

        .qf-row-action-stack .cf-btn-secondary {
            font-size: 0.74rem;
            padding-left: 8px;
            padding-right: 8px;
        }
}

.cf-automation-trigger-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cf-automation-trigger-check-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: var(--cf-surface-solid);
    box-shadow: 0 10px 24px rgba(7, 21, 47, 0.04);
}

    .cf-automation-trigger-check-card.configured {
        border-color: rgba(var(--cf-primary-rgb), 0.25);
        background: rgba(var(--cf-primary-rgb), 0.04);
    }

@media (max-width: 768px) {
    .cf-automation-trigger-checklist {
        grid-template-columns: 1fr;
    }

    .cf-automation-trigger-check-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

.cf-formula-bar {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d6e3f3;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

    .cf-formula-bar:hover {
        border-color: #9db7d8;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .cf-formula-bar:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }

.cf-formula-bar-prefix {
    color: #334155;
    font-weight: 700;
    flex: 0 0 auto;
}

.cf-formula-bar-value {
    color: #2563eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-formula-bar-placeholder {
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-formula-bar-disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.cf-formula-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
    overflow-y: auto;
}

.cf-formula-modal {
    width: min(960px, calc(100vw - 32px));
    max-height: calc(100dvh - 64px);
    background: #ffffff;
    border: 1px solid #d9e5f2;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cf-formula-modal-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cf-formula-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.cf-formula-modal-subtitle {
    margin-top: 0.35rem;
    color: #475569;
    font-size: 0.9rem;
}

.cf-formula-modal-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.8rem;
    line-height: 1;
    padding: 0.1rem 0.35rem;
}

    .cf-formula-modal-close:hover {
        color: #0f172a;
    }

.cf-formula-modal-body {
    padding: 1rem 1.25rem;
    overflow: auto;
}

.cf-formula-editor-section {
    margin-bottom: 1rem;
}

.cf-formula-textarea {
    width: 100%;
    min-height: 96px;
    border: 1px solid #d6e3f3;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    padding: 0.75rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
}

    .cf-formula-textarea:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
        background: #ffffff;
    }

.cf-formula-validation-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.cf-formula-validation-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.cf-formula-validation-badge-success {
    background: #ecfdf3;
    color: #16803c;
}

.cf-formula-validation-badge-error {
    background: #fef2f2;
    color: #b91c1c;
}

.cf-formula-validation-text {
    flex: 1 1 auto;
    font-size: 0.875rem;
}

.cf-formula-validation-success {
    color: #16803c;
}

.cf-formula-validation-error {
    color: #b91c1c;
}

.cf-formula-test-button,
.cf-formula-insert-button {
    border: 0;
    background: transparent;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.25rem 0.35rem;
}

    .cf-formula-test-button:hover,
    .cf-formula-insert-button:hover {
        text-decoration: underline;
    }

.cf-formula-tabs {
    display: flex;
    gap: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    margin-top: 1rem;
}

.cf-formula-tab {
    border: 0;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    padding: 0.75rem 0;
    border-bottom: 2px solid transparent;
}

    .cf-formula-tab.active {
        color: #2563eb;
        border-bottom-color: #2563eb;
    }

.cf-formula-tab-content {
    max-height: 360px;
    overflow: auto;
}

.cf-formula-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 90px;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.cf-formula-grid-header,
.cf-formula-grid-cell {
    padding: 0.75rem;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.cf-formula-grid-header {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.cf-formula-grid-cell {
    color: #334155;
}

.cf-formula-code {
    color: #2563eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.cf-formula-empty {
    padding: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.cf-formula-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .cf-formula-modal {
        max-height: calc(100vh - 1rem);
    }

    .cf-formula-grid {
        grid-template-columns: 1fr;
    }

    .cf-formula-grid-header {
        display: none;
    }

    .cf-formula-grid-cell {
        border-right: 1px solid #e2e8f0;
    }

    .cf-formula-modal-footer {
        flex-direction: column-reverse;
    }

        .cf-formula-modal-footer .cf-btn-primary,
        .cf-formula-modal-footer .cf-btn-secondary {
            width: 100%;
        }
}

/* Conversation detail header refinements */

.cf-email-header-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .cf-email-header-title-row h2 {
        margin: 0;
    }

.cf-email-thread-tools-stacked {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.cf-email-thread-tools-top {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.cf-email-thread-tools-bottom {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

    .cf-email-thread-tools-bottom .cf-email-search-host {
        min-width: 420px;
        flex: 1 1 auto;
    }

.cf-whatsapp-header-right {
    min-width: min(560px, 50%);
}

.cf-whatsapp-search-host {
    position: relative;
    width: min(520px, 100%);
}

.cf-whatsapp-search-results {
    z-index: 2800;
}

.cf-conversation-shell-whatsapp {
    width: 100%;
    max-width: none;
}

    .cf-conversation-shell-whatsapp .cf-conversation-main,
    .cf-conversation-shell-whatsapp .cf-chat-panel,
    .cf-conversation-shell-whatsapp .cf-chat-thread-wrap,
    .cf-conversation-shell-whatsapp .cf-chat-composer {
        width: 100%;
        max-width: none;
    }

    .cf-conversation-shell-whatsapp .cf-message-thread {
        width: 100%;
    }

.cf-message-row {
    width: 100%;
}

.cf-message-row-outgoing {
    justify-content: flex-end;
}

.cf-message-row-incoming {
    justify-content: flex-start;
}

.cf-message-bubble {
    max-width: min(680px, 72%);
}

@media (max-width: 1100px) {
    .cf-email-thread-tools-bottom {
        flex-direction: column;
    }

        .cf-email-thread-tools-bottom .cf-email-search-host {
            width: 100%;
            min-width: 0;
        }

    .cf-email-sort-switch {
        align-self: flex-end;
    }

    .cf-whatsapp-header-right {
        min-width: 0;
        width: 100%;
    }

    .cf-whatsapp-search-host {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .cf-email-thread-tools-top {
        justify-content: flex-start;
    }

    .cf-email-sort-switch {
        align-self: stretch;
    }

    .cf-message-bubble {
        max-width: 92%;
    }
}

/* Importer top progress */
.cf-import-top-progress {
    position: sticky;
    top: 0;
    z-index: 90;
    margin: 0 0 16px 0;
    padding: 14px 18px 12px 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(8px);
}

.cf-import-top-progress-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.cf-import-top-progress-copy {
    min-width: 0;
}

.cf-import-top-progress-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}

.cf-import-top-progress-message {
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.45;
}

.cf-import-top-progress-percent {
    flex: 0 0 auto;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--cf-theme-primary, var(--cf-primary, var(--bs-primary, #db2777)));
    line-height: 1;
}

.cf-import-top-progress-track {
    position: relative;
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.95);
}

.cf-import-top-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient( 90deg, var(--cf-theme-primary, var(--cf-primary, var(--bs-primary, #db2777))), var(--cf-theme-accent, var(--cf-accent, #ec4899)) );
    box-shadow: 0 0 18px rgba(219, 39, 119, 0.28);
    transition: width 0.25s ease;
}

.cf-import-top-progress-status {
    margin-top: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}

@media (max-width: 640px) {
    .cf-import-top-progress {
        border-radius: 14px;
        padding: 12px 14px 10px 14px;
    }

    .cf-import-top-progress-main {
        gap: 12px;
    }

    .cf-import-top-progress-percent {
        font-size: 1rem;
    }
}

/* Shared confirmation portal */

.cf-confirm-portal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3400;
    background: rgba(6, 17, 38, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
}

.cf-confirm-portal-dialog {
    width: min(460px, 96vw);
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: 0 28px 80px rgba(7, 21, 47, 0.34);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cf-confirm-portal-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #fff1f2;
    color: var(--cf-danger-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid rgba(219, 47, 82, 0.16);
}

.cf-confirm-portal-title {
    margin: 0;
    color: var(--cf-text);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cf-confirm-portal-message {
    margin-top: 8px;
    color: var(--cf-text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.cf-confirm-portal-item {
    margin-top: 14px;
    width: 100%;
    border: 1px solid var(--cf-border);
    background: #f8fbfe;
    border-radius: 14px;
    padding: 10px 12px;
    color: var(--cf-text);
    font-size: 0.9rem;
    font-weight: 700;
    word-break: break-word;
}

.cf-confirm-portal-footer {
    width: 100%;
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cf-btn-danger {
    min-height: 38px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cf-danger-600) 0%, var(--cf-danger-500) 100%);
    color: #ffffff;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: var(--cf-transition);
    box-shadow: none;
}

    .cf-btn-danger:hover:not(:disabled) {
        color: #ffffff;
        transform: translateY(-1px);
        filter: brightness(1.03);
    }

    .cf-btn-danger:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
        filter: none;
    }


@media (max-width: 640px) {
    .cf-confirm-portal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .cf-confirm-portal-dialog {
        width: 100%;
        border-radius: 22px;
    }

    .cf-confirm-portal-footer {
        flex-direction: column-reverse;
    }

        .cf-confirm-portal-footer .cf-btn-secondary,
        .cf-confirm-portal-footer .cf-btn-danger {
            width: 100%;
        }
}
/* Action Table format rule target selector */
.cf-format-target-picker {
    position: relative;
    width: 100%;
}

.cf-format-target-select {
    max-width: 560px;
    position: relative;
    z-index: 1;
}

    .cf-format-target-select.open {
        z-index: 3600;
    }

.cf-format-target-menu {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    z-index: 3700;
}

.cf-format-target-menu-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    border-radius: 10px;
    padding: 9px 10px;
}

    .cf-format-target-menu-item.selected {
        background: var(--cf-surface-soft);
        color: var(--cf-blue-700);
        font-weight: 700;
    }

.cf-format-target-check {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cf-blue-700);
    font-size: 0.78rem;
    font-weight: 900;
}

.cf-format-target-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cf-format-target-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 8px 5px 10px;
    border-radius: 999px;
    background: rgba(var(--cf-primary-rgb), 0.08);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.14);
    color: var(--cf-text);
    font-size: 0.8rem;
    font-weight: 700;
}

    .cf-format-target-chip button {
        width: 20px;
        height: 20px;
        border: none;
        border-radius: 999px;
        background: rgba(7, 21, 47, 0.08);
        color: var(--cf-text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding: 0;
    }

        .cf-format-target-chip button:hover:not(:disabled) {
            background: rgba(219, 47, 82, 0.12);
            color: var(--cf-danger-600);
        }

.cf-format-rule-modal .cf-select-menu {
    z-index: 3700;
}

/* Tenant Reports */
.cf-report-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
    .cf-report-tabs {
        grid-template-columns: 1fr;
    }
}

/* Report exports */
.cf-report-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cf-report-export-wrap {
    position: relative;
    z-index: 1301;
}

.cf-report-export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 108px;
}

.cf-report-export-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.cf-report-export-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 1302;
    width: 230px;
    overflow: hidden;
    padding: 0.4rem;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: var(--cf-surface-solid);
    box-shadow: 0 18px 48px rgba(15, 43, 68, 0.2);
}

    .cf-report-export-menu::before {
        content: "";
        position: absolute;
        top: -6px;
        right: 23px;
        width: 12px;
        height: 12px;
        border-top: 1px solid var(--cf-border);
        border-left: 1px solid var(--cf-border);
        background: var(--cf-surface-solid);
        transform: rotate(45deg);
    }

    .cf-report-export-menu button {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: center;
        gap: 0.7rem;
        width: 100%;
        padding: 0.72rem 0.75rem;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--cf-text);
        text-align: left;
        transition: background-color 0.16s ease, transform 0.16s ease;
    }

        .cf-report-export-menu button:hover,
        .cf-report-export-menu button:focus-visible {
            background: var(--cf-surface-soft);
            transform: translateY(-1px);
            outline: none;
        }

        .cf-report-export-menu button > span:last-child {
            color: var(--cf-text-muted);
            font-size: 0.78rem;
            line-height: 1.25;
        }

.cf-report-export-format {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--cf-border-strong);
    border-radius: 8px;
    background: var(--cf-surface-soft);
    color: var(--cf-primary, #135f97);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

@media (max-width: 720px) {
    .cf-report-header-actions {
        width: 100%;
        justify-content: stretch;
    }

        .cf-report-header-actions > .cf-btn-secondary,
        .cf-report-export-wrap,
        .cf-report-export-button {
            flex: 1 1 auto;
        }

    .cf-report-export-button {
        width: 100%;
    }

    .cf-report-export-menu {
        right: 0;
        width: min(240px, calc(100vw - 2rem));
    }
}

/* =========================================================
   ChannelFlow report sorting, horizontal scrolling, and
   sidebar hover repair.

   Append this entire block to the BOTTOM of the current
   ChannelFlow.Client/wwwroot/app.css file.
   ========================================================= */

/* Restore the sidebar hover and active navigation backgrounds. */
.cf-sidebar .cf-nav-link:hover,
.cf-sidebar .cf-nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    outline: none;
}

.cf-sidebar .cf-nav-link.active {
    background: linear-gradient( 135deg, rgba(15, 111, 255, 0.34), rgba(34, 199, 255, 0.18) );
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

    .cf-sidebar .cf-nav-link.active:hover,
    .cf-sidebar .cf-nav-link.active:focus-visible {
        background: linear-gradient( 135deg, rgba(15, 111, 255, 0.44), rgba(34, 199, 255, 0.24) );
    }

/* Report table scroll host. Overrides the inbox table's hidden overflow. */
.cf-report-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-radius: inherit;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 115, 140, 0.55) #eef4f9;
}

    .cf-report-table-scroll::-webkit-scrollbar {
        width: 11px;
        height: 11px;
    }

    .cf-report-table-scroll::-webkit-scrollbar-track {
        background: #eef4f9;
    }

    .cf-report-table-scroll::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.45);
        border-radius: 999px;
        border: 2px solid #eef4f9;
    }

        .cf-report-table-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(94, 115, 140, 0.72);
        }

.cf-report-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    margin-bottom: 0;
    overflow: visible !important;
    border-collapse: separate;
    border-spacing: 0;
}

    .cf-report-table thead th {
        position: sticky;
        top: 0;
        z-index: 20;
        min-width: 132px;
        white-space: nowrap;
        background: #f8fbfe;
        vertical-align: middle;
        box-shadow: inset 0 -1px 0 #dbe5ef;
    }

        .cf-report-table thead th:first-child {
            min-width: 158px;
        }

    .cf-report-table tbody td {
        white-space: nowrap;
        vertical-align: middle;
    }

        .cf-report-table tbody td .text-danger,
        .cf-report-table tbody td .small.text-muted,
        .cf-report-table tbody td pre {
            white-space: normal;
            word-break: break-word;
        }

/* ActionTable-style sortable report headers. */
.cf-report-sort-trigger {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    border: none;
    background: transparent;
    color: inherit;
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

    .cf-report-sort-trigger > span:first-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cf-report-sort-trigger:hover > span:first-child,
    .cf-report-sort-trigger:focus-visible > span:first-child,
    .cf-report-table thead th.cf-report-sort-active .cf-report-sort-trigger > span:first-child {
        color: var(--cf-text);
    }

    .cf-report-sort-trigger:focus-visible {
        outline: none;
    }

.cf-report-sort-arrow {
    width: 22px;
    height: 13px;
    margin-left: -5px;
    margin-top: -1px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    color: #94a3b8;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.14s ease, transform 0.14s ease, color 0.14s ease;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.cf-report-table thead th:hover .cf-report-sort-arrow,
.cf-report-table thead th.cf-report-sort-active .cf-report-sort-arrow,
.cf-report-sort-trigger:focus-visible .cf-report-sort-arrow {
    opacity: 1;
    transform: translateY(0);
}

.cf-report-sort-arrow.active {
    color: var(--cf-blue-700);
    opacity: 1;
    transform: translateY(0);
}

.cf-report-table thead th.cf-report-sort-active {
    background: #f8fbfe !important;
    box-shadow: inset 0 -1px 0 #dbe5ef !important;
}

@media (max-width: 768px) {
    .cf-report-table thead th {
        min-width: 122px;
    }

        .cf-report-table thead th:first-child {
            min-width: 146px;
        }
}

/* =========================================================
   Report table vertical scrolling
   Keeps report headers visible while rows scroll.
   ========================================================= */

.cf-report-table-scroll {
    max-height: clamp(360px, 52vh, 620px);
    overflow-x: auto !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

/* Keep headings fixed during vertical scrolling */
.cf-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #f8fbfe;
}

    /* Ensure the active sorted heading stays above the rows */
    .cf-report-table thead th.cf-report-sort-active {
        z-index: 31;
    }

/* Slightly smaller table viewport on narrower displays */
@media (max-width: 980px) {
    .cf-report-table-scroll {
        max-height: 480px;
    }
}

@media (max-width: 640px) {
    .cf-report-table-scroll {
        max-height: 420px;
    }
}

/* =========================================================
   Action Table action display mode and icon selector
   ========================================================= */

.cf-action-display-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: var(--cf-surface-soft);
}

.cf-action-display-choice {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--cf-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

    .cf-action-display-choice:hover,
    .cf-action-display-choice:focus-visible {
        border-color: var(--cf-border-strong);
        background: #ffffff;
        outline: none;
    }

    .cf-action-display-choice.selected {
        border-color: rgba(124, 58, 237, 0.42);
        background: #ffffff;
        box-shadow: 0 6px 16px rgba(124, 58, 237, 0.12);
        color: #6d28d9;
    }

.cf-action-display-button-glyph {
    min-width: 25px;
    height: 22px;
    padding: 0 5px;
    border: 1px solid currentColor;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.67rem;
    font-weight: 800;
    line-height: 1;
}

    .cf-action-display-button-glyph.compact {
        min-width: 22px;
        height: 19px;
        border-radius: 5px;
        font-size: 0.6rem;
    }

.cf-action-icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 8px;
}

.cf-action-icon-picker-option {
    min-height: 68px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--cf-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

    .cf-action-icon-picker-option:hover,
    .cf-action-icon-picker-option:focus-visible {
        border-color: var(--cf-border-strong);
        background: var(--cf-surface-soft);
        transform: translateY(-1px);
        outline: none;
    }

    .cf-action-icon-picker-option.selected {
        border-color: #7c3aed;
        background: rgba(124, 58, 237, 0.07);
        color: #6d28d9;
        box-shadow: 0 7px 18px rgba(124, 58, 237, 0.13);
    }

.cf-action-icon-visual {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
    color: currentColor;
}

.cf-action-definition-meta {
    display: flex;
    align-items: center;
    gap: 8px 12px;
    flex-wrap: wrap;
}

.cf-action-definition-display {
    min-height: 25px;
    padding: 3px 8px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: var(--cf-surface-soft);
    color: var(--cf-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.qf-row-action-list {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

    .qf-row-action-list .cf-btn-secondary {
        width: auto !important;
        min-width: 68px;
        flex: 1 1 auto;
        justify-content: center;
        padding-left: 9px;
        padding-right: 9px;
    }

.qf-global-action-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.qf-action-icon-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 7px;
    border: 1px solid var(--cf-border-strong);
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

    .qf-action-icon-button:hover,
    .qf-action-icon-button:focus-visible {
        border-color: #7c3aed;
        background: rgba(124, 58, 237, 0.06);
        box-shadow: 0 7px 18px rgba(124, 58, 237, 0.13);
        transform: translateY(-1px);
        outline: none;
    }

    .qf-action-icon-button.qf-action-icon-button-global {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        flex-basis: 40px;
        border-color: rgba(124, 58, 237, 0.5);
    }

    .qf-action-icon-button[aria-disabled="true"] {
        cursor: not-allowed;
    }

.qf-action-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(124, 58, 237, 0.22);
    border-top-color: #7c3aed;
    border-radius: 50%;
    display: inline-block;
    animation: qf-action-spin 0.7s linear infinite;
}

@keyframes qf-action-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .cf-action-icon-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .qf-row-action-list {
        gap: 5px;
    }

        .qf-row-action-list .cf-btn-secondary {
            min-width: 58px;
            padding-left: 7px;
            padding-right: 7px;
            font-size: 0.72rem;
        }

    .qf-action-icon-button {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        flex-basis: 34px;
        padding: 6px;
    }
}

/* =========================================================
   Reports + Action Table final UI corrections
   2026-08-02
   ========================================================= */

/* Keep Action Table row icons and buttons on one line. */
.qf-action-column,
.qf-action-cell {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
}

.qf-row-action-list {
    width: auto !important;
    min-width: max-content;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

    .qf-row-action-list .qf-action-icon-button,
    .qf-row-action-list .cf-btn-secondary {
        flex: 0 0 auto !important;
    }

    .qf-row-action-list .cf-btn-secondary {
        width: auto !important;
        min-width: 68px;
    }

/* Use the shared report icon image in every report tab header. */
.cf-report-tab-icon-image {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    display: block;
}

/* Real Excel and PDF images in export menus. */
.cf-report-export-menu button {
    grid-template-columns: 44px minmax(0, 1fr);
}

.cf-report-export-icon-frame {
    width: 40px;
    height: 40px;
    border: 1px solid var(--cf-border-strong);
    border-radius: 10px;
    background: var(--cf-surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.cf-report-export-icon {
    width: 100%;
    height: 100%;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    display: block;
}

.cf-report-export-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

    .cf-report-export-copy strong {
        color: var(--cf-text);
        font-size: 0.82rem;
        font-weight: 700;
    }

    .cf-report-export-copy span {
        color: var(--cf-text-muted);
        font-size: 0.78rem;
    }

/* Solid, correctly rounded selected sort header without the white corner gap. */
.cf-report-table-scroll {
    border-radius: var(--cf-radius-xl) !important;
    background: #f8fbfe;
    overflow-x: auto !important;
    overflow-y: auto !important;
    background-clip: padding-box;
}

.cf-report-table {
    border-radius: inherit;
}

    .cf-report-table thead th {
        background: #f8fbfe !important;
        background-clip: border-box;
    }

        .cf-report-table thead th:first-child,
        .cf-report-table thead th:first-child .cf-report-sort-trigger {
            border-top-left-radius: calc(var(--cf-radius-xl) - 1px);
        }

        .cf-report-table thead th:last-child,
        .cf-report-table thead th:last-child .cf-report-sort-trigger {
            border-top-right-radius: calc(var(--cf-radius-xl) - 1px);
        }

/* Space report pagination controls so their borders never touch. */
.cf-report-pagination {
    display: flex;
    align-items: center;
    gap: 9px !important;
    padding: 2px 0;
}

    .cf-report-pagination .cf-page-label {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding: 0 2px;
    }

@media (max-width: 768px) {
    .cf-report-tab-icon-image {
        width: 22px !important;
        height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
    }

    .qf-row-action-list {
        gap: 5px !important;
    }
}

/* Reports sorting: match Action Table View.
   Only the active arrow receives the theme colour. */

.cf-report-table thead th.cf-report-sort-active,
.cf-report-table thead th.cf-report-sort-active .cf-report-sort-trigger {
    background: #f8fbfe !important;
    background-color: #f8fbfe !important;
}

.cf-report-table thead th.cf-report-sort-active {
    box-shadow: inset 0 -1px 0 #dbe5ef !important;
    border-bottom-color: #dbe5ef !important;
}

    .cf-report-table thead th.cf-report-sort-active .cf-report-sort-trigger {
        box-shadow: none !important;
    }

.cf-report-sort-arrow.active {
    color: var(--cf-blue-700) !important;
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   NavMenu icons
   ========================================================= */

.cf-nav-link:not(.cf-nav-favorite-link) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
}

.cf-nav-link.cf-nav-link-with-badge {
    justify-content: flex-start;
}

.cf-nav-link-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

    .cf-nav-link-icon svg {
        display: block;
        width: 18px;
        height: 18px;
        max-width: 18px;
        max-height: 18px;
        flex: 0 0 18px;
        color: inherit;
        stroke: currentColor;
    }

.cf-nav-link-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
}

.cf-nav-link-with-badge .cf-nav-badge {
    margin-left: auto;
    flex: 0 0 auto;
}

/* Workspace header accent painted by the card itself.
   This guarantees the accent uses the exact card radius. */

.cf-content .card.cf-workspace-view-header-card {
    position: relative;
    background: linear-gradient( to bottom, var(--cf-workspace-accent, #0f9f6a) 0, var(--cf-workspace-accent, #0f9f6a) 6px, var(--cf-surface) 6px, var(--cf-surface) 100% ) !important;
    background-clip: padding-box !important;
}

/* =========================================================
   Action Table row detail panel
   ========================================================= */

.qf-action-table-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    overflow: hidden;
}

    .qf-action-table-content.has-detail-panel {
        grid-template-columns: minmax(0, 1fr) min(var(--qf-detail-panel-width, 680px), 58vw);
    }

    .qf-action-table-content > .qf-table-card {
        min-width: 0;
        min-height: 0;
    }

.qf-grid-table tbody tr.qf-row-detail-enabled {
    cursor: pointer;
}

    .qf-grid-table tbody tr.qf-row-detail-enabled:hover > td {
        background-image: linear-gradient( rgba(var(--cf-primary-rgb), 0.035), rgba(var(--cf-primary-rgb), 0.035) );
    }

.qf-grid-table tbody tr.qf-row-detail-selected > td {
    background-image: linear-gradient( rgba(var(--cf-primary-rgb), 0.11), rgba(var(--cf-primary-rgb), 0.11) ) !important;
    box-shadow: inset 0 1px 0 rgba(var(--cf-primary-rgb), 0.18), inset 0 -1px 0 rgba(var(--cf-primary-rgb), 0.18);
}

.qf-row-detail-panel {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-xl);
    box-shadow: none;
}

.qf-row-detail-resize-handle {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 12px;
    z-index: 12;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

    .qf-row-detail-resize-handle::before {
        content: "";
        width: 3px;
        height: 52px;
        border-radius: 999px;
        background: transparent;
        transition: background-color 0.15s ease, box-shadow 0.15s ease;
    }

    .qf-row-detail-resize-handle:hover::before,
    .qf-row-detail-panel.is-resizing .qf-row-detail-resize-handle::before {
        background: var(--cf-border-strong);
        box-shadow: 0 0 0 3px rgba(var(--cf-primary-rgb-soft), 0.10);
    }

.qf-row-detail-resize-capture {
    position: fixed;
    inset: 0;
    z-index: 5000;
    cursor: ew-resize;
    background: transparent;
    user-select: none;
}

.qf-row-detail-panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: var( --qf-detail-accent, var(--cf-success-600) );
    z-index: 2;
}

.qf-row-detail-header {
    flex: 0 0 auto;
    min-width: 0;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--cf-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient( 180deg, #ffffff 0%, #fbfdff 100% );
}

.qf-row-detail-eyebrow {
    margin-bottom: 4px;
    color: var(--cf-blue-700);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.qf-row-detail-title {
    margin: 0;
    color: var(--cf-text);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.qf-row-detail-subtitle {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.qf-row-detail-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--cf-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--cf-transition);
}

    .qf-row-detail-close:hover:not(:disabled) {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
        color: var(--cf-text);
    }

    .qf-row-detail-close svg {
        width: 18px;
        height: 18px;
        display: block;
    }

.qf-row-detail-alert {
    flex: 0 0 auto;
    margin: 12px 16px 0;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.qf-row-detail-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px 20px;
}

.qf-row-detail-field {
    padding: 11px 0;
    border-bottom: 1px solid #edf2f7;
}

    .qf-row-detail-field:last-child {
        border-bottom: none;
    }

.qf-row-detail-label {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--cf-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
}

.qf-row-detail-readonly {
    color: var(--cf-text-soft);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.qf-row-detail-value {
    min-height: 24px;
    color: var(--cf-text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

.qf-row-detail-input {
    width: 100%;
    min-height: 38px !important;
    height: 38px;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    font-size: 0.88rem !important;
}

.qf-row-detail-select .cf-select-trigger {
    min-height: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    box-shadow: none;
    font-size: 0.88rem;
}

.qf-row-detail-select .cf-select-menu {
    z-index: 3200;
}

.qf-row-detail-select.is-invalid
.cf-select-trigger {
    border-color: var(--cf-danger-600);
    box-shadow: 0 0 0 3px rgba(219, 47, 82, 0.1);
}

.qf-row-detail-field-error {
    margin-top: 5px;
    color: var(--cf-danger-600);
    font-size: 0.72rem;
    font-weight: 600;
}

.qf-row-detail-footer {
    flex: 0 0 auto;
    padding: 13px 16px;
    border-top: 1px solid var(--cf-border);
    background: #fbfdff;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.qf-row-detail-backdrop {
    display: none;
}

.qf-row-detail-body::-webkit-scrollbar {
    width: 10px;
}

.qf-row-detail-body::-webkit-scrollbar-track {
    background: transparent;
}

.qf-row-detail-body::-webkit-scrollbar-thumb {
    background: rgba(94, 115, 140, 0.38);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

@media (max-width: 1199.98px) {
    .qf-action-table-content.has-detail-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .qf-row-detail-backdrop {
        display: block;
        position: fixed;
        inset: 76px 0 0;
        z-index: 2690;
        border: none;
        background: rgba(6, 17, 38, 0.34);
        backdrop-filter: blur(2px);
    }

    .qf-row-detail-panel {
        position: fixed;
        top: 76px;
        right: 0;
        bottom: 0;
        width: min(var(--qf-detail-panel-width, 680px), 94vw);
        z-index: 2700;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: -18px 0 48px rgba(7, 21, 47, 0.2);
    }
}

@media (max-width: 640px) {
    .qf-row-detail-panel {
        width: 100vw;
        border-left: none;
        border-radius: 0;
    }

    .qf-row-detail-resize-handle {
        display: none;
    }

    .qf-row-detail-footer {
        flex-direction: column-reverse;
    }

        .qf-row-detail-footer .cf-btn-primary,
        .qf-row-detail-footer .cf-btn-secondary {
            width: 100%;
        }
}
/* Action Table virtual columns */
.cf-action-table-column-modal {
    width: min(920px, calc(100vw - 32px));
}

.cf-action-table-column-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.cf-action-table-column-section {
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: #ffffff;
    padding: 16px;
}

.cf-action-table-column-section-title {
    margin-bottom: 14px;
    color: var(--cf-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.cf-action-table-column-section-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--cf-text);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
}

    .cf-action-table-column-section-toggle:focus-visible {
        outline: none;
        color: var(--cf-blue-700);
    }

.cf-action-table-column-modal-footer {
    justify-content: space-between;
}

.cf-virtual-column-badge {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(var(--cf-primary-rgb), 0.08);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.18);
    color: var(--cf-blue-700);
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: none;
}

.column-mapping-source:has(.cf-virtual-column-badge) .form-control {
    padding-right: 76px;
}

.cf-option-disabled {
    opacity: 0.58;
    cursor: not-allowed !important;
}

    .cf-option-disabled input {
        cursor: not-allowed !important;
    }

.cf-btn-danger-outline {
    color: var(--cf-danger-600);
    border-color: rgba(219, 47, 82, 0.28);
}

    .cf-btn-danger-outline:hover {
        color: #ffffff;
        border-color: var(--cf-danger-600);
        background: var(--cf-danger-600);
    }

.qf-virtualize-placeholder-row > td {
    height: 46px;
    background: #ffffff;
}

@media (max-width: 640px) {
    .cf-action-table-column-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

        .cf-action-table-column-modal-footer > div,
        .cf-action-table-column-modal-footer .cf-btn-primary,
        .cf-action-table-column-modal-footer .cf-btn-secondary {
            width: 100%;
        }
}

/* =========================================================
   Action Table locked resizable column geometry
   ========================================================= */

.qf-grid-table {
    table-layout: fixed !important;
}

    .qf-grid-table col {
        box-sizing: border-box;
    }

    .qf-grid-table th,
    .qf-grid-table td {
        box-sizing: border-box;
        min-width: 0;
        overflow: hidden !important;
    }

    .qf-grid-table .qf-header-cell,
    .qf-grid-table .qf-header-sort-trigger,
    .qf-grid-table .qf-header-title,
    .qf-grid-table .qf-cell-content,
    .qf-grid-table .qf-cell-text,
    .qf-grid-table .qf-inline-cell-trigger,
    .qf-grid-table .qf-inline-cell-trigger .qf-cell-text {
        min-width: 0;
        max-width: 100%;
    }

        .qf-grid-table .qf-header-title,
        .qf-grid-table .qf-cell-text,
        .qf-grid-table .qf-inline-cell-trigger .qf-cell-text {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .qf-grid-table .qf-inline-cell-trigger {
        overflow: hidden;
    }

    /* =========================================================
   Action Table resize-handle alignment and selection guard
   ========================================================= */

    /*
 * Keep the data-column header content flush with the actual column box.
 * Padding is applied to the inner header cell so the resize handle can be
 * centred directly over the same right-edge divider used by the column.
 */
    .qf-grid-table thead th:not(.qf-action-column) {
        padding: 0 !important;
    }

        .qf-grid-table thead th:not(.qf-action-column) > .qf-header-cell {
            width: 100%;
            min-width: 0;
            min-height: 42px;
            box-sizing: border-box;
            padding: 8px 18px 8px 10px;
        }

/* The hit area straddles the divider, while its visual line is centred on it. */
.qf-column-resizer {
    top: 0;
    right: -6px;
    bottom: 0;
    width: 12px;
    height: auto;
    z-index: 45;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

    .qf-column-resizer::before {
        width: 2px;
        margin: 10px 0;
    }

.qf-grid-table thead th:not(:last-child)::after {
    right: 0;
    z-index: 1;
    pointer-events: none;
}

.qf-grid-table thead th.qf-column-resizing .qf-column-resizer::before {
    background: #94a3b8;
}

/*
 * Prevent browser text selection and sort-hover styling while a column is
 * being dragged. The resize handle remains interactive; the sort button does not.
 */
.qf-grid-scroll.is-column-resizing,
.qf-grid-scroll.is-column-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

    .qf-grid-scroll.is-column-resizing .qf-header-sort-trigger {
        pointer-events: none;
    }

        .qf-grid-scroll.is-column-resizing .qf-header-sort-trigger:hover .qf-header-title,
        .qf-grid-table thead th.qf-column-resizing .qf-header-title {
            color: #667085 !important;
        }

    .qf-grid-scroll.is-column-resizing .qf-grid-table thead th:not(.qf-sort-active) .qf-header-sort-arrow {
        opacity: 0 !important;
        transform: translateY(-3px) !important;
    }

    .qf-grid-scroll.is-column-resizing .qf-grid-table thead th.qf-sort-active .qf-header-sort-arrow {
        transition: none;
    }


@media (max-width: 768px) {
    .cf-format-icon-picker-header {
        align-items: stretch;
        flex-direction: column;
    }

        .cf-format-icon-picker-header .cf-btn-secondary {
            width: 100%;
        }

    .cf-format-icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        max-height: 220px;
    }
}


/* ==========================================================================
   Shared modal controls + Input Form Edit Field alignment
   ========================================================================== */

/* Match the standard ChannelFlow circular portal close button. */
.cf-formula-modal-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--cf-text);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--cf-transition);
    cursor: pointer;
}

    .cf-formula-modal-close:hover:not(:disabled) {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
        color: var(--cf-text);
    }

    .cf-formula-modal-close:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/*
 * FieldConfigurationModal previously used Bootstrap align-items-end on the
 * General row. The Source Column also has helper text below it, which caused
 * Type / Display Name / Options to be pushed lower than Source Column.
 * Keep all General controls aligned from the top instead.
 */
.cf-formula-modal:has(#field-config-title)
.cf-formula-modal-body
.row.g-2.align-items-end {
    align-items: flex-start !important;
    row-gap: 1rem;
}

    .cf-formula-modal:has(#field-config-title)
    .cf-formula-modal-body
    .row.g-2.align-items-end > [class*="col-"] {
        align-self: flex-start !important;
    }

    .cf-formula-modal:has(#field-config-title)
    .cf-formula-modal-body
    .row.g-2.align-items-end
    .d-flex.flex-nowrap {
        flex-wrap: wrap !important;
        align-items: center !important;
    }

/* =========================================================
   Action Table compact URL / File / Image / Signature cells
   ========================================================= */

.qf-rich-cell-content {
    min-width: 0;
    max-width: 100%;
}

.qf-rich-cell-content-editable {
    min-height: 42px;
    box-sizing: border-box;
    padding: 6px 12px;
}

.qf-rich-cell {
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    line-height: 1;
}

.qf-rich-url-cell,
.qf-rich-file-cell {
    flex: 1 1 auto;
}

.qf-rich-link,
.qf-rich-file-fallback,
.qf-rich-loading {
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
}

.qf-rich-link {
    color: var(--cf-blue-700);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 650;
}

    .qf-rich-link:hover {
        color: var(--cf-blue-500);
        text-decoration: underline;
    }

    .qf-rich-link:focus-visible,
    .qf-rich-preview-link:focus-visible,
    .qf-rich-edit-button:focus-visible {
        outline: 2px solid rgba(var(--cf-primary-rgb), 0.35);
        outline-offset: 2px;
        border-radius: 5px;
    }

.qf-rich-link-icon {
    flex: 0 0 auto;
    font-size: 17px;
    line-height: 1;
}

.qf-rich-link-label,
.qf-rich-fallback-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qf-rich-file-link {
    flex: 1 1 auto;
}

.qf-rich-edit-button {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cf-blue-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    opacity: 0.68;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

    .qf-rich-edit-button:hover {
        background: rgba(var(--cf-primary-rgb), 0.08);
        opacity: 1;
    }

    .qf-rich-edit-button .material-symbols-outlined {
        font-size: 16px;
    }

.qf-rich-preview-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
}

.qf-rich-image-preview {
    width: 36px;
    height: 30px;
    display: block;
    object-fit: cover;
    border: 1px solid var(--cf-border);
    border-radius: 6px;
    background: #ffffff;
}

.qf-rich-signature-link {
    background: #ffffff;
    border: 1px solid var(--cf-border);
}

.qf-rich-signature-preview {
    width: 66px;
    height: 28px;
    display: block;
    object-fit: contain;
    padding: 2px 4px;
    box-sizing: border-box;
    background: #ffffff;
}

.qf-rich-count-badge {
    min-width: 22px;
    height: 20px;
    flex: 0 0 auto;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--cf-primary-rgb), 0.08);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.16);
    color: var(--cf-blue-700);
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1;
}

.qf-rich-file-fallback,
.qf-rich-fallback-text {
    color: inherit;
    font-size: 0.84rem;
}

.qf-rich-loading {
    color: var(--cf-text-muted);
    font-size: 0.8rem;
}

.qf-rich-spinner {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 2px solid rgba(var(--cf-primary-rgb), 0.18);
    border-top-color: var(--cf-blue-700);
    border-radius: 50%;
    animation: qf-rich-spin 0.7s linear infinite;
}

.qf-row-detail-rich-value {
    min-height: 32px;
    display: flex;
    align-items: center;
}

@keyframes qf-rich-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   Input Form related-row Grid
   ========================================================= */
.cf-input-grid-shell {
    width: 100%;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.cf-input-grid-scroll {
    width: 100%;
    overflow-x: auto;
}

.cf-input-grid-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: auto;
}

    .cf-input-grid-table th,
    .cf-input-grid-table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--cf-border);
        text-align: left;
        vertical-align: middle;
        white-space: nowrap;
    }

    .cf-input-grid-table th {
        background: #f8fbfe;
        color: var(--cf-text-muted);
        font-size: .78rem;
        font-weight: 700;
    }

    .cf-input-grid-table td {
        color: var(--cf-text);
        font-size: .9rem;
    }

    .cf-input-grid-table tbody tr:last-child td {
        border-bottom: 0;
    }

.cf-input-grid-empty,
.cf-input-grid-state {
    padding: 14px 16px;
    color: var(--cf-text-muted);
    background: #fbfdff;
    font-size: .88rem;
}

/* Searchable shared select / Enum Allow New
   Keep the dropdown body block-based. The floating menu is positioned by JS,
   while this options panel owns vertical scrolling. */
.cf-select-menu {
    display: block;
    max-height: none;
    overflow: visible;
}

.cf-select-search-wrap {
    display: block;
    padding: 10px;
    border-bottom: 1px solid var(--cf-border);
    background: #ffffff;
}

.cf-select-search-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--cf-text);
    padding: 7px 11px;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
}

    .cf-select-search-input:hover {
        border-color: var(--cf-border-strong);
    }

    .cf-select-search-input:focus {
        border-color: var(--cf-border-strong);
        box-shadow: 0 0 0 4px rgba(var(--cf-primary-rgb-soft), 0.14);
    }

.cf-select-options {
    display: block;
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 115, 140, 0.48) transparent;
}

    .cf-select-options > .cf-select-item {
        display: block;
        width: 100%;
    }

    .cf-select-options::-webkit-scrollbar {
        width: 8px;
    }

    .cf-select-options::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-select-options::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.48);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

        .cf-select-options::-webkit-scrollbar-thumb:hover {
            background: rgba(94, 115, 140, 0.72);
            border: 2px solid transparent;
            background-clip: padding-box;
        }

.cf-select-new-item {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: var(--cf-blue-700);
    font-weight: 700;
    border-bottom: 1px solid #eef2f7;
}

    .cf-select-new-item:hover {
        color: var(--cf-blue-700);
    }

.cf-select-new-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
}

.cf-select-empty {
    padding: 12px 16px;
    color: var(--cf-text-muted);
    font-size: 0.86rem;
}

/* Action Table Row Detail configuration + format target scrolling hardening */
.cf-select-menu.cf-format-target-menu {
    display: block;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 115, 140, 0.4) transparent;
}

    .cf-select-menu.cf-format-target-menu::-webkit-scrollbar {
        width: 10px;
    }

    .cf-select-menu.cf-format-target-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .cf-select-menu.cf-format-target-menu::-webkit-scrollbar-thumb {
        background: rgba(94, 115, 140, 0.4);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

        .cf-select-menu.cf-format-target-menu::-webkit-scrollbar-thumb:hover {
            background: rgba(94, 115, 140, 0.65);
            border: 2px solid transparent;
            background-clip: padding-box;
        }

/* Input Form Yes/No checkbox control */
.cf-input-form-checkbox-choice {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-sm);
    background: var(--cf-surface-solid);
}

    .cf-input-form-checkbox-choice .form-check-input {
        width: 18px;
        height: 18px;
        margin: 0;
        flex: 0 0 18px;
        cursor: pointer;
    }

        .cf-input-form-checkbox-choice .form-check-input:disabled {
            cursor: not-allowed;
        }

    .cf-input-form-checkbox-choice span {
        font-size: 0.9rem;
    }

/* ==========================================================================
   Shared CfSelect floating menu + long-value marquee
   ========================================================================== */

.cf-select-menu.cf-select-menu-floating {
    position: fixed !important;
    top: 0;
    left: 0;
    right: auto !important;
    width: 280px;
    min-width: 0;
    max-width: calc(100vw - 16px);
    visibility: hidden;
    z-index: 5000 !important;
    border: 1px solid var(--cf-border-strong);
    border-radius: var(--cf-radius-sm);
    box-shadow: 0 18px 42px rgba(7, 21, 47, 0.16);
    overflow: hidden;
}

    .cf-select-menu.cf-select-menu-floating.positioned {
        visibility: visible;
    }

.cf-select-host.open .cf-select-trigger {
    border-radius: var(--cf-radius-sm);
}

.cf-select-host.cf-select-opens-below .cf-select-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.cf-select-host.cf-select-opens-above .cf-select-trigger {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.cf-select-menu.cf-select-menu-floating.cf-select-menu-below {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.cf-select-menu.cf-select-menu-floating.cf-select-menu-above {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.cf-select-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.cf-select-text-value {
    display: inline-block;
    min-width: max-content;
    white-space: nowrap;
    transform: translateX(0);
    will-change: transform;
}

.cf-select-text.is-overflowing:hover .cf-select-text-value {
    animation: cf-select-text-reveal var(--cf-select-scroll-duration, 2.8s) ease-in-out forwards;
}

@keyframes cf-select-text-reveal {
    0%, 12% {
        transform: translateX(0);
    }

    88%, 100% {
        transform: translateX(calc(-1 * var(--cf-select-overflow, 0px)));
    }
}

@media (prefers-reduced-motion: reduce) {
    .cf-select-text.is-overflowing:hover .cf-select-text-value {
        animation: none;
    }
}

.cf-workspace-grid-inline-table td:has(.cf-select-host) {
    min-width: 180px !important;
}

.cf-workspace-grid-inline-table td:has(.cf-select-host[data-searchable="true"]) {
    min-width: 230px !important;
}

.cf-workspace-grid-inline-table td:has(.cf-select-host) .cf-select-trigger {
    min-width: 0;
    width: 100%;
}

.cf-workspace-grid-inline-table td:has(.cf-select-host[data-searchable="true"]) .cf-select-trigger {
    min-width: 200px;
}

@media (max-width: 768px) {
    .cf-workspace-grid-inline-table td:has(.cf-select-host),
    .cf-workspace-grid-inline-table td:has(.cf-select-host[data-searchable="true"]) {
        min-width: 190px !important;
    }

        .cf-workspace-grid-inline-table td:has(.cf-select-host[data-searchable="true"]) .cf-select-trigger {
            min-width: 170px;
        }
}

/* =========================================================
   Notification count badge consistency
   - Fixed-height flex pills for every unread/count badge.
   - Numbers remain mathematically centred for 1, 2 and 3+ digits.
   ========================================================= */

.cf-count-badge,
.cf-topbar-badge,
.cf-tenant-count-badge,
.cf-unread-badge,
.cf-nav-badge {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

/* Topbar notification count. The white ring keeps the pill crisp over the bell. */
.cf-topbar-badge {
    top: -9px;
    right: -12px;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--cf-danger-600);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(219, 47, 82, 0.22);
}

/* Tenant selector trigger: name on the left, global count + chevron on the right. */
.cf-tenant-dropdown-trigger .cf-tenant-dropdown-text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.cf-tenant-dropdown-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

.cf-tenant-count-badge,
.cf-nav-badge {
    min-width: 24px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cf-danger-600), var(--cf-danger-500));
    color: #ffffff;
    font-size: 0.70rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(219, 47, 82, 0.18);
}

.cf-tenant-count-badge-total {
    box-shadow: 0 3px 10px rgba(219, 47, 82, 0.22);
}

.cf-tenant-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cf-tenant-dropdown-item-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-notification-global-count {
    margin-top: 2px;
    color: var(--cf-text-muted);
    font-size: 0.72rem;
    line-height: 1.2;
}

@media (max-width: 640px) {
    .cf-topbar-badge {
        top: -7px;
        right: -8px;
        min-width: 22px;
        height: 20px;
        padding: 0 6px;
        font-size: 0.68rem;
    }

    .cf-tenant-dropdown-right {
        gap: 6px;
    }

    .cf-tenant-count-badge,
    .cf-nav-badge {
        min-width: 22px;
        height: 20px;
        padding: 0 6px;
    }
}

/* ============================================================
   Action Table Matrix
   Shared Matrix/table-total presentation styles.

   Typography intentionally uses whole-pixel sizes. Fractional rem
   values such as .76rem / .72rem resolve to sub-pixel font sizes
   in common browser configurations and can make dense sticky
   Matrix tables look soft on Windows/Chrome.
   ============================================================ */
.cf-matrix-shell {
    position: relative;
    width: 100%;
    overflow: auto;
    background: #fff;
    isolation: isolate;
}

    .cf-matrix-shell.is-column-resizing,
    .cf-matrix-shell.is-column-resizing * {
        cursor: col-resize !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

        .cf-matrix-shell.is-column-resizing .qf-header-sort-trigger {
            pointer-events: none;
        }

.cf-matrix-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    text-rendering: optimizeLegibility;
}

/*
 * app.css also contains generic compact-table rules scoped under
 * .cf-content. Those selectors are more specific than the Matrix
 * selectors, so explicitly override them here to prevent 12.8px /
 * 14.08px fractional font sizes from leaking into Matrix tables.
 */
.cf-content .cf-matrix-table {
    font-size: 14px;
    line-height: 1.35;
}

    .cf-content .cf-matrix-table thead th {
        font-size: 12px;
        line-height: 1.25;
        letter-spacing: 0;
    }

    .cf-content .cf-matrix-table tbody td {
        font-size: 14px;
        line-height: 1.35;
    }

.cf-matrix-table col {
    box-sizing: border-box;
}

.cf-matrix-table th,
.cf-matrix-table td {
    box-sizing: border-box;
    padding: 9px 10px;
    border-right: 1px solid var(--cf-border);
    border-bottom: 1px solid var(--cf-border);
    background: #fff;
    color: var(--cf-text);
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.cf-matrix-table tbody td {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.cf-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 0;
    background: #f8fbfe;
    color: #5f6b7a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    overflow: visible;
}

.cf-matrix-table thead tr:nth-child(2) th {
    top: 45px;
}

.cf-matrix-table thead th:hover .qf-header-sort-arrow,
.cf-matrix-table thead th.cf-matrix-sort-active .qf-header-sort-arrow {
    opacity: 1;
    transform: translateY(0);
}

.cf-matrix-header-cell {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 8px 18px 8px 10px;
}

    .cf-matrix-header-cell .qf-header-sort-trigger {
        width: 100%;
        min-width: 0;
        justify-content: center;
        font: inherit;
        line-height: inherit;
    }

.cf-matrix-row-label-header .cf-matrix-header-cell .qf-header-sort-trigger {
    justify-content: flex-start;
}

.cf-matrix-header-cell .qf-header-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.cf-matrix-group-header {
    border-top: 3px solid var(--cf-workspace-accent, #0f9f6a);
}

.cf-matrix-group-header-content {
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-matrix-group-title {
    overflow: hidden;
    color: var(--cf-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-matrix-group-subtitle {
    margin-top: 3px;
    overflow: hidden;
    color: #6f7b8a;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-matrix-row-label,
.cf-matrix-row-label-header {
    position: sticky !important;
    left: 0;
    z-index: 12 !important;
    text-align: left !important;
    background: #fff !important;
    box-shadow: 1px 0 0 var(--cf-border);
}

.cf-matrix-row-label-header {
    z-index: 20 !important;
    background: #f8fbfe !important;
}

.cf-matrix-row-label {
    overflow: hidden;
    color: var(--cf-text);
    font-size: 14px;
    font-weight: 600 !important;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.cf-matrix-summary-header,
.cf-matrix-summary-cell {
    position: sticky !important;
    z-index: 11;
    background: #fbfdff !important;
    box-shadow: -1px 0 0 var(--cf-border);
}

.cf-matrix-summary-cell {
    overflow: hidden;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.cf-matrix-summary-header {
    z-index: 19 !important;
    background: #f1f6fb !important;
}

    .cf-matrix-summary-header .cf-matrix-header-cell {
        padding: 7px 10px 7px 8px;
    }

    .cf-matrix-summary-header .qf-header-title {
        color: #536171;
        font-size: 12px;
        font-weight: 700;
    }

.cf-matrix-sort-active {
    box-shadow: inset 0 -2px 0 var(--cf-workspace-accent, var(--cf-blue-700));
}

    .cf-matrix-sort-active .qf-header-sort-arrow {
        color: var(--cf-workspace-accent, var(--cf-blue-700));
        opacity: 1;
        transform: translateY(0);
    }

.cf-matrix-column-resizing {
    background: #f4f8fc !important;
}

.cf-matrix-shell .qf-column-resizer {
    top: 0;
    right: -6px;
    bottom: 0;
    width: 12px;
    height: auto;
    z-index: 45;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

    /*
     * Keep the resize hit area generous, but draw the visible line
     * exactly over the table's real 1px column border.
     */
    .cf-matrix-shell .qf-column-resizer::before {
        width: 1px;
        margin: 0;
        border-radius: 0;
    }

    .cf-matrix-table thead th:hover .qf-column-resizer::before,
    .cf-matrix-table thead th.cf-matrix-column-resizing .qf-column-resizer::before,
    .cf-matrix-shell .qf-column-resizer.qf-column-resizer-active::before {
        background: var(--cf-border-strong);
    }

.cf-matrix-empty {
    padding: 40px 20px;
    color: var(--cf-text-muted);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.cf-matrix-totals {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-top: 1px solid var(--cf-border);
    background: #fbfdff;
}

.cf-matrix-total-card {
    min-width: 150px;
    padding: 9px 12px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: #fff;
}

.cf-matrix-total-label {
    color: #6f7b8a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cf-matrix-total-value {
    margin-top: 3px;
    color: var(--cf-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

/* Tenant Settings */

.cf-settings-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-settings-tab {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--cf-text);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-settings-tab:hover {
        background: var(--cf-surface-soft);
        border-color: var(--cf-border-strong);
    }

    .cf-settings-tab.active {
        color: #ffffff;
        border-color: transparent;
        background: var(--cf-primary-gradient);
        box-shadow: none;
    }

.cf-settings-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.cf-settings-provider-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cf-settings-stat {
    min-width: 0;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #f8fbfe;
    padding: 13px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .cf-settings-stat > span {
        color: var(--cf-text-muted);
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .cf-settings-stat > strong {
        color: var(--cf-text);
        font-size: 1rem;
        font-weight: 800;
        line-height: 1.2;
        font-variant-numeric: tabular-nums;
        overflow-wrap: anywhere;
    }

.cf-settings-rate-pair,
.cf-settings-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
}

.cf-settings-rate-pair {
    background: rgba(var(--cf-primary-rgb), 0.08);
    color: var(--cf-blue-700);
    border: 1px solid rgba(var(--cf-primary-rgb), 0.16);
}

.cf-settings-state.active {
    background: rgba(15, 159, 106, 0.10);
    color: #0f7a54;
    border: 1px solid rgba(15, 159, 106, 0.18);
}

.cf-settings-state.inactive {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.cf-settings-check-control {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 2px;
    color: var(--cf-text);
    font-size: 0.88rem;
    font-weight: 600;
}

    .cf-settings-check-control .form-check-input {
        width: 17px;
        height: 17px;
        margin: 0;
        flex: 0 0 17px;
    }

.cf-settings-advanced {
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #f8fbfe;
    padding: 0;
    overflow: hidden;
}

    .cf-settings-advanced > summary {
        list-style: none;
        min-height: 44px;
        padding: 11px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        color: var(--cf-text);
        background: #ffffff;
        font-size: 0.88rem;
        font-weight: 800;
        cursor: pointer;
        user-select: none;
    }

        .cf-settings-advanced > summary::-webkit-details-marker {
            display: none;
        }

        .cf-settings-advanced > summary::after {
            content: "›";
            color: var(--cf-text-muted);
            font-size: 1.25rem;
            line-height: 1;
            transform: rotate(90deg);
            transition: transform 0.16s ease;
        }

    .cf-settings-advanced[open] > summary {
        border-bottom: 1px solid var(--cf-border);
    }

        .cf-settings-advanced[open] > summary::after {
            transform: rotate(-90deg);
        }

    .cf-settings-advanced > :not(summary) {
        margin-left: 14px;
        margin-right: 14px;
    }

    .cf-settings-advanced > :last-child {
        margin-bottom: 14px;
    }

.cf-settings-rate-meta {
    display: flex;
    align-items: center;
    gap: 10px 24px;
    flex-wrap: wrap;
    color: var(--cf-text-muted);
    font-size: 0.8rem;
}

    .cf-settings-rate-meta > div {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .cf-settings-rate-meta strong {
        color: var(--cf-text);
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

@media (max-width: 1100px) {
    .cf-settings-provider-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .cf-settings-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cf-settings-tab {
        width: 100%;
    }

    .cf-settings-provider-grid {
        grid-template-columns: 1fr;
    }

    .cf-settings-section-header {
        flex-direction: column;
        align-items: stretch;
    }

        .cf-settings-section-header .cf-btn-primary,
        .cf-settings-section-header .cf-btn-secondary {
            width: 100%;
        }
}
