/* ==========================================================================
   DESIGN SYSTEM & PREMIUM LIGHT THEME (WHITE BACKGROUND)
   ========================================================================== */
:root {
    --bg-dark: #f8fafc;
    --bg-container: rgba(255, 255, 255, 0.75);
    --bg-sidebar: rgba(248, 250, 252, 0.9);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-glow: rgba(255, 107, 59, 0.2);
    --border-glow-secondary: rgba(99, 102, 241, 0.2);

    --primary: #ff6b3b;
    /* Vibrant Coral */
    --primary-gradient: linear-gradient(135deg, #ff6b3b 0%, #ff8c42 100%);
    --primary-glow: rgba(255, 107, 59, 0.15);

    --secondary: #6366f1;
    /* Indigo */
    --secondary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --secondary-glow: rgba(99, 102, 241, 0.15);

    --accent: #8b5cf6;
    /* Violet */

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dark: #94a3b8;

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.1);
    --warning: #d97706;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;

    --shadow-premium: 0 20px 40px -15px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ambient Glow Spheres */
.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -150px;
    left: -150px;
    animation: pulseGlow 15s infinite alternate;
}

.glow-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation: pulseGlow 20s infinite alternate-reverse;
}

.glow-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: 30%;
    left: 25%;
    animation: pulseGlow 18s infinite alternate-reverse;
    opacity: 0.08;
}

@keyframes pulseGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(60px, 40px) scale(1.1);
    }
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    width: 98vw;
    height: 96vh;
    max-width: 1700px;
    max-height: 1000px;
    background: var(--bg-container);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    display: flex;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
.app-sidebar {
    width: 290px;
    min-width: 290px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    font-size: 26px;
    text-shadow: 0 0 15px var(--primary-glow);
}

.sidebar-header h1 {
    font-family: var(--font-heading);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header .subtitle {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dark);
    margin-top: 3px;
}

.user-profile-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-top: 14px;
    font-size: 12px;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.logout-btn:hover {
    transform: scale(1.1);
}

/* Sidebar Navigation & Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.sidebar-menu-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #1e293b;
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    outline: none;
    width: 100%;
}

.sidebar-menu-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #000000;
    transform: translateX(4px);
}

.sidebar-menu-btn.active {
    color: #000000 !important;
    font-weight: 700;
    position: relative;
}

/* Color-coded menu items active state */
.sidebar-menu-btn.active[data-tab="dashboard-tab"] {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.sidebar-menu-btn.active[data-tab="dashboard-tab"]::before {
    background: var(--secondary-gradient);
}

.sidebar-menu-btn.active[data-tab="bots-tab"] {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08);
}

.sidebar-menu-btn.active[data-tab="bots-tab"]::before {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
}

.sidebar-menu-btn.active[data-tab="analytics-tab"] {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.06);
}

.sidebar-menu-btn.active[data-tab="analytics-tab"]::before {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
}

.sidebar-menu-btn.active[data-tab="create-tab"] {
    background: rgba(255, 107, 59, 0.08);
    border: 1px solid rgba(255, 107, 59, 0.2);
    box-shadow: 0 4px 12px rgba(255, 107, 59, 0.06);
}

.sidebar-menu-btn.active[data-tab="create-tab"]::before {
    background: var(--primary-gradient);
}

.sidebar-menu-btn.active[data-tab="integration-tab"] {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08);
}

.sidebar-menu-btn.active[data-tab="integration-tab"]::before {
    background: linear-gradient(135deg, var(--accent) 0%, #c084fc 100%);
}

.sidebar-menu-btn.active[data-tab="chat-tab"] {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.06);
}

.sidebar-menu-btn.active[data-tab="chat-tab"]::before {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
}

.sidebar-menu-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    border-radius: 0 4px 4px 0;
}

.sidebar-menu-btn .menu-icon {
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

/* Menu icons background colors */
.sidebar-menu-btn[data-tab="dashboard-tab"] .menu-icon {
    background: rgba(99, 102, 241, 0.08);
    color: var(--secondary);
}

.sidebar-menu-btn[data-tab="bots-tab"] .menu-icon {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent);
}

.sidebar-menu-btn[data-tab="analytics-tab"] .menu-icon {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
}

.sidebar-menu-btn[data-tab="create-tab"] .menu-icon {
    background: rgba(255, 107, 59, 0.08);
    color: var(--primary);
}

.sidebar-menu-btn[data-tab="integration-tab"] .menu-icon {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent);
}

.sidebar-menu-btn[data-tab="chat-tab"] .menu-icon {
    background: rgba(6, 182, 212, 0.08);
    color: #06b6d4;
}

/* Micro-animations on hover */
.sidebar-menu-btn:hover .menu-icon {
    transform: scale(1.15) rotate(5deg);
}

.flex-grow {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
    flex-grow: 1;
}

.bots-list::-webkit-scrollbar {
    width: 4px;
}

.bots-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.bot-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bot-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary-glow);
}

.bot-item.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.bot-item h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-item p {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    text-align: center;
    color: var(--text-dark);
    font-size: 11px;
    padding: 16px 8px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}

.sidebar-footer {
    font-size: 10px;
    color: var(--text-dark);
    text-align: center;
    margin-top: auto;
}

/* ==========================================================================
   MAIN CONTENT WORKSPACE
   ========================================================================== */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.015);
    overflow: hidden;
}

/* Header & Navigation */
.main-header {
    height: 65px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.45);
}

.header-title-area h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.api-status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 0 0 var(--success-glow);
    animation: statusPulse 1.8s infinite;
}

.status-dot-pulse.inactive {
    background-color: var(--danger);
    box-shadow: 0 0 0 0 var(--danger-glow);
    animation: statusPulseDanger 1.8s infinite;
}

@keyframes statusPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes statusPulseDanger {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.tab-content-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    position: relative;
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: tabFadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: flex;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: scale(0.99) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   CARDS & STYLED CONTROLS
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

.form-row > .form-group {
    flex: 1 1 280px;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 13.5px;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

textarea {
    resize: vertical;
}

.url-input-container {
    display: flex;
    position: relative;
    width: 100%;
}

.url-prefix {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-right: none;
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 0 16px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    user-select: none;
}

.url-input-container input {
    flex: 1;
    min-width: 0;
    width: auto !important;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    width: 100%;
}

input[type="range"] {
    flex-grow: 1;
    accent-color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

.range-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 32px;
    text-align: center;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.input-help {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Buttons */
.btn {
    background: transparent;
    /* Prevent default browser button background */
    color: #f8fafc;
    /* Default text color fallback */
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    outline: none;
}

.btn:active:not(:disabled) {
    transform: scale(0.97) translateY(0) !important;
    transition: transform 0.1s ease;
}

.btn-primary {
    background-color: #ff6b3b !important;
    /* Coral solid fallback */
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px var(--primary-glow) !important;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(255, 107, 59, 0.45) !important;
}

.btn-secondary {
    background-color: #1e293b !important;
    /* Dark solid fallback */
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #ef4444 !important;
    /* Red solid fallback */
    background: var(--danger-glow) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: var(--danger) !important;
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11.5px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 14.5px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Glowing primary buttons with shimmer hover animation */
.btn-glow {
    box-shadow: 0 4px 15px var(--primary-glow), 0 0 10px rgba(255, 107, 59, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.18) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(25deg);
    transition: none;
    opacity: 0;
    pointer-events: none;
}

.btn-glow:hover::after {
    left: 150%;
    opacity: 1;
    transition: all 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar navigation item buttons */
.sidebar-btn {
    justify-content: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.sidebar-btn.btn-secondary {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar-btn.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.sidebar-btn.btn-secondary.active {
    background-color: #312e81 !important;
    /* Active solid indigo fallback */
    background: var(--secondary-gradient) !important;
    border-color: var(--secondary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px var(--secondary-glow) !important;
}

.sidebar-btn.btn-primary {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    box-shadow: none !important;
}

.sidebar-btn.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.sidebar-btn.btn-primary.active {
    background-color: #ff6b3b !important;
    /* Active solid coral fallback */
    background: var(--primary-gradient) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px var(--primary-glow) !important;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(18deg);
}

/* ==========================================================================
   TAB 0: ANALYTICS & DASHBOARD
   ========================================================================== */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.welcome-text h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.welcome-text p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Dashboard Layout Grid */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    align-items: start;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 10px;
}

.stat-card {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-gradient);
}

.stat-card:nth-child(2)::after {
    background: var(--primary-gradient);
}

.stat-card:nth-child(3)::after {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 10px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Chatbot Cards list */
.dashboard-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    margin-top: 6px;
}

.dashboard-header-container h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bot-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.bot-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.25);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.bot-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}

.bot-card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-card-domain {
    font-size: 11px;
    color: var(--secondary);
    text-decoration: none;
    display: inline-block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bot-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-sector,
.badge-pages,
.badge-status {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.badge-sector {
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.15);
    background: rgba(192, 132, 252, 0.05);
}

.badge-status.status-active {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.05);
}

.badge-status.status-inactive {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.05);
}

.bot-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.progress-label {
    color: var(--text-muted);
}

.progress-value {
    color: var(--text-main);
    font-weight: 500;
}

.progress-bar-bg {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--secondary);
    width: 0;
    transition: width 0.5s ease-out;
}

.progress-bar-fill.normal {
    background: var(--success);
}

.progress-bar-fill.warning {
    background: var(--warning);
}

.progress-bar-fill.danger {
    background: var(--danger);
}

.bot-card-date {
    font-size: 10px;
    color: var(--text-dark);
    margin-top: 4px;
}

.bot-card-footer {
    display: flex;
    gap: 8px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 10px;
}

.bot-card-footer button {
    flex: 1;
}

.bot-card-footer .btn-delete-icon {
    flex: 0 0 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Right Analytics Side Panel */
.analytics-side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-card h4 {
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 6px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   TAB 1: CRAWLER / CREATE
   ========================================================================== */
.create-card {
    max-width: 900px;
    padding: 32px;
}

#start-pipeline-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#start-pipeline-form .form-row {
    gap: 36px; /* Widen the space between depth and page count limit */
    margin-top: 12px; /* Take the depth part a bit lower, separating it from website-url */
}

#start-pipeline-form .btn-large {
    align-self: flex-start;
    margin-top: 16px; /* Space above button */
}

@media (max-width: 576px) {
    .create-card {
        padding: 20px;
    }
    #start-pipeline-form .form-row {
        gap: 16px;
    }
    #start-pipeline-form .btn-large {
        width: 100%;
        align-self: stretch;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 10px;
    max-width: 900px;
}

.info-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.015);
}

.info-icon {
    font-size: 22px;
}

.info-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.info-card p {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   TAB 2: PIPELINE MONITOR
   ========================================================================== */
.view-navigation-bar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 6px;
}

.pipeline-header {
    display: none !important;
}

.pipeline-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.pipeline-stepper {
    background: var(--bg-card);
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 10px;
    margin-top: 14px;
}

.steps-list::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 17px;
    width: 2px;
    height: calc(100% - 30px);
    background: rgba(15, 23, 42, 0.08);
    z-index: 1;
}

.step-item {
    display: flex;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.step-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: var(--text-dark);
    transition: var(--transition);
}

.step-info h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.step-info p {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.step-progress-mini {
    font-size: 9.5px;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 4px;
}

.step-item.active .step-indicator {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transform: scale(1.05);
}

.step-item.active .step-info h4 {
    color: var(--text-main);
}

.step-item.completed .step-indicator {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-item.completed .step-indicator::after {
    content: '✓';
    font-size: 9px;
}

.step-item.completed .step-info h4 {
    color: var(--success);
}

.links-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 380px;
}

.links-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.links-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.links-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
}

.links-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-top: 6px;
}

.links-section-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.link-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.link-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.link-row input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.link-row-title {
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    max-width: 250px;
}

.link-row-url {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.link-row-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: auto;
}

.links-action-bar {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   TAB 3: CHAT SANDBOX
   ========================================================================== */
.chat-workspace {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    height: calc(100vh - 160px);
    max-height: 750px;
}

.bot-profile-sidebar {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.bot-profile-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.bot-avatar {
    font-size: 32px;
    margin-bottom: 6px;
    display: inline-block;
}

.bot-profile-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.bot-profile-header p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.bot-profile-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-info-group h5 {
    font-size: 10.5px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile-info-group p,
.profile-info-group ul {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.profile-info-group ul {
    padding-left: 14px;
}

.profile-contact-list p {
    margin-bottom: 4px;
}

.chat-interface {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.chat-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-bot-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-bot-title h3 {
    font-size: 14px;
    font-weight: 700;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    transition: background 0.3s ease;
}

.status-indicator.inactive {
    background: var(--danger) !important;
}

.status-text {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.message.user .message-bubble {
    background: var(--secondary-gradient);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.message.assistant .message-bubble {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.message-time {
    font-size: 9.5px;
    color: var(--text-dark);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-input-area {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   MODAL / WIDGET EDITOR & PREVIEW PANELS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 12, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: 90%;
    max-width: 950px;
    height: 90vh;
    max-height: 850px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.modal-body::-webkit-scrollbar {
    width: 5px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.modal-form-scroll {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
}

.section-divider {
    font-family: var(--font-heading);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    padding-bottom: 4px;
    margin-top: 10px;
}

.reset-usage-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

/* Real-time Widget Simulator */
.widget-simulator-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
}

.widget-simulator-container h4 {
    font-family: var(--font-heading);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.phone-mockup {
    border: 6px solid #1e293b;
    border-radius: 20px;
    height: 380px;
    background: #f8fafc;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sim-header {
    padding: 10px 14px;
    background: var(--primary);
    /* Configured via JS */
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.sim-title-wrap {
    display: flex;
    flex-direction: column;
}

.sim-name {
    font-size: 11.5px;
    font-weight: 600;
}

.sim-status {
    font-size: 8.5px;
    opacity: 0.8;
}

.sim-body {
    flex-grow: 1;
    background: #f8fafc;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.sim-msg {
    max-width: 85%;
    font-size: 11px;
    line-height: 1.4;
    padding: 7px 10px;
    border-radius: 8px;
}

.sim-msg.bot {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    align-self: flex-start;
    border-bottom-left-radius: 1px;
}

.sim-msg.user {
    background: var(--primary);
    /* Configured via JS */
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 1px;
}

.sim-footer {
    padding: 8px 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    gap: 6px;
    background: #ffffff;
}

.sim-input {
    flex-grow: 1;
    font-size: 11px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 4px;
    padding: 5px 8px;
    color: #94a3b8;
    pointer-events: none;
    /* Non interactive */
}

.sim-send {
    background: var(--primary);
    /* Configured via JS */
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATION COMPONENT (NAMESPACED & CONFLICT-FREE)
   ========================================================================== */
.botcraft-toast-container {
    position: fixed;
    top: 20px;
    right: 24px;
    left: auto !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999 !important;
}

.botcraft-toast {
    background: #111827 !important;
    /* Solid dark fallback */
    background: rgba(17, 24, 39, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    min-width: 300px;
    max-width: 450px;
    padding: 14px 20px;
    color: #f8fafc !important;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastFadeOut 0.3s ease forwards;
    animation-delay: 0s, 3.7s;
}

.botcraft-toast.success {
    border-left: 4px solid var(--success) !important;
    background: rgba(16, 185, 129, 0.08) !important;
    color: #34d399 !important;
}

.botcraft-toast.error {
    border-left: 4px solid var(--danger) !important;
    background: rgba(239, 68, 68, 0.08) !important;
    color: #fca5a5 !important;
}

.botcraft-toast.info {
    border-left: 4px solid var(--secondary) !important;
    background: rgba(99, 102, 241, 0.08) !important;
    color: #a5b4fc !important;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%) translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
    }
}

/* ==========================================================================
   AUTH CARD & LOGIN SCREEN
   ========================================================================== */
.auth-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 50;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, var(--bg-dark) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow-premium);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-icon {
    font-size: 40px;
    text-shadow: 0 0 20px var(--primary-glow);
    margin-bottom: 10px;
    display: inline-block;
}

.auth-header h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

.auth-error-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    text-align: center;
    margin-bottom: 20px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider::before {
    margin-right: .5em;
}

.auth-divider::after {
    margin-left: .5em;
}

.auth-divider span {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

#google-signin-btn {
    display: flex;
    justify-content: center;
    width: 100%;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==========================================================================
   RESPONSIVE DESIGN MEDIA QUERIES (PREMIUM WRAPPING)
   ========================================================================== */
@media (max-width: 1100px) {
    .dashboard-grid-layout {
        grid-template-columns: 1fr;
    }

    .analytics-side-panel {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .pipeline-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   NEW REDESIGNED TAB VIEWS (DASHBOARD HOME, BOTS, ANALYTICS, INTEGRATION)
   ========================================================================== */

/* Dashboard Home: Stats & Quick Overview */
.dashboard-home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 900px) {
    .dashboard-home-grid {
        grid-template-columns: 1fr;
    }
}

.system-health-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.health-item span {
    font-size: 13.5px;
    color: var(--text-muted);
}

.health-item .badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12) !important;
    color: var(--success) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.badge-info {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

.quick-guide-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-steps li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.guide-steps li .step-num {
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.guide-steps li .step-num.step-orange {
    background: var(--primary-gradient);
    box-shadow: 0 0 10px rgba(255, 107, 59, 0.3);
}

.guide-steps li .step-num.step-purple {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.guide-steps li .step-num.step-blue {
    background: var(--secondary-gradient);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.guide-steps li .step-num.step-green {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.guide-steps li strong {
    font-size: 14px;
    color: var(--text-main);
}

.guide-steps li p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.5;
}

/* Analytics Tab Visual Grid */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* SaaS Integration Panel */
.integration-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.integration-steps-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.integration-step {
    display: flex;
    gap: 18px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 18px;
    border-radius: var(--radius-md);
    align-items: flex-start;
    transition: var(--transition);
}

.integration-step:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.integration-step .step-badge {
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.integration-step .step-badge.step-badge-purple {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.integration-step .step-badge.step-badge-blue {
    background: var(--secondary-gradient);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.integration-step .step-badge.step-badge-green {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.integration-step .step-text h4 {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.integration-step .step-text p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.integration-step .step-text code {
    background: rgba(0, 0, 0, 0.35);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12.5px;
}

/* Selector dropdown customizations */
.chat-bot-selector-dropdown {
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.06) !important;
}

.chat-bot-selector-dropdown:focus {
    border-color: var(--secondary) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25) !important;
}

/* ==========================================================================
   WIDGET ICON / LOGO SELECTOR STYLING
   ========================================================================== */
.launcher-icon-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    align-items: center;
}

.icon-preset-btn,
.icon-custom-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.icon-preset-btn:hover,
.icon-custom-btn:hover {
    transform: translateY(-2px);
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.icon-preset-btn.active,
.icon-custom-btn.active {
    border-color: var(--primary);
    background: rgba(255, 107, 59, 0.1);
    box-shadow: 0 0 14px var(--primary-glow);
    transform: scale(1.08);
}

.icon-custom-btn .custom-logo-placeholder {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.icon-custom-btn:hover .custom-logo-placeholder {
    color: var(--text-main);
}

.custom-logo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    z-index: 2;
}

/* Simulated Widget Launcher Overlay on Phone Mockup */
.sim-launcher {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    pointer-events: none;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sim-launcher img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Sim Avatar inside mockup header */
.sim-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Chatbot Analytics Page Selector Grid & Modal Styles */
.analytics-bot-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.analytics-bot-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics-bot-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.analytics-bot-item-card h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.analytics-bot-item-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.analytics-bot-item-card .bot-card-domain {
    font-size: 11px;
    color: var(--secondary);
    text-decoration: none;
    word-break: break-all;
    margin-top: auto;
}

.analytics-modal-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .analytics-modal-grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Edit History Timeline Items */
.edit-history-timeline-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.edit-history-timeline-item:last-child {
    border-bottom: none;
}

.edit-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.edit-history-time {
    color: var(--secondary);
    font-weight: 600;
}

.edit-history-detail {
    color: var(--text-main);
    line-height: 1.4;
}

/* Period Selector Inside Analytics Detail Modal */
.period-selector button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 11px;
}

.period-selector button.active {
    background: var(--secondary) !important;
    color: #fff !important;
    font-weight: 600;
}