/* Dentivo - Medical SaaS Design System */

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

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #1F8A8B;
    --primary-hover: #177778;
    --primary-light: #E8F5F5;
    --primary-alpha: rgba(31, 138, 139, 0.12);
    --navy: #1B2A41;
    --navy-light: #2D3F5A;
    --bg: #F4F7FA;
    --surface: #FFFFFF;
    --border: #E3EAF2;
    --accent: #6FE7DD;
    --accent-light: rgba(111, 231, 221, 0.15);
    --text-primary: #1B2A41;
    --text-secondary: #5A6A7E;
    --text-muted: #8D9CAD;
    --shadow-sm: 0 1px 3px rgba(27, 42, 65, 0.08);
    --shadow-md: 0 4px 12px rgba(27, 42, 65, 0.10);
    --shadow-lg: 0 8px 24px rgba(27, 42, 65, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 120ms ease;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --primary:        #2BBDBE;
    --primary-hover:  #23A5A6;
    --primary-light:  #1A3535;
    --primary-alpha:  rgba(43, 189, 190, 0.15);
    --navy:           #E2EAF4;
    --navy-light:     #C8D6E8;
    --bg:             #0F1923;
    --surface:        #1A2535;
    --border:         #2D3D52;
    --text-primary:   #E2EAF4;
    --text-secondary: #8DA0B8;
    --text-muted:     #5A6E85;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.4);
}

/* Sanfte Transition beim Theme-Wechsel */
*, *::before, *::after {
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

/* Transition für kritische Performance-Elemente deaktivieren */
.card, .column, .modal-content {
    transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

/* ===== RESET & BASIS ===== */

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

body {
    font-family: var(--font-ui);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== SIDEBAR ===== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 900;
}

.sidebar.collapsed {
    transform: translateX(-210px);
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}

.sidebar-header h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.btn-create-board {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(31, 138, 139, 0.28);
    letter-spacing: 0.01em;
}

.btn-create-board:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 138, 139, 0.36);
}

.boards-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.board-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

.board-item:hover {
    background: var(--bg);
}

.board-item.active {
    background: var(--primary-light);
}

.board-item.active .board-title {
    color: var(--primary);
    font-weight: 600;
}

.board-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.board-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-actions-btn {
    opacity: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition);
    font-size: 15px;
}

.board-item:hover .board-actions-btn {
    opacity: 1;
}

.board-actions-btn:hover {
    background: var(--border);
}

.board-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    z-index: 1000;
    min-width: 180px;
}

.board-menu-item {
    width: 100%;
    background: none;
    border: none;
    padding: 9px 16px;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-primary);
    transition: background var(--transition);
}

.board-menu-item:hover {
    background: var(--bg);
}

.board-menu-item.danger {
    color: #D94F4F;
}

/* ===== MAIN CONTENT ===== */

.main-content {
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    padding: 20px;
}

.main-content.sidebar-collapsed {
    margin-left: 50px;
}

/* ===== HEADER / NAVBAR ===== */

header {
    background: var(--surface);
    padding: 14px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    gap: 20px;
}

header h1 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

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

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

.btn-toggle {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all var(--transition);
}

.btn-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

#view-icon {
    font-size: 15px;
}

/* ===== CONTAINER ===== */

.container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ===== BOARD COLUMNS ===== */

.board-columns {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding-bottom: 20px;
    min-height: 120px;
}

.column {
    flex: 0 0 300px;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Archiv-Liste */
.column.archive-list {
    background: #F0F3F8;
    border: 2px dashed #C5D0DF;
    opacity: 0.9;
}

.column.archive-list .column-title {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.column.archive-list .column-title:hover,
.column.archive-list .column-title:focus {
    background: transparent;
}

.column.archive-list .cards-container {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 5px;
}

.column.archive-list .card {
    background: #F4F7FA;
    opacity: 0.85;
}

.column.archive-list:hover {
    opacity: 1;
    border-color: var(--primary);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.column-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.column-title {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    outline: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    cursor: text;
    letter-spacing: -0.01em;
}

.column-title:hover,
.column-title:focus {
    background: var(--border);
}

.btn-delete-list {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    opacity: 0;
}

.column-title-container:hover .btn-delete-list {
    opacity: 1;
}

.btn-delete-list:hover {
    background: #FDE8E8;
    color: #D94F4F;
}

.card-count {
    background: var(--border);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.cards-container {
    flex: 1;
    min-height: 100px;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.cards-container.drag-over {
    background: var(--primary-alpha);
    border: 2px dashed var(--primary);
}

/* ===== CARDS ===== */

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border-left: 4px solid transparent;
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border);
    border-left-color: transparent;
}

.card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.card.archived {
    background: #F4F7FA;
    opacity: 0.7;
    border-left-color: var(--text-muted);
}

.card.archived .card-title {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.card.archived .card-description,
.card.archived .card-date {
    color: var(--text-muted);
}

.card-title {
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.card-description {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    display: inline-block;
    background: var(--bg);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.card-date.overdue {
    background: #FDE8E8;
    color: #D94F4F;
    border-color: #F5C5C5;
}

.card-date.soon {
    background: #FFF4E5;
    color: #B76B00;
    border-color: #FFD9A0;
}

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

.btn-add-card {
    background: transparent;
    border: 2px dashed var(--border);
    color: var(--text-muted);
    padding: 9px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    text-align: left;
    transition: all var(--transition);
    margin-top: 8px;
    width: 100%;
}

.btn-add-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.add-list-container {
    flex: 0 0 300px;
    display: flex;
    align-items: flex-start;
}

.btn-add-list {
    width: 100%;
    min-height: 50px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px dashed var(--border);
    color: var(--text-secondary);
    padding: 15px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-add-list:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .btn-add-list {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* ===== EMPTY STATES ===== */

.empty-state {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.empty-state h2,
.empty-state h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

/* ===== CALENDAR ===== */

#calendar-view {
    flex-direction: column;
    width: 100%;
}

.calendar-header {
    background: var(--surface);
    padding: 18px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.calendar-header h2 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.btn-nav {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition);
}

.btn-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.calendar-grid {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}

.calendar-day-header {
    background: var(--bg);
    color: var(--text-secondary);
    padding: 11px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-right: 1px solid var(--border);
}

.calendar-day-header:last-child {
    border-right: none;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(110px, auto);
}

.calendar-day {
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 6px;
    overflow: hidden;
    position: relative;
    transition: background var(--transition);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: #FAFCFF;
}

.calendar-day.other-month {
    background: var(--bg);
}

.calendar-day.other-month .day-number {
    color: var(--text-muted);
}

.calendar-day.today {
    background: #F0FBFA;
}

.calendar-day.today .day-number {
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    border: 2px solid var(--primary);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-day.drag-over {
    background: var(--primary-light);
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

.day-number {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 12px;
    padding: 3px 4px;
    display: inline-block;
    border-radius: 50%;
    transition: background var(--transition);
}

.day-number:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.calendar-day .card {
    margin-bottom: 3px;
    padding: 4px 7px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--primary);
    background: var(--surface);
}

.calendar-day .card:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
}

.calendar-day .card-title {
    font-size: 11px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day .card-description,
.calendar-day .card-date {
    display: none;
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 42, 65, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 0;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

#card-form,
#board-form {
    padding: 20px 24px;
}

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

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 7px;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-ui);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-group textarea {
    resize: vertical;
}

.form-group input[type="color"] {
    height: 50px;
    padding: 5px;
    cursor: pointer;
}

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

/* ===== BUTTON SYSTEM ===== */

.btn {
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(31, 138, 139, 0.28);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(31, 138, 139, 0.36);
}

.btn-secondary {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--navy);
}

.btn-secondary:hover {
    background: var(--navy);
    color: white;
}

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

.btn-danger:hover {
    background: #C03030;
}

.btn-warning {
    background: #E8920A;
    color: white;
}

.btn-warning:hover {
    background: #C87800;
}

.btn-success {
    background: #1A8A5E;
    color: white;
}

.btn-success:hover {
    background: #156B4A;
}

/* Board Controls */
.board-controls {
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-archive-toggle {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-archive-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Kalender-Archiv-Filter */
.filter-archive {
    background: var(--surface);
    border: 1.5px solid var(--border);
}

.filter-archive.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== HEADER MIT USER & WORKSPACE ===== */

.workspace-selector {
    position: relative;
}

.btn-workspace {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-workspace:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.dropdown-icon {
    font-size: 9px;
    color: var(--text-muted);
}

.workspace-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 300px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.workspace-item {
    padding: 11px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--bg);
}

.workspace-item:hover {
    background: var(--bg);
}

.workspace-item.active {
    background: var(--primary-light);
}

.workspace-item-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.workspace-item-content strong {
    color: var(--text-primary);
    font-size: 13px;
}

.workspace-item-content small {
    color: var(--text-muted);
    font-size: 12px;
}

.workspace-item.create-workspace,
.workspace-item.manage-workspace {
    color: var(--primary);
    border-bottom: none;
    font-weight: 600;
}

.workspace-item.create-workspace:hover,
.workspace-item.manage-workspace:hover {
    background: var(--primary-light);
}

.workspace-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.workspace-default-badge {
    display: inline-block;
    font-size: 10px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 6px;
    font-weight: 700;
    vertical-align: middle;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* User Display & Menu */
.user-display {
    position: relative;
}

.btn-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-user-menu:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Teal active user dot */
.btn-user-menu::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--surface);
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--primary);
}

.user-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.user-menu-item {
    padding: 11px 16px;
    cursor: pointer;
    transition: background var(--transition);
}

.user-menu-item:hover {
    background: var(--bg);
}

.user-menu-item strong {
    color: var(--text-primary);
    font-size: 13px;
}

.user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.btn-logout {
    padding: 7px 14px;
    background: transparent;
    color: #D94F4F;
    border: 1.5px solid #D94F4F;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: #D94F4F;
    color: white;
}

/* ===== AUTH PAGES (Login/Register) ===== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.auth-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-container h1 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 26px;
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.auth-container p {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form .form-group {
    margin-bottom: 0;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

.auth-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

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

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: #FDE8E8;
    color: #D94F4F;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid #F5C5C5;
}

/* ===== WORKSPACE SETTINGS MODAL ===== */

.workspace-settings-content {
    max-width: 700px;
    width: 90%;
}

.settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    padding: 0 24px;
}

.settings-tab {
    padding: 12px 22px;
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

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

.settings-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.settings-tab-content {
    display: none;
    padding: 20px 24px;
}

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

.danger-zone {
    background: #FDE8E8;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid #F5C5C5;
}

.danger-zone h4 {
    color: #D94F4F;
    margin-bottom: 8px;
    font-size: 15px;
}

.danger-zone p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
}

/* ===== API-TOKEN SEKTION ===== */
.api-token-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.api-token-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.api-token-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.api-token-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.api-token-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.api-token-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.api-token-input {
    flex: 1;
    padding: 8px 36px 8px 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    background: var(--bg-secondary, #f4f5f7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    color: var(--text-primary);
    letter-spacing: 0.04em;
    outline: none;
    min-width: 0;
}

.api-token-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-alpha, rgba(0,176,167,0.15));
}

.api-token-eye {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.api-token-eye:hover {
    opacity: 1;
}

.api-token-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.api-token-warning {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Mitglieder Tab */
.add-member-section h4,
.members-list-section h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form-row input[type="email"] {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 14px;
}

.form-row input[type="email"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-row select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 14px;
    background: var(--surface);
    cursor: pointer;
    color: var(--text-primary);
}

.form-row select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-row .btn {
    white-space: nowrap;
}

/* Members List */
#members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.member-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.member-info {
    flex: 1;
}

.member-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 3px;
}

.member-info small {
    color: var(--text-muted);
    font-size: 12px;
}

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

.role-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-badge.owner {
    background: var(--primary-light);
    color: var(--primary);
}

.role-badge.admin {
    background: #FFF4E5;
    color: #B76B00;
}

.role-badge.member {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    transition: all var(--transition);
}

.btn-remove {
    background: #FDE8E8;
    color: #D94F4F;
}

.btn-remove:hover {
    background: #D94F4F;
    color: white;
}

.btn-transfer {
    background: #FFF4E5;
    color: #B76B00;
}

.btn-transfer:hover {
    background: #B76B00;
    color: white;
}

.role-select {
    padding: 5px 10px;
    font-size: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    transition: all var(--transition);
}

.role-select:hover {
    border-color: var(--primary);
}

.role-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ===== CALENDAR EVENTS ===== */

.calendar-event {
    padding: 4px 7px;
    margin: 2px 0;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid var(--text-muted);
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-event:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.calendar-event.personal-event {
    background: var(--bg);
    border-left: 4px solid var(--primary);
}

.calendar-event.personal-event:hover {
    background: var(--primary-light);
}

.event-time {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 3px;
    font-size: 10px;
}

.event-title {
    color: var(--text-primary);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Kalender-Tag Datum clickbar */
.day-number {
    font-weight: 700;
    transition: background var(--transition);
    padding: 3px 4px;
    border-radius: 50%;
    display: inline-block;
}

/* Listen-Auswahl im Karten-Modal */
#card-list-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 14px;
    background: var(--surface);
    cursor: pointer;
    color: var(--text-primary);
}

#card-list-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ===== TOAST NOTIFICATIONS ===== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    pointer-events: all;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-enter {
    transform: translateX(400px);
    opacity: 0;
}

.toast-exit {
    transform: translateX(400px);
    opacity: 0;
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #E3FCF0;
    color: #1A8A5E;
}

.toast-error .toast-icon {
    background: #FDE8E8;
    color: #D94F4F;
}

.toast-warning .toast-icon {
    background: #FFF4E5;
    color: #E8920A;
}

.toast-info .toast-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.toast-message {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    flex-shrink: 0;
}

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

/* Loading Toast Spinner */
.toast-loading .toast-icon {
    background: transparent;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary-alpha);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== KOMMENTARE & ZUWEISUNGEN ===== */

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: var(--bg);
}

.comment-item {
    background: var(--surface);
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.comment-date {
    font-size: 11px;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-actions {
    margin-top: 7px;
    display: flex;
    gap: 8px;
}

.btn-delete-comment {
    background: transparent;
    color: #D94F4F;
    border: none;
    padding: 3px 7px;
    font-size: 11px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    transition: background var(--transition);
}

.btn-delete-comment:hover {
    background: #FDE8E8;
}

.comment-input-wrapper textarea {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 14px;
    resize: vertical;
    width: 100%;
    color: var(--text-primary);
    background: var(--surface);
}

.comment-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.assignments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 40px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.assignment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.assignment-badge .remove-assignment {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    margin-left: 3px;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.assignment-badge .remove-assignment:hover {
    opacity: 1;
}

/* ===== KARTEN-METADATA (Avatars & Counter) ===== */

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
}

.card-avatars {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: help;
}

.comment-count,
.attachment-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
}

/* Board-Name im Kalender */
.calendar-board-name {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -5px;
    margin-bottom: 14px;
    font-weight: 500;
}

/* ===== WORKSPACE-ÜBERSICHT ===== */

.workspace-overview-section {
    margin-bottom: 10px;
}

.btn-workspace-overview {
    width: 100%;
    background: var(--primary-light);
    color: var(--primary);
    border: 1.5px solid rgba(31, 138, 139, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-workspace-overview:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(31, 138, 139, 0.28);
}

.btn-workspace-overview.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* Übersichtsboard */
.overview-board-column {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    min-width: 280px;
    max-width: 280px;
}

.overview-column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}

.overview-board-badge {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.overview-column-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    letter-spacing: -0.01em;
}

.overview-card-count {
    background: var(--bg);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
}

/* Readonly-Karten */
.card.readonly {
    cursor: pointer;
    opacity: 0.95;
}

.card.readonly:hover {
    opacity: 1;
    box-shadow: var(--shadow-md);
}

/* Board-Farb-Indikator auf Karten */
.card-board-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.card.with-board-indicator {
    position: relative;
    padding-left: 12px;
}

/* Kalender: Board-Farben für Events */
.calendar-event.with-board-color {
    border-left: 4px solid;
    padding-left: 6px;
}

/* ===== LABELS/TAGS ===== */

.labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: white;
    cursor: default;
}

.label-chip .remove-label {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.label-chip .remove-label:hover {
    opacity: 1;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.card-label-mini {
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.01em;
}

/* ===== SEARCH ===== */

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 16px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 9px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    background: var(--bg);
    color: var(--text-primary);
    transition: all var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-result-item {
    padding: 11px 16px;
    border-bottom: 1px solid var(--bg);
    cursor: pointer;
    transition: background var(--transition);
}

.search-result-item:hover {
    background: var(--bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    font-size: 13px;
}

.search-result-context {
    font-size: 12px;
    color: var(--text-muted);
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== HEUTE BUTTON & KALENDER-FILTER ===== */

.btn-today {
    background: var(--primary);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 2px 6px rgba(31, 138, 139, 0.28);
}

.btn-today:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(31, 138, 139, 0.36);
}

.calendar-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== LISTEN-SORTIERUNG ===== */

.list-sort-dropdown {
    padding: 5px 9px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    margin-left: auto;
    font-family: var(--font-ui);
    color: var(--text-secondary);
    transition: border-color var(--transition);
}

.list-sort-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== LABEL-VERWALTUNG ===== */

.workspace-labels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-management-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.label-management-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.label-preview {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: white;
    min-width: 110px;
    text-align: center;
}

.label-edit-inputs {
    display: flex;
    gap: 10px;
    flex: 1;
}

.label-edit-inputs input[type="text"] {
    flex: 1;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color var(--transition);
}

.label-edit-inputs input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.label-edit-inputs input[type="color"] {
    width: 50px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.label-actions {
    display: flex;
    gap: 6px;
}

.btn-icon-small {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 17px;
    padding: 5px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-icon-small:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.btn-icon-small.btn-delete:hover {
    background: #FDE8E8;
    color: #D94F4F;
}

/* ===== CARD ATTACHMENTS ===== */

.attachment-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
    margin-bottom: 14px;
}

.attachment-dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.attachment-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    border-width: 3px;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    font-size: 30px;
    display: block;
    margin-bottom: 9px;
}

.dropzone-content p {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
}

.dropzone-content small {
    color: var(--text-muted);
    font-size: 12px;
}

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

.attachment-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.attachment-item:hover {
    background: var(--bg);
    border-color: var(--primary);
}

.attachment-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

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

.attachment-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.attachment-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.btn-view {
    color: var(--primary);
}

.btn-view:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.btn-download {
    color: #1A8A5E;
}

.btn-download:hover {
    background: #E3FCF0 !important;
    color: #1A8A5E !important;
}

/* ===== ARCHIV ANIMATIONEN ===== */

@keyframes archiveOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.85) translateY(-8px); }
}

@keyframes restoreIn {
    from { opacity: 0; transform: scale(0.85) translateY(-8px); }
    to   { opacity: 1; transform: scale(1); }
}

.card-archive-out {
    animation: archiveOut 150ms ease forwards;
    pointer-events: none;
}

.card-restore-in {
    animation: restoreIn 200ms ease forwards;
}

/* ===== INBOX / SIDEBAR SECTIONS ===== */

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px 4px;
    user-select: none;
}

.board-item.inbox-board-item {
    background: var(--primary-alpha);
    border-left: 3px solid var(--primary);
}

.board-item.inbox-board-item .board-title {
    color: var(--primary);
    font-weight: 600;
}

.board-item.inbox-board-item.active {
    background: var(--primary-light);
}

/* ===== INBOX OVERVIEW COLUMN ===== */

.column.inbox-overview-column {
    border-top: 3px solid var(--primary);
    background: var(--primary-light);
}

/* ===== INBOX ASSIGN PANEL (im Card-Modal) ===== */

.assign-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 0 24px 12px;
}

.assign-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.assign-panel-header strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn.btn-inbox {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(31, 138, 139, 0.28);
}

.btn.btn-inbox:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Checkbox-Label im Board-Modal */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Klein-Button */
.btn.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Assign-to-Board Panel im Modal */
#assign-to-board-panel {
    padding: 0 4px;
}

#assign-to-board-panel .assign-panel {
    margin: 8px 0 0;
}

/* ===== INBOX KONTEXTMENÜ ===== */

#inbox-context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 4px 0;
    font-size: 13px;
    user-select: none;
}

.ctx-header {
    padding: 8px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.ctx-board-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.ctx-board-item:hover {
    background: var(--bg);
}

.ctx-board-item:hover .ctx-submenu {
    display: block;
}

.ctx-board-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ctx-board-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.ctx-arrow {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
}

/* Submenu */
.ctx-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 4px 0;
    z-index: 10000;
}

/* Submenu links ausrichten wenn nah am rechten Rand */
@media (max-width: 900px) {
    .ctx-submenu {
        left: auto;
        right: 100%;
    }
}

.ctx-submenu-item {
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition);
}

.ctx-submenu-item:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.ctx-submenu-loading {
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 12px;
}

.ctx-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.ctx-item {
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition);
}

.ctx-item:hover {
    background: var(--bg);
}

/* ===== SIDEBAR DROP-TARGET ===== */

.board-item.sidebar-drop-target {
    background: var(--primary-alpha) !important;
    border-left: 3px solid var(--primary) !important;
    box-shadow: inset 0 0 0 2px var(--primary);
    transform: scale(1.02);
    transition: all 120ms ease;
}

.board-item.sidebar-drop-target .board-title {
    color: var(--primary);
    font-weight: 700;
}

/* ===== PHASE 2: QUICK ADD ===== */

.quick-add-area {
    padding: 6px 8px 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.quick-add-btn {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    text-align: left;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.quick-add-btn:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.quick-add-input-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.quick-add-input {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
}

.quick-add-input:focus {
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.quick-add-confirm,
.quick-add-cancel {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.quick-add-confirm {
    background: var(--primary);
    color: white;
}

.quick-add-confirm:hover {
    background: var(--primary-hover);
}

.quick-add-cancel {
    background: var(--bg);
    color: var(--text-secondary);
}

.quick-add-cancel:hover {
    background: var(--border);
}

/* ===== BOARD VIEW WRAPPER (Flex-Column-Layout) ===== */

.board-view-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.board-columns-wrapper {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
}

/* ===== PHASE 3: BOARD TOOLBAR (FILTER & SORT) ===== */

.board-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 2px 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.toolbar-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.toolbar-select {
    font-size: 12px;
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    font-weight: 500;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: auto;
    box-shadow: var(--shadow-sm);
}

.toolbar-select:focus,
.toolbar-select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.toolbar-reset {
    font-size: 11px;
    padding: 4px 9px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: background var(--transition), opacity var(--transition);
    line-height: 1;
}

.toolbar-reset:hover {
    background: var(--primary-hover);
}

.toolbar-sep {
    width: 1px;
    height: 14px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Empty states in list columns */

.empty-list-hint {
    text-align: center;
    padding: 16px 10px;
    color: var(--text-muted);
    font-size: 12px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    margin: 4px 0;
    background: none;
}

.empty-filter-hint {
    text-align: center;
    padding: 14px 10px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin: 4px 0;
}

/* ===== PHASE 4: LIST DRAG & DROP ===== */

.column.list-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.column.list-drag-over {
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
    background: var(--primary-alpha);
}

.column-header {
    cursor: grab;
}

.column-header:active {
    cursor: grabbing;
}

/* ===== PHASE 5: WORKSPACE MODAL ===== */

#create-workspace-modal {
    align-items: center;
    justify-content: center;
}

/* ===== PHASE 6: @MENTIONS ===== */

.mention-dropdown {
    position: absolute;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
}

.mention-option {
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background var(--transition);
}

.mention-option:hover,
.mention-option.selected {
    background: var(--primary-alpha);
    color: var(--primary);
}

.mention {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
    border-radius: 3px;
    padding: 0 3px;
}

/* ===== PHASE 7: EMPTY STATES ===== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 32px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 4px;
    opacity: 0.7;
}

.empty-state h2,
.empty-state h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.empty-state-board {
    padding: 24px 16px;
}

.empty-state-board .empty-state-icon {
    font-size: 32px;
}

.empty-state-board h3 {
    font-size: 15px;
}

.sidebar-empty-hint {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

/* ===== PHASE 8: DARK MODE TOGGLE BUTTON ===== */

.btn-theme-toggle {
    font-size: 16px;
    padding: 6px 10px;
    min-width: unset;
}

/* Dark mode adjustments for components that need explicit overrides */

[data-theme="dark"] .card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .column {
    background: #1E2D42;
}

[data-theme="dark"] .column-header {
    background: #1A2840;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .search-input {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
}

[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .search-results {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .toolbar-select {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .quick-add-cancel {
    background: var(--border);
    color: var(--text-secondary);
}

[data-theme="dark"] code,
[data-theme="dark"] pre {
    background: #0D1520;
    border-color: var(--border);
}

/* ===== BENACHRICHTIGUNGS-GLOCKE ===== */

.notif-bell-wrap {
    position: relative;
}

.notif-bell-btn {
    position: relative;
    font-size: 17px;
    padding: 6px 10px;
    min-width: unset;
    transition: transform 150ms ease;
}

.notif-bell-btn.has-notifications {
    animation: bell-shake 0.5s ease;
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0deg); }
    20%       { transform: rotate(-15deg); }
    40%       { transform: rotate(15deg); }
    60%       { transform: rotate(-10deg); }
    80%       { transform: rotate(10deg); }
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #E53E3E;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    border: 2px solid var(--surface);
}

/* ===== BENACHRICHTIGUNGS-DROPDOWN ===== */

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    overflow: hidden;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-mark-read-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.notif-mark-read-btn:hover {
    background: var(--primary-alpha);
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

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

.notif-item:hover {
    background: var(--bg);
}

.notif-item.notif-unread {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.notif-item.notif-unread:hover {
    background: var(--primary-alpha);
}

.notif-msg {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.notif-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== INBOX-BADGE (Sidebar) ===== */

.inbox-count-badge {
    margin-left: auto;
    margin-right: 4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.inbox-count-badge.inbox-count-new {
    background: #E53E3E;
    color: white;
    animation: pulse-badge 1.5s ease infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.85; transform: scale(1.08); }
}

/* Dark Mode Adjustments */

[data-theme="dark"] .notif-dropdown {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .notif-item.notif-unread {
    background: rgba(43, 189, 190, 0.12);
    border-left-color: var(--primary);
}

[data-theme="dark"] .notif-badge {
    border-color: #1A2535;
}

/* ===================================================
   CHAT – Floating Action Button + Panel
   =================================================== */

/* FAB Wrapper */
.chat-fab-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 950;
}

/* FAB Button */
.chat-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0, 121, 191, 0.45);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
    line-height: 1;
}

.chat-fab:hover {
    background: var(--primary-hover);
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0, 121, 191, 0.55);
}

.chat-fab.active {
    background: var(--primary-hover);
    transform: scale(0.96);
}

/* Unread Badge auf dem FAB */
.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    line-height: 1;
    pointer-events: none;
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 92px;   /* FAB (56) + Abstand (12) + margin (24) */
    right: 24px;
    width: 360px;
    height: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 940;
    /* Animations-State: versteckt */
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
}

.chat-header-icon {
    font-size: 16px;
    flex-shrink: 0;
}

#chat-workspace-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.chat-close-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
}

/* Nachrichten-Bereich */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0 4px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 48px 24px;
    line-height: 1.8;
}

/* Datumstrennlinie */
.chat-date-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 4px 0;
}

.chat-date-divider::before,
.chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Nachrichten-Zeile */
.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 2px 12px;
    transition: background-color 0.12s;
}

.chat-message:hover {
    background: rgba(0, 0, 0, 0.03);
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-message.grouped {
    margin-top: -2px;
}

/* Avatar */
.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 2px;
}

.chat-avatar-placeholder {
    width: 28px;
    flex-shrink: 0;
}

/* Content (Meta + Bubble) */
.chat-content {
    display: flex;
    flex-direction: column;
    max-width: 72%;
    gap: 3px;
}

.chat-message.own .chat-content {
    align-items: flex-end;
}

/* Meta-Zeile */
.chat-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 0 4px;
}

.chat-username {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.chat-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* Nachrichten-Blase */
.chat-bubble {
    padding: 8px 12px;
    border-radius: 4px 16px 16px 16px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.chat-message.own .chat-bubble {
    background: var(--primary);
    border-color: transparent;
    color: white;
    border-radius: 16px 4px 16px 16px;
}

/* Links in Blasen */
.chat-bubble a {
    color: var(--primary);
    word-break: break-all;
}

.chat-message.own .chat-bubble a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

/* @Mentions in Blasen */
.chat-bubble .mention {
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 4px;
    padding: 0 3px;
    font-weight: 600;
}

.chat-message.own .chat-bubble .mention {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

/* Eingabebereich */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
    border-radius: 0 0 16px 16px;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text-primary);
    resize: none;
    min-height: 36px;
    max-height: 120px;
    outline: none;
    line-height: 1.5;
    transition: border-color var(--transition);
    overflow-y: auto;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}

.chat-send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.08);
}

.chat-send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Dark Mode Anpassungen */
[data-theme="dark"] .chat-message:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .chat-fab-badge {
    border-color: #0F1923;
}

[data-theme="dark"] .chat-panel {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── FAB Glow & Badge Pulse (Unread-Marker) ── */

.chat-fab.unread {
    animation: chat-fab-glow 2.5s ease infinite;
}

@keyframes chat-fab-glow {
    0%, 100% { box-shadow: 0 4px 18px rgba(0, 121, 191, 0.45); }
    50%       { box-shadow: 0 4px 18px rgba(0, 121, 191, 0.55),
                            0 0 0 8px rgba(0, 121, 191, 0.12); }
}

[data-theme="dark"] .chat-fab.unread {
    animation: chat-fab-glow-dark 2.5s ease infinite;
}

@keyframes chat-fab-glow-dark {
    0%, 100% { box-shadow: 0 4px 18px rgba(43, 189, 190, 0.45); }
    50%       { box-shadow: 0 4px 18px rgba(43, 189, 190, 0.6),
                            0 0 0 8px rgba(43, 189, 190, 0.15); }
}

/* Pulsierendes Badge (wie Inbox) */
.chat-fab-badge.pulse {
    animation: pulse-badge 1.5s ease infinite;
}

/* ── Nachricht-Highlight beim Klick auf Chat-Notif ── */

@keyframes chat-msg-highlight {
    0%   { background: var(--primary-alpha); }
    100% { background: transparent; }
}

.chat-message-highlight {
    animation: chat-msg-highlight 2.5s ease forwards;
    border-radius: 6px;
}

/* ── Chat-Mention Notifikation in der Glocke ── */

.notif-item.notif-chat {
    border-left: 3px solid var(--primary);
}

.notif-type-icon {
    font-size: 13px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   Aktivitätslog im Card-Modal
   ══════════════════════════════════════════════════════════════ */

/* Header-Zeile (klickbar zum Ein-/Ausklappen) */
.activity-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary, #f4f5f7);
    border: 1px solid var(--border, #dfe1e6);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.activity-log-header:hover {
    background: var(--bg-hover, #ebecf0);
}

.activity-log-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #172b4d);
    display: flex;
    align-items: center;
    gap: 6px;
}

.activity-log-icon {
    font-size: 14px;
}

.activity-log-chevron {
    font-size: 11px;
    color: var(--text-muted, #5e6c84);
    transition: transform 0.2s;
}

/* Body — standardmäßig eingeklappt */
.activity-log-body {
    display: none;
    border: 1px solid var(--border, #dfe1e6);
    border-top: none;
    border-radius: 0 0 var(--radius-sm, 6px) var(--radius-sm, 6px);
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg, #ffffff);
}

.activity-log-body.open {
    display: block;
}

/* Einzelner Eintrag */
.activity-list {
    padding: 6px 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 14px;
    font-size: 12.5px;
    line-height: 1.45;
    border-bottom: 1px solid var(--border-light, #f0f1f3);
}

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

.activity-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
    width: 18px;
    text-align: center;
}

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-actor {
    font-weight: 600;
    color: var(--text-primary, #172b4d);
}

.activity-text {
    color: var(--text-secondary, #344563);
}

.activity-text em {
    color: var(--text-muted, #5e6c84);
    font-style: normal;
}

.activity-text strong {
    color: var(--text-primary, #172b4d);
    font-weight: 600;
}

.activity-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #5e6c84);
    margin-top: 2px;
}

/* Lade- und Leer-Zustände */
.activity-loading,
.activity-empty {
    padding: 16px 14px;
    font-size: 12.5px;
    color: var(--text-muted, #5e6c84);
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   Einklappbare Listen-Spalten
   ══════════════════════════════════════════════════════════════ */

/* Eingeklappter Zustand: nur Karten und QuickAdd ausblenden, Header bleibt normal */
.column.collapsed .cards-container,
.column.collapsed .quick-add-area {
    display: none;
}

/* Collapse-Button Basisstil */
.btn-collapse-list {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted, #5e6c84);
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.btn-collapse-list:hover {
    background: var(--bg-hover, #ebecf0);
    color: var(--text-primary, #172b4d);
}

/* ══════════════════════════════════════════════════════════════
   Karten-Kontextmenü (reguläre Boards)
   ══════════════════════════════════════════════════════════════ */

.card-context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--bg-secondary, #f4f5f7);
    border: 1px solid var(--border, #dfe1e6);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    min-width: 220px;
    max-width: 280px;
    padding: 4px 0;
    font-size: 13px;
    user-select: none;
}

/* Karten-Titel als kleiner Header */
.ctx-card-title {
    padding: 8px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #5e6c84);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Klickbare Menü-Zeile */
.ctx-item {
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text-primary, #172b4d);
    transition: background 0.12s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ctx-item:hover {
    background: var(--bg-hover, #ebecf0);
}
.ctx-item.ctx-danger:hover {
    background: #ffeaea;
    color: #c62828;
}

/* Abschnitts-Überschrift (Labels / Mitglieder) */
.ctx-section-title {
    padding: 6px 14px 3px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #5e6c84);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Chip-Container */
.ctx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 4px 10px 8px;
}

/* Label-Chip */
.ctx-label-chip {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 0.15s, transform 0.12s;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ctx-label-chip:hover {
    opacity: 1;
    transform: scale(1.06);
}
.ctx-label-chip.assigned {
    opacity: 1;
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 1px;
}

/* Member-Avatar-Chip */
.ctx-member-chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    opacity: 0.62;
    transition: opacity 0.15s, transform 0.12s;
    flex-shrink: 0;
}
.ctx-member-chip:hover {
    opacity: 1;
    transform: scale(1.12);
}
.ctx-member-chip.assigned {
    opacity: 1;
    outline: 2px solid var(--primary, #0079bf);
    outline-offset: 2px;
}

/* Trennlinie */
.ctx-separator {
    border: none;
    border-top: 1px solid var(--border, #dfe1e6);
    margin: 4px 0;
}

/* ===== AUTH PAGES (Login / Register) ===== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F7FA;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(27, 42, 65, 0.12);
    border: 1px solid #E3EAF2;
}

.auth-card h1 {
    color: #1F8A8B;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 26px;
    margin-bottom: 6px;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-card h2 {
    color: #1B2A41;
    font-size: 18px;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 600;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    color: #5A6A7E;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
}

.auth-form input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #E3EAF2;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.12s, box-shadow 0.12s;
    background: white;
    color: #1B2A41;
}

.auth-form input:focus {
    outline: none;
    border-color: #1F8A8B;
    box-shadow: 0 0 0 3px rgba(31, 138, 139, 0.12);
}

.auth-form button[type="submit"] {
    width: 100%;
    background: #1F8A8B;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.auth-form button[type="submit"]:active {
    transform: translateY(0);
}

.auth-switch {
    text-align: center;
    margin-top: 25px;
    color: #5e6c84;
    font-size: 14px;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-page .error-message {
    background: #ffebe6;
    color: #de350b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.auth-page .error-message.show {
    display: block;
}

.auth-page .success-message {
    background: #e3fcef;
    color: #006644;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.auth-page .success-message.show {
    display: block;
}
