/**
 * Plan.is - Modern UI Stylesheet
 * Design: Clean, animated, responsive
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    /* Farben */
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --secondary-color: #2c3e50;
    --secondary-hover: #34495e;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    
    /* Graustufen */
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Layout */
    --sidebar-width: 320px;
    --sidebar-collapsed-width: 80px;
    --header-height: 80px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Schatten */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden; /* Prevent body scroll, only scroll in containers */
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    animation: bounce 1s ease infinite;
}

.login-app-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.4);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    color: var(--secondary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-600);
    font-size: 15px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--gray-600);
    font-size: 13px;
}

/* ============================================
   App Container & Layout
   ============================================ */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-base);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Im normalen Zustand: Alles sichtbar */
.sidebar .nav-text,
.sidebar .user-details,
.sidebar .app-logo h2,
.sidebar .nav-section h3 span,
.sidebar .user-dropdown-arrow {
    opacity: 1;
    visibility: visible;
    transition: all var(--transition-base);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-details,
.sidebar.collapsed .app-logo h2,
.sidebar.collapsed .app-logo-img,
.sidebar.collapsed .nav-section h3 span,
.sidebar.collapsed .user-dropdown-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
    visibility: hidden;
}


/* Sidebar Header */
.sidebar-header {
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
}

.app-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: all var(--transition-base);
}

.app-logo-img:hover {
    transform: scale(1.05);
}

.app-logo h2 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    transition: opacity var(--transition-base);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.sidebar-toggle {
    background: rgba(52, 152, 219, 0.2);
    border: 2px solid rgba(52, 152, 219, 0.5);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.sidebar-toggle::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--border-radius-sm);
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(52, 152, 219, 0.4);
    border-color: rgba(52, 152, 219, 0.8);
    transform: scale(1.15);
}

.sidebar-toggle:hover::before {
    border-color: rgba(52, 152, 219, 0.6);
    animation: pulse-border 1.5s ease-in-out infinite;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle i {
    font-size: 22px;
    transition: transform var(--transition-base);
}

.sidebar.collapsed .sidebar-toggle {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
}

.sidebar.collapsed .sidebar-toggle:hover {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.8);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(255,255,255,0.4);
        transform: scale(1);
    }
    50% {
        border-color: rgba(255,255,255,0.8);
        transform: scale(1.05);
    }
}

.sidebar-toggle.pulse-attention {
    animation: pulse-attention 1s ease-in-out 3;
}

@keyframes pulse-attention {
    0%, 100% {
        background: rgba(255,255,255,0.1);
        box-shadow: 0 0 0 0 rgba(255,255,255,0.4);
    }
    50% {
        background: rgba(255,255,255,0.3);
        box-shadow: 0 0 0 8px rgba(255,255,255,0);
    }
}

/* User Info */
.user-info-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-info.active {
    background: rgba(52, 152, 219, 0.2);
}

.user-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 48px;
    color: var(--primary-color);
    transition: transform var(--transition-base);
}

.user-avatar-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
}

.user-info:hover .user-avatar i {
    transform: scale(1.1);
}

.user-details {
    flex: 1;
    transition: opacity var(--transition-base);
    min-width: 0;
}

.user-details strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.user-details small {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: capitalize;
    font-weight: 500;
}

.user-dropdown-arrow {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.user-info:hover .user-dropdown-arrow {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(2px);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
    overflow: hidden;
}

.user-info-link:hover .user-dropdown,
.user-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--gray-800);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--gray-100);
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: var(--gray-50);
    padding-left: 24px;
}

.user-dropdown-item i {
    font-size: 18px;
    color: var(--gray-600);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-dropdown-item span {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.user-dropdown-item.logout {
    color: var(--danger-color);
}

.user-dropdown-item.logout i {
    color: var(--danger-color);
}

.user-dropdown-item.logout:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Collapsed State für User-Info */
.sidebar.collapsed .user-details,
.sidebar.collapsed .user-dropdown-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .user-avatar i {
    font-size: 40px;
}

.sidebar.collapsed .user-avatar-name {
    font-size: 13px;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    padding: 20px 10px;
}


/* Collapsed State für User-Dropdown */
.sidebar.collapsed .user-dropdown {
    left: 10px;
    right: 10px;
}

.sidebar.collapsed .user-dropdown-item {
    justify-content: center;
    padding: 14px 10px;
}

.sidebar.collapsed .user-dropdown-item i {
    margin: 0;
}

.sidebar.collapsed .user-dropdown-item span {
    display: none;
}
/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section h3 {
    padding: 0 20px;
    margin-bottom: 10px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-section h3 i {
    font-size: 12px;
}

.nav-tree {
    list-style: none;
}

.nav-tree li {
    margin-bottom: 2px;
}

.nav-tree a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-tree a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--primary-color);
    transition: width var(--transition-base);
}

.nav-tree a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 28px;
}

.nav-tree a:hover::before {
    width: 4px;
}

.nav-tree li.active a {
    background: rgba(52, 152, 219, 0.3);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.nav-tree i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-text {
    transition: opacity var(--transition-base);
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--danger-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.nav-badge-inbox {
    /* Optional: spezielles Styling für Posteingang */
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--gray-50);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    min-height: var(--header-height);
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header h1 {
    font-size: 28px;
    color: var(--secondary-color);
    font-weight: 700;
}

/* ============================================
   Tasks Container
   ============================================ */
.tasks-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.tasks-container::-webkit-scrollbar {
    width: 10px;
}

.tasks-container::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.tasks-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 5px;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   Task Card
   ============================================ */
.task-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s ease-out backwards;
}

.task-card:nth-child(1) { animation-delay: 0.05s; }
.task-card:nth-child(2) { animation-delay: 0.1s; }
.task-card:nth-child(3) { animation-delay: 0.15s; }
.task-card:nth-child(4) { animation-delay: 0.2s; }
.task-card:nth-child(5) { animation-delay: 0.25s; }
.task-card:nth-child(6) { animation-delay: 0.3s; }

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.task-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.task-card:hover::before {
    transform: scaleX(1);
}

.task-card-header {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.task-priority,
.task-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform var(--transition-fast);
}

.task-card:hover .task-priority,
.task-card:hover .task-status {
    transform: scale(1.05);
}

.task-priority.priority-niedrig {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.task-priority.priority-mittel {
    background: rgba(243, 156, 18, 0.15);
    color: #d68910;
}

.task-priority.priority-hoch {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.task-priority.priority-kritisch {
    background: #c0392b;
    color: white;
}

.task-status.status-neu {
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}

.task-status.status-offen {
    background: rgba(26, 188, 156, 0.15);
    color: #16a085;
}

.task-status.status-in_bearbeitung {
    background: rgba(243, 156, 18, 0.15);
    color: #d68910;
}

.task-status.status-storniert {
    background: rgba(149, 165, 166, 0.15);
    color: #7f8c8d;
}

.task-status.status-fertig {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.task-title {
    font-size: 19px;
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-weight: 700;
    line-height: 1.4;
}

.task-description {
    color: var(--gray-600);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.task-category {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    transition: transform var(--transition-fast);
}

.task-card:hover .task-category {
    transform: scale(1.05);
}

.task-date {
    font-size: 12px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-500);
    animation: fadeIn 0.6s ease-out;
}

.empty-state i {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.empty-state p {
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 600;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    width: 100%;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 24px;
    animation: slideUp 0.4s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.05s; }
.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="color"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-base);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s ease-out;
}

.alert i {
    font-size: 20px;
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #d68910;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border-left: 4px solid var(--info-color);
}

/* ============================================
   Quill Editor Styling
   ============================================ */
.quill-editor {
    background: white;
    border-radius: var(--border-radius-sm);
}

.ql-toolbar {
    border-top-left-radius: var(--border-radius-sm);
    border-top-right-radius: var(--border-radius-sm);
}

.ql-container {
    border-bottom-left-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
    font-size: 14px;
}

/* Mobile Menu Button - hidden by default, shown only on mobile */
.mobile-menu-btn {
    display: none;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    
    .tasks-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Fix scrolling on mobile */
    .app-container {
        overflow: visible;
        height: 100vh;
        position: relative;
    }
    
    .main-content {
        overflow-y: scroll; /* Always show scrollbar space */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        height: 100vh;
        position: relative;
        will-change: scroll-position; /* Performance hint */
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        width: 280px;
        transition: transform var(--transition-base);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    
    /* Mobile overlay/backdrop */
    .sidebar.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease-out;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 999;
        background: var(--primary-color);
        color: white;
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        cursor: pointer;
        transition: all var(--transition-base);
        font-size: 20px;
    }
    
    .mobile-menu-btn:hover {
        background: var(--primary-hover);
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    .tasks-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Ensure proper scrolling behavior */
    .tasks-container,
    .profile-container,
    .setup-container {
        padding: 20px;
        overflow-y: visible; /* Let main-content handle scrolling */
        -webkit-overflow-scrolling: touch;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding-left: 80px;
        flex-shrink: 0; /* Prevent header from shrinking */
    }
    
    .content-header h1 {
        font-size: 24px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
/* ============================================
   Notification Banner
   ============================================ */
.notification-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    margin: 0 32px 24px 32px;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-lg);
    animation: slideInDown 0.6s ease-out;
    border-left: 5px solid var(--warning-color);
}

.notification-banner.password-warning {
    background: linear-gradient(135deg, #fff5e6 0%, #ffffff 100%);
    border-left-color: var(--warning-color);
}

.notification-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: white;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(243, 156, 18, 0.5);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-content {
    flex: 1;
}

.notification-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.notification-content p {
    font-size: 14px;
    color: var(--gray-700);
    margin: 0;
    line-height: 1.5;
}

.notification-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 13px;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.notification-banner.hide {
    animation: slideOutUp 0.4s ease-out forwards;
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Responsive Notification */
@media (max-width: 768px) {
    .notification-banner {
        flex-direction: column;
        text-align: center;
        margin: 0 16px 16px 16px;
    }
    
    .notification-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .notification-actions .btn {
        width: 100%;
    }
}

/* ============================================
   User Avatar - Initialen System
   ============================================ */
.user-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-size: 0.45em; /* Relativ zur Container-Größe */
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Verschiedene Größen */
.user-avatar-initials.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.user-avatar-initials.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.user-avatar-initials.avatar-md {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.user-avatar-initials.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.user-avatar-initials.avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 36px;
}

/* Hover-Effekt */
.user-avatar-initials:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Clickable Avatar */
.user-avatar-initials.clickable {
    cursor: pointer;
}

.user-avatar-initials.clickable:active {
    transform: scale(0.95);
}

/* Avatar mit Border */
.user-avatar-initials.with-border {
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Avatar Group (überlappende Avatare) */
.avatar-group {
    display: inline-flex;
    align-items: center;
}

.avatar-group .user-avatar-initials {
    margin-left: -8px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.avatar-group .user-avatar-initials:first-child {
    margin-left: 0;
}

.avatar-group .avatar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gray-300);
    color: var(--gray-700);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-left: -8px;
    border: 2px solid white;
}

/* Online Status Indicator */
.user-avatar-initials.with-status::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border: 2px solid white;
    border-radius: 50%;
}

.user-avatar-initials.status-offline::after {
    background: var(--gray-400);
}

.user-avatar-initials.status-busy::after {
    background: #e74c3c;
}

.user-avatar-initials.status-away::after {
    background: #f39c12;
}

/* Update für bestehende Sidebar User-Avatar */
.sidebar .user-avatar {
    width: 56px;
    height: 56px;
    position: relative;
    border-radius: 50%;
    overflow: visible;
    transition: all var(--transition-base);
}

/* Entferne das alte Icon, nutze jetzt Initialen */
.sidebar .user-avatar i.fa-user-circle {
    display: none;
}

/* Positioniere Initialen in der Sidebar */
.sidebar .user-avatar .user-avatar-initials {
    width: 100%;
    height: 100%;
    font-size: 20px;
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .user-avatar .user-avatar-initials {
    font-size: 16px;
}

/* Task Card Avatare */
.task-assigned-users {
    display: flex;
    align-items: center;
    gap: -4px;
    margin-top: 8px;
}

.task-assigned-users .user-avatar-initials {
    width: 28px;
    height: 28px;
    font-size: 11px;
    margin-left: -8px;
    border: 2px solid white;
}

.task-assigned-users .user-avatar-initials:first-child {
    margin-left: 0;
}

/* Profile Page Avatar */
.profile-avatar-section {
    text-align: center;
    margin-bottom: 32px;
}

.profile-avatar-section .user-avatar-initials {
    width: 120px;
    height: 120px;
    font-size: 48px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Animation beim Laden */
@keyframes avatarFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.user-avatar-initials.animated {
    animation: avatarFadeIn 0.4s ease-out;
}

