:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --dark: #333;
    --light: #f8f9fa;
    --white: #fff;
    --gray: #6c757d;
    --radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: var(--dark);
    font-size: 24px;
    font-weight: 700;
}

.user-info {
    font-size: 14px;
    color: var(--gray);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.user-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.user-info a:hover {
    text-decoration: underline;
}

/* Logo Area */
.logo-area {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.logo-area h1 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 28px;
}

.logo-area p {
    color: var(--gray);
    font-size: 16px;
}

/* Überschriften */
h2 {
    color: var(--dark);
    margin: 25px 0 15px;
    font-size: 20px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
    font-weight: 600;
}

/* Meldungen */
.error, .success {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    border-left: 4px solid;
    font-size: 14px;
}

.error {
    background: #fee;
    color: #721c24;
    border-color: var(--danger);
}

.success {
    background: #efe;
    color: #155724;
    border-color: var(--success);
}

/* Filter Info */
.filter-info {
    background: #e7f3ff;
    border-left: 4px solid var(--primary);
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

/* Statistik */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 25px 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card.green {
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
}

.stat-card.red {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Formulare */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

button[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    padding: 14px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    align-self: flex-start;
    transition: all 0.3s;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--light);
    border-radius: 6px;
    margin: 5px 0;
}

.checkbox-container input {
    width: auto;
    margin: 0;
}

.checkbox-container label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--dark);
}

/* Admin Badge */
.admin-badge {
    background: var(--danger);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    margin-left: 8px;
    font-weight: 600;
}

/* Tabelle - WICHTIG */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    min-width: 900px;
}

thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

th, td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--light);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-open,
.status-closed,
.status-in_progress {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background: #d4edda;
    color: var(--success);
}

.status-closed {
    background: #f8d7da;
    color: var(--danger);
}

.status-in_progress {
    background: #fff3cd;
    color: #856404;
}

/* Links & Buttons */
.ticket-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.btn-view {
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-view:hover {
    background: #5568d3;
    text-decoration: none;
}

/* Admin & User Panels */
.admin-panel, .user-panel {
    padding: 15px;
    border-radius: var(--radius);
    margin-top: 15px;
    border-left: 4px solid;
}

.admin-panel {
    background: #fff3cd;
    border-color: var(--warning);
}

.user-panel {
    background: #d4edda;
    border-color: var(--success);
}

.admin-panel h3, .user-panel h3 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.admin-panel h3 {
    color: #856404;
}

.user-panel h3 {
    color: #155724;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-close {
    background: var(--success);
}

.btn-close:hover {
    background: #218838;
}

/* Message Boxes */
.message-box {
    background: var(--light);
    border: 1px solid #e1e1e1;
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 15px;
}

.message-box.admin {
    background: #e7f3ff;
    border-color: #b3d9ff;
}

.message-box.original {
    background: #f8f9fa;
    border-left: 4px solid var(--primary);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
}

.message-header strong {
    color: var(--primary);
    font-weight: 600;
}

.badge {
    background: var(--danger);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.message-body {
    line-height: 1.8;
    color: var(--dark);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Ticket Info */
.ticket-info {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.info-row {
    margin: 10px 0;
    font-size: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.info-row strong {
    min-width: 120px;
    color: var(--dark);
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 16px;
    background: var(--light);
    border-radius: var(--radius);
    margin: 20px 0;
}

/* Footer */
.footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: var(--gray);
    font-size: 12px;
}

/* Responsive */
@media (max-width: 767px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: 28px;
    }

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

    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 20px;
    }
}


.logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 767px) {
    .logo {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 120px;
    }
}