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

/* ===== LIGHT MODE (Default – Premium Indigo) ===== */
:root {
    --primary: #0176d3;
    --primary-dark: #014486;
    --primary-light: rgba(1, 118, 211, 0.08);
    --accent: #1b96ff;
    --accent-cyan: #06b6d4;
    --red: #ef4444;
    --orange: #f59e0b;
    --green: #10b981;
    --sidebar-bg: #0a0a0f;
    --sidebar-text: rgba(255, 255, 255, 0.55);
    --bg: #f5f5f7;
    --card: #ffffff;
    --surface: #ffffff;
    --border: rgba(0, 0, 0, 0.06);
    --text: #1d1d1f;
    --muted: #6e6e73;
    --shadow: 0 1px 2px rgba(17, 17, 26, 0.04), 0 6px 20px rgba(17, 17, 26, 0.06);
    --shadow-lg: 0 18px 50px rgba(17, 17, 26, 0.14), 0 6px 16px rgba(17, 17, 26, 0.06);
    --radius: 12px;
    --glow: 0 0 0 1px rgba(47,129,247, 0.15), 0 4px 16px rgba(47,129,247, 0.1);
}

/* ===== DARK MODE ===== */
body.dark-mode {
    --bg: #1a1a22;
    --card: #22222c;
    --surface: #2a2a36;
    --border: rgba(255, 255, 255, 0.07);
    --text: #eef0f6;
    --muted: #8b8fa2;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.04);
    --primary-light: rgba(47,129,247, 0.1);
    --glow: 0 0 0 1px rgba(47,129,247, 0.25), 0 4px 20px rgba(47,129,247, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode {
    background-image:
        radial-gradient(ellipse at 15% 5%, rgba(47,129,247, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 90%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ===== DARK MODE: inputs, selects, search ===== */
body.dark-mode .search-wrap input,
body.dark-mode .filter-select,
body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode input[type="email"],
body.dark-mode input[type="url"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="date"],
body.dark-mode select,
body.dark-mode textarea {
    background: #2e2e3a;
    color: #fafafa;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .search-wrap input::placeholder {
    color: #8b949e;
}

body.dark-mode .filter-select option {
    background: #2e2e3a;
    color: #e6edf3;
}


/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: #08080f;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem;
    gap: 1rem;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
    overflow-y: auto;
    border-right: 1px solid rgba(47,129,247, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.25rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0176d3 0%, #1b96ff 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: white;
    font-size: 0.8rem;
    letter-spacing: -0.02em;
}

.brand-text strong {
    display: block;
    color: #fafafa;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-text span {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    position: relative;
}

.nav-item:hover {
    background: rgba(47,129,247, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
    background: rgba(47,129,247, 0.1);
    color: #a5b4fc;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #2f81f7;
}

.nav-item i {
    width: 18px;
    text-align: center;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: rgba(47,129,247, 0.25);
    color: #a5b4fc;
    padding: 1px 7px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.btn-add-lead {
    background: linear-gradient(135deg, #2f81f7 0%, #2f81f7 100%);
    color: white;
    border: none;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(47,129,247, 0.3);
    width: 100%;
}
.btn-add-lead > i { width: 18px; text-align: center; flex-shrink: 0; }

.btn-add-lead:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47,129,247, 0.4);
}

.btn-link-file {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.2s;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.btn-link-file:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-link-file.linked {
    background: #2f81f7;
    border: 2px solid #4f46e5;
    color: white;
    font-weight: 700;
}

.btn-link-file.linked:hover {
    background: #2b4bc6;
}

.btn-import {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.2s;
}

.btn-import:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-save-data {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.2s;
}

.btn-save-data:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ===== MAIN ===== */
.main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 5;
    flex-wrap: wrap;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.topbar-left h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.search-wrap {
    position: relative;
}

.search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
}

.search-wrap input {
    padding: 0.6rem 1rem 0.6rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    width: 240px;
    background: var(--bg);
    transition: border 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: var(--bg);
    cursor: pointer;
}

.stats-bar {
    display: flex;
    gap: 0.75rem;
}

.stat-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
}

.stat-pill.won {
    background: #eef1ff;
    color: var(--accent);
}

/* ===== VIEWS ===== */
.view {
    display: none;
    padding: 1.5rem;
    flex: 1;
}

.view.active {
    display: block;
}

/* ===== KANBAN ===== */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 100px);
}

.kanban-col {
    min-width: 220px;
    max-width: 240px;
    background: var(--bg);
    border-radius: 12px;
    padding: 1rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.col-header {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.col-count {
    background: var(--card);
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    position: relative;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(47,129,247, 0.1);
}

body.dark-mode .kanban-card {
    background: rgba(34, 34, 44, 0.85);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-mode .kanban-card:hover {
    border-color: rgba(47,129,247, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(47,129,247, 0.12);
}

.kanban-card.priority-hoch {
    border-left-color: var(--red);
}

.kanban-card.priority-normal {
    border-left-color: var(--primary);
}

.card-company {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 2px;
}

.card-name {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.card-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 50px;
}

.source-LinkedIn {
    background: #dbeafe;
    color: #1d4ed8;
}

.source-Email {
    background: #fce7f3;
    color: #be185d;
}

.source-Loom {
    background: #ede9fe;
    color: #7c3aed;
}

.source-Instagram {
    background: #fef3c7;
    color: #d97706;
}

.source-Facebook {
    background: #dbeafe;
    color: #1e40af;
}

.source-Empfehlung {
    background: #eef1ff;
    color: #3b5bdb;
}

.source-Website {
    background: #e0f2fe;
    color: #0369a1;
}

.source-Sonstige {
    background: #f1f5f9;
    color: var(--muted);
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
}

.card-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.78rem;
    padding: 3px 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.card-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.card-btn.delete:hover {
    color: var(--red);
    background: #fee2e2;
}

.card-date {
    font-size: 0.72rem;
    color: var(--muted);
}

/* ===== TABLE ===== */
.leads-table-wrap {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th {
    padding: 0.9rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.leads-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    vertical-align: middle;
}

.leads-table tr:last-child td {
    border-bottom: none;
}

.leads-table tr:hover td {
    background: var(--bg);
}

.stage-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stage-Neu {
    background: #f1f5f9;
    color: var(--muted);
}

.stage-Recherchiert {
    background: #e0f2fe;
    color: #0369a1;
}

.stage-Kontaktiert {
    background: #ede9fe;
    color: #7c3aed;
}

.stage-Setter-Call {
    background: #ccfbf1;
    color: #0d9488;
}

.stage-Präsentation {
    background: #e0e7ff;
    color: #4338ca;
}

.stage-Termin {
    background: #dbeafe;
    color: #1d4ed8;
}

.stage-Angebot {
    background: #fef9c3;
    color: #854d0e;
}

.stage-Gewonnen {
    background: #dbeafe;
    color: #1d4ed8;
}

.stage-Verloren {
    background: #fee2e2;
    color: #b91c1c;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.accent {
    border-top: 2px solid var(--accent);
}

.stat-card.accent::before { opacity: 0; }

.stat-card.red {
    border-top: 2px solid var(--red);
}

.stat-card.red::before { opacity: 0; }

body.dark-mode .stat-card {
    background: rgba(34, 34, 44, 0.75);
    backdrop-filter: blur(12px);
}

.s-num {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card.accent .s-num {
    color: var(--accent);
}

.stat-card.red .s-num {
    color: var(--red);
}

.s-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.stats-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow); transition: transform 0.25s ease;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    width: 130px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 50px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, #2f81f7, #2f81f7, #5aa3ff);
    background-size: 200% 100%;
    animation: shimmer 3s ease infinite;
    transition: width 0.8s ease;
}

.bar-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    width: 24px;
    text-align: right;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    background: var(--card);
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, background 0.25s, border-color 0.25s;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

body.dark-mode .modal {
    background: #24242e;
    backdrop-filter: blur(20px);
    border-color: rgba(47,129,247, 0.12);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(47,129,247, 0.08);
}

.modal-wide {
    max-width: 1100px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 1;
}

body.dark-mode .modal-header {
    background: #24242e;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
}

.close-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: border 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.15);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.btn-cancel {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-save {
    background: linear-gradient(135deg, #3b5bdb 0%, #2f81f7 100%); box-shadow: 0 2px 8px rgba(59, 91, 219, 0.3);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: var(--primary-dark);
}

.file-input {
    padding: 0.5rem;
    background: white;
}

/* Detail Modal */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.5rem;
    margin-bottom: 0;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.detail-field .d-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.detail-field .d-val {
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
    word-break: break-word;
    line-height: 1.4;
}

/* Sektionen im Lead-Detail */
.detail-section {
    background: var(--card, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin-bottom: 0.75rem;
}
.detail-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.detail-section-title i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* Prominente einzelne Aktion (Vertrag konfigurieren) */
.detail-primary-action {
    display: flex;
    justify-content: center;
    margin: 0 0 1rem;
}
.detail-primary-action button {
    background: linear-gradient(135deg, var(--primary), #2f81f7);
    color: white;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(47,129,247, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}
.detail-primary-action button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(47,129,247, 0.35);
}

.detail-field .d-val a {
    color: var(--primary);
}

.detail-notes {
    background: var(--bg);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.detail-btn {
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}

.detail-btn.primary {
    background: var(--primary);
    color: white;
}

.detail-btn.primary:hover {
    background: var(--primary-dark);
}

.detail-btn.danger {
    background: #fee2e2;
    color: var(--red);
}

.detail-btn.danger:hover {
    background: #fecaca;
}

.detail-btn.secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

/* Import */
.import-info {
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.import-info code {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.5rem;
    border-radius: 6px;
    word-break: break-all;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: white;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s ease;
    box-shadow: var(--shadow-lg);
}

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

.toast.success {
    background: var(--accent);
}

.toast.error {
    background: var(--red);
}

/* Action buttons in table */
.tbl-btn {
    background: none;
    border: none;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.88rem;
    transition: all 0.2s;
}

.tbl-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.tbl-btn.del:hover {
    background: #fee2e2;
    color: var(--red);
}

/* Empty state */
.empty-col {
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 1.5rem 0.5rem;
    border: 2px dashed var(--border);
    border-radius: 8px;
}

/* ===== DUE DATE BADGES ===== */
.due-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
}

.due-overdue {
    background: #fee2e2;
    color: #b91c1c;
    animation: pulse-red 1.5s infinite;
}

.due-today {
    background: #fef3c7;
    color: #b45309;
}

.due-soon {
    background: #fef9c3;
    color: #854d0e;
}

.due-future {
    background: #e0f2fe;
    color: #0369a1;
}

@keyframes pulse-red {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Next action text on card */
.card-next-action {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* Industry tag on card */
.card-industry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 50px;
    margin-bottom: 0.35rem;
}

/* ===== TOP WEBSITE FLAG ===== */
/* Banner on top of kanban card */
.good-web-banner {
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border-radius: 6px;
    padding: 3px 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Dim the entire card when flagged */
.kanban-card.card-has-good-web {
    opacity: 0.65;
    border-left-color: #d97706 !important;
}

.kanban-card.card-has-good-web:hover {
    opacity: 0.9;
}

/* Active globe button on card */
.card-btn.good-web-active {
    color: #d97706 !important;
    background: #fef3c7 !important;
}

.card-btn.good-web-active:hover {
    color: #92400e !important;
    background: #fde68a !important;
}

/* Pill in table rows */
.good-web-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    padding: 2px 7px;
    border-radius: 50px;
    margin-top: 3px;
}

/* Active globe button in table */
.tbl-btn.good-web-tbl-active {
    background: #fef3c7;
    color: #d97706;
}

.tbl-btn.good-web-tbl-active:hover {
    background: #fde68a;
    color: #92400e;
}

/* Checkbox label in the form */
.good-web-label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.good-web-label:hover {
    background: #fef3c7;
}

.good-web-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #d97706;
    cursor: pointer;
    flex-shrink: 0;
}

.good-web-check-text {
    font-size: 0.88rem;
    color: #92400e;
    font-weight: 500;
}

/* Today badge in sidebar nav */
.today-badge {
    background: #ef4444;
    color: white;
    font-size: 0.66rem;
    font-weight: 800;
    border-radius: 50px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
}

.archive-badge {
    background: #f59e0b;
    color: white;
    font-size: 0.66rem;
    font-weight: 800;
    border-radius: 50px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
    min-width: 18px;
    text-align: center;
}

/* ===== BULK ACTION BAR ===== */
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

.bulk-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-delete-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 0.45rem 1.1rem;
    border-radius: 7px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s;
    white-space: nowrap;
}

.bulk-delete-btn:hover {
    background: rgba(239, 68, 68, 0.7);
    border-color: rgba(239, 68, 68, 0.6);
}

/* Checkbox column */
.cb-col {
    width: 42px;
    text-align: center;
}

.cb-col input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

.row-cb {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Selected row highlight */
.leads-table tr.row-selected td {
    background: var(--primary-light);
}

.leads-table tr.row-selected:hover td {
    background: #dde4ff;
}

/* Dark mode: selected row + hover */
body.dark-mode .leads-table tr.row-selected td {
    background: #1e2347;
}

body.dark-mode .leads-table tr.row-selected:hover td {
    background: #0d3b2d;
}

body.dark-mode .leads-table tbody tr:hover td {
    background: #1e2535 !important;
    color: var(--text) !important;
}

/* ===== FIELD VALIDATION ===== */
.field-error {
    font-size: 0.78rem;
    color: var(--red);
    min-height: 1.1em;
    margin-top: 2px;
    font-weight: 500;
}

.form-group input.input-error,
.form-group textarea.input-error {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px #fee2e2 !important;
    background: #fff8f8;
}

/* ===== DETAIL MODAL TABS ===== */
.detail-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.det-tab {
    padding: 0.55rem 1.1rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.det-tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.det-tab.det-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
}

.det-tab.det-tab-locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.det-tab.det-tab-locked:hover {
    background: none;
    color: var(--muted);
}

/* Won badge in detail header */
.detail-won-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #d4a017, #f5c842, #c49000);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== PROJECT PROFILE ===== */
.project-profile {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.proj-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.proj-status-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.proj-status-select {
    border: 1.5px solid;
    border-radius: 20px;
    padding: 4px 12px 4px 10px;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.proj-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.proj-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.proj-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #3b5bdb);
    border-radius: 10px;
    transition: width 0.4s;
}

.proj-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.proj-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 7px;
}

.proj-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.proj-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proj-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.proj-field input {
    padding: 0.45rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.18s;
}

.proj-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Payment toggles */
.payment-toggles {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.pay-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
    transition: all 0.2s;
}

.pay-toggle input[type="checkbox"] {
    display: none;
}

.pay-toggle .fa-circle-check {
    font-size: 1rem;
}

.pay-toggle:hover {
    border-color: #3b5bdb;
    color: #3b5bdb;
}

.pay-toggle.pay-toggle-active {
    background: #ecfdf5;
    border-color: #3b5bdb;
    color: #2b4bc6;
}

/* Payment Cards */
.payment-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.75rem;
    background: var(--bg);
    transition: all 0.2s;
}
.payment-card.payment-done {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.04);
}
.payment-card.payment-overdue {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.04);
}
.payment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.payment-card-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}
.payment-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.payment-badge-paid {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.payment-badge-open {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.payment-badge-overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    animation: pulse-overdue 2s infinite;
}
@keyframes pulse-overdue {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Zahlungsübersicht View */
.zahlungen-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}
.zahlungen-stat-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}
.zahlungen-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.zahlungen-stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 500;
}
.zahlungen-table-wrap {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}
.zahlungen-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.zahlungen-table thead th {
    background: var(--bg);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.zahlungen-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.zahlungen-table tbody tr:hover {
    background: var(--primary-light);
}
.zahlungen-table tbody tr:last-child td {
    border-bottom: none;
}
.zahlungen-row-overdue {
    background: rgba(239, 68, 68, 0.03);
}

/* Contract upload */
.contract-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cf-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 1.1rem;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s;
}

.cf-upload-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.contract-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-name {
    font-weight: 600;
    font-size: 0.88rem;
    word-break: break-all;
}

.cf-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.cf-btn:hover {
    background: var(--primary);
    color: white;
}

/* Sonderwünsche textarea */
.proj-textarea {
    width: 100%;
    min-height: 90px;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.18s;
}

.proj-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Milestones */
.ms-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: opacity 0.2s;
}

.ms-row:last-child {
    border-bottom: none;
}

.ms-row.ms-done {
    opacity: 0.55;
}

.ms-cb {
    width: 16px;
    height: 16px;
    accent-color: #3b5bdb;
    cursor: pointer;
    flex-shrink: 0;
}

.ms-title {
    flex: 1;
    font-size: 0.88rem;
}

.ms-row.ms-done .ms-title {
    text-decoration: line-through;
    color: var(--muted);
}

.ms-date-badge {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.ms-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    font-size: 0.9rem;
}

.ms-del-btn:hover {
    background: #fee2e2;
    color: var(--red);
}

/* Add milestone row */
.add-ms-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
    align-items: center;
}

.ms-new-input {
    flex: 1;
    padding: 0.45rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text);
}

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

.ms-new-date {
    padding: 0.45rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.82rem;
    background: var(--bg);
    color: var(--text);
    max-width: 150px;
}

.ms-add-btn {
    padding: 0.45rem 0.9rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.18s;
}

.ms-add-btn:hover {
    background: var(--primary-dark);
}

/* ===== KPI TRACKER ===== */
#view-tracker {
    padding: 0;
}

#tracker-content {
    padding: 0 1.5rem 2rem;
}

.trk-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-top: 1.25rem;
}

.trk-tab {
    padding: 0.55rem 1.25rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.18s;
}

.trk-tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.trk-tab.trk-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
}

.trk-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* KPI summary cards */
.trk-kpi-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.trk-kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    box-shadow: var(--shadow);
}

.trk-kpi-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.trk-kpi-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Table header bar */
.trk-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.trk-row-count {
    font-size: 0.82rem;
    color: var(--muted);
}

.trk-add-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.trk-add-btn:hover {
    background: var(--primary-dark);
}

/* The main tracker table */
.trk-table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    box-shadow: var(--shadow);
}

.trk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
}

.trk-table thead tr {
    background: #1a1a2e;
    color: #94a3b8;
}

.trk-table th {
    padding: 0.7rem 0.6rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

.trk-table th:first-child {
    text-align: left;
    padding-left: 1rem;
}

.trk-inp-h {
    background: rgba(47,129,247, 0.15);
    color: #818cf8 !important;
}

.trk-calc-h {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7 !important;
}

.trk-table td {
    padding: 0.45rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.trk-table td:first-child {
    text-align: left;
    padding-left: 1rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.kw-cell {
    color: var(--muted);
    font-size: 0.78rem;
}

/* Blue input cells */
.trk-inp {
    width: 60px;
    padding: 4px 5px;
    text-align: center;
    border: 1.5px solid #c7d2fe;
    border-radius: 5px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.82rem;
}

.trk-inp:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px #c7d2fe;
}

/* Green calculated cells */
.trk-calc {
    color: #2b4bc6;
    font-weight: 700;
    background: #f0fdf4;
}

/* Total row */
.trk-total-row td {
    background: #1a1a2e !important;
    color: #f1f5f9 !important;
    font-weight: 800;
    border-top: 2px solid #334155;
}

.trk-total-row .trk-calc {
    color: #6ee7b7 !important;
    background: transparent !important;
}

/* Average row */
.trk-avg-row td {
    background: #1e293b !important;
    color: #94a3b8 !important;
    font-style: italic;
    font-size: 0.8rem;
}

.trk-avg-row .trk-calc {
    color: #6ee7b7 !important;
    background: transparent !important;
}

/* Delete button in table */
.trk-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.trk-del-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Hint text */
.trk-hint {
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== GOALS TAB ===== */
.trk-goal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.trk-goal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem;
    box-shadow: var(--shadow);
}

.trk-goal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.trk-goal-inp {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    background: var(--bg);
    margin-bottom: 0.75rem;
}

.trk-goal-inp:focus {
    outline: none;
    border-color: var(--primary);
}

.trk-goal-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trk-goal-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.trk-goal-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s;
}

.trk-goal-pct {
    font-size: 0.82rem;
    font-weight: 800;
    min-width: 36px;
    text-align: right;
}

.trk-goal-sub {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.5rem;
}



/* ===== DARK MODE transitions for all cards ===== */
.card,
.kanban-card,
.stat-card,
.topbar,
.detail-modal>div,
.trk-table-wrap,
.proj-section {
    transition: background 0.25s, border-color 0.25s;
}

/* ===== THEME TOGGLE BUTTON (Sidebar) ===== */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--sidebar-text);
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    transition: all 0.2s;
    justify-content: flex-start;
}
.theme-toggle-btn > i { width: 18px; text-align: center; flex-shrink: 0; }

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ===== MANROPE headings ===== */
h1,
.brand-text strong,
.modal-header h2,
.detail-name {
    font-family: 'Manrope', 'Inter', sans-serif;
}

/* ===== LEAD SCORE BADGE ===== */
.lead-score {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

.lead-score.score-high {
    background: #d1fae5;
    color: #065f46;
}

.lead-score.score-mid {
    background: #fef3c7;
    color: #92400e;
}

.lead-score.score-low {
    background: #fee2e2;
    color: #991b1b;
}

.lead-score i {
    font-size: 0.65rem;
}

/* Score on kanban card */
.kanban-card .lead-score {
    margin-top: 4px;
}

/* ===== WHATSAPP BUTTON ===== */
.wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #25d366;
    color: white;
    border: none;
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.wa-btn:hover {
    background: #1da851;
}

/* ===== QUICK NOTE MODAL ===== */
.quick-note-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.quick-note-panel {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    width: 420px;
    max-width: 95vw;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: slideUp 0.2s ease;
}

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

.quick-note-header h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.quick-note-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.1rem;
}

.quick-note-close:hover {
    color: var(--red);
}

.quick-note-lead {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.quick-note-lead strong {
    color: var(--primary);
}

.quick-note-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
    margin-bottom: 0.75rem;
}

.quick-note-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.quick-note-save {
    width: 100%;
    padding: 0.7rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.quick-note-save:hover {
    background: var(--primary-dark);
}

/* ===== REVENUE PIPELINE (top of pipeline view) ===== */
.revenue-pipeline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem 0;
    overflow-x: auto;
}

.rev-stage-pill {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    flex: 1;
    min-width: 120px;
    box-shadow: var(--shadow);
}

.rev-stage-name {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.rev-stage-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.rev-stage-count {
    font-size: 0.72rem;
    color: var(--muted);
}

.rev-stage-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
    margin-top: 4px;
}

/* ===== DUPLICATE WARNING TOAST (uses existing toast, but add special style) ===== */
.toast.toast-warning {
    background: #92400e;
}

/* ===== PRINT STYLES for PDF Export ===== */
@media print {

    .sidebar,
    .topbar,
    .detail-actions,
    .trk-add-btn,
    .ms-add-btn,
    .ms-del-btn,
    .trk-del-btn,
    .cf-upload-label,
    .kanban-board,
    #leads-tbody,
    .bulk-bar,
    .btn-add-lead,
    .btn-import,
    .btn-save-data,
    .btn-link-file,
    .quick-note-btn,
    .theme-toggle-btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        background: white;
    }

    .main {
        margin-left: 0 !important;
    }

    .print-area {
        display: block !important;
        padding: 2rem;
        font-family: 'Manrope', 'Inter', sans-serif;
    }

    .print-header {
        border-bottom: 2px solid #3b5bdb;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    .print-header h1 {
        font-size: 1.4rem;
        color: #3b5bdb;
    }

    .print-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .print-row {
        padding: 0.3rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .print-label {
        font-size: 0.75rem;
        color: #64748b;
        text-transform: uppercase;
    }

    .print-val {
        font-weight: 600;
    }
}

/* ===== QUICK CALL NOTE BUTTON on kanban cards & table ===== */
.quick-note-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.quick-note-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== KPI TRACKER +1 buttons ===== */
.trk-plus-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.trk-plus-btn:hover {
    background: var(--primary-dark);
}

.trk-plus-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

/* ===== PAGINATION BAR ===== */
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    justify-content: center;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
}

.pg-btn {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}

.pg-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.pg-current {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.pg-info {
    font-size: 0.78rem;
    color: var(--muted);
    margin-right: 0.5rem;
}

/* ===== INLINE STAGE SELECT in table ===== */
.inline-stage-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--card);
    color: var(--text);
    max-width: 130px;
    text-align: center;
    transition: all 0.15s;
}

.inline-stage-select:hover {
    border-color: var(--primary);
}

/* Match stage colors */
.inline-stage-select.stage-Gewonnen {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.inline-stage-select.stage-Verloren {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.inline-stage-select.stage-Termin {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.inline-stage-select.stage-Angebot {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}

.inline-stage-select.stage-Neu {
    background: #e0f2fe;
    color: #0c4a6e;
    border-color: #7dd3fc;
}

body.dark-mode .inline-stage-select.stage-Gewonnen {
    background: #052e16;
    color: #86efac;
}

body.dark-mode .inline-stage-select.stage-Verloren {
    background: #450a0a;
    color: #fca5a5;
}

body.dark-mode .inline-stage-select.stage-Termin {
    background: #422006;
    color: #fde68a;
}

body.dark-mode .inline-stage-select.stage-Angebot {
    background: #1e1b4b;
    color: #c4b5fd;
}

body.dark-mode .inline-stage-select.stage-Neu {
    background: #0c1a27;
    color: #7dd3fc;
}

/* ===== UI-VERBESSERUNGEN 2026 ===== */

/* Kanban-Cards: runder, elastischer hover */
.kanban-card {
    border-radius: 12px;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.kanban-card:hover { border-color: rgba(59, 91, 219, 0.15);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Bulk-Select Checkbox */
.bulk-check {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Nav-Item Slide */
.nav-item {
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

/* Tabellenzeilen hover */
tr:hover td {
    background: rgba(0, 200, 150, 0.03);
}

/* Button micro-animation */
button:active:not(:disabled) {
    transform: scale(0.97) !important;
}

/* Modal fade-in */
@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

/* Bulk-Toolbar slide */
@keyframes slideDown {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }

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

#bulk-toolbar {
    animation: slideDown 0.2s ease;
}

/* KPI-Card hover */
.trk-kpi-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.trk-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dark mode topbar */
body.dark-mode .topbar {
    border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); background: rgba(255,255,255,0.85);
}

/* ===== CRM TOOLTIPS für Abkürzungen ===== */
.crm-tooltip {
    position: relative;
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.crm-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    max-width: 260px;
    white-space: normal;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.crm-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
    z-index: 9999;
}

.crm-tooltip:hover::after,
.crm-tooltip:hover::before {
    opacity: 1;
}

/* ===== SIDEBAR ACTION BUTTONS (Light + Dark Mode) ===== */
.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sidebar-action-btn > i { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-action-btn:hover {
    background: rgba(0, 200, 150, 0.15);
    border-color: var(--primary);
    color: #fff;
}
/* ===== PREMIUM ANIMATIONS ===== */
@keyframes shimmer {
    0% { background-position: 200% 50%; }
    100% { background-position: -200% 50%; }
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chart-card:hover {
    transform: translateY(-1px);
}

body.dark-mode .topbar {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.kanban-card {
    border: 1px solid var(--border);
}

.leads-table-wrap {
    border: 1px solid var(--border);
}

.btn-save:hover {
    background: linear-gradient(135deg, #2b4bc6 0%, #5558e3 100%);
    box-shadow: 0 4px 12px rgba(59, 91, 219, 0.4);
    transform: translateY(-1px);
}

.btn-add-lead:hover {
    background: linear-gradient(135deg, #2b4bc6 0%, #5558e3 100%);
    box-shadow: 0 4px 12px rgba(59, 91, 219, 0.4);
    transform: translateY(-1px);
}

.btn-cancel {
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    transform: translateY(-1px);
}

.close-btn {
    transition: all 0.25s ease;
}

.close-btn:hover {
    background: var(--bg);
    color: var(--red);
    transform: rotate(90deg);
}

/* Premium scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 50px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* ===== KI-RECHERCHE SOURCE ===== */
.source-KI-Recherche {
    background: #ede9fe;
    color: #7c3aed;
}

/* ===== KI BADGE ===== */
.ki-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    padding: 1px 7px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== CALL QUEUE ===== */
.cq-progress-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.cq-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 50px;
    overflow: hidden;
}
.cq-progress-fill {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.5s ease;
}
.cq-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cq-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.cq-card-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.cq-card-company {
    font-weight: 700;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cq-card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cq-card-note {
    font-size: 0.78rem;
    color: var(--text);
    margin-top: 4px;
    opacity: 0.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cq-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.cq-btn {
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}
.cq-btn:hover {
    transform: translateY(-1px);
}
.cq-btn.reached {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.cq-btn.reached:hover {
    background: rgba(16, 185, 129, 0.25);
}
.cq-btn.missed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.cq-btn.missed:hover {
    background: rgba(239, 68, 68, 0.2);
}
.cq-btn.appointment {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}
.cq-btn.appointment:hover {
    background: rgba(59, 130, 246, 0.25);
}
.cq-btn.skip {
    background: var(--bg);
    color: var(--muted);
}
.cq-btn.skip:hover {
    background: var(--border);
}
.cq-phone-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.15s;
    text-decoration: none;
}
.cq-phone-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

    /* Sidebar ausblenden – Hamburger-Menü Trigger */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 200;
        width: 270px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0,0,0,0.4);
    }

    /* Overlay-Styling fürs Handy — Sichtbarkeit steuert die Toggle-Funktion (inline display).
       KEIN display:block !important hier, sonst liegt das Overlay (mit Blur) dauerhaft über allem. */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
        backdrop-filter: blur(2px);
    }

    .main {
        margin-left: 0;
    }

    /* Topbar kompakter */
    .topbar {
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }

    .topbar-left h1 {
        font-size: 1rem;
    }

    .search-wrap input {
        width: 160px;
        font-size: 0.82rem;
    }

    /* Hamburger Button */
    .hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: 1px solid var(--border);
        border-radius: 8px;
        width: 36px;
        height: 36px;
        cursor: pointer;
        color: var(--text);
        font-size: 1rem;
        flex-shrink: 0;
    }

    /* Kanban: horizontal scrollbar auf Mobile */
    .kanban-board {
        gap: 0.6rem;
        padding: 0 0.25rem 1rem;
    }

    .kanban-col {
        min-width: 200px;
        max-width: 210px;
    }

    /* Views padding reduzieren */
    .view {
        padding: 0.75rem;
    }

    /* Stats-Grid: 2 Spalten auf Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Charts: eine Spalte */
    .stats-charts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Modal: volle Breite unten */
    .modal-content {
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        width: 100%;
        max-width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    /* Lead-Detail Panel: volle Breite */
    #detail-panel {
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        border-top: 1px solid var(--border);
    }

    /* Tabelle: horizontal scrollbar */
    .leads-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Topbar Buttons vereinfachen */
    .topbar-right .filter-select {
        max-width: 110px;
        font-size: 0.8rem;
    }

    /* Umsatz-Grid: eine Spalte */
    #umsatz-content > div > div[style*="grid-template-columns:1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* Hamburger immer ausgeblendet auf Desktop */
.hamburger-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* Drag & Drop */
.kanban-col.drag-over {
    background: rgba(47,129,247, 0.06);
    border: 2px dashed var(--primary);
    border-radius: 14px;
    transition: all 0.15s;
}
.kanban-card[draggable="true"] {
    cursor: grab;
}
.kanban-card[draggable="true"]:active {
    cursor: grabbing;
}

/* Undo Toast slideUp animation */
@keyframes toastSlideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* ============================================================
   DESIGN REFRESH (2026-05-20) — editorial, weniger verspielt
   Klarere Datenzellen, dezentere Farben, Serif-Headlines
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --serif: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
    /* Crisper Borders */
    --border: rgba(15, 15, 18, 0.10);
    --border-strong: rgba(15, 15, 18, 0.16);
    /* Surface-Hierarchie verbessert */
    --surface-2: #f7f7fa;
    /* Akzente reduziert auf ein dezentes Graphit-Gold */
    --gold: #c59d2a;
    --gold-soft: rgba(197, 157, 42, 0.12);
    --graphite: #2a2a36;
    --radius: 12px;
    --radius-sm: 9px;
}
body.dark-mode {
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.15);
    --surface-2: #1e1e28;
}

/* ============================================================
   PREMIUM POLISH (2026-06-29) — Apple/Salesforce-Feel
   ============================================================ */
.btn-flat, .tbl-btn, .kpi-flat, .nav-item, .stat-pill {
    transition: background .18s ease, border-color .18s ease, box-shadow .25s cubic-bezier(.2, .7, .3, 1), transform .2s cubic-bezier(.2, .7, .3, 1), color .15s ease;
}
/* KPI-Karten: weicher Schatten + sanfter Hover-Lift */
.kpi-flat { box-shadow: var(--shadow); }
.kpi-flat:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border); }
/* Topbar: Frosted Glass (Apple) */
.topbar {
    background: rgba(255, 255, 255, 0.72) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}
body.dark-mode .topbar { background: rgba(18, 18, 24, 0.7) !important; }
/* Sidebar: dezenter Tiefen-Gradient + feine Haarlinie */
.sidebar {
    background: linear-gradient(180deg, #0e0e16 0%, #08080f 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}
/* Buttons: edler Lift */
.btn-flat:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(17, 17, 26, 0.08); }
.btn-flat-primary { box-shadow: 0 2px 10px rgba(29, 29, 31, 0.18); }
.btn-flat-primary:hover { transform: translateY(-1px); }
/* Eingaben: Apple-Fokus-Ring */
input:focus, select:focus, textarea:focus, .search-wrap input:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.18) !important;
}
/* Edle, schlanke Scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.18) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.16); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); background-clip: content-box; }
body.dark-mode ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); background-clip: content-box; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

/* Headline-Hierarchie: Editorial Serif für Hauptüberschriften */
.refresh h1, .refresh h2, .refresh h3,
.dashboard-h1, .editorial-h, h2.editorial,
#dashboard-content h2, #dashboard-content h3,
.modal h3, .detail-section-title {
    font-family: var(--serif);
    letter-spacing: -0.015em;
    font-feature-settings: 'ss01' 1;
}

/* Tabular Numbers überall wo Geld/Datums sichtbar sind */
.num, .euro, td[data-num], .leads-table td:nth-child(8),
.kpi-stat-value, .zahlungen-stat-value {
    font-variant-numeric: tabular-nums;
    font-family: var(--mono);
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ===== LEAD-TABELLE: kompakter, klarer ===== */
.leads-table {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
}
.leads-table thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 9px 12px;
    font-weight: 700;
    text-align: left;
}
.leads-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    vertical-align: middle;
    font-size: 0.86rem;
}
.leads-table tbody tr:last-child td { border-bottom: none; }
.leads-table tbody tr:hover td { background: var(--surface-2); }
.leads-table tbody tr.row-selected td { background: var(--primary-light); }

/* Vertikale Spalten-Trennung — jede Zelle bekommt eine linke Trennlinie außer der ersten */
.leads-table thead th + th,
.leads-table tbody td + td {
    border-left: 1px solid var(--border);
}
.leads-table thead th + th {
    border-left-color: var(--border-strong);
}

/* ===== KPI-Karten: flat, kein Gradient ===== */
.kpi-flat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.35rem;
    transition: border-color 0.15s ease;
}
.kpi-flat:hover { border-color: var(--border-strong); }
.kpi-flat .kpi-stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 6px;
}
.kpi-flat .kpi-stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    font-family: var(--mono);
    letter-spacing: -0.02em;
}

/* ===== Buttons: flat, konsistente Höhe ===== */
.btn-flat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border-strong);
    background: var(--card);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.12s ease;
    line-height: 1.2;
    font-family: inherit;
}
.btn-flat:hover { background: var(--surface-2); border-color: var(--text); }
.btn-flat-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-flat-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ===== Section-Titel im Detail/Kunden-Profil ===== */
.detail-section-title {
    font-family: var(--serif) !important;
    font-size: 0.78rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    font-weight: 700 !important;
    color: var(--muted) !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 12px !important;
}

/* ===== Stage-Select in Tabelle: dezenter Look ===== */
.inline-stage-select {
    background: var(--surface-2);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 4px 26px 4px 10px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    cursor: pointer;
}
.inline-stage-select:hover { border-color: var(--border-strong) !important; }

/* ===== Sidebar-Items: weniger Glow, klare Aktiv-Markierung ===== */
.nav-item.active, .nav-item.is-active {
    background: rgba(1, 118, 211, 0.16) !important;
    border-left: 3px solid var(--primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* ===== Modal: ruhiger, kein zu starker Shadow ===== */
.modal {
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* ===== Tabellen-Action-Buttons (tbl-btn): einheitliche Größe ===== */
.tbl-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.82rem;
    margin: 0 2px;
    transition: all 0.12s;
}
.tbl-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.tbl-btn.del:hover { color: var(--red); border-color: var(--red); }

/* ===== Card-Source-Pills: dezenter ===== */
.card-source {
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 50px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== Reduzierte Schatten überall ===== */
.tbl-btn, .leads-table, .kanban-card, .kpi-flat {
    box-shadow: none !important;
}

/* ===== AKQUISE-VIEW (responsives Verhalten Outcome-Buttons) ===== */
@media (max-width: 700px) {
    .akquise-btn-label { display: none; }
}

/* "Hat schon gute Website"-Toggle (Desktop + Mobile) */
.cold-goodweb-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 0.65rem;
    padding: 8px 12px;
    background: var(--card);
    border: 1.5px solid var(--border-strong);
    color: var(--muted);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
}
.cold-goodweb-toggle:hover { border-color: #c59d2a; color: var(--text); }
.cold-goodweb-toggle.active {
    background: rgba(197,157,42,0.12);
    border-color: #c59d2a;
    color: #c59d2a;
    font-weight: 700;
}

/* ===== ROHLEAD-NOTIZEN (für mich & fürs Team) ===== */
.cold-toggles { margin: 0 0 0.65rem; }
.cold-toggles .cold-goodweb-toggle { margin: 0; }
.cold-notes-toggle {
    display: inline-flex; align-items: center; gap: 7px; margin: 0;
    padding: 8px 12px; background: var(--card);
    border: 1.5px solid var(--border-strong); color: var(--muted);
    border-radius: 8px; font-weight: 600; font-size: 0.82rem;
    cursor: pointer; transition: all 0.12s; font-family: inherit;
}
.cold-notes-toggle:hover { border-color: #2f81f7; color: var(--text); }
.cold-notes-toggle.active { background: rgba(47,129,247,0.12); border-color: #2f81f7; color: #2f81f7; font-weight: 700; }

.cold-notes { margin: 0 0 0.7rem; padding: 0.7rem; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.cold-notes-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }
.cold-note { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.6rem; }
.cold-note-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 3px; }
.cold-note-who { font-size: 0.72rem; font-weight: 700; color: #2f81f7; }
.cold-note-when { font-size: 0.7rem; color: var(--muted); }
.cold-note-del { margin-left: auto; background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 2px 5px; border-radius: 4px; line-height: 1; }
.cold-note-del:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.cold-note-text { font-size: 0.86rem; line-height: 1.4; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.cold-note-empty { font-size: 0.8rem; color: var(--muted); padding: 0.2rem 0 0.5rem; }
.cold-note-input { display: flex; gap: 0.5rem; align-items: flex-end; }
.cold-note-ta { flex: 1; resize: vertical; min-height: 42px; padding: 0.5rem 0.6rem; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--card); color: var(--text); font-family: inherit; font-size: 0.86rem; line-height: 1.4; }
.cold-note-ta:focus { outline: none; border-color: #2f81f7; }
.cold-note-save { white-space: nowrap; background: #2f81f7; color: #fff; border: none; border-radius: 8px; padding: 0.5rem 0.85rem; font-weight: 700; font-size: 0.82rem; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px; }
.cold-note-save:hover { background: #4f46e5; }

/* ===== ROHLEADS MOBILE (Kaltakquise vom Handy) ===== */
@media (max-width: 700px) {
    .cold-goodweb-toggle { display: flex; flex: 1 1 100%; justify-content: center; padding: 11px 12px; font-size: 0.88rem; }
    /* Notiz-Toggle + Bereich mobil: volle Breite, große Tap-Targets, kein iOS-Zoom */
    .cold-notes-toggle { display: flex !important; flex: 1 1 100%; justify-content: center; padding: 11px 12px !important; font-size: 0.88rem !important; }
    .cold-note-input { flex-direction: column !important; align-items: stretch !important; }
    .cold-note-ta { font-size: 16px !important; min-height: 70px !important; }
    .cold-note-save { width: 100% !important; justify-content: center; padding: 12px !important; font-size: 0.95rem !important; }
    .cold-note-text { font-size: 0.95rem !important; }
    .cold-note-del { font-size: 1.05rem !important; padding: 4px 8px !important; }
    /* Karte etwas luftiger für Daumen */
    .cold-card { padding: 1rem 1rem 1.1rem !important; }
    /* Kopf-Bereich stapeln, Info volle Breite */
    .cold-info { min-width: 0 !important; width: 100%; }
    .cold-card .cold-info > div:first-child { font-size: 1.05rem !important; }
    /* Kleine Icon-Buttons (Website/Maps/Löschen) oben rechts: größere Tap-Targets */
    .cold-quickactions .tbl-btn { width: 38px !important; height: 38px !important; font-size: 0.95rem !important; }
    /* Den kleinen Telefon-Icon-Button oben ausblenden — stattdessen der große Anruf-Button unten */
    .cold-quickactions a[href^="tel:"] { display: none !important; }

    /* Großer, voller Anruf-Button mit Nummer (Primär-Aktion für die Kaltakquise) */
    .cold-call-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin: 0.25rem 0 0.7rem;
        padding: 13px 14px;
        background: linear-gradient(135deg, #10b981, #059669);
        color: #fff !important;
        border-radius: 10px;
        font-weight: 800;
        font-size: 0.95rem;
        text-decoration: none;
        box-shadow: 0 2px 8px rgba(16,185,129,0.25);
    }
    .cold-call-mobile:active { transform: translateY(1px); }

    /* Kleinen Globus-Icon-Button oben ausblenden — stattdessen der große Website-Button */
    .cold-quickactions .cold-web-icon { display: none !important; }
    /* Prominenter "Website checken"-Button (für die schnelle Sichtprüfung vor dem Pitch) */
    .cold-web-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin: 0 0 0.7rem;
        padding: 11px 14px;
        background: var(--card);
        border: 1.5px solid var(--border-strong);
        color: var(--text) !important;
        border-radius: 10px;
        font-weight: 700;
        font-size: 0.9rem;
        text-decoration: none;
    }
    .cold-web-mobile:active { transform: translateY(1px); }
    .cold-web-mobile.cold-web-none { color: var(--muted) !important; border-style: dashed; font-weight: 600; opacity: 0.7; }

    /* Outcome-Buttons: 2-Spalten-Raster, beschriftet, große Tap-Targets */
    .cold-btn-label { display: inline !important; }
    .cold-outcomes-wrap { flex-direction: column; align-items: stretch !important; }
    .cold-outcomes {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 7px !important;
        width: 100%;
        flex: none !important;
    }
    .cold-out-btn {
        justify-content: flex-start !important;
        padding: 12px 12px !important;
        font-size: 0.85rem !important;
        min-height: 46px;
    }
    .cold-out-btn i { font-size: 0.95rem; width: 18px; text-align: center; }
    /* "Ins CRM übernehmen" (nur Admin/Editor) volle Breite unten */
    .cold-move-btn { width: 100%; justify-content: center; margin-top: 4px; padding: 12px !important; }
}

/* Auf sehr schmalen Phones: Outcome-Buttons einspaltig (noch größer) */
@media (max-width: 380px) {
    .cold-outcomes { grid-template-columns: 1fr !important; }
}

/* ============================================================
   SALESFORCE-TOUCH: Micro-Animationen (2026-06-29)
   ============================================================ */
@keyframes sfRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sfFade { from { opacity: 0; } to { opacity: 1; } }
/* View-Wechsel: Inhalt steigt sanft ein (kein fill -> kein Rest-Transform, sticky bleibt heil) */
.view.active { animation: sfRise .34s cubic-bezier(.21, .68, .32, 1); }
/* Dashboard-KPIs: gestaffeltes Einblenden */
.kpi-flat { animation: sfRise .42s cubic-bezier(.21, .68, .32, 1) both; }
.kpi-flat:nth-child(1) { animation-delay: .02s; }
.kpi-flat:nth-child(2) { animation-delay: .08s; }
.kpi-flat:nth-child(3) { animation-delay: .14s; }
.kpi-flat:nth-child(4) { animation-delay: .20s; }
.kpi-flat:nth-child(5) { animation-delay: .26s; }
.kpi-flat:nth-child(6) { animation-delay: .32s; }
/* Kanban-Karten sanft einblenden */
.kanban-card { animation: sfFade .3s ease both; }
/* Nav-Items: feiner Slide beim Hover */
.nav-item { transition: background .16s ease, color .16s ease, padding-left .16s ease, border-color .16s ease; }
.nav-item:hover:not(.active) { padding-left: calc(0.75rem + 3px); }
/* Spürbares Press-Feedback */
.btn-flat:active, .tbl-btn:active, .btn-flat-primary:active { transform: translateY(0) scale(0.97); }
/* Reduced-Motion respektieren */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================================================
   DARK MODE PREMIUM (2026-06-29) — Graphit, Glas, technisch
   (am Dateiende -> gewinnt im Cascade über die alten Dark-Tokens)
   ============================================================ */
body.dark-mode {
    --bg: #0c0c0f;
    --card: #16161a;
    --surface: #1c1c21;
    --surface-2: #232329;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f4f4f6;
    --muted: #9a9aa6;
    --primary: #2f9bff;
    --primary-dark: #1f7fe0;
    --primary-light: rgba(47, 155, 255, 0.14);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --glow: 0 0 0 1px rgba(47, 155, 255, 0.3), 0 6px 24px rgba(47, 155, 255, 0.18);
    background-color: #0c0c0f;
    background-image:
        radial-gradient(1200px 600px at 12% -5%, rgba(47, 155, 255, 0.06) 0%, transparent 55%),
        radial-gradient(1000px 500px at 90% 110%, rgba(47, 155, 255, 0.04) 0%, transparent 55%) !important;
    background-attachment: fixed;
}
/* Glas auf Schlüssel-Oberflächen (Apple-Stil) */
body.dark-mode .sidebar {
    background: rgba(14, 14, 18, 0.78) !important;
    -webkit-backdrop-filter: saturate(160%) blur(22px);
    backdrop-filter: saturate(160%) blur(22px);
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
}
body.dark-mode .topbar {
    background: rgba(16, 16, 20, 0.66) !important;
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
body.dark-mode .modal {
    background: rgba(24, 24, 29, 0.92) !important;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
/* KPI-Karten im Dark: leichter Glas-Layer */
body.dark-mode .kpi-flat {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
body.dark-mode .kpi-flat:hover { background: rgba(255, 255, 255, 0.06); }
/* Eingaben im Dark: technischer, klarer */
body.dark-mode .search-wrap input,
body.dark-mode .filter-select,
body.dark-mode input[type="text"], body.dark-mode input[type="email"],
body.dark-mode input[type="tel"], body.dark-mode input[type="number"],
body.dark-mode input[type="url"], body.dark-mode input[type="date"],
body.dark-mode input[type="time"], body.dark-mode select, body.dark-mode textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    color: #f4f4f6 !important;
}
body.dark-mode * { scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }

/* ============================================================
   MOBILE FIX 14.07.2026: kein seitliches Scrollen mehr.
   Live am 375px-Viewport verifiziert (alle 8 Ansichten).
   Ursache: #main-content ist Flex-Kind ohne min-width:0, ein
   verstecktes Formular-Grid (628px) drueckte JEDE Ansicht auf.
   Regel: mobile Overrides immer mit !important.
   ============================================================ */
html, body { max-width: 100vw !important; overflow-x: hidden !important; }
#main-content { min-width: 0 !important; max-width: 100vw !important; overflow-x: hidden !important; }

@media (max-width: 768px) {
    /* Tabellen und Charts scrollen IN ihrem Rahmen, nicht die Seite */
    .leads-table-wrap { overflow-x: auto !important; max-width: 100% !important; -webkit-overflow-scrolling: touch !important; }
    .chart-card { overflow-x: auto !important; max-width: 100% !important; }

    /* Formular- und Statistik-Grids einspaltig bzw. zweispaltig */
    .form-grid { grid-template-columns: 1fr !important; }
    .stats-grid, #forecast-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .stats-charts { grid-template-columns: 1fr !important; }

    /* Termin-Karten: Datum ueber Inhalt stapeln, Buttons duerfen umbrechen */
    #termine-content > div[onclick] { flex-direction: column !important; }
    #termine-content > div[onclick] > div:first-child { min-width: 0 !important; display: flex !important; gap: .6rem !important; align-items: baseline !important; }
    .btn-flat { white-space: normal !important; }

    /* Lange Links / E-Mails brechen statt rauszuragen */
    .view span, .view a { overflow-wrap: anywhere; }

    /* Dashboard: starre Flex-Leisten (z.B. Pipeline-Stages) umbrechen lassen */
    #dashboard-content div[style*="display:flex"] { flex-wrap: wrap !important; }
}
