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

:root {
    /* BeautyHills CI Farben */
    --primary-color: #EC6751;
    --primary-hover: #d95a47;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* BeautyHills Primärfarben */
    --bh-black: #000000;
    --bh-coral: #EC6751;
    --bh-white: #FFFFFF;
    --bh-taupe: #8a8e8f;
    
    /* BeautyHills Sekundärfarben */
    --bh-beige-light: #F0E6D8;
    --bh-beige: #DBC8B6;
    
    /* Graustufen */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-50);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 20px;
}

.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
    margin-bottom: 24px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.header-left {
    justify-self: start;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    justify-self: center;
}

.header-right {
    justify-self: end;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: var(--gray-700);
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--bh-coral);
    box-shadow: 0 0 0 3px rgba(236, 103, 81, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--bh-coral);
    color: var(--bh-white);
    font-weight: 600;
}

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

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background: var(--bh-white);
    color: var(--bh-black);
    border: 2px solid var(--bh-taupe);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--bh-black);
}

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

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    padding-left: 40px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 16px;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.lead-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.lead-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lead-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.lead-card p {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.badge-new {
    background: var(--bh-coral);
    color: var(--bh-white);
}

.badge-progress {
    background: var(--bh-taupe);
    color: var(--bh-white);
}

.badge-qualified {
    background: var(--success-color);
    color: var(--bh-white);
}

.badge-sent {
    background-color: #e0e7ff;
    color: #3730a3;
}

.table-container {
    overflow-x: auto;
}

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

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

table th {
    background-color: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

table tr:hover {
    background-color: var(--gray-50);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card.header {
    background: var(--bh-black);
    color: var(--bh-white);
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid var(--bh-coral);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--gray-900);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.debug-log {
    background: var(--gray-900);
    color: #10b981;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 20px;
}

.debug-log p {
    margin-bottom: 4px;
}

.radio-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
    min-height: 100px;
}

.radio-card:hover .radio-card-content {
    border-color: var(--primary-color);
    background: var(--gray-50);
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    border-color: var(--primary-color);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.radio-card-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.radio-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-card-title {
    color: var(--primary-color);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.radio-card-compact {
    position: relative;
    cursor: pointer;
    display: block;
}

.radio-card-compact input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content-compact {
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
}

.radio-card-compact:hover .radio-card-content-compact {
    border-color: var(--bh-beige);
    background: var(--gray-50);
}

.radio-card-compact input[type="radio"]:checked + .radio-card-content-compact {
    border-color: var(--bh-beige);
    background: var(--bh-beige);
    color: var(--bh-black);
    box-shadow: 0 2px 4px rgba(219, 200, 182, 0.4);
    font-weight: 600;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip span {
    display: inline-block;
    padding: 10px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 20px;
    background: white;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.chip:hover span {
    border-color: var(--bh-beige);
    background: var(--gray-50);
}

.chip input[type="checkbox"]:checked + span {
    border-color: var(--bh-beige);
    background: var(--bh-beige);
    color: var(--bh-black);
    box-shadow: 0 2px 4px rgba(219, 200, 182, 0.4);
    font-weight: 600;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--bh-coral);
    box-shadow: 0 0 0 3px rgba(236, 103, 81, 0.1);
}

.lead-detail-section {
    background: var(--bh-beige-light);
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}

.lead-detail-section .card {
    background: var(--bh-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.leads-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-behavior: smooth;
}

.leads-grid::-webkit-scrollbar {
    height: 8px;
}

.leads-grid::-webkit-scrollbar-track {
    background: var(--bh-beige-light);
    border-radius: 4px;
}

.leads-grid::-webkit-scrollbar-thumb {
    background: var(--bh-taupe);
    border-radius: 4px;
}

.leads-grid::-webkit-scrollbar-thumb:hover {
    background: var(--bh-coral);
}

.lead-tile {
    min-width: 240px;
    max-width: 240px;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lead-tile:hover {
    border-color: var(--bh-coral);
    box-shadow: 0 4px 12px rgba(236, 103, 81, 0.2);
    transform: translateY(-2px);
}

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

.lead-tile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.3;
}

.lead-tile-info {
    font-size: 12px;
    color: var(--gray-600);
    margin: 3px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-tile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--gray-200);
}

.lead-tile-time {
    font-size: 11px;
    color: var(--gray-500);
}

.depot-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.depot-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    position: relative;
}

.depot-card:hover {
    border-color: var(--bh-coral);
    box-shadow: 0 4px 12px rgba(236, 103, 81, 0.2);
    transform: translateY(-2px);
}

.depot-image-container {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--gray-100);
}

.depot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.depot-card:hover .depot-image {
    transform: scale(1.05);
}

.depot-info {
    padding: 12px;
}

.depot-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.3;
}

.depot-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--bh-coral);
    margin: 0;
}

.depot-tax {
    font-size: 11px;
    font-weight: 400;
    color: var(--gray-600);
    display: block;
    margin-top: 2px;
}

.checkout-container {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.checkout-summary {
    margin-bottom: 24px;
}

.legal-notice {
    background: var(--gray-50);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--bh-coral);
    margin-bottom: 24px;
}

.legal-notice h4 {
    color: var(--gray-900);
    margin-bottom: 12px;
    font-size: 16px;
}

.legal-notice p {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.legal-notice ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.legal-notice li {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.8;
    padding-left: 24px;
    position: relative;
}

.legal-notice li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--bh-coral);
    font-weight: bold;
}

.signature-section {
    margin-bottom: 24px;
}

.signature-section h4 {
    color: var(--gray-900);
    font-size: 16px;
}

.signature-container {
    position: relative;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-canvas:hover {
    border-color: var(--bh-coral);
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 14px;
    }

    table th,
    table td {
        padding: 8px;
    }

    .depot-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .depot-image-container {
        height: 120px;
    }

    .checkout-container {
        padding: 20px;
    }
}

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