/* Modern Neumorphism Design - Mobile First Approach */

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

/* Neumorphism Color Palette */
:root {
    --neu-bg: #E8E8E8;
    --neu-surface: #E8E8E8;
    --neu-primary: #667eea;
    --neu-secondary: #764ba2;
    --neu-accent: #f093fb;
    --neu-success: #4ecdc4;
    --neu-warning: #ffe66d;
    --neu-danger: #ff6b6b;
    --neu-text: #2d3748;
    --neu-text-light: #718096;
    --neu-text-dark: #1a202c;
    
    /* Neumorphism Shadows */
    --neu-shadow-light: #ffffff;
    --neu-shadow-dark: #d1d1d1;
    
    /* Shadow Effects - Mobile Optimized (lighter for performance) */
    --neu-shadow-raised: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
    --neu-shadow-pressed: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
    --neu-shadow-flat: 4px 4px 8px var(--neu-shadow-dark), -4px -4px 8px var(--neu-shadow-light);
    --neu-shadow-subtle: 2px 2px 4px var(--neu-shadow-dark), -2px -2px 4px var(--neu-shadow-light);
    
    /* Gradients */
    --neu-gradient-primary: linear-gradient(135deg, var(--neu-primary) 0%, var(--neu-secondary) 100%);
    --neu-gradient-accent: linear-gradient(135deg, var(--neu-accent) 0%, var(--neu-primary) 100%);
    --neu-gradient-surface: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

/* MOBILE FIRST BASE STYLES (320px+) */

/* iOS Safari Specific Optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS-only styles */
    
    /* Fix iOS viewport height issues */
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* Prevent iOS Safari bounce scrolling - FIXED */
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;  /* Verhindert Bounce ohne overflow:hidden */
        -webkit-overscroll-behavior: contain;
    }
    
    /* Improve iOS touch feedback */
    button, .btn, .filter-button, .stat-card {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Fix iOS form input zooming */
    input, textarea, select {
        font-size: 16px !important;
        -webkit-appearance: none;
        -webkit-border-radius: 0;
        border-radius: 12px;
    }
    
    /* Improve iOS scrolling performance */
    .ticket-list, .ticket-cards-container, .modal-content {
        -webkit-overflow-scrolling: touch;
        transform: translate3d(0, 0, 0);
        will-change: scroll-position;
    }
}

/* PWA Standalone App Optimizations - ENHANCED */
@media all and (display-mode: standalone) {
    /* Status bar integration */
    .header {
        padding-top: max(1rem, env(safe-area-inset-top));
        margin-top: 0;
        background: var(--neu-surface);
        /* Ensure header is above status bar */
        z-index: 200;
        /* Native app-like border */
        border-bottom: 1px solid rgba(var(--neu-shadow-dark), 0.1);
    }
    
    /* Safe area padding for all content */
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    /* Full viewport height optimization */
    body {
        min-height: 100vh;
        min-height: 100dvh;  /* Dynamic Viewport Height */
        min-height: -webkit-fill-available;  /* iOS Support */
        padding-top: env(safe-area-inset-top);
        /* Prevent overscroll bounce in standalone */
        overscroll-behavior: none;
        -webkit-overscroll-behavior: none;
        /* Native app background */
        background: var(--neu-bg);
    }
    
    /* Floating elements safe area optimization */
    .fab-container {
        bottom: max(20px, calc(env(safe-area-inset-bottom) + 10px));
        right: max(20px, calc(env(safe-area-inset-right) + 10px));
    }
    
    .floating-top-controls {
        top: max(20px, calc(env(safe-area-inset-top) + 10px));
        right: max(20px, calc(env(safe-area-inset-right) + 10px));
    }
    
    .floating-side-trigger {
        left: max(20px, calc(env(safe-area-inset-left) + 10px));
    }
    
    /* Native app-like scrolling */
    .ticket-list, .ticket-cards-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Remove selection highlight for native feel */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection for inputs and content */
    input, textarea, [contenteditable="true"] {
        -webkit-user-select: auto;
        -khtml-user-select: auto;
        -moz-user-select: auto;
        -ms-user-select: auto;
        user-select: auto;
    }
}

/* Manual Dark Theme (höchste Priorität) */
.dark-theme {
    --neu-bg: #2d2d2d;
    --neu-surface: #2d2d2d;
    --neu-text: #ffffff;
    --neu-text-light: #b0b0b0;
    --neu-text-dark: #ffffff;
    --neu-shadow-light: #404040;
    --neu-shadow-dark: #1a1a1a;
}

/* Manual Light Theme (explizit für Override) */
.light-theme {
    --neu-bg: #E8E8E8;
    --neu-surface: #E8E8E8;
    --neu-text: #2d3748;
    --neu-text-light: #718096;
    --neu-text-dark: #1a202c;
    --neu-shadow-light: #ffffff;
    --neu-shadow-dark: #d1d1d1;
}

/* System Dark Mode Support (nur wenn kein Manual Override) */
@media (prefers-color-scheme: dark) {
    html:not(.dark-theme):not(.light-theme) {
        --neu-bg: #2d2d2d;
        --neu-surface: #2d2d2d;
        --neu-text: #ffffff;
        --neu-text-light: #b0b0b0;
        --neu-text-dark: #ffffff;
        --neu-shadow-light: #404040;
        --neu-shadow-dark: #1a1a1a;
    }
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--neu-surface);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--neu-shadow-raised);
    color: var(--neu-text);
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
    box-shadow: var(--neu-shadow-pressed);
    outline: none;
    transform: scale(0.95);
    border-color: var(--neu-primary);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    color: var(--neu-primary);
}

/* Theme Toggle Animation */
.theme-toggle-btn svg.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle-btn svg.moon-icon {
    opacity: 1;
    transform: rotate(-30deg);
}

.dark-theme .theme-toggle-btn svg.sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.dark-theme .theme-toggle-btn svg.moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Base Styles */
html {
    font-size: 16px; /* Base for rem calculations */
    -webkit-text-size-adjust: 100%; /* Prevent iOS text scaling */
    -ms-text-size-adjust: 100%;
    
    /* iOS Safe Area variables */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    
    /* Dynamic viewport height for iOS */
    --vh: 1vh;
}

body {
    min-height: 100vh;
    min-height: 100dvh;  /* Dynamic Viewport Height für moderne Browser */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--neu-bg);
    color: var(--neu-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-size: clamp(0.875rem, 2.5vw, 1rem); /* Fluid base font size */
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Container - Mobile First */
.container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 1rem;
}

/* Header - Mobile Optimized */
.header {
    background: var(--neu-surface);
    box-shadow: var(--neu-shadow-flat);
    padding: 1rem 0 0.5rem 0;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Scrolling Header */
.header.scrolling-header {
    transition: transform 0.3s ease-out;
}

.header.scrolling-header.header-hidden {
    transform: translateY(-100%);
}

/* NEW: Mobile Optimized Header */
.header.mobile-optimized {
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    min-height: 60px;
}

/* Minimal Header Content */
.header-content-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
}

.header-title-minimal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-title-minimal svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--neu-primary);
    flex-shrink: 0;
}

.header-title-minimal h1 {
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--neu-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    white-space: nowrap;
}

.header-actions-minimal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hamburger Menu Button */
.hamburger-btn {
    background: var(--neu-surface);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: var(--neu-shadow-subtle);
    transition: all 0.3s ease;
    padding: 8px;
}

.hamburger-btn:hover,
.hamburger-btn.active {
    box-shadow: var(--neu-shadow-pressed);
    transform: scale(0.95);
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background: var(--neu-text);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* User Info Minimal */
.user-info-minimal {
    display: none; /* Hidden by default on mobile */
}

.user-greeting-minimal {
    font-size: 0.875rem;
    color: var(--neu-text-light);
    white-space: nowrap;
}

/* Header Top Controls */
.header-top-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle-btn-minimal,
.logout-btn-minimal {
    background: var(--neu-surface);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--neu-shadow-subtle);
    transition: all 0.3s ease;
    color: var(--neu-text-light);
}

.theme-toggle-btn-minimal:hover,
.logout-btn-minimal:hover {
    box-shadow: var(--neu-shadow-pressed);
    transform: scale(0.95);
    color: var(--neu-text);
}

.theme-toggle-btn-minimal svg,
.logout-btn-minimal svg {
    width: 16px;
    height: 16px;
}

/* Collapsible Navigation */
.header-navigation-collapsible {
    background: var(--neu-surface);
    border-radius: 12px;
    margin-top: 0.75rem;
    padding: 1rem;
    box-shadow: var(--neu-shadow-pressed);
    animation: slideDown 0.3s ease-out;
    transform-origin: top;
}

.header-navigation-collapsible.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scaleY(1) translateY(0);
    }
}

/* Navigation Sections */
.nav-user-section,
.nav-stats-section,
.nav-filter-section {
    margin-bottom: 1.5rem;
}

.nav-user-section:last-child,
.nav-stats-section:last-child,
.nav-filter-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neu-text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* User Info Expanded */
.user-info-expanded {
    background: var(--neu-surface);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: var(--neu-shadow-flat);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-greeting-expanded {
    font-weight: 600;
    color: var(--neu-text);
}

.btn-link-minimal {
    background: none;
    border: none;
    color: var(--neu-primary);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    padding: 0;
    text-decoration: underline;
}

.btn-link-minimal:hover {
    color: var(--neu-secondary);
}

/* Stats Navigation Grid */
.stats-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.stat-nav-item-compact {
    background: var(--neu-surface);
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-flat);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.stat-nav-item-compact:hover,
.stat-nav-item-compact.active {
    box-shadow: var(--neu-shadow-raised);
    transform: translateY(-1px);
}

.stat-nav-icon-compact {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-nav-icon-compact svg {
    width: 16px;
    height: 16px;
}

.stat-nav-content {
    display: flex;
    flex-direction: column;
}

.stat-nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neu-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-nav-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neu-text);
}

/* Filter Radio Group Vertical */
.filter-radio-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-radio-label-vertical {
    background: var(--neu-surface);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-flat);
    color: var(--neu-text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.filter-radio-group-vertical input[type="radio"] {
    display: none;
}

.filter-radio-label-vertical:before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--neu-text-light);
    border-radius: 50%;
    background: var(--neu-surface);
    box-shadow: var(--neu-shadow-pressed);
    flex-shrink: 0;
}

.filter-radio-group-vertical input[type="radio"]:checked + .filter-radio-label-vertical {
    box-shadow: var(--neu-shadow-raised);
    background: linear-gradient(135deg, var(--neu-primary), var(--neu-secondary));
    color: white;
}

.filter-radio-group-vertical input[type="radio"]:checked + .filter-radio-label-vertical:before {
    background: white;
    border-color: white;
    box-shadow: inset 0 0 0 4px var(--neu-primary);
}

.filter-radio-label-vertical:hover {
    box-shadow: var(--neu-shadow-raised);
    transform: translateY(-1px);
}

/* Floating Action Button (FAB) - Safe Area Enhanced */
.fab-container {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    right: max(20px, env(safe-area-inset-right));
    z-index: 1000;
}

.fab-button {
    width: 56px;
    height: 56px;
    background: var(--neu-gradient-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), var(--neu-shadow-raised);
    transition: all 0.3s ease;
    color: white;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    touch-action: manipulation;
}

.fab-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5), var(--neu-shadow-raised);
}

.fab-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3), var(--neu-shadow-pressed);
}

.fab-button svg {
    width: 24px;
    height: 24px;
}

/* Floating Top-Right Controls */
.floating-top-controls {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-control-btn {
    width: 48px;
    height: 48px;
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--neu-shadow-raised);
    transition: all 0.3s ease;
    color: var(--neu-text-light);
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    touch-action: manipulation;
}

.floating-control-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), var(--neu-shadow-raised);
    transform: translateY(-2px);
    color: var(--neu-text);
}

.floating-control-btn:active {
    transform: scale(0.95);
    box-shadow: var(--neu-shadow-pressed);
}

.floating-control-btn svg {
    width: 20px;
    height: 20px;
}

.floating-control-btn.logout-floating {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
}

.floating-control-btn.logout-floating:hover {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #991b1b;
}

/* Floating Side Navigation Trigger */
.floating-side-trigger {
    position: fixed;
    top: 50%;
    left: max(20px, env(safe-area-inset-left));
    transform: translateY(-50%);
    z-index: 1100;
}

.floating-side-btn {
    width: 48px;
    height: 48px;
    background: var(--neu-gradient-primary);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), var(--neu-shadow-raised);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    touch-action: manipulation;
    will-change: transform, box-shadow;
}

.floating-side-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5), var(--neu-shadow-raised);
}

.floating-side-btn:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3), var(--neu-shadow-pressed);
}

.floating-side-btn svg {
    width: 20px;
    height: 20px;
}

/* Side Navigation Overlay - ENHANCED */
.side-navigation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    opacity: 0;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.side-navigation-overlay.visible {
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.side-navigation-overlay.hidden {
    display: none;
}

/* Side Navigation */
.side-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--neu-surface);
    z-index: 1300;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.side-navigation.visible {
    transform: translateX(0);
}

.side-navigation.hidden {
    transform: translateX(-100%);
}

/* Side Navigation Header */
.side-nav-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--neu-shadow-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--neu-gradient-primary);
    color: white;
}

.side-nav-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.side-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 48px;  /* Increased touch target */
    height: 48px; /* Increased touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
}

.side-nav-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.side-nav-close:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
}

/* Side Navigation Content */
.side-nav-content {
    padding: 1.25rem;
}

.side-nav-section {
    margin-bottom: 2rem;
}

.side-nav-section:last-child {
    margin-bottom: 0;
}

.side-nav-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neu-text);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Side Navigation Stats */
.side-nav-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.side-stat-item {
    background: var(--neu-surface);
    border: none;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-flat);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    width: 100%;
}

.side-stat-item:hover,
.side-stat-item.active {
    box-shadow: var(--neu-shadow-raised);
    transform: translateY(-1px);
}

.side-stat-item.important {
    border-left: 4px solid #b91c1c;
}

.side-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.side-stat-icon svg {
    width: 20px;
    height: 20px;
}

.side-stat-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.side-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neu-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.side-stat-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neu-text);
}

/* Side Navigation Filters */
.side-nav-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-filter-item {
    background: var(--neu-surface);
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-flat);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    width: 100%;
    color: var(--neu-text);
    font-weight: 500;
}

.side-filter-item:hover {
    box-shadow: var(--neu-shadow-raised);
    transform: translateY(-1px);
}

.side-filter-item.active {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.side-filter-indicator {
    width: 12px;
    height: 12px;
    border: 2px solid var(--neu-text-light);
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.side-filter-item.active .side-filter-indicator {
    background: white;
    border-color: white;
    box-shadow: inset 0 0 0 2px var(--neu-primary);
}

.side-filter-text {
    font-size: 0.875rem;
}

/* Mobile Responsive FAB */
@media (max-width: 480px) {
    .fab-container {
        bottom: 16px;
        right: 16px;
    }
    
    .fab-button {
        width: 52px;
        height: 52px;
    }
    
    .fab-button svg {
        width: 22px;
        height: 22px;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .user-info-minimal {
        display: flex;
        align-items: center;
    }
    
    .header-title-minimal h1 {
        font-size: 1.25rem;
    }
}

/* Desktop: Show full header when space allows */
@media (min-width: 1024px) {
    .header.mobile-optimized {
        padding: 1rem 0 0.5rem 0;
        min-height: auto;
    }
    
    .header-content-minimal {
        min-height: 60px;
    }
    
    .header-title-minimal h1 {
        font-size: 1.5rem;
    }
    
    .user-info-minimal {
        display: flex;
        align-items: center;
        margin-right: 1rem;
    }
    
    .header-actions-minimal {
        gap: 1rem;
    }
    
    /* Show collapsible navigation by default on desktop */
    .header-navigation-collapsible {
        display: block !important;
        animation: none;
        margin-top: 1rem;
    }
    
    .hamburger-btn {
        display: none;
    }
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-direction: column;
}

.header-title svg {
    width: 2rem;
    height: 2rem;
    color: var(--neu-primary);
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
}

.header-title h1 {
    font-size: clamp(1.25rem, 4vw, 2rem); /* Fluid main heading */
    font-weight: 700;
    background: var(--neu-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.header-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-direction: column;
}

/* Mobile Header Actions - Theme Toggle oberhalb des Ticket-Buttons */
@media (max-width: 479px) {
    .header-actions {
        gap: 0.75rem;
    }
}

/* Header Navigation - Stats + Filter */
.header-navigation {
    margin: 0.75rem 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Filter Radio Group - Unter Stats Navigation */
.filter-radio-group {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Stats Navigation - Compact Horizontal */
.stats-nav {
    display: flex;
    gap: 0.5rem;
}

.stat-nav-item {
    background: var(--neu-surface);
    border: none;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
    min-height: 40px;
    text-align: left;
    font-size: 0.875rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-nav-item:hover,
.stat-nav-item:focus {
    box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
    transform: translateY(-0.5px);
    outline: none;
}

.stat-nav-item:active {
    box-shadow: var(--neu-shadow-pressed);
    transform: translateY(0);
}

.stat-nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-nav-icon svg {
    width: 14px;
    height: 14px;
}

.stat-nav-text {
    font-weight: 600;
    color: var(--neu-text);
    font-size: 0.875rem;
}

/* Filter Radio Group - Neumorphism Style */
.filter-radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.filter-radio-label {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
    min-height: 40px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.filter-radio-label:hover {
    box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
    transform: translateY(-0.5px);
}

.filter-radio-label:active {
    box-shadow: var(--neu-shadow-pressed);
    transform: translateY(0);
}

/* Active state for checked radio button */
.filter-radio-group input[type="radio"]:checked + .filter-radio-label {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: var(--neu-shadow-flat);
    transform: translateY(0);
}

.filter-radio-group input[type="radio"]:checked + .filter-radio-label:hover {
    box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
    transform: translateY(-1px);
}

/* Stats Grid - Mobile First (Single Column) */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--neu-surface);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--neu-shadow-raised);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: left;
    min-height: 48px; /* Touch target */
    width: 100%;
}

.stat-card:hover,
.stat-card:focus {
    box-shadow: 10px 10px 20px var(--neu-shadow-dark), -10px -10px 20px var(--neu-shadow-light);
    transform: translateY(-1px);
    outline: none;
}

.stat-card:active {
    box-shadow: var(--neu-shadow-pressed);
    transform: translateY(0);
}

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

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--neu-shadow-subtle);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--neu-text-light);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem); /* Fluid stat values */
    font-weight: 700;
    color: var(--neu-text-dark);
}

/* Filter Buttons - Mobile Stack */
.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.filter-button {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
    min-height: 48px;
    text-align: center;
    font-size: clamp(0.875rem, 2.5vw, 1rem); /* Fluid filter button text */
}

.filter-button:hover,
.filter-button:focus {
    box-shadow: var(--neu-shadow-pressed);
    outline: none;
}

.filter-button.active {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: var(--neu-shadow-flat);
}

.stat-nav-item.active {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: var(--neu-shadow-flat);
}

.stat-nav-item.active .stat-nav-text {
    color: white;
}

.stat-nav-item.active .stat-nav-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* Ticket List - Mobile Optimized */
.ticket-list {
    background: var(--neu-surface);
    border-radius: 16px;
    box-shadow: var(--neu-shadow-raised);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.ticket-list-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.ticket-list-header h2 {
    font-size: clamp(1.125rem, 3vw, 1.5rem); /* Fluid section headings */
    font-weight: 700;
    color: var(--neu-text-dark);
}

/* Ticket Search Styles */
.ticket-search-container {
    margin: 1rem 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--neu-surface);
    border-radius: 16px;
    box-shadow: var(--neu-shadow-pressed);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    box-shadow: var(--neu-shadow-flat);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--neu-text-light);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.ticket-search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    color: var(--neu-text);
    font-family: inherit;
}

.ticket-search-input::placeholder {
    color: var(--neu-text-light);
    font-size: 0.95rem;
}

.search-clear-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 50%;
    color: var(--neu-text-light);
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.search-clear-btn:hover {
    color: var(--neu-danger);
    background: rgba(255, 107, 107, 0.1);
}

.search-clear-btn svg {
    width: 18px;
    height: 18px;
}

.search-clear-btn.hidden {
    display: none;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .ticket-search-container {
        margin: 0.75rem 0;
    }
    
    .search-input-wrapper {
        padding: 0.625rem 0.875rem;
    }
    
    .ticket-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .search-icon {
        width: 18px;
        height: 18px;
        margin-right: 0.625rem;
    }
    
    .search-clear-btn svg {
        width: 16px;
        height: 16px;
    }
}

.ticket-list-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ticket-count {
    color: var(--neu-text-light);
    font-weight: 500;
    background: var(--neu-surface);
    padding: 0.5rem 1rem;
    border-radius: 16px;
    box-shadow: var(--neu-shadow-pressed);
    font-size: 0.875rem;
}

.view-toggle-btn {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover,
.view-toggle-btn:focus {
    box-shadow: var(--neu-shadow-pressed);
    outline: none;
}

.view-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: all 0.3s ease;
}

/* Mobile Table - Horizontal Scroll with better UX */
.ticket-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: var(--neu-shadow-pressed);
    margin: 0 -1rem; /* Extend to container edges */
    padding: 0 1rem;
}

.ticket-table {
    width: 100%;
    min-width: 600px; /* Minimum for readability */
    border-collapse: collapse;
    background: var(--neu-surface);
}

.ticket-table th {
    background: var(--neu-surface);
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--neu-text-dark);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--neu-shadow-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ticket-table td {
    padding: 0.75rem 0.5rem;
    color: var(--neu-text);
    border-bottom: 1px solid rgba(209, 209, 209, 0.2);
    font-size: clamp(0.8rem, 2vw, 0.9rem); /* Fluid table text */
}

.ticket-table tbody tr {
    transition: all 0.3s ease;
}

.ticket-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.ticket-subject {
    font-weight: 600;
    color: var(--neu-text-dark);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-contact,
.ticket-date {
    color: var(--neu-text-light);
    font-size: 0.8rem;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-status,
.ticket-priority {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: clamp(0.65rem, 1.8vw, 0.75rem); /* Fluid badge text */
    font-weight: 600;
    box-shadow: var(--neu-shadow-subtle);
    white-space: nowrap;
}

.ticket-status.open {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
}

.ticket-status.in_progress {
    background: linear-gradient(135deg, #ffe66d 0%, #ffed4a 100%);
    color: var(--neu-text-dark);
}

.ticket-status.completed {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.ticket-priority.low {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--neu-text-dark);
}

.ticket-priority.medium {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    color: var(--neu-text-dark);
}

.ticket-priority.high {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: white;
}

/* Button System - Touch Optimized */
.btn {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    min-height: 48px;
    font-size: clamp(0.875rem, 2.5vw, 1rem); /* Fluid button text */
    width: 100%;
}

.btn:hover,
.btn:focus {
    box-shadow: var(--neu-shadow-pressed);
    outline: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: var(--neu-shadow-flat);
}

.btn-primary:hover,
.btn-primary:focus {
    box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
}

.btn svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.btn-secondary {
    background: var(--neu-surface);
    color: var(--neu-text);
    box-shadow: var(--neu-shadow-subtle);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #e55656 100%);
    color: white;
    box-shadow: var(--neu-shadow-flat);
}

/* Modal Styles - Mobile Optimized with Safe Area */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--neu-surface);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 80px rgba(255, 255, 255, 0.4),
        0 0 120px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    width: 100%;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
}

.modal-scrollable {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(118, 75, 162, 0.3) transparent;
}

.modal-scrollable::-webkit-scrollbar {
    width: 4px;
}

.modal-scrollable::-webkit-scrollbar-track {
    background: rgba(209, 209, 209, 0.1);
    border-radius: 2px;
}

.modal-scrollable::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--neu-primary) 0%, var(--neu-secondary) 100%);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.modal-scrollable::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--neu-secondary) 0%, var(--neu-accent) 100%);
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(209, 209, 209, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.modal-title {
    font-size: clamp(1.125rem, 3vw, 1.4rem); /* Fluid modal titles */
    font-weight: 700;
    color: var(--neu-text-dark);
}

.close-button {
    background: var(--neu-surface);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text-light);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.close-button:hover,
.close-button:focus {
    box-shadow: var(--neu-shadow-pressed);
    color: var(--neu-text-dark);
    outline: none;
}

.modal-body {
    padding: 1.25rem;
    position: relative;
    z-index: 1;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(209, 209, 209, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

/* Form Elements - Touch Optimized */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--neu-text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    box-shadow: var(--neu-shadow-pressed);
    width: 100%;
    color: var(--neu-text);
    font-size: 16px; /* Prevents iOS zoom */
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 48px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    box-shadow: inset 2px 2px 4px var(--neu-shadow-dark), inset -2px -2px 4px var(--neu-shadow-light);
}

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

/* Priority Buttons - Mobile Stack */
.priority-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.priority-button {
    position: relative;
    cursor: pointer;
    width: 100%;
}

.priority-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.priority-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: var(--neu-surface);
    color: var(--neu-text);
    box-shadow: var(--neu-shadow-subtle);
    min-height: 48px;
    width: 100%;
}

.priority-input:checked + .priority-custom {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: var(--neu-shadow-flat);
}

.priority-high .priority-input:checked + .priority-custom {
    background: linear-gradient(135deg, #ff6b6b 0%, #e55656 100%);
}

.priority-medium .priority-input:checked + .priority-custom {
    background: linear-gradient(135deg, #ffe66d 0%, #f1c40f 100%);
    color: var(--neu-text-dark);
}

.priority-low .priority-input:checked + .priority-custom {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.warning-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Status Buttons - Horizontal Layout, Subtle Design */
.status-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.status-button {
    position: relative;
    cursor: pointer;
    flex: 1;
}

.status-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.status-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: var(--neu-surface);
    color: var(--neu-text);
    box-shadow: var(--neu-shadow-subtle);
    min-height: 44px;
    width: 100%;
}

.status-input:checked + .status-custom {
    background: var(--neu-gradient-primary);
    color: white;
    box-shadow: var(--neu-shadow-pressed);
    transform: translateY(1px);
}

.status-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    stroke-width: 2;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.status-input:checked + .status-custom .status-icon {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .status-custom {
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
        gap: 0.3rem;
    }
    
    .status-icon {
        font-size: 0.8rem;
        width: 0.9rem;
        height: 0.9rem;
    }
}

/* Checkbox Styles - Mobile Optimized */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: var(--neu-surface);
    box-shadow: var(--neu-shadow-subtle);
    min-height: 48px;
    justify-content: center;
}

.checkbox-label:hover,
.checkbox-label:focus-within {
    box-shadow: var(--neu-shadow-pressed);
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    position: relative;
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--neu-surface);
    border-radius: 6px;
    box-shadow: var(--neu-shadow-pressed);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--neu-gradient-primary);
    box-shadow: var(--neu-shadow-flat);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 0.125rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.9rem;
    color: var(--neu-text);
    font-weight: 600;
}

.checkbox-divider {
    display: none; /* Hidden on mobile */
}

/* Dropzone - Mobile Optimized */
.dropzone {
    border: 2px dashed var(--neu-text-light);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--neu-surface);
    box-shadow: var(--neu-shadow-pressed);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover,
.dropzone:focus {
    border-color: var(--neu-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    outline: none;
}

.dropzone-text {
    color: var(--neu-text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropzone-text strong {
    color: var(--neu-primary);
}

/* Success Message */
.success-message {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--neu-shadow-flat);
    animation: slideIn 0.3s ease-out;
    margin-top: 0.5rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Autocomplete */
.contact-autocomplete {
    position: relative;
}

.contact-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--neu-surface);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--neu-shadow-raised);
}

.contact-suggestion-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

.contact-suggestion-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.contact-suggestion-item.selected {
    background: var(--neu-gradient-primary);
    color: white;
}

.contact-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.contact-email {
    color: var(--neu-text-light);
    font-size: 0.8rem;
}

.contact-suggestion-item.selected .contact-email {
    color: rgba(255, 255, 255, 0.8);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* Additional Ticket Elements */
.ticket-details {
    padding: 1.25rem;
    background: var(--neu-surface);
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: var(--neu-shadow-pressed);
}

.ticket-description {
    margin-bottom: 1.25rem;
    color: var(--neu-text);
    line-height: 1.6;
    font-size: 0.9rem;
    background: var(--neu-surface);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--neu-shadow-subtle);
}

.ticket-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background: var(--neu-surface);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--neu-shadow-subtle);
}

.ticket-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticket-info-label {
    font-size: 0.75rem;
    color: var(--neu-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ticket-info-value {
    color: var(--neu-text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.ticket-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(209, 209, 209, 0.3);
}

.ticket-action-button {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    min-height: 48px;
}

.ticket-action-button:hover,
.ticket-action-button:focus {
    box-shadow: var(--neu-shadow-pressed);
    outline: none;
}

.ticket-action-button.delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #e55656 100%);
    color: white;
}

.ticket-action-button svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Ticket Cards - Mobile Optimized */
.ticket-cards-container {
    width: 100%;
}

.ticket-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.ticket-card {
    background: var(--neu-surface);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--neu-shadow-raised);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ticket-card:hover {
    box-shadow: 10px 10px 20px var(--neu-shadow-dark), -10px -10px 20px var(--neu-shadow-light);
    transform: translateY(-2px);
}

.ticket-card:active {
    box-shadow: var(--neu-shadow-pressed);
    transform: translateY(0);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.ticket-card-title {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem); /* Fluid card title */
    font-weight: 700;
    color: var(--neu-text-dark);
    line-height: 1.3;
    flex: 1;
}

.ticket-card-date {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem); /* Fluid card date */
    color: var(--neu-text-light);
    font-weight: 500;
    white-space: nowrap;
    background: var(--neu-surface);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    box-shadow: var(--neu-shadow-pressed);
}

.ticket-card-body {
    margin-bottom: 1rem;
}

.ticket-card-contact {
    font-size: clamp(0.8rem, 2vw, 0.9rem); /* Fluid card contact */
    color: var(--neu-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticket-card-contact::before {
    content: '👤';
    font-size: 0.875rem;
}

.ticket-card-assigned {
    font-size: 0.875rem;
    color: var(--neu-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticket-card-assigned::before {
    content: '👥';
    font-size: 0.875rem;
}

.ticket-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ticket-card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ticket-card-status,
.ticket-card-priority {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--neu-shadow-subtle);
    white-space: nowrap;
}

.ticket-card-status.open {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
}

.ticket-card-status.in_progress {
    background: linear-gradient(135deg, #ffe66d 0%, #ffed4a 100%);
    color: var(--neu-text-dark);
}

.ticket-card-status.completed {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.ticket-card-priority.low {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--neu-text-dark);
}

.ticket-card-priority.medium {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    color: var(--neu-text-dark);
}

.ticket-card-priority.high {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: white;
}

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

.ticket-card-action-btn {
    background: var(--neu-surface);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    color: var(--neu-text);
}

.ticket-card-action-btn:hover,
.ticket-card-action-btn:focus {
    box-shadow: var(--neu-shadow-pressed);
    outline: none;
}

.ticket-card-action-btn.delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #e55656 100%);
    color: white;
}

.ticket-card-action-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Loading state for cards */
.ticket-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ticket-card.loading .ticket-card-header,
.ticket-card.loading .ticket-card-body,
.ticket-card.loading .ticket-card-footer {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Custom Scrollbar - Mobile Optimized */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--neu-surface);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: var(--neu-gradient-primary);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neu-gradient-accent);
}

/* RESPONSIVE BREAKPOINTS - Progressive Enhancement */

/* Small Devices (Large Phones) - 480px+ */
@media (min-width: 480px) {
    .container {
        padding: 1.25rem;
    }
    
    .header-title {
        flex-direction: row;
    }
    
    .header-title h1 {
        font-size: 1.75rem;
    }
    
    .header-actions {
        flex-direction: row;
        width: auto;
    }
    
    /* Header Navigation - 480px+ */
    
    .filter-radio-label {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    .stats-nav {
        gap: 0.75rem;
    }
    
    .filter-radio-group {
        gap: 0.5rem;
    }
    
    .filter-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-button {
        width: auto;
        min-width: 120px;
    }
    
    .btn {
        width: auto;
        min-width: 120px;
    }
    
    .modal-footer {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .priority-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .priority-custom {
        width: auto;
        min-width: 120px;
    }
    
    .checkbox-group {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .checkbox-label {
        width: auto;
        min-width: 120px;
    }
    
    .checkbox-divider {
        display: block;
        color: var(--neu-text-light);
        font-size: 1.2rem;
        padding: 0 0.5rem;
    }
}

/* Medium Devices (Tablets) - 640px+ */
@media (min-width: 640px) {
    .container {
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .header-actions {
        width: auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .ticket-list-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .ticket-list-controls {
        justify-content: flex-end;
    }
    
    .ticket-count {
        align-self: center;
    }
    
    .ticket-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .ticket-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ticket-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .ticket-action-button {
        width: auto;
        min-width: 120px;
    }
    
    .modal-content {
        max-width: 500px;
    }
}

/* Large Tablets - 768px+ */
@media (min-width: 768px) {
    .header-title h1 {
        font-size: 2rem;
    }
    
    .header-title svg {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .stat-icon svg {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .ticket-table th,
    .ticket-table td {
        padding: 1rem 0.75rem;
    }
    
    .ticket-subject {
        max-width: 200px;
    }
    
    .ticket-contact,
    .ticket-date {
        max-width: 150px;
    }
    
    .ticket-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop - 1024px+ */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding: 2rem;
    }
    
    .header {
        padding: 1.5rem 0 1rem 0;
    }
    
    /* Header Navigation - Desktop 1024px+ */
    .header-navigation {
        margin: 1rem 0;
    }
    
    .stats-nav {
        gap: 1rem;
    }
    
    .stat-nav-item {
        padding: 0.75rem 1rem;
    }
    
    .filter-radio-group {
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .ticket-list {
        padding: 2rem;
    }
    
    .ticket-table-container {
        margin: 0; /* Reset mobile extension */
        padding: 0;
    }
    
    .ticket-table {
        min-width: auto; /* Remove mobile constraint */
    }
    
    .ticket-subject {
        max-width: 300px;
    }
    
    .ticket-contact,
    .ticket-date {
        max-width: 200px;
    }
    
    .modal-content {
        max-width: 600px;
    }
    
    .ticket-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ticket-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    /* Hide view toggle on desktop - always show table */
    .view-toggle-btn {
        display: none;
    }
    
    #cardView {
        display: none !important;
    }
    
    #tableView {
        display: block !important;
    }
    
    /* Enhanced shadows for desktop */
    :root {
        --neu-shadow-raised: 10px 10px 20px var(--neu-shadow-dark), -10px -10px 20px var(--neu-shadow-light);
        --neu-shadow-pressed: inset 5px 5px 10px var(--neu-shadow-dark), inset -5px -5px 10px var(--neu-shadow-light);
        --neu-shadow-flat: 5px 5px 10px var(--neu-shadow-dark), -5px -5px 10px var(--neu-shadow-light);
        --neu-shadow-subtle: 3px 3px 6px var(--neu-shadow-dark), -3px -3px 6px var(--neu-shadow-light);
    }
}

/* Large Desktop - 1280px+ */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    .stats-grid {
        gap: 2.5rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements meet iOS guidelines */
    .btn,
    .filter-button,
    .stat-card,
    .checkbox-label,
    .priority-custom,
    .close-button,
    .ticket-action-button,
    .contact-suggestion-item {
        min-height: 44px;
    }
    
    /* Prevent iOS zoom on form focus */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
    }
    
    /* Enhanced touch scrolling */
    .ticket-table-container,
    .modal-scrollable,
    .contact-suggestions {
        -webkit-overflow-scrolling: touch;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .header-title svg,
    .stat-icon svg,
    .btn svg,
    .ticket-action-button svg,
    .warning-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .header-actions,
    .filter-buttons,
    .btn,
    .ticket-action-button,
    .modal,
    .close-button {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .ticket-list,
    .stat-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        page-break-inside: avoid;
    }
    
    .ticket-table-container {
        overflow: visible;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Login Modal Styling */
.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-btn {
    background: var(--neu-surface);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--neu-shadow-subtle);
    width: 100%;
    text-align: left;
}

.login-btn:hover {
    box-shadow: var(--neu-shadow-raised);
    transform: translateY(-1px);
}

.login-btn:active {
    box-shadow: var(--neu-shadow-pressed);
    transform: translateY(0);
}

.login-btn-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-icon {
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neu-surface);
    border-radius: 50%;
    box-shadow: var(--neu-shadow-pressed);
    flex-shrink: 0;
}

.login-btn .user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.login-btn .user-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--neu-text-dark);
    margin-bottom: 0.25rem;
}

.login-btn .user-role {
    font-size: 0.9rem;
    color: var(--neu-text-light);
}

/* User Info in Header */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-greeting {
    font-weight: 600;
    color: var(--neu-text-dark);
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--neu-primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--neu-secondary);
    background: rgba(102, 126, 234, 0.1);
}

.logout-btn {
    background: var(--neu-surface);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--neu-shadow-raised);
    margin-left: 0.5rem;
}

.logout-btn:hover {
    box-shadow: var(--neu-shadow-pressed);
    transform: scale(0.95);
    border-color: var(--neu-danger);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
    color: var(--neu-danger);
}

/* Responsive Login Modal */
@media (max-width: 640px) {
    .login-btn-content {
        gap: 0.75rem;
    }
    
    .user-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }
    
    .login-btn .user-name {
        font-size: 1rem;
    }
    
    .login-btn .user-role {
        font-size: 0.8rem;
    }
}

/* Adjust header actions layout */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions .user-info {
    margin-right: 1.5rem;
}

@media (max-width: 640px) {
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .user-name {
        font-size: 0.9rem;
    }
    
    .header-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Timeline Styling */
.ticket-history-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--neu-shadow-dark);
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neu-text-dark);
    margin: 0;
}

.section-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--neu-primary);
}

.timeline {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--neu-primary) transparent;
}

.timeline::-webkit-scrollbar {
    width: 4px;
}

.timeline::-webkit-scrollbar-thumb {
    background: var(--neu-gradient-primary);
    border-radius: 2px;
}

.timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--neu-text-light);
}

.loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--neu-shadow-light);
    border-top: 2px solid var(--neu-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timeline-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -24px;
    width: 2px;
    background: linear-gradient(to bottom, var(--neu-shadow-dark), transparent);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--neu-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--neu-shadow-subtle);
    font-size: 1.2rem;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-icon.created {
    color: #10b981;
    background: #d1fae5;
}

.timeline-icon.comment {
    color: #3b82f6;
    background: #dbeafe;
}

.timeline-icon.status_change {
    color: #f59e0b;
    background: #fef3c7;
}

.timeline-icon.priority_change {
    color: #ef4444;
    background: #fee2e2;
}

.timeline-icon.assignment_change {
    color: #8b5cf6;
    background: #ede9fe;
}

.timeline-icon.field_change {
    color: #6b7280;
    background: #f3f4f6;
}

.timeline-content {
    flex: 1;
    background: var(--neu-surface);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--neu-shadow-pressed);
}

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

.timeline-user {
    font-weight: 600;
    color: var(--neu-primary);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--neu-text-light);
}

.timeline-description {
    color: var(--neu-text-dark);
    line-height: 1.5;
}

.comment-content {
    background: var(--neu-surface);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid var(--neu-primary);
    margin: 0.5rem 0;
    font-style: italic;
    white-space: pre-wrap;
}

.change-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.change-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.change-badge.old {
    background: #fee2e2;
    color: #dc2626;
}

.change-badge.new {
    background: #d1fae5;
    color: #059669;
}

.add-comment {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.add-comment textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
}

.timeline-empty {
    text-align: center;
    padding: 2rem;
    color: var(--neu-text-light);
}

.timeline-empty-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: var(--neu-shadow-dark);
}

/* Responsive Timeline */
@media (max-width: 640px) {
    .timeline-item {
        gap: 0.75rem;
    }
    
    .timeline-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .timeline-item:not(:last-child)::after {
        left: 16px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .timeline-date {
        font-size: 0.75rem;
    }
    
    .change-details {
        flex-direction: column;
    }
    
    .add-comment textarea {
        min-height: 60px;
    }
}

/* Auth-Required Screen & Login-Modal Styles - Safe Area Enhanced */
.auth-required-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--neu-surface) 0%, rgba(230, 231, 238, 0.95) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.login-modal {
    width: 100%;
    max-width: 400px;
    animation: slideInUp 0.4s ease-out;
}

.modal-subtitle {
    color: var(--neu-text-light);
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    text-align: center;
}

.login-info {
    text-align: center;
    padding: 1rem 0 0 0;
    border-top: 1px solid rgba(209, 209, 209, 0.3);
    margin-top: 1rem;
}

.login-info small {
    color: var(--neu-text-light);
    font-size: 0.8rem;
}

.btn-full-width {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    color: #e55656;
    padding: 0.75rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    border-left: 3px solid #e55656;
}

.error-message.hidden {
    display: none;
}

.error-visible {
    display: block \!important;
    animation: shake 0.5s ease-in-out;
}

.success-visible {
    display: block \!important;
    background: rgba(78, 205, 196, 0.1);
    color: #44a08d;
    border-left-color: #44a08d;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .auth-required-screen {
        padding: 0.5rem;
    }
    
    .login-modal {
        max-width: 100%;
    }
}
