/* === POLYMATH PRODUCTIONS - AI LEAD GENERATION & CRM SYSTEM ===
 * Minimalist B2B SaaS Design System
 */

:root {
    --crm-bg: #090d16;
    --crm-card-bg: #121824;
    --crm-card-hover: #172030;
    --crm-border: rgba(255, 255, 255, 0.06);
    --crm-border-focus: rgba(99, 102, 241, 0.4);
    
    /* B2B SaaS Palette */
    --crm-primary: #6366f1;              /* Indigo */
    --crm-primary-hover: #4f46e5;
    --crm-cyan: #0ea5e9;                 /* Sky/Ocean Blue */
    --crm-orange: #f97316;               /* Amber/Orange */
    --crm-green: #10b981;                /* Emerald Green */
    --crm-blue: #3b82f6;                 /* Royal Blue */
    --crm-purple: #8b5cf6;               /* Violet */
    
    --crm-text-main: #f8fafc;
    --crm-text-sub: #94a3b8;
    --crm-text-muted: #64748b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 36px 0 rgba(0, 0, 0, 0.45);
}

/* Base CRM Layout */
body.crm-body {
    background-color: var(--crm-bg);
    background: radial-gradient(circle at 50% 0%, #151d30 0%, #090d16 100%) no-repeat;
    background-attachment: fixed;
    color: var(--crm-text-main);
    font-family: var(--font-body, 'Inter', sans-serif);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

body.crm-modal-open { overflow: hidden; }

.crm-wrapper {
    max-width: 1720px;
    margin: 95px auto 60px auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.lead-detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 9px;
    margin-bottom: 1rem;
}

.lead-detail-info-block {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    background: rgba(7, 9, 14, 0.3);
    overflow-wrap: anywhere;
}

.lead-detail-info-block > strong {
    display: block;
    margin-bottom: 4px;
    color: var(--crm-text-sub);
    font-size: 0.76rem;
    font-weight: 600;
}

.lead-detail-info-value {
    display: block;
    color: var(--crm-text-main);
    font-size: 0.88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

a.lead-detail-info-value { color: var(--crm-cyan); }

.lead-detail-contacts,
.lead-detail-imported {
    margin: 0 0 1rem;
    padding: 12px;
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    background: rgba(7, 9, 14, 0.3);
    font-size: 0.85rem;
}

/* Navigation Bar */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--crm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-sizing: border-box;
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--crm-primary);
}

.crm-badge-pro {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--crm-primary);
    color: #fff;
}

.lang-switch {
    font-size: 0.8rem;
    color: var(--crm-text-muted);
}

.lang-opt {
    cursor: pointer;
    transition: var(--transition);
}

.lang-opt:hover, .lang-opt.active {
    color: #fff;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--crm-border);
    color: var(--crm-text-sub);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* CRM Top Header */
.crm-header-card {
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.crm-brand-info h1 {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px 0;
}

.crm-brand-info h1 span {
    color: var(--crm-primary);
}

.crm-brand-info p {
    color: var(--crm-text-sub);
    font-size: 0.85rem;
    margin: 0;
}

.crm-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.crm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--crm-cyan);
}

.crm-dot-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--crm-cyan);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8); opacity: 0.5; }
}

/* Button UI */
.btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--crm-border);
    background: transparent;
    color: var(--crm-text-sub);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-primary:hover {
    background: var(--crm-primary-hover);
    border-color: var(--crm-primary-hover);
}

.btn-upgrade-glow {
    background: var(--crm-primary);
    color: #fff !important;
    border-color: var(--crm-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2) !important;
}

.btn-upgrade-glow:hover {
    background: var(--crm-primary-hover);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.45) !important;
}

/* KPI Summary Bar */
.crm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--kpi-color, var(--crm-primary));
}

.kpi-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
}

.kpi-info .kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--crm-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.kpi-info .kpi-val {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

.kpi-icon {
    font-size: 1.75rem;
    opacity: 0.7;
}

/* Multi-Source AI Scanner Panel */
.scanner-card {
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
}

.scanner-title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scanner-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: center;
}

.scanner-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.scanner-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(7, 9, 14, 0.6);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.88rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.scanner-input:focus {
    outline: none;
    border-color: var(--crm-primary);
}

.scanner-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(7, 9, 14, 0.6);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    box-sizing: border-box;
}

.scanner-select:focus {
    outline: none;
    border-color: var(--crm-primary);
}

.btn-scan {
    padding: 10px 20px;
    background: var(--crm-primary);
    color: #fff;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.btn-scan:hover {
    background: var(--crm-primary-hover);
}

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

/* Quick Search Suggestions */
.scanner-tags-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.scanner-tag-hint {
    font-size: 0.72rem;
    color: var(--crm-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.scan-suggestion-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--crm-border);
    color: var(--crm-text-sub);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.scan-suggestion-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #fff;
}

/* Live Progress radar & log */
.scanner-progress-box {
    margin-top: 1.2rem;
    padding: 1rem;
    background: rgba(7, 9, 14, 0.4);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    display: none;
}

.scanner-progress-box.active {
    display: block;
}

.progress-step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--crm-text-sub);
}

.spinner-radar {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--crm-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toolbar & View Controls */
.crm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.view-toggle-group {
    display: inline-flex;
    background: rgba(18, 22, 32, 0.6);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.lead-origin-filter { flex: 0 0 auto; }
.lead-origin-filter .view-btn { white-space: nowrap; }

.view-btn {
    background: transparent;
    border: none;
    color: var(--crm-text-sub);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.view-btn.active {
    background: var(--crm-primary);
    color: #fff;
}

.crm-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-search-input {
    padding: 7px 12px;
    background: rgba(18, 22, 32, 0.6);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.82rem;
    min-width: 200px;
}

.crm-search-input:focus {
    outline: none;
    border-color: var(--crm-primary);
}

/* Kanban Board Layout */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(270px, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    min-height: 500px;
}

.kanban-col {
    background: rgba(18, 22, 32, 0.5);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}

.kanban-col.drag-over {
    border-color: var(--crm-primary);
    background: rgba(99, 102, 241, 0.03);
}

.kanban-col-header {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--crm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.col-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.col-title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
}

.col-count-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--crm-text-sub);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

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

/* Lead Cards (Kanban) */
.lead-card {
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: grab;
    transition: var(--transition);
    position: relative;
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.lead-card:hover {
    border-color: var(--crm-border-focus);
    background: var(--crm-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.lead-card.dragging {
    opacity: 0.3;
    cursor: grabbing;
}

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

.lead-name {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
}

.ai-score-badge {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.lead-seriousness-score {
    color: var(--crm-text-muted, #a0aec0);
    font-size: 0.68rem;
    white-space: nowrap;
    max-width: 92px;
    text-align: right;
}

.score-super-hot {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid var(--crm-orange);
    color: var(--crm-orange);
}

.score-hot {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid var(--crm-cyan);
    color: var(--crm-cyan);
}

.score-medium {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--crm-text-sub);
}

.lead-category {
    font-size: 0.75rem;
    color: var(--crm-primary);
    margin-bottom: 4px;
    font-weight: 500;
}

.lead-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--crm-text-sub);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.lead-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.lead-ai-snippet {
    background: rgba(7, 9, 14, 0.4);
    border-left: 2px solid var(--crm-primary);
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    line-height: 1.35;
}

/* Action Toolbar on Cards */
.lead-action-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Current lead-card renderer uses the compact action row below. */
.lead-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-lead-action {
    flex: 1;
    min-width: 0;
    min-height: 32px;
    padding: 6px 8px;
    border: 1px solid var(--crm-border);
    border-radius: 7px;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-lead-action:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.09);
}

.btn-lead-action.btn-wa {
    background: var(--crm-green);
    border-color: var(--crm-green);
}

.btn-lead-action.btn-wa:hover {
    background: #0d9488;
}

.btn-lead-action.btn-lead-check {
    color: #b9fff1;
    border-color: rgba(16, 185, 129, 0.38);
    background: rgba(16, 185, 129, 0.12);
}

.btn-lead-action.btn-lead-check:hover:not(:disabled) {
    border-color: var(--crm-green);
    background: rgba(16, 185, 129, 0.22);
}

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

.lead-maps-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    color: var(--crm-cyan);
    font-size: 0.72rem;
    text-decoration: none;
}

.lead-maps-link:hover {
    border-color: var(--crm-cyan);
    color: #fff;
}

.lead-ai-summary {
    background: rgba(7, 9, 14, 0.4);
    border-left: 2px solid var(--crm-primary);
    padding: 5px 8px;
    border-radius: 0 5px 5px 0;
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    line-height: 1.35;
}

.lead-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.lead-tag {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--crm-text-muted);
    font-size: 0.68rem;
}

.btn-action-wa {
    flex: 1;
    padding: 5px 8px;
    background: var(--crm-green);
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-action-wa:hover {
    background: #0d9488;
}

.btn-action-phone, .btn-action-cal, .btn-action-gcal, .btn-action-post {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--crm-border);
    color: var(--crm-text-sub);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.btn-action-phone:hover, .btn-action-cal:hover, .btn-action-gcal:hover, .btn-action-post:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* List Table View */
.list-view-container {
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: none;
    box-shadow: var(--shadow-sm);
}

.list-view-container.active {
    display: block;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.crm-table th {
    background: rgba(7, 9, 14, 0.4);
    padding: 10px 14px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--crm-text-muted);
    border-bottom: 1px solid var(--crm-border);
}

.crm-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
    color: var(--crm-text-sub);
    vertical-align: middle;
}

.crm-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
    color: #fff;
}

/* Modals System */
.crm-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.crm-modal-backdrop.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.crm-modal-card {
    background: #111622;
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.crm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--crm-border);
    padding-bottom: 0.75rem;
}

.crm-modal-title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-modal-close {
    background: transparent;
    border: none;
    color: var(--crm-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.crm-modal-close:hover {
    color: var(--crm-orange);
}

/* Post Contact Form Styling */
.post-contact-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
}

.status-radio-card {
    position: relative;
}

.status-radio-card input {
    position: absolute;
    opacity: 0;
}

.status-radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: rgba(7, 9, 14, 0.4);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--crm-text-sub);
    transition: var(--transition);
    text-align: center;
    gap: 3px;
}

.status-radio-card input:checked + .status-radio-label {
    border-color: var(--crm-primary);
    background: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.interest-option-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.interest-radio-card input {
    position: absolute;
    opacity: 0;
}

.interest-radio-label {
    display: block;
    text-align: center;
    padding: 8px;
    background: rgba(7, 9, 14, 0.4);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--crm-text-sub);
    transition: var(--transition);
}

.interest-radio-card input:checked + .interest-radio-label {
    border-color: var(--crm-orange);
    background: rgba(249, 115, 22, 0.1);
    color: #fff;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--crm-text-sub);
    margin-bottom: 4px;
    display: block;
}

.form-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(7, 9, 14, 0.5);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--crm-primary);
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(7, 9, 14, 0.5);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--crm-primary);
}

/* Tabs inside Modal */
.modal-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--crm-border);
    padding-bottom: 6px;
}

.modal-tab-btn {
    background: transparent;
    border: none;
    color: var(--crm-text-muted);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 600;
}

/* Timeline in Detail Modal */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.lead-notes-panel {
    margin: 0 0 1.5rem;
    padding: 14px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
}

.lead-notes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.lead-notes-header .form-label {
    margin-bottom: 2px;
}

.lead-notes-hint {
    margin: 0;
    color: var(--crm-text-sub);
    font-size: 0.76rem;
    line-height: 1.35;
}

.lead-notes-admin-badge {
    flex-shrink: 0;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    color: var(--crm-text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
}

.lead-notes-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.lead-note-status {
    flex: 1;
    color: var(--crm-text-sub);
    font-size: 0.78rem;
}

.lead-notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.lead-notes-empty {
    padding: 8px 0 2px;
    color: var(--crm-text-muted);
    font-size: 0.78rem;
}

.lead-note-item {
    padding: 9px 10px;
    background: rgba(7, 9, 14, 0.32);
    border-left: 2px solid var(--crm-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.lead-note-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
    color: var(--crm-text-sub);
    font-size: 0.72rem;
}

.lead-note-text {
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.timeline-item {
    background: rgba(7, 9, 14, 0.3);
    border-left: 2px solid var(--crm-primary);
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.78rem;
}

.timeline-time {
    color: var(--crm-text-muted);
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.timeline-desc {
    color: #cbd5e1;
}

/* Floating Toast */
#crm-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #111625;
    border: 1px solid var(--crm-border);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 100000;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

#crm-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* User Role & Quota Badges */
.crm-user-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.crm-user-tier-badge.emp {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--crm-primary);
}

.crm-user-tier-badge.cust {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--crm-orange);
}

/* Empty Pipeline Banner */
.empty-pipeline-banner {
    grid-column: 1 / -1;
    background: var(--crm-card-bg);
    border: 1px dashed var(--crm-border);
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.empty-pipeline-banner h3 {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.empty-pipeline-banner p {
    color: var(--crm-text-sub);
    font-size: 0.85rem;
    max-width: 500px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.btn-save-pipeline {
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Multi-Tenant Database Status Badge */
.crm-db-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition);
}

.crm-db-badge-emp {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--crm-primary);
}

.crm-db-badge-cust {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--crm-blue);
}

/* AI Website Audit Badges & Card Styles */
.ai-website-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.ai-website-badge.status-no-website {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.25);
    color: var(--crm-orange);
}

.ai-website-badge.status-gap-found {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--crm-primary);
}

.ai-website-badge.status-unqualified {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ai-audit-card {
    background: rgba(7, 9, 14, 0.4);
    border: 1px solid var(--crm-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 1.2rem;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Breakpoints & Mobile UI Optimizations */
@media (max-width: 1024px) {
    .crm-wrapper {
        padding: 1rem;
    }

    .crm-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .scanner-form-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .crm-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    nav {
        padding: 0.8rem 1rem;
    }

    .scanner-form-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .crm-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .crm-filter-bar {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .crm-search-input {
        width: 100%;
    }

    .crm-modal-card {
        width: 95%;
        margin: 1rem auto;
        padding: 1.2rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Lead details is a real mobile page, not a desktop panel floating over
       half of the dashboard. Dynamic viewport units account for browser bars;
       safe-area padding keeps the close button and actions reachable. */
    #lead-details-modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    #lead-details-modal .crm-modal-card {
        width: 100%;
        max-width: none !important;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: calc(0.85rem + env(safe-area-inset-top))
                 calc(0.85rem + env(safe-area-inset-right))
                 calc(1rem + env(safe-area-inset-bottom))
                 calc(0.85rem + env(safe-area-inset-left));
    }

    #lead-details-modal .crm-modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #111622;
        padding-top: 0.25rem;
    }

    #lead-details-modal .crm-modal-close {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #lead-details-modal .modal-tabs { flex-wrap: nowrap; }
    #lead-details-modal .form-textarea { min-height: 150px !important; }

    .kanban-board {
        grid-template-columns: repeat(6, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    .scanner-form-grid {
        grid-template-columns: 1fr !important;
    }

    .crm-kpi-grid {
        grid-template-columns: 1fr;
    }

    .crm-header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* === APP-LIKE MOBILE CRM === */
@media (max-width: 768px) {
    body.crm-body nav {
        min-height: 64px;
        height: auto;
        padding: 0.65rem 0.8rem;
        gap: 8px;
    }

    body.crm-body nav .logo {
        min-width: 0;
        font-size: 1rem;
        gap: 0;
    }

    body.crm-body nav .crm-badge-pro,
    body.crm-body nav .crm-user-tier-badge,
    body.crm-body nav .crm-db-badge {
        display: none;
    }

    .crm-nav-controls {
        flex: 1;
        min-width: 0;
        justify-content: flex-end;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .crm-nav-controls .crm-status-pill {
        padding: 8px;
        min-width: 36px;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .crm-nav-controls .crm-status-pill > span:not(.crm-dot-live),
    .crm-nav-controls #crm-backlink,
    .crm-nav-controls #crm-sales-intelligence,
    .crm-nav-controls #crm-logout-btn {
        font-size: 0 !important;
    }

    .crm-nav-controls #crm-backlink,
    .crm-nav-controls #crm-sales-intelligence,
    .crm-nav-controls #crm-logout-btn {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .crm-nav-controls [data-mobile-icon]::before {
        content: attr(data-mobile-icon);
        font-size: 1rem;
        line-height: 1;
        font-weight: 700;
    }

    .crm-nav-controls .lang-switch {
        font-size: 0.68rem;
        padding: 4px 6px;
        gap: 2px;
    }

    .crm-wrapper {
        margin-top: 86px;
        padding: 0 12px;
    }

    .crm-header-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .crm-brand-info h1 {
        font-size: 1.28rem;
        line-height: 1.2;
    }

    .crm-brand-info p {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .crm-header-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .crm-header-actions > .btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 0;
        font-size: 0 !important;
        border-radius: 12px;
    }

    .crm-header-actions > .btn::before,
    .btn-scan[data-mobile-icon]::before {
        content: attr(data-mobile-icon);
        font-size: 1.15rem;
        line-height: 1;
        font-weight: 700;
    }

    .crm-toolbar {
        gap: 0.8rem;
    }

    .view-toggle-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        border-radius: 12px;
    }

    .view-btn {
        min-height: 42px;
        justify-content: center;
        font-size: 0;
    }

    .view-btn[data-mobile-icon]::before {
        content: attr(data-mobile-icon);
        font-size: 1.15rem;
        font-weight: 700;
    }

    .crm-filter-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .crm-search-input {
        width: 100%;
        min-width: 0;
        grid-column: 1 / -1;
        min-height: 42px;
        padding: 9px 12px;
    }

    .crm-filter-bar .scanner-select {
        width: 100% !important;
        min-width: 0;
        min-height: 42px;
        padding: 8px 9px !important;
        font-size: 0.76rem !important;
    }

    .scanner-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .scanner-header {
        align-items: flex-start;
    }

    .scanner-header > span {
        font-size: 0.72rem !important;
        line-height: 1.4;
    }

    .scanner-form-grid {
        grid-template-columns: 1fr !important;
        gap: 9px !important;
    }

    .scanner-input,
    .scanner-select,
    .btn-scan {
        min-height: 44px;
    }

    .scanner-tags-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .scanner-tag-hint {
        grid-column: 1 / -1;
    }

    .scan-suggestion-btn {
        min-width: 0;
        min-height: 40px;
        padding: 5px 6px;
        line-height: 1.2;
    }

    .kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        min-height: 0;
        gap: 10px;
        padding-bottom: 0;
    }

    .kanban-col {
        max-height: none;
        min-height: 180px;
    }

    .kanban-col-header {
        padding: 0.8rem;
    }

    .col-title {
        font-size: 0.78rem;
    }

    .lead-card {
        padding: 0.85rem;
    }

    .lead-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px !important;
    }

    .btn-lead-action {
        min-width: 0;
        min-height: 40px;
        padding: 0 !important;
        font-size: 0 !important;
        justify-content: center;
        border-radius: 10px;
    }

    .btn-lead-action[data-mobile-icon]::before {
        content: attr(data-mobile-icon);
        font-size: 1.05rem;
        line-height: 1;
        font-weight: 700;
    }

    .btn-lead-action.btn-lead-check {
        font-size: 0.72rem !important;
        padding: 0 5px !important;
    }

    .lead-maps-link {
        min-height: 32px;
        padding: 4px 8px;
    }

    .list-view-container {
        overflow-x: hidden;
        border-radius: 16px;
    }

    .crm-table,
    .crm-table tbody,
    .crm-table tr,
    .crm-table td {
        display: block;
        width: 100%;
    }

    .crm-table thead {
        display: none;
    }

    .crm-table tr {
        position: relative;
        padding: 12px;
        border-bottom: 1px solid var(--crm-border);
    }

    .crm-table tr:last-child {
        border-bottom: 0;
    }

    .crm-table td {
        display: none;
        border: 0;
        padding: 4px 0;
    }

    .crm-table td:nth-child(1),
    .crm-table td:nth-child(2),
    .crm-table td:nth-child(3),
    .crm-table td:nth-child(7) {
        display: block;
    }

    .crm-table td:nth-child(2) {
        position: absolute;
        margin: -34px 0 0;
        width: auto;
        right: 12px;
    }

    .crm-table td:nth-child(3) select {
        width: 100% !important;
        min-height: 40px;
    }

    .crm-table td:nth-child(7) > div {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px !important;
    }

    .crm-table .btn-lead-action {
        width: 100%;
    }

    .crm-modal-backdrop {
        padding: 8px;
    }

    .crm-modal-card {
        width: 100%;
        max-height: calc(100vh - 16px);
        padding: 1rem;
        border-radius: 18px;
    }

    .status-option-grid,
    .interest-option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-tabs,
    .cal-hub-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .modal-tabs::-webkit-scrollbar,
    .cal-hub-tabs::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 480px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }

    .crm-header-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* --- Gefuehrter Einstieg (F8) --- */
.onboarding { max-width: 520px; margin: 0 auto; text-align: center; }
.onboarding-icon { font-size: 2.4rem; margin-bottom: .4rem; }
.onboarding-lead { color: var(--crm-text-muted, #9aa3b2); margin: 0 0 1.6rem; }

.onboarding-schritte {
    text-align: left; counter-reset: schritt;
    list-style: none; padding: 0; margin: 0 0 1.8rem;
}
.onboarding-schritte li {
    counter-increment: schritt;
    display: grid; grid-template-columns: 28px 1fr; gap: .1rem .8rem;
    padding: .8rem 0; border-bottom: 1px solid rgba(255,255,255,.07);
}
.onboarding-schritte li::before {
    content: counter(schritt);
    grid-row: 1 / span 2;
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,255,204,.12); color: var(--crm-primary, #00ffcc);
    font-size: .82rem; font-weight: 700;
}
.onboarding-schritte strong { color: #e7e9ee; font-size: .95rem; }
.onboarding-schritte span {
    color: var(--crm-text-muted, #9aa3b2); font-size: .86rem; line-height: 1.55;
}

.onboarding-btn { margin: 0 auto; display: inline-flex; align-items: center; gap: 6px; }
.onboarding-hinweis {
    margin: 1rem 0 0; font-size: .82rem; color: var(--crm-text-muted, #9aa3b2);
}

/* Hinweis auf eine unbestaetigte E-Mail-Adresse (F5) */
.konto-hinweis {
    display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; justify-content: center;
    padding: .75rem 1.2rem; background: rgba(255, 180, 60, .12);
    border-bottom: 1px solid rgba(255, 180, 60, .32);
    color: #ffc857; font-size: .88rem;
}
.konto-hinweis-btn {
    font: inherit; font-weight: 600; padding: .35rem .9rem; border-radius: 7px;
    border: 1px solid rgba(255, 200, 87, .5); background: transparent;
    color: #ffc857; cursor: pointer;
}
.konto-hinweis-btn:disabled { opacity: .6; cursor: default; }

.company-import-card { margin-top: 1rem; }
.company-import-card .crm-header-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.company-import-status:not([hidden]) { margin: .65rem 0; text-transform: none; line-height: 1.5; }
.company-import-status.error { color: var(--crm-orange); }

.crm-voice-softphone { position: fixed; z-index: 1200; right: 1rem; bottom: 1rem; width: min(390px, calc(100vw - 2rem)); color: var(--crm-text-main); }
.crm-voice-toggle, .crm-voice-hangup { min-height: 42px; border: 1px solid rgba(0,255,204,.42); border-radius: 999px; padding: .65rem 1rem; color: #07110f; background: #00e6b8; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,.32); }
.crm-voice-toggle { display: block; margin-left: auto; }
.crm-voice-active-indicator { margin-left: .35rem; color: #087a42; }
.crm-voice-panel { margin-top: .65rem; padding: 1rem; border: 1px solid rgba(0,255,204,.3); border-radius: 16px; background: rgba(10,15,21,.97); box-shadow: 0 14px 42px rgba(0,0,0,.44); }
.crm-voice-panel[hidden] { display: none; }
.crm-voice-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; }
.crm-voice-panel h2 { margin: 0; font-size: 1rem; }
.crm-voice-close { min-height: 36px; padding: .35rem .65rem; border: 1px solid var(--crm-border); border-radius: 8px; color: var(--crm-text-main); background: rgba(255,255,255,.06); font: inherit; font-size: .8rem; cursor: pointer; }
.crm-voice-dialer { margin: .75rem 0; }
.crm-voice-dialer label, .crm-voice-settings label { display: block; margin-bottom: .35rem; color: var(--crm-text-sub); font-size: .8rem; }
.crm-voice-direct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
.crm-voice-direct-row input, .crm-voice-settings select { min-width: 0; min-height: 42px; padding: .55rem .65rem; border: 1px solid var(--crm-border); border-radius: 8px; color: var(--crm-text-main); background: rgba(255,255,255,.06); font: inherit; }
.crm-voice-direct-row input { width: 100%; }
.crm-voice-settings { margin: .7rem 0; padding: .65rem 0; border-top: 1px solid var(--crm-border); border-bottom: 1px solid var(--crm-border); }
.crm-voice-settings summary { color: var(--crm-text-main); font-size: .88rem; font-weight: 650; cursor: pointer; }
.crm-voice-settings select { width: 100%; margin-bottom: .5rem; }
.crm-voice-number-results { display: grid; gap: .45rem; margin: .55rem 0; }
.crm-voice-number-option { display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: .45rem; border: 1px solid var(--crm-border); border-radius: 8px; color: var(--crm-text-sub); font-size: .8rem; }
.crm-voice-number-option .crm-voice-mute { width: auto; flex: 0 0 auto; min-height: 34px; margin: 0; padding: .35rem .55rem; font-size: .76rem; }
.crm-voice-number-cost { color: var(--crm-text-sub); font-size: .72rem; line-height: 1.4; }
.crm-voice-billing { display: grid; gap: .35rem; margin-top: .7rem; padding: .7rem; border: 1px solid var(--crm-border); border-radius: 9px; color: var(--crm-text-sub); font-size: .78rem; line-height: 1.45; }
.crm-voice-billing strong { color: var(--crm-text-main); }
.crm-voice-billing p { margin: 0; }
.crm-voice-billing a { color: var(--crm-cyan); text-decoration: underline; text-underline-offset: 2px; }
.crm-voice-call-history ul { display: grid; gap: .45rem; max-height: 180px; overflow: auto; margin: .4rem 0 0; padding: 0; list-style: none; }
.crm-voice-call-history li { display: grid; gap: .18rem; padding: .45rem .55rem; border: 1px solid var(--crm-border); border-radius: 8px; }
.crm-voice-call-history li time { color: var(--crm-text-sub); font-size: .7rem; }
.crm-voice-call-history li p { margin: .15rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-voice-status, .crm-voice-target { min-height: 1.25rem; margin: .5rem 0; color: var(--crm-text-sub); font-size: .86rem; overflow-wrap: anywhere; }
.crm-voice-budget { margin: .65rem 0; padding: .6rem .7rem; border: 1px solid var(--crm-border); border-radius: 9px; color: var(--crm-text-sub); font-size: .76rem; }
.crm-voice-budget strong { color: var(--crm-text-main); }
.crm-voice-budget ul { margin: .35rem 0 0; padding-left: 1rem; }
.crm-voice-budget li { margin: .2rem 0; }
.crm-voice-dtmf { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin: .55rem 0; }
.crm-voice-dtmf button { min-height: 38px; border: 1px solid var(--crm-border); border-radius: 7px; color: var(--crm-text-main); background: rgba(255,255,255,.05); font: inherit; cursor: pointer; }
.crm-voice-dtmf button:disabled { opacity: .5; cursor: not-allowed; }
.crm-voice-mute { width: 100%; min-height: 40px; margin-bottom: .5rem; border: 1px solid var(--crm-border); border-radius: 8px; color: var(--crm-text-main); background: rgba(255,255,255,.04); font: inherit; cursor: pointer; }
.crm-voice-hangup { width: 100%; color: #fff; border-color: rgba(255,90,90,.5); background: #a93232; }
.crm-voice-toggle:focus-visible, .crm-voice-hangup:focus-visible, .crm-voice-mute:focus-visible, .crm-voice-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.crm-voice-hangup:disabled, .crm-voice-mute:disabled { cursor: not-allowed; opacity: .55; }
.crm-voice-call-history { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--crm-border); font-size: .8rem; color: var(--crm-text-sub); }
.crm-voice-call-history strong { color: #fff; }

@media (max-width: 760px) {
    .crm-voice-softphone { right: .65rem; bottom: max(.65rem, env(safe-area-inset-bottom)); width: min(320px, calc(100vw - 1.3rem)); }
}
.deal-create-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-top:12px; }
.deal-create-form label { display:grid; gap:5px; color:var(--crm-text-muted); font-size:.78rem; }
.deal-create-form input,.deal-create-form select { width:100%; min-width:0; padding:8px; color:var(--crm-text-main); background:rgba(0,0,0,.2); border:1px solid var(--crm-border); border-radius:6px; }
.deal-stage-history { padding:8px 10px; color:var(--crm-text-muted); background:rgba(7,9,14,.24); border-radius:var(--radius-sm); font-size:.76rem; }
.deal-stage-history > summary { color:var(--crm-text-sub); cursor:pointer; font-weight:600; }
.deal-stage-history p { margin:7px 0 0; overflow-wrap:anywhere; }

/* Gespeicherte Lead-Ansichten (server-seitig, tenant-gebunden) */
.saved-view-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.saved-view-form input,.saved-view-form select { padding:8px 12px; font-size:.85rem; color:var(--crm-text-main); background:rgba(0,0,0,.2); border:1px solid var(--crm-border); border-radius:6px; }
.saved-view-form input[type="text"] { min-width:180px; }
.saved-view-form select[multiple] { min-width:160px; }
.saved-view-button { padding:8px 12px; font-size:.85rem; white-space:nowrap; }

.crm-preview-banner { position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px clamp(16px, 4vw, 44px); color:#f5fbff; background:linear-gradient(110deg,#18283b,#142c31); border-bottom:1px solid rgba(123,220,255,.35); box-shadow:0 8px 28px rgba(0,0,0,.22); }
.crm-preview-banner[hidden] { display:none; }
.crm-preview-banner > div { display:grid; gap:3px; }
.crm-preview-banner strong { color:#9be9dd; font-size:.9rem; }
.crm-preview-banner span { color:#d2deea; font-size:.82rem; }
.crm-preview-banner a { flex:0 0 auto; padding:8px 12px; color:#071714; background:#7de4cc; border-radius:8px; font-size:.82rem; font-weight:700; text-decoration:none; }
#crm-preview-toast { position:fixed; z-index:1000; left:50%; bottom:24px; width:min(560px,calc(100vw - 32px)); padding:13px 16px; color:#f8fbff; background:#172331; border:1px solid rgba(125,228,204,.55); border-radius:12px; box-shadow:0 12px 36px rgba(0,0,0,.34); font-size:.88rem; line-height:1.45; opacity:0; pointer-events:none; transform:translate(-50%,12px); transition:opacity .18s ease,transform .18s ease; }
#crm-preview-toast.visible { opacity:1; transform:translate(-50%,0); }
.crm-preview-mode .company-import-card { display:none; }
.crm-preview-mode .lead-card { cursor:pointer; }
.crm-preview-mode .lead-card [aria-disabled="true"] { opacity:.48; cursor:not-allowed; }
@media (max-width: 680px) { .crm-preview-banner { align-items:flex-start; flex-direction:column; } }
