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

/* ===== LIGHT MODE (Default – Brandfarben) ===== */
:root {
    --primary: #008f6c;
    --primary-dark: #006e54;
    --primary-light: #e6f7f3;
    --accent: #008f6c;
    --red: #ef4444;
    --orange: #f59e0b;
    --sidebar-bg: #070208;
    --sidebar-text: rgba(255, 255, 255, 0.65);
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* ===== DARK MODE ===== */
body.dark-mode {
    --bg: #0f1117;
    --card: #1a1d27;
    --border: #2d3148;
    --text: #e8eaf6;
    --muted: #8892b0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --primary-light: #0d2e25;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    transition: background 0.25s, color 0.25s;
}

/* ===== 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: #1a1d27;
    color: #e8eaf6;
    border-color: #2d3148;
}

body.dark-mode .search-wrap input::placeholder {
    color: #8892b0;
}

body.dark-mode .filter-select option {
    background: #1a1d27;
    color: #e8eaf6;
}


/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 2rem;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: white;
    font-size: 1rem;
}

.brand-text strong {
    display: block;
    color: white;
    font-size: 0.95rem;
}

.brand-text span {
    color: var(--sidebar-text);
    font-size: 0.78rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

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

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

.btn-add-lead {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: background 0.2s;
}

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

.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: #10b981;
    border: 2px solid #059669;
    color: white;
    font-weight: 700;
}

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

.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: 1rem 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.4rem;
    font-weight: 700;
    color: var(--text);
}

.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: 0 0 0 3px var(--primary-light);
}

.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: #d1fae5;
    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: 10px;
    padding: 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

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

.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: #d1fae5;
    color: #047857;
}

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

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

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    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;
}

.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-Loom-gesendet {
    background: #fef3c7;
    color: #b45309;
}

.stage-Follow-up {
    background: #fce7f3;
    color: #be185d;
}

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

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

.stage-Gewonnen {
    background: #d1fae5;
    color: #047857;
}

.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: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

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

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

.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);
}

.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, var(--primary), #818cf8);
    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: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

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

.modal {
    background: var(--card);
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.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;
}

.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 var(--primary-light);
}

.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: var(--primary);
    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: 1.25rem;
    margin-bottom: 1.5rem;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

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

.detail-field .d-val {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}

.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: #f8fafc;
    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: #0d2e25;
}

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, #f59e0b, #10b981);
    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, #10b981);
    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: #10b981;
    color: #10b981;
}

.pay-toggle.pay-toggle-active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #059669;
}

/* 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: #10b981;
    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: #0f172a;
    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(99, 102, 241, 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: #059669;
    font-weight: 700;
    background: #f0fdf4;
}

/* Total row */
.trk-total-row td {
    background: #0f172a !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,
.modal,
.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 1rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    transition: all 0.2s;
    justify-content: center;
}

.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 #008f6c;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    .print-header h1 {
        font-size: 1.4rem;
        color: #008f6c;
    }

    .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 {
    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);
}

/* ===== 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: 8px;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar-action-btn:hover {
    background: rgba(0, 200, 150, 0.15);
    border-color: var(--primary);
    color: #fff;
}