/* ========================================
   ZENTRALE DESIGN-VARIABLEN
   ======================================== */

:root {
    /* Farben - Hauptpalette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-hover: #f0f1f3;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    
    /* Farben - Status */
    --success-bg: #f0fdf4;
    --success-text: #22c55e;
    --warning-bg: #fef2f2;
    --warning-text: #ef4444;
    --info-bg: #e0e7ff;
    --info-text: #4f46e5;
    
    /* Abstände */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Schrift */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-heading: 28px;
    
    /* Rundungen */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;
    
    /* Schatten */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ========================================
   BASIS-RESET
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* ========================================
   FORM INPUTS
   ======================================== */

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

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========================================
   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: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

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

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* ========================================
   BADGES / TAGS
   ======================================== */

.badge {
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-text);
}

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

.table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.table-row:hover {
    background: var(--bg-secondary);
}

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

/* ========================================
   UTILITIES
   ======================================== */

.text-secondary {
    color: var(--text-secondary);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-xs {
    font-size: var(--font-size-xs);
}

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

/* ========================================
   SCROLLBAR - AUTO-HIDING
   ======================================== */

/* Webkit (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

*:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

*:hover {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* ========================================
   EMPLOYEE CARD COMPONENT
   ======================================== */

/* Mini Card - Trigger Element */
.employee-card-trigger {
    cursor: pointer;
    display: inline-block;
}

.ec-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.ec-mini:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.ec-mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.ec-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-mini-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.ec-mini-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ec-mini-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ec-mini-badges {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.ec-mini-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.ec-mini-badge.ec-tc {
    background: #fef3c7;
    color: #d97706;
}

.ec-mini-badge.ec-qm {
    background: #e0e7ff;
    color: #4f46e5;
}

.ec-mini-badge.ec-new {
    background: #dcfce7;
    color: #16a34a;
}

.ec-mini-badge.ec-anreise {
    background: #dbeafe;
    color: #2563eb;
}

/* Popup */
.ec-popup {
    position: fixed;
    z-index: 9999;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 380px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid var(--border-color);
}

.ec-popup-visible {
    opacity: 1;
    transform: translateY(0);
}

.ec-popup-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.ec-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}

.ec-popup-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.ec-popup-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.ec-popup-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-popup-info {
    flex: 1;
    min-width: 0;
    padding-right: 24px;
}

.ec-popup-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.ec-popup-role {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ec-role-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.ec-role-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.ec-popup-role-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ec-role-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.ec-role-tag.ec-tc {
    background: #fef3c7;
    color: #d97706;
}

.ec-role-tag.ec-qm {
    background: #e0e7ff;
    color: #4f46e5;
}

.ec-role-tag.ec-new {
    background: #dcfce7;
    color: #16a34a;
}

.ec-popup-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.ec-popup-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ec-popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
}

.ec-popup-finances {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-finance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ec-finance-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.ec-finance-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ec-finance-value.ec-warning {
    color: #f59e0b;
}

.ec-popup-actions {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
}

.ec-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.ec-action-btn:hover {
    background: var(--bg-hover);
}

.ec-action-btn.ec-primary {
    background: var(--accent-color);
    color: white;
}

.ec-action-btn.ec-primary:hover {
    background: var(--accent-hover);
}

/* Employee Card in Lists */
.ec-list-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.ec-list-item:last-child {
    border-bottom: none;
}

.ec-list-item .ec-mini {
    border: none;
    padding: 0;
    background: transparent;
}

.ec-list-item .ec-mini:hover {
    box-shadow: none;
}

/* ========================================
   STUFEN LABELS (Universal)
   ======================================== */

.stufen-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stufen-label-sma {
    background: rgba(120, 144, 156, 0.15);
    color: #78909C;
}

.stufen-label-ema {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.stufen-label-jmm {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.stufen-label-emm {
    background: rgba(156, 39, 176, 0.15);
    color: #9C27B0;
}

.stufen-label-cemm {
    background: rgba(224, 64, 251, 0.15);
    color: #E040FB;
}

.stufen-label-spb {
    background: rgba(255, 165, 0, 0.15);
    color: #FFA500;
}

.stufen-label-kad {
    background: rgba(255, 215, 0, 0.15);
    color: #D4A500;
}

.stufen-label-fue {
    background: rgba(44, 62, 80, 0.15);
    color: #2C3E50;
}

/* Quality Manager Label */
.stufen-label-qm {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Teamchef Label */
.stufen-label-tc {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Stufen mit Glow (für höhere Stufen) */
.stufen-label-glow {
    box-shadow: 0 0 8px currentColor;
}

/* Anreise/Abreise Labels */
.travel-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.travel-label-anreise {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.travel-label-abreise {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.travel-label-gebundelt {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px dashed #10b981;
}

/* ========================================
   KW TABS SYSTEM
   ======================================== */

.kw-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.kw-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kw-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.kw-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.kw-tab svg {
    width: 16px;
    height: 16px;
}

.kw-tab-content {
    display: none;
}

.kw-tab-content.active {
    display: block;
}

/* ========================================
   TC DIENSTE DROPDOWN
   ======================================== */

.tc-dienst-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.tc-dienst-faktor {
    width: 60px;
    padding: 6px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.tc-dienst-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-primary);
}

.tc-dienst-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tc-dienst-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tc-dienst-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    width: 100%;
    transition: all 0.2s;
}

.tc-dienst-add:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.tc-gesamt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tc-gesamt-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.tc-gesamt-value {
    font-size: 16px;
    font-weight: 700;
    color: #f59e0b;
}

.tc-gesamt-value.warning {
    color: #ef4444;
}

/* ========================================
   DRK OPTIONEN
   ======================================== */

.drk-option-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.drk-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.drk-option-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drk-option-title svg {
    width: 18px;
    height: 18px;
    color: #dc2626;
}

.drk-bereitstellung {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.drk-bereitstellung label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.drk-kosten-section {
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

.drk-kosten-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: 8px;
}

.drk-kosten-row:last-child {
    margin-bottom: 0;
}

.drk-kosten-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-primary);
}

.drk-kosten-input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    text-align: right;
}

.drk-kosten-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 120px;
}

/* ========================================
   INLINE EDIT MODE
   ======================================== */

.inline-editable {
    position: relative;
}

.inline-editable .edit-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed var(--accent-color);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.inline-editable.editing .edit-overlay {
    display: block;
}

.inline-edit-actions {
    display: none;
    gap: 6px;
    margin-top: var(--spacing-sm);
}

.inline-editable.editing .inline-edit-actions {
    display: flex;
}

.inline-input {
    padding: 6px 10px;
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: inherit;
    width: 100%;
    background: var(--bg-primary);
}

/* Read-only im normalen Modus */
.inline-editable:not(.editing) select,
.inline-editable:not(.editing) input[type="number"],
.inline-editable:not(.editing) input[type="text"] {
    pointer-events: none;
    background: var(--bg-secondary);
    border-color: transparent;
}

/* ========================================
   ACTION TOOLBAR - EINHEITLICHE TOOLBAR
   ======================================== */

.action-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 10px var(--spacing-md);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    min-height: 56px;
    flex-wrap: wrap;
}

/* Drei Hauptbereiche */
.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.toolbar-left {
    flex-shrink: 0;
}

.toolbar-center {
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.toolbar-right {
    flex-shrink: 0;
    justify-content: flex-end;
}

/* Einheitliche Element-Höhe: 36px */
.toolbar-element {
    height: 36px;
    display: inline-flex;
    align-items: center;
}

/* ========================================
   TOOLBAR TABS (Pill Style)
   ======================================== */

.toolbar-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    height: 36px;
    align-items: center;
}

.toolbar-tab {
    padding: 0 14px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.toolbar-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toolbar-tab.active {
    background: var(--accent-color);
    color: white;
}

.toolbar-tab .tab-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.toolbar-tab:not(.active) .tab-badge {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ========================================
   TOOLBAR SUCHFELD
   ======================================== */

.toolbar-search {
    position: relative;
    width: 100%;
    max-width: 280px;
    min-width: 160px;
}

.toolbar-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.toolbar-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.toolbar-search-input::placeholder {
    color: var(--text-secondary);
}

.toolbar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* ========================================
   TOOLBAR FILTER DROPDOWNS
   ======================================== */

.toolbar-filter {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.toolbar-filter:hover {
    border-color: var(--text-secondary);
}

.toolbar-filter:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Filter mit Label */
.toolbar-filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toolbar-filter-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.toolbar-filter-group .toolbar-filter {
    height: 28px;
    font-size: 12px;
    min-width: 100px;
}

/* ========================================
   TOOLBAR BUTTONS
   ======================================== */

.toolbar-btn {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Icon-only Button */
.toolbar-btn-icon {
    width: 36px;
    padding: 0;
}

/* Primary Button */
.toolbar-btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.toolbar-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Success Button (für Erstellen) */
.toolbar-btn-success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.toolbar-btn-success:hover {
    background: #059669;
    border-color: #059669;
}

/* ========================================
   TOOLBAR DIVIDER
   ======================================== */

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

/* ========================================
   TOOLBAR FILTER-ROW (für viele Filter)
   ======================================== */

.toolbar-filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ========================================
   RESPONSIVE TOOLBAR
   ======================================== */

@media (max-width: 1200px) {
    .action-toolbar {
        gap: var(--spacing-sm);
    }

    .toolbar-search {
        max-width: 200px;
    }

    .toolbar-btn span {
        display: none;
    }

    .toolbar-btn {
        padding: 0 10px;
    }

    .toolbar-btn-icon {
        padding: 0;
    }
}

@media (max-width: 900px) {
    .action-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-sm);
    }

    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        width: 100%;
        justify-content: flex-start;
    }

    .toolbar-center {
        order: -1;
    }

    .toolbar-search {
        max-width: none;
        flex: 1;
    }

    .toolbar-btn span {
        display: inline;
    }
}

/* ========================================
   TOOLBAR STATS CHIPS
   ======================================== */

.toolbar-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.toolbar-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    height: 28px;
}

.toolbar-stat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.toolbar-stat-dot.red { background: #ef4444; }
.toolbar-stat-dot.orange { background: #f59e0b; }
.toolbar-stat-dot.green { background: #10b981; }
.toolbar-stat-dot.blue { background: #3b82f6; }
.toolbar-stat-dot.purple { background: #8b5cf6; }

.toolbar-stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.toolbar-stat-label {
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========================================
   CONTENT AREA (unter der Toolbar)
   ======================================== */

.content-area {
    padding: var(--spacing-lg);
    max-width: 1600px;
    margin: 0 auto;
}

/* ========================================
   EINHEITLICHES MODAL-DIALOG-SYSTEM
   ========================================

   WICHTIG: Dieses System ersetzt ALLE nativen Browser-Dialoge!

   Anstatt die hässlichen Chrome/Browser alert(), confirm() und prompt()
   Dialoge zu verwenden, nutze diese einheitlichen, schönen Modals:

   VERWENDUNG:
   -----------

   1. ALERT (Nur Hinweis anzeigen):
      showAlert('Titel', 'Nachricht hier', 'success')

      Typen: 'info', 'success', 'warning', 'error'

   2. CONFIRM (Ja/Nein Bestätigung):
      const result = await showConfirm('Titel', 'Frage hier', 'warning')
      if (result) {
          // Benutzer hat "Ja" geklickt
      }

   3. PROMPT (Eingabe vom Benutzer):
      const input = await showPrompt('Titel', 'Frage', 'Standardwert')
      if (input !== null) {
          // Benutzer hat etwas eingegeben
      }

   NIEMALS mehr verwenden:
   - alert()
   - confirm()
   - prompt()

   Diese Funktionen sind in /base/app.js und modal-system.js definiert.

   ======================================== */

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--spacing-md);
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--bg-primary, #ffffff);
    border-radius: var(--radius-lg, 12px);
    padding: var(--spacing-lg, 24px);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

.custom-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md, 16px);
}

.custom-modal-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: #3b82f6;
}

.custom-modal-icon.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    color: #22c55e;
}

.custom-modal-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: #f59e0b;
}

.custom-modal-icon.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #ef4444;
}

.custom-modal-icon.question {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
    color: #a855f7;
}

.custom-modal-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    text-align: center;
    margin-bottom: var(--spacing-sm, 8px);
}

.custom-modal-message {
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
    text-align: center;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg, 24px);
    white-space: pre-line;
}

.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary, #1a1a1a);
    font-size: 14px;
    margin-bottom: var(--spacing-lg, 24px);
    transition: all 0.2s ease;
}

.custom-modal-input:focus {
    outline: none;
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.custom-modal-input::placeholder {
    color: var(--text-secondary, #6b7280);
}

.custom-modal-buttons {
    display: flex;
    gap: var(--spacing-sm, 8px);
    justify-content: center;
}

.custom-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 160px;
}

.custom-modal-btn:active {
    transform: scale(0.97);
}

.custom-modal-btn.cancel {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #1a1a1a);
    border: 1px solid var(--border-color, #e5e7eb);
}

.custom-modal-btn.cancel:hover {
    background: var(--bg-hover, #f0f1f3);
}

.custom-modal-btn.confirm {
    background: var(--accent-color, #3b82f6);
    color: white;
}

.custom-modal-btn.confirm:hover {
    background: var(--accent-hover, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.custom-modal-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.custom-modal-btn.danger:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.custom-modal-btn.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.custom-modal-btn.success:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}
