/* Apple-Style CSS Framework für Fahrzeugverleih Dashboard */

:root {
    --primary-color: #007AFF;
    --primary-hover: #0056CC;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #AEAEB2;
    --background: #F5F5F7;
    --surface: #FFFFFF;
    --surface-secondary: #F2F2F7;
    --border-color: #E5E5EA;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 32px;
}

.sidebar-logo svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--surface-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    max-width: 1400px;
}

/* Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-icon.blue {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.stat-icon.green {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.stat-icon.orange {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning-color);
}

.stat-icon.red {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
}

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

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    background: var(--surface-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

td {
    font-size: 14px;
    color: var(--text-primary);
}

tr:hover td {
    background: var(--surface-secondary);
}

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

/* Ausleihen Status-Zeilen */
tr.row-overdue td {
    background: rgba(255, 59, 48, 0.08);
}

tr.row-overdue:hover td {
    background: rgba(255, 59, 48, 0.15);
}

tr.row-warning td {
    background: rgba(255, 204, 0, 0.08);
}

tr.row-warning:hover td {
    background: rgba(255, 204, 0, 0.15);
}

tr.row-invalid td {
    background: rgba(255, 149, 0, 0.08);
}

tr.row-invalid:hover td {
    background: rgba(255, 149, 0, 0.15);
}

.badge.overdue {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger-color);
}

.badge.warning-status {
    background: rgba(255, 204, 0, 0.15);
    color: #997a00;
}

.badge.invalid-status {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning-color);
}

/* Dashboard List Item Status */
.list-item.list-item-overdue {
    background: rgba(255, 59, 48, 0.06);
    border-left: 3px solid var(--danger-color);
}

.list-item.list-item-warning {
    background: rgba(255, 204, 0, 0.06);
    border-left: 3px solid #ffcc00;
}

.list-item.list-item-invalid {
    background: rgba(255, 149, 0, 0.06);
    border-left: 3px solid var(--warning-color);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.available {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success-color);
}

.badge.rented {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning-color);
}

.badge.maintenance {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger-color);
}

.badge.kategorie-a {
    background: rgba(0, 122, 255, 0.15);
    color: var(--primary-color);
}

.badge.kategorie-b {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success-color);
}

.badge.kategorie-c {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-secondary);
    color: var(--text-primary);
}

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

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

.btn-danger:hover {
    background: #E0352B;
}

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

.btn-success:hover {
    background: #2DB350;
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--surface-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Search */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    padding-left: 44px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.list-item:hover {
    background: var(--surface-secondary);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--text-secondary);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.list-item-actions {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 24px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

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

    .page-title {
        font-size: 24px;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-actions .btn {
        width: 100%;
    }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 99;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Vehicle Card */
.vehicle-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.vehicle-card:hover {
    box-shadow: var(--shadow-md);
}

.vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.vehicle-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.vehicle-card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.vehicle-card-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.vehicle-detail {
    font-size: 13px;
}

.vehicle-detail-label {
    color: var(--text-tertiary);
}

.vehicle-detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Confirmation Dialog */
.confirm-dialog {
    text-align: center;
}

.confirm-dialog svg {
    width: 48px;
    height: 48px;
    color: var(--warning-color);
    margin-bottom: 16px;
}

.confirm-dialog h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.confirm-dialog p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}