﻿/* ========================================
   Custom Styles für COM System
   ======================================== */

/* ========================================
   GLOBAL STYLES
   ======================================== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
    color: #333;
    background-color: #f5f5f5;
}

main {
    min-height: calc(100vh - 200px);
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

    .navbar-brand i {
        margin-right: 8px;
    }

.nav-link {
    font-weight: 500;
    transition: all 0.2s ease;
}

    .nav-link:hover {
        transform: translateY(-1px);
    }

    .nav-link i {
        margin-right: 5px;
    }

/* User Avatar in Navigation */
.user-avatar {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    margin-right: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.dropdown-header {
    padding: 0.75rem 1rem;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

    .card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

    .card-header h5,
    .card-header h6 {
        margin: 0;
    }

.card-body {
    padding: 1.25rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .btn i {
        margin-right: 5px;
    }

.btn-group .btn {
    margin: 0 2px;
}

/* Icon-only Buttons */
.btn-icon {
    padding: 0.375rem 0.625rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

    .form-control.is-invalid,
    .form-select.is-invalid {
        border-color: #dc3545;
    }

    .form-control.is-valid,
    .form-select.is-valid {
        border-color: #198754;
    }

/* Required Field Indicator */
.required::after {
    content: " *";
    color: #dc3545;
}

/* Form Grid Helper */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ========================================
   TABLES
   ======================================== */
.table {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

    .table thead th {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        color: #495057;
        text-transform: uppercase;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }

    .table tbody tr {
        transition: background-color 0.2s ease;
    }

        .table tbody tr:hover {
            background-color: #f8f9fa;
        }

.table-actions {
    white-space: nowrap;
    width: 1%;
}

.table-responsive {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   BADGES & LABELS
   ======================================== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* Status Badges */
.badge-status {
    font-size: 0.875rem;
    padding: 0.4em 0.8em;
}

.status-erfasst {
    background-color: #6c757d;
}

.status-inproduktion {
    background-color: #0dcaf0;
}

.status-produziert {
    background-color: #198754;
}

.status-abholbereit {
    background-color: #20c997;
}

.status-informiert {
    background-color: #0d6efd;
}

.status-erledigt {
    background-color: #28a745;
}

/* Priority Badges */
.priority-hoch {
    background-color: #dc3545;
}

.priority-normal {
    background-color: #0d6efd;
}

.priority-niedrig {
    background-color: #6c757d;
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d1e7dd;
    border-left-color: #198754;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    border-left-color: #0dcaf0;
    color: #055160;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #0d6efd;
    transition: all 0.2s ease;
}

    .page-link:hover {
        background-color: #e9ecef;
        border-color: #dee2e6;
    }

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background-color: #fff;
    margin-top: 3rem;
}

/* ========================================
   LOADING & SPINNERS
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-wrapper {
    text-align: center;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ========================================
   MODALS
   ======================================== */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 2px solid #f0f0f0;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 2px solid #f0f0f0;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    color: #6c757d;
}

/* ========================================
   TOOLTIPS
   ======================================== */
.tooltip-inner {
    background-color: #212529;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

/* ========================================
   DASHBOARD WIDGETS
   ======================================== */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s ease;
}

    .stat-card:hover {
        transform: translateY(-2px);
    }

    .stat-card .stat-icon {
        font-size: 2.5rem;
        opacity: 0.3;
    }

    .stat-card .stat-value {
        font-size: 2rem;
        font-weight: 700;
        line-height: 1;
    }

    .stat-card .stat-label {
        font-size: 0.875rem;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

/* ========================================
   FILTER PANEL
   ======================================== */
.filter-panel {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

    .filter-panel .form-control,
    .filter-panel .form-select {
        background-color: #fff;
    }

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.875rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    main {
        padding: 1rem !important;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.8rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .navbar,
    .footer,
    .btn,
    .filter-panel {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    main {
        padding: 0 !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-muted-hover:hover {
    color: #495057 !important;
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-start-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-start-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-start-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-start-info {
    border-left: 4px solid var(--info-color) !important;
}
