: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: #0b172a;
    --cf-text-muted: #5e738c;
    --cf-text-soft: #7b8da3;
    --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;
}

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%;
}

a,
.btn-link {
    color: var(--cf-blue-700);
    text-decoration: none;
}

    a:hover,
    .btn-link:hover {
        color: var(--cf-blue-600);
    }

h1:focus {
    outline: none;
}

.content {
    padding-top: 1.1rem;
}

.display-6 {
    font-size: 2rem;
    font-weight: 800;
    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(34, 199, 255, 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: 700;
    transition: var(--cf-transition);
}

.btn-primary {
    color: white;
    background: var(--cf-primary-gradient);
    border: none;
    box-shadow: 0 12px 28px rgba(15, 111, 255, 0.22);
}

    .btn-primary:hover {
        color: white;
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: 0 16px 32px rgba(15, 111, 255, 0.28);
    }

/* 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: hidden;
    background: var(--cf-sidebar-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.cf-sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cf-sidebar-brand {
    font-size: 1.7rem;
    font-weight: 800;
    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;
}

.cf-nav-group {
    margin-bottom: 24px;
}

.cf-nav-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 10px;
    padding: 0 10px;
    font-weight: 700;
}

.cf-nav-link {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--cf-radius-md);
    margin-bottom: 6px;
    transition: var(--cf-transition);
}

    .cf-nav-link:hover {
        background: rgba(127, 231, 255, 0.08);
        color: #ffffff;
    }

    .cf-nav-link.active,
    a.active.cf-nav-link {
        background: linear-gradient(135deg, rgba(15, 111, 255, 0.34) 0%, rgba(34, 199, 255, 0.22) 100%);
        color: #ffffff;
        font-weight: 700;
        box-shadow: inset 0 0 0 1px rgba(127, 231, 255, 0.14);
    }

.cf-logout-btn {
    width: 100%;
    text-align: left;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding: 12px 14px;
    border-radius: var(--cf-radius-md);
    font-weight: 700;
    transition: var(--cf-transition);
}

    .cf-logout-btn:hover {
        background: rgba(255, 255, 255, 0.16);
    }

.cf-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    overflow: hidden;
}

.cf-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: auto;
    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: 800;
        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);
    }

    .cf-content .btn {
        border-radius: var(--cf-radius-sm);
        font-weight: 700;
    }

    .cf-content .form-control,
    .cf-content .form-select,
    .cf-content textarea,
    .form-control,
    .form-select,
    textarea {
        border-radius: var(--cf-radius-md);
        border: 1px solid #cddbeb;
        padding: 12px 14px;
        background: #ffffff;
        box-shadow: none;
    }

        .form-control:focus,
        .form-select:focus,
        textarea:focus {
            border-color: #57cfff;
            box-shadow: 0 0 0 4px rgba(34, 199, 255, 0.14);
        }

.table-responsive {
    border-radius: 16px;
    overflow: hidden;
}

.cf-content .table,
.table {
    background: white;
    overflow: hidden;
}

/* 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);
    z-index: 10;
}

.cf-topbar-title {
    font-size: 1.1rem;
    font-weight: 800;
    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: 0 6px 18px rgba(7, 21, 47, 0.05);
}

.cf-topbar-icon-btn {
    width: 42px;
    height: 42px;
    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: 700;
    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: 700;
    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: 0 12px 28px rgba(15, 111, 255, 0.22);
    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: 700;
}

    .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: 0 16px 32px rgba(15, 111, 255, 0.28);
    }

/* Tenant picker */
.cf-tenant-picker-wrap {
    display: flex;
    align-items: center;
}

.cf-tenant-picker {
    min-width: 260px;
    height: 42px;
    border-radius: var(--cf-radius-sm);
    padding: 0 14px;
    font-weight: 700;
}

/* 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: 700;
    margin-bottom: 16px;
    border: 1px solid rgba(15, 111, 255, 0.1);
}

.cf-home-title,
.cf-platform-title {
    font-size: 2.5rem;
    font-weight: 800;
    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: var(--cf-radius-md);
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    min-width: 180px;
}

.cf-btn-secondary {
    background: var(--cf-surface-solid);
    color: var(--cf-text);
}

    .cf-btn-secondary:hover {
        background: var(--cf-surface-soft);
    }

/* Auth */
.cf-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cf-auth-gradient);
    padding: 24px;
}

.cf-auth-panel,
.login-card {
    width: 100%;
    max-width: 520px;
    padding: 40px;
}

.cf-login-wrap .form-label,
.form-label {
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.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: #64748b;
    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;
}

/* 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: #64748b;
    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: 700;
    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: #334155;
}

.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: 800;
    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: #94a3b8;
    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: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
    box-shadow: 0 6px 16px rgba(7, 21, 47, 0.08);
}

/* Inbox */
.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-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: visible;
}

.cf-inbox-table-card {
    overflow: visible;
    box-shadow: none;
}

.cf-inbox-table {
    margin-bottom: 0;
}

    .cf-inbox-table thead th {
        background: #f8fbfe;
        color: var(--cf-text);
        font-weight: 800;
        white-space: nowrap;
        box-shadow: inset 0 -1px 0 #dbe5ef;
        padding: 8px 12px;
        font-size: 0.92rem;
    }

    .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;
    }

    .cf-inbox-table tbody .fw-semibold {
        line-height: 1.1;
    }

    .cf-inbox-table tbody .small {
        font-size: 0.74rem;
        margin-top: 1px;
    }

.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: 700;
    min-height: 36px;
}

    .cf-page-btn:disabled {
        opacity: 0.5;
    }

.cf-page-label {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 700;
}

.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: 40px;
    padding: 7px 12px;
}

.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: 700;
    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: 800;
    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(15, 111, 255, 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: 700;
}

.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;
}

@media (max-width: 1200px) {
    .cf-inbox-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .cf-inbox-filter-actions {
        justify-content: flex-start;
    }
}

@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;
    }
}

/* 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: 800;
    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-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;
    }
}
/* 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: 2rem;
    font-weight: 800;
    color: var(--cf-text);
    letter-spacing: -0.03em;
}

.cf-page-subtitle {
    margin-top: 6px;
    color: var(--cf-text-muted);
    font-size: 0.95rem;
}

.cf-page-back-btn {
    border-radius: var(--cf-radius-sm);
    padding: 10px 14px;
    font-weight: 700;
    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: 700;
}

.cf-breadcrumb-separator {
    color: #94a3b8;
}

.cf-content:has(.cf-team-page-v2) {
    overflow: hidden;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Team Page - restored v2 layout with collapsible sections */
.cf-team-page-v2 {
    padding: 20px;
    height: calc(100vh - 140px);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cf-team-page-header-v2 {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex: 0 0 auto;
}

.cf-team-page-title-v2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #122033;
}

.cf-team-page-subtitle-v2 {
    margin-top: 4px;
    color: var(--cf-text-muted);
    font-size: 0.95rem;
}

.cf-team-shell-v2 {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    flex: 1;
    min-height: 0;
    padding-left: 10px;
    overflow: hidden;
}

.cf-team-sidebar-card,
.cf-team-chat-card-v2 {
    border-radius: 24px;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.cf-team-sidebar-card {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
}

.cf-team-chat-card-v2 {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.cf-team-sidebar-top {
    padding: 14px;
    border-bottom: 1px solid var(--cf-border);
    background: #fff;
    flex: 0 0 auto;
}

.cf-team-sidebar-scroll {
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
    background: #fff;
    padding: 6px 6px 12px 0;
}

.cf-team-sidebar-section {
    padding: 8px 0;
}

.cf-team-sidebar-divider {
    height: 1px;
    background: var(--cf-border);
    margin: 8px 12px;
}

.cf-team-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: 800;
    color: #44566c;
    text-transform: none;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--cf-transition);
}

    .cf-team-section-toggle:hover {
        background: #e9eef5;
    }

.cf-team-section-chevron {
    width: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #64748b;
    flex-shrink: 0;
}

.cf-team-section-content {
    padding-top: 2px;
}

.cf-team-row {
    width: calc(100% - 16px);
    margin: 0 8px 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-team-row:hover,
    .cf-team-row.active {
        background: rgba(15, 111, 255, 0.06);
    }

.cf-team-row-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}

.cf-team-row-avatar-company {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.cf-team-row-avatar-group {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.cf-team-row-avatar-direct,
.cf-team-row-avatar-person {
    background: linear-gradient(135deg, #0f6fff, #3db5ff);
}

.cf-team-row-main {
    min-width: 0;
    flex: 1;
}

.cf-team-row-top,
.cf-team-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cf-team-row-title {
    font-weight: 800;
    color: var(--cf-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-team-row-time,
.cf-team-row-preview {
    color: var(--cf-text-muted);
    font-size: 0.82rem;
}

.cf-team-row-time {
    flex-shrink: 0;
}

.cf-team-row-preview {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.cf-team-empty-list {
    padding: 0 16px 12px;
    color: var(--cf-text-muted);
}

.cf-team-chat-header-v2 {
    padding: 16px 18px;
    border-bottom: 1px solid var(--cf-border);
    background: #fff;
    flex: 0 0 auto;
}

.cf-team-chat-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cf-team-chat-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #0f6fff, #3db5ff);
    flex-shrink: 0;
}

.cf-team-chat-title-v2 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--cf-text);
}

.cf-team-chat-subtitle-v2 {
    font-size: 0.84rem;
    color: var(--cf-text-muted);
}

.cf-team-chat-thread-v2 {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(180deg, #f8fbfe 0%, #f5f8fc 100%);
}

.cf-team-empty-chat-v2 {
    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-team-empty-chat-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--cf-text);
    margin-bottom: 8px;
}

.cf-team-empty-thread {
    color: var(--cf-text-muted);
}

.cf-team-date-divider {
    display: flex;
    justify-content: center;
    margin: 10px 0 16px;
}

    .cf-team-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: 700;
    }

.cf-team-message-row-v2 {
    display: flex;
    margin-bottom: 12px;
}

    .cf-team-message-row-v2.incoming {
        justify-content: flex-start;
    }

    .cf-team-message-row-v2.outgoing {
        justify-content: flex-end;
    }

.cf-team-message-bubble-v2 {
    max-width: 70%;
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

    .cf-team-message-bubble-v2.incoming {
        background: #fff;
        color: var(--cf-text);
    }

    .cf-team-message-bubble-v2.outgoing {
        background: linear-gradient(135deg, #0f6fff, #3db5ff);
        color: #fff;
    }

.cf-team-message-sender-v2 {
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 4px;
    opacity: 0.78;
}

.cf-team-message-text-v2 {
    white-space: pre-wrap;
    word-break: break-word;
}

.cf-team-message-time-v2 {
    margin-top: 6px;
    font-size: 0.72rem;
    opacity: 0.75;
    text-align: right;
}

.cf-team-chat-composer-v2 {
    padding: 16px 18px;
    border-top: 1px solid var(--cf-border);
    background: #fff;
    flex: 0 0 auto;
}

.cf-team-chat-textarea {
    resize: none;
    min-height: 96px;
}

.cf-team-chat-composer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.cf-team-inline-panel {
    padding: 0 16px 12px;
}

.cf-team-group-users-v2 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 10px;
}

.cf-team-group-user-row-v2 {
    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-team-group-user-left-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cf-team-group-user-name {
    font-weight: 700;
    color: var(--cf-text);
}

.cf-team-group-user-email {
    font-size: 0.82rem;
    color: var(--cf-text-muted);
}

.cf-team-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
}

.cf-team-alert {
    padding: 12px;
    border-radius: 12px;
    white-space: pre-wrap;
}

.cf-team-alert-error {
    border: 1px solid #efb2b2;
    background: #ffe8e8;
    color: #8d1f1f;
}

.cf-team-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: 800;
    line-height: 1;
    flex-shrink: 0;
}

.cf-unread-badge-alert {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
}

.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: 800;
    line-height: 1;
}

.cf-team-sidebar-scroll::-webkit-scrollbar,
.cf-team-chat-thread-v2::-webkit-scrollbar,
.cf-team-group-users-v2::-webkit-scrollbar {
    width: 10px;
}

.cf-team-sidebar-scroll::-webkit-scrollbar-track,
.cf-team-chat-thread-v2::-webkit-scrollbar-track,
.cf-team-group-users-v2::-webkit-scrollbar-track {
    background: transparent;
}

.cf-team-sidebar-scroll::-webkit-scrollbar-thumb,
.cf-team-chat-thread-v2::-webkit-scrollbar-thumb,
.cf-team-group-users-v2::-webkit-scrollbar-thumb {
    background: #c7d2df;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    .cf-team-sidebar-scroll::-webkit-scrollbar-thumb:hover,
    .cf-team-chat-thread-v2::-webkit-scrollbar-thumb:hover,
    .cf-team-group-users-v2::-webkit-scrollbar-thumb:hover {
        background: #aebdce;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

@media (max-width: 1100px) {
    .cf-team-shell-v2 {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .cf-team-row-preview {
        max-width: 180px;
    }
}

@media (max-width: 860px) {
    .cf-content:has(.cf-team-page-v2) {
        overflow-y: auto;
    }

    .cf-team-page-v2 {
        height: auto;
    }

    .cf-team-shell-v2 {
        grid-template-columns: 1fr;
        padding-left: 0;
        overflow: visible;
    }

    .cf-team-sidebar-card {
        margin-left: 0;
        min-height: 420px;
    }

    .cf-team-chat-card-v2 {
        min-height: 620px;
    }

    .cf-team-chat-thread-v2 {
        min-height: 340px;
    }
}

/* 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: 800;
    line-height: 1;
}

@media (max-width: 980px) {
    .cf-team-layout {
        grid-template-columns: 1fr;
    }

    .cf-team-main-body {
        min-height: 520px;
    }
}
/* 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: 700;
    color: var(--cf-text);
    margin-bottom: 4px;
}

.cf-notification-item-message {
    color: #475569;
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.cf-notification-item-time {
    color: #94a3b8;
    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: 700;
    padding: 0;
}

    .cf-link-btn:hover {
        color: var(--cf-blue-700);
    }

/* 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: #475569;
    border-radius: var(--cf-radius-xs);
    padding: 8px 14px;
    font-weight: 700;
    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: 700;
    color: var(--cf-text);
}

.cf-loading-message {
    color: var(--cf-text-muted);
    font-size: 0.95rem;
}

/* 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;
    }
}

@media (max-width: 900px) {
    .cf-app-shell {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .cf-sidebar {
        width: 100%;
        flex: none;
        height: auto;
        overflow: visible;
    }

    .cf-main {
        height: auto;
        overflow: visible;
    }

    .cf-content {
        flex: none;
        min-height: auto;
        height: auto;
        overflow: visible;
        padding: 20px;
    }

    .cf-topbar {
        padding: 0 18px;
    }
}

@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);
    will-change: opacity, transform;
}

@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 {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: radial-gradient(circle at 12% 14%, rgba(34, 199, 255, 0.22), transparent 22%), radial-gradient(circle at 78% 24%, rgba(15, 111, 255, 0.18), transparent 24%), linear-gradient(120deg, #061126 0%, #081731 28%, #0a2348 58%, #0f6fff 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.05) 0, rgba(127, 231, 255, 0.05) 1px, transparent 1px, transparent 120px), linear-gradient(rgba(127, 231, 255, 0.035) 0, rgba(127, 231, 255, 0.035) 1px, transparent 1px, transparent 120px);
        mask-image: linear-gradient(180deg, rgba(255,255,255,0.45), 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;
}

.cf-login-hero-inner {
    max-width: 560px;
}

.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: 700;
    letter-spacing: 0.03em;
    margin-bottom: 22px;
}

.cf-login-hero-title {
    margin: 0 0 16px;
    font-size: 3.2rem;
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: white;
}

.cf-login-hero-text {
    margin: 0 0 28px;
    font-size: 1.06rem;
    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: 700;
}

.cf-login-panel-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(180deg, rgba(244, 248, 251, 0.96) 0%, rgba(238, 245, 251, 0.98) 100%);
    backdrop-filter: blur(10px);
}

.cf-login-card {
    width: 100%;
    max-width: 520px;
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(7, 21, 47, 0.12), 0 8px 24px rgba(15, 111, 255, 0.08);
    border: 1px solid rgba(191, 216, 240, 0.9);
}

.cf-login-card-title {
    margin: 0 0 10px;
    font-size: 2.3rem;
    font-weight: 800;
    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;
    }

    .cf-login-hero {
        padding: 40px 32px 16px;
    }

    .cf-login-hero-title {
        font-size: 2.6rem;
    }

    .cf-login-panel-wrap {
        padding: 16px 24px 32px;
        background: transparent;
    }

    .cf-login-card {
        max-width: 640px;
    }
}

@media (max-width: 640px) {
    .cf-login-hero {
        padding: 28px 20px 8px;
    }

    .cf-login-panel-wrap {
        padding: 12px 16px 24px;
    }

    .cf-login-card {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .cf-login-hero-title {
        font-size: 2.1rem;
    }

    .cf-login-hero-text {
        font-size: 0.98rem;
    }

    .cf-login-card-title {
        font-size: 2rem;
    }
}

.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: 0 6px 18px rgba(7, 21, 47, 0.05);
    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;
}

.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: 700;
    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-conversation-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    min-height: 0;
    height: calc(100vh - 220px);
}

.cf-conversation-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cf-conversation-side {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    background: transparent;
}

.cf-conversation-main > .card:first-child {
    flex: 0 0 auto;
}

.cf-conversation-main > .card:last-child {
    flex: 0 0 auto;
}

.cf-conversation-main > .card:nth-child(2) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

    .cf-conversation-main > .card:nth-child(2) .card-body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

.cf-message-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .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);
        }

.cf-message-status {
    margin-top: 6px;
    font-size: 0.76rem;
    line-height: 1.2;
    color: #7f8da3;
}

.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: 800;
    line-height: 1.2;
}

.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);
}

.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;
}

.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;
    }
}