/* --- Brand color — overridden at runtime by setBrandColor() --- */
:root {
    --brand-color: #D4A03A;
    --brand-color-rgb: 212, 160, 58;
}

/* --- WORDPRESS OVERRIDES (Hides WP Header/Footer) --- */
header#masthead, 
header.site-header, 
footer#colophon, 
footer.site-footer, 
.elementor-location-header, 
.elementor-location-footer,
#wpadminbar { 
    display: none !important; 
}

/* --- PREMIUM WATER GLASS NOTICE --- */
.reaction-notice-popover {
    position: fixed;
    z-index: 1000001; /* Above almost everything */
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 12px 16px;
    width: 240px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    color: #eee;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: auto;
    display: none; /* Controlled by JS */
    animation: noticeFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.reaction-notice-popover::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(255, 255, 255, 0.15);
}

@keyframes noticeFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#reaction-notice-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 1000000;
    display: none;
}

/* --- PREMIUM COMING SOON OVERLAY --- */
.chat-coming-soon-overlay {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: inherit;
    animation: fadeIn 0.5s ease;
}

.chat-cs-card {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 320px;
    transform: translateY(0);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-cs-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0084FF, #00c6ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.3);
}

.chat-cs-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.chat-cs-text {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 25px;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- PREMIUM DESKTOP LASER OUTLINE --- */
@keyframes rdv-laser-pulse {
    0% { box-shadow: 0 0 0 0px rgba(34, 197, 94, 0.8); }
    100% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

.rdv-laser-focus {
    outline: 2px solid #22c55e !important;
    outline-offset: -2px;
    background: rgba(34, 197, 94, 0.1) !important;
    animation: rdv-laser-pulse 0.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    z-index: 5;
    position: relative;
}

/* Force body to fill screen and remove WP spacing */
html { margin-top: 0 !important; height: 100%; overflow: hidden; }
body { 
    margin: 0 !important; 
    padding: 0 !important; 
    background: #000 !important; 
    color: #fff; 
    font-family: 'Montserrat', sans-serif; 
    overflow: hidden !important; 
    height: 100% !important; 
    width: 100% !important; 
    position: absolute; 
    top: 0;
    left: 0;
    z-index: 9999; 
    overflow-x: hidden !important; 
}
* { box-sizing: border-box; }

/* --- PREMIUM ATTENTION SHAKE --- */
@keyframes card-attention-nudge {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.attention-shake {
    animation: card-attention-nudge 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: rgba(34, 197, 94, 0.5) !important; /* Temporarily highlight green */
    background: rgba(34, 197, 94, 0.05) !important;
}

/* --- CUSTOM SCROLLBARS --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* --- LOGIN SCREEN --- */
#login-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 999999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.login-card {
    width: 380px; padding: 40px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    text-align: center;
}
@media(max-width: 480px) { .login-card { width: 90%; padding: 30px 20px; } }

.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } }

.login-logo { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; }
.login-subtitle { font-size: 13px; color: #666; margin-bottom: 30px; font-weight: 500; }
.login-input-group { margin-bottom: 15px; width: 100%; text-align: left; }
.login-label { font-size: 11px; font-weight: 700; color: #555; margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.login-input {
    width: 100%; background: #0a0a0a; border: 1px solid #222; color: #fff;
    padding: 12px 15px; border-radius: 8px; font-family: 'Montserrat', sans-serif;
    font-size: 14px; outline: none; transition: all 0.2s;
}
.login-input:focus { border-color: #444; background: #111; }
.btn-login {
    width: 100%; margin-top: 10px; background: #fff; color: #000;
    font-weight: 700; font-size: 14px; padding: 14px; border-radius: 8px; border: none;
    cursor: pointer; transition: transform 0.1s, opacity 0.2s;
}
.btn-login:hover { opacity: 0.9; }
.btn-login:active { transform: scale(0.98); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error {
    width: 100%; padding: 10px 14px; margin-bottom: 4px;
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25);
    border-radius: 8px; color: #f87171; font-size: 12px; font-weight: 500;
    text-align: center; line-height: 1.5; box-sizing: border-box;
}
body.light-mode .login-error {
    background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.3); color: #dc2626;
}

/* --- DASHBOARD WRAPPER --- */
.dashboard-wrapper {
    display: none; background-color: #000; width: 100%; height: 100vh; 
    grid-template-columns: 260px 1fr; overflow: hidden;
}

/* --- SIDEBAR (DESKTOP) --- */
.sidebar { background: #0a0a0a; border-right: 1px solid #1a1a1a; display: flex; flex-direction: column; padding: 16px; height: 100%; z-index: 2; box-sizing: border-box; width: 100%; overflow-y: auto; }
.logo-area { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 20px; padding-left: 10px; letter-spacing: -0.5px; flex-shrink: 0; }
.account-switcher { display: flex; align-items: center; gap: 10px; padding: 10px; background: #151515; border: 1px solid #222; border-radius: 8px; margin-bottom: 25px; cursor: pointer; flex-shrink: 0; }
.switcher-avatar { width: 36px; height: 36px; background: #333; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.switcher-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.switcher-name { font-size: 13px; font-weight: 700; color: #fff; white-space: normal; line-height: 1.3; }
.switcher-role { font-size: 11px; color: #666; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.switcher-badge { background: #222; padding: 1px 4px; border-radius: 3px; font-size: 9px; border: 1px solid #333; }
.nav-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; position: relative; }
.nav-item { padding: 12px 14px; border-radius: 6px; cursor: pointer; color: #999; font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 12px; transition: all 0.1s; flex-shrink: 0; }
.nav-item i { font-size: 20px; transition: color 0.2s; }
.nav-item:hover { background: #1a1a1a; color: #fff; }
.nav-item.active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* The sliding pill — absolutely positioned inside .nav-menu */
#nav-slider {
    position: absolute;
    left: 0;
    width: 100%;
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    pointer-events: none;
    z-index: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.sidebar-footer { border-top: 1px solid #1a1a1a; padding-top: 15px; margin-top: 15px; display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

/* --- MOBILE BOTTOM NAV (kept for legacy, hidden on mobile) --- */
.mobile-bottom-nav { display: none !important; }

/* ============================================================
   MOBILE TOP BAR (Gemini-style)
   ============================================================ */
.mobile-top-bar {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%;
    height: 56px;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    z-index: 1001;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
}

.mobile-hamburger {
    width: 40px; height: 40px;
    background: transparent; border: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; cursor: pointer; padding: 8px; border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.mobile-hamburger:active { background: rgba(255,255,255,0.08); }
.mobile-hamburger span {
    display: block; width: 20px; height: 2px;
    background: #fff; border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-top-logo {
    font-size: 18px; font-weight: 800; color: #fff;
    letter-spacing: -0.5px;
    position: absolute; left: 50%; transform: translateX(-50%);
    pointer-events: none;
}

.mobile-top-spacer { width: 40px; flex-shrink: 0; }

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.mobile-drawer-backdrop {
    display: none;
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-drawer-backdrop.open {
    display: block; opacity: 1;
}

.mobile-drawer {
    position: fixed; top: 0; left: 0;
    width: 88vw; max-width: 360px;
    /* Use dvh so the drawer stops exactly at the visual viewport bottom, not under the browser bar */
    height: 100vh;
    height: 100dvh;
    background: #0a0a0a;
    border-right: 1px solid rgba(255,255,255,0.08);
    z-index: 10001;
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    box-shadow: none;
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
    overflow: hidden;
}
.mobile-drawer.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.7);
}

.mobile-drawer-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.mobile-drawer-logo {
    font-size: 22px; font-weight: 800; color: #fff;
    letter-spacing: -0.5px; margin-bottom: 16px;
}
.mobile-drawer-account {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: #151515;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}
.mobile-drawer-avatar {
    width: 38px; height: 38px; background: #333;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: 700; color: #fff;
    font-size: 15px; flex-shrink: 0;
}
.mobile-drawer-user-info { flex: 1; min-width: 0; }
.mobile-drawer-username {
    font-size: 13px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-drawer-role {
    font-size: 11px; color: #666;
    display: flex; align-items: center; gap: 4px; margin-top: 3px;
}

.mobile-drawer-nav {
    list-style: none; padding: 10px 10px 0; margin: 0;
    flex: 1; overflow-y: auto; min-height: 0;
    display: flex; flex-direction: column; gap: 2px;
}

.mobile-drawer-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 14px; border-radius: 12px;
    cursor: pointer; color: #888; font-weight: 600;
    font-size: 14px; font-family: 'Montserrat', sans-serif;
    transition: all 0.15s ease;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.mobile-drawer-item i { font-size: 20px; flex-shrink: 0; }
.mobile-drawer-item:hover { background: #161616; color: #fff; }
.mobile-drawer-item:active { background: #1e1e1e; transform: scale(0.99); }
.mobile-drawer-item.active {
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; font-weight: 700;
}

.mobile-drawer-footer {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    flex-shrink: 0;
}

/* --- MAIN CONTENT --- */
.main-content { display: flex; flex-direction: column; background: #000; position: relative; width: 100%; height: 100%; overflow: hidden; }
.top-header { height: 60px; border-bottom: 1px solid #1a1a1a; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 25px; background: #0a0a0a; width: 100%; box-sizing: border-box; }
.page-title { font-size: 18px; font-weight: 700; }

/* --- STATUS BADGES & POPOVER --- */
.status-badge { display: flex; align-items: center; gap: 6px; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.2); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; color: #22c55e; letter-spacing: 0.5px; }
.status-dot { width: 6px; height: 6px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 5px rgba(34, 197, 94, 0.5); }

.crm-badge {
    padding: 5px 10px; display: inline-flex; align-items: center; justify-content: center;
    min-width: 162px; width: 162px; box-sizing: border-box;
    border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: capitalize; letter-spacing: 0.3px;
    white-space: nowrap; line-height: normal; flex-shrink: 0;
}
.crm-badge.actionable { cursor: pointer; transition: all 0.2s ease; position: relative; user-select: none; }
.crm-badge.actionable:hover { transform: translateY(-1px); filter: brightness(1.2); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* Chip badges — background + border pill */
.badge-blue   { background: rgba(59, 130, 246, 0.15);  color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-red    { background: rgba(239, 68, 68, 0.15);   color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-green  { background: rgba(34, 197, 94, 0.15);   color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); box-shadow: 0 0 8px rgba(34, 197, 94, 0.1); }
.badge-amber  { background: rgba(245, 158, 11, 0.15);  color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-orange { background: rgba(249, 115, 22, 0.15);  color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-cyan   { background: rgba(6, 182, 212, 0.15);   color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-muted  { background: rgba(75, 85, 99, 0.15);    color: #9ca3af; border: 1px solid rgba(75, 85, 99, 0.3); }
.badge-glass  { background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); color: #bbb; }

/* Plain text badge — New Inquiry: no chip, just blue text */
.badge-grey { background: transparent; border: 1px solid transparent; color: #22c55e; font-weight: 700; }

.status-popover {
    position: fixed; z-index: 999999; background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8); display: none; flex-direction: column;
    min-width: 180px; overflow: hidden; animation: fadeIn 0.1s ease-out;
}
.status-popover.active { display: flex; }
.status-option {
    padding: 12px 16px; font-size: 12px; font-weight: 500; color: #ccc;
    cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.1s; display: flex; align-items: center; gap: 8px;
}
.status-option:last-child { border-bottom: none; }
.status-option:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.status-dot-mini { width: 6px; height: 6px; border-radius: 50%; }

.view-section { display: none; flex: 1; width: 100%; overflow-y: auto; }
.view-section.active-view {
    display: flex;
    flex-direction: column;
    animation: viewEnter 0.2s ease;
}

@keyframes viewEnter {
    from { opacity: 0; transform: translateX(6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* --- PREMIUM REVENUE MODAL --- */
.revenue-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 9999999; display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.revenue-modal-overlay.active { display: flex; opacity: 1; }
.revenue-modal-card {
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px; /* Reduced padding for sleeker look */
    width: 380px; max-width: 90%; 
    max-height: 90vh; overflow-y: auto; /* Prevents stretching off-screen */
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.revenue-modal-overlay.active .revenue-modal-card { transform: scale(1); }

.rev-modal-icon {
    width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 15px auto;
    background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6; font-size: 24px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}
.revenue-modal-card h3 { margin: 0 0 15px 0; color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }

/* The Sleek Micro-Copy Box */
.rev-info-box {
    display: flex; flex-direction: column; gap: 8px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px; padding: 12px 15px; margin-bottom: 20px; text-align: left;
}
.rev-info-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #aaa; font-weight: 500; }
.rev-info-item i { font-size: 16px; flex-shrink: 0; }

.rev-input-group { text-align: left; margin-bottom: 15px; }
.rev-input-group label { display: block; font-size: 10px; font-weight: 700; color: #777; text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.5px; }
.rev-input-group input {
    width: 100%; background: #0a0a0a; border: 1px solid #222; color: #fff;
    padding: 12px 15px; border-radius: 8px; font-family: 'Montserrat', sans-serif;
    font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; font-weight: 600;
}
.rev-input-group input:focus { border-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.15); background: #111; }

.rev-modal-actions { display: flex; gap: 10px; margin-top: 25px; }
.btn-rev-skip { flex: 1; background: transparent; border: 1px solid #333; color: #999; padding: 12px; border-radius: 8px; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.btn-rev-skip:hover { background: rgba(255,255,255,0.05); color: #fff; }
.btn-rev-save { flex: 2; background: #3b82f6; border: none; color: #fff; padding: 12px; border-radius: 8px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); }
.btn-rev-save:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4); }

/* Mobile Specific Tweaks for the Modal */
@media (max-width: 600px) {
    .revenue-modal-card { padding: 20px 20px 25px 20px; width: 92%; }
    .rev-modal-icon { width: 40px; height: 40px; font-size: 20px; margin-bottom: 12px; }
    .revenue-modal-card h3 { font-size: 18px; margin-bottom: 12px; }
    .rev-info-box { padding: 10px 12px; margin-bottom: 15px; }
    .rev-input-group { margin-bottom: 12px; }
    .rev-input-group input { padding: 10px 12px; font-size: 16px; /* 16px prevents iOS auto-zoom */ }
    .rev-modal-actions { margin-top: 20px; }
}

/* --- PREMIUM COMING SOON HOME VIEW & AI --- */
.home-premium-wrapper { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; background: #050505; }
.mock-dashboard { padding: 25px; display: flex; flex-direction: column; gap: 15px; width: 100%; height: 100%; overflow-y: auto; transition: filter 0.5s ease; }
.mock-top-bar { display: flex; gap: 15px; flex-wrap: wrap; }
.mock-top-card { background: #111; border: 1px solid #222; border-radius: 8px; padding: 12px 20px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #aaa; flex: 1; min-width: 150px; }
.mock-top-card.accent { color: #ef4444; font-weight: 600; font-size: 16px; }
.mock-main-grid { display: grid; grid-template-columns: 1fr 300px 300px; gap: 15px; }
@media(max-width: 1200px) { .mock-main-grid { grid-template-columns: 1fr 1fr; } }
@media(max-width: 900px) { .mock-main-grid { grid-template-columns: 1fr; } }
.mock-panel { background: #111; border: 1px solid #222; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.mock-panel-title { font-size: 12px; color: #888; margin-bottom: 15px; font-weight: 500; }
.mock-funnel { display: flex; align-items: center; justify-content: space-between; background: #151515; border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.mock-funnel-item { text-align: center; }
.mock-funnel-val { font-size: 24px; font-weight: 700; color: #fff; }
.mock-funnel-label { font-size: 11px; color: #666; }
.mock-funnel-divider { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #333; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #aaa; }
.mock-chart-area { height: 150px; width: 100%; border-bottom: 1px solid #333; border-left: 1px solid #333; position: relative; display: flex; align-items: flex-end; }
.mock-line { width: 100%; height: 100%; }
.mock-line polyline { fill: none; stroke: #06b6d4; stroke-width: 2; vector-effect: non-scaling-stroke; }
.mock-rev-list { display: flex; flex-direction: column; gap: 10px; }
.mock-rev-item { background: #151515; padding: 12px 15px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.mock-rev-label { color: #888; }
.mock-rev-val { color: #fff; font-weight: 600; }
.mock-donut-container { display: flex; justify-content: center; align-items: center; flex: 1; position: relative; }
.mock-donut { width: 180px; height: 180px; border-radius: 50%; background: conic-gradient(#4ade80 0% 30%, #3b82f6 30% 50%, #06b6d4 50% 80%, #6366f1 80% 100%); display: flex; align-items: center; justify-content: center; }
.mock-donut-inner { width: 100px; height: 100px; background: #111; border-radius: 50%; }
.mock-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
@media(max-width: 900px) { .mock-bottom-grid { grid-template-columns: 1fr; } }
.mock-bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; margin-top: auto; border-bottom: 1px solid #333; padding-bottom: 10px; }
.mock-bar { flex: 1; background: #06b6d4; border-radius: 2px 2px 0 0; min-height: 10%; }
.mock-ai-dashboard { padding: 25px; display: flex; flex-direction: column; gap: 15px; width: 100%; height: 100%; transition: filter 0.5s ease; }
.mock-ai-header { display: flex; gap: 15px; flex-wrap: wrap; }
.mock-ai-stat { background: #111; border: 1px solid #222; border-radius: 8px; padding: 15px 20px; flex: 1; color: #aaa; font-size: 13px; font-weight: 500; min-width: 150px; }
.mock-ai-chat-area { background: #111; border: 1px solid #222; border-radius: 12px; flex: 1; padding: 25px; display: flex; flex-direction: column; gap: 15px; }
.mock-ai-bubble { padding: 14px 18px; border-radius: 12px; max-width: 60%; font-size: 14px; line-height: 1.5; }
.mock-ai-bubble.left { background: #1a1a1a; color: #ccc; align-self: flex-start; border-bottom-left-radius: 4px; }
.mock-ai-bubble.right { background: #06b6d4; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.mock-ai-input { margin-top: auto; background: #151515; border: 1px solid #333; border-radius: 999px; height: 50px; width: 100%; }
.coming-soon-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 50; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(5,5,5,0.2) 0%, rgba(0,0,0,0.85) 60%, rgba(0,0,0,0.95) 100%); }
.cs-content-box { text-align: center; background: rgba(20, 20, 20, 0.6); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1); padding: 50px 40px; border-radius: 24px; max-width: 450px; animation: floatUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; transform: translateY(20px); opacity: 0; }
@keyframes floatUp { to { transform: translateY(0); opacity: 1; } }
.cs-icon-wrapper { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; font-size: 28px; color: #fff; box-shadow: 0 0 20px rgba(255,255,255,0.05); }
.cs-title { font-size: 26px; font-weight: 800; color: #fff; margin: 0 0 10px 0; letter-spacing: -0.5px; background: linear-gradient(to right, #ffffff, #888888); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cs-subtitle { font-size: 14px; color: #888; line-height: 1.6; margin: 0 0 30px 0; }
.cs-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.2); color: #06b6d4; padding: 8px 20px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
@keyframes badgePulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
.cs-badge-dot { width: 6px; height: 6px; background: #06b6d4; border-radius: 50%; box-shadow: 0 0 10px #06b6d4; animation: badgePulse 2s infinite; }

/* --- LEADS TABLE --- */
.leads-view-wrapper { padding: 30px; width: 100%; box-sizing: border-box; overflow: visible; display: flex; flex-direction: column; height: 100%; }
.leads-table-container { background: #0e0e0e; border: 1px solid #1f1f1f; border-radius: 12px; overflow: hidden; flex: 1; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.table-scroll-area {
    overflow-y: auto;
    flex: 1;
    /* ── Hide scrollbar (Desktop Contacts) ── */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE / Edge legacy */
}
.table-scroll-area::-webkit-scrollbar { display: none; } /* Chrome / Safari / Opera */
.leads-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; font-family: 'Montserrat', sans-serif !important; }
.leads-table thead th { position: sticky; top: 0; z-index: 10; background: #151515; color: #777; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 12px 16px; text-align: center; border-bottom: 1px solid #2a2a2a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leads-table thead th:nth-child(1), .leads-table thead th:nth-child(5) { text-align: left; }
.leads-table tbody td { padding: 0 8px; border-bottom: 1px solid #1a1a1a; color: #e5e5e5; vertical-align: middle !important; font-family: 'Montserrat', sans-serif !important; text-align: center; height: 45px; line-height: 45px; white-space: nowrap; overflow: visible; }
.leads-table tbody td:nth-child(1), .leads-table tbody td:nth-child(5) { text-align: left; }
.leads-table tbody tr:hover { background: #1a1a1a; }
.lead-profile { display: flex; align-items: center; gap: 6px; overflow: hidden; height: 100%; }
.lead-name-text { font-weight: 600; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: normal; min-width: 0; flex: 1; }
.lead-phone { font-family: 'Montserrat', sans-serif; letter-spacing: 0.5px; color: #fff; font-size: 13px; font-weight: 600; width: 100%; display: block; overflow: hidden; text-overflow: ellipsis; line-height: normal; }
.lead-date { color: #555; font-size: 12px; font-weight: 500; }
.treatment-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; background: #111; border: 1px solid #222; color: #ccc; font-size: 12px; max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: normal; }
.note-text { line-height: normal; }

/* --- STATUS COLUMN FILTER --- */
.status-th-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
    user-select: none;
    white-space: nowrap;
}
.status-th-filter:hover {
    background: rgba(255,255,255,0.06);
}
.sfd-active-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    display: none; /* shown via JS when filter active */
}
.status-th-caret {
    font-size: 11px;
    color: #888; /* Brightened slightly so you can actually see it */
    transition: transform 0.2s ease;
    flex-shrink: 0; /* STRICT RULE: Never squish the icon */
}

/* Force the text to truncate so it leaves room for the arrow */
#status-th-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 85px; /* Leaves exactly enough room for the dot and the arrow */
    display: block;
}

/* The dropdown itself — fixed positioned, appended to body */
.status-filter-dropdown {
    position: fixed;
    z-index: 9999;
    background: #1a1a1a;
    border: 1px solid #2f2f2f;
    border-radius: 10px;
    padding: 6px;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    animation: sfd-pop 0.12s ease;
}
@keyframes sfd-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}
.sfd-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #bbb;
    transition: background 0.1s ease, color 0.1s ease;
    letter-spacing: 0.2px;
}
.sfd-option:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.sfd-option.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sfd-option.active::after {
    content: '';
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}
.sfd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- GROUPED RDV VIEW (Upcoming / Past) --- */
.rdv-group-header td,
td.rdv-group-header {
    padding: 18px 16px 6px !important;
    background: transparent !important;
    border-bottom: 1px solid #1f1f1f !important;
    line-height: 1 !important;
    height: auto !important;
}

.rdv-group-header-row:hover td {
    background: rgba(255,255,255,0.02) !important;
}

.rdv-group-header--empty {
    opacity: 0.5;
}

.rdv-group-date-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.rdv-group-icon {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.rdv-group-no-booking {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.18);
    letter-spacing: 0.3px;
    font-style: italic;
    text-transform: none;
}

/* Count badge — small pill showing number of leads */
.rdv-group-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    font-size: 10px;
    font-weight: 700;
    color: #22c55e;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1;
    flex-shrink: 0;
}

/* Caret — rotates 90° when group is open */
.rdv-group-caret {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 1px;
}

td.rdv-group-no-future {
    padding: 20px 16px !important;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.18);
    font-weight: 500;
    text-align: center;
    font-style: italic;
    height: auto !important;
    line-height: 1 !important;
}

/* Mobile group headers */
.rdv-group-header-mobile {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 18px 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #1f1f1f;
    margin-bottom: 4px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.rdv-group-header-mobile:active {
    opacity: 0.7;
}

.rdv-group-no-future-mobile {
    padding: 16px 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.18);
    font-weight: 500;
    font-style: italic;
    text-align: center;
}

.rdv-group-empty-state {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

/* Light mode adjustments */
body.light-mode .rdv-group-date-label      { color: rgba(0, 0, 0, 0.45); }
body.light-mode .rdv-group-icon            { color: rgba(0, 0, 0, 0.2); }
body.light-mode .rdv-group-no-booking      { color: rgba(0, 0, 0, 0.2); }
body.light-mode .rdv-group-count-badge     { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #16a34a; }
body.light-mode .rdv-group-caret           { color: rgba(0,0,0,0.25); }
body.light-mode td.rdv-group-no-future     { color: rgba(0, 0, 0, 0.2); }
body.light-mode .rdv-group-header-mobile   { color: rgba(0, 0, 0, 0.45); border-color: rgba(0,0,0,0.1); }
body.light-mode .rdv-group-no-future-mobile{ color: rgba(0, 0, 0, 0.2); }
body.light-mode .rdv-group-header-row:hover td { background: rgba(0,0,0,0.02) !important; }


@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50%       { opacity: 1;   transform: scale(1); }
}
.pag-load-indicator { display: flex; align-items: center; gap: 5px; margin-left: 12px; }
.pag-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4); animation: pulse 1s infinite; }
.pag-dot:nth-child(2) { animation-delay: 0.2s; }
.pag-dot:nth-child(3) { animation-delay: 0.4s; }

.leads-table-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid #1f1f1f;
    border-top: none;
    background: #0e0e0e;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}
/* On mobile the table container is hidden so footer connects directly to mobile list */
@media (max-width: 900px) {
    .leads-table-footer {
        border-top: 1px solid #1f1f1f;
        border-radius: 12px;
        margin-top: 10px;
        margin-bottom: 16px;
    }
}
.pag-btn {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.pag-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}
.pag-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none;
}
.pag-text {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}
.pag-input {
    width: 52px;
    height: 34px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.15s ease;
    -moz-appearance: textfield;
}
.pag-input::-webkit-inner-spin-button,
.pag-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pag-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}
.pag-divider {
    flex: 1;
}
.pag-count {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}


.note-input-wrapper { position: relative; width: 100%; height: 100%; display: flex; align-items: center; }
.note-input { width: 100%; height: 100%; background: transparent !important; border: 0 !important; border-bottom: none !important; border-top: none !important; border-left: none !important; border-right: none !important; box-shadow: none !important; outline: none !important; color: #ffffff !important; font-family: 'Montserrat', sans-serif; font-size: 13px; padding: 0 32px 0 0; text-overflow: ellipsis; }
.note-input::placeholder { color: #ffffff !important; opacity: 0.2; }
.note-input:focus { background: transparent !important; border: none !important; outline: none !important; box-shadow: none !important; }
.btn-save-note { position: absolute; right: 0; top: 50%; transform: translateY(-50%) scale(0); width: 28px; height: 28px; min-width: 28px; min-height: 28px; flex-shrink: 0; aspect-ratio: 1 / 1; padding: 0; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 4px 15px rgba(0,0,0,0.3); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s, background 0.2s; font-size: 12px; pointer-events: none; opacity: 0; }
.note-input-wrapper:focus-within .btn-save-note, 
.btn-save-note:disabled { 
    transform: translateY(-50%) scale(1); 
    pointer-events: auto; 
    opacity: 1; 
}
.btn-save-note:hover { background: rgba(255, 255, 255, 0.25); transform: translateY(-50%) scale(1.1); box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
.btn-save-note:disabled { opacity: 0.7; cursor: not-allowed; }

/* --- RDV CELL STYLES --- */
.rdv-cell { position: relative; transition: background 0.2s; }
.rdv-cell:hover { background: rgba(255,255,255,0.05); }

/* --- ROW DATE PICKER MODAL --- */
#row-date-picker-modal { position: fixed; z-index: 9999999; background: #151515; border: 1px solid #333; border-radius: 16px; width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.05); padding: 15px; display: none; flex-direction: column; gap: 10px; backdrop-filter: blur(20px); opacity: 0; transform: scale(0.95); transition: opacity 0.2s, transform 0.2s; transform-origin: top left; }
#row-date-picker-modal.active { display: flex; opacity: 1; transform: scale(1); }

/* --- LEADS HEADER GROUPING & SEARCH --- */
.leads-header-group { display: flex; align-items: center; gap: 12px; }
.glass-search-wrapper { position: relative; width: 280px; }
.glass-search-input { width: 100%; background: rgba(255, 255, 255, 0.05) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.15) !important; color: #fff !important; padding: 12px 15px 12px 50px !important; border-radius: 999px; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 500; outline: none; transition: all 0.2s ease; box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.05); -webkit-appearance: none; appearance: none; margin: 0; line-height: normal; box-sizing: border-box; }
.glass-search-input:-webkit-autofill, .glass-search-input:-webkit-autofill:hover, .glass-search-input:-webkit-autofill:focus, .glass-search-input:-webkit-autofill:active { -webkit-box-shadow: 0 0 0 30px #0a0a0a inset !important; -webkit-text-fill-color: white !important; transition: background-color 5000s ease-in-out 0s; }
.glass-search-input::placeholder { color: rgba(255, 255, 255, 0.5) !important; }
.glass-search-input:focus { background: rgba(255, 255, 255, 0.1) !important; border-color: rgba(255, 255, 255, 0.3) !important; box-shadow: 0 0 15px rgba(255,255,255,0.05) !important; }
.glass-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #999; font-size: 18px; pointer-events: none; z-index: 10; }

/* --- MOBILE LEADS LIST --- */
.mobile-leads-fade-wrap {
    display: none;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: visible; /* Must NOT clip — filter panel is absolutely positioned */
}

/* Glass edge overlays — sit on top of the scrolling list */
.mobile-glass-edge {
    position: absolute;
    left: 0; right: 0;
    z-index: 2;
    pointer-events: none;
    height: 36px;
    transition: opacity 0.18s ease;
}

/* Top glass: disabled — header line acts as the separator */
.mobile-glass-top {
    display: none !important;
}

/* Bottom glass: fades from transparent → page bg upward */
.mobile-glass-bottom {
    bottom: 0;
    height: 48px;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.55) 45%,
        rgba(0, 0, 0, 0) 100%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
    opacity: 1; /* visible at rest */
}
.mobile-leads-list {
    display: none;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding: 2px 1px;
    /* ── Hide scrollbar (Mobile Contacts) ── */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mobile-leads-list::-webkit-scrollbar { display: none; }

.mobile-lead-card {
    content-visibility: auto;       /* skip layout+paint for off-screen cards */
    contain-intrinsic-size: 0 72px; /* estimated card height — keeps scrollbar stable */
    background: #131313;
    border: 1px solid #252525;
    border-radius: 14px;
    padding: 14px 12px 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    min-height: 66px;
}
.mobile-lead-card:active { background: #1c1c1c; border-color: #333; }

.m-lead-left { display: flex; flex-direction: column; gap: 5px; overflow: hidden; flex: 1; min-width: 0; }
.m-lead-name { font-size: 14px; font-weight: 700; color: #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.m-lead-date { font-size: 11px; color: #4a4a4a; font-weight: 500; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }

/* Treatment label next to date */
.m-lead-treatment {
    color: #555;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

/* Status cell wrapper — badge + meta dot side by side */
.status-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Meta source dot — ph-meta-logo icon next to status badge, desktop only */
.meta-source-dot {
    color: #0082fb;
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
}

.m-lead-right { display: flex; flex-direction: row; align-items: center; gap: 9px; flex-shrink: 0; }


/* RDV date under status badge */
.m-rdv-date {
    font-size: 10px;
    font-weight: 600;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    letter-spacing: 0.1px;
}
.m-rdv-date i { font-size: 10px; }

/* Name row — flex so badge sits right after truncated name */
.m-lead-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    min-width: 0;
}
/* Name inside row still truncates */
.m-lead-name-row .m-lead-name {
    flex: 1;
    min-width: 0;
}

/* Reapply badge — compact count pill e.g. ×3 */
.reapply-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 17px;
    padding: 0 5px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.2px;
}

/* Mobile badge — wide enough for longest label, text never touches border */
.m-badge {
    font-size: 10px !important;
    padding: 5px 14px !important;
    min-width: 148px !important;
    width: 148px !important;
    border-radius: 8px !important;
}

/* Glassmorphism call button — liquid glass, Apple-style */
.btn-call-mobile {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    font-size: 18px;
    transition: all 0.18s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-call-mobile:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); transform: scale(1.05); }
.btn-call-mobile:active { transform: scale(0.94); background: rgba(255,255,255,0.16); }
.btn-call-mobile.called { background: rgba(34,197,94,0.15) !important; border-color: rgba(34,197,94,0.4) !important; color: #22c55e !important; }

/* --- DATE PICKER STYLES --- */
.date-picker-container { position: relative; width: 250px; }

/* ── FILTER BUTTON & PANEL ──────────────────────────────────────────────── */
.filter-btn-container { position: relative; flex-shrink: 0; z-index: 1000; }

.filter-trigger-btn {
    display: flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 18px;
    background: rgba(255,255,255,0.06); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.14); border-radius: 999px;
    color: rgba(255,255,255,0.85); font-family: 'Montserrat', sans-serif;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}
.filter-trigger-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.filter-trigger-btn i { font-size: 16px; }

.filter-active-badge {
    min-width: 18px; height: 18px; padding: 0 5px;
    background: #22c55e; color: #000; font-size: 11px; font-weight: 800;
    border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}

.filter-panel {
    position: absolute; top: calc(100% + 8px); left: 0;
    width: 260px; background: rgba(15,15,15,0.97);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
    padding: 8px 0; z-index: 99999;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06);
    opacity: 0; transform: translateY(-8px) scale(0.97);
    pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.filter-panel.fp-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

.fp-row { padding: 0; }

.fp-section-btn {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 11px 16px; background: none; border: none;
    color: rgba(255,255,255,0.85); font-family: 'Montserrat', sans-serif;
    font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
    transition: background 0.15s;
}
.fp-section-btn:hover { background: rgba(255,255,255,0.05); }

.fp-row-left { display: flex; align-items: center; gap: 10px; }
.fp-caret { font-size: 12px; color: rgba(255,255,255,0.35); transition: transform 0.2s ease; flex-shrink: 0; }

.fp-active-tag {
    display: inline-flex; align-items: center; padding: 2px 8px;
    background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e; font-size: 10px; font-weight: 700; border-radius: 999px;
    white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis;
}

.fp-sub {
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease, padding 0.15s ease;
    padding: 0 12px;
}
.fp-sub.fp-sub-open { max-height: 400px; padding: 4px 12px 8px; }

/* Status sub: fixed height showing ~3.5 items, scrollable */
#fp-sub-status.fp-sub-open {
    max-height: 148px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}
#fp-sub-status.fp-sub-open::-webkit-scrollbar { width: 3px; }
#fp-sub-status.fp-sub-open::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }

.fp-sub-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
    color: rgba(255,255,255,0.7); font-family: 'Montserrat', sans-serif;
    font-size: 12px; font-weight: 600; cursor: pointer; margin-bottom: 5px;
    transition: all 0.15s; text-align: left;
}
.fp-sub-btn:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.15); }
.fp-sub-btn.fp-sub-active { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); color: #22c55e; }

.fp-dot {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block;
}

.fp-calendar-inner { padding: 4px 0; }
.fp-calendar-inner .dp-calendar-wrapper { box-shadow: none; border: none; background: transparent; padding: 0; }
.fp-calendar-inner .dp-footer { margin-top: 8px; padding: 0; }

.fp-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 0; }

.fp-clear-all-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; background: none; border: none;
    color: #ef4444; font-family: 'Montserrat', sans-serif;
    font-size: 12px; font-weight: 700; cursor: pointer; opacity: 0.4;
    transition: opacity 0.2s, background 0.15s; border-radius: 0 0 16px 16px;
}
.fp-clear-all-btn:hover { background: rgba(239,68,68,0.06); opacity: 1 !important; }
.date-trigger-btn { width: 100%; background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(12px) saturate(140%); border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; padding: 10px 15px; height: 40px; box-sizing: border-box; border-radius: 999px; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.2s ease; box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.05); }
.date-trigger-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }
.date-trigger-btn i { font-size: 16px; color: #999; }
.date-picker-modal { position: absolute; top: 110%; left: 0; background: #151515; border: 1px solid #333; border-radius: 16px; width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05); z-index: 1000; padding: 15px; display: none; flex-direction: column; gap: 10px; backdrop-filter: blur(20px); }
.date-picker-modal.open { display: flex; animation: fadeIn 0.2s ease-out; }
.dp-calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 5px; }
.dp-month-label { font-size: 14px; font-weight: 700; color: #fff; }
.dp-nav-btn { background: transparent; border: 1px solid #333; color: #fff; width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dp-nav-btn:hover { background: #222; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-day-header { text-align: center; font-size: 10px; color: #666; font-weight: 700; padding-bottom: 5px; }
.dp-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #ccc; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.dp-day:hover:not(.empty) { background: #222; color: #fff; }
.dp-day.selected { background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(10px) saturate(180%); -webkit-backdrop-filter: blur(10px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3); color: #fff; font-weight: 700; }
.dp-day.in-range { background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; }
.dp-day.today { border: 1px solid rgba(255, 255, 255, 0.3); }
.dp-day.empty { cursor: default; }
.dp-footer { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid #2a2a2a; margin-top: 5px; }
.dp-clear-btn { background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); color: #999; padding: 10px 20px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.dp-clear-btn:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.dp-confirm-btn { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3); color: #fff; padding: 10px 24px; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.dp-confirm-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.dp-confirm-btn:active { transform: translateY(0); }

/* --- GLASS TOOLTIP --- */
#glass-tooltip { position: fixed; z-index: 999999; background: rgba(20, 20, 20, 0.65); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 15px 40px rgba(0,0,0,0.6); padding: 8px 14px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 500; pointer-events: none; display: none; max-width: 300px; white-space: normal; word-wrap: break-word; font-family: 'Montserrat', sans-serif; }

/* --- DROPDOWNS & PAGE SELECTOR CSS --- */
.hidden-select { display: none !important; }
.custom-select-wrapper { position: relative; display: inline-block; width: 100%; margin-bottom: 5px; max-width: 100%; }
.custom-select-trigger { background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); border-radius: 999px; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5), 0 4px 15px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.1); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; letter-spacing: 0.3px; padding: 10px 20px; padding-right: 40px; width: 100%; cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; transition: all 0.2s ease; }
.custom-select-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; margin-right: 10px; min-width: 0; }
.custom-select-trigger:after { content: ''; width: 16px; height: 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'%3E%3C/path%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); transition: transform 0.3s ease; }
.custom-select-trigger:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.custom-select-wrapper.open .custom-select-trigger { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); }
.custom-select-wrapper.open .custom-select-trigger:after { transform: translateY(-50%) rotate(180deg); }
.custom-options { position: absolute; top: 110%; left: 0; right: 0; z-index: 100000; background: rgba(20, 20, 20, 0.85); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 15px 40px rgba(0,0,0,0.6); border-radius: 14px; overflow: hidden; opacity: 0; visibility: hidden; transform: scale(0.95); transform-origin: top center; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-select-wrapper.open .custom-options { opacity: 1; visibility: visible; transform: scale(1); }
.custom-option { padding: 12px 20px; font-size: 13px; font-weight: 500; color: #eaeaea; cursor: pointer; transition: background 0.1s; display: block; position: relative; }
.custom-option:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.custom-option.selected { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 700; }
.custom-option:not(:last-child)::after { content: ''; position: absolute; bottom: 0; left: 15px; right: 15px; height: 1px; background: rgba(255, 255, 255, 0.08); pointer-events: none; }
.page-option-ui { display: flex; align-items: center; gap: 12px; width: 100%; padding-right: 20px; }
.page-icon-box { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.platform-fb { background: linear-gradient(135deg, #1877F2, #0e5a20); border: 1px solid rgba(24, 119, 242, 0.3); }
.platform-ig { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); border: 1px solid rgba(225, 48, 108, 0.3); }
.page-text-group { display: flex; flex-direction: column; text-align: left; overflow: hidden; flex: 1; }
.page-name-text { font-size: 13px; font-weight: 700; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.page-id-text { font-size: 10px; font-weight: 500; color: rgba(255, 255, 255, 0.4); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
#page-selector-wrapper .custom-select-trigger { padding: 8px 15px; height: auto; min-height: 50px; }
#page-selector-wrapper .custom-select-trigger span { margin-right: 0; overflow: visible; display: block; width: 100%; }

/* --- CHAT INTERFACE --- */
.chat-interface { display: grid; grid-template-columns: 320px 1fr 0px; width: 100%; height: 100%; overflow: hidden; transition: grid-template-columns 0.4s ease-out; }
.chat-interface.profile-open { grid-template-columns: 320px 1fr 300px; }
.chat-list-panel { background: #0a0a0a; border-right: 1px solid #1a1a1a; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-search-bar { padding: 15px; border-bottom: 1px solid #1a1a1a; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.search-input { width: 100%; background: #151515; border: 1px solid #333; padding: 10px 15px; border-radius: 8px; color: #fff; font-family: 'Montserrat', sans-serif; outline: none; box-sizing: border-box; }
.conversations-list { flex: 1; overflow-y: auto; list-style: none; padding: 0; margin: 0; min-height: 0; }
.convo-item { display: flex; align-items: center; gap: 15px; padding: 15px 20px; cursor: pointer; transition: background 0.1s; }
.convo-item:hover { background: #151515; }
.convo-item.selected { background: #151515; border-right: 3px solid #0072FF; }
.convo-avatar { width: 42px; height: 42px; border-radius: 50%; background: #333; flex-shrink: 0; position: relative; }
.convo-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.platform-badge-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #0a0a0a;
    color: #fff;
    z-index: 10;
    
    /* --- TRUE CENTER LOGIC --- */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important; /* Prevents font-spacing from pushing the icon */
}

/* Specific nudge for Phosphor icons to hit the mathematical center */
.platform-badge-icon i {
    font-size: 10px;
    display: block;
    transform: translateY(0.5px); /* Micro-nudge for visual balance */
}
.convo-details { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.convo-top-row { display: flex; justify-content: space-between; align-items: baseline; width: 100%; margin-bottom: 3px; }
.convo-name { font-weight: 600; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-time-display { font-size: 11px; color: #666; font-weight: 500; white-space: nowrap; margin-left: 6px; }
.convo-preview { font-size: 13px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;  }
.active-chat-panel { display: flex; flex-direction: column; background: #000; position: relative; width: 100%; height: 100%; min-height: 0; }
.chat-header { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; display: flex; align-items: center; min-height: 56px; background: #000; }
.chat-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.chat-header-avatar-wrap { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #222; display: flex; align-items: center; justify-content: center; }
.chat-header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: none; }
.chat-header-avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: #222; display: flex; align-items: center; justify-content: center; color: #666; font-size: 16px; }
.chat-header-title-group { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; cursor: pointer; }
.chat-header-name { font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.chat-header:hover { background: #0a0a0a; }
.profile-panel { background: #0a0a0a; border-left: 1px solid #1a1a1a; height: 100%; display: flex; flex-direction: column; overflow-y: auto; padding: 25px; box-sizing: border-box; }
.profile-section-title { font-size: 10px; color: #444; font-weight: 700; text-transform: uppercase; margin-bottom: 15px; letter-spacing: 1px; }
.profile-data-item { margin-bottom: 20px; }
.profile-label { font-size: 11px; color: #666; margin-bottom: 4px; }
.profile-value { font-size: 13px; font-weight: 500; color: #fff; word-break: break-all; }
.messages-feed { flex: 1; padding: 12px 16px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; background: #000; min-height: 0; }
.message-group { display: flex; flex-direction: column; max-width: 75%; position: relative; opacity: 1; gap: 2px; }
.message-group.incoming { align-self: flex-start; }
.message-group.outgoing { align-self: flex-end; align-items: flex-end; }
@keyframes glideUp { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }
.animate-pop { animation: glideUp 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.msg-bubble { padding: 9px 13px 6px 13px; border-radius: 20px; font-size: 15px; line-height: 1.4; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; position: relative; min-width: 50px; word-wrap: break-word; word-break: break-word; display: flex; flex-direction: column; gap: 2px; }
.incoming .msg-bubble { background: #E9E9EB; color: #000; border-bottom-left-radius: 4px; }
.outgoing .msg-bubble { background: #7B3FE4; color: #fff; border-bottom-right-radius: 4px; }
.msg-time { font-size: 11px; opacity: 0.5; font-weight: 500; display: block; line-height: 1; align-self: flex-end; white-space: nowrap; }
.chat-input-area { padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px)); background: transparent; border-top: none; display: flex; align-items: center; flex-shrink: 0; position: relative; }
.chat-input-pill { display: flex; align-items: center; background: rgba(255,255,255,0.08); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: 1px solid rgba(255,255,255,0.13); border-radius: 999px; flex: 1; padding: 0 5px 0 14px; min-height: 40px; gap: 6px; }
.message-input { flex: 1; background: transparent; border: none; padding: 9px 0; color: #fff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; outline: none; min-width: 0; }
.send-btn { width: 30px; height: 30px; background: #3478F6; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; flex-shrink: 0; font-size: 14px; transition: background 0.15s; }
.back-to-list-btn { display: none; font-size: 18px; padding-right: 15px; color: #fff; background: none; border: none; cursor: pointer; }
.chat-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #666; gap: 10px; }
.chat-spinner { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.1); border-top-color: #0072FF; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- PREMIUM SETTINGS --- */
.premium-settings-wrapper { padding: 40px; max-width: 800px; margin: 0 auto; width: 100%; animation: fadeIn 0.3s ease; }
.premium-settings-header { margin-bottom: 30px; }
.premium-settings-header h2 { font-size: 24px; font-weight: 700; color: #fff; margin: 0 0 5px 0; }
.premium-settings-header p { font-size: 14px; color: #666; margin: 0; }
.premium-settings-card { background: #0e0e0e; border: 1px solid #1a1a1a; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.ps-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid #1a1a1a; transition: background 0.2s; gap: 16px; }
.ps-row:last-child { border-bottom: none; }
.ps-row:hover { background: rgba(255,255,255,0.02); }
.ps-info { display: flex; flex-direction: column; gap: 4px; padding-right: 20px; flex: 1; min-width: 0; }
.ps-action { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ps-title { font-size: 14px; font-weight: 600; color: #fff; }
.ps-desc { font-size: 13px; color: #888; line-height: 1.4; }
.ps-badge { background: rgba(34, 197, 94, 0.1); color: #22c55e; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid rgba(34,197,94,0.2); }
.ps-link { color: #06b6d4; text-decoration: none; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; transition: opacity 0.2s; }
.ps-link:hover { opacity: 0.8; }
.btn-logout-action { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; padding: 10px 20px; border-radius: 6px; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
.btn-logout-action:hover { background: rgba(239, 68, 68, 0.2); box-shadow: 0 0 15px rgba(239, 68, 68, 0.1); }

/* --- LEAD PROFILE VIEW (PREMIUM MINIMALIST) --- */
.profile-view-header { display: flex; align-items: center; gap: 15px; padding: 20px 30px; border-bottom: 1px solid #1a1a1a; background: #0a0a0a; position: sticky; top: 0; z-index: 10; }
.btn-back-profile { background: transparent; border: 1px solid #333; color: #fff; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.btn-back-profile:hover { background: #222; border-color: #555; }
.lead-profile-container { padding: 40px; max-width: 1000px; margin: 0 auto; width: 100%; animation: fadeIn 0.3s ease-out; }
.profile-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; padding-bottom: 30px; border-bottom: 1px solid #1a1a1a; }
.profile-avatar-large { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #333, #111); color: #fff; font-size: 32px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.profile-hero-info h1 { margin: 0; font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.profile-hero-info p { margin: 5px 0 0 0; color: #666; font-size: 14px; font-weight: 500; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.info-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 25px; transition: transform 0.2s, background 0.2s; }
.info-card:hover { background: rgba(255, 255, 255, 0.05); transform: translateY(-2px); }
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #555; font-weight: 700; margin-bottom: 8px; }
.info-value { font-size: 15px; color: #fff; font-weight: 500; word-break: break-word; line-height: 1.5; }
.info-value.highlight { color: #3b82f6; } 

/* --- STATUS HISTORY TIMELINE --- */
.history-section { margin-top: 40px; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 25px; }
.history-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.timeline { display: flex; flex-direction: column; gap: 15px; position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: rgba(255, 255, 255, 0.1); }
.timeline-item { position: relative; display: flex; flex-direction: column; gap: 4px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #06b6d4; border: 2px solid #0a0a0a; }
.timeline-item:first-child .timeline-dot { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.4); }
.timeline-status { font-size: 13px; font-weight: 600; color: #fff; }
.timeline-time { font-size: 11px; color: #666; font-weight: 500; }

@media (max-width: 600px) {
    .lead-profile-container { padding: 20px; }
    .profile-hero { flex-direction: column; text-align: center; gap: 15px; }
    .profile-grid { grid-template-columns: 1fr; }
    .cs-content-box { padding: 40px 24px; margin: 0 20px; max-width: calc(100% - 40px); box-sizing: border-box; }
    .cs-title { font-size: 22px; }
}

/* --- RESPONSIVE OVERRIDES --- */
@media (max-width: 900px) {
    .dashboard-wrapper { grid-template-columns: 1fr; height: 100vh; overflow-x: hidden; } 
    .sidebar { display: none; }
    .mobile-top-bar { display: flex; }
    .main-content { padding-bottom: 0px; padding-top: 56px; width: 100%; overflow-x: hidden; } 
    .top-header { display: none; }
    .chat-interface { grid-template-columns: 1fr; width: 100%; max-width: 100%; overflow: hidden; } 
    .chat-list-panel { display: flex; flex-direction: column; width: 100%; padding-bottom: 0; background: #000; min-width: 0; box-sizing: border-box; }
    .chat-search-bar { padding: 10px 16px; background: #000; border-bottom: 1px solid rgba(255,255,255,0.06); width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; } 
    .search-input { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px; padding: 12px 20px; font-size: 16px; }
    /* Flat list — no cards */
    .conversations-list { padding: 0 !important; display: flex; flex-direction: column; gap: 0; width: 100%; box-sizing: border-box; }
    .convo-item { background: transparent; border: none; border-radius: 0; padding: 11px 16px; margin-bottom: 0; box-shadow: none; width: 100%; box-sizing: border-box; gap: 12px; min-height: 72px; align-items: center; }
    .convo-item:active { background: rgba(255,255,255,0.05); }
    .convo-details { min-width: 0; gap: 3px; }
    .convo-item.selected { background: rgba(255,255,255,0.04); border-right: none; }
    .convo-avatar { width: 54px; height: 54px; flex-shrink: 0; }
    .custom-select-trigger { width: 100%; box-sizing: border-box; max-width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15); }
    .active-chat-panel { display: none; width: 100%; padding-bottom: 0; min-width: 0; }
    .messages-feed { padding: 10px 12px 6px; }
    .profile-panel { display: none !important; }
    .chat-interface.mobile-chat-active .chat-list-panel { display: none; }
    .chat-interface.mobile-chat-active .active-chat-panel { display: flex; }
    .back-to-list-btn { display: block; }
    /* Full-screen chat: hide top bar, zero out its padding */
    body.chat-open .mobile-top-bar { display: none !important; }
    body.chat-open .main-content { padding-top: 0 !important; }
    
    /* --- MOBILE HEADER LAYOUT --- */
    .leads-header-group { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }

    /* Row 1: Filter button + Search bar side by side */
    .filter-btn-container { order: 1; flex-shrink: 0; }
    .filter-trigger-btn { height: 40px; padding: 0 16px; font-size: 12px; }
    .leads-header-group > .glass-search-wrapper { order: 2; flex: 1; min-width: 0; width: auto; }

    /* Row 2: Avg reaction badge full width */
    #avg-reaction-badge { order: 3; width: 100% !important; box-sizing: border-box !important; padding: 0 15px !important; height: 40px !important; justify-content: center; }

    /* Filter panel: full width on mobile */
    .filter-panel { width: calc(100vw - 30px); left: 0; z-index: 100000; }

    /* Hides the "AVG REACTION:" label text on mobile */
    .leads-header-group > div:nth-child(3) > span:nth-of-type(1) { display: none !important; }

    .glass-search-input { font-size: 11px !important; height: 40px !important; padding: 0 15px 0 42px !important; box-sizing: border-box !important; line-height: 40px !important; }
    .filter-trigger-btn { flex-shrink: 0; min-width: 90px; }
    .leads-view-wrapper { padding: 15px 15px 0 15px; } 
    .mock-dashboard, .mock-ai-dashboard { padding: 20px; }
    .premium-settings-wrapper { padding: 20px 16px; }
    .ps-row { flex-wrap: wrap; gap: 12px; padding: 18px 16px; }
    .ps-action { width: 100%; justify-content: center; }
    .ps-info { padding-right: 0; width: 100%; }
    .leads-table-container { display: none; }
    .meta-source-dot { display: none; } /* desktop only */
    .mobile-leads-fade-wrap { display: flex; flex-direction: column; }
    .mobile-leads-list { display: flex; padding-bottom: 8px; padding-top: 8px; } 
}

/* --- INSTANT LOAD OVERRIDES --- */
body.is-authenticated #login-overlay { display: none !important; }
body.is-authenticated .dashboard-wrapper { display: grid !important; }

/* --- MOBILE SCROLL SNAP-BACK FIX --- */
/* Use min-height instead of forcing height to prevent layout thrashing */
html, body, .dashboard-wrapper { 
    height: 100%; 
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Native iOS fix */
}

@media (max-width: 900px) {
    /* Spacer — only for non-leads lists */
    .conversations-list::after, 
    .mock-dashboard::after,
    .mock-ai-dashboard::after,
    #view-settings::after, 
    #view-lead-profile::after {
        content: '';
        display: block;
        height: 30px !important;
        min-height: 30px !important;
        width: 100%;
        flex-shrink: 0;
    }

    /* Full-screen chat panel — no extra bottom gap */
    .active-chat-panel { padding-bottom: 0 !important; }

    /* Removes the old padding that wasn't working to prevent double spacing */
    .chat-list-panel { padding-bottom: 0 !important; }
    .mobile-leads-fade-wrap { padding-bottom: 0 !important; }
    /* padding-bottom handled above */
}

/* --- LANGUAGE SELECTOR BUTTONS --- */
.btn-lang {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #999;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-lang:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}
.btn-lang.active {
    background: #3b82f6; /* Santidenty Blue */
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* ============================================================
   THEME TOGGLE BUTTON STYLES (Settings Page)
   ============================================================ */
.btn-theme {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #999;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.btn-theme:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}
.btn-theme.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* ============================================================
   LIGHT MODE — ManyChat-inspired, crisp, high-contrast.
   No shadows. Whites are white. Greys are bold enough to read.
   ============================================================ */

/* Color palette used throughout:
   --text-primary:   #111827  (near-black, all main text)
   --text-secondary: #374151  (dark charcoal, sub-titles, roles)
   --text-muted:     #6b7280  (grey, labels, timestamps, meta)
   --text-faint:     #9ca3af  (light grey, only for tiny uppercase labels)
   --border:         #e5e7eb  (soft border)
   --bg-surface:     #f9fafb  (subtle off-white card bg)
   --bg-hover:       #f3f4f6  (hover states)
   --bg-input:       #f3f4f6  (input backgrounds)
*/

/* --- SCROLLBARS --- */
body.light-mode ::-webkit-scrollbar-thumb { background: rgba(60,60,67,0.2); border-radius: 4px; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: rgba(60,60,67,0.35); }

/* --- BODY & WRAPPER --- */
body.light-mode { background: #F2F2F7 !important; color: #000000 !important; }
body.light-mode .dashboard-wrapper { background-color: #F2F2F7; }

/* --- LOGIN SCREEN --- */
body.light-mode #login-overlay { background: #F2F2F7; }
body.light-mode .login-card {
    background: #FFFFFF;
    border: 1px solid rgba(60,60,67,0.12);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.8);
}
body.light-mode .login-logo { color: #000000; }
body.light-mode .login-subtitle { color: rgba(60,60,67,0.6); }
body.light-mode .login-label { color: rgba(60,60,67,0.85); font-weight: 500; }
body.light-mode .login-input { background: rgba(120,120,128,0.12); border: 1px solid rgba(60,60,67,0.1); color: #000000; }
body.light-mode .login-input:focus { border-color: #007AFF; background: rgba(0,122,255,0.04); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
body.light-mode .btn-login { background: #007AFF; color: #fff; box-shadow: 0 2px 8px rgba(0,122,255,0.3); }

/* --- SIDEBAR --- */
body.light-mode .sidebar { background: #F2F2F7; border-right: 1px solid rgba(60,60,67,0.12); }
body.light-mode .logo-area { color: #000000; }
body.light-mode .account-switcher { background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); }
body.light-mode .switcher-avatar { background: #1C1C1E; color: #ffffff; }
body.light-mode .switcher-name { color: #000000; font-weight: 600; }
body.light-mode .switcher-role { color: rgba(60,60,67,0.6); }
body.light-mode .switcher-badge { background: rgba(120,120,128,0.16); border: 1px solid rgba(60,60,67,0.1); color: rgba(60,60,67,0.7); letter-spacing: 0.2px; }
body.light-mode .sidebar i[style*="color: #666"] { color: rgba(60,60,67,0.4) !important; }
body.light-mode .nav-item { color: rgba(60,60,67,0.8); font-weight: 500; }
body.light-mode .nav-item:hover { background: rgba(120,120,128,0.1); color: #000000; }
body.light-mode .nav-item.active {
    background: rgba(255,255,255,0.75);
    color: #000000;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
body.light-mode #nav-slider {
    background: rgba(255,255,255,0.75);
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border-radius: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
body.light-mode .sidebar-footer { border-top: 1px solid rgba(60,60,67,0.1); }

/* --- MOBILE BOTTOM NAV --- */
body.light-mode .mobile-bottom-nav {
    background: rgba(242,242,247,0.92);
    border-top: 1px solid rgba(60,60,67,0.12);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}
body.light-mode .mobile-nav-item { color: rgba(60,60,67,0.4); }
body.light-mode .mobile-nav-item.active { color: #000000; }
body.light-mode .mobile-nav-item.active i { color: #000000; }

/* --- MOBILE TOP BAR & DRAWER (light mode) --- */
body.light-mode .mobile-top-bar {
    background: rgba(242,242,247,0.92);
    border-bottom: 1px solid rgba(60,60,67,0.12);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}
body.light-mode .mobile-hamburger span { background: #1C1C1E; }
body.light-mode .mobile-top-logo { color: #000000; }
body.light-mode .mobile-drawer {
    background: #F2F2F7;
    border-right: 1px solid rgba(60,60,67,0.12);
}
body.light-mode .mobile-drawer-header { border-bottom: 1px solid rgba(60,60,67,0.1); }
body.light-mode .mobile-drawer-logo { color: #000000; }
body.light-mode .mobile-drawer-account { background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); }
body.light-mode .mobile-drawer-avatar { background: #1C1C1E; color: #ffffff; }
body.light-mode .mobile-drawer-username { color: #000000; font-weight: 600; }
body.light-mode .mobile-drawer-role { color: rgba(60,60,67,0.6); }
body.light-mode .mobile-drawer-item { color: rgba(60,60,67,0.85); font-weight: 500; }
body.light-mode .mobile-drawer-item:hover { background: rgba(120,120,128,0.1); color: #000000; }
body.light-mode .mobile-drawer-item.active {
    color: #000000;
    background: rgba(255,255,255,0.75);
    font-weight: 600;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
body.light-mode .mobile-drawer-footer { border-top: 1px solid rgba(60,60,67,0.1); }

/* --- MAIN CONTENT & HEADER --- */
body.light-mode .main-content { background: #F2F2F7; }
body.light-mode .top-header { background: rgba(242,242,247,0.92); border-bottom: 1px solid rgba(60,60,67,0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body.light-mode .page-title { color: #000000; font-weight: 700; letter-spacing: -0.3px; }

/* --- VIEW SECTIONS --- */
body.light-mode .view-section { background: #F2F2F7; }
body.light-mode #view-settings { background: #F2F2F7 !important; }
body.light-mode #view-lead-profile { background: #F2F2F7 !important; }

/* --- SETTINGS PAGE --- */
body.light-mode .premium-settings-header h2 { color: #000000; font-weight: 700; letter-spacing: -0.3px; }
body.light-mode .premium-settings-header p { color: rgba(60,60,67,0.6); }
body.light-mode .premium-settings-card { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1); box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
body.light-mode .ps-row { border-bottom: 1px solid rgba(60,60,67,0.08); }
body.light-mode .ps-row:hover { background: rgba(120,120,128,0.05); }
body.light-mode .ps-title { color: #000000; font-weight: 500; }
body.light-mode .ps-desc { color: rgba(60,60,67,0.55); }
body.light-mode .ps-badge { background: rgba(52,199,89,0.1); border: 1px solid rgba(52,199,89,0.25); color: #248A3D; }
body.light-mode .ps-link { color: #007AFF; }
body.light-mode .btn-lang { background: rgba(120,120,128,0.12); border: 1px solid rgba(60,60,67,0.1); color: rgba(60,60,67,0.8); box-shadow: none; }
body.light-mode .btn-lang:hover:not(.active) { background: rgba(120,120,128,0.2); color: #000000; }
body.light-mode .btn-lang.active { background: #007AFF; color: #fff; border-color: #007AFF; box-shadow: 0 2px 6px rgba(0,122,255,0.3); }
body.light-mode .btn-theme { background: rgba(120,120,128,0.12); border: 1px solid rgba(60,60,67,0.1); color: rgba(60,60,67,0.8); box-shadow: none; }
body.light-mode .btn-theme:hover:not(.active) { background: rgba(120,120,128,0.2); color: #000000; transform: none; }
body.light-mode .btn-theme.active { background: #3A3A3C; color: #fff; border-color: #3A3A3C; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
body.light-mode .btn-logout-action { background: rgba(255,59,48,0.07); border: 1px solid rgba(255,59,48,0.18); box-shadow: none; color: #FF3B30; width: 100%; justify-content: center; border-radius: 12px; }
body.light-mode .btn-logout-action:hover { background: rgba(255,59,48,0.12); box-shadow: none; }

/* --- GLASS TOOLTIP --- */
body.light-mode #glass-tooltip {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(60,60,67,0.12);
    color: #000000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
}

/* --- LEADS VIEW --- */
body.light-mode .leads-table-container { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1); box-shadow: 0 1px 4px rgba(0,0,0,0.05); border-radius: 14px; }
body.light-mode .mobile-glass-top { display: none !important; }
body.light-mode .mobile-glass-bottom {
    background: linear-gradient(to top, rgba(249,250,251,0.92) 0%, rgba(249,250,251,0.55) 45%, rgba(249,250,251,0) 100%);
}
body.light-mode .leads-table thead th { background: rgba(242,242,247,0.8); color: rgba(60,60,67,0.55); border-bottom: 1px solid rgba(60,60,67,0.1); font-weight: 600; letter-spacing: 0.3px; font-size: 11px; text-transform: uppercase; }
body.light-mode .leads-table tbody td { color: #000000; border-bottom: 1px solid rgba(60,60,67,0.06); }
body.light-mode .leads-table tbody tr:hover { background: rgba(120,120,128,0.05); }
body.light-mode .lead-name-text { color: #000000; font-weight: 500; }
body.light-mode .lead-phone { color: rgba(60,60,67,0.85); white-space: nowrap; overflow: visible; }
body.light-mode .lead-date { color: rgba(60,60,67,0.45); }
body.light-mode .treatment-pill { background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); color: rgba(60,60,67,0.8); }
body.light-mode .note-input { color: #000000 !important; background: transparent !important; }
body.light-mode .note-input::placeholder { color: rgba(60,60,67,0.35) !important; opacity: 1; }
body.light-mode .btn-save-note {
    background: rgba(0,122,255,0.08); border: 1px solid rgba(0,122,255,0.18); color: #007AFF;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.light-mode .btn-save-note:hover { background: rgba(0,122,255,0.16); box-shadow: none; }

/* --- STATUS COLUMN FILTER DROPDOWN --- */
body.light-mode .status-th-filter:hover { background: rgba(120,120,128,0.08); border-radius: 6px; }
body.light-mode .status-th-caret { color: rgba(60,60,67,0.35); }
body.light-mode .status-filter-dropdown { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1); box-shadow: 0 8px 30px rgba(0,0,0,0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body.light-mode .sfd-option { color: rgba(60,60,67,0.85); }
body.light-mode .sfd-option:hover { background: rgba(120,120,128,0.08); color: #000000; }
body.light-mode .sfd-option.active { background: rgba(0,122,255,0.08); color: #007AFF; }
body.light-mode .sfd-option.active::after { background: #007AFF; }

/* --- PAGINATION FOOTER --- */
body.light-mode .leads-table-footer { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1); border-top: none; }
@media (max-width: 900px) {
    body.light-mode .leads-table-footer { border-top: 1px solid rgba(60,60,67,0.1); }
}
body.light-mode .pag-btn { background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); color: #000000; }
body.light-mode .pag-btn:hover:not(:disabled) { background: rgba(120,120,128,0.18); border-color: rgba(60,60,67,0.18); box-shadow: none; transform: none; }
body.light-mode .pag-text { color: rgba(60,60,67,0.75); }
body.light-mode .pag-input { background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); color: #000000; }
body.light-mode .pag-input:focus { border-color: #007AFF; background: rgba(0,122,255,0.04); }
body.light-mode .pag-count { color: rgba(60,60,67,0.45); }

/* --- SEARCH & GLASS INPUTS --- */
body.light-mode .glass-search-input {
    background: rgba(120,120,128,0.1) !important; border: 1px solid rgba(60,60,67,0.08) !important;
    color: #000000 !important; box-shadow: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
body.light-mode .glass-search-input::placeholder { color: rgba(60,60,67,0.35) !important; }
body.light-mode .glass-search-input:focus {
    background: rgba(0,122,255,0.04) !important; border-color: #007AFF !important; box-shadow: 0 0 0 3px rgba(0,122,255,0.1) !important;
}
body.light-mode .glass-search-input:-webkit-autofill,
body.light-mode .glass-search-input:-webkit-autofill:hover,
body.light-mode .glass-search-input:-webkit-autofill:focus,
body.light-mode .glass-search-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(242,242,247,1) inset !important;
    -webkit-text-fill-color: #000000 !important;
}
body.light-mode .glass-search-icon { color: rgba(60,60,67,0.4); }

/* --- DATE PICKER TRIGGER BUTTON --- */
body.light-mode .date-trigger-btn {
    background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); color: #000000;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.light-mode .date-trigger-btn:hover { background: rgba(120,120,128,0.18); border-color: rgba(60,60,67,0.15); }
body.light-mode .date-trigger-btn i { color: rgba(60,60,67,0.4); }

/* --- DATE PICKER MODALS (main & row) --- */
body.light-mode .date-picker-modal,
body.light-mode #row-date-picker-modal {
    background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1);
    box-shadow: 0 8px 40px rgba(0,0,0,0.12); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
body.light-mode .dp-month-label { color: #000000; font-weight: 600; }
body.light-mode .dp-nav-btn { border: 1px solid rgba(60,60,67,0.1); color: #007AFF; background: rgba(0,122,255,0.06); }
body.light-mode .dp-nav-btn:hover { background: rgba(0,122,255,0.12); }
body.light-mode .dp-day-header { color: rgba(60,60,67,0.4); font-weight: 600; font-size: 11px; }
body.light-mode .dp-day { color: #000000; }
body.light-mode .dp-day:hover:not(.empty) { background: rgba(0,122,255,0.08); color: #007AFF; }
body.light-mode .dp-day.selected {
    background: #007AFF; color: #fff; border: 1px solid #007AFF;
    box-shadow: 0 2px 8px rgba(0,122,255,0.3); backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.light-mode .dp-day.in-range { background: rgba(0,122,255,0.08); border: none; backdrop-filter: none; }
body.light-mode .dp-day.today { border: 1.5px solid #007AFF; color: #007AFF; font-weight: 600; }
body.light-mode .dp-footer { border-top: 1px solid rgba(60,60,67,0.08); }
body.light-mode .dp-clear-btn { border: 1px solid rgba(60,60,67,0.12); color: rgba(60,60,67,0.7); }
body.light-mode .dp-clear-btn:hover { background: rgba(120,120,128,0.1); border-color: rgba(60,60,67,0.2); color: #000000; }
body.light-mode .dp-confirm-btn {
    background: #007AFF; color: #fff; border: 1px solid #007AFF;
    box-shadow: 0 2px 8px rgba(0,122,255,0.3); backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.light-mode .dp-confirm-btn:hover { background: #0071E3; border-color: #0071E3; transform: none; }

/* --- REACTION NOTICE POPOVER --- */
body.light-mode .reaction-notice-popover {
    background: rgba(255,255,255,0.96); border: 1px solid rgba(60,60,67,0.12); color: rgba(60,60,67,0.85);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
}
body.light-mode .reaction-notice-popover::after { border-bottom: 6px solid rgba(60,60,67,0.12); }

/* --- AVG REACTION BADGE --- */
body.light-mode #avg-reaction-badge { background: rgba(120,120,128,0.1) !important; border: 1px solid rgba(60,60,67,0.1) !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.light-mode #avg-reaction-badge span[style*="color: #888"] { color: rgba(60,60,67,0.5) !important; }
body.light-mode #avg-reaction-badge #avg-reaction-time { color: #000000 !important; font-weight: 700; }

/* --- PAGE SELECTOR DROPDOWN --- */
body.light-mode .custom-select-trigger {
    background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); color: #000000;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.light-mode .custom-select-trigger:after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23111827' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'%3E%3C/path%3E%3C/svg%3E");
}
body.light-mode .custom-select-trigger:hover { background: rgba(120,120,128,0.18); transform: none; }
body.light-mode .custom-select-wrapper.open .custom-select-trigger { background: rgba(120,120,128,0.18); border-color: rgba(60,60,67,0.15); }
body.light-mode .custom-options {
    background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
body.light-mode .custom-option { color: rgba(60,60,67,0.85); }
body.light-mode .custom-option:hover { background: rgba(120,120,128,0.08); color: #000000; }
body.light-mode .custom-option.selected { background: rgba(0,122,255,0.08); color: #007AFF; }
body.light-mode .custom-option:not(:last-child)::after { background: rgba(60,60,67,0.06); }
body.light-mode .page-name-text { color: #000000; font-weight: 500; }
body.light-mode .page-id-text { color: rgba(60,60,67,0.45); }

/* --- CHAT INTERFACE --- */
body.light-mode .chat-list-panel { background: #F2F2F7; border-right: 1px solid rgba(60,60,67,0.1); }
body.light-mode .chat-search-bar { background: rgba(242,242,247,0.9); border-bottom: 1px solid rgba(60,60,67,0.08); }
body.light-mode .search-input {
    background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.08); color: #000000;
}
body.light-mode .search-input::placeholder { color: rgba(60,60,67,0.35); }
body.light-mode .search-input:focus { border-color: #007AFF; background: rgba(0,122,255,0.04); box-shadow: 0 0 0 3px rgba(0,122,255,0.1); outline: none; }

/* Conversation list items */
body.light-mode .convo-item {
    background: #FFFFFF;
    border-bottom: 1px solid rgba(60,60,67,0.07);
    margin: 0;
}
body.light-mode .convo-item:hover { background: rgba(120,120,128,0.05); }
body.light-mode .convo-item.selected {
    background: rgba(0,122,255,0.06);
    border-right: 3px solid #007AFF;
    border-bottom: 1px solid rgba(60,60,67,0.06);
}
body.light-mode .convo-avatar { background: rgba(120,120,128,0.18); }
body.light-mode .platform-badge-icon { border: 2px solid #fff; }
body.light-mode .convo-name { color: #000000; font-weight: 600; }
body.light-mode .convo-preview { color: rgba(60,60,67,0.5); }
body.light-mode .convo-time-display { color: rgba(60,60,67,0.38); }

/* Mobile conversation flat list — light mode */
@media (max-width: 900px) {
    body.light-mode .convo-item {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        min-height: 72px;
    }
    body.light-mode .convo-item:active { background: rgba(60,60,67,0.05); }
    body.light-mode .convo-item.selected {
        background: rgba(0,122,255,0.05);
        border-right: none;
    }
    body.light-mode .chat-search-bar { background: #f2f2f7; border-bottom: 1px solid rgba(60,60,67,0.08); }
    body.light-mode .chat-list-panel { background: #fff; }
    body.light-mode .search-input {
        background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.08); color: #000000;
    }
}

/* Active chat panel */
body.light-mode .active-chat-panel { background: #F2F2F7; }
body.light-mode .chat-header {
    background: #fff;
    border-bottom: 1px solid rgba(60,60,67,0.1);
    color: #000;
}
body.light-mode #chat-header-name, body.light-mode .chat-header-name { color: #000; font-weight: 600; }
body.light-mode #sms-header-name { color: #000000; font-weight: 600; }
body.light-mode .back-to-list-btn { color: #007AFF !important; }
body.light-mode .chat-header-avatar-placeholder { background: #e5e5ea; color: #8e8e93; }

/* Messages feed — plain light background like Instagram */
body.light-mode .messages-feed { background: #fff; }

/* Incoming bubbles */
body.light-mode .incoming .msg-bubble {
    background: #E9E9EB;
    color: #000;
}
/* Outgoing bubbles */
body.light-mode .outgoing .msg-bubble {
    background: #7B3FE4;
    color: #fff;
}
body.light-mode .msg-time { color: rgba(60,60,67,0.38); }
body.light-mode .outgoing .msg-time { color: rgba(255,255,255,0.6); }

/* Chat input area */
body.light-mode .chat-input-area {
    background: transparent;
    border-top: none;
}
body.light-mode .chat-input-pill {
    background: rgba(120,120,128,0.12);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-color: rgba(60,60,67,0.15);
}
body.light-mode .message-input { background: transparent; border: none; color: #000; }
body.light-mode .message-input::placeholder { color: rgba(60,60,67,0.4); }
body.light-mode .send-btn { background: #007AFF; color: #fff; }
body.light-mode .send-btn:hover { background: #0071E3; }

/* Chat loaders */
body.light-mode .chat-loader { color: rgba(60,60,67,0.35); }
body.light-mode .chat-spinner { border: 3px solid rgba(60,60,67,0.12); border-top-color: #007AFF; }

/* Profile panel (desktop chat sidebar) */
body.light-mode .profile-panel { background: #F2F2F7; border-left: 1px solid rgba(60,60,67,0.1); }
body.light-mode .profile-section-title { color: rgba(60,60,67,0.4); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
body.light-mode .profile-label { color: rgba(60,60,67,0.5); }
body.light-mode .profile-value { color: #000000; font-weight: 500; }

/* --- STATUS POPOVER --- */
body.light-mode .status-popover {
    background: rgba(255,255,255,0.97); border: 1px solid rgba(60,60,67,0.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
}
body.light-mode .status-option { color: rgba(60,60,67,0.85); border-bottom: 1px solid rgba(60,60,67,0.06); }
body.light-mode .status-option:hover { background: rgba(120,120,128,0.07); color: #000000; }

/* --- COMING SOON OVERLAYS --- */
body.light-mode .home-premium-wrapper { background: #F2F2F7; }
body.light-mode .chat-cs-card { background: rgba(255,255,255,0.97); border: 1px solid rgba(60,60,67,0.1); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
body.light-mode .chat-cs-title { color: #000000; font-weight: 700; }
body.light-mode .chat-cs-text { color: rgba(60,60,67,0.55); }
body.light-mode .coming-soon-overlay {
    background: linear-gradient(180deg, rgba(242,242,247,0.1) 0%, rgba(242,242,247,0.88) 55%, rgba(242,242,247,0.97) 100%);
}
body.light-mode .cs-content-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
body.light-mode .cs-icon-wrapper {
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.01));
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: rgba(60,60,67,0.7);
    box-shadow: none;
}
body.light-mode .cs-title {
    background: linear-gradient(to right, #111827, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.light-mode .cs-subtitle { color: rgba(60,60,67,0.55); }

/* --- REVENUE MODAL --- */
body.light-mode .revenue-modal-card { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1); box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
body.light-mode .revenue-modal-card h3 { color: #000000; font-weight: 600; }
body.light-mode .rev-modal-icon { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
body.light-mode .rev-info-box { background: rgba(242,242,247,0.8); border: 1px solid rgba(60,60,67,0.08); }
body.light-mode .rev-info-item { color: rgba(60,60,67,0.8); }
body.light-mode .rev-input-group label { color: rgba(60,60,67,0.75); font-weight: 500; }
body.light-mode .rev-input-group input { background: rgba(120,120,128,0.1); border: 1px solid rgba(60,60,67,0.1); color: #000000; }
body.light-mode .rev-input-group input:focus { border-color: #007AFF; box-shadow: 0 0 0 3px rgba(0,122,255,0.1); background: rgba(0,122,255,0.04); }
body.light-mode .btn-rev-skip { border: 1px solid rgba(60,60,67,0.12); color: rgba(60,60,67,0.7); }
body.light-mode .filter-trigger-btn { background: rgba(120,120,128,0.1); border-color: rgba(60,60,67,0.1); color: #000000; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.light-mode .filter-panel { background: rgba(255,255,255,0.98); border-color: rgba(60,60,67,0.1); box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.1); backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%); }
body.light-mode .fp-section-btn { color: rgba(60,60,67,0.75); font-weight: 600; font-size: 13px; letter-spacing: 0.1px; }
body.light-mode .fp-section-btn:hover { background: rgba(120,120,128,0.08); }
body.light-mode .fp-sub-btn { background: rgba(120,120,128,0.07); border-color: rgba(60,60,67,0.09); color: rgba(60,60,67,0.75); font-size: 12px; }
body.light-mode .fp-sub-btn:hover { background: rgba(0,122,255,0.08); color: #007AFF; border-color: rgba(0,122,255,0.2); }
body.light-mode .fp-divider { background: rgba(60,60,67,0.08); }
body.light-mode .btn-rev-skip:hover { background: rgba(120,120,128,0.1); color: #000000; }
body.light-mode .btn-rev-save { box-shadow: none; }
body.light-mode .btn-rev-save:hover { box-shadow: none; transform: none; }

/* --- LEAD PROFILE VIEW --- */
body.light-mode .profile-view-header { background: rgba(242,242,247,0.92); border-bottom: 1px solid rgba(60,60,67,0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body.light-mode .btn-back-profile { border: 1px solid rgba(60,60,67,0.14); color: #000000; background: rgba(120,120,128,0.1); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.light-mode .btn-back-profile:hover { background: rgba(120,120,128,0.2); border-color: rgba(60,60,67,0.22); }
body.light-mode .profile-view-header span { color: #000000; font-weight: 600; }
body.light-mode .profile-hero { border-bottom: 1px solid rgba(60,60,67,0.06); background: #FFFFFF; padding-bottom: 20px; }
body.light-mode .profile-avatar-large { background: #1C1C1E; color: #FFFFFF; border: none; box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
body.light-mode .profile-hero-info h1 { color: #000000; font-weight: 700; letter-spacing: -0.3px; }
body.light-mode .profile-hero-info p { color: rgba(60,60,67,0.55); }
body.light-mode .info-card { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.07); box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 0.5px rgba(60,60,67,0.05); }
body.light-mode .info-card:hover { background: rgba(0,122,255,0.03); transform: none; }
body.light-mode .info-label { color: rgba(60,60,67,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
body.light-mode .info-value { color: #000000; font-weight: 500; }
body.light-mode .info-value i, body.light-mode .info-value em { color: rgba(60,60,67,0.4); font-style: italic; }
body.light-mode .history-section { background: #FFFFFF; border: 1px solid rgba(60,60,67,0.07); box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 0.5px rgba(60,60,67,0.05); }
body.light-mode .history-title { color: #000000; font-weight: 600; }
body.light-mode .timeline::before { background: rgba(60,60,67,0.12); }
body.light-mode .timeline-dot { border: 2px solid #F2F2F7; }
body.light-mode .timeline-status { color: #000000; font-weight: 500; }
body.light-mode .timeline-time { color: rgba(60,60,67,0.45); }

/* --- MOBILE LEADS LIST --- */
body.light-mode .mobile-lead-card { background: #FFFFFF; border-color: rgba(60,60,67,0.08); box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 0.5px rgba(60,60,67,0.06); }
body.light-mode .mobile-lead-card:active { background: rgba(120,120,128,0.06); border-color: rgba(60,60,67,0.15); }
body.light-mode .m-lead-name { color: #000000; font-weight: 500; }
body.light-mode .m-lead-date { color: rgba(60,60,67,0.4); }
body.light-mode .m-lead-treatment { color: rgba(60,60,67,0.5); }
body.light-mode .m-rdv-date { color: #248A3D; }
body.light-mode .reapply-badge { background: rgba(52,199,89,0.1); border-color: rgba(52,199,89,0.3); color: #248A3D; }
body.light-mode .btn-call-mobile {
    background: rgba(120,120,128,0.1);
    border: 1px solid rgba(60,60,67,0.12);
    color: rgba(60,60,67,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: none;
}
body.light-mode .btn-call-mobile:hover { background: rgba(120,120,128,0.18); border-color: rgba(60,60,67,0.2); transform: scale(1.05); }
body.light-mode .btn-call-mobile.called { background: rgba(52,199,89,0.12); border-color: rgba(52,199,89,0.3); color: #248A3D; }

/* --- RDV CELL & ROW DATE PICKER --- */
body.light-mode .rdv-cell:hover { background: rgba(0,122,255,0.05); }
body.light-mode #row-date-picker-modal {
    background: #FFFFFF; border: 1px solid rgba(60,60,67,0.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* ============================================================
   LIGHT MODE — ADDITIONAL OVERRIDES (pass 2)
   Covers: mock elements, badge-glass, status shadow, caret,
   lp-status, send-btn, timeline helpers, new CSS classes,
   and all remaining dark-hardcoded elements.
   ============================================================ */

/* --- STATUS BADGE HOVER — remove shadow --- */
body.light-mode .crm-badge.actionable:hover {
    filter: brightness(0.94);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- BADGE-GLASS in light mode — make it visible --- */
body.light-mode .badge-glass {
    background: rgba(120,120,128,0.1);
    border: 1px solid rgba(60,60,67,0.1);
    color: rgba(60,60,67,0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
body.light-mode .badge-grey {
    background: transparent;
    border: 1px solid transparent;
    color: #34C759;
    font-weight: 600;
    font-size: 12px;
}

/* --- ACCOUNT SWITCHER CARET --- */
body.light-mode .account-switcher .ph-caret-down,
body.light-mode .account-switcher i[style*="color: #666"] {
    color: rgba(60,60,67,0.35) !important;
}

/* --- LP-STATUS (lead profile page subtitle) --- */
body.light-mode #lp-status { color: rgba(60,60,67,0.7); font-weight: 500; }

/* --- MOCK ELEMENTS (Analytics & AI views — blurred previews) --- */
body.light-mode .mock-top-card {
    background: #FFFFFF;
    border: 1px solid rgba(60,60,67,0.08);
    color: rgba(60,60,67,0.75);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.light-mode .mock-top-card.accent { color: #ef4444; }
body.light-mode .mock-top-card span[style*="color:#fff"],
body.light-mode .mock-top-card span[style*="color: #fff"] { color: #000000 !important; }
body.light-mode .mock-panel {
    background: #FFFFFF;
    border: 1px solid rgba(60,60,67,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.light-mode .mock-panel-title { color: rgba(60,60,67,0.5); }
body.light-mode .mock-rev-item {
    background: rgba(120,120,128,0.08);
}
body.light-mode .mock-rev-label { color: rgba(60,60,67,0.5); }
body.light-mode .mock-rev-val { color: #000000; font-weight: 500; }
body.light-mode .mock-bar-chart { border-bottom: 1px solid rgba(60,60,67,0.1); }
body.light-mode .mock-ai-stat {
    background: #FFFFFF;
    border: 1px solid rgba(60,60,67,0.08);
    color: rgba(60,60,67,0.75);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.light-mode .mock-ai-chat-area {
    background: rgba(242,242,247,0.8);
    border: 1px solid rgba(60,60,67,0.08);
}
body.light-mode .mock-ai-bubble.left {
    background: rgba(120,120,128,0.14);
    color: rgba(60,60,67,0.8);
}
body.light-mode .mock-ai-input {
    background: rgba(120,120,128,0.1);
    border: 1px solid rgba(60,60,67,0.08);
}

/* --- CS-BADGE (coming soon "Pending Review") dot shadow --- */
body.light-mode .cs-badge-dot { box-shadow: none; }

/* --- TIMELINE HELPER CLASSES (replaces old inline styles) --- */
.timeline-loading { font-size: 12px; color: #666; }
.timeline-empty   { font-size: 12px; color: #666; }
.timeline-error   { font-size: 12px; color: #ef4444; }
.timeline-details { font-size: 12px; margin-top: 2px; line-height: 1.4; color: #ccc; }
body.light-mode .timeline-loading { color: rgba(60,60,67,0.45); }
body.light-mode .timeline-empty   { color: rgba(60,60,67,0.45); }
body.light-mode .timeline-details { color: rgba(60,60,67,0.7); }

/* --- CHAT HELPER CLASSES (replaces old inline styles) --- */
.chat-list-empty  { padding: 40px; text-align: center; color: #666; font-size: 13px; }
.chat-feed-empty  { text-align: center; margin-top: 50px; color: #444; font-size: 13px; }
.chat-feed-error  { text-align: center; color: #ef4444; margin-top: 20px; font-size: 13px; }
.no-pages-text    { color: #666; font-style: italic; }
body.light-mode .chat-list-empty { color: rgba(60,60,67,0.45); }
body.light-mode .chat-feed-empty { color: rgba(60,60,67,0.6); }
body.light-mode .no-pages-text   { color: rgba(60,60,67,0.45); }

.chat-load-older-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 24px); margin: 12px; padding: 10px 16px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6); border-radius: 10px;
    font-family: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.chat-load-older-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.chat-load-older-btn.loading { opacity: 0.5; cursor: wait; }
.chat-load-older-btn i { font-size: 14px; }
body.light-mode .chat-load-older-btn {
    background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); color: rgba(60,60,67,0.6);
}
body.light-mode .chat-load-older-btn:hover {
    background: rgba(0,0,0,0.06); color: rgba(60,60,67,0.9);
}

/* --- MOBILE CARD NOTES (replaces old inline style) --- */
.m-note-preview {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}
body.light-mode .m-note-preview { color: rgba(60,60,67,0.5); }

/* --- AVG-REACTION-TIME hardcoded white in index.html --- */
body.light-mode #avg-reaction-time { color: #000000 !important; font-weight: 700; }
/* clock icon color is JS-controlled via setReactionIcon() */

/* --- MOCK AI STAT inline white text spans --- */
body.light-mode .mock-ai-stat span[style*="color:#fff"],
body.light-mode .mock-ai-stat span[style*="color: #fff"] { color: #000000 !important; }

/* --- INFO ICON in chat header --- */
body.light-mode .ph-info { color: rgba(60,60,67,0.35) !important; }

/* --- VIEW BG overrides (belt + suspenders against inline style="background:#000") --- */
body.light-mode #view-lead-profile { background: #F2F2F7 !important; }
body.light-mode #view-settings { background: #F2F2F7 !important; }

/* --- LEADS INFO LABELS — bump contrast in light mode --- */
body.light-mode .info-label { color: rgba(60,60,67,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }

/* --- PROFILE SECTION TITLE (chat panel) — not too faint --- */
body.light-mode .profile-section-title { color: rgba(60,60,67,0.4); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* --- SWITCHER CARET --- */
.switcher-caret { color: #666; font-size: 14px; }
body.light-mode .switcher-caret { color: rgba(60,60,67,0.35); }

/* --- AVG REACTION TIME default (dark mode) color --- */
#avg-reaction-time { color: #fff; }

/* --- VIRTUAL ASSISTANT TOGGLE --- */
.va-toggle {
    width: 38px;
    height: 22px;
    background: #3a3a3a;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.28s ease;
    flex-shrink: 0;
}
.va-toggle.va-on { background: #34c759; }
.va-toggle.va-updating { opacity: 0.6; pointer-events: none; }
.va-toggle-knob {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    pointer-events: none;
}
.va-toggle.va-on .va-toggle-knob { transform: translateX(16px); }

/* Light mode VA toggle */
body.light-mode #va-toggle-wrapper {
    background: rgba(0,0,0,0.04) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}
body.light-mode #va-toggle-wrapper span { color: rgba(60,60,67,0.6) !important; }
body.light-mode #va-toggle-wrapper .ph-robot { color: rgba(60,60,67,0.4) !important; }
body.light-mode .va-toggle { background: rgba(120,120,128,0.25); }
body.light-mode .va-toggle.va-on { background: #34C759; }
body.light-mode .va-toggle-knob { box-shadow: 0 1px 4px rgba(0,0,0,0.2); }

/* ================================================================
   SANTIDENTY v2.1 — ENHANCEMENTS
   ================================================================ */

/* === TOAST NOTIFICATION (CSS-driven) === */
.sdnt-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 22, 28, 0.96);
    color: #fff;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16,1,0.3,1), transform 0.25s cubic-bezier(0.16,1,0.3,1);
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.sdnt-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
body.light-mode .sdnt-toast {
    background: rgba(255,255,255,0.97);
    border: 1px solid rgba(60,60,67,0.12);
    color: #000000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    background: rgba(255,255,255,0.96);
    color: #111827;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

/* === SMS — COMING SOON BADGE IN NAV === */
.nav-soon-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 2px 5px;
    margin-left: auto;
    flex-shrink: 0;
}
body.light-mode .nav-soon-badge {
    color: rgba(0,0,0,0.35);
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
}

/* === SKELETON SHIMMER === */
@keyframes sdnt-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: sdnt-shimmer 1.5s infinite linear;
    border-radius: 6px;
    display: inline-block;
}
body.light-mode .skeleton {
    background: linear-gradient(
        90deg,
        rgba(0,0,0,0.04) 25%,
        rgba(0,0,0,0.09) 50%,
        rgba(0,0,0,0.04) 75%
    );
    background-size: 200% 100%;
}
.skeleton-line { height: 12px; width: 100%; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* === COMING SOON — CTA BUTTON === */
.cs-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 22px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.3px;
    cursor: default;
    user-select: none;
    transition: background 0.2s, border-color 0.2s;
}
.cs-cta-btn i { font-size: 14px; }

/* === GMAIL MODULE — CSS CLASSES (replaces inline styles) === */

/* Top bar */
.gmail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.gmail-topbar-left { display: flex; align-items: center; gap: 12px; }
.gmail-status-indicator { display: flex; align-items: center; gap: 8px; }
.gmail-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,0.6);
    flex-shrink: 0;
}
.gmail-connected-address { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.5); }
.gmail-ai-savings-pill {
    font-size: 11px; color: rgba(255,255,255,0.25);
    padding: 3px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
}
.gmail-topbar-right { display: flex; align-items: center; gap: 8px; }
.gmail-last-sync-text { font-size: 11px; color: rgba(255,255,255,0.2); }

/* Body split */
.gmail-body-split { display: flex; flex: 1; overflow: hidden; }

/* Left panel */
.gmail-left-panel {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.gmail-tabs-row { display: flex; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.gmail-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.3);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.gmail-tab-btn.active       { color: rgba(255,255,255,0.7); border-bottom-color: #06b6d4; }
.gmail-tab-btn.active-sent  { color: rgba(255,255,255,0.7); border-bottom-color: #22c55e; }
.gmail-tab-count {
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 4px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
}
.gmail-tab-count.active-count {
    background: rgba(6,182,212,0.2);
    color: #06b6d4;
}
.gmail-list-scroll { flex: 1; overflow-y: auto; padding: 8px; }

/* Right panel */
.gmail-right-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Empty/all-caught-up state */
.gmail-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255,255,255,0.15);
}
.gmail-all-done-icon-wrap {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    display: flex; align-items: center; justify-content: center;
}
.gmail-all-done-title { font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.gmail-all-done-sub  { font-size: 13px; color: rgba(255,255,255,0.3); }

/* Draft / Skipped / Sent viewers */
.gmail-viewer-panel { display: none; flex-direction: column; height: 100%; overflow: hidden; }

.gmail-viewer-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.gmail-viewer-subject    { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.gmail-viewer-subject.muted { color: rgba(255,255,255,0.6); }
.gmail-viewer-meta-row   { display: flex; align-items: center; gap: 12px; }
.gmail-sender-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(6,182,212,0.3), rgba(99,102,241,0.3));
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #06b6d4;
}
.gmail-sender-name  { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); }
.gmail-sender-email { font-size: 11px; color: rgba(255,255,255,0.35); }
.gmail-viewer-time  { margin-left: auto; font-size: 11px; color: rgba(255,255,255,0.25); }

.gmail-viewer-scroll { flex: 1; overflow-y: auto; padding: 0 24px; }

/* Original email block */
.gmail-original-block {
    margin: 16px 0; padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
}
.gmail-block-label {
    font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.2);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 10px;
}
.gmail-block-label.ai-label { color: rgba(6,182,212,0.7); display: flex; align-items: center; gap: 6px; }
.gmail-block-text { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.7; white-space: pre-wrap; }
.gmail-block-hint { font-size: 10px; color: rgba(255,255,255,0.2); }

/* AI draft reply area */
.gmail-draft-section { margin: 16px 0; }
.gmail-draft-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gmail-reply-textarea {
    width: 100%; min-height: 180px;
    background: rgba(6,182,212,0.04);
    border: 1px solid rgba(6,182,212,0.15);
    border-radius: 12px;
    padding: 14px 16px;
    color: rgba(255,255,255,0.8);
    font-size: 13px; font-family: inherit; line-height: 1.7;
    resize: vertical; outline: none;
    transition: border-color 0.2s;
}
.gmail-reply-textarea:focus { border-color: rgba(6,182,212,0.4); }

/* Action bar */
.gmail-action-bar {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
    background: #000;
}
.btn-gmail-send {
    flex: 1; padding: 12px;
    background: linear-gradient(135deg, #06b6d4, #0072ff);
    border: none; border-radius: 10px;
    color: #fff; font-size: 13px; font-weight: 700; font-family: inherit;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity 0.2s;
}
.btn-gmail-send:hover { opacity: 0.9; }
.btn-gmail-send:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gmail-discard {
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: rgba(255,255,255,0.4);
    font-size: 13px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: background 0.2s;
}
.btn-gmail-discard:hover { background: rgba(255,255,255,0.07); }

/* Skipped viewer */
.gmail-ai-reason-badge {
    padding: 12px 14px;
    background: rgba(245,158,11,0.05);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 12px; color: rgba(245,158,11,0.7);
    display: flex; align-items: center; gap: 8px;
}
.gmail-snippet-text { font-size: 13px; color: rgba(255,255,255,0.4); line-height: 1.7; white-space: pre-wrap; }
.btn-gmail-requeue {
    width: 100%; padding: 12px;
    background: rgba(6,182,212,0.08);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 10px;
    color: #06b6d4; font-size: 13px; font-weight: 700; font-family: inherit;
    cursor: pointer; transition: background 0.2s;
}
.btn-gmail-requeue:hover { background: rgba(6,182,212,0.14); }

/* Sent viewer */
.gmail-sent-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.gmail-sent-subject-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gmail-sent-reply-label {
    font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.25);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.gmail-sent-reply-body {
    font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.7; white-space: pre-wrap;
    background: rgba(34,197,94,0.04);
    border: 1px solid rgba(34,197,94,0.12);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 20px;
}
.gmail-sent-original-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }

/* === GMAIL MOBILE RESPONSIVE === */
@media (max-width: 700px) {
    .gmail-body-split { position: relative; }
    .gmail-left-panel { width: 100%; border-right: none; }
    .gmail-right-panel {
        position: absolute;
        inset: 0;
        background: #000;
        z-index: 10;
        display: none !important;
    }
    .gmail-body-split.mobile-email-active .gmail-left-panel { display: none; }
    .gmail-body-split.mobile-email-active .gmail-right-panel { display: flex !important; }
    .gmail-mobile-back {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 0 0 12px 0;
        background: none;
        border: none;
        color: rgba(255,255,255,0.5);
        font-size: 13px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
    }
}
@media (min-width: 701px) {
    .gmail-mobile-back { display: none; }
}

/* Light mode Gmail */
body.light-mode .gmail-topbar       { border-bottom-color: rgba(0,0,0,0.07); }
body.light-mode .gmail-left-panel   { border-right-color: rgba(0,0,0,0.07); }
body.light-mode .gmail-tabs-row     { border-bottom-color: rgba(0,0,0,0.07); }
body.light-mode .gmail-viewer-header { border-bottom-color: rgba(0,0,0,0.07); }
body.light-mode .gmail-action-bar   { background: rgba(242,242,247,0.9); border-top-color: rgba(60,60,67,0.08); }
body.light-mode .gmail-connected-address { color: rgba(60,60,67,0.5); }
body.light-mode .gmail-last-sync-text { color: rgba(0,0,0,0.3); }
body.light-mode .gmail-sender-name  { color: rgba(0,0,0,0.85); font-weight: 500; }
body.light-mode .gmail-viewer-subject { color: #000000; font-weight: 600; }
body.light-mode .gmail-viewer-subject.muted { color: rgba(0,0,0,0.5); }
body.light-mode .gmail-block-text   { color: rgba(0,0,0,0.5); }
body.light-mode .gmail-reply-textarea { background: rgba(0,122,255,0.03); color: rgba(0,0,0,0.82); }
body.light-mode .gmail-snippet-text { color: rgba(0,0,0,0.4); }
body.light-mode .gmail-original-block { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
body.light-mode .gmail-all-done-title { color: rgba(60,60,67,0.7); font-weight: 500; }
body.light-mode .gmail-all-done-sub  { color: rgba(60,60,67,0.38); }
body.light-mode .btn-gmail-discard { background: rgba(120,120,128,0.08); border-color: rgba(60,60,67,0.1); color: rgba(60,60,67,0.5); }
body.light-mode .gmail-tab-btn { color: rgba(60,60,67,0.35); }
body.light-mode .gmail-tab-btn.active { color: #007AFF; font-weight: 600; }
body.light-mode #gmail-right-panel, 
body.light-mode .gmail-right-panel { background: #F2F2F7; }
body.light-mode .gmail-sent-reply-body { color: rgba(0,0,0,0.55); background: rgba(34,197,94,0.04); }

/* === SETTINGS: INTEGRATION STATUS DOTS === */
.integration-status-dot {
    display: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
    flex-shrink: 0;
    animation: status-dot-pulse 2s ease-in-out infinite;
}
.integration-status-dot.connected {
    display: inline-block;
}
@keyframes status-dot-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(34, 197, 94, 0.5); }
    50%       { box-shadow: 0 0 10px rgba(34, 197, 94, 0.9); }
}
body.light-mode .integration-status-dot { box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }

/* =============================================================
   TAB PERMISSIONS — LOCK ICONS & LOCKED OVERLAY
   ============================================================= */

/* ── Padlock icon on locked nav items ── */
.nav-lock-icon {
    margin-left: auto;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: color 0.2s;
}

.nav-item:hover .nav-lock-icon,
.mobile-drawer-item:hover .nav-lock-icon {
    color: rgba(255, 255, 255, 0.45);
}
.nav-item {
    display: flex;
    align-items: center;
}
.mobile-drawer-item {
    display: flex;
    align-items: center;
}
body.light-mode .nav-lock-icon {
    color: rgba(60,60,67,0.3);
    color: rgba(0, 0, 0, 0.25);
}
body.light-mode .nav-item:hover .nav-lock-icon,
body.light-mode .mobile-drawer-item:hover .nav-lock-icon {
    color: rgba(0, 0, 0, 0.45);
}

/* ── Locked tab overlay — sits inside main-content, above views ── */
.tab-locked-overlay {
    position: absolute;
    inset: 0;
    top: 60px; /* clear the top-header */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 24px;
}

.tlo-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 48px 40px 40px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    animation: tlo-in 0.25s ease;
}

@keyframes tlo-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tlo-lock-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.tlo-lock-badge i {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.4);
}

.tlo-feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tlo-feature-icon i {
    font-size: 28px;
    color: #06b6d4;
}

.tlo-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.tlo-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.65;
    max-width: 320px;
}

.tlo-request-btn {
    margin-top: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    border: none;
    background: #06b6d4;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
    font-family: inherit;
}
.tlo-request-btn:hover:not(:disabled) {
    opacity: 0.85;
}
.tlo-request-btn.requested,
.tlo-request-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: default;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light mode overrides */
body.light-mode .tab-locked-overlay {
    background: rgba(255, 255, 255, 0.6);
}
body.light-mode .tlo-card {
    background: #FFFFFF;
    border: 1px solid rgba(60,60,67,0.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}
body.light-mode .tlo-lock-badge {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
}
body.light-mode .tlo-lock-badge i {
    color: rgba(0,0,0,0.35);
}
body.light-mode .tlo-title {
    color: #0a0a0a;
}
body.light-mode .tlo-desc {
    color: rgba(0,0,0,0.5);
}
body.light-mode .tlo-request-btn.requested,
body.light-mode .tlo-request-btn:disabled {
    background: rgba(0,0,0,0.07);
    color: rgba(0,0,0,0.4);
    border-color: rgba(0,0,0,0.1);
}

/* Make sure main-content has position:relative for overlay positioning */
.main-content {
    position: relative;
}


/* =============================================================
   LOADING COVER — shown on reload while preInit fetches data
   ============================================================= */
#sdnt-loading-cover {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 999998; /* just below login overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease;
}
#sdnt-loading-cover.hidden {
    opacity: 0;
    pointer-events: none;
}
body.light-mode #sdnt-loading-cover {
    background: #F2F2F7;
}

.sdnt-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: sdnt-spin 0.7s linear infinite;
}
@keyframes sdnt-spin {
    to { transform: rotate(360deg); }
}
body.light-mode .sdnt-spinner {
    border-color: rgba(0, 0, 0, 0.08);
    border-top-color: #06b6d4;
}
/* ═══════════════════════════════════════════════════════════
   ANALYTICS DASHBOARD
═══════════════════════════════════════════════════════════ */

.an-wrapper {
    padding: 20px 24px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Header */
.an-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.an-header-left { display: flex; flex-direction: column; gap: 3px; }
.an-title {
    font-size: 15px;
    font-weight: 800;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 7px;
}
.an-title i { color: #06b6d4; font-size: 16px; }
.an-period-total {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    font-weight: 500;
}

/* Period pills */
.an-period-pills {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 4px;
}
.an-period-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
}
.an-period-btn:hover { color: rgba(255,255,255,0.6); }
.an-period-btn.active {
    background: rgba(6,182,212,0.15);
    color: #06b6d4;
    border: 1px solid rgba(6,182,212,0.3);
}

/* KPI grid */
.an-kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.an-kpi-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    animation: kpiPop 0.4s both;
    transition: border-color 0.2s, background 0.2s;
}
.an-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--kpi-glow, transparent);
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s;
}
.an-kpi-card:hover::before { opacity: 1; }
.an-kpi-card:hover { border-color: rgba(255,255,255,0.12); }

@keyframes kpiPop {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.an-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--kpi-color, #06b6d4);
    font-size: 16px;
}
.an-kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-kpi-label { font-size: 10px; color: rgba(255,255,255,0.3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.an-kpi-value { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.1; }
.an-kpi-sub { font-size: 10px; color: rgba(255,255,255,0.25); }

/* Chart cards */
.an-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.an-card-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.an-card-title i { font-size: 13px; color: rgba(255,255,255,0.25); }
.an-card-wide { grid-column: span 2; }

.an-chart-box { position: relative; }
.an-chart-box canvas { display: block; width: 100% !important; }

/* Grid layouts */
.an-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}
.an-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Empty state */
.an-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 120px;
    color: rgba(255,255,255,0.12);
    font-size: 11px;
}
.an-empty i { font-size: 24px; }

/* Light mode overrides */
body.light-mode .an-kpi-card,
body.light-mode .an-card {
    background: #FFFFFF;
    border: 1px solid rgba(60,60,67,0.07);
    box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 0.5px rgba(60,60,67,0.05);
}
body.light-mode .an-title { color: #000000; font-weight: 700; }
body.light-mode .an-kpi-label { color: rgba(60,60,67,0.45); }
body.light-mode .an-card-title { color: rgba(60,60,67,0.5); }
body.light-mode .an-card-title i { color: rgba(60,60,67,0.25); }
body.light-mode .an-kpi-value { color: #000000; font-weight: 700; }
body.light-mode .an-period-pills {
    background: rgba(120,120,128,0.12);
    border-color: transparent;
    border-radius: 9px;
    padding: 3px;
}
body.light-mode .an-period-btn { color: rgba(60,60,67,0.5); font-weight: 600; }
body.light-mode .an-period-btn.active { background: #FFFFFF; color: #000000; font-weight: 600; border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }

/* Mobile responsive */
@media (max-width: 900px) {
    .an-wrapper { padding: 14px 12px; gap: 12px; }
    .an-kpis { grid-template-columns: repeat(2, 1fr); }
    .an-kpis .an-kpi-card:last-child { grid-column: span 2; }
    .an-grid-2 { grid-template-columns: 1fr; }
    .an-grid-2 .an-card-wide { grid-column: span 1; }
    .an-grid-3 { grid-template-columns: 1fr; }
    .an-period-pills { flex-wrap: wrap; }
    .an-kpi-value { font-size: 18px; }
}
/* ─── SETTINGS: INLINE STYLE OVERRIDES FOR LIGHT MODE ─────────────────────── */

/* Gmail connect button (inline bg: rgba(255,255,255,0.05), inline color: rgba(255,255,255,0.7)) */
body.light-mode #btn-connect-gmail {
    background: rgba(120,120,128,0.1) !important;
    border: 1px solid rgba(60,60,67,0.15) !important;
    color: #000000 !important;
}
body.light-mode #btn-connect-gmail:hover {
    background: rgba(120,120,128,0.18) !important;
}

/* Gmail disconnect button (inline: border rgba(255,255,255,0.08), color rgba(255,255,255,0.25)) */
body.light-mode #btn-disconnect-gmail {
    background: rgba(255,59,48,0.06) !important;
    border: 1px solid rgba(255,59,48,0.2) !important;
    color: #FF3B30 !important;
}
body.light-mode #btn-disconnect-gmail:hover {
    background: rgba(255,59,48,0.12) !important;
}

/* Pages connected address (inline: color rgba(255,255,255,0.5)) */
body.light-mode #gmail-connected-address {
    color: rgba(60,60,67,0.55) !important;
}

/* Gmail not-connected panel note text (inline: color rgba(255,255,255,0.2)) */
body.light-mode #gmail-not-connected [style*="color:rgba(255,255,255"],
body.light-mode #gmail-not-connected [style*="color: rgba(255,255,255"] {
    color: rgba(60,60,67,0.5) !important;
}

/* Meta not-connected panel note text */
body.light-mode #meta-not-connected [style*="color:rgba(255,255,255"],
body.light-mode #meta-not-connected [style*="color: rgba(255,255,255"] {
    color: rgba(60,60,67,0.5) !important;
}

/* Any inline white-ish text inside settings ps-rows → force readable */
body.light-mode .ps-row [style*="color:rgba(255,255,255"],
body.light-mode .ps-row [style*="color: rgba(255,255,255"] {
    color: rgba(60,60,67,0.6) !important;
}

/* Gmail last-sync text */
body.light-mode .gmail-last-sync-text {
    color: rgba(60,60,67,0.35) !important;
}
/* =============================================================
   SANTIDENTY AI CHAT
   ============================================================= */

#view-santidentyai.active-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* ── WELCOME ─────────────────────────────────────────────────── */
.sai-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 20px;
    text-align: center;
    animation: saiFadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes saiFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sai-welcome-logo {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sai-logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: saiSpinRing 7s linear infinite;
    background: conic-gradient(
        from 0deg,
        rgba(6,182,212,0)   0%,
        rgba(6,182,212,0.6) 40%,
        rgba(99,102,241,0.4) 60%,
        rgba(6,182,212,0)   100%
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
    mask:         radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
}

@keyframes saiSpinRing { to { transform: rotate(360deg); } }

.sai-logo-core {
    position: relative;
    z-index: 2;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(6,182,212,0.18), rgba(0,0,0,0.65));
    border: 1px solid rgba(6,182,212,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 24px rgba(6,182,212,0.18), inset 0 1px 0 rgba(255,255,255,0.07);
}

.sai-welcome-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(17px, 3vw, 24px);
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.35;
}

.sai-welcome-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.33);
    margin: 0 0 30px;
    max-width: 400px;
    line-height: 1.6;
}

.sai-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 540px;
}

@media (max-width: 480px) { .sai-suggestions { grid-template-columns: 1fr; } }

.sai-suggest-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    color: rgba(255,255,255,0.58);
    font-size: 12.5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.sai-suggest-btn i { font-size: 15px; color: #06b6d4; flex-shrink: 0; }

.sai-suggest-btn:hover {
    background: rgba(6,182,212,0.07);
    border-color: rgba(6,182,212,0.25);
    color: rgba(255,255,255,0.85);
    transform: translateY(-1px);
}

/* ── MESSAGES ────────────────────────────────────────────────── */
.sai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 8px;
    display: none;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.sai-messages::-webkit-scrollbar { width: 3px; }
.sai-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 2px; }

.sai-msg {
    display: flex;
    gap: 10px;
    animation: saiFadeUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sai-msg.user      { flex-direction: row-reverse; align-self: flex-end;  max-width: 78%; }
.sai-msg.assistant { align-self: flex-start;                              max-width: 88%; }

.sai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 800;
}

.sai-msg.assistant .sai-msg-avatar {
    background: radial-gradient(circle at 35% 35%, rgba(6,182,212,0.2), rgba(0,0,0,0.55));
    border: 1px solid rgba(6,182,212,0.28);
    color: #06b6d4;
}

.sai-msg.user .sai-msg-avatar {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
}

.sai-msg-bubble {
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.65;
}

.sai-msg.user .sai-msg-bubble {
    background: linear-gradient(135deg, rgba(6,182,212,0.18), rgba(99,102,241,0.12));
    border: 1px solid rgba(6,182,212,0.22);
    color: rgba(255,255,255,0.88);
    border-top-right-radius: 4px;
}

.sai-msg.assistant .sai-msg-bubble {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.8);
    border-top-left-radius: 4px;
}

.sai-msg-bubble.error {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.18);
    color: rgba(239,68,68,0.78);
}

.sai-msg-bubble strong { color: #fff; font-weight: 700; }
.sai-msg-bubble em     { color: rgba(255,255,255,0.5); font-style: italic; }
.sai-msg-bubble ul     { margin: 7px 0 3px 16px; padding: 0; list-style: disc; }
.sai-msg-bubble li     { margin-bottom: 3px; color: rgba(255,255,255,0.76); }

/* ── THINKING ────────────────────────────────────────────────── */
.sai-thinking {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 24px;
    animation: saiFadeIn 0.35s ease both;
}

@keyframes saiFadeIn { from { opacity: 0; } to { opacity: 1; } }

.sai-thinking-avatar {
    position: relative;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sai-think-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.sai-think-ring-1 {
    animation: saiThinkSpin1 3s linear infinite;
    background: conic-gradient(from 0deg, rgba(6,182,212,0) 0%, rgba(6,182,212,0.65) 35%, rgba(6,182,212,0) 70%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
    mask:         radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
}

.sai-think-ring-2 {
    inset: 8px;
    animation: saiThinkSpin2 2s linear infinite reverse;
    background: conic-gradient(from 180deg, rgba(99,102,241,0) 0%, rgba(99,102,241,0.55) 35%, rgba(99,102,241,0) 70%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
    mask:         radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
}

@keyframes saiThinkSpin1 { to { transform: rotate(360deg); } }
@keyframes saiThinkSpin2 { to { transform: rotate(360deg); } }

.sai-think-core {
    position: relative;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(6,182,212,0.2), rgba(0,0,0,0.7));
    border: 1px solid rgba(6,182,212,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    animation: saiCoreGlow 2s ease-in-out infinite;
}

@keyframes saiCoreGlow {
    0%,100% { box-shadow: 0 0 10px rgba(6,182,212,0.2); }
    50%      { box-shadow: 0 0 26px rgba(6,182,212,0.5); }
}

.sai-thinking-dots { display: flex; gap: 5px; align-items: center; }

.sai-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(6,182,212,0.7);
    animation: saiDotBounce 1.2s ease-in-out infinite;
}
.sai-dot:nth-child(2) { animation-delay: 0.2s; }
.sai-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes saiDotBounce {
    0%,80%,100% { transform: scale(0.8); opacity: 0.4; }
    40%          { transform: scale(1.25); opacity: 1; }
}

.sai-thinking-label {
    font-size: 12px;
    color: rgba(255,255,255,0.28);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── INPUT BAR ───────────────────────────────────────────────── */
.sai-input-area {
    padding: 10px 18px 14px;
    flex-shrink: 0;
}

.sai-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 10px 10px 10px 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sai-input-bar:focus-within {
    border-color: rgba(6,182,212,0.38);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.05);
}

.sai-textarea {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: rgba(255,255,255,0.85);
    font-family: 'Montserrat', sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    resize: none;
    max-height: 140px;
    overflow-y: auto;
    padding: 2px 0;
}

.sai-textarea::placeholder { color: rgba(255,255,255,0.2); }
.sai-textarea::-webkit-scrollbar { width: 3px; }
.sai-textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }

.sai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #06b6d4, #0072ff);
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.35;
    transform: scale(0.94);
}

.sai-send-btn:not(:disabled) { opacity: 1; transform: scale(1); }
.sai-send-btn:not(:disabled):hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(6,182,212,0.38); }
.sai-send-btn:disabled { cursor: not-allowed; }

.sai-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 3px 0;
}

.sai-powered-by {
    font-size: 10.5px;
    color: rgba(255,255,255,0.18);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.03em;
}

.sai-powered-by i { color: rgba(6,182,212,0.45); font-size: 11px; }

.sai-clear-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.18);
    font-size: 11px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.sai-clear-btn:hover { color: rgba(239,68,68,0.65); }

/* ── LIGHT MODE ──────────────────────────────────────────────── */
body.light-mode .sai-welcome-title { color: #111; }
body.light-mode .sai-welcome-sub   { color: rgba(0,0,0,0.38); }

body.light-mode .sai-suggest-btn {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.09);
    color: rgba(0,0,0,0.6);
}
body.light-mode .sai-suggest-btn:hover {
    background: rgba(6,182,212,0.07);
    border-color: rgba(6,182,212,0.28);
    color: rgba(0,0,0,0.82);
}

body.light-mode .sai-input-bar {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}
body.light-mode .sai-textarea       { color: rgba(0,0,0,0.85); }
body.light-mode .sai-textarea::placeholder { color: rgba(0,0,0,0.28); }

body.light-mode .sai-msg.user .sai-msg-bubble {
    background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(99,102,241,0.08));
    border-color: rgba(6,182,212,0.2);
    color: rgba(0,0,0,0.85);
}
body.light-mode .sai-msg.assistant .sai-msg-bubble {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.07);
    color: rgba(0,0,0,0.75);
}
body.light-mode .sai-msg-bubble strong { color: #000; }
body.light-mode .sai-msg-bubble li    { color: rgba(0,0,0,0.72); }
body.light-mode .sai-thinking-label   { color: rgba(0,0,0,0.3); }
body.light-mode .sai-powered-by       { color: rgba(0,0,0,0.2); }
body.light-mode .sai-clear-btn        { color: rgba(0,0,0,0.2); }

/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sai-welcome    { padding: 24px 14px 14px; }
    .sai-messages   { padding: 14px 12px 6px; }
    .sai-input-area { padding: 8px 10px 12px; }
    .sai-msg.user, .sai-msg.assistant { max-width: 92%; }
    .sai-welcome-logo { width: 64px; height: 64px; }
    .sai-logo-core    { width: 48px; height: 48px; font-size: 17px; }
}
/* ============================================================
   MOBILE META INBOX — iOS-style search bar (no page selector)
   ============================================================ */
.mobile-chat-search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.mobile-chat-search-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    color: rgba(60, 60, 67, 0.45);
    pointer-events: none;
    z-index: 1;
}

.mobile-chat-search-input {
    width: 100%;
    background: rgba(118, 118, 128, 0.12);
    border: none;
    border-radius: 10px;
    padding: 9px 12px 9px 38px;
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: #000;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.2s ease;
}

.mobile-chat-search-input::placeholder {
    color: rgba(60, 60, 67, 0.45);
    font-weight: 400;
}

.mobile-chat-search-input:focus {
    background: rgba(118, 118, 128, 0.16);
}

/* Dark mode overrides */
body:not(.light-mode) .mobile-chat-search-input {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

body:not(.light-mode) .mobile-chat-search-input::placeholder {
    color: rgba(235, 235, 245, 0.45);
}

body:not(.light-mode) .mobile-chat-search-icon {
    color: rgba(235, 235, 245, 0.45);
}

body:not(.light-mode) .mobile-chat-search-input:focus {
    background: rgba(255, 255, 255, 0.12);
}

/* Override legacy search-input styles inside the mobile chat bar */
@media (max-width: 768px) {
    .chat-search-bar {
        padding: 10px 16px 10px 16px;
        background: #000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        gap: 0;
    }
    body.light-mode .chat-search-bar {
        background: #f2f2f7;
        border-bottom: 1px solid rgba(60, 60, 67, 0.08);
    }
    body.light-mode .mobile-chat-search-icon {
        color: rgba(60, 60, 67, 0.45);
    }
}

/* ============================================================
   FLAT CONVERSATION LIST — Instagram/DM style
   ============================================================ */

/* Bottom row: preview text + unread dot side by side */
.convo-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

/* Unread state — bold name */
.convo-name--unread {
    font-weight: 700 !important;
    color: #fff !important;
}
body.light-mode .convo-name--unread { color: #000 !important; }

/* Unread state — bold preview */
.convo-preview--unread {
    font-weight: 600 !important;
    color: rgba(255,255,255,0.75) !important;
}
body.light-mode .convo-preview--unread { color: rgba(0,0,0,0.75) !important; }

/* Blue unread dot (Instagram-style) */
.convo-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3478F6;
    flex-shrink: 0;
}

/* Larger avatar on mobile flat list */
@media (max-width: 900px) {
    .convo-avatar { width: 54px; height: 54px; }
    .convo-name { font-size: 15px; font-weight: 600; }
    .convo-preview { font-size: 13px; color: rgba(255,255,255,0.45); }
    .convo-time-display { font-size: 12px; color: rgba(255,255,255,0.35); }
    .convo-top-row { margin-bottom: 2px; align-items: center; }
    .convo-bottom-row { min-width: 0; }
    /* Platform badge scales with avatar */
    .platform-badge-icon { width: 20px; height: 20px; bottom: -1px; right: -1px; }
    .platform-badge-icon i { font-size: 11px; }
}

/* ============================================================
   SEARCH ROW + FILTER BUTTON
   ============================================================ */
.mobile-chat-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mobile-chat-search-row .mobile-chat-search-wrapper {
    flex: 1;
    min-width: 0;
}

/* Filter button */
.chat-filter-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.chat-filter-btn:active,
.chat-filter-btn.active {
    background: rgba(52,120,246,0.18);
    color: #3478F6;
}
body.light-mode .chat-filter-btn {
    background: rgba(120,120,128,0.12);
    color: rgba(60,60,67,0.55);
}
body.light-mode .chat-filter-btn.active {
    background: rgba(0,122,255,0.12);
    color: #007AFF;
}

/* ============================================================
   PLATFORM FILTER PILLS
   ============================================================ */
.chat-filter-pills {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 2px 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.chat-filter-pills::-webkit-scrollbar { display: none; }

.chat-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.chat-filter-pill i { font-size: 14px; }
.chat-filter-pill:active { opacity: 0.7; }

.chat-filter-pill.active {
    background: #3478F6;
    border-color: #3478F6;
    color: #fff;
}

body.light-mode .chat-filter-pill {
    border-color: rgba(60,60,67,0.2);
    color: rgba(60,60,67,0.55);
    background: transparent;
}
body.light-mode .chat-filter-pill.active {
    background: #007AFF;
    border-color: #007AFF;
    color: #fff;
}

/* ============================================================
   CHAT SEARCH BAR — scroll-to-hide animation
   ============================================================ */
#chat-container .chat-search-bar {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.28s ease,
                max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 120px;
    overflow: hidden;
    transform: translateY(0);
    opacity: 1;
    will-change: transform, opacity;
}

#chat-container .chat-search-bar--hidden {
    transform: translateY(-100%);
    opacity: 0;
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ============================================================
   CHAT PANEL — iOS-style conversation view
   ============================================================ */

/* Dark mode message feed */
.messages-feed { background: #000; }

/* Message input pill — dark mode */
.chat-input-pill { background: rgba(255,255,255,0.08); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: 1px solid rgba(255,255,255,0.13); }
.message-input::placeholder { color: rgba(235,235,245,0.45); }
.send-btn:active { background: #2060d0; transform: scale(0.94); }

/* Remove old msg-time absolute positioning issue — keep it subtle inline */
.msg-time { font-size: 11px; opacity: 0.5; font-weight: 500; display: block; line-height: 1; align-self: flex-end; white-space: nowrap; margin-top: 1px; }
.outgoing .msg-time { text-align: right; }
.incoming .msg-time { text-align: left; }

/* Date divider in messages */
.chat-date-label {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: rgba(235,235,245,0.45);
    padding: 10px 0 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.light-mode .chat-date-label { color: rgba(60,60,67,0.45); }

/* Active chat panel dark bg */
.active-chat-panel { background: #000; }
body.light-mode .active-chat-panel { background: #fff; }

/* Back button sizing */
.back-to-list-btn { font-size: 22px; padding: 0 6px 0 0; }

/* Mobile: full-screen active chat */
@media (max-width: 900px) {
    .chat-header { padding: 10px 12px; min-height: 56px; }
    .chat-header-name { font-size: 16px; }
    .chat-header-avatar-wrap { width: 34px; height: 34px; }
    .chat-header-avatar { width: 34px; height: 34px; }
    .chat-input-area { padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px)); background: transparent; }
    .chat-input-pill { min-height: 40px; padding: 0 5px 0 14px; border-radius: 999px; }
    .message-input { font-size: 17px; }
    .send-btn { width: 34px; height: 34px; font-size: 15px; }
    .msg-bubble { font-size: 16px; padding: 9px 13px; }
    .message-group { max-width: 80%; }
}

/* ============================================================
   FULL-SCREEN CHAT — when chat-open body class is active
   ============================================================ */
@media (max-width: 900px) {
    /* Entire chat panel takes over the screen */
    body.chat-open #chat-container.mobile-chat-active .active-chat-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        z-index: 2000;
        display: flex;
        flex-direction: column;
        background: #000;
        padding-bottom: 0 !important;
    }
    body.light-mode.chat-open #chat-container.mobile-chat-active .active-chat-panel {
        background: #fff;
    }
    /* Add safe area padding to the header top */
    body.chat-open .chat-header {
        padding-top: calc(env(safe-area-inset-top, 12px) + 10px);
        min-height: calc(56px + env(safe-area-inset-top, 0px));
    }
    /* Input area hugs the bottom with home indicator safe area */
    body.chat-open .chat-input-area {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        background: transparent;
    }
    /* Messages feed fills remaining space */
    body.chat-open .messages-feed {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================
   CONTACTS — scroll behaviour
   ============================================================ */
@media (max-width: 900px) {
    /* Header stays fully visible at all times — no hide-on-scroll */
    #view-leads .leads-view-wrapper > div:first-child {
        opacity: 1;
        transform: none;
        max-height: none;
        overflow: visible;
        pointer-events: auto;
    }

    /* Scroll to top button */
    .leads-scroll-top-btn {
        position: absolute;
        bottom: 20px;
        right: 16px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255,255,255,0.12);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255,255,255,0.22);
        color: rgba(255,255,255,0.85);
        font-size: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 50;
        opacity: 0;
        transform: scale(0.7) translateY(10px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
        box-shadow: 0 2px 16px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.18);
    }
    .leads-scroll-top-btn--visible {
        opacity: 1;
        transform: scale(1) translateY(0);
        pointer-events: auto;
    }
    .leads-scroll-top-btn:active { transform: scale(0.92); opacity: 0.75; }
    body.light-mode .leads-scroll-top-btn {
        background: rgba(255,255,255,0.55);
        border: 1px solid rgba(60,60,67,0.15);
        color: rgba(60,60,67,0.8);
        box-shadow: 0 2px 12px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
    }
}


/* ═══════════════════════════════════════════════════════════════════
   BOT CONFIG DRAWER — System Message / Chatbot Settings
═══════════════════════════════════════════════════════════════════ */

/* ── Gear/sparkle button — same neutral style as filter button ── */
.bot-config-btn { /* inherits .chat-filter-btn fully, no override needed */ }

/* Overlay */
.bot-config-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.bot-config-overlay.active { opacity: 1; pointer-events: all; }

/* Drawer — 520px on desktop, bottom sheet on mobile */
.bot-config-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 520px;
    max-width: 100vw;
    background: #111;
    border-left: 1px solid rgba(255,255,255,0.07);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}
.bot-config-drawer.active { transform: translateX(0); }

/* Header */
.bcd-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.bcd-header-left { display: flex; align-items: center; gap: 12px; }
.bcd-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #60a5fa; flex-shrink: 0;
}
.bcd-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.2px; }
.bcd-subtitle { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.bcd-close {
    width: 32px; height: 32px; border: none;
    background: rgba(255,255,255,0.06); border-radius: 8px;
    color: rgba(255,255,255,0.5); font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.bcd-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Scrollable body */
.bcd-body { flex: 1; overflow-y: auto; padding: 0 0 8px; scrollbar-width: none; -ms-overflow-style: none; }
.bcd-body::-webkit-scrollbar { display: none; }

/* Section */
.bcd-section { padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.bcd-section-label {
    font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.bcd-section-label-row {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}

/* Status toggle — blue palette */
.bcd-status-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.bcd-st-btn {
    flex: 1; padding: 9px 6px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.45);
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.bcd-st-btn.active-auto   { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.4); color: #60a5fa; }
.bcd-st-btn.active-open   { background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.35);  color: #22c55e; }
.bcd-st-btn.active-closed { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.35);  color: #f87171; }
.bcd-status-live { font-size: 12px; color: rgba(255,255,255,0.4); min-height: 16px; }

/* Working hours grid */
.bcd-hours-grid { display: flex; flex-direction: column; gap: 6px; }
.bcd-day-row {
    display: grid;
    grid-template-columns: 110px 44px 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    transition: background 0.15s;
}
.bcd-day-row:hover { background: rgba(255,255,255,0.04); }
.bcd-day-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7); }

/* Toggle switch */
.bcd-day-toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.bcd-day-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.bcd-day-toggle-track {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1); border-radius: 999px;
    cursor: pointer; transition: background 0.2s;
}
.bcd-day-toggle input:checked + .bcd-day-toggle-track { background: #3b82f6; }
.bcd-day-toggle-track::after {
    content: ''; position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%; background: #fff;
    transition: transform 0.2s;
}
.bcd-day-toggle input:checked + .bcd-day-toggle-track::after { transform: translateX(16px); }

/* Time inputs row */
.bcd-day-times { display: flex; align-items: center; gap: 8px; transition: opacity 0.2s; }
.bcd-day-times.disabled { opacity: 0.2; pointer-events: none; }
.bcd-time-input {
    flex: 1; min-width: 0;
    padding: 6px 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff; font-size: 12px; font-family: inherit;
    outline: none; text-align: center; transition: border-color 0.15s;
}
.bcd-time-input:focus { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.06); }
.bcd-day-closed-label { font-size: 11px; color: rgba(255,255,255,0.2); font-style: italic; flex: 1; }
.bcd-time-sep { font-size: 11px; color: rgba(255,255,255,0.25); flex-shrink: 0; }

/* Clinic info */
.bcd-field-group { display: flex; flex-direction: column; gap: 10px; }
.bcd-label { display: block; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.4); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.bcd-input {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff; font-size: 13px; font-family: inherit;
    outline: none; box-sizing: border-box; transition: border-color 0.15s, background 0.15s;
}
.bcd-input:focus { border-color: rgba(59,130,246,0.45); background: rgba(59,130,246,0.05); }
.bcd-input::placeholder { color: rgba(255,255,255,0.2); }
.bcd-input-row { display: flex; gap: 8px; align-items: center; }
.bcd-input-row .bcd-input { flex: 1; }
.bcd-test-btn {
    width: 36px; height: 36px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.45); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.15s;
}
.bcd-test-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Phones */
.bcd-phones-list { display: flex; flex-direction: column; gap: 8px; }
.bcd-phone-row {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px; padding: 8px 10px;
}
.bcd-phone-label {
    width: 90px; flex-shrink: 0; padding: 5px 8px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px; color: rgba(255,255,255,0.6); font-size: 11px; font-family: inherit;
    outline: none;
}
.bcd-phone-label::placeholder { color: rgba(255,255,255,0.2); }
.bcd-phone-number {
    flex: 1; min-width: 0; padding: 5px 0;
    background: transparent; border: none;
    color: #fff; font-size: 13px; font-family: inherit; outline: none;
}
.bcd-phone-number::placeholder { color: rgba(255,255,255,0.2); }
.bcd-phone-booking {
    display: flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3);
    white-space: nowrap; flex-shrink: 0; cursor: pointer;
}
.bcd-phone-booking input[type=checkbox] { accent-color: #3b82f6; width: 13px; height: 13px; }
.bcd-phone-booking.is-booking { color: #60a5fa; }

/* Treatments — premium card style */
.bcd-add-btn {
    font-size: 11px; font-weight: 700; color: #60a5fa;
    background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2);
    border-radius: 8px; padding: 4px 10px; cursor: pointer;
    font-family: inherit; transition: all 0.15s;
}
.bcd-add-btn:hover { background: rgba(59,130,246,0.18); }
.bcd-treatments-list { display: flex; flex-direction: column; gap: 10px; }
.bcd-treatment-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; overflow: hidden;
    transition: border-color 0.15s;
}
.bcd-treatment-card:hover { border-color: rgba(255,255,255,0.13); }
.bcd-tc-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bcd-tc-name {
    flex: 1; min-width: 0;
    background: transparent; border: none;
    color: #fff; font-size: 13px; font-weight: 600; font-family: inherit;
    outline: none;
}
.bcd-tc-name::placeholder { color: rgba(255,255,255,0.25); font-weight: 400; }
.bcd-tc-remove {
    width: 24px; height: 24px; border: none; background: transparent;
    color: rgba(255,255,255,0.2); font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.bcd-tc-remove:hover { background: rgba(239,68,68,0.12); color: #f87171; }
.bcd-tc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.bcd-tc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bcd-tc-field { display: flex; flex-direction: column; gap: 4px; }
.bcd-tc-field.full { grid-column: 1 / -1; }
.bcd-tc-label { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.6px; }
.bcd-tc-select, .bcd-tc-input {
    padding: 7px 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px; color: rgba(255,255,255,0.85); font-size: 12px; font-family: inherit;
    outline: none; transition: border-color 0.15s; appearance: none; -webkit-appearance: none;
}
.bcd-tc-select {
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.bcd-tc-select option { background: #1a1a1a; color: #fff; }
.bcd-tc-select:focus, .bcd-tc-input:focus { border-color: rgba(59,130,246,0.45); }
.bcd-tc-input::placeholder { color: rgba(255,255,255,0.2); }
.bcd-tc-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2px 0;
}
.bcd-tc-toggle-label { font-size: 12px; color: rgba(255,255,255,0.55); }
.bcd-tc-toggle {
    position: relative; width: 32px; height: 18px; flex-shrink: 0;
}
.bcd-tc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.bcd-tc-toggle-track {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1); border-radius: 999px;
    cursor: pointer; transition: background 0.2s;
}
.bcd-tc-toggle input:checked + .bcd-tc-toggle-track { background: #3b82f6; }
.bcd-tc-toggle-track::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; border-radius: 50%; background: #fff;
    transition: transform 0.2s;
}
.bcd-tc-toggle input:checked + .bcd-tc-toggle-track::after { transform: translateX(14px); }

/* Booking method */
.bcd-booking-select {
    width: 100%; padding: 9px 36px 9px 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff; font-size: 13px; font-family: inherit;
    outline: none; appearance: none; -webkit-appearance: none;
    transition: border-color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.bcd-booking-select option { background: #1a1a1a; color: #fff; }
.bcd-booking-select:focus { border-color: rgba(59,130,246,0.45); }
.bcd-booking-url { margin-top: 8px; }

/* Textarea */
.bcd-textarea {
    width: 100%; padding: 10px 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: rgba(255,255,255,0.8); font-size: 12px;
    font-family: inherit; outline: none; resize: vertical; line-height: 1.6;
    box-sizing: border-box; transition: border-color 0.15s;
}
.bcd-textarea:focus { border-color: rgba(59,130,246,0.45); background: rgba(59,130,246,0.04); }
.bcd-textarea::placeholder { color: rgba(255,255,255,0.2); }

/* Footer */
.bcd-footer {
    padding: 14px 24px; border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.bcd-save-feedback { flex: 1; font-size: 12px; color: rgba(255,255,255,0.4); min-height: 16px; }
.bcd-save-feedback.success { color: #22c55e; }
.bcd-save-feedback.error   { color: #f87171; }
.bcd-save-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(37,99,235,0.15));
    border: 1px solid rgba(59,130,246,0.35); border-radius: 10px;
    color: #93c5fd; font-size: 13px; font-weight: 700;
    font-family: inherit; cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.bcd-save-btn:hover { background: linear-gradient(135deg, rgba(59,130,246,0.35), rgba(37,99,235,0.25)); border-color: rgba(59,130,246,0.5); color: #bfdbfe; }
.bcd-save-btn:active { transform: scale(0.98); }

/* ── LIGHT MODE ── */
body.light-mode .bot-config-drawer { background: #F2F2F7; border-left: 1px solid rgba(60,60,67,0.1); }
body.light-mode .bcd-header { border-bottom: 1px solid rgba(60,60,67,0.08); }
body.light-mode .bcd-icon { background: rgba(0,122,255,0.08); border-color: rgba(0,122,255,0.15); color: #007AFF; }
body.light-mode .bcd-title { color: #000; }
body.light-mode .bcd-subtitle { color: rgba(60,60,67,0.45); }
body.light-mode .bcd-close { background: rgba(120,120,128,0.1); color: rgba(60,60,67,0.5); }
body.light-mode .bcd-close:hover { background: rgba(120,120,128,0.2); color: #000; }
body.light-mode .bcd-section { border-bottom-color: rgba(60,60,67,0.06); }
body.light-mode .bcd-section-label { color: rgba(60,60,67,0.45); }
body.light-mode .bcd-st-btn { border-color: rgba(60,60,67,0.12); background: rgba(255,255,255,0.7); color: rgba(60,60,67,0.5); }
body.light-mode .bcd-st-btn.active-auto   { background: rgba(0,122,255,0.1);  border-color: rgba(0,122,255,0.3);  color: #007AFF; }
body.light-mode .bcd-st-btn.active-open   { background: rgba(52,199,89,0.1);  border-color: rgba(52,199,89,0.3);  color: #34C759; }
body.light-mode .bcd-st-btn.active-closed { background: rgba(255,59,48,0.08); border-color: rgba(255,59,48,0.25); color: #FF3B30; }
body.light-mode .bcd-status-live { color: rgba(60,60,67,0.5); }
body.light-mode .bcd-day-row { background: rgba(255,255,255,0.6); border-color: rgba(60,60,67,0.08); }
body.light-mode .bcd-day-row:hover { background: rgba(255,255,255,0.9); }
body.light-mode .bcd-day-name { color: rgba(60,60,67,0.8); }
body.light-mode .bcd-day-toggle-track { background: rgba(120,120,128,0.2); }
body.light-mode .bcd-day-toggle input:checked + .bcd-day-toggle-track { background: #007AFF; }
body.light-mode .bcd-time-input { background: #fff; border-color: rgba(60,60,67,0.12); color: #000; }
body.light-mode .bcd-time-input:focus { border-color: #007AFF; }
body.light-mode .bcd-day-closed-label { color: rgba(60,60,67,0.3); }
body.light-mode .bcd-label { color: rgba(60,60,67,0.5); }
body.light-mode .bcd-input { background: #fff; border-color: rgba(60,60,67,0.12); color: #000; }
body.light-mode .bcd-input:focus { border-color: #007AFF; background: rgba(0,122,255,0.02); }
body.light-mode .bcd-input::placeholder { color: rgba(60,60,67,0.3); }
body.light-mode .bcd-test-btn { background: rgba(120,120,128,0.1); border-color: rgba(60,60,67,0.12); color: rgba(60,60,67,0.5); }
body.light-mode .bcd-test-btn:hover { background: rgba(120,120,128,0.2); color: #000; }
body.light-mode .bcd-phone-row { background: rgba(255,255,255,0.7); border-color: rgba(60,60,67,0.1); }
body.light-mode .bcd-phone-label { background: rgba(120,120,128,0.08); border-color: rgba(60,60,67,0.1); color: rgba(60,60,67,0.7); }
body.light-mode .bcd-phone-number { color: #000; }
body.light-mode .bcd-phone-booking { color: rgba(60,60,67,0.4); }
body.light-mode .bcd-phone-booking.is-booking { color: #007AFF; }
body.light-mode .bcd-add-btn { background: rgba(0,122,255,0.08); border-color: rgba(0,122,255,0.2); color: #007AFF; }
body.light-mode .bcd-add-btn:hover { background: rgba(0,122,255,0.14); }
body.light-mode .bcd-treatment-card { background: rgba(255,255,255,0.7); border-color: rgba(60,60,67,0.1); }
body.light-mode .bcd-treatment-card:hover { border-color: rgba(60,60,67,0.18); }
body.light-mode .bcd-tc-header { border-bottom-color: rgba(60,60,67,0.07); }
body.light-mode .bcd-tc-name { color: #000; }
body.light-mode .bcd-tc-label { color: rgba(60,60,67,0.45); }
body.light-mode .bcd-tc-select, body.light-mode .bcd-tc-input { background: #fff; border-color: rgba(60,60,67,0.12); color: #000; }
body.light-mode .bcd-tc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(60,60,67,0.45)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
body.light-mode .bcd-tc-select option { background: #fff; color: #000; }
body.light-mode .bcd-tc-toggle-label { color: rgba(60,60,67,0.65); }
body.light-mode .bcd-tc-toggle-track { background: rgba(120,120,128,0.2); }
body.light-mode .bcd-tc-toggle input:checked + .bcd-tc-toggle-track { background: #007AFF; }
body.light-mode .bcd-booking-select {
    background-color: #fff; border-color: rgba(60,60,67,0.12); color: #000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='rgba(60,60,67,0.45)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
body.light-mode .bcd-booking-select option { background: #fff; color: #000; }
body.light-mode .bcd-textarea { background: #fff; border-color: rgba(60,60,67,0.12); color: rgba(60,60,67,0.85); }
body.light-mode .bcd-textarea::placeholder { color: rgba(60,60,67,0.3); }
body.light-mode .bcd-footer { border-top-color: rgba(60,60,67,0.08); }
body.light-mode .bcd-save-feedback { color: rgba(60,60,67,0.45); }
body.light-mode .bcd-save-btn { background: rgba(0,122,255,0.1); border-color: rgba(0,122,255,0.25); color: #007AFF; }
body.light-mode .bcd-save-btn:hover { background: rgba(0,122,255,0.16); border-color: rgba(0,122,255,0.35); }


/* Practice type toggle */
.bcd-practice-toggle {
    display: flex;
    gap: 6px;
}
.bcd-pt-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.bcd-pt-btn.active {
    background: rgba(59,130,246,0.14);
    border-color: rgba(59,130,246,0.38);
    color: #60a5fa;
}
.bcd-pt-btn:hover:not(.active) {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
}
body.light-mode .bcd-pt-btn {
    background: rgba(255,255,255,0.7);
    border-color: rgba(60,60,67,0.12);
    color: rgba(60,60,67,0.5);
}
body.light-mode .bcd-pt-btn.active {
    background: rgba(0,122,255,0.1);
    border-color: rgba(0,122,255,0.28);
    color: #007AFF;
}

/* Mobile — bottom sheet */
@media (max-width: 600px) {
    .bot-config-drawer {
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%; height: 92vh;
        border-left: none; border-top: 1px solid rgba(255,255,255,0.08);
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    .bot-config-drawer.active { transform: translateY(0); }
}

/* Bot config status indicators */
.bot-nav-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    margin-left: auto;
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
    animation: botDotPulse 2.5s ease-in-out infinite;
}
.bot-nav-dot.unconfigured {
    background: rgba(255,255,255,0.2);
    box-shadow: none;
    animation: none;
}
@keyframes botDotPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* AI enabled toggle in drawer header */
.bcd-ai-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}
.bcd-ai-toggle-label {
    font-size: 11px;
    font-weight: 700;
    color: #22c55e;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    min-width: 36px;
}
.bcd-ai-toggle-label.off {
    color: rgba(255,255,255,0.25);
}
.bcd-ai-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.bcd-ai-toggle input {
    opacity: 0; width: 0; height: 0; position: absolute;
}
.bcd-ai-toggle-track {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}
.bcd-ai-toggle input:checked + .bcd-ai-toggle-track {
    background: #22c55e;
    border-color: #22c55e;
}
.bcd-ai-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.bcd-ai-toggle input:checked + .bcd-ai-toggle-track::after {
    transform: translateX(18px);
}
body.light-mode .bcd-ai-toggle-label { color: #16a34a; }
body.light-mode .bcd-ai-toggle-label.off { color: rgba(60,60,67,0.3); }
body.light-mode .bcd-ai-toggle-track { background: rgba(120,120,128,0.2); border-color: rgba(60,60,67,0.1); }
body.light-mode .bcd-ai-toggle input:checked + .bcd-ai-toggle-track { background: #22c55e; border-color: #22c55e; }

/* ============================================================
   BRAND COLOR SWATCHES (Settings → Branding)
   ============================================================ */
.brand-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.brand-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255,255,255,0.35);
}
.brand-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.12), 0 2px 10px rgba(0,0,0,0.4);
}
.brand-swatch-custom {
    background: conic-gradient(from 180deg, #ff0080, #7928ca, #2afadf, #17ead9, #f7b733, #ff0080) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
}
.brand-swatch-custom i { font-size: 13px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.brand-swatch-custom input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
}
body.light-mode .brand-swatch { border-color: rgba(60,60,67,0.12); }
body.light-mode .brand-swatch:hover { border-color: rgba(60,60,67,0.25); }
body.light-mode .brand-swatch.active { border-color: #000; box-shadow: 0 0 0 2px rgba(0,0,0,0.08), 0 2px 10px rgba(0,0,0,0.1); }

/* ============================================================
   SHOWCASE TAB — Hub + Editors
   ============================================================ */
#view-showcase { padding: 0; }
.showcase-hub,
.showcase-editor {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 40px 60px 40px;
    box-sizing: border-box;
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.showcase-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.showcase-title i {
    font-size: 26px;
    background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.showcase-subtitle {
    color: #888;
    font-size: 14px;
    margin: 6px 0 0 0;
    font-weight: 500;
}

/* Hub grid */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Hub card */
.showcase-card {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.2,0,0.2,1), border-color 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.showcase-card-active { cursor: pointer; }
.showcase-card-active:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(167,139,250,0.08);
}
.showcase-card-soon { cursor: not-allowed; opacity: 0.55; }
.showcase-card-soon:hover { opacity: 0.7; }

.showcase-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 3;
}
.showcase-card-preview {
    width: 100%;
    aspect-ratio: 16/10;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #151515 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sc-preview-soon i { font-size: 54px; color: rgba(255,255,255,0.2); }

/* Before/After mini preview inside card — minimal Classic look */
.ba-preview { background: #0a0a0a; padding: 0; }
.ba-preview-img {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    border-radius: 0;
}
.ba-preview-before {
    top: 0;
    background: #1a1a1a url('assets/sample-before.jpg') center/cover no-repeat;
    filter: brightness(0.5);
}
.ba-preview-after {
    bottom: 0;
    background: #1a1a1a url('assets/sample-after.jpg') center/cover no-repeat;
    filter: brightness(0.5);
}
/* Thin brand-accent divider line */
.ba-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, rgba(var(--brand-color-rgb),0.55) 25%, rgba(var(--brand-color-rgb),0.55) 75%, transparent);
    z-index: 3;
}
/* Minimal signature image on the divider — small, premium, understated */
.ba-preview-signature-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    width: 22%;
    max-height: 16%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45)) drop-shadow(0 0 8px rgba(255,255,255,0.08));
    pointer-events: none;
}
/* Tiny BEFORE/AFTER chips — semi-transparent dark pills with gold text */
.ba-preview-label {
    position: absolute;
    font-size: 8px;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: var(--brand-color);
    padding: 2px 7px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 3px;
    border: 1px solid rgba(var(--brand-color-rgb),0.3);
    z-index: 2;
}
.ba-label-before { top: 9%; left: 9%; }
.ba-label-after  { bottom: 9%; right: 9%; }

.showcase-card-body { padding: 18px 20px 20px 20px; }
.showcase-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px 0;
    letter-spacing: -0.2px;
}
.showcase-card-desc {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* Editor */
.showcase-editor { display: flex; flex-direction: column; }
.showcase-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.showcase-editor-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.3px;
}
.showcase-back-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #ddd;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.showcase-back-btn:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.15); }

.showcase-editor-body {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 32px;
    align-items: start;
}

.showcase-editor-controls {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.sb-field { display: flex; flex-direction: column; gap: 10px; }
.sb-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Drop zone */
.sb-dropzone {
    position: relative;
    border: 1.5px dashed rgba(255,255,255,0.14);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}
.sb-dropzone:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.04); }
.sb-dropzone.dragging { border-color: #a78bfa; background: rgba(167,139,250,0.08); transform: scale(1.01); }
.sb-dropzone-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #888;
    text-align: center;
    padding: 24px;
}
.sb-dropzone-empty i { font-size: 32px; color: rgba(255,255,255,0.3); }
.sb-dropzone-text { font-size: 13px; color: #999; }
.sb-dropzone-text strong { color: #a78bfa; font-weight: 600; }
.sb-dropzone-preview {
    display: none;
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}
.sb-dropzone.has-image .sb-dropzone-empty { display: none; }
.sb-dropzone.has-image .sb-dropzone-preview { display: block; }
.sb-dropzone.has-image { border-style: solid; border-color: rgba(255,255,255,0.1); padding: 0; }
.sb-dropzone.has-image .sb-dropzone-clear { display: flex; }
.sb-dropzone-clear {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    z-index: 2;
}
.sb-dropzone-clear:hover { background: rgba(239,68,68,0.8); border-color: rgba(239,68,68,1); }

/* Ratio picker */
.sb-ratio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.sb-ratio-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
}
.sb-ratio-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); color: #fff; }
.sb-ratio-btn.active {
    background: linear-gradient(145deg, rgba(167,139,250,0.18) 0%, rgba(96,165,250,0.08) 100%);
    border-color: rgba(167,139,250,0.5);
    color: #fff;
    box-shadow: 0 0 20px rgba(167,139,250,0.15);
}
.sb-ratio-icon {
    width: 32px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    opacity: 0.7;
}
.sb-ratio-btn.active .sb-ratio-icon { opacity: 1; }

/* Style picker — identical shell to ratio picker + tiny layout mockups */
.sb-style-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.sb-style-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 6px 10px 6px;
    cursor: pointer;
    color: #bbb;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
    overflow: hidden;
}
.sb-style-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); color: #fff; }
.sb-style-btn.active {
    background: linear-gradient(145deg, rgba(167,139,250,0.18) 0%, rgba(96,165,250,0.08) 100%);
    border-color: rgba(167,139,250,0.5);
    color: #fff;
    box-shadow: 0 0 20px rgba(167,139,250,0.15);
}
.sb-style-btn span:last-child { white-space: nowrap; }

.sb-style-thumb {
    position: relative;
    width: 42px;
    aspect-ratio: 4/5;
    background: #070707;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

/* Classic thumb — minimal stack, small corner chips, tiny center logo */
.sb-thumb-classic::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(155deg, #a6814e 0%, #7a5a35 100%);
}
.sb-thumb-classic::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(155deg, #efe0c9 0%, #d8c4a3 100%);
}
.sb-thumb-classic .thumb-band {
    position: absolute;
    top: 50%;
    left: 35%; right: 35%;
    height: 6%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.9);
    border: 0.5px solid rgba(var(--brand-color-rgb),0.5);
    border-radius: 999px;
    z-index: 3;
}
.sb-thumb-classic .thumb-chip-top,
.sb-thumb-classic .thumb-chip-bot {
    position: absolute;
    width: 22%;
    height: 6%;
    background: rgba(0,0,0,0.6);
    border: 0.5px solid rgba(var(--brand-color-rgb),0.5);
    border-radius: 1px;
    z-index: 2;
}
.sb-thumb-classic .thumb-chip-top { top: 9%; left: 9%; }
.sb-thumb-classic .thumb-chip-bot { bottom: 9%; right: 9%; }

/* Minimal thumb — stacked, corner chips, thin gradient line */
.sb-thumb-minimal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 49.7%;
    background: linear-gradient(135deg, #444 0%, #222 100%);
}
.sb-thumb-minimal::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 49.7%;
    background: linear-gradient(135deg, #c8c8c8 0%, #7a7a7a 100%);
}
.sb-thumb-minimal .thumb-band {
    position: absolute;
    top: 50%;
    left: 10%; right: 10%;
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    z-index: 3;
}
.sb-thumb-minimal .thumb-chip-top,
.sb-thumb-minimal .thumb-chip-bot {
    position: absolute;
    width: 28%;
    height: 7%;
    background: rgba(255,255,255,0.55);
    border-radius: 1px;
    z-index: 2;
}
.sb-thumb-minimal .thumb-chip-top { top: 9%; left: 10%; }
.sb-thumb-minimal .thumb-chip-bot { bottom: 9%; right: 10%; }

/* Light mode — style picker */
body.light-mode .sb-style-btn {
    background: rgba(255,255,255,0.7);
    border-color: rgba(60,60,67,0.1);
    color: rgba(60,60,67,0.7);
}
body.light-mode .sb-style-btn:hover { background: #fff; border-color: rgba(60,60,67,0.2); color: #000; }
body.light-mode .sb-style-btn.active {
    background: linear-gradient(145deg, rgba(139,92,246,0.12) 0%, rgba(99,102,241,0.06) 100%);
    border-color: rgba(139,92,246,0.45);
    color: #5b21b6;
}
body.light-mode .sb-style-thumb { background: #ebedf2; border-color: rgba(60,60,67,0.1); }

.sb-hint { font-size: 12px; color: #777; margin: 0; }
.sb-hint-center { text-align: center; }

/* Export button */
.sb-export-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(167,139,250,0.3);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.02em;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    margin-top: 4px;
}
.sb-export-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(139,92,246,0.35);
}
.sb-export-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    color: #888;
}

/* Preview */
.showcase-editor-preview {
    position: sticky;
    top: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.sb-preview-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 4/5;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.sb-preview-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}
.sb-preview-canvas:active { cursor: grabbing; }
.sb-preview-canvas.no-drag { cursor: default; }

/* Drag hint under preview */
.sb-drag-hint {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.sb-drag-hint i { font-size: 13px; }
.sb-preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #555;
    text-align: center;
    padding: 40px;
}
.sb-preview-placeholder i { font-size: 52px; color: rgba(255,255,255,0.12); }
.sb-preview-placeholder p { margin: 0; font-size: 13px; color: #666; max-width: 240px; }

/* Light mode — Showcase */
body.light-mode .showcase-title { color: #000; }
body.light-mode .showcase-subtitle { color: rgba(60,60,67,0.6); }
body.light-mode .showcase-header { border-bottom-color: rgba(60,60,67,0.12); }
body.light-mode .showcase-card {
    background: rgba(255,255,255,0.9);
    border-color: rgba(60,60,67,0.1);
}
body.light-mode .showcase-card-active:hover {
    border-color: rgba(60,60,67,0.18);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
body.light-mode .showcase-card-preview { background: linear-gradient(180deg, #eef0f5 0%, #e0e3ea 100%); }
body.light-mode .ba-preview { background: linear-gradient(180deg, #eef0f5 0%, #e0e3ea 100%); }
body.light-mode .ba-preview-divider { background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.2) 50%, transparent 100%); }
body.light-mode .ba-preview-label {
    color: rgba(60,60,67,0.9);
    background: rgba(255,255,255,0.85);
    border-color: rgba(60,60,67,0.1);
}
body.light-mode .showcase-card-title { color: #000; }
body.light-mode .showcase-card-desc { color: rgba(60,60,67,0.6); }
body.light-mode .showcase-card-badge {
    background: rgba(0,0,0,0.75);
    color: #fff;
    border-color: rgba(0,0,0,0.15);
}
body.light-mode .sc-preview-soon i { color: rgba(60,60,67,0.25); }
body.light-mode .showcase-editor-title { color: #000; }
body.light-mode .showcase-editor-header { border-bottom-color: rgba(60,60,67,0.12); }
body.light-mode .showcase-back-btn {
    background: rgba(255,255,255,0.8);
    border-color: rgba(60,60,67,0.12);
    color: #333;
}
body.light-mode .showcase-back-btn:hover {
    background: #fff;
    border-color: rgba(60,60,67,0.2);
    color: #000;
}
body.light-mode .sb-label { color: rgba(60,60,67,0.6); }
body.light-mode .sb-dropzone {
    background: rgba(255,255,255,0.6);
    border-color: rgba(60,60,67,0.18);
}
body.light-mode .sb-dropzone:hover { background: rgba(255,255,255,0.9); border-color: rgba(60,60,67,0.3); }
body.light-mode .sb-dropzone.dragging { background: rgba(139,92,246,0.05); border-color: #8b5cf6; }
body.light-mode .sb-dropzone-empty { color: rgba(60,60,67,0.5); }
body.light-mode .sb-dropzone-empty i { color: rgba(60,60,67,0.35); }
body.light-mode .sb-dropzone-text { color: rgba(60,60,67,0.7); }
body.light-mode .sb-dropzone-text strong { color: #8b5cf6; }
body.light-mode .sb-ratio-btn {
    background: rgba(255,255,255,0.7);
    border-color: rgba(60,60,67,0.1);
    color: rgba(60,60,67,0.7);
}
body.light-mode .sb-ratio-btn:hover { background: #fff; border-color: rgba(60,60,67,0.2); color: #000; }
body.light-mode .sb-ratio-btn.active {
    background: linear-gradient(145deg, rgba(139,92,246,0.15) 0%, rgba(99,102,241,0.08) 100%);
    border-color: rgba(139,92,246,0.5);
    color: #5b21b6;
}
body.light-mode .sb-hint { color: rgba(60,60,67,0.5); }
body.light-mode .sb-export-btn:disabled {
    background: rgba(120,120,128,0.15);
    border-color: rgba(60,60,67,0.1);
    color: rgba(60,60,67,0.4);
}
body.light-mode .sb-preview-wrap {
    background: linear-gradient(180deg, #f5f6fa 0%, #ecedf2 100%);
    border-color: rgba(60,60,67,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
body.light-mode .sb-preview-placeholder { color: rgba(60,60,67,0.4); }
body.light-mode .sb-preview-placeholder i { color: rgba(60,60,67,0.18); }
body.light-mode .sb-preview-placeholder p { color: rgba(60,60,67,0.5); }

/* ===== LOGO CARD + EDITOR ===== */
.logo-card-preview {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(var(--brand-color-rgb),0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(167,139,250,0.05) 0%, transparent 60%),
        linear-gradient(145deg, #111 0%, #050505 100%);
    padding: 0;
}
.logo-card-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.logo-card-image {
    max-width: 80%;
    max-height: 70%;
    width: auto;
    height: auto;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 4px 20px rgba(var(--brand-color-rgb),0.25));
}
.logo-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.3);
    z-index: 2;
}
.logo-card-placeholder i {
    font-size: 42px;
    color: rgba(var(--brand-color-rgb),0.5);
}
.logo-card-placeholder span {
    font-size: 10px;
    letter-spacing: 0.2em;
    font-weight: 700;
    text-transform: uppercase;
}
.logo-card-shimmer {
    position: absolute;
    bottom: 18%;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--brand-color-rgb),0.35), transparent);
}

/* Logo editor layout */
.logo-editor-body {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 32px;
    align-items: start;
}
.logo-editor-controls { display: flex; flex-direction: column; gap: 22px; }

.logo-name-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.15s;
    box-sizing: border-box;
}
.logo-name-input:focus { border-color: rgba(167,139,250,0.5); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 3px rgba(167,139,250,0.12); }
.logo-name-input::placeholder { color: #555; }

/* Generate button — distinct from Save (outline + sparkle) */
.sb-generate-btn {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid rgba(167,139,250,0.4);
    background: linear-gradient(145deg, rgba(167,139,250,0.15) 0%, rgba(96,165,250,0.08) 100%);
    color: #d8ccff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.02em;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s, background 0.2s;
}
.sb-generate-btn:not(:disabled):hover {
    transform: translateY(-1px);
    background: linear-gradient(145deg, rgba(167,139,250,0.25) 0%, rgba(96,165,250,0.15) 100%);
    box-shadow: 0 8px 24px rgba(139,92,246,0.2);
    color: #fff;
}
.sb-generate-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.sb-generate-btn i { font-size: 17px; }

/* Logo preview stage */
.logo-editor-preview {
    position: sticky;
    top: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.logo-preview-stage {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 4/3;
    background:
        radial-gradient(ellipse at 30% 25%, rgba(var(--brand-color-rgb),0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 80%, rgba(167,139,250,0.05) 0%, transparent 55%),
        linear-gradient(145deg, #161616 0%, #060606 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}
.logo-preview-stage::after {
    content: '';
    position: absolute;
    bottom: 10%; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--brand-color-rgb),0.25), transparent);
}
/* Logo preview — image (after generation) + empty + loading states */
.logo-preview-image {
    max-width: 85%;
    max-height: 70%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 30px rgba(var(--brand-color-rgb),0.3));
    animation: logoFadeIn 0.4s ease;
}
@keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.logo-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.3);
    text-align: center;
}
.logo-preview-empty i {
    font-size: 56px;
    color: rgba(var(--brand-color-rgb),0.45);
}
.logo-preview-empty p {
    margin: 0;
    font-size: 13px;
    color: #777;
    max-width: 240px;
}
.logo-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.logo-loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(var(--brand-color-rgb),0.15);
    border-top-color: rgba(var(--brand-color-rgb),0.9);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.logo-loading-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ddd;
}
.logo-loading-sub {
    margin: 0;
    font-size: 12px;
    color: #777;
}

/* Light mode — Logo */
body.light-mode .logo-card-preview {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(var(--brand-color-rgb),0.08) 0%, transparent 60%),
        linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
}
body.light-mode .logo-card-placeholder { color: rgba(255,255,255,0.35); }
body.light-mode .logo-name-input {
    background: rgba(255,255,255,0.8);
    border-color: rgba(60,60,67,0.12);
    color: #000;
}
body.light-mode .logo-name-input:focus { background: #fff; border-color: rgba(139,92,246,0.5); box-shadow: 0 0 0 3px rgba(139,92,246,0.12); }
body.light-mode .logo-name-input::placeholder { color: rgba(60,60,67,0.35); }
body.light-mode .sb-generate-btn {
    background: linear-gradient(145deg, rgba(139,92,246,0.08) 0%, rgba(99,102,241,0.05) 100%);
    border-color: rgba(139,92,246,0.35);
    color: #5b21b6;
}
body.light-mode .sb-generate-btn:not(:disabled):hover {
    background: linear-gradient(145deg, rgba(139,92,246,0.18) 0%, rgba(99,102,241,0.1) 100%);
}
body.light-mode .logo-preview-stage {
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border-color: rgba(60,60,67,0.15);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* Responsive */
@media (max-width: 1024px) {
    .showcase-editor-body,
    .logo-editor-body { grid-template-columns: 1fr; }
    .showcase-editor-preview,
    .logo-editor-preview { position: static; }
    .sb-preview-wrap { max-width: 420px; margin: 0 auto; }
    .logo-preview-stage { max-width: 100%; }
}
@media (max-width: 768px) {
    .showcase-hub, .showcase-editor { padding: 20px 18px 40px 18px; }
    .showcase-grid { grid-template-columns: 1fr; gap: 16px; }
    .showcase-title { font-size: 22px; }
    .showcase-title i { font-size: 22px; }
    .showcase-editor-title { font-size: 18px; }
}