:root {
    /* ReplyFlow logo palette — Reply (#4285F4) + Flow (#25D366) + WA deep (#075E54) */
    --rf-teal: #075e54;
    --rf-teal-deep: #054c44;
    --rf-green: #25d366;
    --rf-blue: #4285f4;
    --rf-blue-deep: #3367d6;
    --rf-gmail-red: #ea4335;
    --rf-gmail-yellow: #fbbc05;
    --rf-gmail-green: #34a853;
    --rf-bg: #f4f7fb;
    --rf-surface: #ffffff;
    --rf-text: #202124;
    --rf-muted: #5f6368;
    --rf-border: #e1e3e1;
    --rf-danger: #ea4335;
    --rf-shadow: 0 1px 2px rgba(60, 64, 67, .12), 0 1px 3px 1px rgba(60, 64, 67, .08);

    /* RGB channels for rgba() helpers */
    --rf-teal-rgb: 7, 94, 84;
    --rf-green-rgb: 37, 211, 102;
    --rf-blue-rgb: 66, 133, 244;
    --rf-danger-rgb: 234, 67, 53;

    /* Legacy aliases — shell uses teal; CTAs use logo blue */
    --primary-color: var(--rf-teal);
    --secondary-color: var(--rf-green);
    --action-color: var(--rf-blue);
    --action-color-deep: var(--rf-blue-deep);

    /* Align Bootstrap utilities with logo colors */
    --bs-primary: #4285f4;
    --bs-primary-rgb: 66, 133, 244;
    --bs-success: #25d366;
    --bs-success-rgb: 37, 211, 102;
    --bs-danger: #ea4335;
    --bs-danger-rgb: 234, 67, 53;
    --bs-link-color: #4285f4;
    --bs-link-hover-color: #3367d6;
}

body {
    background: var(--rf-bg) !important;
    color: var(--rf-text);
}

@media (min-width: 1200px) {

    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl {
        max-width: 960px !important;
    }
}

.header {
    margin-bottom: 0.75rem !important;
}

.header-title {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--rf-text) !important;
    font-size: 1.35rem;
}

.border-bottom {
    border-bottom: 1px solid var(--rf-border) !important;
}

.content {
    margin-top: 0.75rem !important;
    background: transparent;
}

.wrapper {
    background: var(--rf-bg) !important;
}

.wrapper:before {
    height: 0 !important;
    display: none !important;
}

.mb-2-8 {
    margin-bottom: 2.8rem;
}

.title-space {
    padding-bottom: 0.6rem;
}

.btn-accoring-to-text {
    width: revert;
}

/* —— Actions = Gmail blue; chrome = WhatsApp teal —— */
.btn-primary,
.bg-primary-dark,
.splash .splash-icon {
    background-color: var(--rf-blue) !important;
    color: #fff !important;
    border-color: var(--rf-blue) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--rf-blue-deep) !important;
    border-color: var(--rf-blue-deep) !important;
    color: #fff !important;
}

.list-group-item.active {
    background-color: var(--rf-teal) !important;
    color: #fff !important;
    border-color: var(--rf-teal) !important;
}

.btn-primary,
.bg-primary-dark {
    border: 1px solid var(--rf-blue) !important;
}

.btn-outline-primary {
    background-color: transparent !important;
    border-color: var(--rf-blue) !important;
    color: var(--rf-blue) !important;
}

.btn-outline-primary:hover {
    background-color: var(--rf-blue) !important;
    border-color: var(--rf-blue) !important;
    color: #fff !important;
}

.btn-success {
    background-color: var(--rf-green) !important;
    border-color: var(--rf-green) !important;
    color: #fff !important;
}

.btn-danger {
    background-color: var(--rf-danger) !important;
    border-color: var(--rf-danger) !important;
}

a.sidebar-link .fab,
a.sidebar-link .fal,
a.sidebar-link .far,
a.sidebar-link .fas,
a.sidebar-link svg,
.text-primary {
    color: var(--rf-teal) !important;
}

.sidebar-item.active>.sidebar-link .fab,
.sidebar-item.active>.sidebar-link .fal,
.sidebar-item.active>.sidebar-link .far,
.sidebar-item.active>.sidebar-link .fas,
.sidebar-item.active>.sidebar-link svg,
.sidebar-item.active>.sidebar-link {
    color: #fff !important;
}

.sidebar-item.active>.sidebar-link {
    background-color: var(--rf-teal) !important;
    box-shadow: 0 1px 3px rgba(0, 92, 75, .25);
}

.sidebar-link:hover {
    color: var(--rf-teal-deep) !important;
    background-color: rgba(7, 94, 84, .08) !important;
}

.sidebar-brand,
.sidebar-brand:hover {
    background-color: var(--rf-teal) !important;
}

.sidebar {
    background: var(--rf-surface) !important;
    border-right: 1px solid var(--rf-border);
}

.sidebar-content {
    background: var(--rf-surface) !important;
}

.dispatch-note {
    display: block;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
    padding: 8px;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(66, 133, 244, 0.18) !important;
    border-color: var(--rf-blue) !important;
    border-width: 1px !important;
}

.sidebar-user {
    padding: 1rem 0.85rem 0.75rem !important;
    border-bottom: 1px solid var(--rf-border);
    margin-bottom: 0.35rem;
}

.card {
    border: 1px solid var(--rf-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--rf-shadow) !important;
    background: var(--rf-surface) !important;
}

.cardscroll {
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    max-height: 20rem;
}

.text-bg-warning,
.bg-warning {
    background-color: #fef7e0 !important;
    color: #e37400 !important;
}

.badge.bg-success,
.bg-success {
    background-color: var(--rf-green) !important;
}

.badge.bg-primary,
.bg-primary {
    background-color: var(--rf-blue) !important;
}

.badge.bg-danger,
.bg-danger {
    background-color: var(--rf-danger) !important;
}

.sidebar-user img {
    height: 5rem !important;
    width: auto !important;
}

.logo,
.rf-brand-logo {
    height: 4.5rem !important;
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.auth-logo-link {
    display: inline-flex;
    align-items: center;
}

.center-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-tab {
    --bs-nav-link-padding-x: 1rem;
    --bs-nav-link-padding-y: 0.5rem;
    --bs-nav-link-font-weight: ;
    --bs-nav-link-color: var(--bs-link-color);
    --bs-nav-link-hover-color: var(--bs-link-hover-color);
    --bs-nav-link-disabled-color: var(--bs-secondary-color);
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
}

.nav-item-tab {
    padding: 0.5rem !important;
}

.nav-tab .active {
    background-color: rgba(7, 94, 84, .1);
    color: var(--rf-teal);
}

.sidebar-link,
a.sidebar-link {
    border-radius: .75rem !important;
    padding: .55rem .75rem !important;
    color: var(--rf-text) !important;
    font-weight: 500;
}

.sidebar [data-bs-toggle=collapse]:before {
    top: 1.1rem !important;
}

.sidebar-item {
    margin-bottom: 0.3rem !important;
}

.sidebar-dropdown {
    padding-left: 1rem !important;
}

.min-height {
    min-height: 85vh !important;
}

.big-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--rf-blue);
    background-color: #fff;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
}

.avatar-sm {
    height: 32px !important;
    width: 32px !important;
    min-width: 32px;
    min-height: 32px;
}

.avatar-md {
    height: 48px !important;
    width: 48px !important;
    min-width: 48px;
    min-height: 48px;
}

.avatar-lg {
    height: 64px !important;
    width: 64px !important;
    min-width: 64px;
    min-height: 64px;
}

.avatar i {
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-sm i {
    font-size: 12px;
}

.avatar-md i {
    font-size: 16px;
}

.avatar-lg i {
    font-size: 20px;
}

.avatar>* {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.quick-action-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar.d-flex {
    display: flex !important;
}

.stats-card .bg-primary,
.stats-card .bg-info,
.stats-card .bg-warning,
.stats-card .bg-success,
.stats-card .bg-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.stats-card .bg-primary i,
.stats-card .bg-info i,
.stats-card .bg-warning i,
.stats-card .bg-success i,
.stats-card .bg-danger i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-card .bg-primary {
    background-color: var(--rf-blue) !important;
}

.stats-card .bg-success {
    background-color: var(--rf-green) !important;
}

.stats-card .bg-info {
    background-color: var(--rf-teal) !important;
}

.validation-message {
    font-size: 13px !important;
}

/* ========== Auth (Login / Register) ========== */
/* Auth UI lives in dashboard/css/auth.css (loaded on guest auth layouts). */

/* ========== Sidebar pending modules ========== */
.sidebar-pending-badge {
    background: rgba(66, 133, 244, 0.12) !important;
    color: var(--rf-blue-deep) !important;
    font-size: 0.65rem !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 999px !important;
    padding: 0.25rem 0.5rem !important;
}

.sidebar-pending-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--rf-green);
    margin-left: auto;
    display: inline-block;
}

.pending-module-card {
    border-radius: 1rem !important;
}

.pending-module-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 94, 84, 0.1);
    color: var(--rf-teal);
    font-size: 1.6rem;
}

.pending-badge {
    background: rgba(37, 211, 102, 0.2) !important;
    color: #0d7a3a !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
}

.pending-meta {
    background: var(--rf-bg);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    color: var(--rf-muted);
    font-size: 0.9rem;
}

/* ========== App chrome enhancements ========== */
.navbar.navbar-theme {
    background: var(--rf-surface) !important;
    border-bottom: 1px solid var(--rf-border);
    box-shadow: none !important;
    min-height: 56px;
}

.navbar.navbar-theme .nav-link,
.navbar.navbar-theme .navbar-nav .nav-link {
    color: var(--rf-muted) !important;
}

.navbar.navbar-theme .nav-link:hover,
.navbar.navbar-theme .navbar-nav .nav-link:hover {
    color: var(--rf-teal) !important;
}

.navbar.navbar-theme .hamburger,
.navbar.navbar-theme .sidebar-toggle {
    color: var(--rf-teal) !important;
}

/* AdminKit hamburger uses background bars (not color) — force visibility on light topbar */
.navbar.navbar-theme.rf-topbar .sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    z-index: 1050;
    cursor: pointer;
}

.navbar.navbar-theme.rf-topbar .hamburger,
.navbar.navbar-theme.rf-topbar .hamburger:before,
.navbar.navbar-theme.rf-topbar .hamburger:after {
    background: var(--rf-teal) !important;
}

.navbar.navbar-theme.rf-topbar .sidebar-toggle:hover {
    background: rgba(var(--rf-teal-rgb), .08);
}

.navbar.navbar-theme.rf-topbar .sidebar-toggle:hover .hamburger,
.navbar.navbar-theme.rf-topbar .sidebar-toggle:hover .hamburger:before,
.navbar.navbar-theme.rf-topbar .sidebar-toggle:hover .hamburger:after {
    background: var(--rf-teal-deep) !important;
}

.main {
    background: var(--rf-bg);
}

.rf-page-card {
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 12px;
    box-shadow: var(--rf-shadow);
    padding: 1.25rem;
}

.rf-metric {
    border-radius: 12px;
    border: 1px solid var(--rf-border);
    background: var(--rf-surface);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--rf-shadow);
}

.rf-metric .rf-metric-label {
    color: var(--rf-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rf-metric .rf-metric-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--rf-text);
    letter-spacing: -0.02em;
}

.rf-metric.is-teal .rf-metric-icon { background: rgba(7, 94, 84, .12); color: var(--rf-teal); }
.rf-metric.is-blue .rf-metric-icon { background: rgba(66, 133, 244, .12); color: var(--rf-blue); }
.rf-metric.is-green .rf-metric-icon { background: rgba(37, 211, 102, .16); color: #0d7a3a; }

.rf-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.rf-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--rf-border);
    background: var(--rf-surface);
    color: var(--rf-muted);
    text-decoration: none;
}

.rf-chip:hover {
    border-color: var(--rf-blue);
    color: var(--rf-blue);
}

.rf-chip.active {
    background: rgba(66, 133, 244, .1);
    border-color: var(--rf-blue);
    color: var(--rf-blue-deep);
}

.rf-chip.is-success.active,
.rf-chip.is-success:hover {
    background: rgba(37, 211, 102, .14);
    border-color: var(--rf-green);
    color: #0d7a3a;
}

.rf-chip.is-danger.active {
    background: rgba(234, 67, 53, .1);
    border-color: var(--rf-danger);
    color: var(--rf-danger);
}

.rf-channel-pill {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    font-size: 0.95rem;
}
.rf-channel-pill.whatsapp {
    background: rgba(37, 211, 102, 0.18);
    color: #fff;
}
.auth-brand-panel .rf-channel-pill.whatsapp { background: rgba(255,255,255,.18); color: var(--rf-green); }
.rf-channel-pill.gmail {
    background: rgba(66, 133, 244, 0.18);
    color: #fff;
}
.auth-brand-panel .rf-channel-pill.gmail { background: rgba(255,255,255,.18); color: #a8c7fa; }

/* ========== Modern sidebar ========== */
.rf-sidebar.sidebar {
    width: 272px !important;
    min-width: 272px !important;
    max-width: 272px !important;
    background: #ffffff !important;
    border-right: 1px solid var(--rf-border) !important;
    box-shadow: 1px 0 0 rgba(60,64,67,.04);
}

/* Collapsed desktop / off-canvas offsets must match 272px width */
@media (min-width: 992px) {
    .sidebar-collapsed .rf-sidebar.sidebar,
    .sidebar-collapsed .rf-sidebar.sidebar.toggled {
        margin-left: -272px !important;
    }

    .sidebar-collapsed .rf-sidebar .sidebar-content {
        left: -272px !important;
    }

    .sidebar-collapsed.toggled .rf-sidebar.sidebar,
    .sidebar-collapsed.toggled .rf-sidebar .sidebar-content {
        margin-left: 0 !important;
        left: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .rf-sidebar.sidebar {
        margin-left: -272px !important;
    }

    .rf-sidebar.sidebar .sidebar-content {
        left: -272px !important;
    }

    .rf-sidebar.sidebar.toggled {
        margin-left: 0 !important;
    }

    .rf-sidebar.sidebar.toggled .sidebar-content {
        left: 0 !important;
    }
}

.rf-sidebar-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 0 !important;
    background: #fff !important;
}

.rf-sidebar-brand {
    flex-shrink: 0;
    padding: 0.85rem 0.9rem 0.75rem;
    border-bottom: 1px solid var(--rf-border);
}

.rf-sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    color: inherit;
}

.rf-sidebar-logo-img {
    display: block;
    width: auto;
    height: 72px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.rf-sidebar-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--rf-blue) 0%, var(--rf-green) 100%);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(var(--rf-blue-rgb), .28);
    flex-shrink: 0;
}

.rf-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.rf-sidebar-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--rf-text);
}

.rf-sidebar-tag {
    font-size: 0.68rem;
    color: var(--rf-muted);
    font-weight: 500;
    margin-top: 2px;
}

.rf-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.65rem 1rem;
    min-height: 0;
}

.rf-sidebar-nav {
    margin: 0 !important;
    padding: 0 !important;
}

.rf-nav-label {
    list-style: none;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa0a6;
    padding: 0.85rem 0.75rem 0.35rem;
    margin: 0;
}

.rf-sidebar .sidebar-link,
.rf-sidebar a.sidebar-link {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem !important;
    border-radius: 10px !important;
    color: #3c4043 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.rf-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    background: var(--rf-bg);
    color: var(--rf-teal) !important;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.rf-sidebar a.sidebar-link .rf-nav-icon .fab,
.rf-sidebar a.sidebar-link .rf-nav-icon .fas,
.rf-sidebar a.sidebar-link .rf-nav-icon i {
    color: inherit !important;
    margin: 0 !important;
}

.rf-sidebar .sidebar-link:hover {
    background: rgba(7, 94, 84, .07) !important;
    color: var(--rf-teal-deep) !important;
}

.rf-sidebar .sidebar-item.active > .sidebar-link {
    background: linear-gradient(135deg, var(--rf-teal) 0%, var(--rf-teal-deep) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 92, 75, .28) !important;
}

.rf-sidebar .sidebar-item.active > .sidebar-link .rf-nav-icon {
    background: rgba(255,255,255,.18);
    color: #fff !important;
}

.rf-sidebar .sidebar-item.active > .sidebar-link .fab,
.rf-sidebar .sidebar-item.active > .sidebar-link .fas,
.rf-sidebar .sidebar-item.active > .sidebar-link .far,
.rf-sidebar .sidebar-item.active > .sidebar-link span {
    color: #fff !important;
}

.rf-sidebar .sidebar-dropdown {
    padding: 0.25rem 0 0.35rem 0.35rem !important;
    margin: 0 !important;
}

.rf-sidebar .sidebar-dropdown .sidebar-link {
    padding: 0.45rem 0.65rem 0.45rem 0.5rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--rf-muted) !important;
    gap: 0.55rem;
}

.rf-sidebar .sidebar-dropdown .sidebar-item.active > .sidebar-link {
    background: rgba(7, 94, 84, .1) !important;
    color: var(--rf-teal-deep) !important;
    box-shadow: none !important;
}

.rf-sidebar .sidebar-dropdown .sidebar-item.active > .sidebar-link span,
.rf-sidebar .sidebar-dropdown .sidebar-item.active > .sidebar-link {
    color: var(--rf-teal-deep) !important;
}

.rf-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c4c7c5;
    flex-shrink: 0;
    margin-left: 0.85rem;
    margin-right: 0.15rem;
}

.rf-nav-dot.is-wa { background: var(--rf-green); }
.rf-nav-dot.is-gm { background: var(--rf-blue); }

.rf-sidebar .sidebar-dropdown .sidebar-item.active .rf-nav-dot {
    background: var(--rf-teal);
}

.rf-sidebar-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--rf-border);
    background: #fafbfc;
}

.rf-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
    text-decoration: none !important;
    color: inherit;
    border-radius: 10px;
    padding: 0.25rem;
}

.rf-sidebar-user:hover {
    background: rgba(0,0,0,.03);
}

.rf-sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--rf-blue), var(--rf-teal));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.rf-sidebar-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.rf-sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rf-sidebar-user-role {
    font-size: 0.68rem;
    color: var(--rf-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rf-sidebar-logout {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--rf-muted);
    text-decoration: none !important;
    flex-shrink: 0;
}

.rf-sidebar-logout:hover {
    background: rgba(234, 67, 53, .1);
    color: var(--rf-danger);
}

/* Hide legacy sidebar-user block if present */
.rf-sidebar .sidebar-user { display: none !important; }

/* ========== Modern page chrome ========== */
.main {
    background: var(--rf-bg) !important;
}

.content {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;
}

.rf-content-wrap {
    padding-top: 0.25rem !important;
    padding-bottom: 1.5rem !important;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

@media (max-width: 575.98px) {
    .rf-content-wrap {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        padding-bottom: 1rem !important;
    }
}

.rf-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem !important;
    padding: 0.25rem 0 0.85rem;
    border-bottom: 1px solid transparent;
}

.rf-page-header .header-title {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em;
    color: var(--rf-text) !important;
}

.navbar.navbar-theme.rf-topbar {
    background: rgba(255,255,255,.92) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rf-border) !important;
    min-height: 58px;
    padding-left: 0.75rem;
    padding-right: 1rem;
    position: relative;
    z-index: 1040;
    overflow: visible !important;
}

.navbar.navbar-theme.rf-topbar .navbar-collapse,
.navbar.navbar-theme.rf-topbar .navbar-nav {
    overflow: visible !important;
}

.card {
    border-radius: 14px !important;
    border: 1px solid var(--rf-border) !important;
    box-shadow: 0 1px 2px rgba(60,64,67,.06) !important;
    overflow: hidden;
}

.card .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--rf-border) !important;
    font-weight: 600;
    padding: 1rem 1.15rem;
}

.card .card-body {
    padding: 1.15rem;
}

.table {
    --bs-table-bg: transparent;
    color: var(--rf-text);
}

.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--rf-muted);
    border-bottom-width: 1px;
    background: #fafbfc;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    border-color: #f1f3f4;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background: rgba(7, 94, 84, .04);
}

.form-control,
.form-select {
    border-radius: 10px !important;
    border-color: var(--rf-border) !important;
    min-height: 2.6rem;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rf-blue) !important;
    box-shadow: 0 0 0 0.2rem rgba(66, 133, 244, .15) !important;
}

.btn {
    border-radius: 10px !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-sm {
    border-radius: 8px !important;
}

.list-group-item {
    border-color: #f1f3f4 !important;
    font-size: 0.875rem;
}

.list-group-item-action:hover {
    background: rgba(7, 94, 84, .05) !important;
}

.list-group-item.active {
    border-radius: 10px !important;
    margin: 0.2rem 0.4rem;
    width: auto;
}

.badge {
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    border: 0;
    color: var(--rf-teal);
}

.pagination .page-item.active .page-link {
    background: var(--rf-teal);
    color: #fff;
}

.rf-metric {
    transition: transform .15s ease, box-shadow .15s ease;
}

.rf-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(60,64,67,.1);
}

@media (max-width: 991.98px) {
    .rf-sidebar.sidebar {
        width: 260px !important;
    }
}

/* ========== Topbar polish ========== */
.rf-topbar-brand { min-width: 0; }

.rf-topbar-tagline {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rf-muted) !important;
}

.rf-channel-pill {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-size: 0.9rem;
}

.rf-channel-pill.whatsapp {
    background: rgba(37, 211, 102, 0.16);
    color: #075e54;
}

.rf-channel-pill.gmail {
    background: rgba(66, 133, 244, 0.14);
    color: #4285f4;
}

.rf-topbar-user {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.25rem 0.55rem 0.25rem 0.3rem !important;
    border-radius: 999px;
    background: var(--rf-bg);
    line-height: 1 !important;
    min-height: 36px;
    text-decoration: none !important;
}

.rf-topbar-user:hover {
    background: #eef1f5 !important;
}

.rf-topbar-user.dropdown-toggle::after {
    display: none !important;
}

.rf-topbar-user-menu {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--rf-muted);
    display: inline-grid !important;
    place-items: center;
    padding: 0 !important;
    font-size: 0.7rem;
    cursor: pointer;
}

.rf-topbar-user-menu:hover,
.rf-topbar-user-menu[aria-expanded="true"] {
    background: #eef1f5 !important;
    color: var(--rf-text) !important;
}

.rf-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--rf-blue), var(--rf-green));
    color: #fff;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    overflow: hidden;
    /* Optical vertical center for capital glyphs */
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.rf-topbar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rf-text);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

.rf-dropdown {
    border: 1px solid var(--rf-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(60,64,67,.12) !important;
    padding: 0.4rem !important;
    min-width: 12rem;
}

.rf-dropdown .dropdown-item {
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.rf-page-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--rf-blue) 0%, var(--rf-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
}

.rf-page-heading {
    min-width: 0;
}

.rf-page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer {
    background: transparent !important;
    border-top: 1px solid var(--rf-border);
}

/* ========== Settings nav polish ========== */
.rf-card .list-group-item {
    border: 0 !important;
    margin: 0.2rem 0.5rem;
    border-radius: 10px !important;
    padding: 0.7rem 0.85rem;
    color: var(--rf-text);
}

.rf-card .list-group-item.active {
    background: linear-gradient(135deg, var(--rf-teal) 0%, var(--rf-teal-deep) 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(0, 92, 75, .22);
}

.rf-card .list-group-item-action:not(.active):hover {
    background: rgba(7, 94, 84, .07) !important;
    color: var(--rf-teal-deep) !important;
}

.rf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.15rem !important;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%) !important;
}

.rf-card-header .card-title {
    color: var(--rf-text);
    font-size: 0.95rem;
    flex: 1 1 auto;
    min-width: 0;
}

.rf-card-header .card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.rf-card-refresh {
    width: 34px;
    height: 34px;
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    background: #fff;
    color: var(--rf-muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.rf-card-refresh:hover {
    color: var(--rf-text);
    background: #f4f6f8;
}

/* ========== Approval queue ========== */
.rf-aq {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.rf-aq-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.rf-aq-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw + 0.75rem, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rf-text);
}

.rf-aq-sub {
    margin: 0.25rem 0 0;
    color: var(--rf-muted);
    font-size: 0.92rem;
}

.rf-aq-hero-meta {
    text-align: right;
    min-width: 5rem;
}

.rf-aq-total {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--rf-text);
    letter-spacing: -0.03em;
}

.rf-aq-total-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
}

.rf-aq-channel-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
    width: 100%;
}

.rf-aq-channel-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--rf-border);
    background: var(--rf-surface);
    box-shadow: var(--rf-shadow);
    text-decoration: none;
    color: var(--rf-text);
    min-width: 0;
    min-height: 3rem;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.rf-aq-channel-tab:hover {
    border-color: #c9ced6;
    color: var(--rf-text);
    transform: translateY(-1px);
}

.rf-aq-channel-tab.active {
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(60, 64, 67, .12);
}

.rf-aq-channel-tab.active.is-whatsapp,
.rf-aq-channel-tab.is-whatsapp.active {
    background: linear-gradient(135deg, rgba(37, 211, 102, .14), rgba(7, 94, 84, .08));
    border-color: rgba(7, 94, 84, .28);
}

.rf-aq-channel-tab.active.is-gmail,
.rf-aq-channel-tab.is-gmail.active {
    background: linear-gradient(135deg, rgba(66, 133, 244, .12), rgba(51, 103, 214, .06));
    border-color: rgba(66, 133, 244, .3);
}

.rf-aq-channel-tab.active:not(.is-whatsapp):not(.is-gmail) {
    background: linear-gradient(135deg, rgba(7, 94, 84, .08), rgba(66, 133, 244, .08));
    border-color: rgba(66, 133, 244, .22);
}

.rf-aq-channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: var(--rf-bg);
    color: var(--rf-muted);
    flex-shrink: 0;
}

.rf-aq-channel-tab.is-whatsapp .rf-aq-channel-icon {
    background: rgba(37, 211, 102, .16);
    color: #075e54;
}

.rf-aq-channel-tab.is-gmail .rf-aq-channel-icon {
    background: rgba(66, 133, 244, .14);
    color: #4285f4;
}

.rf-aq-channel-label {
    font-weight: 600;
    font-size: 0.92rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rf-aq-channel-label-short,
.rf-chip-label-short {
    display: none;
}

.rf-aq-channel-count {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--rf-muted);
    background: var(--rf-bg);
    border-radius: 999px;
    min-width: 1.75rem;
    padding: 0.15rem 0.55rem;
    text-align: center;
    flex-shrink: 0;
}

.rf-aq-channel-tab.active .rf-aq-channel-count {
    color: var(--rf-text);
    background: rgba(255, 255, 255, .7);
}

.rf-aq-panel {
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
    overflow: hidden;
    max-width: 100%;
}

.rf-aq-toolbar {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--rf-border);
    background: linear-gradient(180deg, #fafbfc 0%, var(--rf-surface) 100%);
}

.rf-aq-toolbar-scroll {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rf-aq-list {
    display: flex;
    flex-direction: column;
}

.rf-aq-item {
    display: flex;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--rf-border);
    transition: background .12s ease;
    min-width: 0;
}

.rf-aq-item:last-child {
    border-bottom: 0;
}

.rf-aq-item:hover {
    background: #f7f9fc;
    color: inherit;
}

.rf-aq-item-rail {
    padding-top: 0.15rem;
    flex-shrink: 0;
}

.rf-aq-item-main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.rf-aq-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.rf-aq-item-who {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.rf-aq-contact {
    font-weight: 700;
    color: var(--rf-text);
    font-size: 0.98rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.rf-aq-channel-name {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
}

.rf-aq-item-badges {
    display: inline-flex;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rf-aq-priority,
.rf-aq-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.rf-aq-priority.is-normal { background: #eef1f5; color: #5f6368; }
.rf-aq-priority.is-low { background: #eef1f5; color: #80868b; }
.rf-aq-priority.is-high { background: rgba(232, 152, 26, .14); color: #b06000; }
.rf-aq-priority.is-urgent { background: rgba(234, 67, 53, .12); color: #c5221f; }

.rf-aq-status.is-pending { background: rgba(66, 133, 244, .12); color: #3367d6; }
.rf-aq-status.is-submitted { background: rgba(232, 152, 26, .16); color: #8a5a00; }
.rf-aq-status.is-approved { background: rgba(37, 211, 102, .16); color: #0d7a3a; }
.rf-aq-status.is-rejected { background: rgba(234, 67, 53, .12); color: #c5221f; }
.rf-aq-status.is-muted { background: #eef1f5; color: #5f6368; }

.rf-aq-summary {
    font-size: 0.92rem;
    color: var(--rf-text);
    margin-bottom: 0.35rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.rf-aq-customer {
    font-size: 0.82rem;
    color: var(--rf-muted);
    line-height: 1.4;
    margin-bottom: 0.55rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.rf-aq-customer-label {
    font-weight: 700;
    color: #80868b;
    margin-right: 0.25rem;
}

.rf-aq-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rf-aq-time {
    font-size: 0.75rem;
    color: #80868b;
}

.rf-aq-review {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rf-blue);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.rf-aq-item:hover .rf-aq-review {
    color: var(--rf-blue-deep);
}

.rf-aq-empty {
    text-align: center;
    padding: 3rem 1.5rem;
}

.rf-aq-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.85rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--rf-bg);
    color: var(--rf-muted);
    font-size: 1.4rem;
}

.rf-aq-empty-title {
    font-weight: 700;
    color: var(--rf-text);
    margin-bottom: 0.25rem;
}

.rf-aq-empty-sub {
    font-size: 0.9rem;
}

.rf-aq-pager {
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--rf-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rf-aq-pager .pagination {
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0;
    row-gap: 0.35rem;
}

@media (max-width: 991.98px) {
    .rf-aq-channel-tabs {
        gap: 0.5rem;
    }

    .rf-aq-channel-tab {
        padding: 0.75rem 0.7rem;
        gap: 0.45rem;
    }

    .rf-aq-channel-label {
        font-size: 0.84rem;
    }

    .rf-aq-item {
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 767.98px) {
    .rf-aq {
        margin-top: 0.5rem !important;
    }

    .rf-aq-title {
        margin-bottom: 0.85rem !important;
        font-size: 1.35rem;
    }

    /* Keep all 3 channel tabs visible — no horizontal scroll */
    .rf-aq-channel-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        overflow: visible;
        margin-bottom: 0.85rem;
        padding-bottom: 0;
        scroll-snap-type: none;
    }

    .rf-aq-channel-tab {
        flex: unset;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.35rem;
        min-width: 0;
        width: 100%;
        min-height: 0;
        padding: 0.7rem 0.35rem 0.65rem;
        scroll-snap-align: unset;
    }

    .rf-aq-channel-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 0.9rem;
    }

    .rf-aq-channel-label {
        font-size: 0.72rem;
        line-height: 1.2;
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        text-overflow: unset;
        width: 100%;
        text-align: center;
    }

    .rf-aq-channel-label-full,
    .rf-chip-label-full {
        display: none;
    }

    .rf-aq-channel-label-short,
    .rf-chip-label-short {
        display: inline;
    }

    .rf-aq-channel-count {
        font-size: 0.78rem;
        min-width: 1.4rem;
        padding: 0.1rem 0.4rem;
    }

    .rf-aq-toolbar {
        padding: 0.75rem;
    }

    /* Show all status chips — wrap instead of scroll */
    .rf-aq-toolbar-scroll {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .rf-aq-toolbar-scroll .rf-chip {
        flex: 0 1 auto;
        white-space: nowrap;
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .rf-aq-item {
        gap: 0.7rem;
        padding: 0.85rem 0.85rem;
    }

    .rf-aq-item-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .rf-aq-item-badges {
        justify-content: flex-start;
    }

    .rf-aq-item-foot {
        gap: 0.4rem;
    }

    .rf-aq-hero-meta {
        text-align: left;
    }

    .rf-aq-empty {
        padding: 2.25rem 1rem;
    }

    .rf-aq-pager {
        padding: 0.65rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .rf-aq-channel-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .rf-aq-channel-tab {
        padding: 0.6rem 0.25rem 0.55rem;
        gap: 0.3rem;
        border-radius: 10px;
        min-width: 0;
    }

    .rf-aq-channel-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .rf-aq-channel-label {
        font-size: 0.68rem;
    }

    .rf-aq-channel-count {
        font-size: 0.72rem;
        min-width: 1.25rem;
        padding: 0.08rem 0.35rem;
    }

    .rf-aq-toolbar-scroll {
        gap: 0.35rem;
    }

    .rf-aq-toolbar-scroll .rf-chip {
        font-size: 0.72rem;
        padding: 0.35rem 0.65rem;
    }

    .rf-aq-contact {
        font-size: 0.92rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .rf-aq-summary,
    .rf-aq-customer {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .rf-aq-review span,
    .rf-aq-review {
        font-size: 0.78rem;
    }
}

@media (max-width: 399.98px) {
    .rf-aq-channel-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .rf-aq-channel-tab {
        min-width: 0;
        padding: 0.55rem 0.2rem 0.5rem;
    }

    .rf-aq-channel-label {
        font-size: 0.64rem;
    }

    .rf-aq-item-rail {
        display: none;
    }
}

@media (hover: none) {
    .rf-aq-channel-tab:hover {
        transform: none;
    }

    .rf-aq-item:active {
        background: #f0f3f7;
    }
}

/* Keep ReplyFlow sidebar above full-bleed Gmail chrome */
body:has(.rf-gm-web) .rf-sidebar.sidebar,
body:has(.rf-gm-web) #sidebar {
    z-index: 2000 !important;
}
body:has(.rf-gm-web) .rf-sidebar.sidebar .sidebar-content {
    z-index: 2001 !important;
}
body:has(.rf-gm-web) .rf-gm-burger {
    position: relative;
    z-index: 5;
    pointer-events: auto;
}
html.sidebar-open body:has(.rf-gm-web)::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.42);
    z-index: 1999;
}
.rf-rp-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rf-rp-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rf-text);
}

.rf-rp-sub {
    margin: 0.3rem 0 0;
    color: var(--rf-muted);
    font-size: 0.92rem;
    max-width: 36rem;
}

.rf-rp-range-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    box-shadow: var(--rf-shadow);
    color: var(--rf-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.rf-rp-filters {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
}

.rf-rp-filter-fields {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.rf-rp-field {
    min-width: 10.5rem;
    flex: 1;
}

.rf-rp-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
    margin-bottom: 0.35rem;
}

.rf-rp-field .form-control {
    border-radius: 10px;
    border-color: var(--rf-border);
    min-height: 2.5rem;
}

.rf-rp-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rf-rp-btn {
    border-radius: 10px !important;
    font-weight: 600;
    min-height: 2.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    white-space: nowrap;
}

.rf-rp-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.rf-rp-tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--rf-border);
    background: var(--rf-surface);
    box-shadow: var(--rf-shadow);
    text-decoration: none;
    color: var(--rf-text);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.rf-rp-tab:hover {
    color: var(--rf-text);
    border-color: #c9ced6;
    transform: translateY(-1px);
}

.rf-rp-tab-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: var(--rf-bg);
    color: var(--rf-muted);
    flex-shrink: 0;
}

.rf-rp-tab-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.rf-rp-tab.active {
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(60, 64, 67, .12);
}

.rf-rp-tab.is-comm.active {
    background: linear-gradient(135deg, rgba(7, 94, 84, .1), rgba(66, 133, 244, .08));
    border-color: rgba(7, 94, 84, .25);
}
.rf-rp-tab.is-comm.active .rf-rp-tab-icon,
.rf-rp-tab.is-comm .rf-rp-tab-icon {
    background: rgba(7, 94, 84, .14);
    color: var(--rf-teal);
}

.rf-rp-tab.is-staff.active {
    background: linear-gradient(135deg, rgba(66, 133, 244, .12), rgba(11, 87, 208, .05));
    border-color: rgba(66, 133, 244, .28);
}
.rf-rp-tab.is-staff .rf-rp-tab-icon {
    background: rgba(66, 133, 244, .12);
    color: var(--rf-blue);
}

.rf-rp-tab.is-ai.active {
    background: linear-gradient(135deg, rgba(147, 52, 230, .1), rgba(66, 133, 244, .06));
    border-color: rgba(147, 52, 230, .25);
}
.rf-rp-tab.is-ai .rf-rp-tab-icon {
    background: rgba(147, 52, 230, .12);
    color: #7b2cbf;
}

.rf-rp-tab.is-customer.active {
    background: linear-gradient(135deg, rgba(232, 152, 26, .12), rgba(66, 133, 244, .05));
    border-color: rgba(176, 96, 0, .22);
}
.rf-rp-tab.is-customer .rf-rp-tab-icon {
    background: rgba(232, 152, 26, .14);
    color: #b06000;
}

.rf-rp-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rf-rp-metrics-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rf-rp-metrics-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.rf-rp-metric {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1.05rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--rf-border);
    background: var(--rf-surface);
    box-shadow: var(--rf-shadow);
    min-width: 0;
}

.rf-rp-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.rf-rp-metric.is-whatsapp .rf-rp-metric-icon { background: rgba(37, 211, 102, .16); color: #075e54; }
.rf-rp-metric.is-gmail .rf-rp-metric-icon { background: rgba(66, 133, 244, .14); color: #4285f4; }
.rf-rp-metric.is-time .rf-rp-metric-icon { background: rgba(232, 152, 26, .14); color: #b06000; }
.rf-rp-metric.is-staff .rf-rp-metric-icon { background: rgba(66, 133, 244, .12); color: #3367d6; }
.rf-rp-metric.is-ai .rf-rp-metric-icon { background: rgba(147, 52, 230, .12); color: #7b2cbf; }
.rf-rp-metric.is-edit .rf-rp-metric-icon { background: rgba(7, 94, 84, .12); color: var(--rf-teal); }
.rf-rp-metric.is-tokens .rf-rp-metric-icon { background: rgba(232, 152, 26, .14); color: #b06000; }
.rf-rp-metric.is-cost .rf-rp-metric-icon { background: rgba(37, 211, 102, .14); color: #0d7a3a; }

.rf-rp-metric-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
}

.rf-rp-metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--rf-text);
    line-height: 1.15;
    margin-top: 0.15rem;
    word-break: break-word;
}

.rf-rp-metric-value-sm { font-size: 1.35rem; }

.rf-rp-metric-hint {
    font-size: 0.78rem;
    color: #80868b;
    margin-top: 0.15rem;
}

.rf-rp-panel {
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
    overflow: hidden;
}

.rf-rp-panel-head {
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--rf-border);
    background: linear-gradient(180deg, #fafbfc 0%, var(--rf-surface) 100%);
}

.rf-rp-panel-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rf-text);
}

.rf-rp-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.1rem 1.15rem;
}

.rf-rp-status {
    padding: 0.9rem;
    border-radius: 12px;
    background: var(--rf-bg);
    border: 1px solid transparent;
    min-width: 0;
}

.rf-rp-status.is-open { border-color: rgba(66, 133, 244, .18); }
.rf-rp-status.is-pending { border-color: rgba(232, 152, 26, .22); }
.rf-rp-status.is-resolved { border-color: rgba(37, 211, 102, .22); }
.rf-rp-status.is-archived { border-color: rgba(95, 99, 104, .18); }

.rf-rp-status-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.rf-rp-status-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-size: 0.75rem;
    background: #fff;
    color: var(--rf-muted);
}

.rf-rp-status.is-open .rf-rp-status-icon { color: #4285f4; }
.rf-rp-status.is-pending .rf-rp-status-icon { color: #b06000; }
.rf-rp-status.is-resolved .rf-rp-status-icon { color: #0d7a3a; }
.rf-rp-status.is-archived .rf-rp-status-icon { color: #5f6368; }

.rf-rp-status-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--rf-muted);
}

.rf-rp-status-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--rf-text);
    letter-spacing: -0.02em;
    margin-bottom: 0.55rem;
}

.rf-rp-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(60, 64, 67, .08);
    overflow: hidden;
}

.rf-rp-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--rf-blue);
}

.rf-rp-status.is-open .rf-rp-bar > span { background: #4285f4; }
.rf-rp-status.is-pending .rf-rp-bar > span { background: #e8981a; }
.rf-rp-status.is-resolved .rf-rp-bar > span { background: #25d366; }
.rf-rp-status.is-archived .rf-rp-bar > span { background: #80868b; }

.rf-rp-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.rf-rp-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rf-rp-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.rf-rp-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--rf-border);
    white-space: nowrap;
    background: #fafbfc;
}

.rf-rp-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--rf-border);
    vertical-align: middle;
    color: var(--rf-text);
    font-size: 0.92rem;
}

.rf-rp-table tr:last-child td { border-bottom: 0; }

.rf-rp-table tbody tr:hover td {
    background: #f7f9fc;
}

.rf-rp-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(145deg, var(--rf-teal), var(--rf-blue));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 0.55rem;
    flex-shrink: 0;
}

.rf-rp-table td:first-child,
.rf-rp-contact {
    display: flex;
    align-items: center;
    min-width: 0;
}

.rf-rp-name { font-weight: 600; }
.rf-rp-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--rf-muted);
    margin-top: 0.1rem;
}

.rf-rp-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.84rem;
}

.rf-rp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.rf-rp-pill.is-ok { background: rgba(37, 211, 102, .16); color: #0d7a3a; }
.rf-rp-pill.is-bad { background: rgba(234, 67, 53, .12); color: #c5221f; }
.rf-rp-pill.is-info { background: rgba(66, 133, 244, .12); color: #3367d6; }
.rf-rp-pill.is-warn { background: rgba(232, 152, 26, .16); color: #8a5a00; }

.rf-rp-empty {
    text-align: center;
    color: var(--rf-muted);
    padding: 1.5rem !important;
}

@media (max-width: 1199.98px) {
    .rf-rp-metrics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .rf-rp-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rf-rp-metrics { grid-template-columns: 1fr; }
    .rf-rp-metrics-2,
    .rf-rp-metrics-4 { grid-template-columns: 1fr; }
    .rf-rp-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rf-rp-split { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .rf-rp-filters {
        padding: 0.9rem;
    }

    .rf-rp-field {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .rf-rp-filter-actions {
        width: 100%;
    }

    .rf-rp-filter-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .rf-rp-tabs {
        grid-template-columns: 1fr;
    }

    .rf-rp-status-grid {
        grid-template-columns: 1fr;
    }

    .rf-rp-range-pill {
        width: 100%;
        justify-content: center;
    }

    /* Stack tables into labeled cards on phones */
    .rf-rp-table thead { display: none; }

    .rf-rp-table,
    .rf-rp-table tbody,
    .rf-rp-table tr,
    .rf-rp-table td {
        display: block;
        width: 100%;
    }

    .rf-rp-table tr {
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--rf-border);
    }

    .rf-rp-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border-bottom: 0;
        text-align: right;
    }

    .rf-rp-table td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--rf-muted);
        text-align: left;
    }

    .rf-rp-table td:first-child {
        display: flex;
        justify-content: flex-start;
        text-align: left;
        margin-bottom: 0.35rem;
    }

    .rf-rp-table td:first-child::before { display: none; }

    .rf-rp-table tbody tr:hover td { background: transparent; }
}

/* ========== Notification bell (header) ========== */
.rf-notif {
    position: relative;
    list-style: none;
}

.rf-notif-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--rf-muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background .15s ease, color .15s ease;
}

.rf-notif-btn:hover,
.rf-notif.is-open .rf-notif-btn {
    background: rgba(var(--rf-teal-rgb), .1);
    color: var(--rf-teal);
}

.rf-notif-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ea4335;
    box-shadow: 0 0 0 2px #fff;
}

.rf-notif-count {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ea4335;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.rf-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(60, 64, 67, .18);
    z-index: 1080;
    overflow: hidden;
    display: none;
    flex-direction: column;
    max-height: min(70vh, 480px);
}

.rf-notif.is-open .rf-notif-panel,
.rf-notif-panel.is-open {
    display: flex;
}

.rf-notif-panel[hidden] {
    display: none !important;
}

.rf-notif-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--rf-border);
    background: #fafbfc;
}

.rf-notif-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rf-text);
}

.rf-notif-panel-sub {
    font-size: 0.75rem;
    color: var(--rf-muted);
    margin-top: 2px;
}

.rf-notif-mark {
    border: 0;
    background: transparent;
    color: var(--rf-blue);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
    white-space: nowrap;
}

.rf-notif-mark:hover {
    text-decoration: underline;
}

.rf-notif-panel-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.rf-notif-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f3f4;
    transition: background .12s ease;
}

.rf-notif-row:hover {
    background: #f6f8fc;
}

.rf-notif-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(66, 133, 244, .12);
    color: var(--rf-blue);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.rf-notif-row-icon.is-danger {
    background: rgba(234, 67, 53, .12);
    color: #ea4335;
}

.rf-notif-row-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rf-notif-row-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rf-text);
    line-height: 1.3;
}

.rf-notif-row-msg {
    font-size: 0.78rem;
    color: var(--rf-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rf-notif-row-time {
    font-size: 0.7rem;
    color: #9aa0a6;
    margin-top: 2px;
}

.rf-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 20px;
    color: var(--rf-muted);
    font-size: 0.875rem;
    text-align: center;
}

.rf-notif-empty i {
    font-size: 1.75rem;
    opacity: .55;
}

.rf-notif-panel-foot {
    border-top: 1px solid var(--rf-border);
    padding: 10px 16px;
    text-align: center;
    background: #fff;
}

.rf-notif-panel-foot a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rf-blue);
    text-decoration: none;
}

.rf-notif-panel-foot a:hover {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .rf-notif-panel {
        position: fixed;
        top: 58px;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: calc(100dvh - 72px);
        border-radius: 14px;
    }
}

/* ========== Notifications page ========== */
.rf-nt-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rf-nt-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--rf-text);
}

.rf-nt-sub {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--rf-muted);
}

.rf-nt-btn {
    border-radius: 999px !important;
    font-weight: 600;
    white-space: nowrap;
}

.rf-nt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: var(--rf-shadow);
}

.rf-nt-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
}

.rf-nt-item:hover {
    background: #f6f8fc;
}

.rf-nt-item.is-unread {
    background: #f0f6ff;
}

.rf-nt-item.is-unread:hover {
    background: #e8f0fe;
}

.rf-nt-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(66, 133, 244, .12);
    color: var(--rf-blue);
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.rf-nt-item.is-danger .rf-nt-icon {
    background: rgba(234, 67, 53, .12);
    color: #ea4335;
}

.rf-nt-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rf-nt-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rf-nt-item-title {
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--rf-text);
    line-height: 1.3;
}

.rf-nt-pill {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rf-blue);
    color: #fff;
}

.rf-nt-pill.is-muted {
    background: #e8eaed;
    color: #5f6368;
}

.rf-nt-item-msg {
    font-size: 0.875rem;
    color: var(--rf-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rf-nt-item-time {
    font-size: 0.75rem;
    color: #9aa0a6;
}

.rf-nt-chevron {
    color: #c4c7c5;
    font-size: 0.75rem;
    padding-top: 14px;
}

.rf-nt-empty {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--rf-muted);
}

.rf-nt-empty-art {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f1f3f4;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    color: #9aa0a6;
}

.rf-nt-empty h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--rf-text);
}

.rf-nt-empty p {
    margin: 0;
    font-size: 0.875rem;
    max-width: 28rem;
    margin-inline: auto;
}

.rf-nt-pager {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .rf-nt-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .rf-nt-title {
        font-size: 1.35rem;
    }

    .rf-nt-mark-all .rf-nt-btn {
        width: 100%;
    }

    .rf-nt-list {
        border-radius: 12px;
        padding: 6px;
        border-left: 0;
        border-right: 0;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        width: calc(100% + 1.5rem);
    }

    .rf-nt-item {
        grid-template-columns: 40px 1fr;
        padding: 12px 10px;
        gap: 10px;
    }

    .rf-nt-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .rf-nt-chevron {
        display: none;
    }

    .rf-nt-item-title {
        font-size: 0.9rem;
    }

    .rf-nt-item-msg {
        font-size: 0.8125rem;
        -webkit-line-clamp: 4;
    }
}

/* ========== Site configuration ========== */
.rf-sc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rf-sc-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--rf-text);
}

.rf-sc-sub {
    margin: 0.3rem 0 0;
    font-size: 0.875rem;
    color: var(--rf-muted);
    max-width: 42rem;
    line-height: 1.45;
}

.rf-sc-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--rf-text);
    font-size: 0.78rem;
    font-weight: 600;
}

.rf-sc-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.rf-sc-nav {
    position: sticky;
    top: 0.75rem;
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
    overflow: hidden;
}

.rf-sc-nav-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem;
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.rf-sc-nav-group + .rf-sc-nav-group {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--rf-border);
}

.rf-sc-nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rf-muted);
    padding: 0.25rem 0.65rem 0.45rem;
}

.rf-sc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--rf-text);
    font-size: 0.875rem;
    font-weight: 550;
    transition: background .12s ease, color .12s ease;
}

.rf-sc-nav-link:hover {
    background: #f4f6f8;
    color: var(--rf-text);
}

.rf-sc-nav-link.active {
    background: rgba(var(--rf-teal-rgb), .1);
    color: var(--rf-teal-deep);
}

.rf-sc-nav-link.is-wa.active {
    background: rgba(37, 211, 102, .12);
    color: #075e54;
}

.rf-sc-nav-link.is-gm.active {
    background: rgba(66, 133, 244, .12);
    color: #1967d2;
}

.rf-sc-nav-link.is-ai.active {
    background: rgba(251, 188, 4, .14);
    color: #a66b00;
}

.rf-sc-nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--rf-bg);
    color: var(--rf-muted);
    flex-shrink: 0;
    font-size: 0.85rem;
}

.rf-sc-nav-link.active .rf-sc-nav-icon {
    background: rgba(255, 255, 255, .7);
    color: inherit;
}

.rf-sc-nav-link.is-wa .rf-sc-nav-icon { color: #25d366; }
.rf-sc-nav-link.is-gm .rf-sc-nav-icon { color: #4285f4; }
.rf-sc-nav-link.is-ai .rf-sc-nav-icon { color: #f9a825; }

.rf-sc-nav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rf-sc-main {
    min-width: 0;
}

.rf-sc-main > .card,
.rf-sc-main .card {
    border-radius: 14px !important;
}

.rf-sc-main .card + .card {
    margin-top: 1rem;
}

.rf-sc-main .form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--rf-text);
}

.rf-sc-main .form-control,
.rf-sc-main .form-select {
    border-radius: 10px;
    border-color: var(--rf-border);
    min-height: 42px;
}

.rf-sc-main .form-control:focus,
.rf-sc-main .form-select:focus {
    border-color: rgba(var(--rf-teal-rgb), .45);
    box-shadow: 0 0 0 3px rgba(var(--rf-teal-rgb), .12);
}

.rf-sc-main .btn {
    border-radius: 10px;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .rf-sc-shell {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .rf-sc-nav {
        position: static;
        border-radius: 12px;
    }

    .rf-sc-nav-scroll {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: minmax(0, auto);
        gap: 0.45rem;
        max-height: none;
        overflow: visible;
        padding: 0.65rem;
    }

    .rf-sc-nav-group {
        display: contents;
    }

    .rf-sc-nav-group + .rf-sc-nav-group {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .rf-sc-nav-label {
        display: none;
    }

    .rf-sc-nav-link {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.35rem;
        min-width: 0;
        max-width: none;
        width: 100%;
        padding: 0.55rem 0.35rem;
        border: 1px solid var(--rf-border);
        background: #fff;
    }

    .rf-sc-nav-link.active {
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(60, 64, 67, .1);
    }

    .rf-sc-nav-text {
        white-space: normal;
        font-size: 0.68rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .rf-sc-title {
        font-size: 1.3rem;
    }

    .rf-sc-sub {
        font-size: 0.8125rem;
    }

    .rf-sc-nav-scroll {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .rf-sc-nav-link {
        min-width: 0;
        padding: 0.45rem 0.2rem;
        gap: 0.28rem;
    }

    .rf-sc-nav-text {
        font-size: 0.62rem;
    }

    .rf-sc-nav-icon {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .rf-sc-main .card .card-header,
    .rf-sc-main .card .card-body {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .rf-sc-main .btn {
        width: 100%;
    }

    .rf-sc-main .d-inline form,
    .rf-sc-main form.d-inline {
        display: block !important;
        width: 100%;
    }
}

/* ========== AI settings ========== */
.rf-ai {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rf-ai-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 188, 4, .28);
    background:
        linear-gradient(135deg, rgba(251, 188, 4, .12), rgba(66, 133, 244, .08) 55%, rgba(37, 211, 102, .08));
}

.rf-ai-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #f9a825;
    font-size: 1.25rem;
    box-shadow: 0 1px 3px rgba(60, 64, 67, .12);
    flex-shrink: 0;
}

.rf-ai-hero-copy {
    flex: 1 1 12rem;
    min-width: 0;
}

.rf-ai-hero-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rf-text);
}

.rf-ai-hero-text {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--rf-muted);
    line-height: 1.45;
}

.rf-ai-hero-status {
    margin-left: auto;
}

.rf-ai-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
    background: #fff;
    border: 1px solid var(--rf-border);
}

.rf-ai-status.is-ok {
    color: #137333;
    border-color: rgba(52, 168, 83, .35);
    background: rgba(52, 168, 83, .1);
}

.rf-ai-status.is-warn {
    color: #b06000;
    border-color: rgba(251, 188, 4, .45);
    background: rgba(251, 188, 4, .14);
}

.rf-ai-card {
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
    overflow: hidden;
}

.rf-ai-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--rf-border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.rf-ai-card-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rf-text);
}

.rf-ai-card-head p {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--rf-muted);
    line-height: 1.4;
    max-width: 36rem;
}

.rf-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #f1f3f4;
    color: var(--rf-muted);
}

.rf-ai-card-body {
    padding: 1.1rem 1.15rem 1.2rem;
}

.rf-ai-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.rf-ai-field {
    min-width: 0;
}

.rf-ai-span-2 { grid-column: span 2; }
.rf-ai-span-full { grid-column: 1 / -1; }

.rf-ai-secret {
    position: relative;
    display: flex;
    align-items: center;
}

.rf-ai-secret .form-control {
    padding-right: 2.75rem;
}

.rf-ai-secret-toggle {
    position: absolute;
    right: 0.35rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rf-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.rf-ai-secret-toggle:hover {
    background: #f1f3f4;
    color: var(--rf-text);
}

.rf-ai-prompt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.55;
    min-height: 240px;
    resize: vertical;
}

.rf-ai-toggles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.rf-ai-toggle {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--rf-border);
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    margin: 0;
    transition: border-color .15s ease, background .15s ease;
}

.rf-ai-toggle:hover {
    border-color: #c9ced6;
    background: #fff;
}

.rf-ai-toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--rf-blue);
    border: 1px solid var(--rf-border);
}

.rf-ai-toggle-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.rf-ai-toggle-title {
    font-size: 0.875rem;
    font-weight: 650;
    color: var(--rf-text);
}

.rf-ai-toggle-help {
    font-size: 0.72rem;
    color: var(--rf-muted);
    line-height: 1.35;
}

.rf-ai-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.rf-ai-switch-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rf-text);
}

.rf-ai-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rf-ai-switch-ui {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #dadce0;
    position: relative;
    flex-shrink: 0;
    transition: background .15s ease;
}

.rf-ai-switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .3);
    transition: transform .15s ease;
}

.rf-ai-switch-input:checked + .rf-ai-switch-ui,
.rf-ai-toggle .rf-ai-switch-input:checked + .rf-ai-switch-ui {
    background: var(--rf-teal);
}

.rf-ai-switch-input:checked + .rf-ai-switch-ui::after,
.rf-ai-toggle .rf-ai-switch-input:checked + .rf-ai-switch-ui::after {
    transform: translateX(18px);
}

.rf-ai-switch-input:focus-visible + .rf-ai-switch-ui {
    outline: 2px solid rgba(var(--rf-teal-rgb), .45);
    outline-offset: 2px;
}

.rf-ai-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    position: sticky;
    bottom: 0.75rem;
    z-index: 5;
    padding: 0.75rem 0 0.15rem;
}

.rf-ai-save {
    min-width: 11rem;
    border-radius: 999px !important;
    padding: 0.7rem 1.35rem !important;
    box-shadow: 0 6px 18px rgba(7, 94, 84, .22);
}

@media (max-width: 991.98px) {
    .rf-ai-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rf-ai-span-2 { grid-column: span 2; }

    .rf-ai-toggles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .rf-ai-hero {
        padding: 1rem;
    }

    .rf-ai-hero-status {
        margin-left: 0;
        width: 100%;
    }

    .rf-ai-status {
        width: 100%;
        justify-content: center;
    }

    .rf-ai-card-head,
    .rf-ai-card-body {
        padding-left: 0.95rem;
        padding-right: 0.95rem;
    }

    .rf-ai-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .rf-ai-span-2,
    .rf-ai-span-full {
        grid-column: 1 / -1;
    }

    .rf-ai-prompt {
        min-height: 200px;
        font-size: 16px; /* avoid iOS zoom */
    }

    .rf-ai-actions {
        position: sticky;
        bottom: 0;
        margin: 0 -0.25rem;
        padding: 0.75rem 0.25rem calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, transparent, var(--rf-bg) 28%);
    }

    .rf-ai-save {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .rf-ai-hero-title {
        font-size: 1.05rem;
    }

    .rf-ai-toggle {
        grid-template-columns: 36px 1fr auto;
        gap: 0.6rem;
        padding: 0.75rem;
    }

    .rf-ai-toggle-icon {
        width: 36px;
        height: 36px;
    }

    .rf-ai-card-head .rf-ai-switch {
        width: 100%;
        justify-content: space-between;
        padding-top: 0.25rem;
    }
}

/* ========== Settings tab content ========== */
.rf-set-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rf-sc-main .rf-card {
    overflow: hidden;
}

.rf-sc-main .card-body {
    padding: 1.15rem !important;
}

.rf-set-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--rf-muted);
    line-height: 1.45;
}

.rf-set-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.rf-set-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.rf-set-pill.is-ok {
    color: #137333;
    background: rgba(52, 168, 83, .12);
    border-color: rgba(52, 168, 83, .28);
}

.rf-set-pill.is-warn {
    color: #b06000;
    background: rgba(251, 188, 4, .16);
    border-color: rgba(251, 188, 4, .4);
}

.rf-set-alert {
    font-size: 0.85rem;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.85rem;
}

.rf-set-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.rf-set-field {
    min-width: 0;
}

.rf-set-span-full {
    grid-column: 1 / -1;
}

.rf-set-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rf-border);
}

.rf-set-btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
}

.rf-set-basic {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.7fr);
    gap: 1.25rem;
    align-items: start;
}

.rf-set-logo-card {
    border: 1px dashed #c9ced6;
    border-radius: 12px;
    padding: 1rem;
    background: #fafbfc;
    text-align: center;
}

.rf-set-logo-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
    margin-bottom: 0.75rem;
}

.rf-set-status-panel {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #fafbfc;
    border: 1px solid var(--rf-border);
}

.rf-set-kv {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rf-set-kv-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.rf-set-kv-key {
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--rf-muted);
}

.rf-set-kv-val {
    font-size: 0.85rem;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.rf-set-break {
    word-break: break-all;
}

.rf-set-table-wrap {
    border: 1px solid var(--rf-border);
    border-radius: 12px;
    overflow: hidden;
}

.rf-set-table {
    margin: 0;
}

.rf-set-table thead th {
    background: #fafbfc;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rf-muted);
    border-bottom-color: var(--rf-border);
    white-space: nowrap;
}

.rf-set-table tbody td {
    vertical-align: middle;
}

.rf-set-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.rf-set-actions-cell .btn,
.rf-set-actions-cell form {
    margin: 0.15rem 0 0.15rem 0.25rem;
}

.rf-set-empty {
    text-align: center;
    color: var(--rf-muted);
    padding: 2rem 1rem !important;
}

.rf-set-empty-state {
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
}

.rf-set-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(var(--rf-teal-rgb), .1);
    color: var(--rf-teal);
    font-size: 1.4rem;
}

.rf-set-empty-state h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.rf-set-empty-state p {
    margin: 0 auto 1.25rem;
    max-width: 28rem;
    color: var(--rf-muted);
    font-size: 0.9rem;
}

.rf-set-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rf-set-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--rf-border);
    border-radius: 12px;
    background: #fafbfc;
}

.rf-set-toggle-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--rf-text);
}

@media (max-width: 991.98px) {
    .rf-set-basic {
        grid-template-columns: 1fr;
    }

    .rf-set-kv-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

@media (max-width: 767.98px) {
    .rf-sc-main .card-body {
        padding: 0.95rem !important;
    }

    .rf-card-header {
        padding: 0.85rem 0.95rem !important;
    }

    .rf-set-grid {
        grid-template-columns: 1fr;
    }

    .rf-set-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .rf-set-form-actions .btn,
    .rf-set-form-actions .rf-set-btn,
    .rf-set-empty-state .btn {
        width: 100%;
    }

    .rf-set-table thead {
        display: none;
    }

    .rf-set-table,
    .rf-set-table tbody,
    .rf-set-table tr,
    .rf-set-table td {
        display: block;
        width: 100%;
    }

    .rf-set-table tr {
        padding: 0.85rem 0.9rem;
        border-bottom: 1px solid var(--rf-border);
    }

    .rf-set-table tr:last-child {
        border-bottom: 0;
    }

    .rf-set-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: 0;
        text-align: right;
    }

    .rf-set-table td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--rf-muted);
        text-align: left;
        flex: 0 0 42%;
    }

    .rf-set-table td.rf-set-empty {
        display: block;
        text-align: center;
    }

    .rf-set-table td.rf-set-empty::before {
        display: none;
    }

    .rf-set-actions-cell {
        flex-wrap: wrap;
        justify-content: flex-end;
        white-space: normal;
    }

    .rf-set-actions-cell .btn,
    .rf-set-actions-cell form {
        margin: 0.2rem 0 0.2rem 0.35rem;
    }

    .rf-sc-main .form-control,
    .rf-sc-main .form-select,
    .rf-set-field .form-control {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .rf-set-toggle-row {
        padding: 0.85rem;
    }

    .rf-card-header {
        flex-wrap: nowrap;
        align-items: center;
    }

    .rf-card-header .card-title {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rf-card-header .card-actions {
        width: auto;
        flex-shrink: 0;
        flex-wrap: nowrap;
        margin-left: auto;
    }

    .rf-card-header .card-actions .rf-card-refresh {
        flex-shrink: 0;
    }

    .rf-card-header .card-actions .btn,
    .rf-card-header .card-actions .form-control,
    .rf-card-header .card-actions select {
        width: auto;
        max-width: 100%;
    }
}

/* Settings: social login / accordion blocks */
.rf-sc-main .accordion {
    border-radius: 12px !important;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.rf-sc-main .accordion + .accordion {
    margin-top: 0.85rem;
}

.rf-sc-main .bg-light.rounded-4 {
    border: 1px solid var(--rf-border);
    background: #fafbfc !important;
}

.rf-sc-main .bg-light.p-2.rounded-4,
.rf-sc-main .bg-light.p-3.rounded-4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rf-sc-main .bg-light .float-end {
    float: none !important;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .rf-sc-main .bg-light.p-2.rounded-4,
    .rf-sc-main .bg-light.p-3.rounded-4 {
        padding: 0.85rem !important;
    }

    .rf-sc-main .accordion-body {
        padding: 0.9rem !important;
    }
}

/* ========== Profile settings shell ========== */
.rf-pf-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rf-pf-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--rf-text);
}

.rf-pf-sub {
    margin: 0.3rem 0 0;
    font-size: 0.875rem;
    color: var(--rf-muted);
    max-width: 36rem;
    line-height: 1.45;
}

.rf-pf-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.75rem 0.45rem 0.45rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--rf-border);
    box-shadow: var(--rf-shadow);
}

.rf-pf-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--rf-blue), var(--rf-green));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    object-fit: cover;
}

.rf-pf-avatar-img {
    background: #fff;
    border: 1px solid var(--rf-border);
}

.rf-pf-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rf-pf-user-name {
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--rf-text);
    line-height: 1.2;
}

.rf-pf-user-email {
    font-size: 0.72rem;
    color: var(--rf-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rf-pf-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.rf-pf-nav {
    position: sticky;
    top: 0.75rem;
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
    overflow: hidden;
}

.rf-pf-nav-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.65rem;
}

.rf-pf-nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rf-muted);
    padding: 0.25rem 0.65rem 0.45rem;
}

.rf-pf-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--rf-text);
    font-size: 0.875rem;
    font-weight: 550;
}

.rf-pf-nav-link:hover {
    background: #f4f6f8;
    color: var(--rf-text);
}

.rf-pf-nav-link.active {
    background: rgba(var(--rf-teal-rgb), .1);
    color: var(--rf-teal-deep);
}

.rf-pf-nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--rf-bg);
    color: var(--rf-muted);
    flex-shrink: 0;
    font-size: 0.85rem;
}

.rf-pf-nav-link.active .rf-pf-nav-icon {
    background: rgba(255, 255, 255, .7);
    color: inherit;
}

.rf-pf-main { min-width: 0; }

.rf-pf-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--rf-text);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ========== Change password ========== */
.rf-pw {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rf-pw-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(7, 94, 84, .18);
    background: linear-gradient(135deg, rgba(7, 94, 84, .08), rgba(66, 133, 244, .08));
}

.rf-pw-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--rf-teal);
    font-size: 1.2rem;
    box-shadow: 0 1px 3px rgba(60, 64, 67, .12);
    flex-shrink: 0;
}

.rf-pw-hero-copy { flex: 1 1 12rem; min-width: 0; }

.rf-pw-hero-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rf-text);
}

.rf-pw-hero-text {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--rf-muted);
    line-height: 1.45;
}

.rf-pw-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.75fr);
    gap: 1rem;
    align-items: start;
}

.rf-pw-card,
.rf-pw-tips {
    background: var(--rf-surface);
    border: 1px solid var(--rf-border);
    border-radius: 14px;
    box-shadow: var(--rf-shadow);
}

.rf-pw-card-head {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--rf-border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.rf-pw-card-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rf-text);
}

.rf-pw-card-head p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--rf-muted);
}

.rf-pw-form {
    padding: 1.15rem;
}

.rf-pw-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rf-pw-field .form-label {
    font-weight: 600;
    font-size: 0.82rem;
}

.rf-pw-input {
    position: relative;
    display: flex;
    align-items: center;
}

.rf-pw-input .form-control {
    padding-right: 2.85rem;
    border-radius: 10px;
    min-height: 46px;
    border-color: var(--rf-border);
}

.rf-pw-input .form-control:focus {
    border-color: rgba(var(--rf-teal-rgb), .45);
    box-shadow: 0 0 0 3px rgba(var(--rf-teal-rgb), .12);
}

.rf-pw-toggle {
    position: absolute;
    right: 0.35rem;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rf-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.rf-pw-toggle:hover {
    background: #f1f3f4;
    color: var(--rf-text);
}

.rf-pw-meter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.rf-pw-meter span {
    height: 5px;
    border-radius: 999px;
    background: #e8eaed;
}

.rf-pw-meter span.is-on.is-l1 { background: #ea4335; }
.rf-pw-meter span.is-on.is-l2 { background: #f9ab00; }
.rf-pw-meter span.is-on.is-l3 { background: #fbbc04; }
.rf-pw-meter span.is-on.is-l4 { background: #34a853; }

.rf-pw-meter-label {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--rf-muted);
    font-weight: 600;
}

.rf-pw-match {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.rf-pw-match.is-ok { color: #137333; }
.rf-pw-match.is-bad { color: #c5221f; }

.rf-pw-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rf-border);
    display: flex;
    justify-content: flex-end;
}

.rf-pw-submit {
    border-radius: 999px !important;
    font-weight: 650 !important;
    padding: 0.7rem 1.35rem !important;
    min-width: 11rem;
    box-shadow: 0 6px 18px rgba(7, 94, 84, .2);
}

.rf-pw-tips {
    padding: 1.15rem;
}

.rf-pw-tips h3 {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rf-text);
}

.rf-pw-tips ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rf-pw-tips li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: var(--rf-text);
    line-height: 1.4;
}

.rf-pw-tips li i {
    color: var(--rf-teal);
    margin-top: 0.15rem;
}

.rf-pw-tips-note {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #f6f8fc;
    border: 1px solid var(--rf-border);
    font-size: 0.78rem;
    color: var(--rf-muted);
    display: flex;
    gap: 0.5rem;
    line-height: 1.4;
}

.rf-pw-tips-note i {
    color: var(--rf-blue);
    margin-top: 0.1rem;
}

@media (max-width: 991.98px) {
    .rf-pf-shell {
        grid-template-columns: 1fr;
    }

    .rf-pf-nav {
        position: static;
    }

    .rf-pf-nav-scroll {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 0.45rem;
    }

    .rf-pf-nav-link {
        flex: 0 0 auto;
        flex-direction: column;
        min-width: 5.5rem;
        text-align: center;
        gap: 0.35rem;
        padding: 0.55rem 0.5rem;
        border: 1px solid var(--rf-border);
        background: #fff;
    }

    .rf-pf-nav-link.active {
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(60, 64, 67, .1);
    }

    .rf-pf-nav-text {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .rf-pw-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .rf-pf-title { font-size: 1.3rem; }

    .rf-pf-user-chip {
        width: 100%;
    }

    .rf-pw-hero {
        padding: 1rem;
    }

    .rf-pw-form,
    .rf-pw-tips,
    .rf-pw-card-head {
        padding-left: 0.95rem;
        padding-right: 0.95rem;
    }

    .rf-pw-actions {
        position: sticky;
        bottom: 0;
        margin: 0 -0.25rem;
        padding: 0.85rem 0.25rem calc(0.85rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, transparent, var(--rf-bg) 30%);
        justify-content: stretch;
    }

    .rf-pw-submit {
        width: 100%;
        min-width: 0;
    }

    .rf-pw-input .form-control {
        font-size: 16px;
    }
}

@media (max-width: 575.98px) {
    .rf-pf-nav-link {
        min-width: 4.75rem;
    }

    .rf-pw-hero-title {
        font-size: 1.05rem;
    }
}
