/* ===================================================================
   WebZítra — Shared Portal Styles
   Used by: admin/index.html, klient/index.html, klient/register.html,
            klient/setup.html
   =================================================================== */

/* ===== FONTS ===== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latinext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --bg: #0b0f1a;
    --bg-card: rgba(26, 31, 46, 0.7);
    --bg-card-solid: #1a1f2e;
    --bg-input: rgba(21, 25, 41, 0.8);
    --text: #b8c5d6;
    --text-muted: #7a8ba0;
    --heading: #f1f5f9;
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.12);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ===== ANIMATIONS ===== */
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ANIMATED BACKGROUND ORBS ===== */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.bg-orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}
.bg-orbs .orb-1 { width: 500px; height: 500px; background: var(--primary); top: -10%; left: -10%; animation-duration: 22s; }
.bg-orbs .orb-2 { width: 400px; height: 400px; background: #7c3aed; bottom: -15%; right: -10%; animation-duration: 18s; animation-delay: -5s; }
.bg-orbs .orb-3 { width: 300px; height: 300px; background: #06b6d4; top: 50%; left: 60%; opacity: 0.08; animation-duration: 25s; animation-delay: -10s; }

/* ===== AUTH SCREENS (login, register, setup) ===== */
.auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}
.auth-box {
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.auth-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--heading);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.auth-logo .icon { font-size: 2rem; }
.auth-logo .hl { color: var(--primary-light); }
.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 36px;
    letter-spacing: 0.3px;
}
.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px;
    text-align: left;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.card-description {
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.6;
}
.auth-footer {
    margin-top: 28px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}
.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--heading);
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: all 0.3s;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--error); }
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.form-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 14px;
    display: none;
    text-align: center;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
}
.form-success {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 14px;
    display: none;
    text-align: center;
    padding: 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 10px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    letter-spacing: 0.2px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-cancel {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}
.btn-cancel:hover { border-color: var(--text-muted); }

.btn-oauth {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--heading);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.btn-oauth:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}
.btn-oauth svg { width: 18px; height: 18px; }

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 14px 20px; border-radius: 12px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); font-size: 14px; font-weight: 500; animation: fadeInUp 0.3s ease; pointer-events: auto; transition: opacity 0.3s; max-width: 380px; }
.toast-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success); }
.toast-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--error); }
.toast-info { background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); color: var(--primary-light); }

/* ===== LOADING SPINNER ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===== BADGE ===== */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-inactive { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-registered { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }

/* ===== TIER BADGES ===== */
.tier-soubory { background: rgba(120, 130, 150, 0.15); color: #94a3b8; }
.tier-zaklad { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.tier-komfort { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-heading { color: var(--heading); }
.text-success { color: var(--success); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-center-justify { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.font-mono { font-family: monospace; }

/* ===== SHARED PANEL ANIMATIONS ===== */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(99, 102, 241, 0.15); }
    50% { box-shadow: 0 0 16px rgba(99, 102, 241, 0.25); }
}
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ===== FEATURE INTRO (shared by analytics, leads, integrations) ===== */
.feature-intro-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(99, 102, 241, 0.2));
}

/* ===== GLASS CARD MIXIN (shared base) ===== */
.glass-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8) 0%, rgba(21, 25, 41, 0.6) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: all 0.25s ease;
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

/* ===== ANALYTICS PANEL ===== */
.analytics-inline {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    gap: 16px;
    animation: fadeInUp 0.3s ease-out;
}
.analytics-start {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}
.analytics-start h4 {
    color: var(--heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.analytics-period-toggle {
    display: inline-flex;
    gap: 2px;
    background: rgba(21, 25, 41, 0.8);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    margin: 16px 0;
}
.analytics-period-toggle button {
    padding: 7px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s;
}
.analytics-period-toggle button.active {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.analytics-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.analytics-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}
.analytics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    opacity: 0.5;
}
.analytics-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.15);
}
.analytics-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading);
    line-height: 1.2;
    background: linear-gradient(135deg, var(--heading) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.analytics-card-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.analytics-chart {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
}
.analytics-chart-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}
.analytics-chart svg {
    width: 100%;
    height: 120px;
    display: block;
}
.analytics-bar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.analytics-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.analytics-bar-label {
    flex: 0 0 120px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
}
.analytics-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    overflow: hidden;
}
.analytics-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.analytics-bar-count {
    flex: 0 0 40px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}
.analytics-devices {
    display: flex;
    gap: 10px;
}
.analytics-device-item {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: all 0.2s;
}
.analytics-device-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.15);
}
.analytics-device-icon { font-size: 1.4rem; margin-bottom: 6px; }
.analytics-device-pct {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--heading);
}
.analytics-device-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}
.analytics-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===== LEADS PANEL ===== */
.leads-inline {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
    animation: fadeInUp 0.3s ease-out;
}
.leads-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    background: rgba(15, 18, 30, 0.4);
}
.leads-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--heading);
}
.btn-export-leads {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s;
}
.btn-export-leads:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.06);
}
.leads-list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}
.leads-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}
.lead-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.lead-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.15);
}
.lead-card.unread {
    border-left: 3px solid var(--primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), -4px 0 16px rgba(99, 102, 241, 0.08);
}
.lead-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.lead-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--heading);
}
.lead-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.lead-card-email {
    font-size: 0.82rem;
    color: var(--primary-light);
    margin-bottom: 4px;
}
.lead-card-preview {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lead-card-expanded {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.lead-card.open .lead-card-expanded { display: block; }
.lead-card.open .lead-card-preview { display: none; }
.lead-card-message {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 12px;
}
.lead-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.lead-card-actions {
    display: flex;
    gap: 8px;
}
.btn-mark-read {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s;
}
.btn-mark-read:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}
.lead-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.lead-status-dot.new {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    animation: leadPulse 2s ease-in-out infinite;
}
.lead-status-dot.read { background: var(--text-muted); opacity: 0.4; }
@keyframes leadPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
    50% { opacity: 0.5; box-shadow: 0 0 4px rgba(99, 102, 241, 0.3); }
}
.leads-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* ===== LEADS CRM — Stats, Filters, Stages, Notes ===== */
.leads-stats-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 18, 30, 0.3);
    overflow-x: auto;
    flex-shrink: 0;
}
.leads-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 48px;
}
.leads-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.leads-stat-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
}
.leads-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.leads-stat-total {
    margin-left: auto;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* Filter pills */
.leads-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    overflow-x: auto;
    flex-shrink: 0;
}
.leads-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.leads-filter-pill:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}
.leads-filter-pill.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.3);
}
.leads-filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.leads-filter-count {
    opacity: 0.6;
    font-weight: 500;
}

/* Stage badge on lead card */
.lead-stage-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    margin-right: 6px;
    vertical-align: middle;
}

/* Stage buttons in expanded card */
.lead-stage-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.lead-stage-btn {
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.lead-stage-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}
.lead-stage-btn.current {
    cursor: default;
    font-weight: 700;
}
.lead-stage-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Notes section */
.lead-notes {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.lead-notes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.lead-note {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
}
.lead-note-text {
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.5;
    flex: 1;
}
.lead-note-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.lead-note-input {
    display: flex;
    gap: 6px;
    align-items: center;
}
.lead-note-field {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.78rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}
.lead-note-field:focus {
    border-color: rgba(99, 102, 241, 0.4);
}
.lead-note-field::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}
.lead-note-add {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-light);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lead-note-add:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}
.lead-note-add:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* --- Lead reply section --- */
.lead-reply-section {
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    margin-top: 10px;
    padding-top: 10px;
}
.lead-replies-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.lead-reply {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    padding: 8px 10px;
}
.lead-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.lead-reply-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-light, #818cf8);
}
.lead-reply-time {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
}
.lead-reply-body {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    white-space: pre-wrap;
    line-height: 1.4;
}
.lead-reply-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lead-reply-field {
    width: 100%;
    background: rgba(15, 18, 30, 0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 0.78rem;
    padding: 8px 10px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.lead-reply-field:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
}
.lead-reply-field::placeholder {
    color: rgba(255,255,255,0.25);
}
.lead-reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lead-reply-hint {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}
.lead-reply-send {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary-light, #818cf8);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.lead-reply-send:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}
.lead-reply-send:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ===== AI AUTOPILOT — RECOMMENDATIONS BANNER ===== */
.recommendations-banner {
    background: rgba(15, 18, 30, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    margin: 12px 12px 0;
    overflow: hidden;
    flex-shrink: 0;
    animation: fadeInUp 0.3s ease-out;
}
.rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.rec-header:hover {
    background: rgba(255, 255, 255, 0.02);
}
.rec-header-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--heading);
}
.rec-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 6px;
}
.rec-header-toggle {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.rec-list {
    display: flex;
    flex-direction: column;
    transition: max-height 0.3s ease, opacity 0.3s;
    overflow: hidden;
}
.rec-list.collapsed {
    max-height: 0 !important;
    opacity: 0;
}
.rec-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}
.rec-card:hover {
    background: rgba(255, 255, 255, 0.02);
}
.rec-card-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.rec-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.rec-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rec-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--heading);
}
.rec-card-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.rec-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.rec-act-btn {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-light);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.rec-act-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}
.rec-act-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
.rec-dismiss-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rec-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.12);
}
@media (max-width: 480px) {
    .recommendations-banner {
        margin: 8px 8px 0;
    }
    .rec-card {
        flex-direction: column;
        gap: 8px;
    }
    .rec-card-actions {
        align-self: flex-end;
    }
}

/* ===== INTEGRATIONS PANEL ===== */
.integrations-inline {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 20px;
    animation: fadeInUp 0.3s ease-out;
}
.integrations-header {
    text-align: center;
    padding: 8px 8px 24px;
}
.integrations-header h4 {
    color: var(--heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.integrations-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}
.integration-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.integration-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.2s ease;
    position: relative;
}
.integration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    transition: all 0.3s;
}
.integration-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.15);
}
.integration-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.25), transparent);
}
.integration-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.integration-card-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
}
.integration-card-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--heading);
    flex: 1;
}
.integration-card-status {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.integration-card-status.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}
.integration-card-status.inactive {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.integration-card-value {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin: 8px 0 0;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    letter-spacing: 0.5px;
}
.integration-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.integration-card-actions button {
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-integration-edit {
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-light);
}
.btn-integration-edit:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}
.btn-integration-remove {
    border: 1px solid rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.04);
    color: var(--error);
}
.btn-integration-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}
.integration-edit-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}
.integration-edit-form input {
    flex: 1;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--heading);
    font-size: 0.85rem;
    font-family: var(--font);
    outline: none;
    transition: all 0.25s;
}
.integration-edit-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.integration-edit-form .btn-save-int {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.integration-edit-form .btn-save-int:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.integration-edit-form .btn-cancel-int {
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}
.integration-edit-form .btn-cancel-int:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}
.integration-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.06);
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.1);
}
.integration-locked {
    opacity: 0.45;
    position: relative;
    pointer-events: none;
}
.integration-locked::after {
    content: '🔒 Komfort';
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.72rem;
    color: var(--warning);
    font-weight: 600;
    background: rgba(245, 158, 11, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.15);
    pointer-events: auto;
}
.integration-apply-wrap {
    margin-top: 20px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    text-align: center;
}
.btn-apply-integrations {
    padding: 11px 28px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
    letter-spacing: 0.2px;
}
.btn-apply-integrations:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}
.btn-apply-integrations:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    box-shadow: none;
}
.integration-apply-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

/* ===== SEO BADGE ===== */
.seo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}
.seo-badge.good { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.seo-badge.warn { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.seo-badge.bad  { background: rgba(239, 68, 68, 0.15); color: var(--error); }

/* ===== QUICK ACTION DIVIDER + CONTENT CHIPS ===== */
.qa-divider {
    width: 100%;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin: 10px 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.qa-divider::before, .qa-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(34, 197, 94, 0.15);
}
.quick-chip-content {
    background: rgba(34, 197, 94, 0.06) !important;
    border-color: rgba(34, 197, 94, 0.18) !important;
    color: #4ade80 !important;
}
.quick-chip-content:hover {
    background: rgba(34, 197, 94, 0.14) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.12) !important;
}

/* ===== SEO FIX-IT BUTTON ===== */
.seo-fix-btn {
    display: inline-block;
    padding: 4px 12px;
    margin-top: 6px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.06);
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s;
}
.seo-fix-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* ===== RESPONSIVE (new panels) ===== */
@media (max-width: 768px) {
    .analytics-cards { grid-template-columns: 1fr 1fr; }
    .analytics-bar-label { flex: 0 0 80px; font-size: 0.78rem; }
    .analytics-card { padding: 14px 12px; }
    .analytics-device-item { padding: 10px 6px; }
    .integration-edit-form { flex-wrap: wrap; }
    .integration-edit-form input { min-width: 0; }
    .integration-card { padding: 12px 14px; }
    .integrations-inline { padding: 16px 12px; }
    .integration-apply-wrap { padding: 12px; margin-top: 14px; }
    .leads-list { padding: 12px; }
    .lead-card { padding: 12px 14px; }
}
