/* DispoSys v4.2 - Stylesheet */

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

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

/* v4.3.2.1: Perspektiv-Wechsel */
.perspektiv-wechsel {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
}

.perspektiv-wechsel label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 15px;
}

.perspektiv-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.perspektiv-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.perspektiv-btn:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.perspektiv-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.badge-secondary {
    background: #9ca3af;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 5px;
}

@media (max-width: 768px) {
    .perspektiv-buttons {
        flex-direction: column;
    }
    
    .perspektiv-btn {
        min-width: 100%;
    }
}

/* v4.3.2: Badge-Buttons (statt Tabs) */
.badge-buttons {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.badge-btn:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.badge-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

@media (max-width: 768px) {
    .badge-buttons {
        gap: 10px;
    }
    
    .badge-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* v4.3.1: Tab-Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin: 25px 0;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.tab-link {
    padding: 12px 20px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-link:hover {
    color: #3b82f6;
    background: #f9fafb;
}

.tab-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* v4.3.1: Verbesserte Buttons */
.btn-lg {
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.punkte-highlight {
    color: #2563eb;
    font-size: 18px;
}

/* Badge für Schwierigkeit */
.badge-leicht {
    background: #d1fae5;
    color: #065f46;
}

.badge-mittel {
    background: #fef3c7;
    color: #92400e;
}

.badge-schwer {
    background: #fee2e2;
    color: #991b1b;
}

/* Info Badge */
.badge-info {
    background: #dbeafe;
    color: #1e40af;
    margin-left: 8px;
}

/* Responsive Tabs */
@media (max-width: 768px) {
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-link {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* v4.3: Beta-Banner */
.beta-banner {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* v4.2: Demo-Banner */
.demo-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* v4.2: Super-Admin Banner */
.superadmin-banner {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

/* v4.3: Rollenwechsel Banner */
.rollenwechsel-banner {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rollenwechsel-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rollenwechsel-icon {
    font-size: 28px;
}

.rollenwechsel-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rollenwechsel-text strong {
    font-size: 12px;
    letter-spacing: 0.5px;
}

.rollenwechsel-text span {
    font-size: 14px;
}

.rollenwechsel-firma,
.rollenwechsel-gruppe {
    font-size: 12px !important;
    opacity: 0.9;
}

.btn-rollenwechsel {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-rollenwechsel:hover {
    background: rgba(255,255,255,0.3);
}

/* v4.3: Rollen-Hilfe Box */
.rollen-hilfe-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.rollen-hilfe-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.rollen-hilfe-header .rollen-icon {
    font-size: 32px;
}

.rollen-hilfe-header h3 {
    margin: 0;
    color: #0369a1;
}

.rollen-hilfe-beschreibung {
    color: #0c4a6e;
    margin-bottom: 12px;
    font-size: 15px;
}

.rollen-hilfe-details {
    margin-top: 10px;
}

.rollen-hilfe-details summary {
    cursor: pointer;
    color: #0369a1;
    font-weight: 600;
    padding: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 5px;
    user-select: none;
}

.rollen-hilfe-details summary:hover {
    background: rgba(255,255,255,0.8);
}

.rollen-hilfe-liste {
    margin-top: 12px;
    padding-left: 25px;
}

.rollen-hilfe-liste li {
    margin: 6px 0;
    color: #0c4a6e;
}

/* v4.3: Rollen-Grid für Auswahl */
.rollen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.rollen-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s;
}

.rollen-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.rollen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.rollen-icon {
    font-size: 36px;
}

.rollen-card h3 {
    margin: 0;
    color: #1e40af;
}

.rollen-beschreibung {
    color: #6b7280;
    margin-bottom: 15px;
    font-size: 14px;
}

.rollen-rechte {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.rollen-rechte strong {
    display: block;
    margin-bottom: 8px;
    color: #374151;
}

.rollen-rechte ul {
    margin: 0;
    padding-left: 20px;
}

.rollen-rechte li {
    margin: 5px 0;
    font-size: 13px;
    color: #6b7280;
}

.rollen-stats {
    background: #dbeafe;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    color: #1e40af;
}

.rollen-stats strong {
    font-size: 20px;
}

.rollen-card .btn {
    width: 100%;
}

/* v4.3: Gruppen-Auswahl */
.gruppen-auswahl {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.gruppen-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.gruppen-card h3 {
    margin-bottom: 10px;
    color: #1e40af;
}

.gruppe-beschreibung {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.gruppe-anzahl {
    background: #f0f9ff;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    color: #0369a1;
    font-size: 14px;
    margin-bottom: 15px;
}

.data-table-compact {
    font-size: 14px;
}

.data-table-compact th,
.data-table-compact td {
    padding: 8px 12px;
}

.info-text {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 15px;
}

.text-muted {
    color: #9ca3af;
    font-style: italic;
}

/* Navigation */
nav {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.2s;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-user {
    font-size: 14px;
    opacity: 0.9;
}

/* v5.2.2: Persönliches Menü Dropdown */
.nav-user-dropdown {
    position: relative;
}

.nav-user-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.nav-user-button:hover {
    background: rgba(255,255,255,0.2);
}

.nav-user-name {
    font-weight: 600;
}

.nav-user-role {
    opacity: 0.85;
    font-size: 13px;
}

.dropdown-arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s;
}

.nav-user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 180px;
    overflow: hidden;
    z-index: 1000;
}

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

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: #f3f4f6;
}

.user-menu-logout {
    color: #dc2626;
    border-top: 1px solid #e5e7eb;
}

.user-menu-logout:hover {
    background: #fee2e2;
}

/* Navigation Links - Active State */
.nav-menu a.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.2s;
}

.nav-menu a.nav-link:hover {
    background: rgba(255,255,255,0.15);
}

.nav-menu a.nav-link.active {
    background: rgba(255,255,255,0.25);
    font-weight: 600;
}

/* v5.2.2: Spezielle Nav-Link Varianten */
.nav-menu a.nav-link-gold {
    color: #fbbf24;
}

.nav-menu a.nav-link-gold:hover {
    background: rgba(251, 191, 36, 0.15);
}

.nav-menu a.nav-link-cta {
    background: #10b981;
    color: white;
    font-weight: 600;
}

.nav-menu a.nav-link-cta:hover {
    background: #059669;
}

.nav-menu a.nav-link-cta.active {
    background: #047857;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
}

/* Container */
.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

h1 {
    margin-bottom: 25px;
    color: #1e40af;
    font-size: 28px;
}

h2 {
    margin: 25px 0 15px 0;
    color: #374151;
    font-size: 22px;
}

h3 {
    margin-bottom: 15px;
    color: #4b5563;
    font-size: 18px;
}

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

.stat-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 36px;
    margin-bottom: 5px;
    color: white;
}

.stat-card p {
    font-size: 14px;
    opacity: 0.9;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Info Box */
.info-box {
    background: #f0f9ff;
    border: 2px solid #bfdbfe;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.info-box p {
    margin: 5px 0;
}

/* Tables */
.section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 1100px;
    table-layout: auto;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th {
    background: #f3f4f6;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

/* Kompakte Zeitstempel-Spalten */
.data-table th[data-sort="date"],
.data-table td[data-label="Erstellt"],
.data-table td[data-label="Angenommen"],
.data-table td[data-label="Erledigt"] {
    white-space: nowrap;
    font-size: 13px;
    min-width: 120px;
}

/* Aktionen Spalte - kompakter */
.data-table th:last-child,
.data-table td:last-child {
    min-width: 130px;
    white-space: normal;
}

/* Kompakte Buttons in Aktionen-Spalte */
.data-table td:last-child .btn {
    padding: 6px 10px;
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
}

.data-table td:last-child .btn-sm {
    padding: 5px 8px;
    font-size: 11px;
}

.data-table td:last-child form {
    margin-bottom: 4px;
}

.data-table td:last-child form .btn {
    margin-bottom: 0;
}

.data-table tr:hover {
    background: #f9fafb;
}

.data-table tr.highlight {
    background: #fef3c7;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* v4.3.6: Outline-Buttons für Zeitraum-Filter */
.btn-outline {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* v4.3.6: Sortierbare Tabellen-Header */
table.sortable th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

table.sortable th[data-sort]:hover {
    background: #e2e8f0;
}

table.sortable th.sort-asc,
table.sortable th.sort-desc {
    background: #dbeafe;
    color: #1d4ed8;
}

table.sortable th .sort-icon {
    font-size: 12px;
    margin-left: 4px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

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

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.badge-offen {
    background: #dbeafe;
    color: #1e40af;
}

.badge-in_arbeit {
    background: #fef3c7;
    color: #92400e;
}

.badge-erledigt {
    background: #d1fae5;
    color: #065f46;
}

.badge-zurueckgegeben {
    background: #fee2e2;
    color: #991b1b;
}

/* Forms */
.form-card {
    background: #f9fafb;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e5e7eb;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Section */
.section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
}

.login-box > p {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
}

.login-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.login-info code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 13px;
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

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

    .action-buttons {
        flex-direction: column;
    }
}

/* v4.3.16: Erweiterte Responsive-Regeln für schmale Fenster */
@media (max-width: 600px) {
    /* Banner kompakter */
    .beta-banner,
    .demo-banner,
    .schnupper-banner {
        font-size: 11px;
        padding: 6px 10px;
        gap: 8px !important;
    }

    /* Zeitraum-Filter stapeln */
    .zeitraum-filter {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .zeitraum-filter form {
        flex-direction: column !important;
        margin-left: 0 !important;
    }

    .zeitraum-filter .zeitraum-buttons {
        justify-content: center;
    }

    /* Perspektiv-Buttons stapeln */
    .perspektiv-buttons {
        flex-direction: column;
    }

    .perspektiv-btn {
        min-width: 100%;
    }

    /* Rollen-Hilfe-Box kompakter */
    .rollen-hilfe-box {
        padding: 15px;
    }

    .rollen-hilfe-header .rollen-icon {
        font-size: 24px;
    }

    .rollen-hilfe-beschreibung {
        font-size: 14px;
    }

    /* Stat-Cards kleiner */
    .stat-card {
        padding: 15px;
    }

    .stat-card h3 {
        font-size: 28px;
    }

    /* Buttons anpassen */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-lg {
        padding: 10px 18px !important;
        font-size: 14px !important;
    }

    /* Tab-Navigation scrollbar */
    .tab-navigation {
        gap: 5px;
        padding-bottom: 10px;
    }

    .tab-link {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* v4.3.16: Sehr schmale Bildschirme (< 400px) */
@media (max-width: 400px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 16px;
    }

    /* Navigation kompakter */
    .nav-menu a {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Ranking-Stats nebeneinander aber kompakter */
    .ranking-stats {
        gap: 15px;
        min-width: auto;
    }

    .ranking-punkte strong,
    .ranking-auftraege {
        font-size: 14px;
    }

    .ranking-label {
        font-size: 9px;
    }

    /* Tabellen-Zellen kompakter */
    .data-table td,
    .data-table th {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* v4.3.16: Action-Buttons bei schmalen Bildschirmen stapeln */
@media (max-width: 600px) {
    .action-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .action-buttons .btn {
        width: 100%;
        text-align: center;
        white-space: nowrap;
    }

    /* Bei Mobile-Cards: Buttons unter dem Content */
    .data-table.mobile-cards td.action-buttons,
    .data-table.mobile-cards td:last-child {
        flex-direction: column;
        align-items: stretch;
    }

    .data-table.mobile-cards td.action-buttons .btn,
    .data-table.mobile-cards td:last-child .btn {
        width: 100%;
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* v4.3.16: Buttons bei sehr schmalen Bildschirmen noch kompakter */
@media (max-width: 400px) {
    .action-buttons .btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .btn-lg {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
}

/* v4.3.16: Dashboard-spezifische responsive Regeln */
@media (max-width: 900px) {
    /* Persönliche Statistik-Box stapeln */
    .persoenliche-statistik > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    .persoenliche-statistik > div > div:last-child {
        width: 100%;
        justify-content: center;
    }

    /* Demo-Willkommens-Box Grid anpassen */
    .demo-willkommen-box div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Spielmodus-Checkliste */
    .spielmodus-checkliste div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    /* Badge-Buttons (Dashboard Tabs) stapeln bei schmal */
    .badge-buttons {
        flex-direction: column;
        gap: 8px;
    }

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

    /* Erweiterte Filter stapeln */
    .erweiterte-filter > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .erweiterte-filter div[style*="margin-left: auto"] {
        margin-left: 0 !important;
    }
}

/* ========================================
   v4.3.1: Ranking - Visuelle Balken
   ======================================== */

.ranking-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.ranking-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ranking-highlight {
    border: 2px solid #2196F3;
    background: linear-gradient(135deg, #E3F2FD 0%, white 100%);
}

/* Linke Seite: Platz + Name */
.ranking-info {
    display: flex;
    align-items: center;
    min-width: 200px;
    margin-right: 20px;
}

.ranking-platz {
    font-size: 24px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.ranking-name {
    font-size: 16px;
}

.ranking-gruppe {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Mitte: Visueller Balken */
.ranking-bar-container {
    flex: 1;
    height: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 20px;
    position: relative;
}

.ranking-bar {
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s ease-out;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    /* v4.7.2: Animation entfernt - verursachte Probleme mit korrekter Breite */
}

/* Animation entfernt - Inline width wird jetzt korrekt angezeigt */

/* Rechts: Punkte + Aufträge */
.ranking-stats {
    display: flex;
    gap: 30px;
    min-width: 200px;
    justify-content: flex-end;
}

.ranking-punkte,
.ranking-auftraege {
    text-align: center;
}

.ranking-punkte strong,
.ranking-auftraege {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.ranking-label {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .ranking-info {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .ranking-bar-container {
        width: 100%;
        margin: 10px 0;
    }

    .ranking-stats {
        width: 100%;
        justify-content: space-around;
    }
}

/* ========================================
   v4.3.5: Mobile-Responsive Tabellen
   Tabellen werden auf Mobile zu Karten
   v4.3.16: Breakpoint erhöht auf 900px wegen vieler Spalten
   ======================================== */

/* Wrapper für horizontales Scrollen als Fallback */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    /* Tabelle als Karten darstellen - nur auf echten Mobile-Geräten */
    .data-table.mobile-cards thead {
        display: none;
    }

    .data-table.mobile-cards,
    .data-table.mobile-cards tbody,
    .data-table.mobile-cards tr,
    .data-table.mobile-cards td {
        display: block;
        width: 100%;
    }

    .data-table.mobile-cards tr {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .data-table.mobile-cards tr:hover {
        background: white;
    }

    .data-table.mobile-cards td {
        padding: 8px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f3f4f6;
        flex-wrap: wrap;
    }

    .data-table.mobile-cards td:last-child {
        border-bottom: none;
        padding-top: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .data-table.mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 13px;
        min-width: 80px;
        flex-shrink: 0;
    }

    .data-table.mobile-cards td:last-child::before {
        display: none;
    }

    /* Action Buttons in Karten zentrieren */
    .data-table.mobile-cards .action-buttons,
    .data-table.mobile-cards td:last-child {
        justify-content: center;
    }

    .data-table.mobile-cards .action-buttons {
        width: 100%;
        flex-direction: column;
    }

    .data-table.mobile-cards .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Container auf Mobile etwas enger */
    .container {
        padding: 15px;
    }

    main {
        padding: 0 10px;
        margin: 15px auto;
    }

    h1 {
        font-size: 22px;
    }

    /* Banner auf Mobile kompakter */
    .demo-banner,
    .beta-banner {
        font-size: 12px;
        padding: 8px 10px;
    }

    /* Section Header auf Mobile */
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .section-header .btn {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   v4.3.5: Pulse Animation für Warn-Buttons
   ======================================== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}
