/* STH-Service Vermietsoftware - Stylesheet */

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==================== NAVIGATION ==================== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.nav-brand i {
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-links a {
    padding: 20px 15px;
    color: #555;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #667eea;
    border-bottom-color: #667eea;
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user span:first-child {
    font-weight: 500;
}

/* ==================== MAIN LAYOUT ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 150px);
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-size: 28px;
    color: #333;
}

.page-header h1 i {
    color: #667eea;
    margin-right: 10px;
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.card-header h2 i {
    color: #667eea;
    margin-right: 8px;
}

.card-body {
    padding: 20px;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-info {
    background: #3498db;
    color: white;
}

.btn-info:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Fixed role badges with proper contrast */
.badge-admin { background: #e74c3c; color: white; }
.badge-disponent { background: #f39c12; color: white; }
.badge-fahrer { background: #3498db; color: white; }

/* ==================== TABLES ==================== */
.table-responsive {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-hover tbody tr {
    transition: background 0.2s;
}

.text-center {
    text-align: center;
}

.empty-state {
    color: #888;
    padding: 40px;
    font-style: italic;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #eafaf1;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.alert-danger {
    background: #fdedec;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.alert-warning {
    background: #fef9e7;
    color: #f39c12;
    border-left: 4px solid #f39c12;
}

.alert-info {
    background: #eaf2f8;
    color: #3498db;
    border-left: 4px solid #3498db;
}

.alert .close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

.alert .close:hover {
    opacity: 1;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[required],
.form-group textarea[required],
.form-group select[required] {
    border-left: 3px solid #667eea;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.active {
        max-height: 500px;
    }

    .nav-links a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .menu-toggle {
        display: block !important;
        position: absolute;
        right: 20px;
        top: 15px;
    }

    .container {
        padding: 15px;
    }

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

    .page-header h1 {
        font-size: 22px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* ==================== UTILITY ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

/* ==================== MOBILE MENU ==================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #667eea;
    cursor: pointer;
    padding: 5px 10px;
}

/* ==================== STATUS BADGES FOR ORDERS ==================== */
.badge-reserviert { background: #9b59b6; color: white; }
.badge-aktiv { background: #3498db; color: white; }
.badge-abgeschlossen { background: #27ae60; color: white; }
.badge-storniert { background: #7f8c8d; color: white; }

/* ==================== TRANSPORT STATUS ==================== */
.status-select.status-geplant { background: #fef9e7; border-color: #f39c12; }
.status-select.status-unterwegs { background: #e8f4fd; border-color: #3498db; }
.status-select.status-abgeschlossen { background: #eafaf1; border-color: #27ae60; }

/* ==================== LINKABLE ROWS ==================== */
.table tbody tr.clickable {
    cursor: pointer;
}

.table tbody tr.clickable:hover {
    background: #e8f4fd;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* ==================== DROPDOWN MENU ==================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #666;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.dropdown-toggle:hover,
.dropdown-toggle.active {
    background: #f0f0f0;
    color: #667eea;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: #f8f9fa;
    color: #667eea;
}

.dropdown-menu a i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
}

/* Mobile Dropdown */
@media (max-width: 768px) {
    .dropdown {
        width: 100%;
    }
    
    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: #f8f9fa;
        padding-left: 20px;
    }
}


/* Dashboard Badge Ergänzungen */
.badge-info {
    background: #3498db;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

/* KPI Card Hover für Anker-Tags */

/* ==================== KPI CARDS ==================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #ddd;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-info .kpi-icon {
    background: #e3f2fd;
    color: #1976d2;
}

.kpi-info {
    border-left-color: #1976d2;
}

.kpi-success .kpi-icon {
    background: #e8f5e9;
    color: #388e3c;
}

.kpi-success {
    border-left-color: #388e3c;
}

.kpi-warning .kpi-icon {
    background: #fff3e0;
    color: #f57c00;
}

.kpi-warning {
    border-left-color: #f57c00;
}

.kpi-danger .kpi-icon {
    background: #ffebee;
    color: #d32f2f;
}

.kpi-danger {
    border-left-color: #d32f2f;
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.kpi-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}
a.kpi-card {
    text-decoration: none;
    color: inherit;
}

a.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Clickable Rows */
.clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}

.clickable-row:hover {
    background: #f8f9fa;
}

/* Badge mit Icons */
.badge i {
    margin-right: 4px;
}

/* ==================== CATEGORY GRID ==================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.category-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    text-align: center;
}

.category-count {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

/* FontAwesome Icon Fallbacks */
.fa-hand-holding-box:before,
.fa-hand-holding:before {
    content: "\f4be";
}
