/* Reset & Base */
@import url('https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@1,700&display=swap');

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-top: 20px;
}

/* Headings */
h1, h2, h3 {
    color: #2c3e50;
}

h1 {
    border-bottom: 4px solid #3498db;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

h2 {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

h3 {
    margin-top: 0;
    font-size: 1.1em;
}

/* Control Bar */
.control-bar {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 6px;
}

.control-bar label {
    font-weight: 600;
    color: #34495e;
}

.control-bar select,
.control-bar input,
.control-bar button {
    padding: 10px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.control-bar select {
    min-width: 150px;
}

/* Buttons */
button {
    font-weight: 600;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

a.btn-primary,
a.btn-secondary,
a.btn-success,
a.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

a.btn-primary:hover,
a.btn-secondary:hover,
a.btn-success:hover,
a.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* Messages */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid;
    display: none;
}

.alert-success {
    background-color: #d5f4e6;
    color: #1e8449;
    border-left-color: #27ae60;
}

.alert-error {
    background-color: #fadbd8;
    color: #78281f;
    border-left-color: #e74c3c;
}

.alert-warning {
    background-color: #fdeaa8;
    color: #7d6608;
    border-left-color: #f39c12;
}

/* Entry List */
.entry-list {
    margin: 25px 0;
}

.entry-card {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.entry-card:hover {
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.entry-header h3 {
    margin: 0;
    color: #2980b9;
    flex: 1;
}

.entry-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #ecf0f1;
}

.entry-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.entry-detail-item {
    padding: 12px;
    background: #f8f9f9;
    border-radius: 4px;
    font-size: 13px;
    border-left: 3px solid #3498db;
}

.entry-detail-label {
    display: block;
    font-weight: 700;
    color: #2980b9;
    margin-bottom: 4px;
}

.entry-detail-value {
    color: #555;
}

.entry-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.entry-actions button {
    padding: 8px 14px;
    font-size: 12px;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select {
    height: 38px;
    padding: 8px 10px;
    line-height: 22px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input[readonly] {
    background-color: #ecf0f1;
    cursor: not-allowed;
}

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

/* Bemerkung startet so klein wie ein normales Input-Feld */
.form-group textarea.compact-textarea {
    min-height: 38px;
    height: 38px;
    padding: 8px 10px;
    line-height: 22px;
}

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

.form-actions button {
    flex: 1;
    min-width: 150px;
}

.actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #e74c3c;
}

/* Autocomplete */
.autocomplete-list {
    position: absolute;
    background: white;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-list .item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
    font-size: 13px;
}

.autocomplete-list .item:hover {
    background: #ecf0f1;
    color: #2980b9;
}

/* Info Box */
.abrechnung-info {
    background: linear-gradient(135deg, #ecf0f1 0%, #f8f9f9 100%);
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    margin: 15px 0;
}

.abrechnung-info strong {
    color: #2980b9;
    font-size: 1.1em;
}

.abrechnung-info {
    background: linear-gradient(135deg, #d5f4e6 0%, #ecf0f1 100%);
}

.abrechnung-info strong {
    color: #27ae60;
}

/* Admin Panel */
.admin-panel {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.admin-panel h2 {
    color: #856404;
    border-color: #ffc107;
}

.table-editor {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.table-editor th {
    background: #3498db;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.table-editor td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.table-editor tr:hover {
    background: #ecf0f1;
}

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

.text-center {
    text-align: center;
}

.text-muted {
    color: #95a5a6;
}

.no-entries {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .control-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-bar select,
    .control-bar button {
        width: 100%;
    }
    
    .entry-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .entry-details {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    
    .entry-card {
        padding: 15px;
    }
    
    .entry-actions {
        flex-direction: column;
    }
    
    .entry-actions button {
        width: 100%;
    }
}

/* ============== APP HEADER mit USER MENU ============== */

.app-header {
    background: #4ea3dd;
    color: white;
    padding: 34px 0 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative;
}

.app-header.theme-billing {
    background: #4ea3dd;
}

.app-header.theme-ticket {
    background: #f39c12;
}

.app-header.theme-projects {
    background: #27ae60;
}

.area-nav {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    position: absolute;
    left: 0;
    top: 0;
    transform: none;
    z-index: 2;
}

.area-link {
    width: 44px;
    height: 38px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    border-radius: 0;
    margin-right: -9px;
    padding: 7px 10px;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: none;
    transition: width 0.24s ease, transform 0.24s ease, margin-right 0.24s ease;
}

.area-link:hover {
    transform: translateY(0);
    color: #fff;
}

.area-link.active {
    width: 168px;
    margin-right: 0;
    transform: translateY(0);
    color: #fff;
    z-index: 5;
}

.area-link.tab-billing {
    background: linear-gradient(135deg, #4ea3dd 0%, #2f87c2 100%);
    box-shadow: inset -8px 0 10px rgba(0,0,0,0.13);
    z-index: 2;
}

.area-link.tab-ticket {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: inset -8px 0 10px rgba(0,0,0,0.13);
    z-index: 2;
}

.area-link.tab-projects {
    background: linear-gradient(135deg, #27ae60 0%, #1f8b4d 100%);
    box-shadow: inset -8px 0 10px rgba(0,0,0,0.13);
    z-index: 2;
}

.area-link.active.tab-billing {
    background: #4ea3dd;
    box-shadow: none;
}

.area-link.active.tab-ticket {
    background: #f39c12;
    box-shadow: none;
}

.area-link.active.tab-projects {
    background: #27ae60;
    box-shadow: none;
}

.area-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-bottom: 0;
    filter: brightness(0) invert(1);
}

.area-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    max-width: 0;
    overflow: hidden;
    transform: translateX(-2px);
    transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.22s ease;
}

.area-nav:hover .area-label {
    max-width: 120px;
    transform: translateX(0);
}

.area-link.active .area-label {
    max-width: 120px;
    transform: translateX(0);
}

.area-nav:hover .area-link {
    width: 168px;
    margin-right: 0;
}

.coming-soon-box {
    border: 1px dashed #b7c7d5;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: #f7fbfe;
}

.header-container {
    position: absolute;
    top: 0;
    right: 6px;
    margin: 0;
    padding: 0;
    z-index: 4;
    display: block;
}

.app-header h1 {
    margin: 0;
    font-size: 24px;
    border: none;
    padding-bottom: 0;
}

.user-menu {
    position: relative;
}

.user-btn {
    position: relative;
    background: rgba(255,255,255,0.15);
    color: white;
    height: 34px;
    width: 34px;
    padding: 0;
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    overflow: visible;
}

.user-btn:hover {
    background: rgba(255,255,255,0.3);
    box-shadow: none;
    transform: none;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #fff;
}

.user-btn .badge-mini-kz {
    right: -3px;
    bottom: -3px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    margin-top: 5px;
}

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

.user-dropdown a {
    display: block;
    padding: 12px 15px;
    color: #2c3e50;
    text-decoration: none;
    border-bottom: 1px solid #ecf0f1;
    transition: all 0.2s ease;
    font-size: 14px;
}

.user-dropdown a i {
    width: 18px;
    margin-right: 6px;
    text-align: center;
}

.user-dropdown a:last-of-type {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: #ecf0f1;
    padding-left: 20px;
}

.user-dropdown hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid #ecf0f1;
}

/* ============== TABELLEN STYLES ============== */

.entries-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.entries-table thead {
    background: #ecf0f1;
    border-bottom: 2px solid #bdc3c7;
}

.entries-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

.entries-table th:hover {
    background: #d5dbdb;
}

.entries-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 13px;
    color: #555;
}

.entries-table tbody tr:hover {
    background: #f8f9f9;
}

.entries-table tbody tr[draggable="true"] {
    cursor: auto;
}

.entries-table tbody tr.day-drag-over td {
    box-shadow: inset 0 2px 0 #4ea3dd, inset 0 -2px 0 #4ea3dd;
}

.entries-table tbody tr:nth-child(even) {
    background: #fafbfb;
}

.entries-table .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    margin-right: 5px;
}

.no-entries {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
    font-size: 14px;
}

/* ============== FORM LAYOUTS ============== */

.form-group.narrow {
    flex: 0 0 auto;
    min-width: 120px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-sm:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-sm.btn-danger {
    background: #e74c3c;
}

.btn-sm.btn-danger:hover {
    background: #c0392b;
}

.btn-sm:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.client-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.client-login-notice {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    align-items: end;
    margin: 0 0 14px 0;
    padding: 12px 14px;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    background: #fbfcfd;
}

.client-login-notice h3 {
    margin: 0 0 8px 0;
    font-size: 1.02rem;
}

.client-login-notice p {
    margin: 0 0 8px 0;
    line-height: 1.45;
    color: #2f3c48;
}

.client-login-notice p:last-child {
    margin-bottom: 0;
}

.client-login-notice-team {
    margin-top: 2px;
}

.client-login-signature {
    min-width: 220px;
    justify-self: end;
    text-align: right;
    opacity: 0.64;
}

.client-login-signature img {
    display: block;
    width: min(300px, 34vw);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.client-login-signature span {
    display: inline-block;
    font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive;
    font-size: clamp(34px, 5.2vw, 58px);
    line-height: 1;
    letter-spacing: 0.3px;
    color: #111;
    transform: rotate(-5deg);
    white-space: nowrap;
}

.client-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.client-ticket-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 14px;
    align-items: start;
}

.client-ticket-list-wrap,
.client-ticket-thread-wrap {
    margin-bottom: 14px;
}

.client-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-ticket-item {
    display: block;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f9fcff;
    color: inherit;
    text-decoration: none;
}

.client-ticket-item:hover {
    border-color: #5aa3d6;
    background: #edf7ff;
}

.client-ticket-item.active {
    border-color: #2f80ed;
    background: #e8f3ff;
}

.client-ticket-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.client-ticket-head-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.client-ticket-assignees {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.client-ticket-assignees .mitarbeiter-item-badge {
    width: 22px;
    height: 22px;
    font-size: 10px;
    opacity: 1;
    border-color: var(--badge-active-bg, #8AA5B8);
}

.client-ticket-assignees .mitarbeiter-item-badge.has-image {
    background: #fff;
}

.client-ticket-assignees .mitarbeiter-item-badge .badge-mini-kz {
    font-size: 7px;
}

.status-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    background: #e7eef5;
    color: #334b61;
    font-size: 11px;
    font-weight: 600;
}

.ticket-thanked {
    position: relative;
}

.ticket-thanked-corner {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffebf1;
    border: 1px solid #f3bccd;
    color: #d84f77;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 3;
}

.avatar-hovercard {
    position: fixed;
    z-index: 9999;
    width: 210px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #dce4ee;
    box-shadow: 0 12px 28px rgba(24, 34, 46, 0.22);
    padding: 12px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: perspective(700px) rotateX(-12deg) translateY(5px) scale(0.98);
    transform-origin: 50% 0%;
    transition: opacity 340ms ease, transform 340ms ease;
    will-change: opacity, transform;
}

.avatar-hovercard.is-visible {
    opacity: 1;
    transform: perspective(700px) rotateX(0deg) translateY(0) scale(1);
}

.avatar-hovercard-image-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto 8px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #d7e0ea;
    background: #f5f8fc;
}

.avatar-hovercard-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-hovercard-name {
    font-size: 12px;
    font-weight: 700;
    color: #1f2a33;
    line-height: 1.25;
    margin-bottom: 2px;
}

.avatar-hovercard-email {
    font-size: 11px;
    color: #5f6f82;
    line-height: 1.2;
    word-break: break-word;
}

.client-thread-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    background: #f7fafc;
}

.client-message-list {
    margin-top: 10px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.wysiwyg-wrap {
    border: 1px solid #ccd8e4;
    border-radius: 8px;
    background: #fff;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    border-bottom: 1px solid #e3ebf3;
    background: #f4f7fa;
}

.wysiwyg-toolbar button {
    padding: 4px 8px;
    font-size: 12px;
    background: #9aa8b6;
    border: 1px solid #7f8d9b;
    border-radius: 4px;
    color: #fff;
    line-height: 1.1;
}

.wysiwyg-toolbar button:hover {
    background: #7f8d9b;
    transform: none;
    box-shadow: none;
}

.wysiwyg-editor {
    min-height: 110px;
    padding: 10px;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.client-chat-item {
    margin-bottom: 10px;
}

.client-closed-tickets summary {
    cursor: pointer;
    color: #4e6275;
    font-weight: 600;
}

.client-top-header .header-container {
    left: 0;
    right: 0;
    width: 100%;
    min-height: 102px;
    padding: 0 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 0;
}

.client-top-header {
    padding-top: 72px;
    padding-bottom: 10px;
}

.client-top-header .app-title {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    font-size: 22px;
    margin: 0;
}

.client-top-header.theme-ticket {
    background: linear-gradient(90deg, #7f8790 0%, #939ca6 42%, #c79d61 66%, #f39c12 100%);
}

.client-hint-strip {
    max-width: 980px;
    margin: 2px auto 8px auto;
    padding: 0 22px 0 14px;
    height: 15px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.client-hint-strip::before {
    content: "Schon gewusst?";
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-56%);
    font-family: Baskerville, "Baskerville Old Face", "Times New Roman", serif;
    font-size: 40px;
    line-height: 1;
    color: #d3d3d3;
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
    white-space: nowrap;
}

.client-hint-text {
    margin-top: 0;
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: #222;
    text-align: center;
    transform-origin: center center;
    backface-visibility: hidden;
    min-height: 18px;
    letter-spacing: 0.01em;
    width: 100%;
    line-height: 1.2;
    transform-style: preserve-3d;
    position: relative;
    z-index: 2;
    text-shadow:
        -1px 0 #fff,
        0 1px #fff,
        1px 0 #fff,
        0 -1px #fff;
    
}

.client-hint-text.hint-leave {
    animation: hintFlipOut 1.5s ease-in-out forwards;
}

.client-hint-text.hint-enter {
    animation: hintFlipIn 1.5s ease-in-out forwards;
}

@keyframes hintFlipOut {
    0% { opacity: 1; transform: perspective(900px) rotateX(0deg) translateY(0); filter: blur(0); }
    100% { opacity: 0; transform: perspective(900px) rotateX(-86deg) translateY(5px) scale(0.96); filter: blur(0.35px); }
}

@keyframes hintFlipIn {
    0% { opacity: 0; transform: perspective(900px) rotateX(86deg) translateY(-5px) scale(0.96); filter: blur(0.35px); }
    100% { opacity: 1; transform: perspective(900px) rotateX(0deg) translateY(0) scale(1); filter: blur(0); }
}

.app-title {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.gold-text {
    position: relative;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 4.2rem !important;
    word-spacing: 0.12em;
    display: inline-block;
    padding: 0;
    line-height: 1;
    white-space: nowrap;
    margin: 0;
    color: transparent;
    background-color: #d9b45f;
    background-image: linear-gradient(
        180deg,
        #fff8dc 0%,
        #f5df9b 20%,
        #d7b04e 42%,
        #b5852f 58%,
        #f2dc98 78%,
        #fff4cf 100%
    );
    background-size: 100% 100%;
    background-clip: text;
    -webkit-background-clip: text;
}

.client-brand-wrap {
    position: absolute;
    top: 10px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.client-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.client-brand-logo {
    width: 57px;
    height: 57px;
    flex: 0 0 57px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter:
        drop-shadow(0 -1px 0 rgba(255, 249, 219, 0.95))
        drop-shadow(0 1px 0 rgba(92, 63, 17, 0.62))
        drop-shadow(0 2px 0 rgba(92, 63, 17, 0.52))
        drop-shadow(0 3px 0 rgba(92, 63, 17, 0.40))
        drop-shadow(0 5px 4px rgba(92, 63, 17, 0.34));
}

.client-brand-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.client-brand-beta {
    display: inline-block;
    order: 3;
    margin-left: -18px;
    margin-right: 0;
    transform: translateY(15px) rotate(-12deg);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #d9c9a1;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 3px rgba(0, 0, 0, 0.34),
        0 0 4px rgba(0, 0, 0, 0.16);
    user-select: none;
    pointer-events: none;
    position: relative;
    z-index: 3;
}

.gold-text:before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    color: #d9b45f;
    z-index: -1;
    text-shadow:
        0 -1px 0 rgba(255, 249, 219, 0.9),
        0 1px 0 rgba(92, 63, 17, 0.5),
        0 2px 0 rgba(92, 63, 17, 0.45),
        0 3px 0 rgba(92, 63, 17, 0.35),
        0 4px 0 rgba(92, 63, 17, 0.25),
        0 4px 2px rgba(92, 63, 17, 0.35),
        0 0.075em 0.1em rgba(25, 22, 13, 0.3),
        0 0.15em 0.3em rgba(92, 63, 17, 0.2);
}

.gold-text__highlight {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.gold-text__highlight:after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    color: transparent;
    background-image: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0) 36%,
        rgba(255, 255, 255, 0.6) 48%,
        rgba(255, 255, 255, 0) 62%
    );
    background-clip: text;
    -webkit-background-clip: text;
    background-size: 24rem 100%;
    background-repeat: no-repeat;
    animation: gold-shine 4s linear infinite alternate;
}

.gold-text__highlight:before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    color: transparent;
    background-image: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0) 44%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(255, 255, 255, 0) 56%
    );
    background-clip: text;
    -webkit-background-clip: text;
    animation: gold-flash 4s linear infinite alternate;
}

@keyframes gold-shine {
    0% { background-position: -16rem 0; }
    100% { background-position: 16rem 0; }
}

@keyframes gold-flash {
    0%, 65%, 100% { opacity: 0; }
    72%, 84% { opacity: 1; }
}

.client-user-btn {
    width: auto;
    min-width: 170px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    height: 38px;
    padding: 0 12px 0 2px;
    overflow: visible;
    margin-top: 0;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(19, 28, 39, 0.22);
}

.client-header-right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-right: 4px;
}

.client-header-links {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.client-header-links a {
    color: #f4f7fb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.95;
}

.client-header-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.forgot-link {
    color: #d8891f;
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    color: #bf7412;
    text-decoration: none;
}

.client-form-row.client-form-row-title-name {
    grid-template-columns: 90px 1fr 1fr;
}

.form-group.form-group-title-compact {
    min-width: 80px;
}

.client-user-btn .user-avatar-img,
.client-user-btn .user-avatar-fallback {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    box-sizing: border-box;
}

.client-user-btn .user-avatar-img {
    border: 2px solid #cfd9e2;
    background: #fff;
}

.client-user-btn .user-avatar-fallback {
    border: 2px solid #cfd9e2;
    background: #e3e8ee;
    color: #6f7f8d;
    font-size: 11px;
    font-weight: 700;
}

.user-btn-avatar-wrap {
    position: relative;
    width: 32px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.user-btn-avatar-wrap .badge-mini-kz {
    right: -3px;
    bottom: -3px;
}

.client-user-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.client-ticket-reply-actions {
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

.client-ticket-reply-actions .client-cancel-btn {
    margin-left: auto;
    background: #b64c4c;
    border-color: #a44444;
}

.client-ticket-reply-actions .client-cancel-btn:hover {
    background: #9f4242;
}

.ticket-agent-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.btn-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #b7c7d8;
    background: #f4f8fc;
    color: #1f2a33;
    border-radius: 6px;
    padding: 7px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.btn-tab:hover {
    background: #e8f1f9;
}

.btn-tab.active {
    background: #2f80ed;
    border-color: #2f80ed;
    color: #fff;
}

.ticket-users-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
}

.ticket-users-list {
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #fff;
    max-height: 600px;
    overflow-y: auto;
}

.ticket-user-row {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #eef3f8;
    text-decoration: none;
    color: #1f2a33;
}

.ticket-user-row:hover {
    background: #f5faff;
}

.ticket-user-row.active {
    background: #e9f3ff;
}

.ticket-user-row:last-child {
    border-bottom: none;
}

.ticket-user-meta {
    font-size: 12px;
    color: #65788a;
}

.ticket-user-form textarea.email-list {
    min-height: 92px;
    font-family: inherit;
}

.ticket-msg-menu {
    position: absolute;
    z-index: 1200;
    min-width: 260px;
    background: #ffffff;
    border: 1px solid #d7e2ec;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    padding: 6px;
}

.ticket-msg-menu button {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    color: #1f2a33;
    font-size: 13px;
}

.ticket-msg-menu button:hover {
    background: #eef6ff;
    border-color: #c9ddf3;
}

@media (max-width: 980px) {
    .ticket-users-layout {
        grid-template-columns: 1fr;
    }
}

.btn-link {
    background: none;
    border: none;
    color: #2f80ed;
    padding: 0;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.client-dropzone {
    margin-top: 8px;
    border: 1px dashed #9eb7cd;
    border-radius: 8px;
    padding: 8px 10px;
    color: #5c7084;
    font-size: 12px;
    background: #f7fbff;
}

.client-dropzone.drag-over {
    border-color: #2f80ed;
    background: #eaf3ff;
}

.client-attachment-pending {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-pending-item {
    font-size: 12px;
    color: #475b6e;
}

.client-status-event {
    margin: 7px 0;
    padding: 2px 0;
    color: #7f8c98;
    font-size: 11px;
    background: transparent;
    border: 0;
}

textarea.auto-grow {
    resize: none;
    overflow-y: hidden;
}

.client-message-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.client-attach-thumb-link {
    display: inline-block;
}

.client-attach-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d5e1eb;
}

.client-file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #d5e1eb;
    background: #f7fafc;
    color: #2f4858;
    text-decoration: none;
    font-size: 12px;
}

.client-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 26, 0.82);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-lightbox.hidden {
    display: none;
}

.client-lightbox-image {
    max-width: min(92vw, 1200px);
    max-height: 86vh;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.client-lightbox-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 24px;
    cursor: pointer;
}

.client-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    cursor: pointer;
}

.client-lightbox-nav.prev { left: 20px; }
.client-lightbox-nav.next { right: 20px; }

@media (max-width: 980px) {
    .client-auth-grid,
    .client-form-row,
    .client-ticket-layout {
        grid-template-columns: 1fr;
    }
    .client-login-notice {
        grid-template-columns: 1fr;
    }
    .client-login-signature {
        justify-self: start;
        text-align: left;
        opacity: 0.5;
    }
    .client-login-signature img {
        width: min(260px, 74vw);
    }
}

.delete-x-btn {
    min-width: 30px;
    padding: 4px 10px;
    font-weight: 800;
    font-size: 21px;
    line-height: 1;
}

.ticket-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    color: #1f6fb2;
    background: #e8f1f8;
    border: 1px solid #bfd4e5;
}

.ticket-link-icon:hover {
    background: #d5e9f7;
    color: #175a90;
}

.entries-table th.ticket-header-link {
    color: #1d5f95;
}

.entries-table th.ticket-header-link:hover {
    background: #d5e9f7;
}

.entry-modal-nav {
    position: absolute;
    right: -40px;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.entry-nav-btn {
    width: 30px;
    min-width: 30px;
    height: 28px;
    padding: 0;
    border: 1px solid #b9c0c7;
    border-radius: 4px;
    background: #d5dbe1;
    color: #3f4a56;
    line-height: 1;
}

.entry-nav-btn:hover {
    background: #c8cfd6;
    color: #2f3a45;
    transform: none;
    box-shadow: none;
}

.entry-nav-btn:disabled {
    background: #eceff2;
    color: #9aa3ad;
    border-color: #d4d9de;
}

.table-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #2f4858;
    cursor: pointer;
}

.export-preview-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

/* ============== MODAL IMPROVEMENTS ============== */

.modal {
    animation: fadeIn 0.2s ease-in;
}

.modal.show {
    animation: fadeIn 0.2s ease-in;
}

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

/* ============== RESPONSIVE ADJUSTMENTS ============== */

@media (max-width: 1024px) {
    .entries-table {
        font-size: 12px;
    }
    
    .entries-table th, .entries-table td {
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .app-header h1 {
        font-size: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .entries-table {
        font-size: 11px;
        overflow-x: auto;
        display: block;
    }
    
    .entries-table th, .entries-table td {
        padding: 6px 8px;
    }
}

/* Tabelle: schmale Spalten für Ticket und Datum */
.col-ticket { white-space: nowrap; width: 1%; padding-right: 8px; }
.col-datum { white-space: nowrap; width: 1%; padding-right: 8px; }

/* Dauer-Teilwerte in Tabellenansicht */
.actual-duration { color: #555; font-size: 0.95em; }
.abr-duration { color: #9aa0a6; font-size: 0.95em; margin-left: 8px; }
.abr-duration-manual { color: #c24a4a; font-weight: 700; }
.entry-amount { color: #2f4858; font-size: 0.95em; font-weight: 600; margin-left: 10px; white-space: nowrap; }
.entry-car-icon {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1;
}
.entry-extra-icons {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.entry-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2f80ed;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}
.entry-user-badge-stack {
    display: inline-block;
    position: relative;
    width: 120px;
    height: 24px;
    margin-left: 8px;
    vertical-align: middle;
}

.entry-user-badge {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: 2px solid rgba(0,0,0,0.08);
    transform: translateX(calc(var(--i, 0) * 12px));
    transition: transform 180ms ease;
    z-index: calc(100 + var(--i, 0));
}

.entry-user-badge.has-image {
    background: #fff !important;
    overflow: visible;
}

.entry-user-badge-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.badge-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.badge-mini-kz {
    position: absolute;
    right: -3px;
    bottom: -3px;
    min-width: 11px;
    height: 11px;
    border-radius: 6px;
    padding: 0 2px;
    font-size: 7px;
    line-height: 11px;
    font-weight: 800;
    text-align: center;
    background: var(--mini-bg, rgba(255, 255, 255, 0.94));
    color: var(--mini-fg, #1f2a33);
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    pointer-events: none;
}

.entry-user-badge-stack:hover .entry-user-badge {
    transform: translateX(calc(var(--i, 0) * 26px));
}

.mitarbeiter-checklist {
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    min-height: 38px;
    max-height: 140px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mitarbeiter-item {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 12px;
    color: #2c3e50;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.mitarbeiter-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.mitarbeiter-item-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e3e8ee;
    color: #6f7f8d;
    border: 2px solid #cfd9e2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    opacity: 0.6;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, opacity 140ms ease, transform 120ms ease;
}

.mitarbeiter-item-badge.has-image {
    background: #fff;
    color: #fff;
    overflow: visible;
    opacity: 0.85;
}

.mitarbeiter-item:hover .mitarbeiter-item-badge {
    transform: translateY(-1px);
}

.mitarbeiter-item.active .mitarbeiter-item-badge {
    background: var(--badge-active-bg, #8AA5B8);
    color: var(--badge-active-fg, #FFFFFF);
    border-color: rgba(0,0,0,0.2);
    opacity: 1;
}

.mitarbeiter-item.active .mitarbeiter-item-badge.has-image {
    background: #fff;
    border-color: var(--badge-active-bg, #8AA5B8);
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: #55616d;
}

.manual-override {
    border-color: #d97b7b !important;
    box-shadow: 0 0 0 2px rgba(217, 123, 123, 0.12);
}

/* Fixierte Fußleiste mit Monats-Summe */
.fixed-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
    text-align: right;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 9999;
}

.has-fixed-footer {
    padding-bottom: 86px;
}

.admin-card {
    border: 1px solid #e3e8eb;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fafcfd;
}

.projects-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.projects-overview,
.projects-main,
.project-editor-full {
    width: 100%;
}

.projects-main {
    min-width: 0;
}

.projects-main-head {
    margin-bottom: 10px;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-settings-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
}

.project-overview-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mitarbeiter-item.disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-list-wide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.project-list-item {
    position: relative;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid #d9e2e8;
    background: #fff;
    color: #2c3e50;
}

.project-list-item-title {
    display: block;
    padding-right: 28px;
}

.project-list-unread-badge {
    position: absolute;
    right: 8px;
    top: 6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #d94141;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    font-weight: 700;
}

.project-list-item.active {
    background: #e7f3ff;
    border-color: #9cc5ea;
}

.project-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 10px;
    align-items: start;
}

.project-col {
    background: #f7f9fb;
    border: 1px solid #e2e8ef;
    border-radius: 8px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.project-col-info {
    background: #f4f6f8;
}

.project-col-open {
    background: #fff5f5;
}

.project-col-in_progress {
    background: #fff9e8;
}

.project-col-acceptance {
    background: #f1f7ff;
}

.project-col-done {
    background: #effaf2;
}

.project-col-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #e2e8ef;
    background: #eef3f7;
}

.project-col-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 360px;
}

.project-card {
    border: 1px solid #d4dfe8;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.project-card-unread {
    border-color: var(--unread-color, #8aa5b8);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.95) inset;
}

.project-card-unread::after {
    content: "";
    position: absolute;
    left: -6px;
    right: -6px;
    top: -6px;
    bottom: -6px;
    border-radius: 12px;
    background: var(--unread-color, #8aa5b8);
    opacity: 0.22;
    filter: blur(9px);
    z-index: 0;
    pointer-events: none;
}

.project-card > * {
    position: relative;
    z-index: 1;
}

.project-card-overdue {
    background: #fff0f0;
    border-color: #e05b5b;
}

.project-card-conversation {
    background: #eef6ff;
    border-color: #9dc4eb;
}

.project-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #2e3e4f;
    word-break: break-word;
    padding-right: 64px;
}

.project-card-meta {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #5d6d7a;
}

.project-card-assignee {
    position: absolute;
    right: 8px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-card-comment-badge {
    position: absolute;
    right: -7px;
    top: -7px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #d94141;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    font-weight: 700;
    z-index: 5;
    pointer-events: none;
}

.project-card-assignee-stack {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

.project-card-assignee-entry {
    display: inline-flex;
    margin-left: calc(var(--i, 0) * -8px);
}

.project-card-assignee-stack .project-card-assignee-entry:first-child {
    margin-left: 0;
}

.project-card-assignee-badge {
    width: 24px;
    height: 24px;
    font-size: 10px;
    opacity: 1;
}

.project-card-assignee-badge .badge-mini-kz {
    right: -4px;
    bottom: -4px;
    min-width: 11px;
    height: 11px;
    line-height: 11px;
    font-size: 7px;
    padding: 0 2px;
}

.project-editor {
    border: 1px solid #e2e8ef;
    background: #fcfdff;
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
    max-height: calc(100vh - 200px);
    overflow: auto;
}

.project-editor-full {
    max-height: none;
}

.project-editor-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.project-conversation-links {
    margin-bottom: 10px;
    border-left: 4px solid #9ec4ea;
    background: #f4f9ff;
}

.project-conversation-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-conversation-link {
    border: 1px solid #b7d0ea;
    background: #ffffff;
    color: #2f4f6b;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.project-conversation-link:hover {
    background: #eaf3fd;
}

.markdown-view {
    border: 1px solid #d7e1e9;
    border-radius: 6px;
    background: #fff;
    min-height: 120px;
    padding: 10px;
    cursor: text;
}

.markdown-view h3,
.markdown-view h4,
.markdown-view h5,
.markdown-view h6 {
    margin: 8px 0;
}

.markdown-view p,
.markdown-view ul {
    margin: 6px 0;
}

.markdown-view code {
    background: #f0f4f7;
    border-radius: 4px;
    padding: 1px 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.markdown-help {
    margin-top: 6px;
    font-size: 12px;
    color: #6e7d8a;
}

.markdown-help-wrap {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.markdown-help-badge {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: 1px solid #9fb2c0;
    background: #f4f8fb;
    color: #3f5a6e;
    font-weight: 800;
    font-size: 12px;
    padding: 0;
}

.markdown-help-badge:hover {
    transform: none;
    box-shadow: none;
    background: #e9f1f7;
}

.markdown-help-panel {
    position: absolute;
    right: 0;
    bottom: 30px;
    width: 300px;
    border: 1px solid #d6e0e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(26, 40, 52, 0.16);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #2f3d49;
    z-index: 6;
}

.markdown-help-panel code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #f2f6f9;
    padding: 1px 4px;
    border-radius: 4px;
}

.project-comments {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8ef;
}

.project-comment-input textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
    border: 1px solid #cdd9e3;
    border-radius: 8px;
    padding: 10px;
    font: inherit;
}

.project-comment-input {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid #e7edf2;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
}

.comment-item {
    border: none;
    padding: 0;
    background: transparent;
}

.comment-head {
    font-size: 11px;
    color: #6e7d8a;
    margin-bottom: 4px;
}

.comment-body {
    font-size: 13px;
    color: #2f3d49;
    white-space: pre-wrap;
}

.chat-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: start;
}

.chat-avatar {
    margin-top: 2px;
}

.chat-avatar-badge {
    width: 28px;
    height: 28px;
}

.chat-avatar-badge .badge-mini-kz {
    right: -3px;
    bottom: -3px;
}

.chat-bubble {
    background: #ffffff;
    border: 1px solid #dbe5ed;
    border-radius: 12px;
    padding: 8px 10px;
    position: relative;
}

.chat-bubble::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 11px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 8px solid #dbe5ed;
}

.chat-bubble::after {
    content: "";
    position: absolute;
    left: -7px;
    top: 11px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 8px solid #ffffff;
}

.chat-meta {
    font-size: 11px;
    color: #7b8a97;
    margin-bottom: 4px;
}

.chat-text {
    font-size: 13px;
    color: #2f3d49;
    white-space: normal;
    word-break: break-word;
}

.chat-text p {
    margin: 0 0 8px;
}

.chat-text p:last-child {
    margin-bottom: 0;
}

.status-badge-note {
    margin-left: 6px;
    background: #eef2f6;
    color: #4e6275;
    border: 1px solid #d8e0e8;
}

.status-badge-note.status-badge-note-public {
    background: #fff1e2;
    color: #8a4f1a;
    border-color: #efbf8d;
}

.client-chat-item.is-note .chat-bubble {
    background: #fff7d6;
    border-color: #ead67d;
}

.client-chat-item.is-note .chat-bubble::before,
.client-chat-item.is-note .chat-bubble::after {
    display: none;
}

.client-chat-item.is-note-public .chat-bubble {
    background: #fff3e7;
    border-color: #efbf8d;
}

.client-chat-item.is-note-public .chat-bubble::before {
    display: block;
    border-right-color: #e4b27e;
}

.client-chat-item.is-note-public .chat-bubble::after {
    display: block;
    border-right-color: #fff3e7;
}

.project-context-menu {
    position: fixed;
    z-index: 2000;
    min-width: 220px;
    border: 1px solid #d6e0e8;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
    padding: 6px;
}

.project-context-menu button {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 0;
    color: #2c3e50;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
}

.project-context-menu button:hover {
    background: #eef5fb;
}

.project-delete-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #9a4b42;
}

@media (max-width: 1280px) {
    .projects-layout {
        grid-template-columns: 1fr;
    }
    .project-board {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
    .project-editor-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .area-nav {
        left: 0;
    }
    .area-link {
        width: 40px;
        height: 36px;
        padding: 7px;
        margin-right: -8px;
    }
    .area-link.active {
        width: 36px;
    }
    .area-label,
    .area-link.active .area-label,
    .area-nav:hover .area-label {
        max-width: 0;
    }
    .project-board {
        grid-template-columns: 1fr;
    }
    .client-top-header .header-container {
        min-height: 80px;
    }
    .client-top-header {
        padding-top: 56px;
    }
    .client-brand-wrap {
        left: 12px;
        top: 8px;
        gap: 8px;
    }
    .client-brand-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
    .gold-text {
        font-size: 2.5rem;
    }
    .client-brand-beta {
        margin-left: -14px;
        transform: translateY(6px) rotate(-12deg);
        font-size: 10px;
    }
}

/* Kleinere Textareas für Leistung/Bemerkung */
.small-textarea { min-height: 80px; max-height: 160px; resize: vertical; }

/* Besteller-Autocomplete: leichte Schattenbox */
.autocomplete-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #e0e0e0; max-height: 220px; overflow: auto; z-index: 999; }
.autocomplete-list .item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.autocomplete-list .item:hover { background: #f6f8fa; }
.autocomplete-list .item.active { background: #dfeefb; }

.mail-quote-collapsed {
    margin-top: 10px;
    border: 1px solid #d8e3ee;
    border-radius: 8px;
    background: #f7fafc;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
}

.mail-quote-collapsed > summary {
    cursor: pointer;
    list-style: none;
    padding: 8px 10px;
    font-size: 12px;
    color: #5f7386;
    background: #eef3f8;
    border-top: 1px solid #d8e3ee;
}

.mail-quote-collapsed > summary::-webkit-details-marker {
    display: none;
}

.mail-quote-collapsed[open] > summary {
    color: #3f5569;
}

.mail-quote-collapsed > :not(summary) {
    padding: 8px 10px;
}

.chat-text blockquote,
.wysiwyg-editor blockquote,
.mail-forward-quote {
    margin: 8px 0;
    padding: 6px 10px;
    border-left: 3px solid #b9c9d9;
    background: #f8fbff;
}
