@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-input: #1e293b;
    --border-color: #2e3e5c;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --danger-color: #f43f5e;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------------------------
   Bootstrap 5.3 dark-mode alignment.
   The layout sets <html data-bs-theme="dark">, which flips every stock
   Bootstrap component (tables, form-selects, dropdowns, modals, the
   *-subtle badge utilities) to its dark variant. This block re-points
   Bootstrap's dark palette at our custom tokens so those stock elements
   blend with the hand-styled -custom components instead of rendering in
   Bootstrap's default slate. Loaded after bootstrap.min.css, so it wins.
   ------------------------------------------------------------------ */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--bg-main);
    --bs-body-color: var(--text-primary);
    --bs-emphasis-color: var(--text-primary);
    --bs-secondary-color: var(--text-secondary);
    --bs-tertiary-color: var(--text-secondary);
    --bs-secondary-bg: var(--bg-input);
    --bs-tertiary-bg: var(--bg-input);
    --bs-border-color: var(--border-color);
    --bs-heading-color: var(--text-primary);
    --bs-card-bg: var(--bg-card);
    --bs-card-color: var(--text-primary);
    --bs-link-color-rgb: 99, 102, 241;
    --bs-link-hover-color-rgb: 79, 70, 229;
}

/* Stock tables (17 views use plain .table, not .table-custom): keep text
   readable and let the card/body surface show through. */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

/* Stock form-select / form-control that don't use the -custom classes. */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Navbar */
.navbar-custom {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.navbar-brand-custom {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link-custom {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--text-primary) !important;
    background-color: var(--bg-input);
}

/* Two-level portal header and persistent company context */
.portal-header {
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 24, 39, .98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.portal-topbar {
    display: flex;
    min-height: 80px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem clamp(1rem, 2.3vw, 2.25rem);
}

.portal-topbar .navbar-brand-custom {
    margin: 0;
    padding: 0;
}

.portal-brand-logo {
    display: block;
    width: 180px;
    height: auto;
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 7px;
    object-fit: contain;
    background: transparent;
}

.portal-login-logo {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 20px;
    padding: 10px 18px;
    background: transparent;
}

.portal-account-area {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.portal-icon-action {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b9c8e8;
    background: rgba(99, 102, 241, .1);
    border: 1px solid rgba(129, 140, 248, .25);
    border-radius: 10px;
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.portal-icon-action:hover,
.portal-icon-action:focus-visible {
    color: #fff;
    background: rgba(99, 102, 241, .24);
    border-color: rgba(129, 140, 248, .55);
    transform: translateY(-1px);
}

.portal-icon-action-active {
    color: #5ee9a5;
    background: rgba(16, 185, 129, .13);
    border-color: rgba(52, 211, 153, .42);
}

.portal-icon-action-warning {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .38);
}

.portal-icon-action:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.portal-icon-action[hidden] {
    display: none !important;
}

.portal-user-summary {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding-left: .7rem;
    border-left: 1px solid var(--border-color);
}

.portal-user-summary > i {
    color: #7184a4;
    font-size: 1.35rem;
}

.portal-user-summary span {
    display: grid;
    min-width: 0;
}

.portal-user-summary strong {
    max-width: 190px;
    overflow: hidden;
    color: #dde7f3;
    font-size: .74rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-summary small {
    color: var(--text-secondary);
    font-size: .62rem;
}

.portal-logout,
.portal-login {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: .4rem;
    padding: .48rem .68rem;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #9fb0c7;
    background: transparent;
    font: inherit;
    font-size: .72rem;
}

.portal-logout:hover,
.portal-login:hover {
    color: #fff;
    border-color: var(--border-color);
    background: rgba(255, 255, 255, .035);
}

.portal-navrow {
    min-height: 52px;
    padding: .28rem clamp(1rem, 2.3vw, 2.25rem);
    border-top: 1px solid rgba(46, 62, 92, .65);
    background: rgba(10, 16, 27, .6);
}

.portal-navigation {
    width: 100%;
    flex-wrap: wrap;
    gap: .18rem;
}

.portal-navigation .nav-link-custom {
    padding: .56rem .82rem !important;
    font-size: .79rem;
}

.portal-navigation .nav-link-custom.active {
    border: 1px solid rgba(129, 140, 248, .18);
    background: rgba(99, 102, 241, .13);
    box-shadow: inset 0 -2px #818cf8;
}

.portal-nav-toggle {
    display: none;
    padding: .3rem .48rem;
    border-color: var(--border-color);
}

.global-client-trigger {
    display: grid;
    grid-template-columns: 38px minmax(0, auto) auto;
    gap: .58rem;
    align-items: center;
    min-width: 196px;
    max-width: 270px;
    min-height: 48px;
    padding: .36rem .55rem;
    border: 1px solid #33445f;
    border-radius: 12px;
    color: var(--text-primary);
    background: linear-gradient(145deg, rgba(35, 49, 72, .94), rgba(24, 35, 54, .94));
    text-align: left;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.global-client-trigger:hover {
    border-color: #5d63cf;
    transform: translateY(-1px);
}

.global-client-trigger-logo,
.global-client-option-logo {
    display: grid;
    overflow: hidden;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    color: #a5b4fc;
    background: #eef2f7;
}

.global-client-trigger-logo img,
.global-client-option-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.global-client-trigger-logo i,
.global-client-option-logo i { font-size: 1rem; }
.global-client-trigger-logo:has(i),
.global-client-option-logo:has(i) { background: rgba(99, 102, 241, .12); }

.global-client-trigger-copy {
    display: grid;
    min-width: 0;
}

.global-client-trigger-copy small {
    color: #8192aa;
    font-size: .56rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.global-client-trigger-copy strong {
    overflow: hidden;
    color: #edf4fc;
    font-size: .74rem;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-client-trigger-arrow { margin-left: .15rem; color: #7f90a9; font-size: .68rem; }

.global-client-modal .modal-dialog { max-width: 560px; }
.global-client-modal .modal-content { overflow: hidden; max-height: min(720px, calc(100dvh - 2rem)); border: 1px solid #344660; border-radius: 20px; background: #121b2a; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); }
.global-client-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.3rem 1rem; }
.global-client-modal-header > div > span { color: #818cf8; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.global-client-modal-header h2 { margin: .1rem 0 .25rem; font-size: 1.4rem; }
.global-client-modal-header p { margin: 0; color: var(--text-secondary); font-size: .75rem; line-height: 1.5; }
.global-client-modal-search { position: relative; margin: 0 1.3rem .8rem; }
.global-client-modal-search i { position: absolute; top: 50%; left: .85rem; color: #7e8fa8; transform: translateY(-50%); }
.global-client-modal-search input { width: 100%; height: 44px; padding: 0 .9rem 0 2.5rem; border: 1px solid #30415a; border-radius: 11px; outline: 0; background: #1c293c; color: #f8fafc; font: inherit; font-size: .8rem; }
.global-client-modal-search input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
.global-client-options { overflow-y: auto; min-height: 150px; padding: 0 .75rem .85rem; }
.global-client-options form { margin: 0; }
.global-client-option { display: grid; width: 100%; grid-template-columns: 46px minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .65rem .7rem; border: 1px solid transparent; border-radius: 12px; color: var(--text-primary); background: transparent; text-align: left; }
.global-client-option:hover { border-color: #30415a; background: rgba(255, 255, 255, .035); }
.global-client-option.is-selected { border-color: rgba(37, 211, 102, .25); background: rgba(37, 211, 102, .07); }
.global-client-option-logo { width: 44px; height: 44px; }
.global-client-option-logo.is-system { color: #a5b4fc; background: rgba(99, 102, 241, .13); }
.global-client-option > span:nth-child(2) { display: grid; min-width: 0; }
.global-client-option strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.global-client-option small { color: var(--text-secondary); font-size: .65rem; }
.global-client-option > i { color: #6f819c; }
.global-client-option.is-selected > i { color: #45df7e; }
.global-client-no-results { display: grid; min-height: 150px; place-content: center; justify-items: center; color: var(--text-secondary); font-size: .75rem; }
.global-client-no-results i { margin-bottom: .5rem; font-size: 1.4rem; }

@media (max-width: 991.98px) {
    .portal-nav-toggle { display: block; }
    .portal-navrow { padding-block: 0; }
    .portal-navigation { padding: .45rem 0 .65rem; }
    .portal-navigation .nav-link-custom { padding: .62rem .75rem !important; }
    .portal-navigation .nav-link-custom.active { box-shadow: inset 3px 0 #818cf8; }
}

@media (max-width: 767.98px) {
    .portal-topbar { min-height: 68px; padding-inline: .75rem; }
    .portal-topbar .navbar-brand-custom { font-size: 1.12rem; }
    .portal-brand-logo { width: 138px; padding: 4px 8px; }
    .global-client-trigger { min-width: 0; width: 44px; height: 44px; grid-template-columns: 1fr; padding: 3px; }
    .global-client-trigger-copy,
    .global-client-trigger-arrow,
    .portal-user-summary { display: none; }
    .global-client-trigger-logo { width: 36px; height: 36px; }
    .portal-logout span { display: none; }
    .portal-logout { width: 38px; justify-content: center; padding: .35rem; }
    .global-client-modal .modal-dialog { margin: .55rem; }
    .global-client-modal .modal-content { max-height: calc(100dvh - 1.1rem); }
}

@media (max-width: 575.98px) {
    .portal-topbar { flex-wrap: wrap; gap: .65rem; }
    .portal-account-area { margin-left: auto; gap: .4rem; }
}

/* Container Wrapper */
.main-wrapper {
    flex: 1;
    padding: 2.5rem 1.5rem;
}

/* Cards */
.card-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.8rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card-custom-hover:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: white;
}

.btn-secondary-custom {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-secondary-custom:hover {
    background-color: var(--border-color);
    color: white;
}

.btn-danger-custom {
    background-color: var(--danger-color);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-danger-custom:hover {
    background-color: #e11d48;
}

/* Badges */
.badge-custom {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 50px;
    text-transform: uppercase;
}

.badge-received { background-color: rgba(14, 165, 233, 0.15); color: var(--info-color); border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-processing { background-color: rgba(245, 158, 11, 0.15); color: var(--warning-color); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-processed { background-color: rgba(16, 185, 129, 0.15); color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-sent { background-color: rgba(99, 102, 241, 0.15); color: var(--primary-color); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-failed { background-color: rgba(244, 63, 94, 0.15); color: var(--danger-color); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-partial { background-color: rgba(245, 158, 11, 0.15); color: var(--warning-color); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-retried { background-color: rgba(14, 165, 233, 0.15); color: var(--info-color); border: 1px solid rgba(14, 165, 233, 0.3); }

.badge-active { background-color: rgba(16, 185, 129, 0.15); color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-inactive { background-color: rgba(148, 163, 184, 0.15); color: var(--text-secondary); border: 1px solid rgba(148, 163, 184, 0.3); }

/* Form Elements */
.form-control-custom {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    transition: var(--transition);
}

.form-control-custom:focus {
    background-color: var(--bg-input);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    outline: none;
}

.form-label-custom {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

/* Wizard Stepper */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 4%;
    right: 4%;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
}

.wizard-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20%;
}

.wizard-step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: var(--transition);
}

.wizard-step.active .wizard-step-circle {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.wizard-step.completed .wizard-step-circle {
    border-color: var(--success-color);
    color: white;
    background-color: var(--success-color);
}

.wizard-step-label {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    transition: var(--transition);
}

.wizard-step.active .wizard-step-label {
    color: var(--text-primary);
}

.wizard-step.completed .wizard-step-label {
    color: var(--success-color);
}

.wizard-content-panel {
    display: none;
}

.wizard-content-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tables */
.table-custom {
    color: var(--text-primary) !important;
}

.table-custom th {
    background-color: #1a2336 !important;
    border-bottom: 2px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem !important;
}

.table-custom td {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem !important;
    vertical-align: middle !important;
}

.table-custom tbody tr:hover td {
    background-color: #1b2438 !important;
}

/* Code Editor & Payload blocks */
.code-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.code-editor-header {
    background-color: #1a2336;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-editor-title {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.code-textarea {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    background-color: #0b0f19 !important;
    color: #e2e8f0 !important;
    border: none !important;
    border-radius: 0 !important;
    resize: vertical;
    padding: 1rem;
    line-height: 1.5;
}

.facebook-form-helper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(56, 189, 248, .25);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(14, 165, 233, .08), rgba(30, 41, 59, .22));
}

.facebook-form-questions-modal {
    width: min(94vw, 1200px);
    max-width: 1200px;
}

.facebook-form-note,
.facebook-form-empty {
    padding: .85rem 1rem;
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 10px;
    color: #bae6fd;
    background: rgba(14, 165, 233, .07);
    font-size: .86rem;
}

.facebook-form-question-list {
    display: grid;
    gap: .8rem;
}

.facebook-form-question {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(8, 15, 28, .55);
}

.facebook-form-question-heading {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
}

.facebook-form-question-number {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 8px;
    color: #cffafe;
    background: rgba(8, 145, 178, .22);
    font-size: .78rem;
    font-weight: 800;
}

.facebook-form-question-label {
    color: #f8fafc;
    font-weight: 700;
}

.facebook-form-question-meta {
    margin-top: .25rem;
    color: #94a3b8;
    font-size: .76rem;
}

.facebook-form-question-meta code,
.facebook-form-option code {
    color: #67e8f9;
}

.facebook-form-question-type {
    padding: .24rem .55rem;
    border: 1px solid rgba(129, 140, 248, .28);
    border-radius: 999px;
    color: #c7d2fe;
    background: rgba(99, 102, 241, .12);
    font-size: .65rem;
    font-weight: 800;
    white-space: nowrap;
}

.facebook-form-options {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: .85rem 0 0 2.4rem;
}

.facebook-form-options-title {
    width: 100%;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.facebook-form-option {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .38rem .65rem;
    border: 1px solid rgba(100, 116, 139, .35);
    border-radius: 8px;
    color: #e2e8f0;
    background: rgba(30, 41, 59, .72);
    font-size: .78rem;
}

.facebook-form-no-options {
    margin: .7rem 0 0 2.4rem;
    color: #64748b;
    font-size: .78rem;
}

@media (max-width: 767.98px) {
    .facebook-form-helper { align-items: stretch; flex-direction: column; }
    .facebook-form-question-type { display: none; }
    .facebook-form-options,
    .facebook-form-no-options { margin-left: 0; }
}

.transform-ai-card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
    border: 1px solid rgba(129, 140, 248, .38);
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0, rgba(124, 58, 237, .19), transparent 35%),
        linear-gradient(145deg, rgba(21, 29, 49, .98), rgba(13, 20, 35, .98));
    box-shadow: 0 14px 35px rgba(2, 6, 23, .24);
}

.transform-ai-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    content: "";
    background: linear-gradient(90deg, #38bdf8, #818cf8 45%, #c084fc);
}

.transform-ai-heading {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.transform-ai-heading h4 {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 800;
}

.transform-ai-heading p {
    margin-top: .2rem;
    color: #94a3b8;
    font-size: .78rem;
}

.transform-ai-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid rgba(165, 180, 252, .4);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #2563eb, #7c3aed);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
    font-size: 1.05rem;
}

.transform-ai-badge {
    padding: .2rem .5rem;
    border: 1px solid rgba(192, 132, 252, .38);
    border-radius: 999px;
    color: #e9d5ff;
    background: rgba(126, 34, 206, .16);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.transform-ai-input {
    min-height: 160px;
    border-color: rgba(100, 116, 139, .42) !important;
    background: rgba(8, 15, 28, .68) !important;
    line-height: 1.45;
}

.transform-ai-input:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .13) !important;
}

.transform-ai-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.transform-ai-generate {
    border: 1px solid rgba(165, 180, 252, .55);
    color: #fff;
    background: linear-gradient(100deg, #2563eb, #6d4aff 55%, #9333ea);
    box-shadow: 0 8px 22px rgba(79, 70, 229, .28);
    font-size: .82rem;
    font-weight: 800;
}

.transform-ai-generate:hover,
.transform-ai-generate:focus {
    border-color: #c4b5fd;
    color: #fff;
    filter: brightness(1.09);
}

.transform-ai-generate:disabled { color: #e2e8f0; opacity: .72; }
.transform-ai-status { color: #94a3b8; text-align: right; }
.transform-ai-status.is-working { color: #93c5fd; }
.transform-ai-status.is-success { color: #6ee7b7; }
.transform-ai-status.is-error { color: #fda4af; }

.transform-ai-preview {
    padding: .85rem;
    border: 1px solid rgba(52, 211, 153, .3);
    border-radius: 10px;
    background: rgba(6, 78, 59, .09);
}

.transform-ai-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .55rem;
    color: #6ee7b7;
    font-size: .76rem;
    font-weight: 800;
}

.transform-ai-preview-head small { color: #94a3b8; font-weight: 500; }
.transform-ai-preview p,
.transform-ai-preview ul { color: #cbd5e1; }

.transform-ai-output-fields {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    color: #94a3b8;
    font-size: .72rem;
}

.transform-ai-output-fields > span {
    flex: 0 0 auto;
    padding-top: .2rem;
    font-weight: 700;
}

.transform-ai-output-fields > div {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.transform-ai-output-fields code {
    padding: .16rem .42rem;
    border: 1px solid rgba(56, 189, 248, .25);
    border-radius: 6px;
    color: #bae6fd;
    background: rgba(14, 165, 233, .1);
    font-size: .68rem;
}

.transform-ai-preview pre {
    max-height: 260px;
    overflow: auto;
    padding: .75rem;
    border: 1px solid rgba(71, 85, 105, .45);
    border-radius: 8px;
    color: #bae6fd;
    background: rgba(2, 6, 23, .62);
    font-size: .75rem;
    white-space: pre-wrap;
}

.transform-ai-privacy {
    color: #64748b;
    font-size: .68rem;
    line-height: 1.45;
}

@media (max-width: 767.98px) {
    .transform-ai-actions { align-items: stretch; flex-direction: column; }
    .transform-ai-status { text-align: left; }
    .transform-ai-preview-head { align-items: flex-start; flex-direction: column; gap: .2rem; }
}

.payload-preview {
    font-family: monospace;
    font-size: 0.85rem;
    background-color: #0b0f19;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: #38bdf8;
    overflow-x: auto;
    max-height: 400px;
    white-space: pre-wrap;
}

/* Statistics Widgets */
.stat-widget {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Spreadsheet Grid View */
.sheet-container {
    overflow: auto;
    max-height: calc(100vh - 280px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.sheet-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.sheet-table th {
    position: sticky;
    top: 0;
    background-color: #1a2336;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    z-index: 10;
    font-size: 0.85rem;
    white-space: nowrap;
}

.sheet-column-header {
    display: flex;
    min-width: 145px;
    flex-direction: column;
    gap: 0.45rem;
}

.sheet-column-header > span {
    display: flex;
    align-items: center;
    min-height: 1.25rem;
    font-weight: 700;
}

.sheet-column-filter {
    width: 100%;
    min-width: 120px;
    height: 30px;
    padding: 0.25rem 0.55rem;
    border: 1px solid #3a4963;
    border-radius: 6px;
    outline: none;
    background-color: #0e1728;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 400;
}

.sheet-column-filter::placeholder {
    color: #7887a3;
}

.sheet-column-filter:hover {
    border-color: #596a89;
}

.sheet-column-filter:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

.sheet-column-filter::-webkit-search-cancel-button {
    cursor: pointer;
}

.sheet-input-editor,
.sheet-select-editor {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sheet-input-control,
.sheet-outcome-select {
    height: 31px;
    border: 1px solid #3a4963;
    border-radius: 6px;
    outline: none;
    background-color: #0e1728;
    color: #e2e8f0;
    font-size: 0.78rem;
}

.sheet-input-control {
    min-width: 190px;
    padding: 0.3rem 0.55rem;
}

.sheet-outcome-select {
    min-width: 76px;
    padding: 0.25rem 0.45rem;
    cursor: pointer;
}

.sheet-input-control:focus,
.sheet-outcome-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

.sheet-input-control:disabled,
.sheet-outcome-select:disabled {
    cursor: wait;
    opacity: 0.7;
}

.sheet-input-save {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.sheet-input-save > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.sheet-input-save > span {
    display: inline-flex;
    width: 29px;
    height: 29px;
    align-items: center;
    justify-content: center;
    border: 1px solid #596a89;
    border-radius: 6px;
    background-color: #18243a;
    color: #93a4c2;
    transition: 0.15s ease;
}

.sheet-input-save:hover > span,
.sheet-input-save > input:focus-visible + span {
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

.sheet-input-save > input:checked + span {
    border-color: #10b981;
    background-color: #10b981;
    color: #ffffff;
}

.sheet-save-state {
    display: inline-block;
    max-width: 92px;
    overflow: hidden;
    color: #93a4c2;
    font-size: 0.68rem;
    line-height: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-save-state.is-saving { color: #fbbf24; }
.sheet-save-state.is-saved { color: #34d399; }
.sheet-save-state.is-error { color: #f87171; }

.sheet-table td {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #e2e8f0;
    white-space: nowrap;
}

.sheet-table tr:hover td {
    background-color: #1e293b;
}

.sheet-table tr.sheet-row-unread td {
    background-color: rgba(220, 53, 69, 0.2);
    border-bottom-color: rgba(248, 113, 113, 0.45);
}

.sheet-table tr.sheet-row-unread:hover td {
    background-color: rgba(220, 53, 69, 0.3);
}

.alert-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

.alert-success-custom {
    border-color: rgba(16, 185, 129, 0.4);
    background-color: rgba(16, 185, 129, 0.05);
}

.alert-danger-custom {
    border-color: rgba(244, 63, 94, 0.4);
    background-color: rgba(244, 63, 94, 0.05);
}

/* Shared in-app dialogs replace native alert / confirm / prompt popups. */
.app-dialog .modal-dialog {
    max-width: 520px;
}

.app-dialog-content {
    background: linear-gradient(145deg, #182135, var(--bg-card));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.app-dialog-heading {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.app-dialog-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99, 102, 241, 0.32);
    font-size: 1.25rem;
}

.app-dialog[data-tone="danger"] .app-dialog-icon {
    color: #fda4af;
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.32);
}

.app-dialog[data-tone="warning"] .app-dialog-icon {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.32);
}

.app-dialog[data-tone="info"] .app-dialog-icon {
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.32);
}

.app-dialog[data-tone="success"] .app-dialog-icon {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.32);
}

.app-dialog-actions {
    gap: 0.75rem;
}

@media (max-width: 575.98px) {
    .app-dialog .modal-dialog {
        margin: 1rem;
    }

    .app-dialog-actions .btn {
        flex: 1;
    }
}

/* WhatsApp-style conversation inbox, report and secure sales-rep bridge */
.wa-conversations-page,
.wa-chat-admin-page {
    --wa-green: #25d366;
    --wa-green-dark: #075e54;
    --wa-panel: #111a2a;
    --wa-panel-raised: #172237;
    --wa-line: #293a57;
}

.wa-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--border-color);
}

.wa-page-heading h1 {
    margin: .2rem 0 .15rem;
    font-size: clamp(2rem, 3vw, 2.75rem);
}

.wa-page-heading p {
    margin: 0;
    color: var(--text-secondary);
}

.wa-page-eyebrow {
    color: var(--wa-green);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.wa-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.wa-inbox-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: .9rem;
}

.wa-inbox-stat {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 76px;
    padding: .9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .025), transparent), var(--bg-card);
}

.wa-inbox-stat > i {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    font-size: 1.1rem;
}

.wa-inbox-stat span {
    color: var(--text-secondary);
    font-size: .75rem;
}

.wa-inbox-stat strong {
    display: block;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    line-height: 1.05;
}

.wa-inbox-stat.is-green > i { color: #5ee894; background: rgba(37, 211, 102, .12); }
.wa-inbox-stat.is-amber > i { color: #fbbf24; background: rgba(245, 158, 11, .12); }
.wa-inbox-stat.is-slate > i { color: #a5b4c9; background: rgba(148, 163, 184, .12); }
.wa-inbox-stat.is-blue > i { color: #60a5fa; background: rgba(59, 130, 246, .12); }

.wa-inbox-shell {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-card);
    box-shadow: var(--card-shadow);
}

.wa-inbox-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: .7rem;
    align-items: end;
    padding: .85rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 14, 24, .58);
}

.wa-inbox-search {
    position: relative;
}

.wa-inbox-search i {
    position: absolute;
    top: 50%;
    left: .9rem;
    color: var(--text-secondary);
    transform: translateY(-50%);
    pointer-events: none;
}

.wa-inbox-search input,
.wa-inbox-filters select,
.wa-inbox-dates input {
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: 0;
    background: var(--bg-input);
    color: var(--text-primary);
}

.wa-inbox-search input {
    width: 100%;
    padding: 0 1rem 0 2.65rem;
}

.wa-inbox-search input:focus,
.wa-inbox-filters select:focus,
.wa-inbox-dates input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

.wa-inbox-filters {
    display: flex;
    gap: .55rem;
}

.wa-inbox-filters select {
    min-width: 155px;
    padding: 0 2.25rem 0 .75rem;
}

.wa-inbox-dates {
    display: flex;
    align-items: end;
    gap: .45rem;
}

.wa-inbox-dates label {
    margin: 0;
}

.wa-inbox-dates label span {
    display: block;
    margin: 0 0 .25rem .15rem;
    color: var(--text-secondary);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.wa-inbox-dates input {
    width: 138px;
    padding: 0 .65rem;
}

.wa-inbox-dates > a {
    display: grid;
    width: 38px;
    height: 44px;
    place-items: center;
    border-radius: 10px;
    color: var(--text-secondary);
    background: var(--bg-input);
}

.wa-inbox-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: .72rem;
}

.wa-inbox-titlebar div {
    display: flex;
    align-items: baseline;
    gap: .7rem;
}

.wa-inbox-titlebar strong {
    color: var(--text-primary);
    font-size: .92rem;
}

.wa-inbox-list {
    min-height: 210px;
}

.wa-inbox-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: center;
    min-height: 108px;
    padding: .95rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color .18s ease, transform .18s ease;
}

.wa-inbox-row:last-of-type { border-bottom: 0; }
.wa-inbox-row:hover { color: var(--text-primary); background: rgba(37, 211, 102, .045); }

.wa-avatar {
    position: relative;
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    background: linear-gradient(145deg, #29415f, #17263a);
    color: #e9f4ff;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.wa-avatar-lg { width: 52px; height: 52px; font-size: 1.2rem; }
.wa-avatar-xl { width: 72px; height: 72px; margin-inline: auto; font-size: 1.65rem; }

.wa-presence {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    background: #64748b;
}

.wa-presence.is-active { background: var(--wa-green); }
.wa-presence.is-waiting { background: #f59e0b; }
.wa-presence.is-closed,
.wa-presence.is-expired { background: #64748b; }
.wa-presence.is-unanswered { background: #f43f5e; }

.wa-inbox-row-main { min-width: 0; }
.wa-inbox-row-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wa-inbox-row-top > div { display: flex; min-width: 0; align-items: center; gap: .55rem; }
.wa-inbox-row-top strong { overflow: hidden; font-size: .98rem; text-overflow: ellipsis; white-space: nowrap; }
.wa-inbox-row-top time { flex: 0 0 auto; color: var(--text-secondary); font-size: .72rem; }

.wa-status-pill {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: .22rem .48rem;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, .09);
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.wa-status-pill.is-active { color: #60e893; border-color: rgba(37, 211, 102, .26); background: rgba(37, 211, 102, .1); }
.wa-status-pill.is-waiting { color: #fbbf24; border-color: rgba(245, 158, 11, .25); background: rgba(245, 158, 11, .1); }
.wa-status-pill.is-unanswered { color: #fb7185; border-color: rgba(244, 63, 94, .25); background: rgba(244, 63, 94, .1); }

.wa-inbox-preview {
    overflow: hidden;
    margin-top: .28rem;
    color: #c4d0e1;
    font-size: .84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-inbox-context {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    margin-top: .48rem;
    color: var(--text-secondary);
    font-size: .69rem;
}

.wa-inbox-context i { margin-right: .18rem; color: #6f83a4; }

.wa-inbox-row-end {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #6f83a4;
}

.wa-message-count {
    padding: .28rem .5rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, .09);
    color: #a9b7ce;
    font-size: .7rem;
}

.wa-inbox-empty,
.wa-chat-empty {
    display: grid;
    min-height: 210px;
    place-content: center;
    justify-items: center;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.wa-inbox-empty i,
.wa-chat-empty i { margin-bottom: .65rem; color: #64748b; font-size: 2rem; }
.wa-inbox-empty h3 { margin: 0; font-size: 1.12rem; }
.wa-inbox-empty p,
.wa-chat-empty span { max-width: 480px; margin: .3rem 0 0; font-size: .8rem; }

/* Shared chat surface */
.wa-chat-admin-page { padding-top: .25rem; }
.wa-chat-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }

.wa-chat-window,
.secure-wa-chat {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    height: min(760px, calc(100dvh - 145px));
    min-height: 560px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: #0c1420;
    box-shadow: var(--card-shadow);
}

.wa-chat-header {
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 70px;
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(21, 28, 44, .97);
}

.wa-icon-button {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: #cad5e4;
    font-size: 1.05rem;
}

.wa-icon-button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.wa-chat-contact { min-width: 0; }
.wa-chat-contact-name { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-contact-meta { display: flex; gap: .3rem; overflow: hidden; color: var(--text-secondary); font-size: .68rem; white-space: nowrap; }

.wa-chat-header-status {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-left: auto;
}

.wa-window-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .55rem;
    border-radius: 999px;
    color: #fbbf24;
    background: rgba(245, 158, 11, .09);
    font-size: .67rem;
}

.wa-window-label.is-open { color: #5ee894; background: rgba(37, 211, 102, .09); }

.wa-chat-background {
    min-height: 0;
    background-color: #0b141c;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(37, 211, 102, .035) 0 2px, transparent 2.5px),
        radial-gradient(circle at 80% 65%, rgba(255, 255, 255, .025) 0 2px, transparent 2.5px),
        linear-gradient(135deg, rgba(255, 255, 255, .012) 25%, transparent 25%);
    background-size: 74px 74px, 92px 92px, 36px 36px;
}

.wa-chat-messages {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.05rem clamp(.75rem, 2.5vw, 2.2rem) 1.4rem;
    overscroll-behavior: contain;
    scrollbar-color: rgba(148, 163, 184, .28) transparent;
}

.wa-day-divider {
    display: flex;
    justify-content: center;
    margin: .25rem 0 1rem;
    position: sticky;
    top: .2rem;
    z-index: 1;
}

.wa-day-divider span {
    padding: .32rem .65rem;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    color: #afbdd0;
    background: rgba(19, 31, 45, .94);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    font-size: .65rem;
    font-weight: 700;
}

.wa-system-message,
.secure-wa-note,
.secure-wa-error {
    display: flex;
    width: min(92%, 700px);
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: .65rem auto 1rem;
    padding: .5rem .7rem;
    border: 1px solid rgba(99, 102, 241, .16);
    border-radius: 9px;
    color: #aebdd2;
    background: rgba(24, 38, 57, .92);
    font-size: .67rem;
    line-height: 1.45;
    text-align: center;
}

.wa-system-message time { color: #7f90a8; font-size: .6rem; white-space: nowrap; }
.secure-wa-note { color: #c2cedc; border-color: rgba(37, 211, 102, .12); }
.secure-wa-note i { color: #54df87; }
.secure-wa-error { color: #fecdd3; border-color: rgba(244, 63, 94, .26); background: rgba(127, 29, 29, .32); }

.wa-message-line {
    display: flex;
    width: 100%;
    margin: .2rem 0;
}

.wa-message-line.is-incoming { justify-content: flex-start; }
.wa-message-line.is-outgoing { justify-content: flex-end; }

.wa-bubble {
    position: relative;
    width: fit-content;
    max-width: min(74%, 680px);
    padding: .5rem .65rem .35rem;
    border: 1px solid rgba(255, 255, 255, .045);
    border-radius: 8px;
    background: #1b2737;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
}

.is-outgoing .wa-bubble { background: #075e54; border-color: rgba(37, 211, 102, .12); }
.is-incoming .wa-bubble { border-top-left-radius: 2px; }
.is-outgoing .wa-bubble { border-top-right-radius: 2px; }

.wa-bubble-sender {
    margin-bottom: .18rem;
    color: #6fe99b;
    font-size: .66rem;
    font-weight: 800;
}

.is-outgoing .wa-bubble-sender { color: #b4f3cb; }

.wa-bubble-copy {
    color: #f0f5fa;
    font-size: .86rem;
    line-height: 1.48;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.wa-message-image,
.wa-message-video {
    display: block;
    width: min(100%, 420px);
    max-height: 440px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(0, 0, 0, .28);
    margin-bottom: .45rem;
}

.wa-message-audio { display: block; width: min(320px, 100%); margin-bottom: .4rem; }
.wa-message-document { display: flex; align-items: center; gap: .55rem; padding: .7rem; margin-bottom: .4rem; border-radius: 8px; background: rgba(255,255,255,.07); color: #e2e8f0; text-decoration: none; }
.wa-message-document:hover { color: #fff; background: rgba(255,255,255,.12); }

.wa-bubble footer {
    display: flex;
    min-width: 52px;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
    margin: .12rem 0 0 .8rem;
    color: rgba(219, 230, 240, .62);
    font-size: .58rem;
}

.wa-delivery-state { color: rgba(219, 230, 240, .7); font-size: .78rem; line-height: 1; }
.wa-delivery-state.is-read { color: #53bdeb; }
.wa-delivery-state.is-failed { color: #fb7185; }
.wa-bubble-error { margin-top: .35rem; padding-top: .32rem; border-top: 1px solid rgba(251, 113, 133, .22); color: #fda4af; font-size: .65rem; }

.wa-chat-readonly-bar,
.secure-wa-closed {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .65rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: #151e2d;
    font-size: .72rem;
    text-align: center;
}

.wa-chat-sidebar { display: grid; gap: .8rem; }

.wa-sidebar-customer,
.wa-sidebar-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-card);
}

.wa-sidebar-customer { padding-block: 1.3rem; text-align: center; }
.wa-sidebar-customer h2 { margin: .7rem 0 .15rem; font-size: 1.25rem; }
.wa-sidebar-customer > a { color: #5ee894; font-size: .8rem; }
.wa-sidebar-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.wa-sidebar-tags span { padding: .25rem .45rem; border-radius: 7px; color: #aebdd2; background: rgba(99, 102, 241, .09); font-size: .63rem; }
.wa-sidebar-card h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .85rem; font-size: .92rem; }
.wa-sidebar-card dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: .6rem; margin-bottom: 1rem; font-size: .72rem; }
.wa-sidebar-card dt { color: var(--text-secondary); font-weight: 500; }
.wa-sidebar-card dd { margin: 0; overflow-wrap: anywhere; }
.wa-sidebar-danger { border-color: rgba(244, 63, 94, .22); }
.wa-sidebar-danger p { color: var(--text-secondary); font-size: .72rem; }

/* The sales representative gets a private, app-like page without portal chrome. */
.secure-chat-body {
    --wa-green: #25d366;
    --wa-green-dark: #075e54;
    overflow: hidden;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 20% 0, rgba(37, 211, 102, .12), transparent 32%),
        radial-gradient(circle at 90% 100%, rgba(99, 102, 241, .13), transparent 34%),
        #080d15;
}

.secure-wa-page {
    display: grid;
    min-height: 100dvh;
    padding: clamp(.75rem, 2vw, 1.6rem);
    place-items: center;
}

.secure-wa-chat {
    width: min(1080px, 100%);
    height: min(860px, calc(100dvh - clamp(1.5rem, 4vw, 3.2rem)));
    min-height: 520px;
    border-color: #25364d;
}

.secure-wa-header { min-height: 76px; padding-inline: clamp(.75rem, 2vw, 1.25rem); }
.secure-wa-brand { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #8b8df8; background: rgba(99, 102, 241, .13); }
.secure-wa-brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.secure-wa-header-meta { display: flex; align-items: center; gap: .55rem; margin-left: auto; }
.secure-wa-client { color: var(--text-secondary); font-size: .72rem; }
.secure-wa-lock { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .55rem; border-radius: 999px; color: #66e994; background: rgba(37, 211, 102, .09); font-size: .66rem; font-weight: 700; }
.secure-wa-contact-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .55rem .8rem; border-top: 1px solid #25364d; border-bottom: 1px solid #25364d; background: #121b29; }
.secure-wa-contact-summary { display: flex; min-width: 0; align-items: center; gap: .6rem; color: #dce6f2; }
.secure-wa-contact-summary > i { color: #8b8df8; font-size: 1.2rem; }
.secure-wa-contact-summary span { display: grid; min-width: 0; }
.secure-wa-contact-summary strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.secure-wa-contact-summary small { overflow: hidden; color: #8ea0b6; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.secure-wa-contact-buttons { display: flex; flex: 0 0 auto; gap: .45rem; }
.secure-wa-contact-button { display: inline-flex; min-height: 34px; align-items: center; gap: .38rem; padding: .42rem .65rem; border: 1px solid #34465e; border-radius: 9px; color: #dfe8f3; background: #1d2939; font-size: .7rem; font-weight: 700; text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.secure-wa-contact-button:hover { border-color: #596f8d; color: #fff; background: #26364a; transform: translateY(-1px); }
.secure-wa-contact-button.is-chat { border-color: rgba(37, 211, 102, .35); color: #71e69a; background: rgba(37, 211, 102, .08); }
.secure-wa-contact-button.is-save { border-color: rgba(129, 140, 248, .52); color: #e0e7ff; background: rgba(99, 102, 241, .2); }
.secure-wa-contact-button.is-primary { min-height: 40px; padding-inline: .9rem; border-color: #818cf8; color: #fff; background: #6366f1; box-shadow: 0 7px 18px rgba(99, 102, 241, .22); font-size: .76rem; }
.secure-wa-contact-button.is-primary:hover { border-color: #a5b4fc; background: #7477f4; }
.secure-wa-contact-buttons form { margin: 0; }
.secure-wa-contact-button.is-close { min-height: 40px; border-color: rgba(248, 113, 113, .38); color: #fecaca; background: rgba(127, 29, 29, .18); }
.secure-wa-contact-button.is-close:hover { border-color: rgba(248, 113, 113, .7); color: #fff; background: rgba(185, 28, 28, .32); }
.wa-contact-import-row { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; border-top: 1px solid #25364d; border-bottom: 1px solid #25364d; background: linear-gradient(90deg, rgba(99, 102, 241, .08), rgba(15, 23, 42, .2)); }
.wa-contact-import-copy { display: flex; min-width: 0; align-items: center; gap: .7rem; }
.wa-contact-import-copy > i { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; color: #a5b4fc; background: rgba(99, 102, 241, .14); font-size: 1.1rem; }
.wa-contact-import-copy span { display: grid; min-width: 0; }
.wa-contact-import-copy strong { color: var(--text-primary); font-size: .8rem; }
.wa-contact-import-copy small { overflow: hidden; color: var(--text-secondary); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.wa-contact-import-primary { display: inline-flex; min-height: 42px; flex: 0 0 auto; align-items: center; justify-content: center; gap: .45rem; padding: .58rem 1rem; border: 1px solid #818cf8; border-radius: 11px; color: #fff; background: #6366f1; box-shadow: 0 8px 20px rgba(99, 102, 241, .24); font-size: .76rem; font-weight: 800; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.wa-contact-import-primary:hover { color: #fff; background: #7477f4; transform: translateY(-1px); }
.wa-contact-row-buttons { display: flex; flex: 0 0 auto; align-items: center; gap: .55rem; }
.wa-contact-preview-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: .45rem; padding: .58rem .9rem; border: 1px solid rgba(37, 211, 102, .4); border-radius: 11px; color: #71e69a; background: rgba(37, 211, 102, .09); font-size: .76rem; font-weight: 800; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.wa-contact-preview-button:hover { color: #9bf1b8; background: rgba(37, 211, 102, .16); transform: translateY(-1px); }
.secure-wa-background { min-height: 0; }

.secure-wa-composer {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 46px;
    gap: .65rem;
    align-items: end;
    padding: .65rem .75rem calc(.65rem + env(safe-area-inset-bottom));
    border-top: 1px solid #27374d;
    background: #151e2d;
}

.secure-wa-attach { position: relative; display: grid; place-items: center; width: 42px; height: 42px; align-self: end; overflow: hidden; border-radius: 50%; color: #a9b8c8; cursor: pointer; font-size: 1.15rem; }
.secure-wa-attach:hover { color: #fff; background: rgba(255,255,255,.08); }
.secure-wa-attach.has-file { color: #71e69a; background: rgba(37, 211, 102, .12); }
.secure-wa-attach input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.secure-wa-selected-file { grid-column: 1 / -1; display: flex; min-width: 0; align-items: center; gap: .5rem; padding: .42rem .65rem; border: 1px solid rgba(37, 211, 102, .3); border-radius: 9px; color: #b9f5cd; background: rgba(37, 211, 102, .08); font-size: .76rem; }
.secure-wa-selected-file[hidden] { display: none; }
.secure-wa-selected-file.is-error { border-color: rgba(239, 68, 68, .45); color: #fecaca; background: rgba(239, 68, 68, .1); }
.secure-wa-selected-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secure-wa-selected-file button { display: grid; flex: 0 0 auto; width: 26px; height: 26px; margin-left: auto; place-items: center; padding: 0; border: 0; border-radius: 50%; color: inherit; background: rgba(255,255,255,.08); }
.secure-wa-selected-file button:hover { background: rgba(255,255,255,.16); }

.secure-wa-textarea {
    width: 100%;
    min-height: 46px;
    max-height: 132px;
    resize: none;
    padding: .72rem .9rem;
    border: 1px solid #304158;
    border-radius: 22px;
    outline: 0;
    background: #202c3c;
    color: #f8fafc;
    font: inherit;
    font-size: .86rem;
    line-height: 1.45;
}

.secure-wa-textarea::placeholder { color: #8392a7; }
.secure-wa-textarea:focus { border-color: rgba(37, 211, 102, .55); box-shadow: 0 0 0 3px rgba(37, 211, 102, .08); }

.secure-wa-send {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #052f23;
    background: var(--wa-green);
    box-shadow: 0 8px 20px rgba(37, 211, 102, .22);
    font-size: 1rem;
    transition: transform .18s ease, filter .18s ease;
}

.secure-wa-send:hover { filter: brightness(1.07); transform: translateY(-1px); }
.secure-wa-send:active { transform: scale(.96); }
.secure-wa-closed { min-height: 68px; color: #facc6b; background: #1c2130; }

.secure-wa-state-page { display: grid; min-height: 100dvh; padding: 1rem; place-items: center; }
.secure-wa-state-card { width: min(480px, 100%); padding: clamp(1.5rem, 5vw, 2.5rem); border: 1px solid #293a52; border-radius: 22px; background: rgba(21, 28, 44, .94); box-shadow: 0 28px 70px rgba(0, 0, 0, .38); text-align: center; }
.secure-wa-state-brand { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.7rem; color: #9b9dfb; font-family: 'Outfit', sans-serif; font-weight: 800; }
.secure-wa-state-brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }
.secure-wa-state-icon { display: grid; width: 72px; height: 72px; margin: 0 auto 1rem; place-items: center; border-radius: 20px; color: #fb7185; background: rgba(244, 63, 94, .1); font-size: 2rem; }
.secure-wa-state-card h1 { margin-bottom: .65rem; font-size: clamp(1.45rem, 5vw, 2rem); }
.secure-wa-state-card > p { color: var(--text-secondary); font-size: .88rem; line-height: 1.6; }
.secure-wa-state-help { display: flex; align-items: flex-start; gap: .55rem; margin-top: 1.25rem; padding: .75rem; border-radius: 11px; color: #b8c5d7; background: rgba(99, 102, 241, .08); font-size: .75rem; text-align: left; }

@media (max-width: 1199.98px) {
    .wa-inbox-toolbar { grid-template-columns: 1fr; }
    .wa-inbox-filters select { flex: 1 1 0; }
    .wa-inbox-dates { justify-content: flex-start; }
}

@media (max-width: 899.98px) {
    .wa-chat-admin-grid { grid-template-columns: 1fr; }
    .wa-chat-window { height: min(720px, calc(100dvh - 135px)); }
    .wa-chat-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wa-sidebar-customer { grid-column: 1 / -1; }
}

@media (max-width: 767.98px) {
    .wa-conversations-page { padding-inline: .55rem !important; }
    .wa-page-heading { align-items: flex-start; flex-direction: column; }
    .wa-page-actions { width: 100%; }
    .wa-page-actions .btn { flex: 1; }
    .wa-inbox-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wa-inbox-stat { min-height: 66px; padding: .7rem; }
    .wa-inbox-stat > i { width: 36px; height: 36px; flex-basis: 36px; }
    .wa-inbox-filters { display: grid; grid-template-columns: 1fr 1fr; }
    .wa-inbox-filters select { min-width: 0; width: 100%; }
    .wa-inbox-dates { display: grid; grid-template-columns: 1fr 1fr auto; }
    .wa-inbox-dates input { width: 100%; }
    .wa-inbox-titlebar > span { display: none; }
    .wa-inbox-row { min-height: 96px; padding: .8rem .7rem; }
    .wa-inbox-context span:nth-child(2) { display: none; }
    .wa-inbox-row-end .wa-message-count { display: none; }
    .wa-inbox-row-end { gap: 0; }
    .wa-chat-admin-page { padding: 0 !important; }
    .wa-chat-admin-grid { gap: .75rem; }
    .wa-chat-window { height: calc(100dvh - 92px); min-height: 500px; border-inline: 0; border-radius: 0; }
    .wa-chat-header-status .wa-window-label { display: none; }
    .wa-chat-sidebar { grid-template-columns: 1fr; padding-inline: .7rem; }
    .wa-sidebar-customer { grid-column: auto; }
    .wa-bubble { max-width: 86%; }

    .secure-wa-page { display: block; padding: 0; }
    .secure-wa-chat { width: 100%; height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; }
    .secure-wa-header { min-height: 66px; padding-top: calc(.55rem + env(safe-area-inset-top)); }
    .secure-wa-brand { display: none; }
    .secure-wa-client { display: none; }
    .secure-wa-lock { padding: .3rem; background: transparent; font-size: 0; }
    .secure-wa-lock i { font-size: 1rem; }
    .secure-wa-contact-actions { align-items: stretch; flex-direction: column; gap: .45rem; padding: .5rem .65rem; }
    .secure-wa-contact-buttons { display: grid; grid-template-columns: 1fr 1fr; }
    .secure-wa-contact-button { justify-content: center; }
    .wa-contact-import-row { align-items: stretch; flex-direction: column; gap: .55rem; padding: .65rem .75rem; }
    .wa-contact-row-buttons { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.wa-contact-import-primary, .wa-contact-preview-button { width: 100%; }
    .secure-wa-note { width: 96%; }
}

/* Sales representative account inbox */
.rep-inbox-page { max-width: 1480px; margin-inline: auto; }
.rep-inbox-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.rep-inbox-heading h1 { margin: .15rem 0; color: #f8fafc; font-size: clamp(1.55rem, 2.3vw, 2.25rem); font-weight: 850; }
.rep-inbox-heading p { margin: 0; color: #94a3b8; font-size: .86rem; }
.rep-inbox-live { display: flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border: 1px solid rgba(52, 211, 153, .25); border-radius: 999px; color: #6ee7b7; background: rgba(6, 78, 59, .13); font-size: .7rem; font-weight: 800; }
.rep-inbox-live > span { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .12); }
.rep-inbox-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.rep-inbox-stat { display: flex; min-height: 78px; align-items: center; gap: .8rem; padding: .85rem 1rem; border: 1px solid #25364d; border-radius: 13px; background: linear-gradient(145deg, rgba(23, 33, 52, .98), rgba(17, 25, 41, .98)); }
.rep-inbox-stat > i { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; font-size: 1rem; }
.rep-inbox-stat span { display: grid; color: #94a3b8; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.rep-inbox-stat strong { color: #f8fafc; font-size: 1.25rem; line-height: 1.15; }
.rep-inbox-stat.is-unread > i { color: #fff; background: #22c55e; }
.rep-inbox-stat.is-open > i { color: #67e8f9; background: rgba(8, 145, 178, .18); }
.rep-inbox-stat.is-closed > i { color: #cbd5e1; background: rgba(100, 116, 139, .18); }
.rep-inbox-shell { overflow: hidden; border: 1px solid #25364d; border-radius: 15px; background: #111a2a; box-shadow: 0 16px 42px rgba(0, 0, 0, .22); }
.rep-inbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem; border-bottom: 1px solid #25364d; background: #162135; }
.rep-inbox-search { display: flex; width: min(470px, 100%); align-items: center; gap: .55rem; padding: .55rem .75rem; border: 1px solid #30425d; border-radius: 10px; color: #64748b; background: #0e1726; }
.rep-inbox-search input { width: 100%; border: 0; outline: 0; color: #e2e8f0; background: transparent; font-size: .8rem; }
.rep-inbox-tabs { display: flex; gap: .25rem; padding: .2rem; border: 1px solid #2b3b53; border-radius: 10px; background: rgba(15, 23, 42, .65); }
.rep-inbox-tabs button { padding: .4rem .65rem; border: 0; border-radius: 7px; color: #94a3b8; background: transparent; font-size: .7rem; font-weight: 750; }
.rep-inbox-tabs button.is-active { color: #fff; background: #4f46e5; box-shadow: 0 4px 12px rgba(79, 70, 229, .25); }
.rep-inbox-list { min-height: 220px; }
.rep-inbox-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85rem; min-height: 104px; padding: .85rem 1rem; border-bottom: 1px solid rgba(48, 66, 93, .7); color: inherit; text-decoration: none; background: #111a2a; transition: background .15s ease, border-color .15s ease; }
.rep-inbox-row:last-of-type { border-bottom: 0; }
.rep-inbox-row:hover { color: inherit; background: #17243a; }
.rep-inbox-row.is-unread { border-left: 3px solid #22c55e; background: linear-gradient(90deg, rgba(34, 197, 94, .09), #131e30 35%); }
.rep-inbox-row-main { min-width: 0; }
.rep-inbox-row-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.rep-inbox-row-top > div { display: flex; min-width: 0; align-items: center; gap: .5rem; }
.rep-inbox-row-top strong { overflow: hidden; color: #f8fafc; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.rep-inbox-row.is-unread .rep-inbox-row-top strong { font-weight: 850; }
.rep-inbox-row-top time { flex: 0 0 auto; color: #64748b; font-size: .68rem; }
.rep-inbox-row.is-unread .rep-inbox-row-top time { color: #4ade80; }
.rep-new-label { padding: .14rem .38rem; border-radius: 999px; color: #bbf7d0; background: rgba(34, 197, 94, .16); font-size: .56rem; font-weight: 850; text-transform: uppercase; }
.rep-inbox-preview { overflow: hidden; margin: .25rem 0 .42rem; color: #94a3b8; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.rep-inbox-row.is-unread .rep-inbox-preview { color: #dbeafe; font-weight: 650; }
.rep-inbox-context { display: flex; flex-wrap: wrap; gap: .4rem .8rem; color: #64748b; font-size: .65rem; }
.rep-inbox-context span { display: inline-flex; align-items: center; gap: .25rem; }
.rep-inbox-context span:first-child { color: #a5b4fc; }
.rep-inbox-row-end { display: flex; align-items: center; gap: .65rem; color: #64748b; }
.rep-unread-count { display: grid; min-width: 23px; height: 23px; padding: 0 .35rem; place-items: center; border-radius: 999px; color: #052e16; background: #4ade80; font-size: .65rem; font-weight: 900; }
.rep-inbox-empty { display: grid; min-height: 260px; place-content: center; justify-items: center; padding: 2rem; color: #64748b; text-align: center; }
.rep-inbox-empty > i { margin-bottom: .6rem; font-size: 2rem; }
.rep-inbox-empty h3 { color: #cbd5e1; font-size: 1rem; }
.rep-inbox-empty p { max-width: 420px; font-size: .78rem; }

@media (max-width: 767.98px) {
    .rep-inbox-heading { align-items: flex-start; flex-direction: column; }
    .rep-inbox-stats { grid-template-columns: 1fr; }
    .rep-inbox-toolbar { align-items: stretch; flex-direction: column; }
    .rep-inbox-search { width: 100%; }
    .rep-inbox-tabs { overflow-x: auto; }
    .rep-inbox-tabs button { flex: 1 0 auto; }
    .rep-inbox-row { min-height: 96px; padding: .75rem; }
    .rep-inbox-context span:nth-child(n+2) { display: none; }
}

@media (max-width: 479.98px) {
    .wa-inbox-stat span { font-size: .66rem; }
    .wa-inbox-stat strong { font-size: 1.12rem; }
    .wa-inbox-filters { grid-template-columns: 1fr; }
    .wa-inbox-dates { grid-template-columns: 1fr 1fr; }
    .wa-inbox-dates > a { width: 100%; height: 36px; grid-column: 1 / -1; }
    .wa-inbox-context span:nth-child(3) { display: none; }
    .wa-avatar-lg { width: 46px; height: 46px; }
    .secure-wa-contact-button span { font-size: .66rem; }
    .wa-status-pill { display: none; }
    .wa-chat-contact-meta span:last-child { max-width: 124px; overflow: hidden; text-overflow: ellipsis; }
}
.live-filter-bar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .9rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(15, 23, 42, .48);
}

.live-filter-field {
    flex: 1 1 260px;
    min-width: 220px;
}

.live-filter-field.live-filter-select {
    flex: 0 1 260px;
}

.live-filter-label {
    display: block;
    margin-bottom: .35rem;
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.live-filter-input-wrap {
    position: relative;
}

.live-filter-input-wrap > i {
    position: absolute;
    top: 50%;
    left: .85rem;
    z-index: 2;
    color: var(--text-secondary);
    transform: translateY(-50%);
    pointer-events: none;
}

.live-filter-input-wrap .form-control {
    padding-left: 2.45rem;
}

.live-filter-result-count {
    flex: 0 0 auto;
    align-self: center;
    color: var(--text-secondary);
    font-size: .8rem;
}

/* Super-admin system failure log */
.system-log-page { max-width: 1540px; margin: 0 auto; }
.system-log-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 28px 30px; margin-bottom: 18px; border: 1px solid rgba(129, 140, 248, .2); border-radius: 22px; background: radial-gradient(circle at 88% 12%, rgba(244, 63, 94, .13), transparent 28%), linear-gradient(135deg, rgba(30, 41, 59, .96), rgba(15, 23, 42, .96)); box-shadow: 0 18px 55px rgba(2, 6, 23, .22); }
.system-log-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #a5b4fc; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.system-log-hero h1 { margin: 8px 0 5px; color: #f8fafc; font-size: clamp(1.75rem, 3vw, 2.55rem); font-weight: 800; letter-spacing: -.04em; }
.system-log-hero p { margin: 0; color: #94a3b8; max-width: 680px; }
.system-log-live { display: inline-flex; align-items: center; gap: 9px; color: #cbd5e1; font-size: .78rem; white-space: nowrap; }
.system-log-live span { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52, 211, 153, .12); }
.system-log-hero-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 14px; }
.system-log-hero-actions form { margin: 0; }
.system-log-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.system-log-metrics article { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 18px; border: 1px solid var(--border-color); border-radius: 17px; background: var(--bg-card); }
.system-log-metrics strong { display: block; color: var(--text-primary); font-size: 1.55rem; line-height: 1; }
.system-log-metrics span { display: block; color: var(--text-secondary); font-size: .78rem; margin-top: 5px; }
.system-log-metric-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; font-size: 1.08rem; }
.system-log-metric-icon.is-total { color: #fb7185; background: rgba(244, 63, 94, .13); }
.system-log-metric-icon.is-recent { color: #fbbf24; background: rgba(245, 158, 11, .12); }
.system-log-metric-icon.is-whatsapp { color: #34d399; background: rgba(16, 185, 129, .12); }
.system-log-metric-icon.is-clients { color: #818cf8; background: rgba(99, 102, 241, .13); }
.system-log-panel { overflow: hidden; border: 1px solid var(--border-color); border-radius: 20px; background: var(--bg-card); box-shadow: 0 16px 44px rgba(2, 6, 23, .15); }
.system-log-tabs { display: flex; gap: 3px; overflow-x: auto; padding: 10px 12px 0; border-bottom: 1px solid var(--border-color); }
.system-log-tabs a { display: inline-flex; align-items: center; gap: 8px; min-width: max-content; padding: 12px 13px 14px; border-bottom: 2px solid transparent; color: var(--text-secondary); text-decoration: none; font-size: .82rem; font-weight: 700; }
.system-log-tabs a strong { display: grid; place-items: center; min-width: 23px; height: 21px; padding: 0 6px; border-radius: 999px; background: rgba(148, 163, 184, .1); font-size: .68rem; }
.system-log-tabs a:hover, .system-log-tabs a.active { color: #c7d2fe; border-bottom-color: #818cf8; }
.system-log-tabs a.active strong { color: #e0e7ff; background: rgba(99, 102, 241, .22); }
.system-log-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto auto; align-items: end; gap: 12px; padding: 18px; background: rgba(15, 23, 42, .18); border-bottom: 1px solid var(--border-color); }
.system-log-filters label > span { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.system-log-input { position: relative; }
.system-log-input i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #64748b; }
.system-log-input input, .system-log-filters select { width: 100%; height: 43px; color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 11px; outline: none; background: var(--bg-input, rgba(15, 23, 42, .7)); }
.system-log-input input { padding: 0 14px 0 39px; }
.system-log-filters select { padding: 0 12px; }
.system-log-input input:focus, .system-log-filters select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .13); }
.system-log-filters button { height: 43px; padding: 0 17px; border: 0; border-radius: 11px; color: white; background: #6366f1; font-weight: 750; }
.system-log-clear { align-self: center; color: #a5b4fc; font-size: .8rem; text-decoration: none; }
.system-log-results-heading { display: flex; justify-content: space-between; padding: 15px 19px; color: var(--text-secondary); font-size: .78rem; border-bottom: 1px solid var(--border-color); }
.system-log-results-heading strong { color: var(--text-primary); }
.system-log-list { display: grid; }
.system-log-entry { position: relative; display: grid; grid-template-columns: 43px minmax(0, 1fr) 145px; gap: 14px; padding: 19px; border-bottom: 1px solid var(--border-color); transition: background .18s ease; }
.system-log-entry:last-child { border-bottom: 0; }
.system-log-entry:hover { background: rgba(99, 102, 241, .035); }
.system-log-entry-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fb7185; background: rgba(244, 63, 94, .12); }
.system-log-entry.category-whatsapp .system-log-entry-icon { color: #34d399; background: rgba(16, 185, 129, .12); }
.system-log-entry.category-webhook .system-log-entry-icon { color: #fbbf24; background: rgba(245, 158, 11, .12); }
.system-log-entry.category-spreadsheet .system-log-entry-icon { color: #22d3ee; background: rgba(6, 182, 212, .12); }
.system-log-entry.category-email .system-log-entry-icon { color: #a78bfa; background: rgba(139, 92, 246, .13); }
.system-log-entry.category-facebook .system-log-entry-icon { color: #60a5fa; background: rgba(37, 99, 235, .14); }
.system-log-entry-topline { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.system-log-category { color: #fda4af; font-size: .66rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.category-whatsapp .system-log-category { color: #6ee7b7; }
.category-webhook .system-log-category { color: #fcd34d; }
.category-spreadsheet .system-log-category { color: #67e8f9; }
.category-email .system-log-category { color: #c4b5fd; }
.category-facebook .system-log-category { color: #93c5fd; }
.system-log-entry time { color: #64748b; font-size: .7rem; }
.system-log-entry h2 { margin: 0 0 5px; color: var(--text-primary); font-size: .94rem; font-weight: 780; }
.system-log-entry p { margin: 0; color: var(--text-secondary); font-size: .82rem; line-height: 1.55; }
.system-log-entry details { margin-top: 9px; }
.system-log-entry summary { width: max-content; cursor: pointer; color: #a5b4fc; font-size: .73rem; }
.system-log-entry pre { max-height: 220px; overflow: auto; margin: 8px 0 0; padding: 11px; white-space: pre-wrap; word-break: break-word; color: #cbd5e1; border: 1px solid var(--border-color); border-radius: 9px; background: rgba(2, 6, 23, .42); font-size: .7rem; }
.system-log-context { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.system-log-context span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: #94a3b8; border: 1px solid rgba(148, 163, 184, .14); border-radius: 7px; background: rgba(148, 163, 184, .05); font-size: .68rem; }
.system-log-context .is-code { color: #fda4af; }
.system-log-entry-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; }
.system-log-entry-side > span { color: #64748b; font-size: .68rem; text-align: right; }
.system-log-entry-side a { color: #a5b4fc; font-size: .74rem; font-weight: 750; text-decoration: none; }
.system-log-entry-side a:hover { color: #c7d2fe; }
.system-log-empty { padding: 72px 20px; text-align: center; }
.system-log-empty i { display: block; margin-bottom: 10px; color: #34d399; font-size: 2.5rem; }
.system-log-empty h2 { margin: 0 0 6px; color: var(--text-primary); font-size: 1.1rem; }
.system-log-empty p { margin: 0; color: var(--text-secondary); font-size: .84rem; }
.system-log-pagination { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-top: 1px solid var(--border-color); }
.system-log-pagination a { color: #a5b4fc; font-size: .78rem; text-decoration: none; }
.system-log-pagination a.disabled { pointer-events: none; opacity: .35; }
.system-log-pagination span { color: var(--text-secondary); font-size: .74rem; }
@media (max-width: 1000px) { .system-log-metrics { grid-template-columns: repeat(2, 1fr); } .system-log-entry { grid-template-columns: 43px minmax(0, 1fr); } .system-log-entry-side { grid-column: 2; flex-direction: row; align-items: center; } }
@media (max-width: 700px) { .system-log-hero { align-items: flex-start; flex-direction: column; padding: 22px; } .system-log-hero-actions { align-items: flex-start; } .system-log-metrics { grid-template-columns: 1fr; } .system-log-filters { grid-template-columns: 1fr; } .system-log-filters button { width: 100%; } .system-log-entry { grid-template-columns: 36px minmax(0, 1fr); padding: 15px 12px; gap: 10px; } .system-log-entry-icon { width: 34px; height: 34px; } }

@media (max-width: 575.98px) {
    .live-filter-field,
    .live-filter-field.live-filter-select {
        flex-basis: 100%;
        min-width: 100%;
    }
}
/* How-to learning centre */
.howto-page { max-width: 1540px; margin: 0 auto; }
.howto-hero { position: relative; overflow: hidden; min-height: 245px; padding: 38px 42px 74px; border: 1px solid rgba(99,102,241,.32); border-radius: 22px; background: radial-gradient(circle at 86% 30%, rgba(56,189,248,.18), transparent 25%), linear-gradient(135deg, rgba(79,70,229,.28), rgba(17,24,39,.98) 55%); }
.howto-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 28px 28px; }
.howto-hero > div:first-child { position: relative; z-index: 1; max-width: 820px; }
.howto-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: #a5b4fc; font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.howto-hero h1 { margin: 0 0 9px; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; }
.howto-hero p { max-width: 750px; margin: 0; color: #aebbd0; font-size: 1.05rem; line-height: 1.65; }
.howto-hero-art { position: absolute; z-index: 1; right: 7%; top: 30px; display: grid; place-items: center; width: 134px; height: 134px; border: 1px solid rgba(125,211,252,.28); border-radius: 36px; color: #7dd3fc; background: rgba(15,23,42,.55); box-shadow: 0 24px 70px rgba(0,0,0,.28); transform: rotate(5deg); }
.howto-hero-art i { font-size: 4rem; transform: rotate(-5deg); }
.howto-search { position: absolute; z-index: 2; left: 42px; right: 42px; bottom: -1px; display: flex; align-items: center; gap: 12px; height: 56px; max-width: 760px; padding: 0 16px; border: 1px solid rgba(148,163,184,.24); border-bottom: 0; border-radius: 13px 13px 0 0; background: #111827; box-shadow: 0 -8px 35px rgba(0,0,0,.15); }
.howto-search > i { color: #818cf8; font-size: 1.1rem; }
.howto-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: #f8fafc; background: transparent; }
.howto-search input::placeholder { color: #718096; }
.howto-search kbd { padding: 3px 7px; border: 1px solid #344159; color: #8290a8; background: #1b2638; font-size: .68rem; }
.howto-layout { display: grid; grid-template-columns: 225px minmax(0,1fr); gap: 28px; align-items: start; }
.howto-sidebar { position: sticky; top: 18px; padding: 10px; border: 1px solid var(--border-color); border-radius: 16px; background: rgba(17,24,39,.88); }
.howto-sidebar nav { display: grid; gap: 3px; }
.howto-sidebar a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; color: #8fa0b9; font-size: .86rem; font-weight: 650; text-decoration: none; transition: .18s ease; }
.howto-sidebar a i { width: 19px; color: #64748b; font-size: 1rem; text-align: center; }
.howto-sidebar a:hover, .howto-sidebar a.active { color: #f8fafc; background: rgba(99,102,241,.14); }
.howto-sidebar a.active i { color: #818cf8; }
.howto-content { min-width: 0; }
.howto-section { scroll-margin-top: 18px; margin-bottom: 26px; padding: 30px; border: 1px solid var(--border-color); border-radius: 18px; background: linear-gradient(145deg, rgba(21,31,49,.98), rgba(17,24,39,.98)); box-shadow: 0 12px 35px rgba(0,0,0,.1); }
.howto-section-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.howto-section-heading > div { flex: 1; min-width: 0; }
.howto-section-heading > div > span { display: block; margin-bottom: 2px; color: #65728a; font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.howto-section-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.howto-section-heading p { margin: 3px 0 0; color: #8190a8; font-size: .88rem; }
.howto-section-icon { flex: 0 0 48px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; font-size: 1.3rem; }
.howto-section-icon.violet { color: #a5b4fc; background: rgba(99,102,241,.16); }
.howto-section-icon.cyan, .howto-section-icon.blue { color: #7dd3fc; background: rgba(14,165,233,.13); }
.howto-section-icon.amber { color: #fbbf24; background: rgba(245,158,11,.13); }
.howto-section-icon.green { color: #34d399; background: rgba(16,185,129,.13); }
.howto-section-icon.pink { color: #f9a8d4; background: rgba(236,72,153,.13); }
.howto-section-icon.red { color: #fb7185; background: rgba(244,63,94,.13); }
.howto-flow-map { display: grid; grid-template-columns: repeat(4,minmax(0,1fr) auto); align-items: center; gap: 12px; }
.howto-flow-map > div { min-height: 155px; padding: 20px; border: 1px solid rgba(148,163,184,.14); border-radius: 14px; background: rgba(15,23,42,.62); }
.howto-flow-map > div > i { display: block; margin-bottom: 16px; color: #818cf8; font-size: 1.5rem; }
.howto-flow-map strong, .howto-flow-map span { display: block; }
.howto-flow-map strong { margin-bottom: 7px; }
.howto-flow-map span { color: #8795ab; font-size: .8rem; line-height: 1.55; }
.howto-flow-map > i { color: #475569; }
.howto-callout { display: flex; gap: 14px; margin-top: 20px; padding: 15px 17px; border: 1px solid; border-radius: 12px; }
.howto-callout > i { margin-top: 2px; font-size: 1.05rem; }
.howto-callout strong, .howto-callout span { display: block; }
.howto-callout strong { margin-bottom: 3px; font-size: .88rem; }
.howto-callout span { color: #9aa7ba; font-size: .81rem; line-height: 1.55; }
.howto-callout.info { border-color: rgba(56,189,248,.24); color: #7dd3fc; background: rgba(14,165,233,.06); }
.howto-callout.warning { border-color: rgba(245,158,11,.25); color: #fbbf24; background: rgba(245,158,11,.06); }
.howto-callout.danger { border-color: rgba(244,63,94,.25); color: #fb7185; background: rgba(244,63,94,.06); }
.howto-steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.howto-steps article { display: flex; gap: 14px; padding: 18px; border: 1px solid rgba(148,163,184,.13); border-radius: 13px; background: rgba(15,23,42,.55); }
.howto-steps article b { flex: 0 0 30px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #c7d2fe; background: rgba(99,102,241,.2); font-size: .78rem; }
.howto-steps h3, .howto-card-grid h3, .howto-checklist h3 { margin: 2px 0 6px; font-size: .96rem; }
.howto-steps p, .howto-card-grid p { margin: 0; color: #8d9ab0; font-size: .81rem; line-height: 1.6; }
.howto-steps.compact { grid-template-columns: 1fr; }
.howto-steps.compact article { padding: 14px 16px; }
.howto-checklist { height: 100%; padding: 22px; border: 1px solid rgba(52,211,153,.2); border-radius: 14px; background: rgba(16,185,129,.055); }
.howto-checklist h3 { margin-bottom: 17px; color: #6ee7b7; }
.howto-checklist label { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(148,163,184,.1); color: #aab5c6; font-size: .82rem; }
.howto-checklist label i { color: #34d399; }
.howto-wizard-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.howto-wizard-grid article { position: relative; padding: 20px; border: 1px solid rgba(148,163,184,.14); border-radius: 14px; background: rgba(15,23,42,.6); }
.howto-wizard-grid article > span { color: #718096; font-size: .67rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.howto-wizard-grid article > i { display: block; margin: 24px 0 14px; color: #fbbf24; font-size: 1.5rem; }
.howto-wizard-grid h3 { font-size: .95rem; }
.howto-wizard-grid p { margin: 0; color: #8795ab; font-size: .78rem; line-height: 1.55; }
.howto-code-tip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 18px; padding: 20px; border: 1px solid rgba(251,191,36,.2); border-radius: 13px; background: rgba(245,158,11,.05); }
.howto-code-tip > div { color: #fbbf24; }
.howto-code-tip > div i { margin-right: 8px; }
.howto-code-tip p { color: #9ba7b8; font-size: .83rem; line-height: 1.6; }
.howto-code-tip pre { grid-column: 2; grid-row: 1 / span 2; margin: 0; padding: 14px; border-radius: 9px; color: #a7f3d0; background: #090f1c; font-size: .76rem; }
.howto-output-table { border: 1px solid rgba(148,163,184,.13); border-radius: 13px; }
.howto-output-table .table { --bs-table-bg: transparent; --bs-table-color: #a6b1c2; --bs-table-border-color: rgba(148,163,184,.11); }
.howto-output-table th { padding: 13px 15px; color: #728097; background: rgba(15,23,42,.68); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.howto-output-table td { padding: 15px; font-size: .79rem; line-height: 1.5; }
.howto-output-table td:first-child { min-width: 170px; color: #edf2f7; }
.output-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 8px; }
.output-icon.webhook { color: #a5b4fc; background: rgba(99,102,241,.14); }.output-icon.sheet { color: #34d399; background: rgba(16,185,129,.13); }.output-icon.customer { color: #7dd3fc; background: rgba(14,165,233,.13); }.output-icon.business { color: #fbbf24; background: rgba(245,158,11,.13); }.output-icon.whatsapp { color: #4ade80; background: rgba(34,197,94,.13); }.output-icon.rep { color: #f9a8d4; background: rgba(236,72,153,.13); }
.howto-card-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.howto-card-grid article { padding: 20px; border: 1px solid rgba(148,163,184,.13); border-radius: 13px; background: rgba(15,23,42,.55); }
.howto-card-grid article > i { color: #34d399; font-size: 1.35rem; }
.howto-card-grid h3 { margin-top: 16px; }
.howto-accordion .accordion-item { overflow: hidden; border: 1px solid rgba(148,163,184,.13); color: #9aa7ba; background: rgba(15,23,42,.5); }
.howto-accordion .accordion-button { color: #e5e7eb; background: rgba(19,29,47,.96); box-shadow: none; font-size: .88rem; font-weight: 650; }
.howto-accordion .accordion-button:not(.collapsed) { color: #a5b4fc; background: rgba(99,102,241,.11); }
.howto-accordion .accordion-button::after { filter: invert(1) opacity(.6); }
.howto-accordion .accordion-body { color: #9aa7ba; font-size: .83rem; line-height: 1.7; }
.howto-empty { padding: 70px 20px; text-align: center; }
.howto-empty i { color: #64748b; font-size: 2.5rem; }.howto-empty h2 { margin: 15px 0 5px; }.howto-empty p { color: #7b879b; }
@media (max-width: 1199.98px) { .howto-layout { grid-template-columns: 1fr; }.howto-sidebar { position: static; overflow-x: auto; padding: 7px; }.howto-sidebar nav { display: flex; min-width: max-content; }.howto-sidebar a { padding: 9px 12px; }.howto-wizard-grid, .howto-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 767.98px) { .howto-hero { padding: 28px 22px 72px; }.howto-hero-art { display: none; }.howto-search { left: 20px; right: 20px; }.howto-section { padding: 21px 16px; }.howto-section-heading { align-items: flex-start; flex-wrap: wrap; }.howto-section-heading .btn { width: 100%; }.howto-flow-map, .howto-steps, .howto-wizard-grid, .howto-card-grid { grid-template-columns: 1fr; }.howto-flow-map > i { transform: rotate(90deg); justify-self: center; }.howto-code-tip { grid-template-columns: 1fr; }.howto-code-tip pre { grid-column: 1; grid-row: auto; }.howto-output-table { border-radius: 9px; } }

/* Client lead-sheet gallery */
.client-flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.client-flow-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 355px; border: 1px solid rgba(99,102,241,.24); border-radius: 18px; background: radial-gradient(circle at 100% 0, rgba(16,185,129,.09), transparent 34%), linear-gradient(145deg, #172136, #111827); box-shadow: 0 18px 42px rgba(0,0,0,.14); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.client-flow-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,.48); box-shadow: 0 22px 48px rgba(0,0,0,.22); }
.client-flow-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .38; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 24px 24px; }
.client-flow-card-top, .client-flow-card-body, .client-flow-card-actions { position: relative; z-index: 1; }
.client-flow-card-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 0; }
.client-flow-symbol { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 13px; color: #6ee7b7; background: rgba(16,185,129,.13); font-size: 1.35rem; }
.client-flow-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid rgba(16,185,129,.22); border-radius: 999px; color: #6ee7b7; background: rgba(16,185,129,.08); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.client-flow-status i { font-size: .44rem; }
.client-flow-card-body { flex: 1; padding: 28px 22px 22px; }
.client-flow-label { color: #6f7e96; font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.client-flow-card-body h2 { margin: 6px 0 8px; font-size: 1.35rem; letter-spacing: -.025em; }
.client-flow-card-body > p { display: -webkit-box; overflow: hidden; margin: 0; color: #8795aa; font-size: .82rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.client-flow-count { display: flex; align-items: baseline; gap: 8px; margin-top: 26px; }
.client-flow-count strong { color: #f8fafc; font-size: 1.7rem; letter-spacing: -.04em; }
.client-flow-count span { color: #74839a; font-size: .76rem; }
.client-flow-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 16px 18px 18px; border-top: 1px solid rgba(148,163,184,.11); background: rgba(8,15,28,.28); }
.client-flow-card-actions .btn, .client-flow-card-actions form, .client-flow-card-actions form .btn { width: 100%; }
.client-flow-card-actions .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-size: .8rem; }
.client-flow-note { display: flex; align-items: flex-start; gap: 10px; max-width: 760px; margin-top: 18px; color: #7f8ca1; font-size: .78rem; line-height: 1.55; }
.client-flow-note i { margin-top: 2px; color: #60a5fa; }
.client-flow-empty { padding: 80px 24px; border: 1px dashed rgba(148,163,184,.22); border-radius: 18px; text-align: center; background: rgba(15,23,42,.38); }
.client-flow-empty > span { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 18px; color: #64748b; background: rgba(100,116,139,.1); font-size: 1.8rem; }
.client-flow-empty h2 { margin-bottom: 8px; font-size: 1.25rem; }.client-flow-empty p { max-width: 500px; margin: 0 auto; color: #78869b; font-size: .86rem; }
@media (max-width: 575.98px) { .client-flow-grid { grid-template-columns: 1fr; }.client-flow-card-actions { grid-template-columns: 1fr; } }

/* Compact AI email writer used by both customer and business email outputs. */
.email-ai-assistant { padding: 15px; border: 1px solid rgba(139,92,246,.32); border-radius: 12px; background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(139,92,246,.07)); }
.email-ai-assistant-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.email-ai-assistant-heading > span { color: #ddd6fe; font-size: .84rem; font-weight: 700; }.email-ai-assistant-heading > span i { margin-right: 6px; color: #a78bfa; }
.email-ai-assistant-heading small { padding: 3px 7px; border: 1px solid rgba(167,139,250,.28); border-radius: 999px; color: #c4b5fd; background: rgba(124,58,237,.12); font-size: .57rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.email-ai-assistant textarea { min-height: 62px; resize: vertical; font-size: .82rem; }
.email-ai-assistant-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.email-ai-generate { border: 1px solid rgba(167,139,250,.35); color: #fff; background: linear-gradient(135deg, #4f46e5, #9333ea); font-size: .78rem; font-weight: 700; }
.email-ai-generate:hover, .email-ai-generate:focus { border-color: rgba(196,181,253,.72); color: #fff; filter: brightness(1.08); }
.email-ai-generate:disabled { opacity: .7; }
.email-ai-status { color: #94a3b8; font-size: .72rem; }.email-ai-status.is-success { color: #6ee7b7; }.email-ai-status.is-error { color: #fda4af; }

/* Super-admin lead processing statistics */
.lead-stats-page { max-width: 1620px; margin: 0 auto; padding-bottom: 38px; }
.lead-stats-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 18px; padding: 30px 34px; border: 1px solid rgba(99,102,241,.25); border-radius: 19px; background: radial-gradient(circle at 86% 15%, rgba(99,102,241,.16), transparent 29%), linear-gradient(145deg, rgba(21,31,52,.98), rgba(11,19,34,.98)); }
.lead-stats-hero::after { content: ""; position: absolute; right: -70px; bottom: -110px; width: 280px; height: 280px; border: 45px solid rgba(45,212,191,.035); border-radius: 50%; }
.lead-stats-eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 11px; color: #a5b4fc; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.lead-stats-hero h1 { margin: 0; font-size: clamp(1.8rem,3vw,2.7rem); letter-spacing: -.045em; }
.lead-stats-hero p { margin: 8px 0 0; color: #8593aa; font-size: .88rem; }.lead-stats-hero p strong { color: #dbe4f0; }
.lead-stats-range-summary { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; min-width: 320px; padding: 15px 18px; border: 1px solid rgba(148,163,184,.16); border-radius: 13px; background: rgba(8,15,28,.55); }
.lead-stats-range-summary > i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #67e8f9; background: rgba(6,182,212,.11); }
.lead-stats-range-summary div { display: flex; flex-direction: column; gap: 3px; }.lead-stats-range-summary span { color: #67758d; font-size: .64rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }.lead-stats-range-summary strong { color: #cbd5e1; font-size: .76rem; font-weight: 650; }
.lead-stats-filter-panel { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 17px 20px; border: 1px solid rgba(148,163,184,.14); border-radius: 15px; background: rgba(17,27,46,.82); }
.lead-stats-filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }.lead-stats-filter-form label { display: flex; flex-direction: column; gap: 6px; }.lead-stats-filter-form label > span { color: #75839a; font-size: .65rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.lead-stats-filter-form input { min-height: 40px; padding: 8px 11px; border: 1px solid #33445f; border-radius: 9px; color: #e2e8f0; color-scheme: dark; background: #111c30; font-size: .8rem; }
.lead-stats-filter-form button, .lead-stats-today { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 15px; border-radius: 9px; font-size: .78rem; font-weight: 700; text-decoration: none; }
.lead-stats-filter-form button { border: 1px solid #6366f1; color: #fff; background: linear-gradient(135deg,#4f46e5,#7c3aed); }.lead-stats-today { border: 1px solid rgba(148,163,184,.2); color: #cbd5e1; background: rgba(30,41,59,.7); }
.lead-stats-filter-note { max-width: 575px; color: #718097; font-size: .74rem; line-height: 1.5; }.lead-stats-filter-note i { margin-right: 6px; color: #38bdf8; }.lead-stats-filter-note strong { color: #aebbd0; }
.lead-stats-primary-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.lead-stats-primary-metrics article { display: flex; align-items: center; gap: 15px; min-height: 122px; padding: 20px; border: 1px solid rgba(148,163,184,.14); border-radius: 15px; background: linear-gradient(145deg,rgba(21,31,51,.96),rgba(15,24,41,.96)); }
.lead-stats-metric-icon { display: grid; flex: 0 0 46px; place-items: center; width: 46px; height: 46px; border-radius: 13px; font-size: 1.25rem; }.is-leads .lead-stats-metric-icon { color: #93c5fd; background: rgba(59,130,246,.13); }.is-success .lead-stats-metric-icon { color: #6ee7b7; background: rgba(16,185,129,.13); }.is-pending .lead-stats-metric-icon { color: #fcd34d; background: rgba(245,158,11,.13); }.is-failure .lead-stats-metric-icon { color: #fda4af; background: rgba(244,63,94,.13); }
.lead-stats-primary-metrics article > div:last-child { display: flex; flex-direction: column; }.lead-stats-primary-metrics span { color: #7e8ca2; font-size: .68rem; font-weight: 700; text-transform: uppercase; }.lead-stats-primary-metrics strong { margin: 2px 0; color: #f8fafc; font-size: 1.75rem; letter-spacing: -.04em; }.lead-stats-primary-metrics small { color: #69768b; font-size: .67rem; }
.lead-stats-section { margin-bottom: 18px; padding: 22px; border: 1px solid rgba(148,163,184,.14); border-radius: 16px; background: rgba(17,27,46,.76); }
.lead-stats-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }.lead-stats-section-heading span { color: #818cf8; font-size: .63rem; font-weight: 850; letter-spacing: .11em; }.lead-stats-section-heading h2 { margin: 3px 0 0; font-size: 1.08rem; }.lead-stats-section-heading > strong { color: #74839a; font-size: .72rem; font-weight: 600; }
.lead-stats-channel-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.lead-stats-channel-card { padding: 18px; border: 1px solid rgba(148,163,184,.13); border-radius: 14px; background: rgba(9,17,31,.58); }.lead-stats-channel-top { display: flex; align-items: center; justify-content: space-between; }.lead-stats-channel-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; font-size: 1.05rem; }.is-email .lead-stats-channel-icon { color: #7dd3fc; background: rgba(14,165,233,.12); }.is-whatsapp .lead-stats-channel-icon { color: #4ade80; background: rgba(34,197,94,.12); }.is-webhook .lead-stats-channel-icon { color: #c4b5fd; background: rgba(139,92,246,.13); }.is-excel .lead-stats-channel-icon { color: #6ee7b7; background: rgba(16,185,129,.12); }
.lead-stats-channel-rate { color: #76849a; font-size: .64rem; font-weight: 700; }.lead-stats-channel-card h3 { margin: 16px 0 12px; font-size: .9rem; }.lead-stats-channel-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.lead-stats-channel-numbers div { display: flex; flex-direction: column; }.lead-stats-channel-numbers strong { font-size: 1.2rem; }.lead-stats-channel-numbers div:first-child strong { color: #a7f3d0; }.lead-stats-channel-numbers div:last-child strong { color: #fda4af; }.lead-stats-channel-numbers span { color: #64748b; font-size: .63rem; }
.lead-stats-channel-track { overflow: hidden; height: 4px; margin-top: 14px; border-radius: 99px; background: rgba(148,163,184,.12); }.lead-stats-channel-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#22c55e,#2dd4bf); }
.lead-stats-failure-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; align-items: center; gap: 12px; }.lead-stats-failure-strip > div { display: flex; flex-direction: column; gap: 4px; padding-right: 14px; border-right: 1px solid rgba(148,163,184,.12); }.lead-stats-failure-strip span { color: #7b899f; font-size: .68rem; }.lead-stats-failure-strip span i { margin-right: 5px; color: #fb7185; }.lead-stats-failure-strip strong { font-size: 1.25rem; }.lead-stats-failure-strip a { color: #a5b4fc; font-size: .75rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.lead-stats-table-panel { overflow: hidden; padding: 0; }.lead-stats-table-panel .lead-stats-section-heading { padding: 22px 22px 0; }.lead-stats-table { --bs-table-bg: transparent; --bs-table-color: #9aa8bb; --bs-table-border-color: rgba(148,163,184,.1); }.lead-stats-table th { padding: 12px 18px; color: #66758b; background: rgba(8,15,28,.36); font-size: .64rem; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }.lead-stats-table td { padding: 14px 18px; font-size: .78rem; }.lead-stats-table td:first-child { display: flex; align-items: center; gap: 10px; color: #e2e8f0; white-space: nowrap; }.lead-stats-company-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #c7d2fe; background: rgba(99,102,241,.13); font-size: .72rem; }.lead-stats-good { color: #6ee7b7; }.lead-stats-bad { color: #fda4af; font-weight: 750; }
.lead-stats-client-row { cursor: pointer; transition: background-color .16s ease; }.lead-stats-client-row:hover td,.lead-stats-client-row:focus td { background: rgba(99,102,241,.07); }.lead-stats-client-row:focus { outline: 2px solid rgba(129,140,248,.6); outline-offset: -2px; }.lead-stats-company-name { display: flex; min-width: 0; flex-direction: column; }.lead-stats-company-name small { margin-top: 2px; color: #64748b; font-size: .65rem; font-weight: 500; }.lead-stats-row-arrow { margin-left: auto; color: #64748b; }
.lead-stats-flow-modal .modal-dialog { max-width: 1180px; }.lead-stats-flow-modal .modal-content { border-color: rgba(99,102,241,.34); }.lead-stats-flow-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }.lead-stats-flow-summary>div { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid rgba(148,163,184,.13); border-radius: 11px; background: rgba(8,15,28,.42); }.lead-stats-flow-summary span { color: #718096; font-size: .67rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }.lead-stats-flow-summary strong { margin-top: 3px; color: #f8fafc; font-size: 1.25rem; }.lead-stats-flow-table-wrap { overflow: hidden; border: 1px solid rgba(148,163,184,.13); border-radius: 12px; }.lead-stats-flow-table td:first-child { min-width: 260px; }.lead-stats-flow-table td:first-child>span:last-child { display: flex; min-width: 0; flex-direction: column; }.lead-stats-flow-table td:first-child small { margin-top: 2px; color: #64748b; font-size: .65rem; }.lead-stats-flow-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 8px; color: #a5b4fc; background: rgba(99,102,241,.12); }
.lead-stats-empty { padding: 65px 20px; text-align: center; }.lead-stats-empty > i { color: #536278; font-size: 2rem; }.lead-stats-empty h3 { margin: 13px 0 5px; font-size: 1rem; }.lead-stats-empty p { margin: 0; color: #6f7e93; font-size: .78rem; }
@media (max-width: 1199.98px) { .lead-stats-primary-metrics, .lead-stats-channel-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.lead-stats-failure-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }.lead-stats-failure-strip a { grid-column: 1 / -1; } }
@media (max-width: 767.98px) { .lead-stats-hero, .lead-stats-filter-panel { align-items: stretch; flex-direction: column; }.lead-stats-range-summary { min-width: 0; }.lead-stats-filter-note { max-width: none; }.lead-stats-primary-metrics, .lead-stats-channel-grid, .lead-stats-failure-strip { grid-template-columns: 1fr; }.lead-stats-failure-strip a { grid-column: auto; }.lead-stats-section-heading { align-items: flex-start; flex-direction: column; }.lead-stats-filter-form label { flex: 1 1 135px; }.lead-stats-filter-form input { width: 100%; }.lead-stats-flow-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } }
