/* =====================================================
   NEXURAPLANT - Hauptstylesheet
   ===================================================== */

/* CSS Variables */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #3b82f6;
    
    --color-success: #16a34a;
    --color-warning: #ca8a04;
    --color-danger: #dc2626;
    --color-info: #0891b2;
    
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px 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);
    
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-gray-800);
    background-color: var(--color-gray-100);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =====================================================
   APP LAYOUT
   ===================================================== */

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

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 5px 1rem;
    margin-top: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--color-gray-700);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-text {
    font-weight: 600;
    font-size: 1.125rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--color-gray-300);
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-nav li a:hover {
    background: var(--color-gray-800);
    color: white;
}

.sidebar-nav li a.active {
    background: var(--color-primary);
    color: white;
}

.sidebar-nav .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-nav li a.active .nav-badge {
    background: rgba(255, 255, 255, 0.25);
}

.nav-divider {
    height: 1px;
    background: var(--color-gray-700);
    margin: 0.5rem 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-gray-500);
    display: flex;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    width: 280px;
    padding: 0.5rem 1rem;
    border: 1px solid #22c55e;
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: white;
}

.search-input::placeholder {
    color: var(--color-gray-400);
}

.search-input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: white;
    color: var(--color-gray-700);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.search-btn:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

.search-btn .icon {
    width: 16px;
    height: 16px;
    color: var(--color-gray-500);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-help-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-gray-500);
    transition: all 0.15s ease;
}

.header-help-link:hover {
    background: var(--color-gray-100);
    color: var(--color-primary);
    text-decoration: none;
}

.header-help-link .icon {
    width: 20px;
    height: 20px;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 500;
    color: var(--color-gray-700);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    display: none;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--color-gray-700);
    text-decoration: none;
}

.user-dropdown a:hover {
    background: var(--color-gray-50);
}

.page-content {
    flex: 1;
    padding: 1.5rem;
    padding-top: calc(var(--header-height) - 1rem);
}

/* =====================================================
   AUTH PAGES
   ===================================================== */

.auth-page {
    background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-gray-800) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.auth-logo .logo-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
}

.auth-logo .logo-text {
    font-size: 1.5rem;
    color: var(--color-gray-900);
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--color-gray-500);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--color-gray-400);
    font-size: 0.75rem;
}

/* =====================================================
   FORMS
   ===================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .form-hint {
    font-size: 0.75rem;
    color: var(--color-gray-500);
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--color-danger);
}

.form-group .error-message {
    font-size: 0.75rem;
    color: var(--color-danger);
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

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

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

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

.btn-secondary {
    background: white;
    border-color: var(--color-gray-300);
    color: var(--color-gray-700);
}

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

/* =====================================================
   FLASH MESSAGES
   ===================================================== */

.flash-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.flash-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    padding: 0.25rem;
}

.flash-close:hover {
    opacity: 1;
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-200);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* =====================================================
   TABLES
   ===================================================== */

.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    background: var(--color-gray-50);
}

.table tbody tr:hover {
    background: var(--color-gray-50);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   STATUS BADGES
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-blue { background: #dbeafe; color: #1e40af; }
.status-yellow { background: #fef3c7; color: #92400e; }
.status-orange { background: #ffedd5; color: #9a3412; }
.status-green { background: #dcfce7; color: #166534; }
.status-red { background: #fee2e2; color: #991b1b; }
.status-purple { background: #f3e8ff; color: #6b21a8; }
.status-gray { background: #f3f4f6; color: #374151; }

.priority-urgent { color: var(--color-danger); }
.priority-high { color: #ea580c; }
.priority-normal { color: var(--color-warning); }
.priority-low { color: var(--color-success); }

.criticality-critical { color: var(--color-danger); font-weight: 600; }
.criticality-high { color: #ea580c; }
.criticality-normal { color: var(--color-gray-600); }
.criticality-low { color: var(--color-gray-400); }

/* =====================================================
   PAGE HEADER
   ===================================================== */

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

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.breadcrumbs {
    margin-bottom: 0.25rem;
}

.breadcrumbs ol {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    font-size: 0.875rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--color-gray-400);
}

.breadcrumbs a {
    color: var(--color-gray-500);
}

.breadcrumbs .current {
    color: var(--color-gray-900);
}

/* =====================================================
   DASHBOARD WIDGETS
   ===================================================== */

/* Kompakte Dashboard Stats (Pills) */
.dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 2rem;
    text-decoration: none;
    color: var(--color-gray-700);
    font-size: 0.875rem;
    transition: all 0.15s;
}

.dashboard-stat:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-300);
    text-decoration: none;
}

.dashboard-stat .icon {
    width: 18px;
    height: 18px;
    color: var(--color-gray-400);
}

.dashboard-stat-value {
    font-weight: 600;
    color: var(--color-gray-900);
}

.dashboard-stat-label {
    color: var(--color-gray-500);
}

/* Alte Stat-Cards (für Kompatibilität) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--color-gray-200);
}

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

.stat-card-title {
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.stat-card-footer {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 0.5rem;
}

/* =====================================================
   UTILITIES
   ===================================================== */

.text-muted { color: var(--color-gray-500); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.hidden { display: none; }

.icon {
    display: inline-block;
    vertical-align: middle;
}

/* Form Input/Select Base Styles (for filter forms) */
.form-input,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.form-select-sm {
    width: auto;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
}

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

/* Filter-Formular inline */
.filter-form-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label-inline {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    white-space: nowrap;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        left: 0;
    }
    
    .search-input {
        width: 150px;
    }
    
    .search-btn-text {
        display: none;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   V2 ERGÄNZUNGEN
   ===================================================== */

/* User Dropdown Header */
.user-dropdown-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--color-gray-200);
}

/* Status Colors for Badges */
.status-blue { background: #dbeafe; color: #1e40af; }
.status-green { background: #dcfce7; color: #166534; }
.status-yellow { background: #fef9c3; color: #854d0e; }
.status-red { background: #fee2e2; color: #991b1b; }
.status-purple { background: #f3e8ff; color: #6b21a8; }
.status-gray { background: #f3f4f6; color: #374151; }

/* Text Utilities */
.text-right { text-align: right; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.font-bold { font-weight: 700; }

/* Spacing */
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* =====================================================
   LIST GROUP
   ===================================================== */

.list-group {
    display: flex;
    flex-direction: column;
}

.list-group-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-gray-200);
}

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

.list-group-item:hover {
    background: var(--color-gray-50);
}
/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    color: var(--color-primary);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.pagination-link:hover {
    background: var(--color-gray-100);
    border-color: var(--color-primary);
}

.pagination-link.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    pointer-events: none;
}

.pagination-info {
    color: var(--color-gray-600);
    font-size: 0.875rem;
}

.card-footer {
    border-top: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
}

.activity-action {
    background: var(--color-gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.8125rem;
}

/* Button Group Flex */
.btn-group-flex {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-group-flex form {
    margin: 0;
}

/* Outline Button */
.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
}

.btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

/* Flexbox Gaps */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* Space Y (vertical spacing between children) */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* Flex utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Margins */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Text colors */
.text-green-600 { color: #16a34a; }
.text-blue-600 { color: #2563eb; }
.text-gray-500 { color: #6b7280; }
.text-yellow-800 { color: #92400e; }
.text-yellow-700 { color: #a16207; }

/* Font sizes */
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

/* Font weights */
.font-semibold { font-weight: 600; }

/* Width */
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }

/* =====================================================
   MODAL SYSTEM (zentral für alle Modals)
   ===================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.is-active,
.modal[style*="display: flex"] {
    display: flex;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.modal-dialog.modal-sm {
    max-width: 400px;
}

.modal-dialog.modal-lg {
    max-width: 700px;
}

.modal-dialog.modal-xl {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-header h3,
.modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* Legacy Support für alte Struktur mit modal-content statt modal-dialog */
.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.modal-content.modal-lg {
    max-width: 700px;
}

/* Legacy Support für modal-overlay als Backdrop */
.modal > .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Responsive */
@media (max-width: 640px) {
    .modal {
        padding: 0.5rem;
    }
    
    .modal-dialog,
    .modal-content {
        max-width: 100%;
        margin: 0;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-gray-200);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--color-gray-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--color-primary);
    background: var(--color-gray-50);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 500;
}

.tab .badge {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.tab.active .badge {
    background: var(--color-primary);
    color: white;
}

/* Pagination erweitert */
.pagination {
    flex-wrap: wrap;
    justify-content: space-between;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-dots {
    padding: 0 0.5rem;
    color: var(--color-gray-400);
}
