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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #2c3e50;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    width: 100%;
    margin: 0;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #e1e8ed;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 120px;
    width: auto;
}

header h1 {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 600;
    margin: 0;
}

/* Upload Section - temporarily commented out */
/*
.upload-section {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    margin-bottom: 20px;
}

.upload-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed #cbd6e2;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
    background: #f7f9fa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #1da1f2;
    background: #f0f8ff;
}

.upload-text p {
    font-size: 0.95em;
    color: #657786;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 0.85em !important;
    color: #8899a6 !important;
}
*/


/* Buttons */
button {
    background: #ffffff;
    color: #2c3e50;
    border: 1px solid #cbd6e2;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

/* Collapse Button */
.collapse-btn {
    background: transparent;
    border: none;
    padding: 2px 6px;
    margin-right: 6px;
    font-size: 12px;
    color: #657786;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.collapse-btn:hover {
    background: #f7f9fa;
    color: #2c3e50;
}

.project-controls {
    display: inline-flex;
    align-items: center;
}

.vorgang-cell {
    position: relative;
}

button:hover {
    background: #f7f9fa;
    border-color: #1da1f2;
}

button.edit-btn {
    background: #ffffff;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #cbd6e2;
}

button.edit-btn:hover {
    background: #f7f9fa;
}


/* Upload Status - temporarily commented out */
/*
#uploadStatus {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 3px;
    display: none;
    font-weight: 500;
    font-size: 0.9em;
}

#uploadStatus.success {
    background: #f0fff4;
    color: #17bf63;
    border: 1px solid #c6f6d5;
}

#uploadStatus.error {
    background: #fdf2f8;
    color: #e1306c;
    border: 1px solid #fbb6ce;
}
*/

/* Table Section */
.table-section {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
}


/* Table */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

th, td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
    vertical-align: middle;
    height: 32px;
    line-height: 24px;
}

th {
    text-align: center;
    font-weight: bold;
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ID Spalte - schmal */
th:nth-child(1), td:nth-child(1) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

/* Vorgang Spalte - flexibel, aber mindestens 300px */
th:nth-child(2), td:nth-child(2) {
    min-width: 300px;
    width: auto;
}

/* KW Spalte - schmal */
th:nth-child(3), td:nth-child(3) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

/* Dauer Spalte */
th:nth-child(4), td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
}

/* Anfang und Ende Datumsspalten */
th:nth-child(5), th:nth-child(6),
td:nth-child(5), td:nth-child(6) {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    text-align: center;
}

/* Aktionen Spalte */
th:nth-child(7), td:nth-child(7) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    text-align: center;
}

/* Bestätigt Checkbox-Spalte */
th:nth-child(8), td:nth-child(8) {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    text-align: center;
    white-space: nowrap;
}

th {
    background: #f7f9fa;
    color: #2c3e50;
    font-weight: 600;
    position: sticky;
    top: 0;
    cursor: default;
    user-select: none;
    border-bottom: 2px solid #e1e8ed;
}

th:hover {
    background: #edf2f7;
}


.collapse-controls {
    display: inline-flex;
    gap: 4px;
    margin-left: 10px;
    vertical-align: middle;
}

.collapse-all-btn, .expand-all-btn {
    background: #ffffff;
    border: 1px solid #cbd6e2;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    color: #657786;
    transition: all 0.2s ease;
}

.collapse-all-btn:hover, .expand-all-btn:hover {
    background: #f7f9fa;
    color: #2c3e50;
    border-color: #1da1f2;
}

tr {
    height: 32px;
}

tr:nth-child(even) {
    background: #fafbfc;
}

/* Task rows always white background */
.task-task {
    background: #ffffff !important;
}

.task-task:hover {
    background: #f0f8ff !important;
}

/* Confirmed task rows - light green background */
.task-confirmed {
    background: #f0fff4 !important;
}

.task-confirmed:hover {
    background: #e8f5e8 !important;
}

/* Completed task rows - orange background */
.task-completed {
    background: #fff3cd !important;
    color: #856404 !important;
    border-left: 4px solid #28a745 !important;
}

.task-completed:hover {
    background: #ffeaa7 !important;
}

/* Recently updated task rows - yellow background */
.task-updated {
    background: #fff9c4 !important;
    border-left: 4px solid #ffeb3b !important;
}

.task-updated:hover {
    background: #fff59d !important;
}

/* Puffer rows - light blue background */
.task-puffer {
    background: #e6f3ff !important;
    border-left: 4px solid #2196f3 !important;
}

.task-puffer:hover {
    background: #cce7ff !important;
}

/* Comment cell styling */
.comment-cell {
    max-width: 200px;
    word-wrap: break-word;
}

.comment-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-text {
    flex: 1;
    font-size: 13px;
    color: #555;
    line-height: 1.3;
    max-height: 6.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.comment-text:empty {
    color: #ccc;
    font-style: italic;
}

.comment-text:empty::after {
    content: "Kein Kommentar";
}

.comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
    flex-shrink: 0;
}

.comment-btn:hover {
    opacity: 1;
    background-color: #f0f8ff;
}

tr:hover:not(.no-data) {
    background: #f0f8ff;
}

/* Modern Modal Dialogs */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

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

.custom-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-modal-header.error {
    background: linear-gradient(135deg, #ff6b6b, #ffa8a8);
    color: white;
    border-bottom: none;
}

.custom-modal-header.warning {
    background: linear-gradient(135deg, #ffc107, #ffed4e);
    color: #333;
    border-bottom: none;
}

.custom-modal-header.info {
    background: linear-gradient(135deg, #007bff, #40a9ff);
    color: white;
    border-bottom: none;
}

.custom-modal-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.custom-modal-body {
    padding: 25px;
    line-height: 1.6;
    color: #333;
}

.custom-modal-body strong {
    color: #495057;
}

.custom-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.custom-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 80px;
}

.custom-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-modal-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.custom-modal-btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.custom-modal-btn.secondary {
    background: #6c757d;
    color: white;
}

.custom-modal-btn.light {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.conflict-list {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #ffc107;
}

.conflict-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

.conflict-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.conflict-task {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.conflict-details {
    font-size: 13px;
    color: #6c757d;
    margin-left: 10px;
}

.date-info {
    background: #e7f3ff;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #007bff;
    text-align: center;
}

.date-highlight {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 8px;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .custom-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-footer {
        padding: 15px;
    }
    
    .custom-modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .custom-modal-btn {
        flex: 1;
        min-width: auto;
    }
    
    .conflict-list {
        padding: 10px;
    }
    
    .conflict-item {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
}

/* Task Styling */
.task-project {
    font-weight: 600;
    background: #f7f9fa !important;
}

.task-project:hover {
    background: #edf2f7 !important;
}


/* Checkbox */
.checkbox-container {
    text-align: center;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

input[type="checkbox"] {
    cursor: pointer;
    accent-color: #1da1f2;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    transform: scale(1.1);
}

.checkbox-placeholder {
    height: 18px;
    width: 18px;
    display: inline-block;
    vertical-align: middle;
}

/* No Data Message */
.no-data td {
    text-align: center;
    padding: 40px 20px;
    color: #657786;
}

.no-data-message {
    font-size: 1em;
    line-height: 1.5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
}

.modal-content {
    background: #ffffff;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    width: 90%;
    max-width: 450px;
    position: relative;
}

.close {
    color: #657786;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #2c3e50;
}

#editForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

#editForm label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.9em;
}

#editForm input, #editForm select {
    padding: 8px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    font-size: 13px;
    background: #ffffff;
    color: #2c3e50;
}

#editForm input:focus, #editForm select:focus {
    outline: none;
    border-color: #1da1f2;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

#cancelEdit {
    background: #ffffff;
    color: #657786;
    border: 1px solid #cbd6e2;
}

#cancelEdit:hover {
    background: #f7f9fa;
}

/* Loading Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e8ed;
    border-top: 3px solid #1da1f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.overlay p {
    color: #2c3e50;
    font-size: 0.95em;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo {
        height: 120px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 4px 6px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 20px 15px;
    }
    
    button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .form-buttons {
        flex-direction: column;
    }
}

/* Filter Button */
.filter-btn {
    background: white;
    border: 1px solid #ddd;
    color: #333;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #999;
}

.filter-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.filter-btn.active:hover {
    background: #2980b9;
    border-color: #2980b9;
}

/* KW Filter Dropdown */
.kw-filter {
    background: white;
    border: 1px solid #ddd;
    color: #333;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    min-width: 80px;
    transition: all 0.3s;
}

.kw-filter:hover {
    background: #f8f9fa;
    border-color: #999;
}


/* Filter Modal */
.filter-content {
    max-height: 500px;
    overflow-y: auto;
}

.filter-controls {
    margin-bottom: 15px;
    text-align: center;
}

.filter-controls button {
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    padding: 5px 10px;
    margin: 0 5px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.filter-controls button:hover {
    background: #d5dbdb;
}

.filter-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 3px;
}

.filter-item:hover {
    background: #f8f9fa;
}

.filter-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.filter-item label {
    cursor: pointer;
    font-size: 14px;
    flex: 1;
    color: #2c3e50;
}

/* Login System */
.login-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e8f5e8;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

#loginBtn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#loginBtn:hover {
    background: #2980b9;
}

#logoutBtn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

#logoutBtn:hover {
    background: #c0392b;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.readonly-checkbox {
    opacity: 0.6;
    cursor: not-allowed;
}

.disabled-btn {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
}

.disabled-btn:hover {
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
}

.admin-only {
    display: none;
}

/* Puffer Modal Styles */
.puffer-content {
    max-height: 600px;
    overflow-y: auto;
}

/* Puffer Modal größer machen */
#pufferModal .modal-content {
    width: 95%;
    max-width: 700px;
    margin: 3% auto;
}


.task-checkbox-list {
    border: 1px solid #e1e8ed;
    border-radius: 3px;
    padding: 8px;
    background: #f7f9fa;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.task-checkbox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    padding: 3px;
    border-radius: 3px;
}

.task-checkbox-item:hover {
    background: white;
}

.task-checkbox-item:last-child {
    margin-bottom: 0;
}

.task-checkbox-item input[type="checkbox"] {
    margin-left: 0;
    cursor: pointer;
    transform: scale(0.9);
    flex-shrink: 0;
}

.task-checkbox-item label {
    cursor: pointer;
    font-size: 13px;
    color: #2c3e50;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
    min-width: 0;
}

#addToPuffer {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

#addToPuffer:hover {
    background: #218838;
}

#addToPuffer:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.puffer-list {
    border: 1px solid #e1e8ed;
    border-radius: 3px;
    padding: 10px;
    background: #f7f9fa;
    max-height: 200px;
    overflow-y: auto;
}

.puffer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 3px;
}

.puffer-item:last-child {
    margin-bottom: 0;
}

.puffer-item-text {
    flex: 1;
    font-size: 13px;
    color: #2c3e50;
}

.puffer-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.puffer-item-remove:hover {
    background: #c82333;
}