/* ================================================================
   LATERPRO - ENTERPRISE WHATSAPP SCHEDULER & DESIGN SYSTEM
   ================================================================ */

:root {
    /* Color Palette */
    --bg-main: #060913;
    --bg-surface: #0a101f;
    --bg-card: rgba(13, 20, 36, 0.76);
    --bg-card-hover: rgba(18, 28, 50, 0.88);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-border-glow: rgba(16, 185, 129, 0.3);
    --bg-input: rgba(9, 14, 26, 0.9);
    --bg-input-focus: rgba(12, 19, 36, 0.98);

    /* Brand Primary Accent (WhatsApp Emerald) */
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-light: rgba(16, 185, 129, 0.14);
    --primary-glow: rgba(16, 185, 129, 0.35);

    /* Secondary & State Colors */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.14);
    --danger: #f43f5e;
    --danger-hover: #e11d48;
    --danger-light: rgba(244, 63, 94, 0.14);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.14);
    --success: #10b981;

    /* Typography & Grays */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);

    /* Layout Metrics */
    --sidebar-width: 260px;
    --header-height: 72px;
    --mobile-nav-height: 64px;
    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;

    /* Transitions & Shadows */
    --transition-fast: all 0.15s ease;
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-glass: 0 20px 45px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --shadow-dropdown: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 10% 8%, rgba(16, 185, 129, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 90% 92%, rgba(59, 130, 246, 0.09) 0%, transparent 48%),
        radial-gradient(circle at 50% 35%, rgba(13, 20, 36, 0.75) 0%, transparent 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Chrome / Safari Autofill Override Fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0px 1000px #090e1a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

/* Remove ugly wheel spinner in number inputs & prevent wheel drift */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Utility Helpers */
.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.text-center { text-align: center; }
.text-danger { color: var(--danger) !important; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-muted { color: var(--text-muted); }
.p-4 { padding: 16px; }
.w-100 { width: 100%; }
.code-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2px;
}

/* ========================================== */
/* SKELETON INITIAL LOADER                    */
/* ========================================== */
.page-loader {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: opacity 0.35s ease, visibility 0.35s;
}
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-logo-img {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    box-shadow: 0 0 24px var(--primary-glow);
    animation: floatIcon 3s ease-in-out infinite alternate;
}
@keyframes floatIcon {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}
.skeleton-title {
    width: 210px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 20px;
    margin-bottom: 10px;
    animation: pulseLoader 1.4s infinite ease-in-out;
}
.skeleton-subtitle {
    width: 290px;
    height: 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
    animation: pulseLoader 1.4s infinite ease-in-out 0.2s;
}
.skeleton-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spinLoader 0.9s linear infinite;
}
@keyframes pulseLoader {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}
@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

/* ========================================== */
/* ========================================== */
/* AUTH OVERLAY & LOGIN PAGE NAVBAR           */
/* ========================================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    overflow-y: auto;
    transform: translateZ(0);
    will-change: opacity;
}

#auth-overlay {
    background: radial-gradient(circle at 10% 8%, rgba(16, 185, 129, 0.12) 0%, transparent 42%),
                radial-gradient(circle at 90% 92%, rgba(59, 130, 246, 0.09) 0%, transparent 48%),
                rgba(4, 7, 14, 0.96);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
#auth-overlay.hidden {
    display: none !important;
}

.app-container.hidden,
#app-dashboard.hidden,
.mobile-bottom-nav.hidden,
#mobile-bottom-nav.hidden,
.hidden .sidebar,
.app-container.hidden .sidebar {
    display: none !important;
}

.auth-top-navbar {
    width: 100%;
    height: 72px;
    background: rgba(6, 9, 19, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--bg-card-border);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.auth-navbar-container {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.auth-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    text-decoration: none;
}
.auth-nav-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.auth-nav-icon img {
    width: 26px;
    height: 26px;
}
.auth-brand-text h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--text-main);
}
.auth-brand-badge {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.auth-brand-text p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}
.auth-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.auth-nav-link {
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    padding: 6px 0;
}
.auth-nav-link:hover, .auth-nav-link.active {
    color: var(--text-main);
}
.auth-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.auth-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-btn-portal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--primary-glow);
    text-decoration: none;
    transition: var(--transition-fast);
}
.auth-btn-portal:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--primary-glow);
}
.auth-body-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px 50px 20px;
    position: relative;
    width: 100%;
    min-height: calc(100vh - 72px);
}
@media (max-width: 768px) {
    .auth-nav-links {
        display: none;
    }
    .auth-navbar-container {
        padding: 0 16px;
    }
}

.auth-bg-ambient {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16) 0%, rgba(59, 130, 246, 0.06) 45%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulseAmbient 7s ease-in-out infinite alternate;
}
@keyframes pulseAmbient {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--bg-card-border);
    box-shadow: var(--shadow-glass), 0 0 35px rgba(16, 185, 129, 0.09);
    position: relative;
    z-index: 2;
    animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}
.auth-brand .brand-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.premium-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}
.auth-brand h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.badge-pro {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    background: var(--primary-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.auth-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    margin-bottom: 22px;
}
.auth-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.auth-tab-btn.active {
    background: var(--bg-card-hover);
    color: var(--text-main);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-switch {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}
.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}
.auth-switch a:hover {
    text-decoration: underline;
}

.auth-legal-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-card-border);
    text-align: center;
}
.auth-legal-footer .legal-notice {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11.5px;
}
.auth-legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}
.auth-legal-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}
.auth-legal-links span {
    color: var(--text-dim);
    font-size: 10px;
}

/* ========================================== */
/* APP CONTAINER & SIDEBAR DRAWER             */
/* ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Backdrop for Mobile Sidebar */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 27, 0.94);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    z-index: 1100;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bg-card-border);
    margin-bottom: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
    flex-shrink: 0;
}
.brand-icon .premium-brand-logo {
    width: 28px;
    height: 28px;
}
.brand-text h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.2;
}
.brand-text p {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 2px;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-close-btn {
    display: none; /* Visible only on mobile */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.sidebar-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}
.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    position: relative;
    user-select: none;
}
.nav-btn i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}
.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}
.nav-btn:hover i {
    color: var(--primary);
}
.nav-btn.active {
    color: white;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-left: 3px solid var(--primary);
    border-color: rgba(16, 185, 129, 0.2) rgba(16, 185, 129, 0.05) rgba(16, 185, 129, 0.05) var(--primary);
}
.nav-btn.active i {
    color: var(--primary);
}
.unread-count-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    box-shadow: 0 0 8px var(--primary-glow);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--bg-card-border);
}
.connection-status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
}
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-indicator.online { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-indicator.offline { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.status-indicator.connecting { background: var(--warning); box-shadow: 0 0 10px var(--warning); animation: pulseDot 1.5s infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }

.status-info { display: flex; flex-direction: column; min-width: 0; }
.status-title { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-subtitle { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-legal-bar {
    margin-top: 12px;
    padding-top: 8px;
    text-align: center;
}
.sidebar-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 6px;
}
.sidebar-legal-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition-fast);
}
.sidebar-legal-links a:hover {
    color: var(--primary);
}
.sidebar-legal-links span {
    color: rgba(255, 255, 255, 0.15);
    font-size: 9px;
}
.sidebar-copy-info {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.3px;
}

/* ========================================== */
/* ADVERTISEMENT & SPONSOR SLOTS              */
/* ========================================== */
.ad-slot-container {
    background: rgba(10, 16, 31, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 10px;
    position: relative;
    text-align: center;
    transition: var(--transition-fast);
    overflow: hidden;
}
.ad-slot-container:hover {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(10, 16, 31, 0.85);
}
.ad-slot-container.sidebar-ad {
    margin: 12px 0 6px 0;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ad-slot-container.leaderboard-ad {
    margin-top: 32px;
    min-height: 80px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ad-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.ad-content-placeholder {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-placeholder-text {
    font-size: 11.5px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.65;
}

/* ========================================== */
/* MAIN CONTENT & TOP HEADER                  */
/* ========================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px 28px;
    min-height: 100vh;
    min-width: 0;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.mobile-nav-toggle {
    display: none; /* Appears only on mobile */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.header-title {
    min-width: 0;
}
.header-title h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-title p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--bg-card-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}
.user-pill-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}
.user-info-text {
    display: flex;
    flex-direction: column;
}
.user-name { font-size: 12.5px; font-weight: 700; }
.user-email { font-size: 11px; color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}
.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
}
.btn-block {
    width: 100%;
}
.btn-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-emerald:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 18px var(--primary-glow);
}
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 14px var(--accent-light);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--bg-card-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}
.btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 4px 12px var(--danger-light);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}
.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-text:hover {
    color: var(--danger);
}

/* ========================================== */
/* GLASS CARDS & FORM CONTROLS                */
/* ========================================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--bg-card-border);
}
.card-header h3 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.accent-icon {
    color: var(--primary);
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.grid-2-col-wide {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 24px;
}
.max-w-700 {
    max-width: 680px;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: tabFadeIn 0.25s ease; }
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}
.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}
.form-group label i {
    color: var(--primary);
}

.input-wrapper {
    position: relative;
    width: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea {
    resize: vertical;
    line-height: 1.5;
}
.form-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========================================== */
/* QR CODE & SESSION PAIRING CARD             */
/* ========================================== */
.qr-container {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}
.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}
#qr-image {
    max-width: 240px;
    width: 100%;
    border-radius: var(--radius-md);
    padding: 12px;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: qrPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes qrPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.connected-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.success-icon-wrapper {
    font-size: 54px;
    color: var(--success);
    filter: drop-shadow(0 0 16px var(--primary-glow));
    animation: bounceIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.connected-view h3 {
    font-size: 20px;
    font-weight: 700;
}
.connected-view p {
    font-size: 13.5px;
    color: var(--text-muted);
}
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.instructions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    text-align: left;
}
.instructions-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.session-info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    gap: 12px;
}
.info-item .label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.info-item .value {
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

/* Badges */
.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-yellow { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-red { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-gray { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); }

.warning-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(245, 158, 11, 0.08);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.warning-callout i { font-size: 20px; color: var(--warning); margin-top: 2px; }
.warning-callout h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.warning-callout p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ========================================== */
/* LIVE CHAT INBOX (WHATSAPP WEB STYLE)       */
/* ========================================== */
.chat-app-container {
    padding: 0;
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 165px);
    max-height: calc(100vh - 165px);
    min-height: 460px;
    overflow: hidden;
    position: relative;
}

.chat-list-sidebar {
    border-right: 1px solid var(--bg-card-border);
    background: rgba(8, 12, 22, 0.65);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.chat-search-box {
    padding: 14px;
    border-bottom: 1px solid var(--bg-card-border);
    position: relative;
    flex-shrink: 0;
}
.chat-search-box i {
    position: absolute;
    left: 28px;
    top: 27px;
    color: var(--text-muted);
    font-size: 13px;
}
.chat-search-box input {
    padding-left: 36px;
    font-size: 13px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.35);
}
.chats-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}
.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: var(--transition-fast);
    content-visibility: auto;
    contain-intrinsic-size: 70px;
}
.chat-item:hover, .chat-item.active {
    background: rgba(16, 185, 129, 0.12);
}
.chat-item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
    text-transform: uppercase;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}
.chat-item-name {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-item-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.chat-item-lastmsg {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Main Thread */
.chat-main-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
    background: rgba(6, 10, 18, 0.5);
}
.chat-thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--bg-card-border);
    background: rgba(12, 18, 32, 0.65);
    flex-shrink: 0;
    z-index: 5;
}
.btn-chat-back {
    display: none; /* Appears only in mobile thread view */
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    font-size: 15px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-chat-back:hover {
    background: rgba(255, 255, 255, 0.15);
}
.chat-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.chat-user-details {
    flex: 1;
    min-width: 0;
}
.chat-user-details h4 {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-user-details p {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-messages-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    will-change: scroll-position;
}
.empty-chat-placeholder {
    margin: auto;
    text-align: center;
    max-width: 380px;
    color: var(--text-muted);
}
.premium-empty-chat-logo {
    width: 60px;
    height: 60px;
    opacity: 0.35;
    margin-bottom: 12px;
}
.empty-chat-placeholder h3 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 6px;
}
.empty-chat-placeholder p {
    font-size: 13px;
    line-height: 1.5;
}

/* Chat Message Bubbles */
.msg-bubble-wrapper,
.chat-bubble-row {
    display: flex;
    width: 100%;
    margin-bottom: 2px;
}
.msg-bubble-wrapper.outgoing,
.chat-bubble-row.from-me {
    justify-content: flex-end;
}
.msg-bubble-wrapper.incoming,
.chat-bubble-row.from-them {
    justify-content: flex-start;
}

.msg-bubble,
.chat-bubble {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 13px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.clickable-bubble {
    cursor: pointer !important;
}
.clickable-bubble:hover {
    transform: scale(1.015);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.msg-bubble-wrapper.outgoing .msg-bubble,
.chat-bubble-row.from-me .chat-bubble {
    background: #005c4b;
    color: #e9edef;
    border-bottom-right-radius: 3px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.msg-bubble-wrapper.incoming .msg-bubble,
.chat-bubble-row.from-them .chat-bubble {
    background: #202c33;
    color: #d1d7db;
    border-bottom-left-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.msg-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13.5px;
    line-height: 1.45;
}

.msg-time,
.chat-bubble-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
    user-select: none;
}
.msg-tick.read { color: #53bdeb; }
.msg-tick.delivered { color: #8696a0; }
.msg-tick.sent { color: #8696a0; }

.msg-info-trigger {
    font-size: 10px;
    opacity: 0.6;
    margin-left: 2px;
    transition: opacity 0.15s ease;
}
.clickable-bubble:hover .msg-info-trigger {
    opacity: 1;
    color: var(--primary);
}

.chat-media-wrapper {
    margin-bottom: 6px;
    border-radius: 8px;
    overflow: hidden;
}
.chat-media-img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    transition: transform 0.2s ease;
}
.chat-media-img:hover {
    transform: scale(1.02);
}
.chat-media-video, .chat-media-audio {
    max-width: 100%;
    border-radius: 8px;
}
.chat-media-doc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 12px;
}

/* Chat Reply Footer */
.chat-input-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--bg-card-border);
    background: rgba(10, 15, 27, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.attach-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bg-card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.attach-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
}
.chat-input-footer input[type="text"] {
    flex: 1;
    min-width: 0;
    border-radius: 24px;
    padding: 11px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
    transition: var(--transition-fast);
}
.chat-input-footer input[type="text"]:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.65);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.file-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary);
}
.remove-file-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
}
.remove-file-btn:hover { color: var(--danger); }

/* Dropzones */
.media-upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.18);
    border-radius: var(--radius-md);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.media-upload-dropzone:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}
.media-upload-dropzone i {
    font-size: 26px;
    margin-bottom: 8px;
}

/* ================================================================ */
/* REDESIGNED SMART TIME SELECTOR WIDGET (ZERO SCROLL-DRIFT)        */
/* ================================================================ */
.schedule-toggle-group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px dashed var(--bg-card-border);
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(22px);
    background-color: white;
}
.schedule-toggle-text {
    display: flex;
    flex-direction: column;
}
.schedule-toggle-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}
.schedule-toggle-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* The Smart Schedule Box */
.schedule-widget-box {
    background: rgba(8, 14, 26, 0.7);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInWidget 0.25s ease;
}
@keyframes fadeInWidget {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.schedule-widget-header .schedule-label {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Preset Chips */
.schedule-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.preset-chip {
    padding: 7px 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}
.preset-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}
.preset-chip.active {
    background: var(--primary-light);
    color: #34d399;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Delay Presets Bar */
.delay-presets-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* Custom Date/Time Row */
.schedule-custom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.schedule-field-col label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-control-picker {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}
.form-control-picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
}

.time-picker-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-select-picker {
    flex: 1;
    padding: 10px 8px;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 9px;
    padding-right: 22px;
}
.form-select-picker option {
    background: #0d1527;
    color: white;
}
.time-sep {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-muted);
}
.ampm-pill-group {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    padding: 2px;
    flex-shrink: 0;
}
.ampm-pill {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.ampm-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* Stepper adjustments */
.schedule-steppers-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}
.steppers-title {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.steppers-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-stepper {
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-stepper:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Schedule Live Preview Card */
.schedule-preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}
.schedule-preview-card .preview-icon {
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}
.schedule-preview-card .preview-target {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}
.schedule-preview-card .preview-rel {
    font-size: 11px;
    margin-top: 2px;
}

/* Range Sliders */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}
.range-wrapper input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}
.delay-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}
.delay-badge input[type="number"] {
    width: 60px;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    text-align: right;
}
.delay-badge input[type="number"]:focus {
    box-shadow: none;
}

/* ========================================== */
/* PROGRESS MONITOR & ACTIVITY LOGS           */
/* ========================================== */
.progress-container {
    margin-bottom: 20px;
}
.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.percent-badge {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--primary);
}
.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--bg-card-border);
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 20px;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px var(--primary-glow);
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}
.stat-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    text-align: center;
    display: flex;
    flex-direction: column;
}
.stat-num {
    font-size: 22px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}
.stat-box.success .stat-num { color: var(--success); }
.stat-box.danger .stat-num { color: var(--danger); }

.logs-wrapper {
    background: rgba(4, 7, 14, 0.65);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
}
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--bg-card-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.log-output {
    padding: 14px;
    max-height: 220px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
}
.log-line {
    margin-bottom: 6px;
    word-break: break-all;
}

/* ========================================== */
/* DATA TABLES (SCHEDULED MESSAGES)           */
/* ========================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.data-table th {
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 11px;
    white-space: nowrap;
}
.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================== */
/* API DOCS & KEY DISPLAY                     */
/* ========================================== */
.api-key-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    margin-bottom: 24px;
}
.api-key-input-wrapper {
    display: flex;
    gap: 10px;
    margin: 10px 0 8px;
}
.api-key-input-wrapper input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}
.api-subtitle {
    font-size: 15px;
    font-weight: 700;
}
.api-doc-item {
    margin-bottom: 16px;
}
.api-doc-item h4 {
    font-size: 13.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.method {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}
.method.post { background: var(--primary-light); color: #34d399; }
.api-doc-item pre {
    background: rgba(4, 7, 14, 0.8);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    color: #e2e8f0;
    line-height: 1.5;
}

/* ========================================== */
/* REDESIGNED MODALS (MESSAGE INFO & CONFIRM) */
/* ========================================== */
.msg-info-card {
    width: 100%;
    max-width: 460px;
    padding: 26px;
    border-radius: var(--radius-xl);
    position: relative;
    z-index: 100000;
    background: var(--bg-card);
    backdrop-filter: blur(28px);
    border: 1px solid var(--bg-card-border);
    box-shadow: var(--shadow-glass), 0 0 35px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.msg-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--bg-card-border);
    margin-bottom: 18px;
}
.msg-info-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.close-modal-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition-fast);
}
.close-modal-btn:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
}

.msg-preview-box {
    background: rgba(0, 0, 0, 0.35);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    margin-bottom: 20px;
    font-size: 13.5px;
    word-break: break-word;
}
.msg-preview-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.info-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}
.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.38;
    transition: opacity 0.2s ease;
}
.timeline-item.active {
    opacity: 1;
}
.tl-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bg-card-border);
    flex-shrink: 0;
}
.timeline-item.active .read-icon { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: rgba(59, 130, 246, 0.4); }
.timeline-item.active .delivered-icon { background: rgba(16, 185, 129, 0.2); color: var(--primary); border-color: rgba(16, 185, 129, 0.4); }
.timeline-item.active .sent-icon { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.tl-content { display: flex; flex-direction: column; }
.tl-title { font-size: 12.5px; font-weight: 700; color: var(--text-main); }
.tl-time { font-size: 11.5px; color: var(--text-muted); }

.msg-meta-details {
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}
.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}
.meta-row strong { color: var(--text-main); word-break: break-all; }
.copy-inline-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-copy-mini {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-copy-mini:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
}

/* Custom Confirmation Modal */
.confirm-card {
    width: 100%;
    max-width: 400px;
    padding: 28px;
    border-radius: var(--radius-xl);
    text-align: center;
    position: relative;
    z-index: 100000;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}
.confirm-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}
.confirm-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-actions button {
    flex: 1;
}

/* Media Lightbox Modal */
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}
.lightbox-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}
.lightbox-footer {
    margin-top: 14px;
}

/* ========================================== */
/* TOAST NOTIFICATIONS                        */
/* ========================================== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: rgba(13, 20, 36, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid var(--bg-card-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
}
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--accent); }
@keyframes toastSlideIn {
    from { transform: translateX(100%) translateY(-10px); opacity: 0; }
    to { transform: translateX(0) translateY(0); opacity: 1; }
}

/* ========================================== */
/* MOBILE BOTTOM NAVIGATION                   */
/* ========================================== */
.mobile-bottom-nav {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(10, 15, 27, 0.94);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--bg-card-border);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    transition: var(--transition-fast);
}
.mobile-nav-item i {
    font-size: 18px;
    transition: var(--transition-fast);
}
.mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--primary);
}
.mobile-nav-item.active i {
    transform: translateY(-2px);
}
.mobile-nav-icon-wrapper {
    position: relative;
    display: inline-flex;
}
.mobile-nav-icon-wrapper .unread-count-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    font-size: 9px;
    padding: 1px 5px;
}

/* ========================================== */
/* RESPONSIVE LAYOUT BREAKPOINTS              */
/* ========================================== */

/* Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .grid-2-col, .grid-2-col-wide {
        grid-template-columns: 1fr;
    }
    .chat-app-container {
        grid-template-columns: 280px 1fr;
    }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
    /* Show mobile-specific elements */
    .mobile-nav-toggle {
        display: inline-flex;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .sidebar-close-btn {
        display: flex;
    }
    .hide-mobile {
        display: none !important;
    }

    /* Off-canvas slide-out sidebar drawer */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Main Content adjustments */
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: calc(var(--mobile-nav-height) + 24px); /* Space for bottom nav */
    }

    .top-header {
        margin-bottom: 18px;
    }
    .header-title h1 {
        font-size: 18px;
    }
    .header-user-profile {
        padding: 4px 8px;
        gap: 6px;
    }

    /* Live Chat Mobile Experience (Sliding 2-View) */
    .chat-app-container {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 170px);
        min-height: 440px;
        position: relative;
    }
    .chat-list-sidebar {
        width: 100%;
        height: 100%;
        border-right: none;
    }
    .chat-main-window {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #080c17;
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 15;
    }
    .chat-app-container.mobile-thread-open .chat-main-window {
        transform: translateX(0);
    }
    .btn-chat-back,
    #chat-back-btn {
        display: inline-flex;
    }

    /* Scheduling Custom Controls on Mobile */
    .schedule-custom-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .time-picker-controls {
        flex-wrap: wrap;
    }

    /* Stats Grid */
    .stats-row {
        gap: 8px;
    }
    .stat-num {
        font-size: 18px;
    }

    /* Glass card padding */
    .glass-card {
        padding: 18px 14px;
        border-radius: var(--radius-lg);
    }

    /* Toast position */
    #toast-container {
        top: 14px;
        right: 14px;
        left: 14px;
    }
    .toast {
        max-width: 100%;
    }
}

/* Very Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
    .auth-card {
        padding: 26px 18px;
    }
    .schedule-preset-chips {
        gap: 6px;
    }
    .preset-chip {
        padding: 6px 10px;
        font-size: 11.5px;
    }
    .steppers-group {
        width: 100%;
        justify-content: flex-start;
    }
    .btn-stepper {
        padding: 4px 7px;
    }
    .confirm-card {
        padding: 20px 16px;
    }
    .msg-info-card {
        padding: 18px 14px;
    }
    .chat-bubble {
        max-width: 88%;
    }
}
