/* Modern Dashboard Design - Einsatzplanung */

/* Reset und Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, #ffffff 0%, #bab2c2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation - Modern Glassmorphism */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand a:before {
    content: "📊";
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Dashboard Header */
.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.date-range {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Stats Grid - Modern Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: hidden;
}

.stat-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.stat-card:hover:before {
    width: 8px;
}

.stat-card.stat-primary:before { background: var(--primary); }
.stat-card.stat-success:before { background: var(--success); }
.stat-card.stat-warning:before { background: var(--warning); }
.stat-card.stat-info:before { background: var(--info); }
.stat-card.stat-secondary:before { background: var(--secondary); }

.stat-icon {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-percentage {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
    margin-top: 0.5rem;
}

/* Dashboard Row */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.dashboard-card h2 {
    color: var(--dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 0.75rem;
}

.card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header-with-action h2 {
    margin: 0;
    border: none;
    padding: 0;
}

/* Service Type List */
.service-type-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.service-type-item {
    padding-bottom: 0.5rem;
}

.service-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.service-type-name {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.1rem;
}

.service-type-rate {
    font-weight: 800;
    font-size: 1.5rem;
}

.service-type-rate.rate-good { color: var(--success); }
.service-type-rate.rate-medium { color: var(--warning); }
.service-type-rate.rate-low { color: var(--danger); }

.progress-bar {
    height: 12px;
    background: var(--light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    height: 100%;
    transition: width 0.6s ease;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--success), var(--info));
}

.progress-fill.progress-good {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.progress-fill.progress-medium {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.progress-fill.progress-low {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.service-type-stats {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Top Employees List */
.top-employees-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.employee-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.employee-item:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    transform: translateX(4px);
}

.employee-rank {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    min-width: 3rem;
    text-align: center;
}

.employee-info {
    flex: 1;
}

.employee-name {
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.employee-name:hover {
    color: var(--primary);
}

.employee-stats {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Appointments Table */
.appointments-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

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

thead {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

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

.time-cell {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    font-size: 1.1rem;
}

.address-cell {
    font-size: 0.875rem;
    color: var(--text-light);
}

.employee-cell {
    font-size: 0.9rem;
}

.text-muted {
    color: var(--text-light);
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-style: italic;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-planned {
    background: linear-gradient(135deg, #fef3c7, #fde047);
    color: #92400e;
}

.status-confirmed {
    background: linear-gradient(135deg, #d1fae5, #34d399);
    color: #065f46;
}

.status-completed {
    background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
    color: #3730a3;
}

.status-cancelled {
    background: linear-gradient(135deg, #fee2e2, #fca5a5);
    color: #991b1b;
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    border-color: var(--primary);
}

.action-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.action-label {
    color: var(--dark);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

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

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

.btn-secondary:hover {
    background: var(--light);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Employee Grid & Cards */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.employee-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.employee-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.employee-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 700;
}

.employee-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.filter-section label {
    margin-right: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.filter-section input,
.filter-section select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-right: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.page-header h1 {
    color: var(--dark);
    font-weight: 800;
    font-size: 2rem;
}

/* Employee Details */
.employee-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.detail-card h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Week Navigation */
.week-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* Schedule Week */
.schedule-week {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.day-schedule {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.day-schedule:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.day-schedule h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary);
    font-weight: 700;
}

.no-appointments {
    color: var(--text-light);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

/* Appointments */
.appointments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-card {
    border-left: 4px solid var(--primary);
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.appointment-card:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    transform: translateX(4px);
}

.appointment-time {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.appointment-time .duration {
    font-weight: normal;
    color: var(--text-light);
    font-size: 0.875rem;
}

.appointment-details {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
}

.appointment-details small {
    color: var(--text-light);
}

.appointment-status {
    margin-top: 0.75rem;
}

.day-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .schedule-week,
    .dashboard-row {
        grid-template-columns: 1fr;
    }

    .week-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .nav-menu {
        flex-wrap: wrap;
    }
}

/* Customers Overview */
.customers-list {
    margin-top: 1.5rem;
}

.customers-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.customers-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
}

.customers-card-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark);
}

.customers-subtitle {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.customers-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.customers-count {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(99,102,241,0.1);
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 600;
}

.customers-table-wrapper {
    max-height: calc(100vh - 260px);
    overflow: auto;
}

.customers-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.customers-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.customers-table th {
    background: linear-gradient(135deg, rgba(99,102,241,0.95), rgba(139,92,246,0.95));
    padding: 0.9rem 1.5rem;
    font-size: 0.8rem;
}

.customers-table td {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(148,163,184,0.4);
}

.customers-table tbody tr:nth-child(odd) {
    background: rgba(15,23,42,0.02);
}

.customers-table tbody tr:nth-child(even) {
    background: rgba(15,23,42,0.05);
}

.customers-table tbody tr:hover {
    background: rgba(255,255,255,0.9);
}

.customer-name-cell .customer-name {
    font-weight: 600;
    color: #0f172a;
}

.customer-address-cell {
    min-width: 260px;
}

.customer-contact-cell {
    white-space: nowrap;
}

.customer-actions-cell {
    text-align: right;
    width: 1%;
}

.care-level-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .customers-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .customers-table-wrapper {
        max-height: none;
    }

    .customers-table th:nth-child(2),
    .customers-table td:nth-child(2) {
        display: none;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.dashboard-card,
.employee-card,
.action-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .navbar,
    .quick-actions,
    .btn {
        display: none;
    }

    .dashboard-card,
    .stat-card {
        box-shadow: none;
        border: 1px solid var(--border);
        break-inside: avoid;
    }
}
