:root {
    /* Brand – NeoPresence Schwarz/Weiss */
    --primary: #0a0a0a;
    --primary-hover: #27272a;
    --primary-light: #f4f4f5;
    --primary-gradient: linear-gradient(135deg, #0a0a0a 0%, #3f3f46 100%);

    /* Semantic Colors – alle in Grau-Varianten */
    --success: #18181b;
    --success-light: #f4f4f5;
    --success-text: #18181b;
    --warning: #52525b;
    --warning-light: #fafafa;
    --warning-text: #27272a;
    --danger: #0a0a0a;
    --danger-light: #fafafa;
    --danger-text: #0a0a0a;
    --info: #3f3f46;
    --info-light: #fafafa;
    --info-text: #27272a;

    /* Neutrals */
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;

    /* Surfaces */
    --bg: #ffffff;
    --bg-subtle: #fafafa;
    --bg-card: #ffffff;
    --bg-sidebar: #fafafa;
    --text: #0a0a0a;
    --text-secondary: #3f3f46;
    --text-tertiary: #71717a;
    --text-sidebar: #3f3f46;
    --text-sidebar-active: #0a0a0a;
    --border: #d4d4d8;
    --border-subtle: #f4f4f5;

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows – moderner, weicher */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow: 0 4px 12px -2px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 12px 24px -6px rgb(0 0 0 / 0.08), 0 4px 8px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 24px 48px -12px rgb(0 0 0 / 0.12);

    /* Typography Scale */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    --sidebar-width: 240px;

    /* Easing */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Inline Code */
code {
    font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
    font-size: 0.88em;
    padding: 1px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--primary-hover);
}

/* Smooth scrolling und Scrollbars */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 2px solid var(--bg);
}

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

/* Selection */
::selection {
    background: #0a0a0a;
    color: #ffffff;
}

/* Sidebar – hell und subtil */
#sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    padding: var(--space-6) 0;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 var(--space-6);
    margin-bottom: var(--space-8);
}

.logo-icon-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    display: none;
}

.logo-wordmark {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-links {
    list-style: none;
    padding: 0 var(--space-3);
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 2px;
    color: #0a0a0a;
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: 500;
    transition: all 0.2s var(--ease);
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-links a svg {
    opacity: 0.9;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    background: #f4f4f5;
    color: #0a0a0a;
}

.nav-links a:hover svg {
    opacity: 1;
}

.nav-links a.active {
    background: #0a0a0a;
    color: #ffffff;
}

.nav-links a.active svg {
    opacity: 1;
    color: #ffffff;
}

/* Main Content */
#content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--space-8);
    min-height: 100vh;
    max-width: 100%;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    gap: var(--space-4);
}

.page-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* Buttons – moderner mit subtiler Tiefe */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s var(--ease);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--gray-300);
}

.btn-danger {
    background: #ffffff;
    color: #0a0a0a;
    border-color: #0a0a0a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-danger:hover {
    background: #0a0a0a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--text-sm);
    gap: 6px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: var(--space-6);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s var(--ease);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: calc(var(--space-2) * -1);
    padding: var(--space-2);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: var(--bg-subtle);
    position: sticky;
    top: 0;
}

th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s, background 0.15s;
}

th.sortable:hover {
    color: var(--text);
    background: var(--gray-100);
}

th.sortable.sorted {
    color: var(--primary);
}

.sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.4;
    transition: opacity 0.15s;
}

th.sortable:hover .sort-arrow {
    opacity: 0.8;
}

.sort-arrow.active {
    opacity: 1;
    color: var(--primary);
    font-weight: 700;
}

tbody tr {
    transition: background 0.12s;
}

tbody tr:hover {
    background: var(--bg-subtle);
}

tbody tr:last-child td {
    border-bottom: none;
}

tr.clickable {
    cursor: pointer;
}

/* Status Badges – moderner Flat-Look mit Dot */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.badge-neu { background: #ffffff; color: #0a0a0a; border: 1px solid #0a0a0a; }
.badge-demo_bereit { background: #f4f4f5; color: #0a0a0a; border: 1px solid #0a0a0a; }
.badge-brief_versendet { background: #ffffff; color: #0a0a0a; border: 1px dashed #0a0a0a; }
.badge-gescannt { background: #e4e4e7; color: #0a0a0a; border: 1px solid #0a0a0a; }
.badge-opted_in { background: #0a0a0a; color: #ffffff; opacity: 0.7; }
.badge-kontaktiert { background: #ffffff; color: #0a0a0a; border: 1px dashed #0a0a0a; }
.badge-in_gespraech { background: #0a0a0a; color: #ffffff; border: 1px solid #0a0a0a; opacity: 0.65; }
.badge-auftrag { background: #0a0a0a; color: #ffffff; opacity: 0.8; }
.badge-freigabe { background: #0a0a0a; color: #ffffff; opacity: 0.92; }
.badge-abgeschlossen { background: #0a0a0a; color: #ffffff; }
.badge-inaktiv { background: #ffffff; color: #0a0a0a; border: 1px dashed #a1a1aa; opacity: 0.5; }

.badge-auftrag::before,
.badge-freigabe::before,
.badge-abgeschlossen::before { background: #ffffff; opacity: 0.9; }

/* Industry Badges – subtiler */
.badge-industry {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-industry::before {
    display: none;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    transition: all 0.15s var(--ease);
    box-shadow: var(--shadow-xs);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    transition: all 0.15s var(--ease);
}

.filter-bar input:hover,
.filter-bar select:hover {
    border-color: var(--gray-300);
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(24, 24, 27, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s var(--ease);
    padding: var(--space-4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.2s var(--ease);
}

.modal h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-6);
}

.modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--space-6);
}

.pagination button {
    padding: 7px 12px;
    min-width: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s var(--ease);
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-subtle);
    border-color: var(--gray-300);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.25);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: var(--text-tertiary);
    padding: 0 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: var(--text-md);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text);
    letter-spacing: -0.01em;
}

/* InfoBox / Alert – fuer Hinweise */
.infobox {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--text-secondary);
}

.infobox-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    background: var(--gray-200);
    color: var(--gray-600);
}

.infobox-content strong {
    color: var(--text);
    font-weight: 600;
}

.infobox-info {
    background: #fafafa;
    border-color: #e4e4e7;
    color: #27272a;
}

.infobox-info .infobox-icon {
    background: #27272a;
    color: white;
}

.infobox-warning {
    background: #ffffff;
    border: 1px dashed #27272a;
    color: #0a0a0a;
}

.infobox-warning .infobox-icon {
    background: #0a0a0a;
    color: white;
}

.infobox-success {
    background: #0a0a0a;
    border-color: #0a0a0a;
    color: #ffffff;
}

.infobox-success .infobox-icon {
    background: #ffffff;
    color: #0a0a0a;
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

/* Utility */
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.mt-8 { margin-top: var(--space-2); }
.mt-16 { margin-top: var(--space-4); }
.mt-24 { margin-top: var(--space-6); }
.mb-16 { margin-bottom: var(--space-4); }
.mb-24 { margin-bottom: var(--space-6); }
.flex { display: flex; }
.gap-8 { gap: var(--space-2); }
.gap-12 { gap: var(--space-3); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin-right: var(--space-2);
    animation: spin 0.7s linear infinite;
}

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

/* ============================================================
   Pipeline Board – Modernes Design
   ============================================================ */

.pipeline-board-modern {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: thin;
}

.pipeline-board-modern::-webkit-scrollbar {
    height: 8px;
}

.pipeline-board-modern::-webkit-scrollbar-track {
    background: transparent;
}

.pipeline-board-modern::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.pipeline-column-modern {
    min-width: 260px;
    flex: 1;
    background: var(--col-bg, #ffffff);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    border: 1px solid #0a0a0a;
    transition: all 0.2s;
    position: relative;
}

.pipeline-column-modern::before {
    content: "";
    position: absolute;
    top: 0;
    left: 14px;
    right: 14px;
    height: 4px;
    background: var(--col-accent);
    border-radius: 0 0 3px 3px;
    opacity: 1;
}

.pipeline-column-modern.drag-over {
    border-width: 2px;
    transform: scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pipeline-col-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 6px 4px 4px;
}

.pipeline-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--col-text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pipeline-col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--col-accent);
}

.pipeline-col-count {
    background: var(--col-accent);
    color: var(--col-bg);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 26px;
    text-align: center;
}

.pipeline-cards-modern {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 100px;
}

.pipeline-empty {
    text-align: center;
    padding: 32px 8px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.4);
}

/* Card */
.pipeline-card-modern {
    background: white;
    border-radius: 10px;
    padding: 12px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
    overflow: hidden;
}

.pipeline-card-modern::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--col-accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.pipeline-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.pipeline-card-modern:hover::before {
    opacity: 1;
}

.pipeline-card-modern:active {
    cursor: grabbing;
}

.pipeline-card-modern.dragging {
    opacity: 0.4;
    transform: rotate(2deg) scale(0.98);
}

.pipeline-card-modern.high-priority {
    border: 1px solid #0a0a0a;
    background: #ffffff;
}

.pipeline-card-modern.high-priority::before {
    background: #0a0a0a;
    opacity: 1;
    width: 4px;
}

/* Card Top Section */
.pipeline-card-top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.pipeline-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #0a0a0a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.pipeline-card-title {
    flex: 1;
    min-width: 0;
}

.pipeline-card-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pipeline-card-industry {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.pipeline-priority-badge {
    background: #0a0a0a;
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Icons */
.pipeline-card-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.pipeline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: var(--border);
    background: transparent;
    transition: all 0.15s;
}

.pipeline-icon.active {
    color: #0a0a0a;
    background: #f4f4f5;
}

.pipeline-rating {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: #18181b;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Fallback fuer Browser ohne color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
    .pipeline-avatar {
        background: var(--col-accent);
    }
}

/* Progress Bar */
.running-job-card {
    border-left: 4px solid var(--primary);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-left-color: #0a0a0a; }
    50% { border-left-color: #a1a1aa; }
}

.progress-container {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar-mini {
    width: 80px;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.progress-bar-mini-wide {
    width: 100%;
    min-width: 200px;
    height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-wide {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-icon-delete {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: 300;
    transition: all 0.15s;
}

.btn-icon-delete:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0a0a0a, #3f3f46);
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.progress-percent {
    font-size: 18px;
    font-weight: 700;
    color: #0a0a0a;
}

/* Tabs – modern Pill-Style */
.tabs {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tab {
    padding: 7px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s var(--ease);
    letter-spacing: -0.01em;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--text);
    background: var(--bg-card);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* Template-Cards */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
}

.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
}

.template-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #0a0a0a;
    opacity: 0;
    transition: opacity 0.2s;
}

.template-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

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

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.template-header h3 {
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.template-price {
    font-size: var(--text-xl);
    font-weight: 700;
    color: #0a0a0a;
    white-space: nowrap;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.template-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    line-height: 1.5;
}

.template-items {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-3) 0;
    flex: 1;
}

.template-items li {
    padding: 8px 0;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    position: relative;
    padding-left: 18px;
}

.template-items li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0a0a0a;
    transform: translateY(-50%);
}

.template-items li:last-child {
    border-bottom: none;
}

.template-notes {
    background: #fafafa;
    border-left: 3px solid #0a0a0a;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: #27272a;
    margin-bottom: var(--space-3);
    line-height: 1.5;
}

.template-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

/* Mini-Stats (inline in Karten) */
.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-2) 0;
}

.stat-mini-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.stat-mini-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* E-Mail-Template-Card */
.email-template-card {
    margin-bottom: var(--space-4);
}

.email-preview-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.email-preview-row + .email-preview-row {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.email-preview-body {
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.55;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
}

/* Template Compact (Dashboard/Overview) */
.template-list-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.template-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    gap: var(--space-3);
}

.template-compact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.template-compact-info strong {
    font-size: var(--text-sm);
    font-weight: 600;
}

/* Sequenz-Liste */
.sequence-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.sequence-lead {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    background: var(--bg-card);
    transition: all 0.15s var(--ease);
}

.sequence-lead:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.sequence-lead-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.sequence-lead-name {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-md);
    margin-right: var(--space-2);
}

.sequence-steps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.sequence-step-box {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    font-size: var(--text-xs);
    min-height: 76px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.sequence-step-box.inactive {
    opacity: 0.5;
    text-align: center;
    align-items: center;
    color: var(--text-tertiary);
}

.sequence-step-box.done {
    background: #0a0a0a;
    border-color: #0a0a0a;
    color: #ffffff;
}

.sequence-step-box.done .sequence-step-label { color: #ffffff; }
.sequence-step-box.done .sequence-step-date { color: #a1a1aa; }

.sequence-step-box.pending {
    background: #fafafa;
    border-color: #e4e4e7;
}

.sequence-step-box.failed {
    background: #ffffff;
    border: 1px dashed #0a0a0a;
}

.sequence-step-label {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-xs);
}

.sequence-step-status {
    font-size: var(--text-xs);
    font-weight: 500;
}

.sequence-step-box.done .sequence-step-status { color: #ffffff; }
.sequence-step-box.pending .sequence-step-status { color: #52525b; }
.sequence-step-box.failed .sequence-step-status { color: #0a0a0a; }

.sequence-step-date {
    font-size: 10px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* Templates-Liste (in E-Mail-Seite) */
.templates-list {
    display: flex;
    flex-direction: column;
}

/* Item Rows in Template-Form */
.item-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.item-row input {
    padding: 6px 10px !important;
    font-size: 13px !important;
}

.item-row .item-desc {
    flex: 1;
}

/* ============================================================
   Mailbox / Posteingang
   ============================================================ */

.nav-badge {
    margin-left: auto;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-links a.active .nav-badge {
    background: #ffffff;
    color: #0a0a0a;
}

.mail-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    height: calc(100vh - 180px);
    min-height: 500px;
}

@media (max-width: 900px) {
    .mail-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.mail-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mail-folders {
    display: flex;
    gap: 4px;
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.mail-folder {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.mail-folder:hover { border-color: #0a0a0a; color: #0a0a0a; }

.mail-folder.active {
    background: #0a0a0a;
    color: #ffffff;
    border-color: #0a0a0a;
}

.mail-folder .count {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 700;
}

.mail-folder:not(.active) .count {
    background: #0a0a0a;
    color: #ffffff;
}

.mail-filters {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.mail-filters input[type=text] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.mail-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.mail-list {
    flex: 1;
    overflow-y: auto;
}

.mail-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.mail-row {
    display: flex;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.12s;
}

.mail-row:hover { background: var(--bg-subtle); }

.mail-row.active {
    background: #0a0a0a;
    color: #ffffff;
}

.mail-row.active .mail-date,
.mail-row.active .mail-row-subject,
.mail-row.active .mail-tag,
.mail-row.active .mail-from { color: #ffffff; }

.mail-row.unread .mail-from,
.mail-row.unread .mail-row-subject {
    font-weight: 700;
}

.mail-row.unread::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    background: #0a0a0a;
    border-radius: 50%;
    margin-top: 14px;
    flex-shrink: 0;
}

.mail-row.active.unread::before { background: #ffffff; }

.mail-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0a0a0a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.mail-row.active .mail-avatar {
    background: #ffffff;
    color: #0a0a0a;
}

.mail-row-body {
    flex: 1;
    min-width: 0;
}

.mail-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.mail-from {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.mail-date {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.mail-row-subject {
    font-size: 13px;
    color: var(--text);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mail-tag {
    font-size: 10px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.mail-star-on { color: #0a0a0a; font-size: 11px; }
.mail-att { font-size: 11px; color: var(--text-tertiary); }

/* Mail-Pane (Detail rechts) */
.mail-pane {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 0;
}

.mail-empty-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    gap: 12px;
    padding: 40px;
    text-align: center;
}

.mail-detail {
    padding: 24px 28px;
}

.mail-detail-header h2 {
    font-size: 20px;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.mail-detail-meta {
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    line-height: 1.8;
}

.mail-detail-meta strong {
    color: var(--text);
    font-weight: 600;
    display: inline-block;
    min-width: 60px;
}

.mail-detail-body {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    line-height: 1.6;
    font-size: 14px;
}

.mail-plain {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    margin: 0;
}

.mail-detail-body img { max-width: 100%; height: auto; }

/* ============================================================
   WebsiteBuilder
   ============================================================ */

.wb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.wb-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
    height: calc(100vh - 180px);
    min-height: 500px;
}

@media (max-width: 900px) {
    .wb-layout { grid-template-columns: 1fr; height: auto; }
}

/* Chat-Bereich */
.wb-chat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.wb-chat-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 40px 20px;
    font-size: 14px;
}

.wb-chat-msg { margin-bottom: 12px; }

.wb-chat-user { display: flex; justify-content: flex-end; }
.wb-chat-assistant { display: flex; justify-content: flex-start; }

.wb-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.wb-chat-user .wb-chat-bubble {
    background: #0a0a0a;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.wb-chat-assistant .wb-chat-bubble {
    background: var(--bg-subtle);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 3px;
}

.wb-chat-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    font-weight: 600;
    margin-bottom: 4px;
}

.wb-chat-text { white-space: pre-wrap; word-break: break-word; }

.wb-chat-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 4px;
}

.wb-chat-input {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.wb-chat-input textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
}

.wb-chat-input textarea:focus {
    outline: none;
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.1);
}

/* Preview-Bereich */
.wb-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wb-preview-toolbar {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-preview-frame {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    background: #e4e4e7;
    padding: 16px;
}

.wb-iframe {
    background: #ffffff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    height: 100%;
    transition: width 0.3s ease;
}

.wb-iframe-desktop { width: 100%; max-width: 100%; }
.wb-iframe-tablet { width: 768px; }
.wb-iframe-mobile { width: 375px; }

.wb-source-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        width: 60px;
        overflow: hidden;
    }

    #sidebar .logo-wordmark,
    #sidebar .nav-links a span {
        display: none;
    }

    #sidebar .logo-icon-img {
        display: block;
    }

    #sidebar .logo {
        justify-content: center;
        padding: 0;
    }

    #content {
        margin-left: 60px;
    }

    .grid-4 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
