/**
 * Leadful Prospecting - Frontend Dashboard CSS
 * Modernes Kanban-Style Dashboard
 */

/* ===== Variables ===== */
:root {
    --lp-primary: #2271b1;
    --lp-primary-dark: #135e96;
    --lp-success: #00a32a;
    --lp-warning: #dba617;
    --lp-danger: #d63638;
    --lp-gray-100: #f6f7f7;
    --lp-gray-200: #e0e0e0;
    --lp-gray-300: #c3c4c7;
    --lp-gray-500: #787c82;
    --lp-gray-700: #3c434a;
    --lp-gray-900: #1d2327;
    --lp-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --lp-shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --lp-radius: 8px;
    --lp-radius-sm: 4px;
}

/* ===== Base ===== */
.lp-dashboard,
.lp-termine {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--lp-gray-900);
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Login Required ===== */
.lp-login-required {
    text-align: center;
    padding: 40px;
    background: var(--lp-gray-100);
    border-radius: var(--lp-radius);
    color: var(--lp-gray-500);
}

/* ===== Dashboard Header ===== */
.lp-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--lp-gray-200);
}

.lp-dashboard-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--lp-gray-900);
    margin: 0;
}

/* ===== Buttons ===== */
.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--lp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--lp-gray-200);
    color: var(--lp-gray-700);
}

.lp-btn:hover {
    background: var(--lp-gray-300);
}

.lp-btn-primary {
    background: var(--lp-primary);
    color: #fff;
}

.lp-btn-primary:hover {
    background: var(--lp-primary-dark);
    color: #fff;
}

.lp-btn-small {
    padding: 4px 10px;
    font-size: 13px;
}

/* ===== Filter Bar ===== */
.lp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: var(--lp-gray-100);
    border-radius: var(--lp-radius);
    margin-bottom: 20px;
}

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

.lp-filter-group label {
    font-weight: 500;
    color: var(--lp-gray-700);
}

.lp-filter-group select,
.lp-filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--lp-gray-300);
    border-radius: var(--lp-radius-sm);
    font-size: 14px;
    min-width: 150px;
}

.lp-filter-group select:focus,
.lp-filter-group input:focus {
    outline: none;
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.lp-stats {
    margin-left: auto;
    display: flex;
    gap: 20px;
}

.lp-stat {
    color: var(--lp-gray-500);
    font-size: 13px;
}

.lp-stat strong {
    color: var(--lp-gray-900);
}

/* ===== Kanban Board ===== */
.lp-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* 4 Spalten Kanban */
.lp-kanban.lp-kanban-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

@media (max-width: 768px) {
    .lp-kanban,
    .lp-kanban.lp-kanban-4 {
        grid-template-columns: 1fr;
    }
}

/* ===== Kanban Column ===== */
.lp-kanban-column {
    background: var(--lp-gray-100);
    border-radius: var(--lp-radius);
    min-height: 400px;
}

.lp-kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: var(--lp-radius) var(--lp-radius) 0 0;
    border-bottom: 3px solid;
}

.lp-kanban-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.lp-kanban-header .lp-count {
    background: rgba(255,255,255,0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* Status Colors */
.lp-status-entry {
    background: #3498db;
    border-color: #2980b9;
}

.lp-status-qualifizierung {
    background: #f39c12;
    border-color: #d68910;
}

.lp-status-termin {
    background: #27ae60;
    border-color: #1e8449;
}

.lp-kanban-cards {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

/* ===== Lead Card ===== */
.lp-card {
    background: #fff;
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow);
    transition: all 0.2s ease;
}

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

.lp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--lp-gray-100);
}

.lp-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--lp-gray-900);
    word-break: break-word;
}

.lp-card-menu {
    position: relative;
}

.lp-card-menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    color: var(--lp-gray-500);
    line-height: 1;
}

.lp-card-menu-btn:hover {
    color: var(--lp-gray-900);
}

.lp-card-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: var(--lp-radius-sm);
    box-shadow: var(--lp-shadow-lg);
    min-width: 140px;
    z-index: 100;
    overflow: hidden;
}

.lp-card-dropdown a {
    display: block;
    padding: 10px 15px;
    color: var(--lp-gray-700);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.lp-card-dropdown a:hover {
    background: var(--lp-gray-100);
}

.lp-card-body {
    padding: 10px 12px;
}

.lp-card-location,
.lp-card-contact,
.lp-card-branche,
.lp-card-termin {
    font-size: 12px;
    color: var(--lp-gray-500);
    margin-bottom: 4px;
}

.lp-card-termin {
    color: var(--lp-primary);
    font-weight: 500;
}

.lp-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--lp-gray-100);
    background: var(--lp-gray-100);
    border-radius: 0 0 var(--lp-radius) var(--lp-radius);
}

.lp-action-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: var(--lp-radius-sm);
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    color: var(--lp-gray-700);
    transition: all 0.2s;
}

.lp-action-btn:hover {
    background: var(--lp-primary);
    color: #fff;
}

.lp-action-call:hover {
    background: var(--lp-success);
}

.lp-action-next {
    background: var(--lp-primary);
    color: #fff;
    font-weight: 600;
}

.lp-action-next:hover {
    background: var(--lp-primary-dark);
}

/* ===== Empty State ===== */
.lp-empty-state {
    text-align: center;
    padding: 30px;
    color: var(--lp-gray-500);
    font-style: italic;
}

/* ===== Verloren Section ===== */
.lp-verloren-section {
    margin-top: 20px;
}

.lp-verloren-toggle {
    width: 100%;
    padding: 12px 20px;
    background: var(--lp-gray-100);
    border: 1px solid var(--lp-gray-200);
    border-radius: var(--lp-radius);
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--lp-gray-500);
}

.lp-verloren-toggle:hover {
    background: var(--lp-gray-200);
}

.lp-verloren-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
    background: var(--lp-gray-100);
    border-radius: 0 0 var(--lp-radius) var(--lp-radius);
    margin-top: -5px;
}

.lp-verloren-list .lp-card {
    opacity: 0.7;
}

/* ===== Modal ===== */
.lp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lp-modal-content {
    background: #fff;
    border-radius: var(--lp-radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--lp-shadow-lg);
}

.lp-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--lp-gray-500);
    line-height: 1;
}

.lp-modal-close:hover {
    color: var(--lp-gray-900);
}

#lp-modal-body {
    padding: 30px;
}

.lp-modal-header {
    border-bottom: 2px solid var(--lp-primary);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.lp-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--lp-primary);
}

.lp-modal-section {
    margin-bottom: 20px;
}

.lp-modal-section h3 {
    font-size: 14px;
    color: var(--lp-gray-500);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.lp-modal-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 15px;
}

.lp-modal-label {
    font-weight: 500;
    color: var(--lp-gray-700);
}

.lp-modal-value {
    color: var(--lp-gray-900);
}

.lp-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--lp-gray-200);
}

/* ===== Termine ===== */
.lp-termine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--lp-gray-200);
}

.lp-termine-header h1 {
    font-size: 24px;
    margin: 0;
}

.lp-termine-nav {
    display: flex;
    gap: 10px;
}

.lp-termine-day {
    margin-bottom: 25px;
}

.lp-termine-date {
    font-size: 16px;
    font-weight: 600;
    color: var(--lp-gray-700);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--lp-gray-200);
}

.lp-termin-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow);
    margin-bottom: 10px;
    transition: all 0.2s;
}

.lp-termin-row:hover {
    box-shadow: var(--lp-shadow-lg);
}

.lp-termin-time {
    font-size: 18px;
    font-weight: 600;
    color: var(--lp-primary);
    min-width: 60px;
}

.lp-termin-info {
    flex: 1;
}

.lp-termin-info strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.lp-termin-contact,
.lp-termin-location {
    font-size: 13px;
    color: var(--lp-gray-500);
    margin-right: 15px;
}

.lp-termin-actions {
    display: flex;
    gap: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .lp-dashboard,
    .lp-termine {
        padding: 10px;
    }
    
    .lp-dashboard-header,
    .lp-termine-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .lp-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .lp-filter-group {
        width: 100%;
    }
    
    .lp-filter-group select,
    .lp-filter-group input {
        width: 100%;
    }
    
    .lp-stats {
        margin-left: 0;
        flex-direction: column;
        gap: 5px;
    }
    
    .lp-termin-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lp-termin-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===== Loading State ===== */
.lp-loading {
    text-align: center;
    padding: 30px;
}

.lp-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--lp-gray-200);
    border-top-color: var(--lp-primary);
    border-radius: 50%;
    animation: lp-spin 0.8s linear infinite;
}

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

/* ===== Notification Toast ===== */
.lp-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--lp-gray-900);
    color: #fff;
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow-lg);
    z-index: 10001;
    animation: lp-slide-in 0.3s ease;
}

.lp-toast-success {
    background: var(--lp-success);
}

.lp-toast-error {
    background: var(--lp-danger);
}

.lp-toast-info {
    background: #3498db;
}

@keyframes lp-slide-in {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== Lead Form ===== */
.lp-lead-form-container {
    max-width: 1000px;
    margin: 0 auto;
}

.lp-form-header {
    margin-bottom: 25px;
}

.lp-back-link {
    display: inline-block;
    color: var(--lp-primary);
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
}

.lp-back-link:hover {
    text-decoration: underline;
}

.lp-form-header h1 {
    font-size: 24px;
    margin: 0;
    color: var(--lp-gray-900);
}

.lp-form {
    background: #fff;
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow);
    padding: 25px;
}

.lp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .lp-form-grid {
        grid-template-columns: 1fr;
    }
}

.lp-form-section {
    background: var(--lp-gray-100);
    padding: 20px;
    border-radius: var(--lp-radius);
}

.lp-form-section h2 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: var(--lp-gray-700);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-form-section.lp-form-full {
    margin-top: 20px;
}

.lp-field {
    margin-bottom: 15px;
}

.lp-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--lp-gray-700);
    margin-bottom: 5px;
}

.lp-field input,
.lp-field select,
.lp-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lp-gray-300);
    border-radius: var(--lp-radius-sm);
    font-size: 14px;
    box-sizing: border-box;
}

.lp-field input:focus,
.lp-field select:focus,
.lp-field textarea:focus {
    outline: none;
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.lp-field textarea {
    resize: vertical;
    min-height: 80px;
}

.lp-field-row {
    display: flex;
    gap: 15px;
}

.lp-field-row .lp-field {
    flex: 1;
}

.lp-field-row .lp-field.lp-field-small {
    flex: 0 0 100px;
}

.lp-field-row .lp-field.lp-field-large {
    flex: 2;
}

.lp-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--lp-gray-200);
    flex-wrap: wrap;
}

.lp-btn-large {
    padding: 12px 24px;
    font-size: 15px;
}

.lp-error {
    background: #fff5f5;
    border: 1px solid var(--lp-danger);
    color: var(--lp-danger);
    padding: 15px;
    border-radius: var(--lp-radius);
    text-align: center;
}

/* ===== Report Ansicht ===== */
.lp-report {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lp-report-header {
    margin-bottom: 20px;
}

.lp-report-header h1 {
    font-size: 24px;
    margin: 0 0 5px 0;
    color: var(--lp-gray-900);
}

.lp-report-subtitle {
    color: var(--lp-gray-500);
    font-size: 14px;
}

.lp-count-badge {
    display: inline-block;
    background: var(--lp-primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

/* Filter Bar */
.lp-filter-form {
    margin-bottom: 20px;
}

.lp-filter-bar {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: var(--lp-gray-100);
    padding: 15px 20px;
    border-radius: var(--lp-radius);
}

.lp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lp-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--lp-gray-600);
}

.lp-filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--lp-gray-300);
    border-radius: var(--lp-radius-sm);
    font-size: 14px;
    min-width: 180px;
    background: #fff;
}

.lp-filter-group select:focus {
    outline: none;
    border-color: var(--lp-primary);
}

.lp-filter-actions {
    margin-left: auto;
}

/* Report Tabelle */
.lp-report-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow);
}

.lp-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.lp-report-table thead {
    background: var(--lp-gray-100);
}

.lp-report-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--lp-gray-700);
    border-bottom: 2px solid var(--lp-gray-200);
    white-space: nowrap;
}

.lp-report-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--lp-gray-200);
    color: var(--lp-gray-700);
}

.lp-report-table tbody tr:hover {
    background: var(--lp-gray-50);
}

.lp-report-table tbody tr:last-child td {
    border-bottom: none;
}

.lp-table-actions {
    white-space: nowrap;
}

.lp-table-actions .lp-btn-small {
    margin-right: 5px;
}

.lp-empty-state {
    text-align: center;
    color: var(--lp-gray-400);
    padding: 40px !important;
    font-style: italic;
}

.lp-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .lp-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .lp-filter-group select {
        width: 100%;
    }
    
    .lp-filter-actions {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .lp-filter-actions .lp-btn {
        width: 100%;
    }
}
