/* =========================================
   1. GRUNDEINSTELLUNGEN & FARBEN
   ========================================= */
:root {
    /* DAS LOGO ORANGE (Kreativ Netzwerk) */
    --brand-orange: #F39200;  /* Satter, warmer Ton */
    
    /* Standard-Farben */
    --primary:     #007bff;
    --bg:          #f4f6f9;
    --card-bg:     #ffffff;
    --text:        #333333;
    --text-muted:  #666666;
    --border:      #dddddd;
    --input-bg:    #ffffff;
    --section-bg:  #f8f9fa;
    --shadow:      rgba(0, 0, 0, 0.1);
}

/* Dark Mode Farben */
body.dark-mode {
    --primary:     #4dabf7;
    --bg:          #121212;
    --card-bg:     #1e1e1e;
    --text:        #e0e0e0;
    --text-muted:  #aaaaaa;
    --border:      #333333;
    --input-bg:    #2d2d2d;
    --section-bg:  #252525;
    --shadow:      rgba(0, 0, 0, 0.5);
}

/* Grundlegendes Styling */
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}



.app-container { max-width: 1600px; margin: 0 auto; padding: 20px; }
.top-header { display: flex; align-items: center; margin-bottom: 25px; background: var(--card-bg); padding: 15px 25px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.panel { background: var(--card-bg); padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px var(--shadow); margin-bottom: 20px; border: 1px solid var(--border); }
.layout { display: flex; gap: 20px; align-items: flex-start; }
.col-left { flex: 0 0 400px; } .col-right { flex: 1; }
.app-input { width: 100%; padding: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); border-radius: 4px; box-sizing: border-box; margin-bottom: 10px; }
.btn-primary { background: var(--primary); color: white; padding: 10px; border: none; border-radius: 4px; cursor: pointer; width: 100%; font-weight: bold; }

/* =========================================
   8. LOGIN STYLE (LOGO FARBEN)
   ========================================= */
.auth-wrapper { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    /* Das ist dein Logo-Blau (Verlauf von Hell nach etwas dunkler) */
    background: linear-gradient(135deg, #89CFF0 0%, #5CA8E6 100%);
}

.auth-card { 
    background: white; 
    padding: 2.5rem; 
    border-radius: 12px; 
    /* Ein weicherer Schatten passend zum hellen Blau */
    box-shadow: 0 10px 30px rgba(92, 168, 230, 0.4); 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
}

/* Optional: Auch den Button an das Logo-Blau anpassen */
.auth-card .btn-primary {
    background: #5CA8E6; 
    border: none;
    transition: background 0.3s;
}
.auth-card .btn-primary:hover {
    background: #4a90e2; /* Etwas dunkler beim Drüberfahren */
}
.input-wrapper { position: relative; display: flex; align-items: center; margin-bottom: 15px;} .input-wrapper input { padding-left: 35px; } .input-icon { position: absolute; left: 10px; color: #999; z-index: 2; }


/* Draggable & Header */
#draggable-panel { position: relative; z-index: 10; transition: box-shadow 0.3s; }
#draggable-panel.dragging { position: absolute; z-index: 999; box-shadow: 0 20px 50px rgba(0,0,0,0.5); opacity: 0.95; }
.drag-header { cursor: move; display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 15px; user-select: none; }
.panel-search-wrapper { display: flex; gap: 10px; align-items: center; margin-right: 15px; }
.panel-search { padding: 5px 10px; border: 1px solid var(--border); border-radius: 20px; background: var(--input-bg); color: var(--text); font-size: 0.9rem; width: 150px; transition: width 0.3s; }
.panel-search:focus { width: 220px; border-color: var(--primary); outline: none; }

.view-switcher { display: flex; gap: 5px; }
.view-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--section-bg); color: var(--text); font-size: 0.9rem; cursor: pointer; }
.view-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; table-layout: fixed; }
th { text-align: left; padding: 12px 8px; background: var(--section-bg); border-bottom: 2px solid var(--border); border-right: 1px solid var(--border); position: relative; color: var(--text); }
td { padding: 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.resizer { position: absolute; right: 0; top: 0; height: 100%; width: 5px; cursor: col-resize; user-select: none; touch-action: none; }

.badge { padding: 3px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: bold; color:white; }
.bg-red { background: #dc3545; } .bg-blue { background: #0d6efd; } .bg-green { background: #198754; } .bg-yellow { background: #ffc107; color: #333; }
.row { display: flex; gap: 10px; } .col { flex: 1; }
.suggestion-box { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; } .sugg-btn { background: var(--section-bg); border: 1px solid var(--border); padding: 5px 10px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; color:var(--text); }
.folder-tabs { display: flex; gap: 5px; border-bottom: 2px solid var(--border); padding-bottom: 10px; margin-bottom: 15px; overflow-x: auto; }
.folder-tab { padding: 8px 15px; border-radius: 20px; font-size: 0.9rem; text-decoration: none; color: var(--text); background: var(--section-bg); white-space: nowrap; } .folder-tab.active { background: var(--primary); color: white; }
#reset-btn { position: fixed; bottom: 15px; right: 15px; background: #dc3545; color: white; padding: 10px; border-radius: 50px; font-weight: bold; font-size: 0.75rem; border: 2px solid white; text-decoration:none; }
.panel-toggle { cursor: pointer; font-size: 1.1rem; padding: 5px 10px; border-radius: 4px; background: var(--section-bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin-right: 10px; color: var(--text); }
.modal-action-btn { display:inline-block; padding:8px 15px; background: var(--section-bg); border:1px solid var(--border); border-radius:20px; text-decoration:none; color: var(--text); font-size:0.85rem; margin-right:5px; font-weight: 500; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.lead-card { background: var(--section-bg); border: 1px solid var(--border); border-radius: 8px; padding: 15px; position: relative; }
.lead-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-color: var(--primary); }
.tree-folder { margin-bottom: 15px; } .tree-item { background: var(--section-bg); padding: 8px 12px; border-radius: 4px; border: 1px solid var(--border); display: flex; justify-content: space-between; margin-bottom: 5px; margin-left: 20px; }
.startup-links { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.radar-btn { display: block; padding: 8px; text-align: center; border-radius: 6px; text-decoration: none; font-size: 0.9rem; font-weight: bold; transition: 0.2s; border: 1px solid transparent; }
.radar-btn.nd { background: #1a237e; color: white; } .radar-btn.nd:hover { opacity: 0.9; }
.radar-btn.gn { background: #ea4335; color: white; } .radar-btn.gn:hover { opacity: 0.9; }
.radar-btn.hr { background: #2e7d32; color: white; } .radar-btn.hr:hover { opacity: 0.9; }
.trash-btn { color: #dc3545; cursor: pointer; font-size: 1.1rem; margin-left: 10px; transition: color 0.2s; } .trash-btn:hover { color: #a71d2a; }


/* --- MARKIERUNGEN IM LOGO-LOOK --- */

/* 1. Scanner: Die Karte leuchtet */
.lead-card.scanner-active {
    border: 4px solid var(--brand-orange) !important;
    /* Hintergrund passend zum Logo-Orange (leicht transparent) */
    background-color: rgba(243, 146, 0, 0.1) !important; 
    box-shadow: 0 0 25px rgba(243, 146, 0, 0.4) !important;
    transform: scale(1.02); 
    z-index: 10;
    transition: all 0.3s ease;
}

/* 2. CRM Liste: Der linke Balken */
.active-lead {
    border-left: 8px solid var(--brand-orange) !important;
    background-color: rgba(243, 146, 0, 0.08) !important;
    transition: all 0.3s ease;
}

/* --- FIXES FÜR ANSICHTEN --- */

/* Kacheln (Mittlerer Button) hübscher machen */
.lead-card .btn-primary {
    width: auto !important;       
    display: inline-block;
    padding: 5px 15px;            
    font-size: 0.85rem;           
    margin-right: 5px;
}

/* Icons in der Action-Spalte und Cards nicht so riesig */
.lead-card i, .table i { font-size: 1rem; }

/* Baum-Struktur (Rechter Button) Styling */
.tree-container { display: flex; flex-direction: column; gap: 15px; }
.tree-folder { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.tree-folder h4 { margin: 0 0 10px 0; font-size: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 5px; color: var(--primary); }
.tree-list { padding-left: 10px; }
.tree-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--section-bg); font-size: 0.9rem; }


/* Google Button Style */
.btn-google {
    display: inline-flex; align-items: center; gap: 6px; background-color: #fff; color: #3c4043;
    border: 1px solid #dadce0; border-radius: 4px; padding: 6px 12px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: all 0.2s;
}
.btn-google:hover { background-color: #f1f3f4; border-color: #dadce0; box-shadow: 0 1px 2px rgba(60,64,67,0.1); color: #202124; }
.btn-google i { color: #4285f4; }
body.dark-mode .btn-google { background-color: #303134; color: #e8eaed; border-color: #5f6368; }
body.dark-mode .btn-google:hover { background-color: #3c4043; }


/* --- LÖSCHEN FENSTER (CONFIRM MODAL) --- */
/* Nur diese Buttons bekommen das große Padding */
.confirm-actions .btn-cancel,
.confirm-actions .btn-delete {
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    color: white;
}
.confirm-actions .btn-cancel { background: #6c757d; }
.confirm-actions .btn-delete { background: #dc3545; }
.confirm-actions .btn-cancel:hover { background: #5a6268; }
.confirm-actions .btn-delete:hover { background: #c82333; }


/* --- EDITIERBARE TITEL & LOGS (Repariert) --- */

/* 1. Der Titel oben (sieht aus wie Text, ist aber editierbar) */
.title-input {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 5px 10px;
    width: 100%;
    transition: all 0.2s;
    box-sizing: border-box;
}
.title-input:hover { border-color: var(--border); background: rgba(255, 255, 255, 0.05); }
.title-input:focus { border-color: var(--primary); background: var(--bg); outline: none; box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); }

/* 2. Die Historien-Einträge (Aufgeräumtes Grid-Layout) */
.history-item-form {
    display: grid;
    /* Spalten: Datum/User (150px) | Text (Flexibel) | Buttons (Auto) */
    grid-template-columns: 150px 1fr auto; 
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    align-items: start;
    transition: background 0.2s;
}
.history-item-form:hover { background: rgba(255, 255, 255, 0.02); }

/* Der Textbereich in der Historie */
.history-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}
.history-input:focus { border-color: var(--primary); outline: none; }

/* Die kleinen Buttons (Diskette & Mülleimer) */
.history-actions { display: flex; flex-direction: column; gap: 5px; }

/* WICHTIG: Spezifische Styles für die Mini-Buttons, damit sie nicht die großen Styles erben */
.btn-mini {
    width: 32px;
    height: 32px;
    padding: 0; /* Verhindert das Aufblähen durch Padding */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}
.btn-mini:hover { transform: translateY(-1px); color: white; border-color: transparent; }
.btn-mini i { font-size: 0.9rem; }

/* Farben nur beim Hovern für Mini Buttons */
.btn-save:hover { background-color: #28a745; box-shadow: 0 2px 5px rgba(40,167,69,0.3); }
.btn-delete:hover { background-color: #dc3545; box-shadow: 0 2px 5px rgba(220,53,69,0.3); }


/* --- FIX: Modal Fenster (Kompakt, Scrollbar & Layout) --- */
.modal-content {
    /* Breite: Kompakter (maximal 900px statt 1100px) */
    width: 90% !important; 
    max-width: 900px !important; 
    
    /* Höhe: Maximal 85% des Bildschirms, sonst Scrollbalken */
    max-height: 85vh !important;
    overflow-y: auto !important; 
    
    /* Positionierung: Mittig mit Abstand */
    margin: 5vh auto !important;
    
    /* Optik */
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
    border-radius: 12px !important;
    padding: 25px !important;
    background-color: var(--card-bg) !important;
    color: var(--text);
    position: relative;
}

/* Scrollbalken im Fenster hübsch machen */
.modal-content::-webkit-scrollbar { width: 8px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: #888; }

/* Grid für das Modal-Innere */
.crm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* =========================================
   9. LOGIN FELDER (LOGO STYLE)
   ========================================= */

/* Die Eingabefelder: Hellgrau & Schwarzer Text */
.auth-card .app-input {
    background-color: #f2f4f6 !important; /* Das Hellgrau aus dem Logo */
    color: #333333 !important;             /* Text: Schwarz */
    border: 1px solid #e0e0e0 !important;  /* Dezenter Rahmen */
    font-weight: 500;
}

/* Wenn man in das Feld klickt */
.auth-card .app-input:focus {
    background-color: #ffffff !important;  /* Wird weiß beim Tippen */
    border-color: #5CA8E6 !important;      /* Rahmen in Logo-Blau */
    color: #000000 !important;
}

/* Die Icons (Briefumschlag/Schloss): Dunkelgrau/Schwarz */
.auth-card .input-icon {
    color: #444444 !important;             /* Gut sichtbar auf Hellgrau */
}

/* Der Platzhalter-Text (z.B. "E-Mail") */
.auth-card .app-input::placeholder {
    color: #888888 !important;
}