/* =====================================================
   ONBOARDING-CENTER - AVERRO WEBSITE DESIGN
   MOBILE OPTIMIZED - FIXED
   ===================================================== */

:root {
    --bg-primary: #0a0a0a;
    --bg-card: #111111;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    
    --pink: #FF3366;
    --yellow: #FFD700;
    --cyan: #06B6D4;
    --green: #22C55E;
    --blue: #3B82F6;
    --purple: #A855F7;
    --orange: #F97316;
    --red: #EF4444;
    
    --rainbow: linear-gradient(90deg, #EF4444, #F97316, #FFD700, #22C55E, #06B6D4, #3B82F6);
    
    --status-neue: #3B82F6;
    --status-chat: #A855F7;
    --status-gesendet: #F97316;
    --status-ausgefuellt: #06B6D4;
    --status-signed: #22C55E;
    --status-marketplace: #FF3366;
    
    --sidebar-width: 260px;
    --shadow-offset: 4px;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle, #333 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
}

body::before, body::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--rainbow);
    z-index: 9999;
}
body::before { top: 0; }
body::after { bottom: 0; }

/* LOGIN */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border: 3px solid var(--pink);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--pink);
    padding: 35px 25px;
    width: 100%;
    max-width: 400px;
}

.login-logo { text-align: center; margin-bottom: 25px; }
.login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--yellow);
    text-shadow: 3px 3px 0 var(--pink);
}
.login-logo p { color: var(--text-muted); font-size: 14px; margin-top: 5px; }
.error-text { color: var(--red); font-size: 14px; margin-top: 15px; text-align: center; }

/* LAYOUT */
.app { display: flex; min-height: 100vh; padding-top: 6px; padding-bottom: 6px; overflow-x: hidden; }
.hidden { display: none !important; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 3px solid var(--cyan);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 6px;
    left: 0;
    height: calc(100vh - 12px);
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 3px solid var(--cyan);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), transparent);
}
.sidebar-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--yellow);
    text-shadow: 2px 2px 0 var(--orange);
}
.user-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--cyan);
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid var(--cyan);
}

.sidebar-nav { flex: 1; padding: 15px 12px; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 2px solid transparent;
    margin-bottom: 6px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}
.nav-item svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--pink);
    color: var(--pink);
}
.nav-item.active {
    background: var(--pink);
    border-color: var(--pink);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 #000;
    color: white;
}
.sidebar-footer { padding: 15px; border-top: 3px solid var(--cyan); }

/* MOBILE MENU TOGGLE - IMMER SICHTBAR AUF MOBILE */
.menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 10px;
    z-index: 200;
    width: 50px;
    height: 50px;
    background: var(--pink);
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    color: white;
    font-size: 26px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* MAIN CONTENT */
.main-content { 
    flex: 1; 
    margin-left: var(--sidebar-width); 
    padding: 25px; 
    min-height: 100vh; 
    overflow-x: hidden;
}
.page { max-width: 1400px; margin: 0 auto; }
.page-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    flex-wrap: wrap;
    gap: 15px;
}
.page-header h1 { 
    font-size: 26px; 
    font-weight: 800; 
    color: var(--yellow); 
    text-shadow: 3px 3px 0 var(--orange); 
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    border: 3px solid #000;
    cursor: pointer;
    transition: all 0.1s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: var(--pink); color: white; box-shadow: var(--shadow-offset) var(--shadow-offset) 0 #000; }
.btn-primary:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.btn-secondary { background: var(--cyan); color: white; box-shadow: var(--shadow-offset) var(--shadow-offset) 0 #000; }
.btn-secondary:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.btn-danger { background: var(--red); color: white; box-shadow: var(--shadow-offset) var(--shadow-offset) 0 #000; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: #333; box-shadow: none; }
.btn-block { width: 100%; justify-content: center; }

/* FORMS */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 3px solid #333;
    color: var(--text-primary);
    font-size: 14px;
    -webkit-appearance: none;
    border-radius: 0;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 3px 3px 0 var(--yellow);
}
.form-group input:disabled { opacity: 0.6; cursor: not-allowed; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-section { margin-top: 25px; padding-top: 20px; border-top: 3px dashed #333; }
.form-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 15px; color: var(--pink); text-transform: uppercase; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 25px; padding-top: 20px; border-top: 3px dashed #333; flex-wrap: wrap; }
.checkbox-label { display: flex !important; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--pink); }

/* CARDS */
.card {
    background: var(--bg-card);
    border: 3px solid var(--cyan);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--cyan);
    padding: 20px;
    margin-bottom: 20px;
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 15px; color: var(--yellow); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 25px; }
.stat-card {
    background: var(--bg-card);
    border: 3px solid;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.stat-card:nth-child(1) { border-color: var(--blue); box-shadow: 4px 4px 0 var(--blue); }
.stat-card:nth-child(2) { border-color: var(--green); box-shadow: 4px 4px 0 var(--green); }
.stat-card:nth-child(3) { border-color: var(--purple); box-shadow: 4px 4px 0 var(--purple); }
.stat-card:nth-child(4) { border-color: var(--orange); box-shadow: 4px 4px 0 var(--orange); }
.stat-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #000;
    box-shadow: 2px 2px 0 #000;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; fill: white; }
.stat-icon.blue { background: var(--blue); }
.stat-icon.green { background: var(--green); }
.stat-icon.purple { background: var(--purple); }
.stat-icon.orange { background: var(--orange); }
.stat-content { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--yellow); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* DASHBOARD */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.status-bars { display: flex; flex-direction: column; gap: 12px; }
.status-bar { display: flex; align-items: center; gap: 12px; }
.status-bar-label { width: 140px; font-size: 12px; color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.status-bar-track { flex: 1; height: 24px; background: #222; border: 2px solid #333; min-width: 50px; }
.status-bar-fill { height: 100%; }
.status-bar-value { width: 35px; text-align: right; font-weight: 700; color: var(--yellow); font-size: 14px; }
.herkunft-list { display: flex; flex-direction: column; gap: 8px; }
.herkunft-item { display: flex; justify-content: space-between; padding: 12px 14px; background: #1a1a1a; border: 2px solid #333; font-size: 13px; }
.herkunft-item span:last-child { font-weight: 700; color: var(--pink); }

/* FILTER */
.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--text-muted); }
.search-box input { width: 100%; padding: 12px 14px 12px 42px; background: var(--bg-card); border: 3px solid #333; color: var(--text-primary); font-size: 14px; }
.search-box input:focus { outline: none; border-color: var(--yellow); }
.filter-select { padding: 12px 14px; background: var(--bg-card); border: 3px solid #333; color: var(--text-primary); font-size: 14px; min-width: 140px; }
.filter-select:focus { outline: none; border-color: var(--cyan); }

/* KANBAN */
.leads-kanban { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 12px; 
    overflow-x: auto; 
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}
.kanban-column { 
    background: var(--bg-card); 
    border: 3px solid; 
    min-width: 220px; 
    max-height: calc(100vh - 280px); 
    display: flex; 
    flex-direction: column; 
}
.kanban-column[data-status="neue_leads"] { border-color: var(--status-neue); }
.kanban-column[data-status="im_chat"] { border-color: var(--status-chat); }
.kanban-column[data-status="formular_gesendet"] { border-color: var(--status-gesendet); }
.kanban-column[data-status="formular_ausgefuellt"] { border-color: var(--status-ausgefuellt); }
.kanban-column[data-status="signed"] { border-color: var(--status-signed); }
.kanban-column[data-status="marketplace"] { border-color: var(--status-marketplace); }
.kanban-header { padding: 12px; border-bottom: 3px solid; display: flex; justify-content: space-between; align-items: center; }
.kanban-column[data-status="neue_leads"] .kanban-header { border-color: var(--status-neue); background: rgba(59, 130, 246, 0.1); }
.kanban-column[data-status="im_chat"] .kanban-header { border-color: var(--status-chat); background: rgba(168, 85, 247, 0.1); }
.kanban-column[data-status="formular_gesendet"] .kanban-header { border-color: var(--status-gesendet); background: rgba(249, 115, 22, 0.1); }
.kanban-column[data-status="formular_ausgefuellt"] .kanban-header { border-color: var(--status-ausgefuellt); background: rgba(6, 182, 212, 0.1); }
.kanban-column[data-status="signed"] .kanban-header { border-color: var(--status-signed); background: rgba(34, 197, 94, 0.1); }
.kanban-column[data-status="marketplace"] .kanban-header { border-color: var(--status-marketplace); background: rgba(255, 51, 102, 0.1); }
.kanban-header h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.kanban-count { background: #000; padding: 3px 10px; font-size: 11px; font-weight: 700; color: var(--yellow); border: 2px solid var(--yellow); }
.kanban-body { flex: 1; overflow-y: auto; padding: 10px; }
.lead-card { background: #1a1a1a; border: 2px solid #333; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.lead-card:hover { border-color: var(--pink); box-shadow: 3px 3px 0 var(--pink); transform: translate(-2px, -2px); }
.lead-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px; }
.lead-card-name { font-weight: 700; font-size: 13px; word-break: break-word; }
.lead-card-nummer { font-size: 9px; color: var(--yellow); background: #000; padding: 2px 6px; font-family: monospace; font-weight: 700; border: 1px solid var(--yellow); flex-shrink: 0; }
.lead-card-info { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.lead-card-info div { margin-bottom: 3px; }
.lead-card-status { width: 100%; padding: 8px; background: #000; border: 2px solid #444; color: var(--text-primary); font-size: 11px; font-weight: 600; }

/* IMPORT */
.import-zone { border: 3px dashed var(--cyan); padding: 40px 25px; text-align: center; cursor: pointer; background: rgba(6, 182, 212, 0.05); }
.import-zone:hover, .import-zone.dragover { border-color: var(--pink); background: rgba(255, 51, 102, 0.1); }
.import-zone svg { width: 50px; height: 50px; fill: var(--cyan); margin-bottom: 15px; }
.import-zone h3 { font-size: 18px; margin-bottom: 8px; color: var(--yellow); }
.import-zone p { color: var(--text-muted); font-size: 13px; }
.import-zone .hint { font-size: 11px; margin-top: 12px; }
.import-result { margin-top: 25px; padding: 15px; background: #1a1a1a; border: 2px solid var(--green); }
.import-result h3 { color: var(--green); font-size: 14px; }
.import-result li { color: var(--red); font-size: 12px; margin-bottom: 5px; }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px; text-align: left; border-bottom: 2px solid #333; font-size: 13px; }
.data-table th { font-size: 11px; font-weight: 700; color: var(--cyan); text-transform: uppercase; background: #1a1a1a; }
.data-table tr:hover td { background: rgba(255, 51, 102, 0.05); }
.data-table .actions { display: flex; gap: 8px; }

/* MODALS */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 15px; }
.modal-content { background: var(--bg-card); border: 4px solid var(--pink); box-shadow: 6px 6px 0 var(--pink); width: 100%; max-width: 500px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-large { max-width: 850px; }
.modal-small { max-width: 400px; }
.modal-header { padding: 15px 20px; border-bottom: 4px solid var(--pink); display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), transparent); }
.modal-header h2 { flex: 1; font-size: 16px; font-weight: 700; color: var(--yellow); }
.modal-close { width: 32px; height: 32px; background: var(--red); border: 3px solid #000; box-shadow: 2px 2px 0 #000; color: white; font-size: 18px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.modal-body { padding: 20px; overflow-y: auto; }
.lead-nummer-badge { background: var(--yellow); color: #000; padding: 5px 12px; font-size: 12px; font-family: monospace; font-weight: 700; border: 2px solid #000; }
.lead-nummer-input { font-family: monospace; font-size: 16px !important; font-weight: 700; color: var(--yellow) !important; letter-spacing: 2px; }
.vertrag-section { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vertrag-link { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); text-decoration: none; padding: 10px 14px; background: #1a1a1a; border: 2px solid var(--cyan); font-weight: 600; font-size: 13px; }
.vertrag-link:hover { background: var(--cyan); color: #000; }
.vertrag-link svg { width: 18px; height: 18px; fill: currentColor; }
.autosave-status { font-size: 12px; color: var(--green); margin-right: auto; font-weight: 600; }

/* TOAST */
.toast-container { position: fixed; top: 15px; right: 15px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100% - 30px); }
.toast { background: var(--bg-card); border: 3px solid; padding: 14px 18px; min-width: 280px; max-width: 100%; box-shadow: 4px 4px 0 #000; font-weight: 600; font-size: 13px; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.info { border-color: var(--cyan); color: var(--cyan); }

/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */

@media (max-width: 1400px) { 
    .leads-kanban { grid-template-columns: repeat(3, 1fr); } 
}

@media (max-width: 1200px) { 
    .stats-grid { grid-template-columns: repeat(2, 1fr); } 
    .dashboard-grid { grid-template-columns: 1fr; } 
}

@media (max-width: 992px) {
    .leads-kanban { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .menu-toggle { 
        display: flex !important; 
    }
    
    .sidebar { 
        transform: translateX(-100%); 
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content { 
        margin-left: 0 !important; 
        padding: 15px;
        padding-top: 75px;
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .leads-kanban { 
        grid-template-columns: 1fr; 
    }
    
    .kanban-column {
        max-height: none;
        min-width: 100%;
    }
    
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header h2 {
        font-size: 14px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .status-bar {
        flex-wrap: wrap;
    }
    
    .status-bar-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
        padding-top: 70px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .stat-icon {
        width: 38px;
        height: 38px;
    }
    
    .stat-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .login-box {
        padding: 25px 15px;
    }
    
    .login-logo h1 {
        font-size: 20px;
    }
}
