/* Tesla-inspired Design System for Feuerwehr Lagerverwaltung - Compiled Version */

/* Design Tokens */
:root {
    --tesla-red: #dc2626;
    --tesla-dark: #1a1a1a;
    --tesla-gray: #737373;
    --tesla-light-gray: #f5f5f5;
    --tesla-border: #e5e5e5;
    --tesla-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --tesla-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --tesla-radius: 0.5rem;
    --tesla-radius-lg: 0.75rem;
}

/* Base Card Styles */
.card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgb(243 244 246);
    overflow: hidden;
    padding: 1.5rem;
    box-shadow: var(--tesla-shadow);
    transition: all 0.3s ease;
}

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

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgb(243 244 246);
    background-color: rgb(249 250 251);
}

.card-title {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    color: rgb(17 24 39);
}

.card-body {
    padding: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    outline: 2px solid transparent;
    outline-offset: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px;
}

.btn-primary {
    background-color: rgb(220 38 38);
    color: #ffffff;
    border-color: rgb(220 38 38);
}

.btn-primary:hover {
    background-color: rgb(185 28 28);
    border-color: rgb(185 28 28);
}

.btn-primary:focus {
    box-shadow: 0 0 0 2px rgb(239 68 68);
}

.btn-secondary {
    background-color: rgb(243 244 246);
    color: rgb(55 65 81);
    border-color: rgb(229 231 235);
}

.btn-secondary:hover {
    background-color: rgb(229 231 235);
    border-color: rgb(209 213 219);
}

.btn-secondary:focus {
    box-shadow: 0 0 0 2px rgb(107 114 128);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(55 65 81);
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    background-color: #fff;
    transition: all 0.2s;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: rgb(239 68 68);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgb(156 163 175);
}

.form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
}

.form-checkbox {
    border-radius: 0.25rem;
    border-color: rgb(209 213 219);
    color: rgb(220 38 38);
}

.form-checkbox:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: rgb(220 38 38);
}

.form-hint {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: rgb(107 114 128);
}

/* Toggle Switch for Checkboxes */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: rgb(209 213 219);
    border-radius: 24px;
    margin-right: 0.75rem;
    transition: background-color 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgb(220 38 38);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.875rem;
    color: rgb(55 65 81);
}

/* Tesla Card */
.tesla-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgb(243 244 246);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tesla-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Additional fixes */
.btn-secondary:hover {
    background-color: rgb(229 231 235);
    border-color: rgb(209 213 219);
}

.btn-secondary:focus {
    box-shadow: 0 0 0 2px rgb(107 114 128);
}

.btn-outline {
    background-color: transparent;
    color: rgb(55 65 81);
    border-color: rgb(209 213 219);
}

.btn-outline:hover {
    background-color: rgb(249 250 251);
    border-color: rgb(156 163 175);
}

.btn-outline:focus {
    box-shadow: 0 0 0 2px rgb(107 114 128);
}

.btn-danger {
    background-color: rgb(220 38 38);
    color: #ffffff;
    border-color: rgb(220 38 38);
}

.btn-danger:hover {
    background-color: rgb(185 28 28);
    border-color: rgb(185 28 28);
}

.btn-danger:focus {
    box-shadow: 0 0 0 2px rgb(239 68 68);
}

.btn-warning {
    background-color: rgb(245 158 11);
    color: #ffffff;
    border-color: rgb(245 158 11);
}

.btn-warning:hover {
    background-color: rgb(217 119 6);
    border-color: rgb(217 119 6);
}

.btn-warning:focus {
    box-shadow: 0 0 0 2px rgb(251 191 36);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    line-height: 1.75rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: rgb(55 65 81);
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    transition: colors 0.2s;
    background-color: #fff;
    font-size: 1rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgb(220 38 38);
    border-color: rgb(220 38 38);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgb(156 163 175);
}

.form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
}

.form-checkbox {
    border-radius: 0.25rem;
    border-color: rgb(209 213 219);
    color: rgb(220 38 38);
}

.form-checkbox:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgb(220 38 38);
}

.form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(220 38 38);
}

.form-hint {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(107 114 128);
}

/* Table Styles */
.table {
    width: 100%;
}

.table thead {
    background-color: rgb(249 250 251);
    border-bottom: 1px solid rgb(229 231 235);
}

.table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    color: rgb(107 114 128);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 1.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(17 24 39);
}

.table tbody tr {
    border-bottom: 1px solid rgb(243 244 246);
}

.table tbody tr:hover {
    background-color: rgb(249 250 251);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-sm th,
.table-sm td {
    padding: 0.5rem 1rem;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
}

.badge-primary {
    background-color: rgb(254 226 226);
    color: rgb(153 27 27);
}

.badge-secondary {
    background-color: rgb(243 244 246);
    color: rgb(31 41 55);
}

.badge-success {
    background-color: rgb(220 252 231);
    color: rgb(22 101 52);
}

.badge-warning {
    background-color: rgb(254 249 195);
    color: rgb(133 77 14);
}

.badge-danger {
    background-color: rgb(254 226 226);
    color: rgb(153 27 27);
}

.badge-info {
    background-color: rgb(219 234 254);
    color: rgb(30 64 175);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
}

.alert-success {
    background-color: rgb(240 253 244);
    color: rgb(22 101 52);
    border-color: rgb(187 247 208);
}

.alert-warning {
    background-color: rgb(255 251 235);
    color: rgb(133 77 14);
    border-color: rgb(253 230 138);
}

.alert-danger {
    background-color: rgb(254 242 242);
    color: rgb(153 27 27);
    border-color: rgb(254 202 202);
}

.alert-info {
    background-color: rgb(239 246 255);
    color: rgb(30 64 175);
    border-color: rgb(191 219 254);
}

/* Link Styles */
.link {
    color: rgb(220 38 38);
    text-decoration: underline;
    transition: colors 0.2s;
}

.link:hover {
    color: rgb(185 28 28);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pagination-info {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(55 65 81);
}

.pagination-prev,
.pagination-next {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: rgb(55 65 81);
    background-color: #ffffff;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    transition: colors 0.2s;
}

.pagination-prev:hover,
.pagination-next:hover {
    background-color: rgb(249 250 251);
}

.pagination-prev:focus,
.pagination-next:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgb(220 38 38);
}

.pagination-wrapper {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgb(229 231 235);
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(229 231 235);
}

/* Stat Cards (Dashboard Style) */
.stat-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgb(243 244 246);
    box-shadow: var(--tesla-shadow);
    transition: all 0.3s ease;
}

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

/* Quick Action Cards */
.quick-action-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgb(243 244 246);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-action-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: rgb(254 202 202);
    transform: translateY(-2px);
}

.quick-action-icon {
    font-size: 1.875rem;
    line-height: 2.25rem;
    margin-bottom: 0.5rem;
    display: block;
}

.quick-action-text {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: rgb(55 65 81);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    
    .card-header,
    .card-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .table {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.75rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (min-width: 640px) {
    .btn {
        width: auto;
    }
    
    .form-actions {
        flex-direction: row;
    }
    
    .form-actions .btn {
        width: auto;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgb(209 213 219);
    border-top-color: rgb(220 38 38);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Sidebar Styles */
.sidebar-wrapper {
    background-color: #111827;
    color: #ffffff;
}

/* Desktop Sidebar Fix */
@media (min-width: 1024px) {
    .sidebar-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 16rem;
        z-index: 40;
        overflow-y: auto;
    }
    
    /* Scrollbar styling für Sidebar */
    .sidebar-wrapper::-webkit-scrollbar {
        width: 6px;
    }
    
    .sidebar-wrapper::-webkit-scrollbar-track {
        background: #1f2937;
    }
    
    .sidebar-wrapper::-webkit-scrollbar-thumb {
        background: #4b5563;
        border-radius: 3px;
    }
    
    .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
    }
}

/* Main content scroll behavior */
html, body {
    height: 100%;
    overflow: hidden;
}

/* Ensure proper scrolling for main content */
main {
    overflow-y: auto;
    max-height: calc(100vh - 4rem); /* Account for header height */
}