:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141f;
    --text-primary: #f0f0f5;
    --text-secondary: #9aa0a6;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --glass-bg: rgba(20, 20, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --error: #ef4444;
    --success: #22c55e;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* =========================================================
   Login Page
   ========================================================= */

/* Same dark base as the home page */
body.login-page {
    background: #030712;
    overflow: hidden;
}

/* Full-screen starfield canvas — sits behind everything */
#login-stars-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Colour tint layer — matches home page radial gradients exactly */
body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 0% 0%,    rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(217, 70, 239, 0.10) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Login Overlay — transparent so starfield shows through */
#login-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 1rem;
}

/* Login card */
.login-box {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 2.75rem 2.25rem 2rem;
    position: relative;
    z-index: 1;
    background: rgba(12, 12, 22, 0.75);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 32px 80px rgba(0, 0, 0, 0.55),
        0 0 60px rgba(139, 92, 246, 0.08);
    animation: loginSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Gradient accent line along the top edge of card */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.7), rgba(217, 70, 239, 0.7), transparent);
    border-radius: 999px;
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand header */
.login-brand {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.login-logo {
    display: inline-block;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-decoration: none;
    color: #fff;
    line-height: 1;
}
/* "Bytes" part — white */
.login-logo-white { color: #fff; }
/* "AI" part — gradient */
.login-logo-gradient {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-tagline {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
}

/* Heading + subtitle */
.login-box h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.login-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    margin: 0 0 1.5rem;
}

/* Inputs inside login */
.login-box input {
    width: 100%;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    margin-bottom: 1.25rem;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.25em;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}
.login-box input:focus {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.06);
}

.error {
    color: #fca5a5;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

/* Social login buttons */
.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.btn-social {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #f1f5f9;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    text-align: left;
    font-family: inherit;
}
.btn-social img {
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.btn-social span { flex: 1; text-align: center; }

/* Per-provider accent on hover */
.btn-google:hover {
    background: rgba(234, 67, 53, 0.12);
    border-color: rgba(234, 67, 53, 0.4);
    box-shadow: 0 4px 24px rgba(234, 67, 53, 0.15);
    transform: translateY(-1px);
}
.btn-facebook:hover {
    background: rgba(24, 119, 242, 0.12);
    border-color: rgba(24, 119, 242, 0.4);
    box-shadow: 0 4px 24px rgba(24, 119, 242, 0.15);
    transform: translateY(-1px);
}
.btn-linkedin:hover {
    background: rgba(10, 102, 194, 0.12);
    border-color: rgba(10, 102, 194, 0.4);
    box-shadow: 0 4px 24px rgba(10, 102, 194, 0.15);
    transform: translateY(-1px);
}
.btn-social:active { transform: translateY(0); box-shadow: none; }

/* Sign-up escape hatch */
.login-signup-link {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.4);
    margin: 0.25rem 0 0;
}
.login-signup-link a {
    color: #c4b5fd;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.login-signup-link a:hover { color: #ede9fe; text-decoration: underline; }

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    margin-bottom: 1.25rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

/* Layout */
#dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

/* Client brand */
.client-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 0;
}
.client-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.company-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 155px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
}

.sidebar-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.sidebar-footer-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.sidebar-footer-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.sidebar-footer-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* User avatar + dropdown */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-menu {
    position: relative;
}
.user-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: rgba(99, 102, 241, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.2s;
}
.user-avatar-btn:hover {
    border-color: var(--accent-color);
}
.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-avatar-initials {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    pointer-events: none;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.4rem;
    z-index: 500;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.user-dropdown.open {
    display: block;
}
.dropdown-user-info {
    padding: 0.65rem 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.dropdown-user-info strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}
.dropdown-user-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.35rem 0;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
}

/* Light mode */
body.light-mode {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
}

/* Content Area */
.content {
    padding: 3rem;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 2rem;
}

/* Tables */
.table-container {
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 1000px;
    /* Prevent squishing of data on small screens */
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    /* Prevent headers from stacking */
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
    white-space: nowrap;
    /* Most columns shouldn't wrap to keep it clean */
}

/* Kanban Board Layout */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    height: calc(100vh - 250px);
    align-items: flex-start;
}

.kanban-column {
    flex: 1;
    min-width: 320px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kanban-column-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px 12px 0 0;
}

.kanban-column-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.kanban-column-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Kanban Cards */
.lead-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.lead-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lead-card:active {
    cursor: grabbing;
}

.lead-card.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--accent-color);
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.lead-card-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: white;
}

.lead-card-budget {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 700;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.lead-card-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.lead-card-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lead-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.lead-card-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Allow summary to wrap if we ever remove truncation */
td:nth-child(7) {
    white-space: normal;
    min-width: 250px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
}

.form-group select {
    background: var(--bg-secondary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa0a6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.2rem;
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
}

@media (max-width: 1000px) {
    #dashboard-container {
        grid-template-columns: 1fr;
    }

    #mobile-menu-btn {
        display: block !important;
    }

    #close-sidebar-btn {
        display: block !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        padding: 1.5rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-container {
        flex-direction: column;
        gap: 1rem;
    }

    .pipeline-container>div:nth-child(even) {
        transform: rotate(90deg);
        /* Rotate the arrows down */
    }

    .login-box {
        padding: 2rem 1.25rem 1.5rem;
        margin: 0 1rem;
    }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .analytics-bottom-row { grid-template-columns: 1fr; }
}

/* ─── Analytics View ─────────────────────────────────────────────────────── */

.analytics-time-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.time-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.42rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.time-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}
.time-btn.active {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
    color: #a5b4fc;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: 3px solid transparent;
    border-radius: 14px;
    padding: 1.35rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.kpi-leads     { border-left-color: #6366f1; }
.kpi-pipeline  { border-left-color: #34d399; }
.kpi-conversion{ border-left-color: #60a5fa; }
.kpi-campaigns { border-left-color: #a78bfa; }

.kpi-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
}
.kpi-leads     .kpi-icon-wrap { background: rgba(99,102,241,0.12); color: #818cf8; }
.kpi-pipeline  .kpi-icon-wrap { background: rgba(52,211,153,0.12); color: #34d399; }
.kpi-conversion.kpi-icon-wrap, .kpi-conversion .kpi-icon-wrap { background: rgba(96,165,250,0.12); color: #60a5fa; }
.kpi-campaigns .kpi-icon-wrap { background: rgba(167,139,250,0.12); color: #a78bfa; }

.kpi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}
.kpi-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.kpi-delta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Charts layout */
.charts-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.1rem;
    margin-bottom: 1.1rem;
}
.analytics-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 1.1rem;
    margin-bottom: 2rem;
}

.chart-card {
    /* inherits glass-panel */
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.chart-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}
.chart-period {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
}

/* Bar Chart */
.bar-chart-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 130px;
}
.bar-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.bar-fill {
    width: 100%;
    min-height: 3px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(to top, rgba(99,102,241,0.85), rgba(165,180,252,0.55));
    position: relative;
    transition: height 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.bar-fill:hover {
    background: linear-gradient(to top, #6366f1, #a5b4fc);
}
.bar-val {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    color: var(--text-secondary);
    white-space: nowrap;
    pointer-events: none;
}
.bar-chart-labels {
    display: flex;
    gap: 3px;
    margin-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 5px;
}
.bar-label {
    flex: 1;
    font-size: 0.58rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

/* Funnel Chart */
.funnel-chart {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.25rem 0;
}
.funnel-row {
    display: grid;
    grid-template-columns: 85px 1fr 44px;
    align-items: center;
    gap: 0.65rem;
}
.funnel-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
}
.funnel-bar-wrap {
    position: relative;
    height: 26px;
    background: rgba(255,255,255,0.03);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.funnel-bar {
    height: 100%;
    border-radius: 5px;
    min-width: 4px;
    transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1);
    opacity: 0.85;
}
.funnel-count {
    position: absolute;
    right: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    pointer-events: none;
}
.funnel-conv {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

/* Donut Chart */
.donut-chart-wrap {
    padding: 0.25rem 0;
}
.donut-layout {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}
.donut-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}
.legend-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-label {
    flex: 1;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.legend-count {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 18px;
    text-align: right;
}
.legend-pct {
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    font-size: 0.9rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border-radius: 7px;
    flex-shrink: 0;
}
.activity-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.activity-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-event {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.activity-time {
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Settings Page ──────────────────────────────────────────────────────────── */

.settings-layout {
    max-width: 820px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Toggle switch */
.sett-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}
.sett-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sett-toggle-thumb {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    transition: background 0.2s;
}
.sett-toggle-thumb::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.sett-toggle input:checked ~ .sett-toggle-thumb { background: var(--accent-color); }
.sett-toggle input:checked ~ .sett-toggle-thumb::before { transform: translateX(20px); }
.sett-toggle input:disabled ~ .sett-toggle-thumb { opacity: 0.5; cursor: not-allowed; }

/* Mode picker buttons */
.sett-mode-btn {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.sett-mode-btn.active {
    background: var(--accent-color);
    color: white;
}
.sett-mode-btn:hover:not(.active) {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

/* Settings toggle row */
.sett-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sett-toggle-row:last-child { border-bottom: none; }
.sett-toggle-row p { margin: 0; }
.sett-toggle-row .sett-label { font-size: 0.88rem; font-weight: 600; }
.sett-toggle-row .sett-note { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.1rem; }
