@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* --- DESIGN SYSTEM TOKENS --- */
:root {
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    
    /* Farben (HSL) angepasst an das bytes4vision Branding */
    --bg-base: 220 22% 6%;            /* Sehr dunkles Blaugrau */
    --bg-surface: 220 22% 9%;         /* Etwas helleres Panel */
    --bg-card: 218 18% 14%;           /* Dunkler Slate-Grau-Ton ähnlich Logo-Schrift */
    --border-color: 218 15% 22%;      /* Ränder */
    --border-focus: 196 25% 58%;      /* #7aa0ad (Logo Teal) */
    
    --text-primary: 210 40% 98%;      /* Fast Weiß */
    --text-secondary: 215 16% 70%;    /* Blaugrau-Grau */
    --text-muted: 215 12% 50%;        /* Dunkles Blaugrau-Grau */
    
    --primary: 196 25% 58%;           /* #7aa0ad (Logo Teal) */
    --primary-hover: 196 35% 68%;     /* Etwas helleres Teal */
    --primary-glow: 196 25% 58% / 30%;
    
    --success: 142 76% 36%;           /* Emerald-600 */
    --success-glow: 142 76% 36% / 20%;
    
    --danger: 346 84% 50%;            /* Rose-600 */
    --danger-glow: 346 84% 50% / 20%;
    
    /* Sonstiges */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(24, 28, 38, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* --- RESET & BASICS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: hsl(var(--bg-base));
    color: hsl(var(--text-primary));
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar-Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: hsl(var(--border-color));
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--text-muted));
}

/* --- APP LAYOUT --- */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: hsl(var(--bg-surface));
    border-right: 1px solid hsl(var(--border-color));
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 10px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-hover)));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px hsl(var(--primary-glow));
    color: white;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: hsl(var(--text-secondary));
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.nav-item a:hover {
    color: hsl(var(--text-primary));
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active a {
    color: white;
    background: linear-gradient(135deg, hsl(var(--primary) / 40%), transparent);
    border-left: 3px solid hsl(var(--primary));
}

.nav-item a svg {
    width: 18px;
    height: 18px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 30px 40px 100px 40px; /* Zusätzliches Padding unten wegen Timer-Banner */
    overflow-y: auto;
    position: relative;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.main-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-hover)));
    color: white;
    box-shadow: 0 4px 15px hsl(var(--primary-glow));
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    color: hsl(var(--text-primary));
}

.btn-secondary:hover {
    background-color: hsl(var(--border-color));
}

.btn-danger {
    background-color: hsl(var(--danger) / 15%);
    color: hsl(346 84% 65%);
    border: 1px solid hsl(var(--danger) / 30%);
}

.btn-danger:hover {
    background-color: hsl(var(--danger));
    color: white;
    box-shadow: 0 4px 12px hsl(var(--danger-glow));
}

.btn-icon-only {
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* --- VIEW CONTAINER --- */
.view-container {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.view-container.active {
    display: block;
    opacity: 1;
}

/* --- KANBAN BOARD --- */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    align-items: start;
}

.board-column {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 550px;
    transition: var(--transition);
}

.board-column.dragover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--bg-surface) / 60%);
    box-shadow: 0 0 15px hsl(var(--primary-glow));
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid hsl(var(--border-color));
}

.column-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-badge {
    background-color: hsl(var(--border-color));
    color: hsl(var(--text-secondary));
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 450px;
    flex-grow: 1;
}

/* Task Cards */
.task-card {
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: grab;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card:hover {
    transform: translateY(-2px);
    border-color: hsl(var(--text-muted));
    box-shadow: var(--shadow);
}

.task-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
    transform: scale(0.98);
}

.task-card.active-timer {
    border-color: hsl(var(--danger));
    box-shadow: 0 0 15px hsl(var(--danger-glow));
    animation: borderPulse 2s infinite ease-in-out;
}

.card-client-tag {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: hsl(var(--primary) / 15%);
    color: hsl(var(--primary-hover));
    border: 1px solid hsl(var(--primary) / 30%);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.card-description {
    font-size: 0.85rem;
    color: hsl(var(--text-secondary));
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: hsl(var(--text-muted));
    border-top: 1px solid hsl(var(--border-color) / 50%);
    padding-top: 10px;
}

.card-timer-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.card-timer-indicator.active {
    color: hsl(var(--danger));
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: hsl(var(--danger));
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

/* --- CLIENT MANAGER --- */
.client-section {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.client-form-panel {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: hsl(var(--text-secondary));
}

.input-control {
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-md);
    color: white;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.input-control:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 10px hsl(var(--primary-glow));
}

select.input-control {
    padding: 0 16px;
    height: 38px;
}

.input-control option, select option {
    background-color: #1e293b;
    color: white;
}

.client-list {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.client-item:hover {
    border-color: hsl(var(--text-muted));
}

.client-item.active {
    border-color: hsl(var(--primary));
    background-color: rgba(122, 160, 173, 0.1);
}

.client-name {
    font-weight: 600;
}

/* --- REPORTS & DASHBOARD --- */
.filter-bar {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.table-container {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.report-table th,
.report-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid hsl(var(--border-color));
}

.report-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: hsl(var(--text-secondary));
}

.report-table tbody tr {
    transition: var(--transition);
}

.report-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

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

.report-total-panel {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-time-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: hsl(var(--text-secondary));
}

.total-time-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: hsl(var(--success));
}

/* --- ACTIVE TIMER FLOATING BANNER --- */
.active-timer-banner {
    position: fixed;
    bottom: 25px;
    left: 280px; /* Sidebar Breite + Abstand */
    right: 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.active-timer-banner.visible {
    transform: translateY(0);
}

.timer-banner-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timer-banner-task {
    font-weight: 600;
    font-size: 0.95rem;
}

.timer-banner-client {
    font-size: 0.8rem;
    color: hsl(var(--text-secondary));
}

.timer-banner-time {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: hsl(var(--danger));
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- MODAL WINDOWS --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal-content {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid hsl(var(--border-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: hsl(var(--text-secondary));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

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

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid hsl(var(--border-color));
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Spezifisch für Aufgaben-Details im Modal */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.detail-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: hsl(var(--text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    border-bottom: 1px solid hsl(var(--border-color) / 40%);
    padding-bottom: 6px;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid hsl(var(--border-color) / 50%);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
}

.log-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.log-time-info {
    font-weight: 600;
}

.log-note {
    color: hsl(var(--text-secondary));
    font-style: italic;
    font-size: 0.8rem;
}

.log-duration {
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-duration-value {
    font-weight: 700;
    color: hsl(var(--success));
}

/* --- IDEEN-BÖRSE MODULE --- */
.record-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-hover)));
    border: none;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 15px hsl(var(--primary-glow));
    outline: none;
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.record-btn.recording {
    background: linear-gradient(135deg, hsl(var(--danger)), #f43f5e);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    animation: voicePulse 1.5s infinite ease-in-out;
}

.record-btn svg {
    width: 28px;
    height: 28px;
    transition: var(--transition);
}

.idea-card {
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.idea-card:hover {
    border-color: hsl(var(--text-muted));
    box-shadow: var(--shadow);
}

.idea-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.idea-category-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-idee {
    background-color: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.category-aufgabe {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-notiz {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.idea-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.idea-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.idea-card-desc {
    font-size: 0.85rem;
    color: hsl(var(--text-secondary));
    line-height: 1.4;
}

.idea-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid hsl(var(--border-color) / 50%);
    padding-top: 12px;
    font-size: 0.8rem;
    color: hsl(var(--text-muted));
}

@keyframes voicePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
        transform: scale(0.95);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(0.95);
    }
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes borderPulse {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.4);
    }
    50% {
        border-color: rgba(239, 68, 68, 1);
    }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1024px) {
    .active-timer-banner {
        left: 25px;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid hsl(var(--border-color));
        padding: 20px;
    }
    
    .main-content {
        padding: 20px;
        padding-bottom: 120px;
    }
    
    .board-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .btn {
        width: 100%;
    }
}

/* --- LOGIN SCREEN (2FA) & BENUTZERVERWALTUNG --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: hsl(var(--bg-base));
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    background: white;
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-logo img {
    max-height: 45px;
    width: auto;
    object-fit: contain;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: white;
}

.login-subtitle {
    font-size: 0.85rem;
    color: hsl(var(--text-secondary));
    text-align: center;
    margin-top: -15px;
}

.login-step {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.login-step.active {
    display: flex;
}

.qr-container {
    background: white;
    padding: 15px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px auto;
    width: 180px;
    height: 180px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.qr-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.secret-key-display {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px dashed hsl(var(--border-color));
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    font-family: monospace;
    font-size: 0.95rem;
    color: hsl(var(--primary-hover));
    letter-spacing: 1px;
}

.role-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.role-admin {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.role-manager {
    background-color: rgba(124, 58, 237, 0.15);
    color: #c084fc;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.role-worker {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast-notification {
    pointer-events: auto;
    min-width: 320px;
    max-width: 450px;
    background-color: hsl(var(--bg-surface));
    border-left: 4px solid hsl(var(--primary));
    border-top: 1px solid hsl(var(--border-color));
    border-right: 1px solid hsl(var(--border-color));
    border-bottom: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    color: hsl(var(--text-primary));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    animation: toastFadeIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition);
}

.toast-notification.toast-success {
    border-left-color: hsl(var(--success));
}

.toast-notification.toast-danger {
    border-left-color: hsl(var(--danger));
}

.toast-notification.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-content svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-close {
    background: none;
    border: none;
    color: hsl(var(--text-muted));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.toast-close:hover {
    color: hsl(var(--text-primary));
    background-color: hsl(var(--border-color));
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

@keyframes toastFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- VOICE DICTATION & RECORDING FEEDBACK --- */
.btn-voice-desc.recording {
    background: hsl(var(--danger)) !important;
    color: white !important;
    box-shadow: 0 0 10px hsl(var(--danger-glow)) !important;
    border-color: hsl(var(--danger)) !important;
    animation: voicePulse 1.5s infinite;
}

@keyframes voicePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.tab-os-btn.active {
    background: hsl(var(--primary)) !important;
    color: white !important;
    border-color: hsl(var(--primary)) !important;
}

/* --- NAV GROUPS IN SIDEBAR --- */
.nav-group {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: hsl(var(--text-muted));
    padding: 8px 16px 4px 16px;
    user-select: none;
}

/* --- TICKET & FORM GENERATOR STYLES --- */
.ticket-item-card {
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-md);
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item-card:hover {
    border-color: hsl(var(--text-secondary));
}

.ticket-item-card.active {
    border-color: hsl(var(--primary));
    background-color: rgba(122, 160, 173, 0.08);
}

.ticket-item-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: hsl(var(--primary));
}

.message-bubble {
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid hsl(var(--border-color));
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: hsl(var(--bg-card));
    color: hsl(var(--text-primary));
}

.message-bubble.intern {
    background-color: rgba(245, 158, 11, 0.04);
    border-left: 4px solid #f59e0b;
}

.message-bubble.mitarbeiter {
    background-color: rgba(122, 160, 173, 0.04);
    border-left: 4px solid hsl(var(--primary));
}

.message-bubble.kunde {
    background-color: rgba(59, 130, 246, 0.04);
    border-left: 4px solid #3b82f6;
}

.prio-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    width: fit-content;
}

.prio-niedrig { background-color: rgba(122, 160, 173, 0.2); color: hsl(var(--text-secondary)); }
.prio-normal { background-color: rgba(16, 185, 129, 0.2); color: #10b981; }
.prio-hoch { background-color: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.prio-kritisch { background-color: rgba(244, 63, 94, 0.2); color: #f43f5e; }

.status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    width: fit-content;
}

.status-neu { background-color: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.status-in_bearbeitung { background-color: rgba(122, 160, 173, 0.2); color: hsl(var(--primary)); }
.status-wartet_auf_rueckmeldung { background-color: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.status-intern_klaerung { background-color: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-erledigt { background-color: rgba(16, 185, 129, 0.2); color: #10b981; }
.status-geschlossen { background-color: rgba(100, 116, 139, 0.2); color: #64748b; }

/* Fields Drag and Drop Handle styling */
.field-item {
    background-color: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-sm);
    padding: 15px 15px 15px 45px;
    position: relative;
}

.drag-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 35px;
    background-color: hsl(var(--bg-surface));
    border-right: 1px solid hsl(var(--border-color));
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--text-muted));
}

.drag-handle:active {
    cursor: grabbing;
}

/* Forms Height Adjustment for Modals (to 44px) */
#create-ticket-title,
#create-ticket-category,
#create-ticket-priority,
#create-ticket-client,
#create-ticket-assignee,
#form-config-title,
#form-config-purpose,
#form-config-target-group,
#form-config-target-employee,
#form-config-success-msg,
#form-config-submit-text {
    height: 44px !important;
    padding: 10px 16px !important;
}

/* Collapsible Panels */
.client-list,
#project-summary-dashboard {
    transition: padding 0.3s ease, margin-bottom 0.3s ease !important;
}

.collapsed-card {
    padding: 12px 20px !important;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: border-color 0.3s ease, margin 0.3s ease, padding 0.3s ease, color 0.2s ease;
    border-bottom: 1px solid transparent;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.collapsible-header:hover {
    color: hsl(var(--primary-hover));
}

.collapsible-header:not(.collapsed) {
    border-bottom: 1px solid hsl(var(--border-color));
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
}

.collapsible-header .chevron-icon {
    transition: transform 0.3s ease;
}

.collapsible-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.35s ease;
    max-height: 1200px;
    opacity: 1;
    overflow: visible;
}

.collapsible-content.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* --- BILLING / AUFTRAGSWESEN MODULES --- */
.billing-doc-item {
    background: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.billing-doc-item:hover {
    border-color: hsl(var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.billing-doc-item.active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 5%);
    box-shadow: 0 0 10px hsl(var(--primary) / 20%);
}
.billing-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.billing-doc-number {
    font-family: monospace;
    font-weight: 700;
    color: hsl(var(--primary));
}
.billing-doc-type-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.billing-type-offer { background: hsl(196 25% 58% / 15%); color: hsl(var(--primary)); }
.billing-type-estimate { background: hsl(38 90% 50% / 15%); color: #fbbf24; }
.billing-type-confirmation { background: hsl(142 76% 36% / 15%); color: #34d399; }
.billing-type-credit_note { background: hsl(346 84% 50% / 15%); color: #f87171; }
.billing-type-invoice { background: hsl(263 70% 50% / 15%); color: #a78bfa; }



