/* ========================================
   Wiki — Modern UI Stylesheet
   ======================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --success: #22c55e;
    --success-bg: #dcfce7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    --bg: #f0f2f7;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-solid: #ffffff;
    --bg-sidebar: #12103d;
    --text: #1e293b;
    --text-light: #64748b;
    --text-sidebar: #c7c4f0;
    --border: rgba(226, 232, 240, 0.8);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    --sidebar-width: 270px;

    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-success: linear-gradient(135deg, #22c55e, #16a34a);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-info: linear-gradient(135deg, #3b82f6, #2563eb);
    --gradient-bg: linear-gradient(135deg, #eff1f7 0%, #e8e4f3 50%, #eef0fa 100%);
}

/* Dark-Mode — saubere Tonwert-Hierarchie:
   sidebar (dunkel)  →  bg (mittel)  →  card (hell)
   Solid-Flächen statt rgba-Transparenz, damit kein Farbmatsch auf Gradienten entsteht. */
[data-theme="dark"] {
    --bg: #0f1220;
    --bg-card: #1a1e33;
    --bg-card-solid: #1a1e33;
    --bg-sidebar: #080a14;

    --text: #e8eaf0;
    --text-light: #9aa3c2;
    --text-sidebar: #b8bcd8;

    --border: #2a2f47;

    --shadow:    0 1px 2px rgba(0,0,0,0.45);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.55);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.65);

    /* Kein Gradient-Hintergrund im Dunkelmodus — wirkt auf OLED/Laptop-Displays matschig. */
    --gradient-bg: #0f1220;

    --primary-glow: rgba(99, 102, 241, 0.35);
    --success-bg: rgba(34, 197, 94, 0.18);
    --danger-bg:  rgba(239, 68, 68, 0.18);
    --warning-bg: rgba(245, 158, 11, 0.18);
    --info-bg:    rgba(59, 130, 246, 0.18);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); text-decoration: none; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ========== Animations ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes progressFill {
    from { width: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 8px var(--primary-glow); }
    50% { box-shadow: 0 0 20px var(--primary-glow); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.shake { animation: shake 0.4s ease; }

/* Page load animation */
.page-content {
    animation: fadeIn 0.4s ease;
    flex: 1;
}

/* Staggered card animation */
.page-content .card,
.page-content .stat-card {
    animation: fadeInUp 0.5s ease backwards;
}
.page-content > :nth-child(1) { animation-delay: 0.05s; }
.page-content > :nth-child(2) { animation-delay: 0.1s; }
.page-content > :nth-child(3) { animation-delay: 0.15s; }
.page-content > :nth-child(4) { animation-delay: 0.2s; }
.page-content > :nth-child(5) { animation-delay: 0.25s; }
.page-content > :nth-child(6) { animation-delay: 0.3s; }

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
    border-right: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.15), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.1), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

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

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-header .logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header .logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: transform var(--transition-spring), box-shadow var(--transition);
}

.sidebar-header .logo-icon:hover {
    transform: rotate(-8deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.sidebar-header .logo-icon svg { width: 20px; height: 20px; }

.sidebar-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c7c4f0, #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.sidebar-toggle { display: none; background: none; border: none; color: var(--text-sidebar); cursor: pointer; padding: 0.5rem; border-radius: var(--radius-xs); transition: background var(--transition-fast); }
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); }

.nav-links {
    list-style: none;
    padding: 0.75rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.nav-links li {
    margin-bottom: 2px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: var(--text-sidebar);
    text-decoration: none;
    transition: all var(--transition);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    position: relative;
    font-weight: 450;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
    transition: transform var(--transition-spring);
}

.nav-links li a:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

.nav-links li a:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-links li.active a {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.nav-links li.active a::before {
    transform: translateY(-50%) scaleY(1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.nav-links li a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.75; transition: opacity var(--transition-fast); }
.nav-links li a:hover svg, .nav-links li.active a svg { opacity: 1; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.user-info .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
}

.user-info svg { width: 16px; height: 16px; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-sidebar);
    opacity: 0.6;
    font-size: 0.82rem;
    text-decoration: none;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.btn-logout:hover { opacity: 1; text-decoration: none; background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.btn-logout svg { width: 15px; height: 15px; }

/* ========== Content ========== */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 0.5rem; border-radius: var(--radius-xs); transition: background var(--transition-fast); }
.mobile-menu-btn:hover { background: rgba(0,0,0,0.05); }

.header-actions { display: flex; gap: 0.5rem; align-items: center; }

.page-content { padding: 1.75rem 2rem 3rem; }

/* ========== Cards (Glassmorphism) ========== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform var(--transition), box-shadow var(--transition);
}
/* Im Dunkelmodus sind Cards solide — Backdrop-Filter mit rgba-Bg würde den
   Dark-Canvas durchschimmern lassen und die Abstufung zwischen bg und card verwischen. */
[data-theme="dark"] .card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 svg { width: 18px; height: 18px; color: var(--primary); }

/* ========== Stat Cards (Dashboard) ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition-spring);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-icon svg { width: 24px; height: 24px; }

.stat-icon.income { background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05)); color: var(--success); }
.stat-icon.expense { background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05)); color: var(--danger); }
.stat-icon.balance { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05)); color: var(--info); }
.stat-icon.savings { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); color: var(--warning); }

.stat-card:has(.stat-icon.income)::before { background: var(--gradient-success); }
.stat-card:has(.stat-icon.expense)::before { background: var(--gradient-danger); }
.stat-card:has(.stat-icon.balance)::before { background: var(--gradient-info); }
.stat-card:has(.stat-icon.savings)::before { background: var(--gradient-warning); }

.stat-info h4 { font-size: 0.78rem; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.15rem; }
.stat-info .stat-value { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.02em; }
.stat-info .stat-change { font-size: 0.78rem; margin-top: 0.2rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.1rem 0.4rem; border-radius: 999px; }
.stat-change.positive { color: var(--success); background: var(--success-bg); }
.stat-change.negative { color: var(--danger); background: var(--danger-bg); }

/* ========== Charts Grid ========== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container { position: relative; height: 300px; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn svg { width: 17px; height: 17px; }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.btn-success:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    color: #fff;
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    color: #fff;
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow);
}
.btn-outline:hover { background: var(--bg-card-solid); box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-sm svg { width: 14px; height: 14px; }

.btn-icon {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}
.btn-icon:hover { background: var(--bg-card); color: var(--primary); transform: rotate(15deg); }
.btn-icon svg { width: 20px; height: 20px; }

/* Button tooltip */
.btn[title], .btn-icon[title], .btn-sm[title] {
    position: relative;
}

/* ========== Forms ========== */
.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background: var(--bg-card-solid);
    color: var(--text);
    transition: all var(--transition);
    font-family: inherit;
}

.form-control:hover {
    border-color: var(--text-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--bg-card-solid);
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 1rem;
}

/* ========== Tables ========== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    background: var(--bg-card-solid);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    transition: background var(--transition-fast);
}

tbody tr {
    transition: all var(--transition-fast);
}

tbody tr:nth-child(even) {
    background: rgba(99, 102, 241, 0.02);
}

[data-theme="dark"] tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

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

.amount-in { color: var(--success); font-weight: 650; }
.amount-out { color: var(--danger); font-weight: 650; }

/* Text Truncation Utilities */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

td.td-note {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    td.td-note { max-width: 120px; }
}

.budget-header .budget-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ========== Category Badge ========== */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 550;
    transition: transform var(--transition-fast);
}

.category-badge:hover {
    transform: scale(1.05);
}

/* ========== Alerts ========== */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    margin: 0 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 500;
    animation: slideInDown 0.4s ease backwards;
    border-left: 4px solid transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alert-success { background: var(--success-bg); color: #166534; border-left-color: var(--success); }
.alert-danger { background: var(--danger-bg); color: #991b1b; border-left-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-left-color: var(--warning); }
.alert-info { background: var(--info-bg); color: #1e40af; border-left-color: var(--info); }

[data-theme="dark"] .alert-success { color: #86efac; }
[data-theme="dark"] .alert-danger { color: #fca5a5; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-info { color: #93c5fd; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    padding: 0.25rem;
    border-radius: 50%;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ========== Modal ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card-solid);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
    border: 1px solid var(--border);
}

.modal h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ========== Budget Progress ========== */
.budget-item {
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.budget-item:hover {
    background: rgba(99, 102, 241, 0.03);
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.budget-header .budget-name { font-weight: 600; font-size: 0.9rem; }
.budget-header .budget-amount { font-size: 0.82rem; color: var(--text-light); font-weight: 500; }

.progress-bar {
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressFill 1s ease backwards;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

.progress-fill.ok { background: var(--gradient-success); }
.progress-fill.warning { background: var(--gradient-warning); }
.progress-fill.danger { background: var(--gradient-danger); }

/* ========== Quick Add ========== */
.quick-add {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.quick-add input {
    flex: 1;
    padding: 0.85rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    transition: all var(--transition);
    font-family: inherit;
}

.quick-add input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.quick-add-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0;
    margin-bottom: 2rem;
    opacity: 0.7;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.pagination a:hover {
    background: var(--bg-card);
    text-decoration: none;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination .active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ========== Empty State ========== */
/* .empty-state — konsolidierte Definition unten (~Zeile 2612). */

/* ========== Auth Pages ========== */
.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-bg);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12), transparent 70%);
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.1), transparent 70%);
    pointer-events: none;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow-xl);
    padding: 2.75rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

.auth-card .auth-logo {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    animation: float 3s ease-in-out infinite;
}

.auth-card .auth-logo svg { width: 28px; height: 28px; color: #fff; }

.auth-card h1 {
    text-align: center;
    margin-bottom: 0.4rem;
    font-size: 1.75rem;
    font-weight: 750;
    background: linear-gradient(135deg, var(--primary), #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-card .auth-link {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.88rem;
    color: var(--text-light);
}

.auth-error {
    background: var(--danger-bg);
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 3px solid var(--danger);
    animation: shake 0.4s ease;
}

[data-theme="dark"] .auth-error { color: #fca5a5; }

/* ========== Settings Grid ========== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 1.5rem;
}

/* ========== Budget Grid ========== */
.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
}

/* ========== Export Grid ========== */
.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 1.5rem;
}

/* ========== Budget Percentage Display ========== */
.budget-percentage {
    font-size: 2.25rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    text-align: center;
    margin: 1rem 0;
}

.budget-percentage.status-ok { color: var(--text); }
.budget-percentage.status-warning { color: var(--warning); }
.budget-percentage.status-danger { color: var(--danger); }

.budget-detail {
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: center;
}

.budget-meta {
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-light);
}

/* ========== Action Bar ========== */
.action-bar {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.action-bar .summary {
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 500;
}

/* ========== Inline Alert (for cards) ========== */
.alert-inline {
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

/* ========== Color Dot ========== */
.color-dot {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: transform var(--transition-fast);
}

.color-dot:hover { transform: scale(1.2); }

/* ========== Responsive ========== */

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .charts-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .page-content { padding: 1.25rem 1.5rem 2rem; }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open { transform: translateX(0); }

    .sidebar-toggle { display: block; }
    .mobile-menu-btn { display: flex; }

    .content { margin-left: 0; }
    .content-header { padding: 0.85rem 1rem; }
    .page-content { padding: 1rem; }

    .charts-grid {
        grid-template-columns: 1fr;
    }

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

    .stat-card {
        padding: 1rem;
    }

    .stat-icon { width: 42px; height: 42px; }
    .stat-info .stat-value { font-size: 1.2rem; }

    .form-row { grid-template-columns: 1fr; }
    .alert { margin: 0 1rem 1rem; }

    .settings-grid,
    .export-grid { grid-template-columns: 1fr; }

    .budget-grid { grid-template-columns: 1fr; }

    /* Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card-solid);
        border-top: 1px solid var(--border);
        z-index: 100;
        padding: 0.35rem 0.25rem;
        padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
        justify-content: space-around;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        padding: 0.5rem 0.75rem;
        color: var(--text-light);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 500;
        border-radius: var(--radius-sm);
        transition: all var(--transition-fast);
        min-width: 56px;
    }

    .mobile-bottom-nav a svg { width: 22px; height: 22px; }

    .mobile-bottom-nav a.active {
        color: var(--primary);
    }

    .mobile-bottom-nav a.active svg {
        filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
    }

    /* Ensure page content has enough bottom padding for bottom nav */
    .content {
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    }

    /* Larger touch targets on mobile */
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .form-control { min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .auth-card { padding: 2rem 1.5rem; }

    /* Kompaktere Abstände */
    .content-header { padding: 0.75rem 1rem; }
    .content-header h1 { font-size: 1.15rem; }
    .page-content { padding: 0.75rem 0.75rem 2rem; }

    /* Kompaktere Cards */
    .card { padding: 1.15rem; margin-bottom: 1rem; }
    .card-header { margin-bottom: 1rem; padding-bottom: 0.6rem; }
    .card-header h3 { font-size: 0.95rem; }

    /* Kompaktere Stat-Cards */
    .stat-card { padding: 1rem; gap: 0.75rem; }
    .stat-icon { width: 42px; height: 42px; }
    .stat-info .stat-value { font-size: 1.15rem; }

    /* Tabellen kompakter */
    thead th { padding: 0.6rem 0.5rem; font-size: 0.65rem; }
    tbody td { padding: 0.6rem 0.5rem; font-size: 0.8rem; }

    /* Touch-freundliche Pagination */
    .pagination a, .pagination span {
        padding: 0.6rem 0.9rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Alerts anpassen */
    .alert {
        margin: 0 0.5rem 0.75rem;
        padding: 0.7rem 1rem;
        font-size: 0.82rem;
    }

    /* Modals für kleine Screens */
    .modal { padding: 1.25rem; width: 95%; }
    .modal h2 { font-size: 1.1rem; }

    /* Quick-Add stapeln */
    .quick-add { flex-direction: column; }
    .quick-add input { width: 100%; }

    /* Grids erzwingen */
    .settings-grid,
    .export-grid,
    .budget-grid { grid-template-columns: 1fr; }

    /* Charts */
    .charts-grid { grid-template-columns: 1fr; }
    .chart-container { height: 220px; }

    /* Action-Bar stapeln */
    .action-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }
}

/* ========== Install Page Overrides ========== */
.installer {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 620px;
    padding: 2.75rem;
    animation: fadeInUp 0.6s ease;
}


.widget-item {
    min-width: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.widget-item[draggable="true"] {
    cursor: grab;
    border: 2px dashed transparent;
    border-radius: var(--radius);
    padding: 2px;
}

.widget-item[draggable="true"]:hover {
    border-color: var(--primary);
}

.widget-item[draggable="true"]:active {
    cursor: grabbing;
}


/* ========== Fixed Footer ========== */
.site-footer {
    text-align: center;
    padding: 1.25rem 2rem;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    margin-top: auto;
    background: var(--bg-card);
    z-index: 10;
}

.site-footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

.site-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.site-footer .footer-brand {
    font-size: 0.75rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .site-footer {
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ========== Legal Pages (Datenschutz, AGB, Impressum) ========== */
.legal-page {
    max-width: 750px;
}

.legal-page .legal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.legal-page .legal-header {
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.legal-page .legal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.legal-page .legal-header p {
    margin: 0.5rem 0 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

.legal-page .legal-body {
    padding: 2rem;
}

.legal-page .legal-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.legal-page .legal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-page .legal-section h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-page .legal-section h4::before {
    content: '';
    width: 4px;
    height: 1.1em;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.legal-page .legal-section p {
    color: var(--text-light);
    line-height: 1.8;
    white-space: pre-line;
    margin: 0;
}

.legal-page .legal-footer {
    padding: 1.25rem 2rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
}

/* ========== Sidebar Nav Groups ========== */
.nav-group-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(199, 196, 240, 0.45);
    padding: 1.25rem 1.5rem 0.3rem;
    font-weight: 700;
    list-style: none;
    user-select: none;
}
.nav-group-title:first-child { padding-top: 0.5rem; }

/* ========== Admin Sidebar Layout ========== */
.admin-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.admin-sidebar {
    width: 210px;
    min-width: 210px;
    background: var(--bg-card-solid);
    border-radius: 12px;
    padding: 0.5rem;
    position: sticky;
    top: 1rem;
    height: fit-content;
    box-shadow: var(--shadow);
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.admin-sidebar a:hover {
    background: var(--bg);
    color: var(--primary);
}
.admin-sidebar a.active {
    background: var(--primary);
    color: #fff;
}
.admin-sidebar a.active svg { stroke: #fff; }
.admin-sidebar a svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav-divider {
    border-top: 1px solid var(--border);
    margin: 0.4rem 0.5rem;
}
.admin-content {
    flex: 1;
    min-width: 0;
}
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        min-width: 0;
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 0.25rem;
        padding: 0.4rem;
        -webkit-overflow-scrolling: touch;
    }
    .admin-sidebar a {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .admin-nav-divider { display: none; }
}

/* ========== Breadcrumbs ========== */
.breadcrumbs {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .separator { opacity: 0.4; }

/* ========== Global Search Overlay ========== */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    animation: fadeIn 0.15s;
}
.search-overlay.active {
    display: flex;
}
.search-modal {
    background: var(--bg-card-solid);
    border-radius: 16px;
    width: 95%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.search-modal input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.search-results {
    max-height: 350px;
    overflow-y: auto;
}
.search-results .search-group-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    padding: 0.75rem 1.25rem 0.25rem;
    font-weight: 700;
}
.search-results a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.1s;
}
.search-results a:hover,
.search-results a.active {
    background: var(--primary);
    color: #fff;
}
.search-results a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.6; }
.search-results a:hover svg,
.search-results a.active svg { opacity: 1; stroke: #fff; }
.search-hint {
    padding: 0.6rem 1.25rem;
    font-size: 0.7rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    text-align: center;
}
.search-hint kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-family: monospace;
}

/* ========== Improved Empty States ========== */
/* .empty-state — konsolidierte Definition unten. Nur empty-title-Subklasse bleibt: */
.empty-state .empty-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.empty-state .empty-desc {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ========== Shortcut Help Modal ========== */
.shortcut-table {
    width: 100%;
    font-size: 0.85rem;
}
.shortcut-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.shortcut-table td:first-child {
    width: 140px;
    font-weight: 600;
}
.shortcut-table kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-family: monospace;
}

/* ========== Professional Polish ========== */

/* Focus States (Accessibility) */
.btn:focus-visible,
.btn-icon:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* Muted Icon Buttons (Header) */
.btn-icon-muted {
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-icon-muted:hover {
    opacity: 1;
}

/* ========== Notification System ========== */
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 380px;
    max-height: 440px;
    background: var(--bg-card-solid);
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    z-index: 200;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: fadeIn 0.15s;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notif-dropdown-header strong { font-size: 0.9rem; }
.notif-dropdown-header a {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
}
.notif-dropdown-header a:hover { text-decoration: underline; }
.notif-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.15rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(99, 102, 241, 0.04); border-left: 3px solid var(--primary); }
.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item.unread .notif-title { font-weight: 600; }
.notif-msg {
    font-size: 0.72rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.notif-time {
    font-size: 0.65rem;
    color: var(--text-light);
    flex-shrink: 0;
    padding-top: 2px;
}
.notif-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.88rem;
}

/* ========== Support Banner ========== */
.support-banner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.support-banner-inner { display: flex; align-items: center; gap: 0.5rem; }
.support-banner-btn {
    background: #000;
    color: #fbbf24;
    font-weight: 600;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.support-banner-btn:hover { opacity: 0.85; }

/* ========== Widget System (Proper CSS) ========== */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
}
.widget-size-1 { grid-column: span 2; }
.widget-size-2 { grid-column: span 3; }
.widget-size-3 { grid-column: span 6; }
@media (max-width: 1024px) {
    .widget-size-1 { grid-column: span 3; }
    .widget-size-2 { grid-column: span 3; }
}
@media (max-width: 768px) {
    .widget-grid { grid-template-columns: 1fr; }
    .widget-size-1,
    .widget-size-2,
    .widget-size-3 { grid-column: span 1; }
}
.widget-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 0.75rem;
}
.widget-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.widget-checkbox-label:hover { background: var(--bg); }
.widget-checkbox-label.active {
    background: var(--success-bg);
    border-color: var(--success);
}

/* ========== Modal Variants ========== */
.modal-narrow { max-width: 420px; }

/* ========== Responsive Card Grid (Goals, Challenges, etc.) ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
}

/* ========== Card Accent Borders ========== */
.card-accent { border-left: 4px solid var(--primary); }
.card-accent.accent-success { border-left-color: var(--success); }
.card-accent.accent-danger { border-left-color: var(--danger); }
.card-accent.accent-warning { border-left-color: var(--warning); }
.card-accent.accent-info { border-left-color: var(--info); }
.card-accent.accent-teal { border-left-color: #14b8a6; }
.card-accent.accent-pink { border-left-color: #ec4899; }
.card-accent.accent-purple { border-left-color: #8b5cf6; }

/* ========== Support PIN Box ========== */
.pin-box {
    display: inline-block;
    background: var(--bg);
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 1rem 2rem;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}
.pin-box:hover {
    border-color: var(--success);
    background: var(--success-bg);
}

/* ========== Card Hover Polish ========== */

/* ========== Dark Mode Additions ========== */
[data-theme="dark"] .support-banner {
    background: linear-gradient(135deg, #92400e, #78350f);
    color: #fcd34d;
}
[data-theme="dark"] .support-banner-btn {
    background: #fcd34d;
    color: #78350f;
}
[data-theme="dark"] .notif-dropdown {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .notif-item:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .notif-item.unread { background: rgba(99, 102, 241, 0.1); }
[data-theme="dark"] .btn-icon-muted { opacity: 0.7; }
[data-theme="dark"] .widget-checkbox-label:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .search-overlay { background: rgba(0, 0, 0, 0.7); }

/* ========== Reduced Motion (Accessibility) ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Better Focus Visibility ========== */
.nav-links li a:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: -2px;
}
.mobile-bottom-nav a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ========== Notification Dropdown Mobile ========== */
@media (max-width: 480px) {
    .notif-dropdown {
        position: fixed;
        left: 0.5rem;
        right: 0.5rem;
        top: auto;
        bottom: 70px;
        width: auto;
        max-height: 60vh;
    }
}

/* ========== Dark Mode: Admin Sidebar ========== */
[data-theme="dark"] .admin-sidebar {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
}
[data-theme="dark"] .admin-sidebar a:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ========== Print Styles ========== */
@media print {
    .sidebar, .mobile-bottom-nav, .content-header, .site-footer,
    .support-banner, .notif-dropdown, .btn { display: none !important; }
    .content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ==========================================================================
   wiki_neu · Kompatibilitäts-Layer
   Aliasse für bestehende wiki_neu-Klassen + Tokens, damit Views nicht brechen.
   ========================================================================== */

/* ---- Token-Aliase (wiki_neu `--w-*` → Finance-Tokens) --------------------- */
:root {
    --w-bg: var(--bg);
    --w-bg-subtle: var(--bg);
    --w-bg-muted: rgba(99, 102, 241, 0.06);
    --w-bg-elev: var(--bg-card-solid);
    --w-surface: var(--bg-card);
    --w-surface-2: var(--bg-card-solid);
    --w-sidebar-bg: var(--bg-sidebar);
    --w-code-bg: rgba(99, 102, 241, 0.06);
    --w-border: var(--border);
    --w-border-strong: var(--text-light);
    --w-border-soft: var(--border);
    --w-text: var(--text);
    --w-text-muted: var(--text-light);
    --w-text-soft: var(--text-light);
    --w-primary: var(--primary);
    --w-primary-hover: var(--primary-dark);
    --w-primary-active: var(--primary-dark);
    --w-primary-weak: var(--primary-glow);
    --w-primary-border: var(--primary-light);
    --w-success: var(--success);
    --w-success-weak: var(--success-bg);
    --w-warning: var(--warning);
    --w-warning-weak: var(--warning-bg);
    --w-danger: var(--danger);
    --w-danger-weak: var(--danger-bg);
    --w-info: var(--info);
    --w-info-weak: var(--info-bg);
    --w-hover-bg: rgba(99, 102, 241, 0.08);
    --w-selected-bg: rgba(99, 102, 241, 0.12);
    --w-focus-ring: var(--primary-glow);
    --w-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --w-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --w-fs-xs: 11px;   --w-lh-xs: 16px;
    --w-fs-sm: 12px;   --w-lh-sm: 18px;
    --w-fs-md: 13px;   --w-lh-md: 20px;
    --w-fs-base: 15px; --w-lh-base: 24px;
    --w-fs-lg: 16px;   --w-lh-lg: 26px;
    --w-fs-xl: 18px;   --w-lh-xl: 28px;
    --w-fs-2xl: 22px;  --w-lh-2xl: 32px;
    --w-fs-3xl: 28px;  --w-lh-3xl: 38px;
    --w-fs-4xl: 36px;  --w-lh-4xl: 46px;
    --w-fw-regular: 400;
    --w-fw-medium: 500;
    --w-fw-semibold: 650;
    --w-fw-bold: 750;
    --w-tracking-tight: -0.02em;
    --w-tracking-snug: -0.01em;
    --w-tracking-wide: 0.04em;
    --w-s-0: 0; --w-s-1: 4px; --w-s-2: 8px; --w-s-3: 12px; --w-s-4: 16px;
    --w-s-5: 20px; --w-s-6: 24px; --w-s-7: 32px; --w-s-8: 40px; --w-s-9: 48px; --w-s-10: 64px;
    --w-r-xs: var(--radius-xs); --w-r-sm: var(--radius-sm); --w-r-md: 12px;
    --w-r-lg: var(--radius); --w-r-xl: 20px; --w-r-full: 999px;
    --w-radius: var(--radius-sm);
    --w-radius-lg: var(--radius);
    --w-shadow-xs: var(--shadow);
    --w-shadow-sm: var(--shadow);
    --w-shadow-md: var(--shadow-md);
    --w-shadow-lg: var(--shadow-lg);
    --w-shadow-xl: var(--shadow-xl);
    --w-shadow: var(--shadow);
    --w-dur-fast: 120ms;
    --w-dur-base: 160ms;
    --w-dur-slow: 240ms;
    --w-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --w-z-dropdown: 30; --w-z-sticky: 40; --w-z-tooltip: 60; --w-z-overlay: 80;
    --w-z-modal: 90; --w-z-cmd: 100; --w-z-toast: 110;
    --w-heat-0: rgba(99, 102, 241, 0.04);
    --w-heat-1: #c7e3cf; --w-heat-2: #86c99a; --w-heat-3: #3ea25c; --w-heat-4: #1a7f37;
}
[data-theme="dark"] {
    --w-heat-0: rgba(255,255,255,0.04);
    --w-heat-1: #0e4429; --w-heat-2: #006d32; --w-heat-3: #26a641; --w-heat-4: #39d353;

    /* Ohne diese Overrides bleiben --w-bg-subtle / --w-bg-muted / --w-code-bg an das
       Light-Mapping gebunden (transparente Farben, die im Dunkel kaum sichtbar sind).
       Hier setzen wir solide Dark-Tokens mit sauberer Abstufung zu --bg und --bg-card. */
    --w-bg-subtle:   #161a2e;
    --w-bg-muted:    #1a1f36;
    --w-bg-elev:     #1a1e33;
    --w-surface:     #1a1e33;
    --w-surface-2:   #1e2340;
    --w-code-bg:     #0b0e1a;
    --w-border:      #2a2f47;
    --w-border-soft: #232840;
    --w-border-strong: #3a3f5a;
    --w-text-muted:  #9aa3c2;
    --w-text-soft:   #7a83a0;
    --w-hover-bg:    rgba(99, 102, 241, 0.14);
    --w-selected-bg: rgba(99, 102, 241, 0.20);
}

/* ---- App-Shell-Mapping ---------------------------------------------------- */
body { display: block; min-height: 100vh; }    /* Finance setzte flex — wiki_neu wrappt in .app-shell */
.app-shell { min-height: 100vh; }
body:not(:has(.app-sidebar)) .app-main { margin-left: 0; }
body:not(:has(.app-sidebar)) .app-topbar { padding: 0.85rem 1.5rem; }
.app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1.5rem; background: var(--bg-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50; gap: 12px; flex-wrap: wrap;
}
[data-theme="dark"] .app-topbar {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--bg);                  /* matchendes Canvas statt durchscheinend */
    border-bottom: 1px solid var(--border);
}
.app-sidebar {
    width: var(--sidebar-width); background: var(--bg-sidebar);
    color: var(--text-sidebar); position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 100; overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.05);
    transition: transform var(--transition);
    display: flex; flex-direction: column;
}
.app-sidebar::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse at top left, rgba(99,102,241,0.15), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(139,92,246,0.1), transparent 60%);
}
.app-sidebar > * { position: relative; z-index: 1; }
.app-sidebar.is-open { transform: translateX(0); }
.app-main {
    margin-left: var(--sidebar-width); padding: 0;
    min-height: 100vh; flex: 1; display: flex; flex-direction: column;
}
.app-main .page-content { padding: 1.5rem 2rem 3rem; flex: 1; animation: fadeIn 0.4s ease; }
.app-footer { color: var(--text-light); font-size: 0.82rem; padding: 1rem 0 0; }

/* Sidebar-Navigation (wiki_neu nutzt kein .sidebar .nav-links) */
.app-sidebar .sidebar-header {
    padding: 1.5rem 1.25rem; display: flex; align-items: center;
    gap: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.app-sidebar .sidebar-header .logo-icon {
    width: 38px; height: 38px; background: var(--gradient-primary);
    border-radius: var(--radius-sm); display: flex; align-items: center;
    justify-content: center; color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4); font-size: 18px;
}
.app-sidebar .sidebar-header h2 {
    font-size: 1.1rem; font-weight: 700;
    background: linear-gradient(135deg, #c7c4f0, #a78bfa, #c084fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em; margin: 0;
}

/* Topbar-Nav (globale Tabs — bleibt oben in app-topbar) */
.topbar-nav {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.topbar-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.5rem 0.85rem; border-radius: var(--radius-sm);
    color: var(--text-light); font-size: 0.85rem; font-weight: 550;
    transition: all var(--transition-fast);
}
.topbar-nav a:hover { background: var(--bg-card-solid); color: var(--primary); text-decoration: none; }
.topbar-nav a.is-active { background: rgba(99,102,241,0.12); color: var(--primary); }
@media (max-width: 860px) { .topbar-nav { display: none; } }

/* Topbar-Search + right-actions */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.brand-mark {
    width: 32px; height: 32px; background: var(--gradient-primary);
    border-radius: var(--radius-sm); display: inline-flex;
    align-items: center; justify-content: center; color: #fff; font-weight: 700;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.topbar-search {
    flex: 1; max-width: 480px; display: flex; align-items: center; gap: 8px;
    padding: 0.5rem 0.85rem; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-light); font-size: 0.85rem; cursor: pointer;
    transition: all var(--transition-fast);
}
.topbar-search:hover { border-color: var(--primary); }
.topbar-search input { flex: 1; border: 0; background: transparent; outline: none; color: inherit; font: inherit; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-title-slot { flex: 1; }

/* Sidebar-Scroll-Container + Wiki-Sidebar-Partial-Styles */
.app-sidebar .sidebar-scroll { flex: 1; overflow-y: auto; padding: 0.75rem 0.75rem 1rem; }
.app-sidebar .sidebar-group { margin-bottom: 0.85rem; }
.app-sidebar .sidebar-group:last-child { margin-bottom: 0; }
.app-sidebar .sidebar-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: rgba(255,255,255,0.38);
    padding: 0.75rem 0.85rem 0.35rem; margin: 0;
}
.app-sidebar .sidebar-nav {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.app-sidebar .sidebar-nav li { margin: 0; }
.app-sidebar .sidebar-nav ul {
    list-style: none; padding: 0 0 0 1.15rem; margin: 2px 0 0;
    display: flex; flex-direction: column; gap: 1px;
    border-left: 1px dashed rgba(255,255,255,0.08); margin-left: 1.15rem;
}
.app-sidebar a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.85rem; color: var(--text-sidebar);
    border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 450;
    text-decoration: none; transition: all var(--transition-fast);
    position: relative;
}
.app-sidebar a > .bi { opacity: 0.7; font-size: 15px; width: 16px; flex-shrink: 0; }
.app-sidebar a:hover {
    background: rgba(255,255,255,0.07); color: #fff;
    transform: translateX(2px); text-decoration: none;
}
.app-sidebar a:hover > .bi { opacity: 1; }
.app-sidebar a.is-active {
    background: rgba(99,102,241,0.18); color: #fff; font-weight: 600;
    box-shadow: 0 0 20px rgba(99,102,241,0.12);
}
.app-sidebar a.is-active > .bi { opacity: 1; color: #a5b4fc; }
.app-sidebar a.is-active::before {
    content: ''; position: absolute; left: -0.75rem; top: 20%;
    width: 3px; height: 60%; background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
}
.app-sidebar details.sidebar-group > summary.sidebar-title {
    cursor: pointer; list-style: none;
}
.app-sidebar details.sidebar-group > summary.sidebar-title::-webkit-details-marker { display: none; }
.app-sidebar details.sidebar-group > summary.sidebar-title::after {
    content: '▸'; margin-left: auto; font-size: 10px; opacity: 0.5;
    transition: transform var(--transition-fast);
}
.app-sidebar details[open].sidebar-group > summary.sidebar-title::after { transform: rotate(90deg); }
.app-sidebar .text-soft { color: rgba(255,255,255,0.35); font-size: 0.78rem; }
.app-sidebar .btn-inline {
    background: rgba(99,102,241,0.18); color: #fff; font-weight: 550;
    border: 1px dashed rgba(99,102,241,0.4);
}
.app-sidebar .btn-inline:hover { background: rgba(99,102,241,0.3); }

/* ---- Button-Mapping ------------------------------------------------------- */
.btn-ghost {
    background: transparent; border: 1px solid transparent;
    color: var(--text-light); box-shadow: none;
}
.btn-ghost:hover { background: var(--bg-card); color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }
.btn-warning { background: var(--gradient-warning); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,0.3); }

/* ---- Section-Nav (Repo-Tabs) --------------------------------------------- */
.section-nav {
    display: flex; gap: 4px; padding: 0.25rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.55rem 1rem; color: var(--text-light); font-size: 0.85rem;
    font-weight: 550; white-space: nowrap; border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.section-nav a:hover { background: var(--bg-card-solid); color: var(--primary); text-decoration: none; }
.section-nav a.is-active { background: var(--gradient-primary); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.25); }
.section-nav a .count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px;
    background: rgba(0,0,0,0.08); color: inherit; font-size: 11px; font-weight: 600;
}
.section-nav a.is-active .count { background: rgba(255,255,255,0.25); color: #fff; }

/* Legacy Tab-Class */
.tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.6rem 1rem; color: var(--text-light); font-size: 0.85rem;
    font-weight: 550; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--primary); text-decoration: none; }
.tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Page-Header v2 ------------------------------------------------------- */
.page-header {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 0.5rem 0 1.25rem; margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.page-header-main { flex: 1; min-width: 0; }
.page-header-eyebrow {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.8rem; color: var(--text-light);
    margin-bottom: 4px; font-weight: 500;
}
.page-header h1 {
    margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.page-header-desc {
    margin: 6px 0 0; color: var(--text-light); font-size: 0.9rem; max-width: 72ch;
}
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-header .meta, .meta {
    color: var(--text-light); font-size: 0.82rem;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px;
}
.spacer { flex: 1; }

/* ---- Meta-Sidebar (Issue/MR rechte Spalte) ------------------------------- */
.with-meta { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.meta-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.meta-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.85rem;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.meta-block-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); font-weight: 650; margin-bottom: 6px; }
.meta-block-body { font-size: 0.88rem; }
.meta-empty { color: var(--text-light); font-style: italic; font-size: 0.82rem; }
@media (max-width: 960px) { .with-meta { grid-template-columns: 1fr; } .meta-sidebar { position: static; } }

/* ---- Tables (wiki_neu-Klassen) ------------------------------------------- */
.table-wrap {
    overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 0.85rem 1rem; text-align: left; font-size: 0.72rem;
    font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-light); border-bottom: 2px solid var(--border);
    background: var(--bg-card-solid);
}
.table td {
    padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.table tbody tr:nth-child(even) { background: rgba(99,102,241,0.02); }
.table tbody tr:hover { background: rgba(99,102,241,0.06); }
[data-theme="dark"] .table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(99,102,241,0.08); }
.table tbody tr:last-child td { border-bottom: none; }
.table .tabular { font-variant-numeric: tabular-nums; }

/* ---- Grid-Aliase --------------------------------------------------------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* ---- Stat-Widgets (wiki_neu alt) ---------------------------------------- */
.stat {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat .stat-head { display: flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 6px; }
.stat .stat-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; }
.stat .value { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }

/* Finance-Alert Margin-Reset für wiki_neu (war 0 2rem 1rem) */
.alert { margin: 0 0 1rem; }

/* ---- Flash / Announcements (wiki_neu .flash → .alert-Style) ------------ */
.flash {
    padding: 0.85rem 1.15rem; border-radius: var(--radius-sm);
    margin: 0 0 1rem; display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; font-weight: 500; border-left: 4px solid transparent;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    animation: slideInDown 0.4s ease backwards;
}
.flash .bi { flex-shrink: 0; font-size: 18px; }
.flash.success { background: var(--success-bg); color: #166534; border-left-color: var(--success); }
.flash.danger { background: var(--danger-bg); color: #991b1b; border-left-color: var(--danger); }
.flash.warning { background: var(--warning-bg); color: #92400e; border-left-color: var(--warning); }
.flash.info { background: var(--info-bg); color: #1e40af; border-left-color: var(--info); }
[data-theme="dark"] .flash.success { color: #86efac; }
[data-theme="dark"] .flash.danger { color: #fca5a5; }
[data-theme="dark"] .flash.warning { color: #fcd34d; }
[data-theme="dark"] .flash.info { color: #93c5fd; }
.flash-close { background: none; border: 0; color: inherit; font-size: 1.25rem; opacity: 0.6; cursor: pointer; margin-left: auto; padding: 0.25rem; }
.flash-close:hover { opacity: 1; }

/* ---- Badges -------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.2rem 0.6rem; border-radius: 999px;
    background: var(--bg-card-solid); color: var(--text-light);
    font-size: 0.72rem; font-weight: 600; border: 1px solid var(--border);
    white-space: nowrap;
}
.badge.sm { padding: 0.1rem 0.45rem; font-size: 0.68rem; }
.badge.on { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge.off { background: var(--bg-card-solid); color: var(--text-light); }
.badge.info-blue { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.info-purple { background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: transparent; }

/* Status-Badges (Tasks) */
.badge.status-open        { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.status-in_progress { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge.status-review      { background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: transparent; }
.badge.status-done        { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge.status-cancelled   { background: var(--bg-card); color: var(--text-light); border-color: var(--border); opacity: 0.7; }

/* Prio-Badges (Tasks-Liste) */
.badge.prio-urgent { background: var(--danger-bg); color: var(--danger); border-color: transparent; font-weight: 650; }
.badge.prio-high   { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge.prio-normal { background: var(--bg-card); color: var(--text-light); border-color: var(--border); }
.badge.prio-low    { background: var(--info-bg); color: var(--info); border-color: transparent; }

/* ---- Form-Field-Aliase --------------------------------------------------- */
.field { margin-bottom: 1.15rem; }
.field-label {
    display: block; font-size: 0.78rem; font-weight: 650;
    margin-bottom: 0.4rem; color: var(--text); text-transform: uppercase;
    letter-spacing: 0.05em;
}
.field-required { color: var(--danger); margin-left: 2px; }
.field-hint { color: var(--text-light); font-size: 0.8rem; margin-top: 4px; }
.field-input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"], input[type="date"],
textarea, select {
    width: 100%; padding: 0.6rem 0.9rem; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.9rem;
    background: var(--bg-card-solid); color: var(--text);
    font-family: inherit; transition: all var(--transition);
}
.field-input:focus, input:focus, textarea:focus, select:focus {
    outline: 0; border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.field.has-error .field-input, .field.has-error input, .field.has-error textarea {
    border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,0.15);
}
.field-error { color: var(--danger); font-size: 0.78rem; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); align-items: center; flex-wrap: wrap; }

/* ---- Toolbar & Row-Helper ----------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { justify-content: space-between; }
.row-link { display: flex; align-items: center; gap: 10px; }

/* ---- Typography-Helper --------------------------------------------------- */
.muted { color: var(--text-light); }
.text-soft { color: var(--text-light); opacity: 0.8; }
.mono { font-family: var(--w-font-mono); }
.xs { font-size: 0.72rem; }
.small { font-size: 0.82rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; padding: 0 6px; height: 20px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: 4px; box-shadow: 0 1px 0 var(--border);
    font-family: var(--w-font-mono); font-size: 11px; color: var(--text-light);
}

/* ---- Breadcrumbs --------------------------------------------------------- */
.breadcrumbs { font-size: 0.88rem; }
.breadcrumbs ol { display: flex; align-items: center; gap: 6px; list-style: none; flex-wrap: wrap; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs .sep { color: var(--text-light); margin: 0 2px; }
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* ---- User-Menu + Dropdown (Topbar) --------------------------------------- */
.user-menu { position: relative; }
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0.35rem 0.6rem; border-radius: var(--radius-sm);
    background: var(--bg-card-solid); border: 1px solid var(--border);
    cursor: pointer; font-size: 0.85rem; color: var(--text);
    transition: all var(--transition-fast);
}
.user-chip:hover { border-color: var(--primary); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 230px; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 40;
    display: none; animation: scaleIn 0.2s ease;
}
.dropdown.is-open { display: block; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 0.5rem 0.75rem; border-radius: var(--radius-xs);
    background: transparent; border: 0; color: var(--text); font-size: 0.85rem;
    text-align: left; cursor: pointer; text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--w-hover-bg); color: var(--primary); }
.dropdown .dd-head { padding: 0.5rem 0.75rem; color: var(--text-light); font-size: 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---- Avatar -------------------------------------------------------------- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gradient-primary); color: #fff; font-weight: 700;
    flex-shrink: 0; overflow: hidden; font-size: 0.78rem;
}
.avatar-sm { width: 24px; height: 24px; font-size: 0.7rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Notification-Badge -------------------------------------------------- */
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--danger); color: #fff; font-size: 10px;
    font-weight: 700; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Menu-Toggle (Mobile) ----------------------------------------------- */
.menu-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 0.5rem; border-radius: var(--radius-xs); }
.menu-toggle:hover { background: var(--bg-card); }
@media (max-width: 900px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.is-open { transform: translateX(0); }
    .app-main { margin-left: 0; padding: 1rem; }
    .menu-toggle { display: inline-flex; }
}

/* ---- Empty-State --------------------------------------------------------- */
/* .empty-state — konsolidierte Definition (vorher 4× dupliziert mit divergenten Werten). */
.empty-state {
    text-align: center; padding: 3rem 1.5rem; color: var(--text-light);
    border: 1px dashed var(--border); border-radius: var(--radius);
    background: var(--bg-card); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.empty-state .bi,
.empty-state i.bi { font-size: 44px; opacity: 0.35; display: block; margin-bottom: 0.85rem; color: var(--text-light); }
.empty-state h3,
.empty-state h4 { color: var(--text); font-size: 1.05rem; font-weight: 650; margin: 0 0 6px; }
.empty-state p { margin: 0 auto 1rem; max-width: 46ch; font-size: 0.88rem; line-height: 1.55; }

/* ---- Command-Palette ---------------------------------------------------- */
.cmd-palette { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); align-items: flex-start; justify-content: center; padding-top: 10vh; }
.cmd-palette.is-open { display: flex; }
.cmd-box { width: 92%; max-width: 640px; background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xl); overflow: hidden; animation: scaleIn 0.2s ease; }
.cmd-head { display: flex; align-items: center; gap: 10px; padding: 1rem; border-bottom: 1px solid var(--border); }
.cmd-head input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--text); }
.cmd-body { max-height: 60vh; overflow-y: auto; }
.cmd-foot { display: flex; gap: 16px; padding: 0.5rem 1rem; border-top: 1px solid var(--border); color: var(--text-light); font-size: 0.72rem; }

/* ---- Card-Header Alias für wiki_neu -------------------------------------- */
.card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-title { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; margin: 0; }

/* ---- File-Icons (Repo-Tree) --------------------------------------------- */
.file-icon { font-size: 15px; width: 16px; text-align: center; }
.file-icon.fi-folder { color: #f0b429; }
.file-icon.fi-md { color: #3b82f6; }
.file-icon.fi-js { color: #eab308; }
.file-icon.fi-ts { color: #3178c6; }
.file-icon.fi-py { color: #3572a5; }
.file-icon.fi-php { color: #777bb4; }
.file-icon.fi-go { color: #00add8; }
.file-icon.fi-rust { color: #ce422b; }
.file-icon.fi-css { color: #8b5cf6; }
.file-icon.fi-html { color: #e34c26; }
.file-icon.fi-json { color: #eab308; }
.file-icon.fi-yaml { color: #22c55e; }
.file-icon.fi-shell { color: #4caf50; }
.file-icon.fi-img { color: #c084fc; }
.file-icon.fi-lock { color: var(--text-light); }
.file-icon.fi-gen { color: var(--text-light); }

/* ---- Prose (Markdown-Output) -------------------------------------------- */
.prose { color: var(--text); line-height: 1.7; max-width: 72ch; }
.prose h1, .prose h2, .prose h3 { letter-spacing: -0.02em; margin: 1.5em 0 0.5em; }
.prose h1 { font-size: 1.6rem; font-weight: 750; }
.prose h2 { font-size: 1.3rem; font-weight: 700; }
.prose h3 { font-size: 1.1rem; font-weight: 650; }
.prose p { margin: 0 0 1em; }
.prose code { background: var(--bg-card-solid); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.88em; border: 1px solid var(--border); }
.prose pre { background: var(--bg-card-solid); padding: 1em; border-radius: var(--radius-sm); overflow-x: auto; border: 1px solid var(--border); }
.prose pre code { background: none; border: 0; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { padding: 0.5em 0.85em; border: 1px solid var(--border); }
.prose blockquote { border-left: 4px solid var(--primary); padding: 0.5em 1em; margin: 1em 0; color: var(--text-light); background: rgba(99,102,241,0.04); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { margin: 0 0 1em 1.5em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---- Shortcuts-Modal ----------------------------------------------------- */
.shortcuts-modal { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); align-items: center; justify-content: center; }
.shortcuts-modal.is-open { display: flex; }
.shortcuts-modal .inner { background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 520px; width: 92%; box-shadow: var(--shadow-xl); animation: scaleIn 0.2s ease; }
.shortcuts-modal h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.shortcuts-modal dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; }
.shortcuts-modal dt { font-weight: 600; }
.shortcuts-modal dd { color: var(--text-light); margin: 0; }

/* ---- Hero (Home-Banner) ------------------------------------------------- */
.hero {
    padding: 2rem 2rem 1.5rem; margin-bottom: 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
    border: 1px solid var(--border);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at top right, rgba(139,92,246,0.18), transparent 60%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
    font-size: 1.75rem; font-weight: 750; margin: 0 0 6px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary), #a78bfa, #c084fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-light); font-size: 0.95rem; margin: 0; max-width: 72ch; }

/* ---- Row-Link (klickbare Zeile) ----------------------------------------- */
.row-link {
    display: flex; align-items: center; gap: 10px;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    background: transparent; color: var(--text);
    text-decoration: none; transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.row-link:hover {
    background: rgba(99,102,241,0.06); border-color: var(--border);
    text-decoration: none; transform: translateX(2px);
}
.row-link .sub, .sub { color: var(--text-light); font-size: 0.8rem; }

/* ---- Generic utility aliases -------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.title { font-weight: 650; letter-spacing: -0.01em; }
.help, .hint { color: var(--text-light); font-size: 0.8rem; }
.err { color: var(--danger); font-size: 0.78rem; }
.dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: var(--text-light); flex-shrink: 0; vertical-align: middle;
}
.disabled { opacity: 0.55; pointer-events: none; }
.list-group {
    display: flex; flex-direction: column; gap: 1px;
    background: var(--border); border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border);
}
.list-group > * {
    background: var(--bg-card-solid); padding: 0.75rem 1rem;
    display: flex; align-items: center; gap: 10px;
    transition: background var(--transition-fast);
}
.list-group > *:hover { background: var(--bg-card); }
.form-check {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0.5rem 0; font-size: 0.88rem; cursor: pointer;
}
.form-check input[type="checkbox"], .form-check input[type="radio"] {
    width: 16px; height: 16px; margin: 0; accent-color: var(--primary);
}
.empty-icon { font-size: 44px; opacity: 0.35; color: var(--text-light); display: block; margin-bottom: 1rem; }

/* ---- Task-Board (Kanban — komplettes Redesign) ------------------------- */
.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    align-items: start;
}
.board-col {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    min-height: 200px;
}
.board-col::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--col-accent, var(--text-light));
    opacity: 0.85;
}
.board-col[data-status="open"]          { --col-accent: var(--info); }
.board-col[data-status="in_progress"]   { --col-accent: var(--warning); }
.board-col[data-status="review"]        { --col-accent: #8b5cf6; }
.board-col[data-status="done"]          { --col-accent: var(--success); }
.board-col.is-drop-target {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-md);
    background: rgba(99, 102, 241, 0.06);
}
.board-col-head {
    display: flex; align-items: center; gap: 8px;
    padding: 0.85rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--text);
    background: linear-gradient(to bottom, color-mix(in srgb, var(--col-accent) 8%, transparent), transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .board-col-head { background: var(--bg-card); }
}
.board-col-head .board-col-icon {
    font-size: 14px;
    color: var(--col-accent, var(--text-light));
}
.board-col-head .board-col-title {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
}
.board-col-head .count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 7px;
    background: color-mix(in srgb, var(--col-accent) 15%, transparent);
    color: var(--col-accent);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .board-col-head .count { background: rgba(99,102,241,0.12); color: var(--primary); }
}

.board-list {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px;
    flex: 1; min-height: 60px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Add-Button am Ende jeder Spalte */
.board-add {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 0 10px 10px;
    padding: 0.55rem;
    color: var(--text-light);
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 550;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.board-add:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    text-decoration: none;
}

.board-empty {
    margin: 12px 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.82rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.board-empty .bi { font-size: 24px; opacity: 0.4; }

/* Board-Card */
.board-card {
    position: relative;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem 0.65rem 1.05rem;
    transition: all var(--transition-fast);
    cursor: grab;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.board-card:active { cursor: grabbing; }
.board-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.board-card.is-dragging {
    opacity: 0.5;
    transform: rotate(1.5deg) scale(0.98);
    cursor: grabbing;
    box-shadow: var(--shadow-lg);
}

/* Prio-Akzent als Border-Left */
.board-card::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
}
.board-card.prio-urgent::before { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.board-card.prio-high::before   { background: var(--warning); }
.board-card.prio-normal::before { background: var(--text-light); opacity: 0.35; }
.board-card.prio-low::before    { background: var(--info); opacity: 0.5; }

.board-card .bc-drag-handle {
    position: absolute; top: 6px; right: 6px;
    color: var(--text-light); opacity: 0;
    transition: opacity var(--transition-fast);
    font-size: 14px; cursor: grab;
}
.board-card:hover .bc-drag-handle { opacity: 0.5; }

.board-card .bc-link {
    display: block;
    color: var(--text);
    text-decoration: none;
}
.board-card .bc-link:hover { text-decoration: none; }
.board-card .bc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 8px;
    letter-spacing: -0.005em;
}
.board-card:hover .bc-title { color: var(--primary); }

.bc-labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.bc-label {
    display: inline-flex; align-items: center;
    padding: 0.1rem 0.5rem;
    background: color-mix(in srgb, var(--lbl, var(--primary)) 18%, transparent);
    color: var(--lbl, var(--primary));
    border: 1px solid color-mix(in srgb, var(--lbl, var(--primary)) 35%, transparent);
    border-radius: 999px;
    font-size: 0.68rem; font-weight: 600;
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .bc-label { background: var(--bg-card); color: var(--lbl, var(--primary)); border-color: var(--lbl, var(--primary)); }
}

.bc-meta {
    display: flex; gap: 5px; flex-wrap: wrap; align-items: center;
    font-size: 0.7rem; color: var(--text-light);
    margin-bottom: 8px;
}
.bc-id {
    font-family: var(--w-font-mono);
    font-size: 0.7rem;
    color: var(--text-light);
    background: var(--bg-card);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.bc-prio {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bc-prio.prio-urgent { background: var(--danger-bg); color: var(--danger); }
.bc-prio.prio-high   { background: var(--warning-bg); color: var(--warning); }
.bc-prio.prio-normal { background: var(--bg-card); color: var(--text-light); }
.bc-prio.prio-low    { background: var(--info-bg); color: var(--info); }
.bc-est {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.bc-foot {
    display: flex; align-items: center; gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.72rem; color: var(--text-light);
}
.bc-assignee {
    display: inline-flex; align-items: center; gap: 5px;
    flex: 1; min-width: 0;
    font-weight: 500;
    color: var(--text);
}
.bc-assignee.unassigned { color: var(--text-light); font-style: italic; font-weight: 400; }
.bc-assignee .avatar { flex-shrink: 0; }
.bc-due {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.bc-due.overdue {
    color: var(--danger);
    font-weight: 650;
}
.bc-due.overdue::before {
    content: '!';
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--danger); color: #fff;
    font-size: 0.6rem; font-weight: 700; margin-right: 2px;
}

/* Mobile */
@media (max-width: 900px) {
    .board { grid-template-columns: 1fr; gap: 0.75rem; }
    .board-list { max-height: none; }
}

/* ---- Attachments --------------------------------------------------------- */
.att-uploader {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: 1.5rem; background: var(--bg-card);
    text-align: center; transition: all var(--transition-fast);
}
.att-uploader:hover, .att-drop.is-hover { border-color: var(--primary); background: rgba(99,102,241,0.04); }
.att-input { display: none; }
.att-drop { color: var(--text-light); font-size: 0.88rem; cursor: pointer; }
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 10px; margin-top: 0.75rem; }
.att-file {
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.6rem; position: relative;
    transition: all var(--transition-fast);
}
.att-file:hover { border-color: var(--primary); transform: translateY(-1px); }
.att-thumb {
    width: 100%; height: 80px; border-radius: var(--radius-xs);
    background: var(--bg-card); display: flex; align-items: center;
    justify-content: center; margin-bottom: 6px; overflow: hidden;
    color: var(--text-light); font-size: 24px;
}
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-name { font-size: 0.78rem; font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 0.7rem; color: var(--text-light); }
.att-show { color: var(--primary); font-size: 0.75rem; margin-top: 4px; display: inline-block; }

/* ---- Reactions ---------------------------------------------------------- */
.reactions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.reactions .r-count {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.2rem 0.55rem; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.78rem; cursor: pointer;
    transition: all var(--transition-fast);
}
.reactions .r-count:hover { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.reactions .r-count.is-active { background: rgba(99,102,241,0.12); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.reactions .r-emoji { font-size: 0.95rem; line-height: 1; }
.reaction-picker { position: relative; display: inline-block; }
.reaction-menu {
    position: absolute; bottom: 100%; left: 0;
    margin-bottom: 6px; padding: 4px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    gap: 2px; z-index: 20;
    display: flex;                /* Default sichtbar, hidden-Attribut versteckt */
    animation: scaleIn 0.15s ease;
}
.reaction-menu[hidden] { display: none; }
.reaction-picker.is-open .reaction-menu { display: flex; }  /* Legacy-Fallback */
.reaction-menu .r-pick {
    background: transparent; border: 0; padding: 4px 6px;
    cursor: pointer; font-size: 1rem; border-radius: var(--radius-xs);
}
.reaction-menu .r-pick:hover { background: var(--bg-card); }

/* ---- Diff-Pick (Revisions) ---------------------------------------------- */
.diff-pick {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.2rem 0.55rem; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.75rem; cursor: pointer;
}
.diff-pick:has(input:checked) { background: var(--gradient-primary); color: #fff; border-color: transparent; }
.diff-pick input { accent-color: var(--primary); }

/* ---- Card-Header h3 Fix (Bootstrap-Icons) ------------------------------- */
.card-header h3 .bi, .card-header h3 > i { color: var(--primary); font-size: 18px; }

/* ---- Hero-Teaser auf home/guest page ------------------------------------ */
.page-content > .hero:first-child { margin-top: 0; }

/* ---- Snippet-Cards / Code-Preview --------------------------------------- */
pre { font-family: var(--w-font-mono); background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.55; }
code { font-family: var(--w-font-mono); }

/* ---- TOC (Table of Contents) -------------------------------------------- */
.toc {
    padding: 0.75rem 1rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a {
    display: block; padding: 4px 8px; color: var(--text-light);
    border-left: 2px solid transparent; border-radius: var(--radius-xs);
    text-decoration: none; transition: all var(--transition-fast);
}
.toc a:hover { color: var(--primary); background: var(--bg-card-solid); }
.toc a.is-active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* ---- Page-Content Animation für wiki_neu -------------------------------- */
.page-content > .card, .page-content > .stat, .page-content > .grid > .card, .page-content > .grid > .stat {
    animation: fadeInUp 0.4s ease backwards;
}

/* ---- Flash-Container ohne horizontale Margins in page-content ---------- */
.page-content > .flash:first-child, .page-content > .alert:first-child { margin-top: 0; }

/* ==========================================================================
   Native Markdown-Editor (.md-editor) — Finance-Polish
   ========================================================================== */
.md-editor {
    background: var(--bg-card-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.md-editor:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.md-editor.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
    box-shadow: inset 0 0 0 3px var(--primary-glow);
}

/* Toolbar */
.md-editor .md-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.md-editor .md-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--text);
    width: 34px;
    height: 32px;
    padding: 0 8px;
    margin: 0;
    font-size: 0.92rem;
    font-weight: 650;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--w-font-sans);
    line-height: 1;
}
.md-editor .md-toolbar button:hover {
    background: var(--bg-card-solid);
    color: var(--primary);
    border-color: var(--border);
    transform: translateY(-1px);
}
.md-editor .md-toolbar button:active {
    transform: translateY(0);
    background: rgba(99, 102, 241, 0.12);
}
.md-editor .md-toolbar button[data-name="italic"] { font-style: italic; }
.md-editor .md-toolbar button[data-name="ic"],
.md-editor .md-toolbar button[data-name="code"] { font-family: var(--w-font-mono); font-size: 0.78rem; }
.md-editor .md-toolbar button[data-name="preview"] {
    width: auto;
    padding: 0 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
}
.md-editor .md-toolbar button[data-name="preview"]:hover {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}
.md-editor .md-toolbar .sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
    align-self: center;
}
.md-editor .md-toolbar .spacer {
    flex: 1;
}
.md-editor .md-toolbar .md-hint {
    font-size: 0.72rem;
    color: var(--text-light);
    padding: 0 8px;
}

/* Body + Textarea */
.md-editor .md-body {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}
.md-editor .md-body textarea#md-editor,
.md-editor textarea {
    width: 100%;
    min-height: 380px;
    border: 0;
    outline: 0;
    resize: vertical;
    padding: 16px 18px;
    background: var(--bg-card-solid);
    color: var(--text);
    font-family: var(--w-font-mono);
    font-size: 14px;
    line-height: 1.7;
    box-shadow: none !important;
    border-radius: 0;
}
.md-editor .md-body textarea:focus {
    box-shadow: none !important;
    border: 0 !important;
}

/* Preview-Panel */
.md-editor .md-preview {
    padding: 18px 22px;
    background: var(--bg-card);
    min-height: 380px;
    color: var(--text);
    font-family: var(--w-font-sans);
    line-height: 1.7;
}
.md-editor .md-preview h1,
.md-editor .md-preview h2,
.md-editor .md-preview h3 { letter-spacing: -0.02em; margin: 1em 0 0.4em; }
.md-editor .md-preview h1 { font-size: 1.45rem; font-weight: 750; }
.md-editor .md-preview h2 { font-size: 1.2rem; font-weight: 700; }
.md-editor .md-preview h3 { font-size: 1.05rem; font-weight: 650; }
.md-editor .md-preview code {
    background: var(--bg-card-solid);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    border: 1px solid var(--border);
}
.md-editor .md-preview pre {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    overflow-x: auto;
    margin: 0.75em 0;
}
.md-editor .md-preview blockquote {
    border-left: 4px solid var(--primary);
    background: rgba(99, 102, 241, 0.05);
    padding: 0.5em 1em;
    color: var(--text-light);
    margin: 0.75em 0;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.md-editor .md-preview a { color: var(--primary); }
.md-editor .md-preview table { border-collapse: collapse; margin: 0.75em 0; }
.md-editor .md-preview th,
.md-editor .md-preview td { border: 1px solid var(--border); padding: 0.5em 0.9em; }
.md-editor .md-preview th { background: var(--bg-card-solid); }

/* Upload-Banner */
.md-editor .md-uploading {
    padding: 6px 14px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shimmer 2s ease-in-out infinite;
    background-size: 200% 100%;
}

/* Dark-Mode */
[data-theme="dark"] .md-editor textarea,
[data-theme="dark"] .md-editor .md-body textarea#md-editor {
    background: var(--bg-card-solid);
    color: var(--text);
}
[data-theme="dark"] .md-editor .md-toolbar button:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Mobile */
@media (max-width: 640px) {
    .md-editor .md-toolbar button { width: 32px; height: 30px; font-size: 0.85rem; }
    .md-editor .md-toolbar .md-hint { display: none; }
    .md-editor textarea { font-size: 15px; padding: 12px 14px; }
}

/* ==========================================================================
   EasyMDE / CodeMirror — nur falls doch verwendet
   ========================================================================== */
.EasyMDEContainer {
    background: var(--bg-card-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}
.EasyMDEContainer:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Toolbar */
.EasyMDEContainer .editor-toolbar {
    background: var(--bg-card);
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    opacity: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.EasyMDEContainer .editor-toolbar::before,
.EasyMDEContainer .editor-toolbar::after { display: none; }
.EasyMDEContainer .editor-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--text-light);
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 14px;
}
.EasyMDEContainer .editor-toolbar button:hover {
    background: var(--bg-card-solid);
    color: var(--primary);
    border-color: var(--border);
}
.EasyMDEContainer .editor-toolbar button.active,
.EasyMDEContainer .editor-toolbar button:focus {
    background: rgba(99,102,241,0.12);
    color: var(--primary);
    border-color: var(--primary-light);
}
.EasyMDEContainer .editor-toolbar i.separator {
    border-left: 1px solid var(--border);
    border-right: 0;
    margin: 0 4px;
    height: 20px;
    align-self: center;
}

/* CodeMirror Editor-Fläche */
.EasyMDEContainer .CodeMirror {
    background: var(--bg-card-solid);
    color: var(--text);
    font-family: var(--w-font-mono);
    font-size: 14px;
    line-height: 1.7;
    border: 0;
    border-radius: 0;
    padding: 14px 16px;
    min-height: 360px;
    height: auto;
}
.EasyMDEContainer .CodeMirror-scroll { min-height: 340px; }
.EasyMDEContainer .CodeMirror-cursor { border-left-color: var(--primary); border-left-width: 2px; }
.EasyMDEContainer .CodeMirror-selected,
.EasyMDEContainer .CodeMirror-selectedtext { background: rgba(99,102,241,0.2) !important; }
.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected { background: rgba(99,102,241,0.28) !important; }

/* Markdown-Syntax-Highlighting im Editor */
.EasyMDEContainer .cm-s-easymde .cm-header { color: var(--primary); font-weight: 700; }
.EasyMDEContainer .cm-s-easymde .cm-header-1 { font-size: 1.4em; }
.EasyMDEContainer .cm-s-easymde .cm-header-2 { font-size: 1.25em; }
.EasyMDEContainer .cm-s-easymde .cm-header-3 { font-size: 1.1em; }
.EasyMDEContainer .cm-s-easymde .cm-strong { color: var(--text); font-weight: 700; }
.EasyMDEContainer .cm-s-easymde .cm-em { color: var(--text); font-style: italic; }
.EasyMDEContainer .cm-s-easymde .cm-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.EasyMDEContainer .cm-s-easymde .cm-url { color: var(--text-light); }
.EasyMDEContainer .cm-s-easymde .cm-comment,
.EasyMDEContainer .cm-s-easymde .cm-quote { color: var(--text-light); font-style: italic; background: rgba(99,102,241,0.04); padding: 0 2px; }
.EasyMDEContainer .cm-s-easymde .cm-keyword { color: #8b5cf6; }
.EasyMDEContainer .cm-s-easymde .cm-string { color: var(--success); }
.EasyMDEContainer .cm-s-easymde .cm-tag,
.EasyMDEContainer .cm-s-easymde .cm-variable-2 { color: var(--info); }
.EasyMDEContainer .cm-s-easymde .cm-hr { color: var(--text-light); font-weight: 700; }
.EasyMDEContainer .cm-s-easymde .cm-formatting-code,
.EasyMDEContainer .cm-s-easymde .cm-formatting-code-block { background: rgba(99,102,241,0.06); color: var(--primary); }
.EasyMDEContainer .cm-s-easymde .cm-formatting-quote { color: var(--primary); }

/* Preview-Panel (split-view) */
.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 14px 18px;
    color: var(--text);
    font-family: var(--w-font-sans);
}
.EasyMDEContainer .editor-preview-side { border: 0; border-left: 1px solid var(--border); }
.EasyMDEContainer .editor-preview-active,
.EasyMDEContainer .editor-preview-active-side { display: block; }
.EasyMDEContainer .editor-preview h1,
.EasyMDEContainer .editor-preview h2,
.EasyMDEContainer .editor-preview h3 { letter-spacing: -0.02em; color: var(--text); }
.EasyMDEContainer .editor-preview code {
    background: var(--bg-card-solid);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.88em;
    border: 1px solid var(--border);
}
.EasyMDEContainer .editor-preview pre {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}
.EasyMDEContainer .editor-preview blockquote {
    border-left: 4px solid var(--primary);
    background: rgba(99,102,241,0.04);
    padding: 0.5em 1em;
    color: var(--text-light);
    margin: 0.75em 0;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.EasyMDEContainer .editor-preview a { color: var(--primary); }
.EasyMDEContainer .editor-preview table { border-collapse: collapse; margin: 0.75em 0; }
.EasyMDEContainer .editor-preview th,
.EasyMDEContainer .editor-preview td { border: 1px solid var(--border); padding: 0.4em 0.75em; }

/* Statusbar unten */
.EasyMDEContainer .editor-statusbar {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    color: var(--text-light);
    padding: 6px 12px;
    font-size: 0.72rem;
    font-family: var(--w-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.EasyMDEContainer .editor-statusbar .lines::before { content: 'Zeilen: '; }
.EasyMDEContainer .editor-statusbar .words::before { content: 'Wörter: '; }
.EasyMDEContainer .editor-statusbar .characters::before { content: 'Zeichen: '; }

/* Fullscreen */
.EasyMDEContainer.sided--no-fullscreen .editor-preview-side { position: static; }
.editor-preview-full,
.CodeMirror-fullscreen { background: var(--bg); }

/* Drop-Zone-Indicator fürs Drag&Drop */
.EasyMDEContainer .CodeMirror.drop-active {
    box-shadow: inset 0 0 0 3px var(--primary);
    background: rgba(99,102,241,0.04);
}

/* Dark-Mode-Anpassungen */
[data-theme="dark"] .EasyMDEContainer .CodeMirror {
    background: var(--bg-card-solid);
    color: var(--text);
}
[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .cm-string { color: #86efac; }
[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .cm-keyword { color: #c4b5fd; }
[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .cm-tag,
[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .cm-variable-2 { color: #93c5fd; }
[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .cm-comment,
[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .cm-quote { background: rgba(99,102,241,0.08); }

/* Mobile: Toolbar-Buttons enger */
@media (max-width: 640px) {
    .EasyMDEContainer .editor-toolbar button { width: 30px; height: 30px; }
    .EasyMDEContainer .CodeMirror { font-size: 15px; padding: 10px 12px; }
}

/* ==========================================================================
   wiki_neu · Neue Features (Finance-Polish)
   Issue-Labels · MR-Reviews · Releases · Health-Widget · Timeline · Notifs
   ========================================================================== */

/* ---- MR-Status-Pill (analog Issue-Status) ------------------------------- */
.mr-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 650;
    text-transform: uppercase; letter-spacing: 0.05em;
    vertical-align: middle; margin-right: 6px;
}
.mr-status.open {
    background: var(--info-bg); color: var(--info);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.2);
}
.mr-status.merged {
    background: rgba(139,92,246,0.14); color: #8b5cf6;
    box-shadow: 0 0 0 1px rgba(139,92,246,0.25);
}
.mr-status.closed {
    background: var(--danger-bg); color: var(--danger);
    box-shadow: 0 0 0 1px rgba(239,68,68,0.2);
}

/* ---- Notifications-Row (Liste) ----------------------------------------- */
.notif-section-title {
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-light);
    font-weight: 650; margin: 20px 0 8px; padding-left: 2px;
}
.notif-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: transparent;
    border-bottom: 1px solid var(--border); width: 100%;
    transition: background var(--transition-fast); color: var(--text);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: rgba(99,102,241,0.05); }
.notif-row.unread { background: rgba(99,102,241,0.06); border-left: 3px solid var(--primary); padding-left: 13px; }
.notif-row.unread .notif-body { font-weight: 600; }
.notif-row.read { opacity: 0.85; }
.notif-row .notif-body { font-size: 0.88rem; color: var(--text); }
.notif-row .sub { display: flex; gap: 6px; font-size: 0.75rem; color: var(--text-light); margin-top: 2px; align-items: center; flex-wrap: wrap; }
.notif-row .notif-kind {
    font-family: var(--w-font-mono); font-size: 0.7rem;
    background: var(--bg-card-solid); padding: 1px 6px;
    border-radius: 3px; border: 1px solid var(--border);
    color: var(--primary); text-transform: none;
}

/* ---- Status-Dot (Notifications, Tasks) ---------------------------------- */
.status-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; flex-shrink: 0;
    background: var(--text-light);
    box-shadow: 0 0 0 2px var(--bg);
}
.status-dot.info { background: var(--info); box-shadow: 0 0 8px rgba(59,130,246,0.5), 0 0 0 2px var(--bg); }
.status-dot.success { background: var(--success); }
.status-dot.danger { background: var(--danger); }
.status-dot.warning { background: var(--warning); }

/* ---- Wiki-Seiten-Liste (Per-Repo) --------------------------------------- */
.meta-sidebar .meta-block .wiki-pages {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.meta-sidebar .meta-block .wiki-pages a {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: var(--radius-xs);
    color: var(--text); font-size: 0.82rem; text-decoration: none;
    transition: all var(--transition-fast);
}
.meta-sidebar .meta-block .wiki-pages a:hover {
    background: rgba(99,102,241,0.06); color: var(--primary);
    transform: translateX(2px);
}
.meta-sidebar .meta-block .wiki-pages a.is-active {
    background: rgba(99,102,241,0.12); color: var(--primary);
    font-weight: 600;
}

/* ---- Command-Palette-Items --------------------------------------------- */
.cmd-body .cmd-group-title {
    padding: 8px 12px 4px; font-size: 0.68rem;
    font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-light);
}
.cmd-body .cmd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; color: var(--text);
    text-decoration: none; cursor: pointer;
    border-left: 2px solid transparent;
    transition: background var(--transition-fast);
}
.cmd-body .cmd-item:hover,
.cmd-body .cmd-item.is-active {
    background: rgba(99,102,241,0.08); border-left-color: var(--primary);
    text-decoration: none;
}
.cmd-body .cmd-item .bi { color: var(--primary); font-size: 16px; flex-shrink: 0; }
.cmd-body .cmd-item .cmd-item-title { font-weight: 550; font-size: 0.88rem; flex: 1; min-width: 0; }
.cmd-body .cmd-item .cmd-item-sub { color: var(--text-light); font-size: 0.75rem; margin-left: auto; flex-shrink: 0; }
.cmd-body .cmd-item .cmd-item-type {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 2px 6px; background: var(--bg-card-solid);
    border-radius: 999px; color: var(--text-light); flex-shrink: 0;
}

/* ---- Issue-Status-Pill --------------------------------------------------- */
.issue-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 650;
    text-transform: uppercase; letter-spacing: 0.05em;
    vertical-align: middle; margin-right: 6px;
}
.issue-status.open {
    background: var(--success-bg); color: var(--success);
    box-shadow: 0 0 0 1px rgba(34,197,94,0.2);
}
.issue-status.closed {
    background: rgba(139,92,246,0.12); color: #8b5cf6;
    box-shadow: 0 0 0 1px rgba(139,92,246,0.2);
}

/* ---- Label-Pills (Issues/MR) -------------------------------------------- */
.labels-row {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.label-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.18rem 0.6rem; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600;
    background: color-mix(in srgb, var(--label-color) 15%, transparent);
    color: var(--label-color);
    border: 1px solid color-mix(in srgb, var(--label-color) 35%, transparent);
    transition: transform var(--transition-fast);
}
.label-pill:hover { transform: scale(1.05); }
@supports not (background: color-mix(in srgb, red, blue)) {
    .label-pill { background: var(--bg-card-solid); color: var(--label-color); border-color: var(--label-color); opacity: 0.9; }
}

/* ---- Comment-Card + Timeline-Events ------------------------------------- */
.comment-card { border-radius: var(--radius); background: var(--bg-card); }
.timeline-event {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-light);
    padding: 8px 12px; border-left: 2px solid var(--border);
    margin-left: 18px; position: relative;
}
.timeline-event::before {
    content: ''; position: absolute; left: -5px; top: 50%;
    transform: translateY(-50%); width: 8px; height: 8px;
    border-radius: 50%; background: var(--text-light);
    border: 2px solid var(--bg);
}
.timeline-event strong { color: var(--text); }
.timeline-event .text-soft { margin-left: auto; }

/* ---- MR-Review-Verdict-Badges + Review-Form ---------------------------- */
.review-verdict {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600;
}
.review-verdict.approved { background: var(--success-bg); color: var(--success); }
.review-verdict.changes_requested { background: var(--danger-bg); color: var(--danger); }
.review-verdict.commented { background: var(--bg-card-solid); color: var(--text-light); border: 1px solid var(--border); }

.review-summary {
    display: flex; gap: 1rem; flex-wrap: wrap;
    padding: 10px 14px; background: var(--bg-card);
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    font-size: 0.82rem; align-items: center;
}
.review-summary-item {
    display: inline-flex; align-items: center; gap: 5px; font-weight: 550;
}
.review-summary-item.approved { color: var(--success); }
.review-summary-item.changes_requested { color: var(--danger); }
.review-summary-item.commented { color: var(--text-light); }

.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.review-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-card-solid); border: 1px solid var(--border);
    transition: all var(--transition-fast);
}
.review-list li:hover { border-color: var(--primary-light); }
.review-list li .bi { font-size: 18px; flex-shrink: 0; }

/* ---- Releases-Timeline -------------------------------------------------- */
.release-card {
    padding: 1.5rem; border-bottom: 1px solid var(--border);
    position: relative;
}
.release-card:last-child { border-bottom: 0; }
.release-card h2 {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.75rem;
}
.release-card h2 .bi-tag-fill {
    color: var(--primary); filter: drop-shadow(0 2px 8px rgba(99,102,241,0.35));
}
.release-card-list {
    list-style: none; margin: 10px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 3px;
}
.release-card-list li {
    display: flex; align-items: baseline; gap: 10px;
    padding: 6px 10px; border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    font-size: 0.88rem;
}
.release-card-list li:hover { background: rgba(99,102,241,0.04); }
.release-card-list .mono {
    color: var(--primary); font-size: 0.78rem; font-weight: 600;
    background: rgba(99,102,241,0.1); padding: 2px 6px; border-radius: 4px;
}

/* ---- Ops-Health-Widget (Admin-Dashboard) ------------------------------- */
.health-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px;
}
.health-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card-solid); border: 1px solid var(--border);
    transition: all var(--transition-fast);
}
.health-item:hover { border-color: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.health-item .bi { font-size: 20px; flex-shrink: 0; }
.health-item.ok { border-left: 3px solid var(--success); }
.health-item.fail { border-left: 3px solid var(--danger); }
.health-item .label { font-weight: 600; font-size: 0.88rem; }
.health-item .detail { font-size: 0.78rem; color: var(--text-light); word-break: break-all; }

/* ---- Notifications-Grouping -------------------------------------------- */
.notif-group {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); margin-bottom: 10px; overflow: hidden;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.notif-group.has-unread { border-left: 3px solid var(--primary); }
.notif-group summary {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer;
    list-style: none; font-size: 0.88rem;
}
.notif-group summary::-webkit-details-marker { display: none; }
.notif-group summary::after {
    content: '▸'; margin-left: auto; opacity: 0.5;
    transition: transform var(--transition-fast); font-size: 11px;
}
.notif-group[open] summary::after { transform: rotate(90deg); }
.notif-group summary .count {
    padding: 1px 7px; border-radius: 999px;
    background: var(--primary); color: #fff;
    font-size: 0.7rem; font-weight: 700;
}
.notif-group .notif-items {
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.notif-group .notif-items > * {
    padding: 8px 14px; border-bottom: 1px solid var(--border);
    font-size: 0.82rem; display: flex; gap: 8px; align-items: center;
}
.notif-group .notif-items > *:last-child { border-bottom: 0; }

/* ---- File-Type-Icons (Repo-Tree, Runde 3) ------------------------------ */
/* schon oben gesetzt, aber hier Background-Tint für bessere Sichtbarkeit */
.file-icon { display: inline-block; line-height: 1; }
td > a > .file-icon { margin-right: 4px; vertical-align: -1px; }

/* ---- Smart-Commit-Refs (Runde 6) --------------------------------------- */
.commit-refs {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 12px 14px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.82rem; margin-top: 10px;
}
.commit-refs > a {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.78rem; color: var(--text);
    transition: all var(--transition-fast);
}
.commit-refs > a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.commit-refs > a.closes {
    background: var(--success-bg); color: var(--success);
    border-color: transparent; font-weight: 600;
}

/* ---- Shield-Badges (SVG-Embed) ----------------------------------------- */
.repo-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.repo-badges img { height: 20px; border-radius: 3px; }

/* ---- VS Code-Button (Runde 11) ----------------------------------------- */
.btn .bi-microsoft { color: #007acc; }
[data-theme="dark"] .btn .bi-microsoft { color: #4ea9ff; }

/* ---- CODEOWNERS-Table --------------------------------------------------- */
.codeowners-list .badge {
    background: rgba(99,102,241,0.1); color: var(--primary);
    border: 1px solid rgba(99,102,241,0.3); font-weight: 600;
}

/* ---- Repo-Wiki-Sidebar -------------------------------------------------- */
.meta-sidebar .meta-block ul a[href*="/wiki?"] {
    font-size: 0.85rem; display: block;
    padding: 5px 8px; border-radius: var(--radius-xs);
}

/* ==========================================================================
   Task-Detail (show.php) — Finance-Polish
   ========================================================================== */

/* Task-Status-Pill im H1 */
.task-status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0.25rem 0.75rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 650;
    text-transform: uppercase; letter-spacing: 0.05em;
    vertical-align: middle; margin-right: 8px;
    border: 1px solid transparent;
}
.task-status-pill.open        { background: var(--info-bg);    color: var(--info);    box-shadow: 0 0 0 1px rgba(59,130,246,0.2); }
.task-status-pill.in_progress { background: var(--warning-bg); color: var(--warning); box-shadow: 0 0 0 1px rgba(245,158,11,0.2); }
.task-status-pill.review      { background: rgba(139,92,246,0.14); color: #8b5cf6;    box-shadow: 0 0 0 1px rgba(139,92,246,0.25); }
.task-status-pill.done        { background: var(--success-bg); color: var(--success); box-shadow: 0 0 0 1px rgba(34,197,94,0.2); }
.task-status-pill.cancelled   { background: var(--bg-card);    color: var(--text-light); border-color: var(--border); }

/* Segmented Status-Control unter dem Header */
.status-segment {
    display: flex; align-items: stretch; gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.status-segment::-webkit-scrollbar { display: none; }
.status-segment-btn {
    flex: 1; min-width: 100px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0.5rem 0.85rem;
    background: transparent; border: 0; border-radius: var(--radius-sm);
    color: var(--text-light); font-size: 0.82rem; font-weight: 550;
    cursor: pointer; transition: all var(--transition-fast);
    white-space: nowrap;
}
.status-segment-btn:hover { background: var(--bg-card-solid); color: var(--text); }
.status-segment-btn.is-active {
    color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.status-segment-btn.is-active.status-open        { background: var(--info); box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
.status-segment-btn.is-active.status-in_progress { background: var(--warning); box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.status-segment-btn.is-active.status-review      { background: #8b5cf6; box-shadow: 0 2px 8px rgba(139,92,246,0.3); }
.status-segment-btn.is-active.status-done        { background: var(--success); box-shadow: 0 2px 8px rgba(34,197,94,0.3); }
.status-segment-btn.is-active.status-cancelled   { background: var(--text-light); }

/* Key-Value-Rows in Meta-Blocks */
.kv-row {
    display: flex; justify-content: space-between; gap: 8px;
    padding: 5px 0; font-size: 0.82rem;
    border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:first-child,
.kv-row .muted { flex-shrink: 0; }
.kv-row a { color: var(--primary); font-weight: 500; }

/* Progress-Bar (Finance-Style, für Checklist + Zeit) */
.progress-bar {
    height: 6px; background: var(--border);
    border-radius: 999px; overflow: hidden; position: relative;
}
.progress-fill {
    height: 100%; background: var(--gradient-primary);
    border-radius: 999px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}
.progress-fill.ok      { background: var(--gradient-success); }
.progress-fill.warning { background: var(--gradient-warning); }
.progress-fill.danger  { background: var(--gradient-danger); }

/* Checklist-Items */
.cl-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 4px; border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    font-size: 0.85rem;
}
.cl-item:hover { background: rgba(99,102,241,0.04); }
.cl-item.is-done .cl-text { text-decoration: line-through; color: var(--text-light); }
.cl-item .cl-check {
    background: transparent; border: 0; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; color: var(--text-light);
    transition: color var(--transition-fast);
}
.cl-item .cl-check:hover { color: var(--primary); }
.cl-item.is-done .cl-check i { color: var(--success); }
.cl-item .cl-text { flex: 1; line-height: 1.4; }
.cl-del {
    background: transparent; border: 0; padding: 2px 4px;
    color: var(--text-light); opacity: 0; cursor: pointer;
    border-radius: var(--radius-xs); transition: all var(--transition-fast);
    font-size: 0.85rem;
}
.cl-item:hover .cl-del, .dep-item:hover .cl-del, .collab-item:hover .cl-del, .time-entry:hover .cl-del { opacity: 0.6; }
.cl-del:hover { opacity: 1 !important; background: var(--danger-bg); color: var(--danger); }

/* Dep-Items */
.meta-block.is-blocked {
    border-color: var(--warning);
    box-shadow: 0 0 0 1px var(--warning), var(--shadow);
}
.dep-section { margin-bottom: 10px; }
.dep-section:last-child { margin-bottom: 0; }
.dep-label {
    display: block; font-size: 0.7rem; color: var(--text-light);
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
    margin-bottom: 4px;
}
.dep-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 0; font-size: 0.82rem;
}
.dep-item a { flex: 1; min-width: 0; color: var(--text); }
.dep-item a:hover { color: var(--primary); }
.dep-item .badge {
    font-size: 0.65rem; padding: 1px 6px;
}

/* Collaborator-Items */
.collab-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 0.85rem;
}

/* Time-Entry */
.time-entry {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; padding: 2px 0;
}

/* MR-Diff mit Inline-Comments */
.diff { font-family: var(--w-font-mono); font-size: 0.82rem; line-height: 1.5; background: var(--bg-card-solid); }
.diff-line {
    display: grid; grid-template-columns: 44px 44px 18px minmax(0, 1fr) 24px;
    align-items: center; padding: 0;
    min-height: 22px;
    position: relative;
}
.diff-line .diff-ln {
    text-align: right; padding: 0 6px;
    color: var(--text-light); opacity: 0.55;
    font-size: 0.72rem; user-select: none;
    border-right: 1px solid var(--border); background: var(--bg-card);
}
.diff-line .diff-sign { text-align: center; color: var(--text-light); font-weight: 700; }
.diff-line .diff-text { white-space: pre; padding: 0 8px; overflow-x: auto; }
.diff-line.diff-add { background: rgba(34,197,94,0.08); }
.diff-line.diff-add .diff-sign { color: var(--success); }
.diff-line.diff-del { background: rgba(239,68,68,0.08); }
.diff-line.diff-del .diff-sign { color: var(--danger); }
.diff-line.diff-sep {
    display: block; grid-template-columns: none;
    padding: 4px 10px; color: var(--text-light);
    background: var(--bg-card); font-size: 0.78rem;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.diff-line:hover { background: rgba(99,102,241,0.05); }
.diff-line:hover .diff-add-comment { opacity: 1; }
.diff-add-comment {
    width: 20px; height: 20px;
    background: var(--primary); color: #fff;
    border: 0; border-radius: 3px;
    font-size: 10px; cursor: pointer;
    opacity: 0; transition: opacity var(--transition-fast);
    margin: 0 2px;
}
.mr-new-thread, .mr-inline-thread {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    display: block;
}
.mr-new-thread { padding: 10px 14px; }
.mr-inline-thread.is-resolved { background: rgba(34,197,94,0.05); border-left: 3px solid var(--success); }
.mr-inline-cmt {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.mr-inline-cmt:last-of-type { border-bottom: 0; }
.mr-inline-reply { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.mr-inline-reply input { width: 100%; }

/* Task-Form (New/Edit) — 2-spaltig mit Meta-Sidebar */
.task-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1rem;
    align-items: start;
}
.task-form-main { min-width: 0; }
.task-form-main .card { margin: 0; }
.task-form-meta {
    display: flex; flex-direction: column; gap: 10px;
    position: sticky; top: 1rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
@media (max-width: 960px) {
    .task-form-layout { grid-template-columns: 1fr; }
    .task-form-meta { position: static; max-height: none; order: 2; }
}
.task-title-input {
    font-size: 1.15rem !important;
    font-weight: 600;
    padding: 10px 14px !important;
}

/* Prio-Segment (wie status-segment aber horizontal kompakt) */
.prio-segment {
    display: flex; flex-direction: column; gap: 3px;
}
.prio-segment-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.82rem; font-weight: 550;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin: 0;
    position: relative;
}
.prio-segment-btn:hover { background: var(--bg-card); color: var(--text); }
.prio-segment-btn i { font-size: 14px; flex-shrink: 0; }
.prio-segment-btn.is-active {
    color: #fff; font-weight: 600; border-color: transparent;
}
.prio-segment-btn.prio-urgent.is-active { background: var(--danger); box-shadow: 0 2px 6px rgba(239,68,68,0.35); }
.prio-segment-btn.prio-high.is-active   { background: var(--warning); box-shadow: 0 2px 6px rgba(245,158,11,0.35); }
.prio-segment-btn.prio-normal.is-active { background: var(--text-light); }
.prio-segment-btn.prio-low.is-active    { background: var(--info); box-shadow: 0 2px 6px rgba(59,130,246,0.35); }

/* Status-Segment kompakt (vertikal) */
.status-segment-sm {
    flex-direction: column;
    gap: 3px; padding: 4px;
}
.status-segment-sm .status-segment-btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 7px 10px;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.82rem;
}
.status-segment-sm .status-segment-btn input[type="radio"] {
    pointer-events: none;
}

/* Label-Pills (Checkbox-Group mit Farbe) */
.label-checks {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.label-check {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-card-solid);
    color: var(--lbl, var(--text-light));
    border: 1px solid color-mix(in srgb, var(--lbl, var(--border)) 35%, var(--border));
    font-size: 0.75rem; font-weight: 550;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin: 0;
}
.label-check:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.label-check input { display: none; }
.label-check.is-on {
    background: var(--lbl, var(--primary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--lbl, var(--primary)) 40%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .label-check.is-on { background: var(--lbl, var(--primary)); color: #fff; border-color: var(--lbl, var(--primary)); }
}

/* Contribution-Heatmap (Dashboard) */
.heatmap { padding: 4px 0; }
.heatmap-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 10px;
}

/* Erweiterte Heatmap mit Monats- und Tages-Labels (GitHub-Style) */
.heatmap-wrapper {
    overflow-x: auto;
    padding: 4px 4px 2px;
}
.hm-months {
    display: grid;
    gap: 3px;
    margin-bottom: 4px;
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}
.hm-month { min-width: 10px; }
.heatmap-body {
    display: grid;
    gap: 3px;
}
.hm-days {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    font-size: 0.68rem;
    color: var(--muted);
    padding-right: 4px;
}
.hm-days span { line-height: 1; align-self: center; }
.hm-week {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
}

/* Zellen als <button> stylen — native Button-Look entfernen */
button.hm-cell {
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
button.hm-cell.hm-l1, button.hm-cell.hm-l2, button.hm-cell.hm-l3, button.hm-cell.hm-l4 {
    cursor: pointer;
}

/* Heatmap-Popover: schwebt über der Seite, ~350px breit */
.hm-popover {
    position: absolute;
    z-index: 100;
    width: 340px;
    max-height: 400px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 12px;
    overflow-y: auto;
    font-size: 0.88rem;
}
[data-theme="dark"] .hm-popover { box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.hm-pop-body { display: flex; flex-direction: column; gap: 3px; }
.hm-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
}
.hm-item:hover { background: var(--bg-muted); }
.hm-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-item-time { color: var(--muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.hm-cell {
    width: 12px; height: 12px;
    border-radius: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: inline-block;
    transition: transform var(--transition-fast);
}
.hm-cell:hover { transform: scale(1.25); }
.hm-l0 { background: var(--bg-card); }
.hm-pad { visibility: hidden; pointer-events: none; } /* zukünftige Tage in Spalte 12 — Grid-Alignment behalten */
.hm-l1 { background: #c7e3cf; border-color: transparent; }
.hm-l2 { background: #86c99a; border-color: transparent; }
.hm-l3 { background: #3ea25c; border-color: transparent; }
.hm-l4 { background: #1a7f37; border-color: transparent; }
[data-theme="dark"] .hm-l1 { background: #0e4429; }
[data-theme="dark"] .hm-l2 { background: #006d32; }
[data-theme="dark"] .hm-l3 { background: #26a641; }
[data-theme="dark"] .hm-l4 { background: #39d353; }
.heatmap-legend {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.72rem;
}
.heatmap-legend .hm-cell { width: 10px; height: 10px; }

/* Repo-Settings-Sections (Anker-Navigation) */
.edit-section {
    scroll-margin-top: 80px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}
.edit-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}
.edit-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.95rem; font-weight: 650;
    color: var(--text);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}
.edit-section-title .bi { color: var(--primary); }

/* ==========================================================================
   GitHub-Style Repo-Ansicht
   ========================================================================== */

/* Header mit Owner/Slug-Breadcrumb + Visibility + Actions */
.gh-repo-header {
    display: flex; align-items: center; gap: 12px;
    padding: 1rem 0 0.75rem; margin-bottom: 0;
    flex-wrap: wrap;
}
.gh-repo-breadcrumb {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
    font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em;
}
.gh-repo-breadcrumb > i {
    font-size: 22px; color: var(--text-light);
}
.gh-repo-breadcrumb .gh-owner {
    color: var(--primary); font-weight: 500;
}
.gh-repo-breadcrumb .gh-sep {
    color: var(--text-light); font-weight: 400; opacity: 0.5;
}
.gh-repo-breadcrumb .gh-slug {
    color: var(--primary); font-weight: 700;
}
.gh-repo-breadcrumb a:hover { text-decoration: underline; }
.gh-vis-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border: 1px solid var(--border);
    border-radius: 999px; font-size: 0.7rem;
    font-weight: 600; color: var(--text-light);
    background: var(--bg-card-solid); text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gh-vis-pill.private { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.gh-vis-pill.internal { color: #7c3aed; border-color: color-mix(in srgb, #7c3aed 40%, var(--border)); }
.gh-fork-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--bg-muted);
}
.gh-fork-pill a { color: var(--primary); text-decoration: none; margin-left: 2px; }
.gh-fork-pill a:hover { text-decoration: underline; }
.gh-repo-actions { display: flex; gap: 6px; flex-shrink: 0; }
.gh-counter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; font-size: 0.82rem; font-weight: 500;
    color: var(--text); background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    text-decoration: none; cursor: pointer;
    transition: all var(--transition-fast);
}
.gh-counter-btn:hover {
    background: var(--bg-card); border-color: var(--text-light);
    text-decoration: none; color: var(--text);
}
.gh-counter-btn.is-active {
    background: rgba(99,102,241,0.12); color: var(--primary); border-color: var(--primary-light);
    font-weight: 600;
}
.gh-counter-btn .gh-counter {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 6px; margin-left: 4px;
    background: var(--bg-card); color: var(--text-light);
    border-radius: 999px; font-size: 0.7rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.gh-counter-btn.is-active .gh-counter { background: var(--primary); color: #fff; }

/* GitHub-Nav mit Unterstreichung für aktiven Tab */
.gh-repo-nav {
    display: flex; gap: 0; padding: 0;
    margin: 0 0 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    overflow: visible;   /* wichtig: Dropdown darf überhängen */
    background: transparent;
}
/* Auf schmalen Screens scrollbar, solange kein Dropdown offen ist */
@media (max-width: 900px) {
    .gh-repo-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .gh-repo-nav::-webkit-scrollbar { display: none; }
    /* Wenn Insights geöffnet: Overflow freigeben, damit das Menü sichtbar ist */
    .gh-repo-nav:has(details[open]) {
        overflow: visible;
    }
}
.gh-repo-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 14px 12px;
    color: var(--text); font-size: 0.88rem; font-weight: 500;
    text-decoration: none; white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}
.gh-repo-nav a:hover {
    background: color-mix(in srgb, var(--bg-card) 50%, transparent);
    text-decoration: none;
    border-bottom-color: var(--border);
}
.gh-repo-nav a.is-active {
    border-bottom-color: var(--primary);
    font-weight: 650;
    color: var(--text);
}
.gh-repo-nav a .count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 6px;
    background: var(--bg-card); color: var(--text-light);
    border-radius: 999px; font-size: 0.7rem; font-weight: 600;
}
.gh-repo-nav a.is-active .count { background: rgba(99,102,241,0.18); color: var(--primary); }

/* Insights-Dropdown im Repo-Nav (<details>-basiert) */
.gh-repo-nav .gh-nav-dropdown {
    position: relative; display: inline-block; margin-bottom: -1px;
}
.gh-repo-nav .gh-nav-dropdown > summary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 12px 12px;
    color: var(--text); font-size: 0.88rem; font-weight: 500;
    cursor: pointer; list-style: none;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.gh-repo-nav .gh-nav-dropdown > summary::-webkit-details-marker { display: none; }
.gh-repo-nav .gh-nav-dropdown > summary::marker { display: none; content: ''; }
.gh-repo-nav .gh-nav-dropdown > summary::before { display: none; }
.gh-repo-nav details.gh-nav-dropdown { list-style: none; }
.gh-repo-nav details.gh-nav-dropdown summary { list-style: none; }
.gh-repo-nav .gh-nav-dropdown > summary:hover {
    background: color-mix(in srgb, var(--bg-card) 50%, transparent);
    border-bottom-color: var(--border);
}
.gh-repo-nav .gh-nav-dropdown > summary.is-active {
    border-bottom-color: var(--primary);
    font-weight: 650;
}
.gh-repo-nav .gh-nav-dropdown .gh-nav-chev {
    font-size: 0.7rem; color: var(--text-light); margin-left: 2px;
    transition: transform var(--transition-fast);
}
.gh-repo-nav .gh-nav-dropdown[open] .gh-nav-chev { transform: rotate(180deg); }

.gh-repo-nav .gh-nav-dropdown-menu {
    position: absolute; top: 100%; left: 0;
    min-width: 220px; margin-top: 4px; padding: 6px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 40; animation: scaleIn 0.15s ease;
}
.gh-repo-nav .gh-nav-dropdown-menu a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: var(--radius-xs);
    border: 0; border-bottom: 0; margin-bottom: 0;
    font-size: 0.85rem; font-weight: 500; color: var(--text);
    white-space: nowrap;
}
.gh-repo-nav .gh-nav-dropdown-menu a:hover {
    background: var(--bg-card); color: var(--primary);
    border-bottom-color: transparent;
}
.gh-repo-nav .gh-nav-dropdown-menu a.is-active {
    background: rgba(99,102,241,0.12); color: var(--primary); font-weight: 600;
    border-bottom-color: transparent;
}
.gh-repo-nav .gh-nav-dropdown-menu a > i { font-size: 14px; color: var(--text-light); width: 16px; }
.gh-repo-nav .gh-nav-dropdown-menu a:hover > i,
.gh-repo-nav .gh-nav-dropdown-menu a.is-active > i { color: var(--primary); }
.gh-repo-nav .gh-nav-dropdown-menu .gh-dd-label { flex: 1; }
.gh-repo-nav .gh-nav-dropdown-menu .gh-dd-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 6px;
    background: var(--bg-card); color: var(--text-light);
    border-radius: 999px; font-size: 0.7rem; font-weight: 600;
}

/* Settings rechts */
.gh-repo-nav .gh-nav-end { margin-left: auto; }
@media (max-width: 720px) {
    .gh-repo-nav .gh-nav-end { margin-left: 0; }
    .gh-repo-nav .gh-nav-dropdown-menu { left: auto; right: 0; }
}

/* Layout: Main + Sidebar */
.gh-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 296px;
    gap: 1.5rem; align-items: start;
}
.gh-main { min-width: 0; }
.gh-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
@media (max-width: 960px) {
    .gh-layout { grid-template-columns: 1fr; }
    .gh-sidebar { position: static; order: -1; }
}

/* Code-Bar: Branch-Picker + Stats + Actions */
.gh-code-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; margin-bottom: 12px;
    flex-wrap: wrap;
}
.gh-branch-select {
    padding: 6px 28px 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card-solid);
    font-size: 0.85rem; font-weight: 550;
    color: var(--text); font-family: var(--w-font-mono);
    min-width: 180px;
}
.gh-branch-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.gh-code-stats {
    display: flex; gap: 0; align-items: center;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.gh-code-stats .gh-stat {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; font-size: 0.82rem; color: var(--text);
    text-decoration: none;
    border-right: 1px solid var(--border);
    transition: background var(--transition-fast);
}
.gh-code-stats .gh-stat:last-child { border-right: 0; }
.gh-code-stats .gh-stat:hover { background: var(--bg-card); color: var(--primary); text-decoration: none; }
.gh-code-stats .gh-stat strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.gh-code-stats .gh-stat span { color: var(--text-light); }

.gh-code-actions {
    display: flex; gap: 6px; align-items: center;
    margin-left: auto; flex-wrap: wrap;
}
/* Das Clone-Panel (grüner "Code"-Button wie GitHub) */
.gh-code-actions .clone-panel [data-clone-toggle] {
    background: linear-gradient(180deg, #2ea043, #238636);
    color: #fff; border: 1px solid rgba(27,31,36,0.15);
    box-shadow: 0 1px 0 rgba(27,31,36,0.1), inset 0 1px 0 rgba(255,255,255,0.03);
    font-weight: 600; padding: 6px 14px; font-size: 0.85rem;
    border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 6px;
    transition: all var(--transition-fast);
}
.gh-code-actions .clone-panel [data-clone-toggle]:hover {
    background: linear-gradient(180deg, #2c974b, #2a8f41);
    transform: translateY(-1px);
}
[data-theme="dark"] .gh-code-actions .clone-panel [data-clone-toggle] {
    background: linear-gradient(180deg, #2ea043, #238636);
}

/* Clone-Panel-Dropdown: schwebt als Popover über dem Layout. */
.clone-panel { position: relative; display: inline-block; }
.clone-dropdown {
    position: absolute;
    top: calc(100% + 4px); right: 0;
    z-index: 50;
    width: 360px; max-width: 94vw;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px;
}
.clone-dropdown[hidden] { display: none; }
.clone-tabs {
    display: flex; gap: 4px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.clone-tabs > button {
    background: transparent; border: 0;
    padding: 6px 10px;
    font-size: 0.8rem; color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.clone-tabs > button.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.clone-pane { padding: 4px 0 8px; }
.clone-pane[hidden] { display: none; }
.clone-label {
    display: block;
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
}
.clone-row {
    display: flex; gap: 4px; align-items: center;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 2px;
}
.clone-row input[type="text"] {
    flex: 1; border: 0; background: transparent;
    font: 0.78rem/1.3 var(--w-font-mono, ui-monospace, monospace);
    padding: 4px 6px;
    color: var(--text);
    outline: none;
}
.clone-hint { margin: 6px 0 0; }
.clone-steps { margin: 0 0 10px; padding-left: 20px; }
.clone-steps li { margin-bottom: 6px; }
.clone-pane-extra {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.btn-block { display: block; width: 100%; margin-top: 6px; text-align: center; }

/* === Watch-Dropdown (Repo-Header) === */
.gh-watch-menu { position: relative; display: inline-block; }
.gh-watch-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.gh-watch-menu > summary::-webkit-details-marker { display: none; }
.gh-watch-menu-body {
    position: absolute;
    top: calc(100% + 4px); right: 0;
    z-index: 60;
    min-width: 320px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    padding: 4px;
}
.gh-watch-opt { margin: 0; }
.gh-watch-opt > button {
    width: 100%;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-xs);
    background: transparent; border: 0; color: var(--text);
    cursor: pointer; text-align: left;
}
.gh-watch-opt > button:hover { background: var(--bg-muted); }
.gh-watch-opt.is-active > button { background: var(--primary-subtle, rgba(99,102,241,0.08)); }
.gh-watch-opt > button > i.bi { padding-top: 2px; font-size: 1rem; color: var(--muted); }
.gh-watch-opt.is-active > button > i.bi:first-child { color: var(--primary); }
.gh-watch-opt-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.gh-watch-opt-text strong { font-size: 0.85rem; font-weight: 600; }
.gh-watch-opt-text em { font-style: normal; font-size: 0.75rem; color: var(--muted); line-height: 1.35; }

/* Visibility-Icon-Badges (klein, inline) */
.vis-icon { color: var(--muted); font-size: 0.82em; vertical-align: baseline; opacity: 0.85; }
.vis-icon.bi-globe2   { color: #22863a; }
.vis-icon.bi-building { color: #7c3aed; }
.vis-icon.bi-lock-fill { color: #d97706; }
.vis-text { font-size: 0.78rem; color: var(--muted); }

/* Counter-Link im Watch/Star-Button klickbar trennen */
.gh-counter-link {
    color: inherit; text-decoration: none;
    display: inline-block; padding: 0 2px;
}
.gh-counter-link:hover { text-decoration: underline; }

/* ============================================================
 * Admin-Layout — permanent dunkles Control-Panel-Design
 * (unabhängig vom User-Theme, wie GitHub/Vercel Admin-Dashboards)
 * ============================================================ */
.admin-shell {
    /* Admin nutzt dasselbe Theme wie der User-Bereich (Indigo/Violett + Light/Dark).
       Die `--ad-*`-Variablen mappen auf die globalen Token — dadurch funktioniert
       Theme-Toggle automatisch. Der sichtbare Admin-Unterschied kommt über:
        1. Dünnen ROTEN Streifen oben auf dem ganzen Layout
        2. „Admin-Modus"-Badge im Sidebar-Header
        3. Rot/Warm-Orange als sekundäre Akzentfarbe für Admin-spezifische Icons
    */
    --ad-bg:        var(--bg);
    --ad-bg-2:      var(--bg-card);
    --ad-surface:   var(--bg-card-solid);
    --ad-surface-2: color-mix(in srgb, var(--bg-card-solid) 93%, var(--text));
    --ad-border:    var(--border);
    --ad-border-2:  color-mix(in srgb, var(--border) 100%, var(--primary) 15%);
    --ad-text:      var(--text);
    --ad-text-2:    color-mix(in srgb, var(--text) 75%, transparent);
    --ad-muted:     var(--text-light);
    --ad-primary:   var(--primary);
    --ad-primary-2: var(--primary-light, #818cf8);
    --ad-primary-glow: var(--primary-glow);
    --ad-success:   var(--success);
    --ad-warning:   var(--warning);
    --ad-danger:    var(--danger);
    /* Sekundäre Admin-Akzentfarbe (Mode-Indikator) */
    --ad-accent:       #e11d48;  /* Rose-600 */
    --ad-accent-light: #fb7185;

    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    position: relative;
    padding-top: 4px; /* Platz für den Admin-Mode-Streifen */
}
/* Roter Admin-Mode-Streifen ganz oben — signalisiert „privilegierter Kontext" */
.admin-shell::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e11d48, #ec4899, #e11d48);
    background-size: 200% 100%;
    animation: admin-mode-shimmer 6s linear infinite;
    z-index: 9999;
    pointer-events: none;
}
@keyframes admin-mode-shimmer {
    from { background-position: 0 0; }
    to   { background-position: 200% 0; }
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: sticky; top: 0; max-height: none; z-index: 10; }
}

/* === Admin Full-Width Layout (neue Variante ohne Seiten-Sidebar) === */
.admin-shell.admin-full { display: flex; flex-direction: column; }
.admin-main.admin-main-full {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 26px 32px;
}
@media (max-width: 700px) { .admin-main.admin-main-full { padding: 16px; } }

/* Admin-Topbar */
.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 22px;
    background: var(--ad-bg-2);
    border-bottom: 1px solid var(--ad-border);
    position: sticky; top: 0; z-index: 80;
    backdrop-filter: blur(12px);
}
.admin-topbar-left { flex-shrink: 0; }
.admin-topbar .admin-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--ad-text);
}
.admin-topbar .admin-logo-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    font-size: 1rem;
}

.admin-topbar-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.admin-topbar-nav::-webkit-scrollbar { display: none; }
.admin-topbar-nav > a, .admin-more > summary {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ad-text-2);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    transition: background 0.12s, color 0.12s;
}
.admin-topbar-nav > a:hover, .admin-more > summary:hover {
    background: var(--ad-surface);
    color: var(--ad-text);
}
.admin-topbar-nav > a.is-active, .admin-more[open] > summary {
    background: var(--ad-primary-glow);
    color: #fff;
    font-weight: 600;
}
.admin-topbar-nav > a.is-active i.bi,
.admin-more[open] > summary i.bi { color: var(--ad-primary); }
.admin-more > summary::-webkit-details-marker { display: none; }
.admin-more > summary i.bi:first-child { color: var(--ad-muted); }

.admin-topbar-right {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 10px;
}
.admin-user {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    font-size: 0.82rem;
    color: var(--ad-text);
}
.admin-user .avatar-sm { width: 26px; height: 26px; font-size: 0.74rem; }

/* Admin "Mehr"-Dropdown */
.admin-more { position: relative; }
.admin-more-menu {
    position: absolute;
    top: calc(100% + 6px); right: 0;
    z-index: 100;
    width: 460px; max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.5);
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.admin-more-section {
    padding: 6px;
}
.admin-more-heading {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--ad-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 6px 10px 4px;
}
.admin-more-section a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--ad-text-2);
    text-decoration: none;
    font-size: 0.82rem;
}
.admin-more-section a:hover { background: var(--ad-surface-2); color: var(--ad-text); }
.admin-more-section a.is-active {
    background: var(--ad-primary-glow);
    color: var(--ad-primary-2);
    font-weight: 600;
}
.admin-more-section a i.bi { color: var(--ad-muted); font-size: 0.95rem; width: 18px; text-align: center; }

@media (max-width: 600px) {
    .admin-topbar { flex-wrap: wrap; padding: 8px 12px; gap: 10px; }
    .admin-topbar-nav { order: 3; width: 100%; }
    .admin-user span:last-child { display: none; }
    .admin-more-menu { width: calc(100vw - 24px); grid-template-columns: 1fr; }
}

/* === Sidebar-Admin-Link (im normalen App-Sidebar) ===
 * Indigo/Violett wie der Rest — Unterscheidungs-Marker ist der rote Admin-Punkt. */
.sidebar-admin-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    margin: 4px 0;
    border-radius: 10px;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.2),
        rgba(139, 92, 246, 0.2));
    color: var(--text-sidebar);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.15s;
    position: relative;
}
/* Roter Admin-Dot im Link */
.sidebar-admin-link::before {
    content: '';
    position: absolute;
    top: 8px; right: 10px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #e11d48;
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.25);
    animation: admin-pulse 2s ease-in-out infinite;
}
.sidebar-admin-link:hover, .sidebar-admin-link.is-active {
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--primary-glow);
    transform: translateX(2px);
}
.sidebar-admin-link i.bi:first-child {
    font-size: 1.1rem;
    color: inherit;
}

.admin-sidebar {
    background: var(--bg-card-solid);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0;
    max-height: 100vh; overflow-y: auto;
}
[data-theme="dark"] .admin-sidebar {
    background: color-mix(in srgb, var(--bg-sidebar) 90%, var(--bg-card-solid));
}
.admin-sidebar-head {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--ad-border);
    background: linear-gradient(180deg, rgba(225, 29, 72, 0.05), transparent);
    display: flex; flex-direction: column; gap: 8px;
}
.admin-badge-label {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    background: color-mix(in srgb, var(--ad-accent) 12%, transparent);
    color: var(--ad-accent);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ad-accent) 30%, transparent);
    align-self: flex-start;
}
.admin-badge-label::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ad-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ad-accent) 20%, transparent);
    animation: admin-pulse 2s ease-in-out infinite;
}
@keyframes admin-pulse {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ad-accent) 20%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ad-accent) 0%, transparent); }
}
.admin-badge-label i.bi { display: none; }
.admin-logo {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--text);
}
.admin-logo-icon {
    width: 40px; height: 40px;
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: #fff; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    position: relative;
    box-shadow: 0 6px 20px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
/* Kleiner roter Punkt oben rechts am Logo-Icon = Admin-Mode */
.admin-logo-icon::after {
    content: '';
    position: absolute;
    top: -2px; right: -2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--ad-accent, #e11d48);
    border: 2px solid var(--bg-card-solid);
    box-shadow: 0 0 0 1px var(--ad-accent-light);
}
.admin-logo-label { display: flex; flex-direction: column; line-height: 1.15; }
.admin-logo-label strong { font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: -0.01em; }
.admin-logo-label small { color: var(--text-light); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-top: 2px; }

.admin-side-nav { flex: 1; padding: 10px 8px; }
.admin-side-section { margin-bottom: 18px; }
.admin-side-heading {
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-light);
    padding: 8px 12px 6px;
}
.admin-side-section ul { list-style: none; padding: 0; margin: 0; }
.admin-side-section li + li { margin-top: 1px; }
.admin-side-section a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    transition: background 0.1s, color 0.1s;
    position: relative;
}
.admin-side-section a:hover {
    background: var(--bg-card);
    color: var(--text);
}
.admin-side-section a.is-active {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}
.admin-side-section a.is-active::before {
    content: ''; position: absolute;
    left: 0; top: 8px; bottom: 8px; width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.admin-side-section a.is-active i.bi { color: var(--primary); }
.admin-side-section i.bi {
    color: var(--text-light);
    font-size: 1rem;
    width: 18px; text-align: center;
    transition: color 0.1s;
}
.admin-side-section a:hover i.bi { color: var(--primary); }
.admin-sidebar-foot {
    padding: 14px;
    border-top: 1px solid var(--border);
}
.admin-user-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 8px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
}
.admin-user-row .avatar-sm {
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    box-shadow: 0 0 0 2px var(--bg-card-solid);
    width: 32px; height: 32px;
    color: #fff;
    font-weight: 600;
}
.admin-sidebar-foot .btn {
    background: var(--bg-card-solid);
    color: var(--text-light);
    border: 1px solid var(--border);
}
.admin-sidebar-foot .btn:hover {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--primary);
}
.admin-sidebar-foot .theme-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.admin-sidebar-foot .theme-row > button {
    flex: 1;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    transition: all 0.12s;
}
.admin-sidebar-foot .theme-row > button:hover { background: var(--bg-card); color: var(--text); }
.admin-sidebar-foot .theme-row > button.is-active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.admin-main {
    padding: 30px 40px;
    max-width: 1400px;
    width: 100%;
}
@media (max-width: 700px) { .admin-main { padding: 18px; } }

/* Admin erbt das globale Theme — nur vereinzelte Overrides.
   Cards/Forms/Buttons/Tables nutzen die User-Styles (Indigo/Violett). */
.admin-shell .card {
    border-radius: 12px;
}

/* Admin-Page-Header */
.admin-page-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.admin-page-header .crumbs {
    display: flex; gap: 6px;
    font-size: 0.75rem; color: var(--text-light);
}
.admin-page-header .crumbs a { color: var(--text-light); text-decoration: none; }
.admin-page-header .crumbs a:hover { color: var(--primary); }
.admin-page-header .crumbs .sep { opacity: 0.5; }
.admin-page-header .crumbs strong { color: var(--text); font-weight: 600; }
.admin-page-header .hdr-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 2px;
}
.admin-page-header h1 {
    margin: 0; font-size: 1.7rem; font-weight: 700; flex: 1;
    display: flex; align-items: center; gap: 12px;
    letter-spacing: -0.02em;
}
.admin-page-header h1 > i.bi {
    color: var(--primary);
    font-size: 1.5rem;
    padding: 8px;
    background: var(--primary-glow);
    border-radius: 10px;
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
}
.admin-page-header .subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 6px;
    max-width: 720px;
}
.admin-page-header .actions {
    display: flex; gap: 8px; flex-wrap: wrap;
}

/* Stat-Kacheln — moderner Control-Panel-Stil */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.admin-shell .admin-stat {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}
.admin-shell .admin-stat::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at top right, var(--primary-glow), transparent 60%);
    opacity: 0; transition: opacity 0.18s;
    pointer-events: none;
}
.admin-shell .admin-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.admin-shell .admin-stat:hover::before { opacity: 1; }
.admin-shell .admin-stat .s-label {
    color: var(--text-light);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
    position: relative;
}
.admin-shell .admin-stat .s-value {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.02em;
    position: relative;
}
.admin-shell .admin-stat .s-delta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 6px;
    position: relative;
}
.admin-shell .admin-stat .s-delta.pos { color: var(--success); }
.admin-shell .admin-stat .s-delta.neg { color: var(--danger); }
.admin-shell .admin-stat .s-icon {
    position: absolute; right: 18px; top: 18px;
    font-size: 1.8rem;
    opacity: 0.15;
    color: var(--primary);
    transition: opacity 0.15s;
}
.admin-shell .admin-stat:hover .s-icon { opacity: 0.35; }

/* Impersonation-Banner — full-width */
.admin-shell .impersonation-banner { border-radius: 0; margin: 0 !important; }

/* Titles / Headings */
.admin-shell h1, .admin-shell h2, .admin-shell h3, .admin-shell h4 { color: #fff; }
.admin-shell .small, .admin-shell small { color: var(--ad-muted); }
.admin-shell .text-soft { color: var(--ad-muted); }

/* Responsive: Sidebar wird auf Mobile zum Top-Bar */
@media (max-width: 900px) {
    .admin-sidebar {
        position: static;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--ad-border);
    }
    .admin-sidebar-head { text-align: center; }
    .admin-side-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
    .admin-side-section { flex: 1 0 180px; margin-bottom: 0; }
}

/* Admin-Table-Toolbar */
.admin-toolbar {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.admin-toolbar .search {
    flex: 1; min-width: 220px;
    max-width: 420px;
}
.admin-shell .admin-toolbar input[type="search"] {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: var(--ad-bg-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7590'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/></svg>") no-repeat 12px center/15px;
    border: 1px solid var(--ad-border);
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--ad-text);
}
.admin-shell .admin-toolbar input[type="search"]::placeholder { color: var(--ad-muted); }

/* Merge-Strategie-Dropdown (MR-Show-Toolbar) */
.merge-dropdown > summary { list-style: none; cursor: pointer; }
.merge-dropdown > summary::-webkit-details-marker { display: none; }
.merge-dropdown > .merge-form {
    position: absolute;
    top: calc(100% + 6px); right: 0;
    z-index: 60;
    width: 340px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px;
}
.merge-option {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}
.merge-option:hover { background: var(--bg-muted); }
.merge-option input[type="radio"] { margin-top: 3px; }
.merge-option span { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.merge-option strong { font-size: 0.88rem; font-weight: 600; }
.merge-option small { color: var(--muted); font-size: 0.74rem; line-height: 1.35; }

/* Impersonation-Warn-Banner (ganzer Vhost sichtbar bei aktiver Admin-Impersonation) */
.impersonation-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #f59e0b 0%, #dc2626 100%);
    color: #fff;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.impersonation-banner .btn { background: rgba(255,255,255,0.22); color: #fff; border-color: rgba(255,255,255,0.4); }
.impersonation-banner .btn:hover { background: rgba(255,255,255,0.32); }

/* Watch-Dropdown auf Mobile — Popover füllt Breite, zentriert unter Button. */
@media (max-width: 480px) {
    .gh-watch-menu-body {
        position: fixed;
        top: auto; right: 8px; left: 8px;
        min-width: auto;
        width: auto;
    }
}

/* Last-Commit-Banner über der File-List */
.gh-last-commit {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.gh-last-commit strong { font-weight: 600; }
.gh-last-commit .gh-last-commit-subject {
    color: var(--text); flex: 1; min-width: 0;
    max-width: 50%;
}
.gh-last-commit .gh-last-commit-subject:hover { color: var(--primary); text-decoration: underline; }
.gh-last-commit .gh-sha {
    color: var(--primary); font-weight: 600;
    padding: 2px 6px; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: 3px;
}
.gh-last-commit .gh-sha:hover { background: rgba(99,102,241,0.08); text-decoration: none; }

/* Blob-Layout: 3 Spalten (Files | Content | Symbols) wie GitHub */
.blob-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 260px;
    gap: 1rem;
    align-items: start;
}
.blob-layout:not(:has(.blob-symbols-sidebar)) {
    grid-template-columns: 260px minmax(0, 1fr);
}
.blob-layout:has(.blob-files-sidebar.is-collapsed) {
    grid-template-columns: 44px minmax(0, 1fr) 260px;
}
.blob-layout:has(.blob-files-sidebar.is-collapsed):not(:has(.blob-symbols-sidebar:not(.is-collapsed))) {
    grid-template-columns: 44px minmax(0, 1fr);
}
.blob-layout:has(.blob-symbols-sidebar.is-collapsed) {
    grid-template-columns: 260px minmax(0, 1fr);
}
.blob-main { min-width: 0; }
@media (max-width: 1200px) {
    .blob-layout { grid-template-columns: 1fr; }
    .blob-layout:has(.blob-files-sidebar.is-collapsed) { grid-template-columns: 1fr; }
    .blob-files-sidebar, .blob-symbols-sidebar { position: static; max-height: 280px; }
}

/* Files-Sidebar */
.blob-files-sidebar, .blob-symbols-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: sticky; top: 1rem;
    max-height: calc(100vh - 120px);
    display: flex; flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.blob-files-sidebar.is-collapsed { overflow: hidden; }
.blob-files-sidebar.is-collapsed .blob-sb-body { display: none; }
.blob-files-sidebar.is-collapsed { padding: 6px; }
.blob-symbols-sidebar.is-collapsed { display: none; }

.blob-sb-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    flex-shrink: 0;
}
.blob-files-sidebar.is-collapsed .blob-sb-head {
    border-bottom: 0; padding: 4px;
}
.blob-files-sidebar.is-collapsed .blob-sb-head strong { display: none; }
.blob-sb-toggle {
    background: transparent; border: 0; padding: 4px;
    color: var(--text-light); cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
    font-size: 15px;
}
.blob-sb-toggle:hover { background: var(--bg-card-solid); color: var(--primary); }
.blob-sb-body {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}
.blob-sb-branch {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-light);
}
.blob-sb-branch .bi { color: var(--primary); }
.blob-sb-search {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.blob-sb-search .bi { color: var(--text-light); flex-shrink: 0; }
.blob-sb-search input {
    flex: 1; border: 0; outline: 0; padding: 0;
    background: transparent; font-size: 0.82rem; color: var(--text);
    min-height: 0;
}
.blob-sb-parent {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px;
    color: var(--text-light);
    font-size: 0.82rem;
    border-radius: var(--radius-xs);
    text-decoration: none;
}
.blob-sb-parent:hover { background: var(--bg-card-solid); color: var(--primary); text-decoration: none; }
.blob-sb-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.blob-sb-list li { margin: 0; }
.blob-sb-list a {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px;
    color: var(--text); font-size: 0.85rem;
    text-decoration: none; border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
}
.blob-sb-list a:hover { background: var(--bg-card-solid); text-decoration: none; }
.blob-sb-list a .bi { font-size: 14px; flex-shrink: 0; }
.blob-sb-list li.is-active a {
    background: rgba(99,102,241,0.12);
    color: var(--primary); font-weight: 600;
}

/* Symbols-Sidebar */
.blob-symbols-sidebar .blob-sym-hint {
    padding: 0 12px; margin: 0 0 4px;
}
.blob-symbols-sidebar .blob-sb-search { margin: 0 10px; }
.blob-sym-list {
    list-style: none; margin: 8px 0 0; padding: 0 6px 10px;
    display: flex; flex-direction: column; gap: 1px;
    overflow-y: auto;
    flex: 1;
}
.blob-sym-list li { margin: 0; }
.blob-sym-list a {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px;
    color: var(--text); font-size: 0.85rem;
    text-decoration: none; border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    font-family: var(--w-font-mono);
}
.blob-sym-list a:hover { background: var(--bg-card-solid); text-decoration: none; color: var(--primary); }
.sym-kind {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; padding: 1px 5px;
    background: var(--bg-card-solid);
    color: var(--text-light);
    border-radius: var(--radius-xs);
    font-size: 0.7rem; font-weight: 600;
    text-transform: lowercase;
    font-family: var(--w-font-sans);
    flex-shrink: 0;
}
.sym-kind-func   { color: #8b5cf6; background: rgba(139,92,246,0.1); }
.sym-kind-class, .sym-kind-type, .sym-kind-struct { color: var(--info); background: var(--info-bg); }
.sym-kind-iface  { color: var(--warning); background: var(--warning-bg); }
.sym-kind-h1, .sym-kind-h2, .sym-kind-h3, .sym-kind-h4, .sym-kind-h5, .sym-kind-h6 { color: var(--primary); background: rgba(99,102,241,0.1); }
.sym-name { flex: 1; min-width: 0; }

/* Line-Highlight nach Symbol-Click */
.ln a.is-hl {
    background: rgba(245,158,11,0.25);
    color: var(--warning);
    font-weight: 700;
    border-radius: 2px;
}

/* File-Breadcrumb (Blob-Header) — GitHub-Style */
.gh-file-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 0 14px;
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 500;
    flex-wrap: wrap;
}
.gh-file-breadcrumb a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}
.gh-file-breadcrumb a:hover { text-decoration: underline; }
.gh-file-breadcrumb .sep {
    color: var(--text-light); opacity: 0.6; font-weight: 300;
}
.gh-file-breadcrumb strong {
    color: var(--text); font-weight: 650;
}
.gh-file-copy {
    background: transparent; border: 0; padding: 4px 6px;
    color: var(--text-light); cursor: pointer;
    border-radius: var(--radius-xs); margin-left: 4px;
    transition: all var(--transition-fast); font-size: 14px;
}
.gh-file-copy:hover { background: var(--bg-card); color: var(--primary); }

/* File-Header mit Code|Blame Tabs + Stats + Button-Group */
.gh-file-header {
    display: flex; align-items: stretch; gap: 12px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    flex-wrap: wrap;
}
.gh-file-header-left {
    display: flex; align-items: center; gap: 16px;
    flex: 1; min-width: 0;
}
.gh-file-tabs {
    display: inline-flex; align-items: stretch; gap: 0;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.gh-file-tabs a {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px;
    border-left: 1px solid var(--border);
    color: var(--text); font-size: 0.85rem; font-weight: 550;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.gh-file-tabs a:first-child { border-left: 0; }
.gh-file-tabs a:hover { background: var(--bg-card); color: var(--primary); text-decoration: none; }
.gh-file-tabs a.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.gh-file-tabs a.is-active:hover { color: #fff; background: var(--primary); }
.gh-file-tabs a i { font-size: 12px; }

.gh-file-stats {
    color: var(--text-light); font-size: 0.82rem;
    display: inline-flex; align-items: center; gap: 5px;
}
.gh-file-stats strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.gh-file-stats-sep { opacity: 0.5; }
.gh-file-stats .muted { font-variant-numeric: tabular-nums; }

.gh-file-btn-group {
    display: inline-flex; align-items: stretch; gap: 0;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.gh-file-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px;
    background: transparent; border: 0;
    border-left: 1px solid var(--border);
    color: var(--text); font-size: 0.82rem; font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none; font-family: inherit;
}
.gh-file-btn:first-child { border-left: 0; }
.gh-file-btn:hover { background: var(--bg-card); color: var(--primary); text-decoration: none; }
.gh-file-btn i { font-size: 13px; }
.gh-file-btn-danger:hover { color: var(--danger); background: var(--danger-bg); }
.gh-file-btn-edit { color: var(--primary); }
@media (max-width: 720px) {
    .gh-file-header { flex-direction: column; align-items: stretch; }
    .gh-file-btn-group { justify-content: flex-end; }
}

/* Code-Block darunter ohne oberen Border (verschmilzt mit File-Header) */
.gh-file-header + .code-block {
    border-top: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-top: 0;
}

/* File-List (GitHub-Style Rows) */
.gh-filelist {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.gh-filerow {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(200px, 2fr) 120px;
    align-items: center; gap: 12px;
    padding: 8px 16px;
    color: var(--text); text-decoration: none;
    border-top: 1px solid var(--border);
    transition: background var(--transition-fast);
    font-size: 0.85rem;
}
.gh-filelist > .gh-filerow:first-child { border-top: 0; }
.gh-filerow:hover {
    background: color-mix(in srgb, var(--primary) 4%, var(--bg-card-solid));
    text-decoration: none; color: var(--text);
}
.gh-filerow:hover .gh-filerow-name { color: var(--primary); }
.gh-filerow-name {
    display: inline-flex; align-items: center; gap: 8px;
    min-width: 0; font-weight: 500;
}
.gh-filerow-name > .bi { font-size: 16px; flex-shrink: 0; }
.gh-filerow-commit {
    color: var(--text-light); font-size: 0.82rem;
    min-width: 0;
}
.gh-filerow-date {
    color: var(--text-light); font-size: 0.78rem;
    text-align: right; font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .gh-filerow { grid-template-columns: 1fr auto; }
    .gh-filerow-commit { display: none; }
}

/* README-Panel */
.gh-readme {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.gh-readme-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.gh-readme-head .bi { color: var(--text-light); }

/* About-Sidebar */
.gh-about {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}
.gh-about:last-child { border-bottom: 0; padding-bottom: 0; }
.gh-about-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; font-weight: 650;
    margin: 0 0 10px; color: var(--text);
    letter-spacing: -0.005em;
}
.gh-about-head .gh-about-link-all {
    margin-left: auto; font-size: 0.78rem;
    color: var(--primary); font-weight: 500;
}
.gh-about-desc {
    font-size: 0.88rem; line-height: 1.5;
    color: var(--text); margin: 0 0 10px;
}
.gh-about-link {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; color: var(--primary);
    margin-bottom: 10px;
}
.gh-about-link a { color: inherit; }
.gh-about-stats {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 6px;
    font-size: 0.82rem; color: var(--text-light);
}
.gh-about-stats li {
    display: flex; align-items: center; gap: 6px;
}
.gh-about-stats li .bi { color: var(--text-light); width: 14px; }
.gh-about-stats li a { color: var(--text); font-weight: 500; }

.gh-release-latest {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.gh-release-latest .badge { align-self: flex-start; }

.gh-contribs {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.gh-contribs .avatar { width: 28px; height: 28px; font-size: 0.72rem; }

/* Sidebar als Card */
.gh-sidebar {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ==========================================================================
   Repo-Overview — Hosting-CTA + Quick-Actions
   ========================================================================== */

.host-activate {
    margin: 1rem 0 1.5rem;
    padding: 1.5rem;
    border: 1.5px dashed var(--primary);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.04));
    display: flex; flex-direction: column; gap: 1.25rem;
}
.host-activate-head {
    display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.host-activate-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.host-activate-head h3 {
    margin: 0 0 4px; font-size: 1.05rem; font-weight: 700;
    letter-spacing: -0.01em;
}
.host-activate-head p { margin: 0; max-width: 68ch; }

.host-activate-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 10px;
}
.host-activate-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.host-activate-option:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.host-activate-option > i {
    font-size: 22px; color: var(--primary); flex-shrink: 0;
    margin-top: 1px;
}
.host-activate-option strong { display: block; font-size: 0.88rem; margin-bottom: 3px; color: var(--text); }

/* Klickbare Host-Varianten (V2) */
.host-variants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 14px;
}
.host-variant { margin: 0; display: flex; }
.host-variant-btn {
    flex: 1;
    display: flex; flex-direction: column; gap: 8px;
    padding: 18px 20px;
    background: var(--bg-card-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}
.host-variant-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-solid);
    color: var(--text);
}
.host-variant-btn:active:not(:disabled) { transform: translateY(-1px); }
.host-variant-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.host-variant-btn::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}
.host-variant-btn:hover:not(:disabled)::before { opacity: 1; }

.host-variant-icon {
    font-size: 28px;
    color: var(--primary);
    width: 48px; height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}
.host-variant-btn:hover:not(:disabled) .host-variant-icon {
    background: var(--gradient-primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.host-variant-title {
    display: block;
    font-size: 1rem; font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text);
}
.host-variant-desc {
    display: block;
    font-size: 0.82rem; line-height: 1.5;
    color: var(--text-light);
    flex: 1;
}
.host-variant-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    margin-top: 6px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600;
    align-self: flex-start;
    transition: all var(--transition-fast);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .host-variant-cta { background: rgba(99,102,241,0.12); }
}
.host-variant-btn:hover:not(:disabled) .host-variant-cta {
    background: var(--gradient-primary);
    color: #fff;
}

/* Primary-Variante (Upload — visuell stärker) */
.host-variant-btn.host-variant-primary {
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.03));
    border-color: var(--primary-light);
}
.host-variant-btn.host-variant-primary::before { opacity: 0.6; }
.host-variant-btn.host-variant-primary .host-variant-icon {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* Quick-Actions (Hosted Repo) */
.repo-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 10px;
    margin-bottom: 1.25rem;
}
.repo-action {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}
.repo-action::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--primary); opacity: 0;
    transition: opacity var(--transition-fast);
}
.repo-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    text-decoration: none;
    color: var(--text);
}
.repo-action:hover::before { opacity: 1; }
.repo-action > i {
    font-size: 24px; color: var(--primary); flex-shrink: 0;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: rgba(99,102,241,0.1);
    display: inline-flex; align-items: center; justify-content: center;
}
.repo-action > div { flex: 1; min-width: 0; }
.repo-action strong { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.repo-action span { display: block; color: var(--text-light); font-size: 0.78rem; line-height: 1.4; }
.repo-action-primary {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.06));
    border-color: var(--primary-light);
}
.repo-action-primary::before { opacity: 1; background: var(--gradient-primary); }
.repo-action-primary > i {
    background: var(--gradient-primary); color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

/* ==========================================================================
   Repo-Index — Card-Grid + Filter-Bar
   ========================================================================== */

.repo-filter-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.repo-filter-search {
    flex: 1; min-width: 220px;
    display: flex; align-items: center; gap: 8px;
    padding: 0.5rem 0.85rem;
    background: var(--bg-card-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.repo-filter-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.repo-filter-search .bi-search { color: var(--text-light); flex-shrink: 0; }
.repo-filter-search input {
    flex: 1; border: 0; outline: 0; padding: 0;
    background: transparent; font-size: 0.9rem; color: var(--text); min-height: 0;
}
.repo-filter-search .clear-q {
    color: var(--text-light); padding: 2px; border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}
.repo-filter-search .clear-q:hover { background: var(--bg-card); color: var(--danger); }

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1rem;
}

.repo-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 1.15rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}
.repo-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}
.repo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    text-decoration: none;
    color: var(--text);
}
.repo-card:hover::before { opacity: 1; }
.repo-card:hover .repo-card-title { color: var(--primary); }

.repo-card-head {
    display: flex; align-items: flex-start; gap: 10px;
}
.repo-card-icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    flex-shrink: 0; font-size: 18px;
}
.repo-card-title {
    font-size: 1rem; font-weight: 650;
    letter-spacing: -0.01em; color: var(--text);
    line-height: 1.3; margin-bottom: 2px;
    transition: color var(--transition-fast);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.repo-card-slug {
    font-size: 0.75rem; color: var(--text-light);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.repo-card-desc {
    font-size: 0.85rem; color: var(--text-light);
    line-height: 1.5; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.repo-card-foot {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center; padding-top: 6px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem; color: var(--text-light);
}
.repo-stat {
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 500;
}
.repo-stat i { font-size: 0.8rem; opacity: 0.75; }
.repo-stat.repo-stat-owner { margin-left: auto; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-stat.repo-stat-ago { color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .repo-filter-bar { flex-direction: column; align-items: stretch; }
    .repo-filter-search { min-width: 0; }
    .repo-grid { grid-template-columns: 1fr; }
    .repo-card-foot .repo-stat-owner { margin-left: 0; }
}

/* ---- Interactive-Card (Repos, Stacks, Teams) --------------------------- */
.card-interactive, .card.card-interactive {
    display: block;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.card-interactive::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}
.card-interactive:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    text-decoration: none;
}
.card-interactive:hover::before { opacity: 1; }
.card-interactive:hover .card-title { color: var(--primary); }
.card-interactive:active { transform: translateY(-1px); }

/* ---- Bulk-Action-Bar (sticky oben bei Mehrfachauswahl) ------------------ */
[data-bulk-bar] {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08)) !important;
    border: 1.5px solid var(--primary) !important;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px 14px !important;
    animation: slideInDown 0.25s ease;
}
[data-bulk-bar] strong { color: var(--primary); }
[data-bulk-bar] [data-bulk-count] {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 8px;
    background: var(--primary); color: #fff;
    border-radius: 999px; font-size: 0.75rem;
    margin-right: 6px; font-variant-numeric: tabular-nums;
}

/* ---- Filter-Button-Group (Tasks, Issues, MRs) -------------------------- */
.toolbar .btn.btn-sm.btn-primary {
    box-shadow: 0 2px 6px rgba(99,102,241,0.25);
}

/* ---- Saved-Filters-Pills ----------------------------------------------- */
.saved-filters {
    display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
    padding: 6px 0; margin-bottom: 12px;
}

/* ---- Checkboxes in Listen (Bulk-Select) -------------------------------- */
.table input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0;
}

/* ---- Divider ----------------------------------------------------------- */
.divider {
    height: 1px; background: var(--border); margin: 1rem 0;
    border: 0;
}
.divider.vertical { width: 1px; height: auto; align-self: stretch; margin: 0 0.5rem; }

/* ---- Code-Block (Snippets/Blob) ----------------------------------------- */
.code-block {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; background: var(--bg-card-solid); margin: 0.75rem 0;
}
.code-head {
    display: flex; align-items: center; gap: 8px;
    padding: 0.5rem 0.85rem; background: var(--bg-card);
    border-bottom: 1px solid var(--border); font-size: 0.78rem;
    color: var(--text-light); font-family: var(--w-font-mono);
}
.code-head .lang { color: var(--primary); font-weight: 600; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.05em; }
.code-body {
    display: flex; font-family: var(--w-font-mono);
    font-size: 0.85rem; line-height: 1.6; overflow-x: auto;
    align-items: flex-start;
}
.code-body .ln {
    user-select: none;
    padding: 0.5rem 0;
    text-align: right; background: var(--bg-card);
    border-right: 1px solid var(--border);
    min-width: 3.5em;
    font-variant-numeric: tabular-nums;
    display: flex; flex-direction: column;
    position: sticky; left: 0; z-index: 1;
}
.code-body .ln a {
    display: block;
    padding: 0 12px;
    color: var(--text-light); opacity: 0.55;
    text-decoration: none;
    line-height: 1.6;
    transition: all var(--transition-fast);
    font-size: 0.78rem;
    cursor: pointer;
}
.code-body .ln a:hover {
    opacity: 1; color: var(--primary);
    background: rgba(99,102,241,0.08);
    text-decoration: none;
}
.code-body .ln a:target,
.code-body .ln a.is-hl {
    opacity: 1;
    color: var(--warning);
    background: rgba(245,158,11,0.18);
    font-weight: 700;
    border-left: 2px solid var(--warning);
    padding-left: 10px;
}
.code-body .code {
    padding: 0.5rem 0.85rem; flex: 1; white-space: pre;
    color: var(--text);
    line-height: 1.6;
    tab-size: 4;
}
.code-body .code code {
    line-height: 1.6;
    background: transparent;
    padding: 0; border: 0;
    display: block;
}
.code-body pre { background: none; border: 0; padding: 0; margin: 0; }

/* ---- Diff-Viewer -------------------------------------------------------- */
.diff { font-family: var(--w-font-mono); font-size: 0.82rem; line-height: 1.5; }
.diff .add { background: rgba(34,197,94,0.1); color: var(--success); }
.diff .del { background: rgba(239,68,68,0.1); color: var(--danger); }
.diff .hunk { color: var(--text-light); background: var(--bg-card); padding: 2px 6px; }

/* ---- Language-Stats (Repo) --------------------------------------------- */
.lang-bar {
    display: flex; height: 8px; border-radius: 999px; overflow: hidden;
    background: var(--border); margin: 0.75rem 0;
}
.lang-chip { height: 100%; transition: flex var(--transition); }
.lang-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.78rem; }
.lang-legend > span { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.lang-pct { color: var(--text-light); font-variant-numeric: tabular-nums; }

/* ---- Upload-Zone -------------------------------------------------------- */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 2.5rem 1.5rem; background: var(--bg-card);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    text-align: center; transition: all var(--transition);
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.is-hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(99,102,241,0.04); transform: scale(1.005); }
.upload-zone-inner { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; color: var(--text-light); }
.upload-zone-inner .bi { font-size: 36px; color: var(--primary); opacity: 0.7; }

/* ---- Repo-Path breadcrumbs + metas -------------------------------------- */
.path { font-family: var(--w-font-mono); color: var(--text-light); font-size: 0.85rem; }
.sep { color: var(--text-light); opacity: 0.5; margin: 0 2px; }
.size { font-variant-numeric: tabular-nums; color: var(--text-light); font-size: 0.78rem; }
.rm, .removed { color: var(--danger); }

/* ---- Dashboard-Hero + Admin-Extras -------------------------------------- */
.dashboard-hero {
    padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.08));
    border: 1px solid var(--border); position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.dashboard-hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at top right, rgba(139,92,246,0.18), transparent 60%);
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h1 {
    font-size: 1.5rem; font-weight: 750; margin: 0 0 4px; letter-spacing: -0.02em;
}
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 0.1rem 0.45rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
}
.delta.positive, .delta.up { color: var(--success); background: var(--success-bg); }
.delta.negative, .delta.down { color: var(--danger); background: var(--danger-bg); }

/* ---- Auth-Layout (wiki_neu: .auth-body + .auth-wrap) ------------------- */
body.auth-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--gradient-bg); padding: 1rem; position: relative; overflow-x: hidden;
}
body.auth-body::before {
    content: ''; position: absolute; top: -40%; left: -20%;
    width: 80%; height: 80%; pointer-events: none;
    background: radial-gradient(ellipse, rgba(99,102,241,0.12), transparent 70%);
}
body.auth-body::after {
    content: ''; position: absolute; bottom: -30%; right: -20%;
    width: 70%; height: 70%; pointer-events: none;
    background: radial-gradient(ellipse, rgba(139,92,246,0.1), transparent 70%);
}
.auth-wrap { width: 100%; display: flex; justify-content: center; align-items: center; position: relative; z-index: 1; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.brand-lg { font-size: 1.25rem; font-weight: 700; gap: 10px; }
.brand-lg .brand-mark { width: 42px; height: 42px; font-size: 20px; }
.auth-card .sub { text-align: center; color: var(--text-light); margin-bottom: 1.75rem; font-size: 0.92rem; }
.auth-card h1 {
    text-align: center; margin: 0 0 0.35rem; font-size: 1.7rem; font-weight: 750;
    background: linear-gradient(135deg, var(--primary), #a78bfa, #c084fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.88rem; color: var(--text-light); }
.auth-footer a { color: var(--primary); font-weight: 550; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 0.95rem; font-weight: 600; }

/* ---- Reduced Motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* === Repo-Wiki (überarbeitet) === */
.wiki-layout {
    display: grid;
    grid-template-columns: 260px minmax(0,1fr) 220px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .wiki-layout { grid-template-columns: 240px minmax(0,1fr); }
    .wiki-toc-sidebar { display: none; }
}
@media (max-width: 760px) {
    .wiki-layout { grid-template-columns: 1fr; }
}
.wiki-sidebar,
.wiki-toc-sidebar {
    position: sticky; top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
}
.wiki-sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 8px;
}
.wiki-sidebar-title {
    font-weight: 600; font-size: 0.85rem; color: var(--text);
    display: inline-flex; align-items: center; gap: 6px;
}
.wiki-count {
    background: var(--bg-muted); color: var(--muted);
    padding: 1px 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 500;
}
.wiki-filter { margin-bottom: 8px; font-size: 0.85rem; padding: 6px 10px; }
.wiki-nav { display: flex; flex-direction: column; gap: 2px; }

.wiki-dir { margin: 0; }
.wiki-dir > summary {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--text);
    border-radius: var(--radius-xs);
    list-style: none;
}
.wiki-dir > summary::-webkit-details-marker { display: none; }
.wiki-dir > summary::before {
    content: '▸'; font-size: 0.7rem; color: var(--muted); transition: transform 0.12s;
}
.wiki-dir[open] > summary::before { transform: rotate(90deg); }
.wiki-dir > summary:hover { background: var(--bg-muted); }
.wiki-dir-body { padding-left: 14px; border-left: 1px dashed var(--border); margin-left: 8px; }

.wiki-pages-list { list-style: none; margin: 0; padding: 0; }
.wiki-pages-list > li > a {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    color: var(--text);
    text-decoration: none;
    font-size: 0.82rem;
}
.wiki-pages-list > li > a:hover { background: var(--bg-muted); }
.wiki-pages-list > li > a.is-active {
    background: var(--primary-subtle, rgba(99,102,241,0.12));
    color: var(--primary, #4f46e5);
    font-weight: 550;
}
.wiki-pages-list > li > a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wiki-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; margin-bottom: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.86rem;
}
.wiki-breadcrumb-actions {
    margin-left: auto;
    display: inline-flex; gap: 6px;
}

.wiki-article { padding: 24px 32px; }
@media (max-width: 760px) { .wiki-article { padding: 18px; } }

.wiki-toc-title {
    font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--muted); margin-bottom: 8px;
    display: inline-flex; align-items: center; gap: 6px;
}
.wiki-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wiki-toc a {
    display: block; padding: 3px 6px;
    color: var(--muted); text-decoration: none;
    font-size: 0.8rem; line-height: 1.35;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.wiki-toc a:hover { color: var(--text); background: var(--bg-muted); }
.wiki-toc-l0 a { padding-left: 6px; font-weight: 550; color: var(--text); }
.wiki-toc-l1 a { padding-left: 16px; }
.wiki-toc-l2 a { padding-left: 26px; }

/* ============================================================
 * MODERN DESIGN REFRESH (polish-layer, low-risk)
 * Subtile Upgrades auf existierende Komponenten ohne Breaking-Changes.
 * ============================================================ */

/* Globale Scrollbar */
* { scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-light) 40%, transparent);
    border-radius: 10px;
    border: 2px solid var(--bg, #f8fafc);
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-light) 70%, transparent); }

/* Smooth anchors + besseres Text-Rendering */
html { scroll-behavior: smooth; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

/* Selection */
::selection { background: var(--primary-glow); color: var(--text); }

/* Body-Background subtile Layer */
body:not(.admin-shell):not(.auth-body) {
    background-image:
        radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 40%),
        radial-gradient(circle at 85% 90%, color-mix(in srgb, #8b5cf6 6%, transparent), transparent 40%);
    background-attachment: fixed;
}

/* Headline-Refresh */
h1, .h1 { letter-spacing: -0.025em; font-weight: 700; }
h2, .h2 { letter-spacing: -0.02em; font-weight: 650; }
h3, .h3 { letter-spacing: -0.015em; font-weight: 600; }

/* Card-Hover-Polish — subtile Lift-Animation nur wo .card-interactive */
.card.card-interactive {
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.18s ease, border-color 0.18s ease;
    will-change: transform;
}
.card.card-interactive:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: var(--shadow-lg);
}

/* Buttons — Focus-Ring + sanfterer Press-State */
button:focus-visible, .btn:focus-visible, a.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.btn { transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.08s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary {
    background: var(--gradient-primary, linear-gradient(180deg, var(--primary), var(--primary-dark)));
    color: #fff;
    border: 1px solid color-mix(in srgb, var(--primary) 60%, transparent);
    box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 14px color-mix(in srgb, var(--primary) 45%, transparent);
}

/* Links — Underline-on-Hover nur für „echte" Textlinks (nicht in Buttons/Nav) */
.prose a:not(.btn):not(.anchor), .card a:not(.btn):not(.row-link):not(.gh-counter-link) {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
    transition: text-decoration-color 0.15s;
}
.prose a:hover:not(.btn), .card a:hover:not(.btn):not(.row-link) {
    text-decoration-color: var(--primary);
}

/* Input-Focus-Ring konsistent */
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
    outline: none;
}
.field-input:focus, input.field-input:focus, select.field-input:focus, textarea.field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Code-Tags weicher */
:not(pre) > code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.88em;
    padding: 1px 6px;
    background: color-mix(in srgb, var(--primary) 8%, var(--bg-card-solid));
    color: color-mix(in srgb, var(--primary) 75%, var(--text));
    border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
    border-radius: 4px;
}

/* Tabellen — moderner Look, Zebra-light */
table.table tbody tr { transition: background 0.1s; }
table.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, var(--bg-card)); }
table.table thead th {
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

/* Badges — konsistente Padding/Radius */
.badge {
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

/* Sidebar-Navigation — Hovers mit Slide-Effekt */
.app-sidebar nav a, .sidebar-scroll a {
    transition: background 0.15s, color 0.15s, padding-left 0.12s;
}
.app-sidebar nav a:hover { padding-left: calc(var(--spacing-inline, 1rem) + 2px); }

/* Topbar-Search Polish */
.topbar-search {
    transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Flash — moderne Look mit Left-Accent statt nur Background */
.flash {
    position: relative;
    border-radius: var(--radius-sm);
    padding: 12px 16px 12px 20px;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(8px);
}
.flash::before {
    content: ''; position: absolute;
    left: 0; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--info);
}
.flash.success::before { background: var(--success); }
.flash.warning::before { background: var(--warning); }
.flash.danger::before  { background: var(--danger); }
.flash.info::before    { background: var(--info); }

/* Kbd-Tags moderner */
kbd, .kbd {
    display: inline-block;
    padding: 1px 6px;
    min-width: 20px;
    text-align: center;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* Avatar-Polish */
.avatar {
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: 999px;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-card-solid);
}

/* Dividers/Hrs subtiler */
hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* Empty-States konsistent */
/* .empty-state — konsolidiert oben bei ~Zeile 2594. */

/* Row-Link Polish — weichere Hover */
.row-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s;
}
.row-link:hover { background: var(--bg-muted, color-mix(in srgb, var(--primary) 5%, transparent)); }

/* Fokus-Outlines unsichtbar bei Maus, sichtbar bei Tastatur */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Tooltip-Grundlage (nativ title="" ergänzen — kleiner Aufpeppel) */
[title]:not(:disabled) { cursor: help; }
button[title], a[title], .btn[title] { cursor: inherit; }

/* Print-Support */
@media print {
    .app-sidebar, .app-topbar, .topbar-actions, .btn, form, .flash { display: none !important; }
    .app-main, .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    body { background: #fff !important; color: #000 !important; }
}

/* Reduce-Motion respektieren */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark-Mode Feintuning für User-Bereich */
[data-theme="dark"] body:not(.admin-shell):not(.auth-body) {
    background-image:
        radial-gradient(circle at 10% 0%, rgba(99,102,241,0.1), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(139,92,246,0.08), transparent 40%);
}
[data-theme="dark"] .card, [data-theme="dark"] .card-interactive {
    border-color: color-mix(in srgb, var(--border) 80%, transparent);
}
[data-theme="dark"] .flash {
    background: color-mix(in srgb, var(--bg-card-solid) 85%, transparent);
    border-color: color-mix(in srgb, var(--border) 100%, transparent);
}
[data-theme="dark"] .btn-primary {
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 2px 10px rgba(99,102,241,0.35);
}
[data-theme="dark"] :not(pre) > code {
    background: color-mix(in srgb, var(--primary) 15%, var(--bg-card-solid));
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}
[data-theme="dark"] kbd, [data-theme="dark"] .kbd {
    background: var(--bg-card-solid);
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb { border-color: var(--bg); }

/* ============================================================
 * Sidebar-Polish (Hauptnav)
 * ============================================================ */
.app-sidebar .sidebar-header .logo-icon {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.app-sidebar .sidebar-header:hover .logo-icon {
    transform: rotate(-6deg) scale(1.05);
}

/* Sidebar-Links — modernere Hover-Animation */
.app-sidebar nav a, .sidebar-scroll a {
    position: relative;
}
.app-sidebar nav a::before, .sidebar-scroll a::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 0;
    background: var(--primary-light, #818cf8);
    border-radius: 0 2px 2px 0;
    transition: height 0.15s;
}
.app-sidebar nav a.is-active::before, .sidebar-scroll a.is-active::before {
    height: 70%;
}

/* ============================================================
 * Topbar-Refinements
 * ============================================================ */
.app-topbar {
    /* Glass-Morph-Effekt stärker */
    background: color-mix(in srgb, var(--bg-card-solid) 70%, transparent);
}
.topbar-actions .btn-icon {
    transition: background 0.15s, transform 0.1s;
}
.topbar-actions .btn-icon:active { transform: scale(0.94); }

/* Notification-Badge mit Puls-Animation wenn neu */
.topbar-actions .notif-badge {
    position: relative;
}
.topbar-actions .notif-badge::after {
    content: ''; position: absolute;
    top: 6px; right: 6px; width: 8px; height: 8px;
    border-radius: 50%; background: #ef4444;
    box-shadow: 0 0 0 2px var(--bg-card-solid);
    animation: notif-pulse 2.5s ease-in-out infinite;
}
@keyframes notif-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.7; }
}

/* ============================================================
 * Markdown-Prose — saubererer Reader-Look
 * ============================================================ */
.prose {
    line-height: 1.65;
    font-size: 0.94rem;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    scroll-margin-top: 60px;
}
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.prose p { margin-bottom: 1em; }
.prose ul, .prose ol { margin-bottom: 1em; padding-left: 1.5em; }
.prose li { margin-bottom: 0.25em; }
.prose blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 3px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, transparent);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    color: var(--text-light);
    font-style: italic;
}
.prose pre {
    background: color-mix(in srgb, var(--text) 5%, var(--bg-card-solid));
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow-x: auto;
    margin: 1em 0;
    font-size: 0.85em;
    line-height: 1.5;
}
.prose pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
}
.prose a.anchor {
    color: var(--text-light);
    opacity: 0;
    margin-left: 0.3em;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.15s;
}
.prose h1:hover a.anchor, .prose h2:hover a.anchor,
.prose h3:hover a.anchor, .prose h4:hover a.anchor { opacity: 0.6; }
.prose a.anchor:hover { opacity: 1 !important; color: var(--primary); }

.prose table {
    width: 100%; border-collapse: collapse; margin: 1em 0;
    font-size: 0.9em;
}
.prose table th, .prose table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}
.prose table th { background: color-mix(in srgb, var(--primary) 8%, var(--bg-card)); font-weight: 600; }
.prose table tr:nth-child(even) { background: color-mix(in srgb, var(--text-light) 3%, transparent); }

/* Task-List-Items im Markdown */
.prose input[type="checkbox"] {
    margin-right: 6px;
    transform: translateY(1px);
}
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.2em; }

/* ============================================================
 * Drop-Shadows & Glow-Akzente auf wichtigen Elementen
 * ============================================================ */
.btn-primary, .btn-success, .btn-danger, .btn-warning {
    position: relative;
    overflow: hidden;
}
.btn-primary::before, .btn-success::before, .btn-danger::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 40%);
    pointer-events: none;
    border-radius: inherit;
}

/* Page-Header-Vereinheitlichung quer durch die App */
.page-header {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.page-header h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
}
.page-header .meta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    color: var(--text-light); font-size: 0.85rem; margin-top: 4px;
}
.page-header .spacer { flex: 1; }
.page-header .toolbar { display: flex; gap: 6px; flex-wrap: wrap; }

/* Dropdown-Panels (alle <details> basierten Menus) — sanfter Schatten */
details > .dropdown-menu,
details.gh-nav-dropdown > .gh-nav-dropdown-menu {
    box-shadow: var(--shadow-md);
}

/* Tabs-Row einheitlich */
.tabs-row {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.tabs-row > a, .tabs-row > button {
    padding: 8px 14px;
    border: 0; background: transparent;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.tabs-row > a:hover, .tabs-row > button:hover {
    color: var(--text);
    background: transparent;
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.tabs-row > a.is-active, .tabs-row > button.is-active,
.tabs-row > a.btn-primary, .tabs-row > button.btn-primary {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

/* ============================================================
 * Dashboard-Hero Refresh
 * ============================================================ */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 10%, var(--bg-card-solid)) 0%,
        color-mix(in srgb, #8b5cf6 8%, var(--bg-card-solid)) 50%,
        var(--bg-card-solid) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 22px;
    display: flex; align-items: center;
    gap: 14px; flex-wrap: wrap;
}
.dashboard-hero::before {
    content: ''; position: absolute;
    top: -30%; right: -10%; width: 260px; height: 260px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary) 30%, transparent), transparent 60%);
    pointer-events: none;
}
.dashboard-hero > div:first-child { flex: 1; min-width: 0; position: relative; }
.dashboard-hero h1 {
    margin: 0 0 4px;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}
.dashboard-hero .sub {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}
.dashboard-hero .actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    position: relative;
}

/* ============================================================
 * Dashboard-Stat-Cards — moderner Look
 * ============================================================ */
.grid.grid-4 .stat,
.grid.grid-3 .stat {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}
.grid.grid-4 .stat::before,
.grid.grid-3 .stat::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 85% 5%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 50%);
    opacity: 0; transition: opacity 0.18s;
    pointer-events: none;
}
.stat.card-interactive:hover::before { opacity: 1; }
.stat.card-interactive:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    box-shadow: var(--shadow-lg);
}
.stat-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.stat-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stat .value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.stat .delta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 6px;
}
.stat .delta.up    { color: var(--success); }
.stat .delta.down  { color: var(--danger); }

/* ============================================================
 * Widget-Cards konsistenter — mit Header-Divider-Style
 * ============================================================ */
.card > .card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.card > .card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    display: flex; align-items: center; gap: 8px;
}
.card > .card-header h3 > i.bi {
    color: var(--primary);
    font-size: 1rem;
}
.card > .card-header .card-actions {
    display: flex; gap: 6px;
}
.card > *:not(.card-header):not(header) { padding-left: 18px; padding-right: 18px; }
.card > *:last-child { padding-bottom: 16px; }
.card > .card-header + * { padding-top: 14px; }

/* ============================================================
 * Topbar — moderne Action-Items
 * ============================================================ */
.topbar-actions {
    display: flex; align-items: center; gap: 6px;
}
.btn-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent;
    border: 0;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    position: relative;
}
.btn-icon:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    color: var(--primary);
}

/* Avatar-Wrapper im Topbar */
.user-menu-trigger {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.user-menu-trigger:hover {
    background: var(--bg-card-solid);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.user-menu-trigger .avatar-sm {
    width: 28px; height: 28px;
    font-size: 0.78rem;
    box-shadow: none;
}

/* ============================================================
 * Input-Group-Polish (Search-Bar im Topbar)
 * ============================================================ */
.topbar-search {
    flex: 1; max-width: 420px; min-width: 200px;
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.87rem;
    cursor: text;
    transition: all 0.15s;
}
.topbar-search i.bi { color: var(--text-light); }
.topbar-search input[type="search"] {
    flex: 1; border: 0; background: transparent;
    color: inherit; font-size: inherit;
    outline: none; padding: 0;
}
.topbar-search kbd, .topbar-search .kbd {
    font-size: 0.68rem;
    padding: 1px 5px;
}

/* ============================================================
 * Issue/MR-Items in Listen — modernere Cards
 * ============================================================ */
.issue-row, .mr-row {
    display: flex; gap: 12px; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.issue-row:hover, .mr-row:hover { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.issue-row:last-child, .mr-row:last-child { border-bottom: 0; }
.issue-row .issue-icon, .mr-row .mr-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Status-Pills einheitlich */
.issue-status, .mr-status, .task-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.issue-status.open, .mr-status.open {
    background: color-mix(in srgb, #22c55e 15%, transparent);
    color: #16a34a;
}
.issue-status.closed, .mr-status.closed {
    background: color-mix(in srgb, var(--text-light) 12%, transparent);
    color: var(--text-light);
}
.mr-status.merged {
    background: color-mix(in srgb, #8b5cf6 15%, transparent);
    color: #7c3aed;
}

/* ============================================================
 * Modern Progress-Bars (Milestones, Task-Completion)
 * ============================================================ */
.progress-track {
    height: 8px;
    background: color-mix(in srgb, var(--text-light) 15%, transparent);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary, linear-gradient(90deg, var(--primary), #8b5cf6));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1) inset;
}
.progress-fill.complete {
    background: linear-gradient(90deg, var(--success), #10b981);
}

/* ============================================================
 * Filter-Pills (z.B. in Task-/Repo-Listings)
 * ============================================================ */
.filter-pills {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.filter-pills > a {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.12s;
}
.filter-pills > a:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.filter-pills > a.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================================
 * Timeline (Audit, Activity)
 * ============================================================ */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding: 8px 0 12px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px; top: 14px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--bg-card-solid), 0 0 0 4px var(--border);
}

/* ============================================================
 * Floating-Action-Button (mobile-friendly quick-add)
 * ============================================================ */
.fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: #fff;
    border: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    z-index: 90;
}
.fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 30px rgba(99,102,241,0.5);
}

/* ============================================================
 * Form-Groups konsistent
 * ============================================================ */
.field {
    margin-bottom: 14px;
}
.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.field-required {
    color: var(--danger);
    font-weight: 400;
}
.field-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin: 4px 0 0;
    line-height: 1.45;
}
.field.has-error .field-input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}
.field.has-error .field-hint {
    color: var(--danger);
}

.field-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.field-input {
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
}
select.field-input {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%23888'><path d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
    padding-right: 32px;
    appearance: none;
    -webkit-appearance: none;
}

/* ============================================================
 * Form-Actions (Buttons am Ende eines Forms)
 * ============================================================ */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.form-actions .btn:first-child:not(.btn-primary) { margin-right: auto; }


/* ==========================================================================
 * Dark-Mode Feinschliff
 * Zentrale Stelle für Dark-only-Tweaks, die nicht über die Variable-Map
 * abgedeckt sind. Ergänzt den überarbeiteten Dark-Palette-Block weiter oben.
 * ========================================================================== */
[data-theme="dark"] body {
    background: var(--bg);                  /* kein Gradient-Matsch mehr */
}
[data-theme="dark"] .app-sidebar {
    border-right: 1px solid var(--border);  /* klare Kante Sidebar ↔ Canvas */
}
[data-theme="dark"] .app-sidebar::before {
    /* Die radialen Akzent-Gradients im Light-Mode sind im Dunklen zu aggressiv */
    background:
        radial-gradient(ellipse at top left, rgba(99,102,241,0.08), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(139,92,246,0.05), transparent 60%);
}
[data-theme="dark"] tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.025);
}
[data-theme="dark"] tbody tr:hover {
    background: var(--w-hover-bg);
}
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-ghost {
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-ghost:hover {
    background: var(--w-hover-bg);
    border-color: var(--primary);
}
[data-theme="dark"] .field-hint {
    color: var(--w-text-soft);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--w-text-soft);
    opacity: 0.8;
}
[data-theme="dark"] pre,
[data-theme="dark"] .prose pre,
[data-theme="dark"] code {
    /* Code-Flächen leicht unterhalb Card-Niveau → klar als Mono-Bereich erkennbar */
    background: var(--w-code-bg);
    border-color: var(--w-border-soft);
}
[data-theme="dark"] .prose pre code {
    background: transparent;                /* nur das äußere <pre> hat Hintergrund */
}
[data-theme="dark"] kbd,
[data-theme="dark"] .kbd {
    background: var(--w-bg-muted);
    border-color: var(--w-border-soft);
    color: var(--text);
}
[data-theme="dark"] .badge:not([class*="badge-"]):not([style*="background"]) {
    background: var(--w-bg-muted);
    color: var(--text);
    border: 1px solid var(--w-border-soft);
}
/* Dropdowns, Popover, Command-Palette: solide Dark-Surface statt Transparent-Overlay */
[data-theme="dark"] .dropdown,
[data-theme="dark"] .notif-dropdown,
[data-theme="dark"] .cmd-palette,
[data-theme="dark"] .mention-pop,
[data-theme="dark"] .tooltip {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
/* Flash: weniger gesättigte Farbflächen + heller Text für bessere Lesbarkeit */
[data-theme="dark"] .flash {
    border-color: var(--border);
}
[data-theme="dark"] .flash.success { background: rgba(34,197,94,0.14);  border-color: rgba(34,197,94,0.35); }
[data-theme="dark"] .flash.danger  { background: rgba(239,68,68,0.14);  border-color: rgba(239,68,68,0.35); }
[data-theme="dark"] .flash.warning { background: rgba(245,158,11,0.14); border-color: rgba(245,158,11,0.35); }
[data-theme="dark"] .flash.info    { background: rgba(59,130,246,0.14); border-color: rgba(59,130,246,0.35); }

/* Admin-Shell: Indigo-Accent bleibt erhalten, aber Unterschied User↔Admin leserlich halten */
[data-theme="dark"] .admin-shell {
    background: var(--bg);
}

/* Avatare mit Text: Fallback-Hintergrund, damit ein Initial auch ohne explizite
   Farbe lesbar bleibt (vorher oft weiß auf weiß durch rgba-Bugs) */
[data-theme="dark"] .avatar {
    background: var(--w-bg-muted);
    color: var(--text);
}

/* Selektionsfarbe: Indigo transparent statt System-blau (system dunkler Modus wählt oft grell) */
[data-theme="dark"] ::selection {
    background: rgba(99, 102, 241, 0.40);
    color: #fff;
}

/* Scrollbar im Dunklen sichtbar halten ohne aufdringlich zu werden */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2e3452;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3a4268;
}

/* ==========================================================================
 * Dashboard (User-Bereich)
 * Layout-Regeln für die Hero-Zeile, die KPI-Karten und das 2-Spalten-Grid.
 * ========================================================================== */
/* KPI-Reihe — optisch an die Standard-Card angelehnt, nur dichter gepackt.
   Keine Schatten-Eskalation, gleiches Border/Radius wie andere Karten auf der Seite. */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.dash-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.dash-kpi:hover {
    border-color: color-mix(in oklab, var(--w-primary) 40%, var(--border));
    background: color-mix(in oklab, var(--w-primary) 3%, var(--bg-card-solid));
}
.dash-kpi.is-warning {
    border-color: color-mix(in oklab, var(--w-danger) 40%, var(--border));
}
.dash-kpi-ico {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.dash-kpi-label {
    font-size: 0.74rem;
    color: var(--w-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.dash-kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* 2-Spalten-Grid */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 20px;
    align-items: flex-start;
}
.dash-col-main,
.dash-col-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
/* Cards innerhalb der Dashboard-Spalten ersetzen ihr eigenes margin-bottom
   durch das Grid-`gap` — sonst entsteht doppelter Abstand. */
.dash-col-main > .card,
.dash-col-side > .card {
    margin-bottom: 0;
}

/* Listen-Rows in den Dashboard-Cards: kompakte Höhe + Hover-Feedback */
.dash-list .row-link {
    padding: 10px 12px;
    gap: 10px;
    border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
}
.dash-list .row-link:hover {
    background: var(--w-hover-bg);
}
.dash-row-title {
    font-weight: 550;
    font-size: 0.9rem;
    color: var(--text);
}
.dash-chev {
    color: var(--w-text-soft);
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}
.dash-list .row-link:hover .dash-chev {
    transform: translateX(2px);
    color: var(--primary);
}

/* Zwischenüberschriften innerhalb einer Card (MRs / Issues) */
.dash-subhead {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--w-text-muted);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-subhead i { font-size: 0.85rem; }

.dash-empty-inline {
    margin: 0;
    padding: 10px 0 4px;
    font-style: italic;
    text-align: center;
}

/* Responsive: Auf schmaleren Bildschirmen Seitenspalte unter den Main-Content */
@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .dash-kpis { grid-template-columns: 1fr; }
    .dashboard-hero { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
 * Chat (DMs + Team-Chats)
 * ========================================================================== */
.chat-inbox .row-link { padding: 12px 14px; gap: 12px; }
.chat-unread-badge {
    background: var(--w-primary); color: #fff; border-radius: 999px;
    padding: 2px 8px; font-size: 0.72rem; font-weight: 600; min-width: 22px;
    text-align: center; flex-shrink: 0;
}

.chat-room {
    display: flex; flex-direction: column;
    height: calc(100vh - 240px); min-height: 420px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.chat-scroll {
    flex: 1; overflow-y: auto; padding: 16px 18px;
    scrollbar-gutter: stable;
}
.chat-empty { text-align: center; padding: 60px 20px; }
.chat-messages { display: flex; flex-direction: column; gap: 2px; }

.chat-date-sep {
    text-align: center; margin: 16px 0 8px; position: relative;
}
.chat-date-sep::before, .chat-date-sep::after {
    content: ''; position: absolute; top: 50%; width: 42%;
    border-top: 1px solid var(--border);
}
.chat-date-sep::before { left: 0; }
.chat-date-sep::after  { right: 0; }
.chat-date-sep span {
    background: var(--bg-card-solid); position: relative; padding: 0 10px;
    font-size: 0.75rem; color: var(--w-text-muted); font-weight: 500;
}

.chat-msg {
    display: flex; gap: 10px; padding: 3px 0;
    position: relative;
}
.chat-msg:hover { background: var(--w-hover-bg); border-radius: var(--w-r-sm); }
.chat-msg-avatar { width: 32px; flex-shrink: 0; padding-top: 2px; }
.chat-msg-body-wrap { flex: 1; min-width: 0; position: relative; }
.chat-msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-msg-head strong { font-size: 0.88rem; font-weight: 600; }
.chat-msg-body {
    font-size: 0.92rem; line-height: 1.5;
    color: var(--text); white-space: pre-wrap; word-wrap: break-word;
}
.chat-msg.is-deleted .chat-msg-body { color: var(--w-text-soft); font-style: italic; }
.chat-edited { margin-left: 6px; font-size: 0.72rem; }
.chat-msg-actions {
    position: absolute; right: 0; top: 0;
    display: none; gap: 2px; background: var(--bg-card-solid);
    border: 1px solid var(--border); border-radius: var(--w-r-sm);
    padding: 2px;
}
.chat-msg:hover .chat-msg-actions { display: inline-flex; }

.chat-edit-form {
    margin-top: 4px;
}
.chat-edit-form textarea {
    width: 100%; min-height: 60px; padding: 6px 8px;
    border: 1px solid var(--w-primary); border-radius: var(--w-r-sm);
    background: var(--bg-card-solid); color: var(--text);
    font-family: inherit; font-size: 0.9rem; resize: vertical;
}

.chat-compose {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 10px 12px; border-top: 1px solid var(--border);
    background: var(--w-bg-subtle);
}
.chat-compose textarea {
    flex: 1; min-height: 40px; max-height: 160px;
    padding: 8px 10px; border: 1px solid var(--border);
    border-radius: var(--w-r-sm);
    background: var(--bg-card-solid); color: var(--text);
    font-family: inherit; font-size: 0.92rem; resize: vertical;
    transition: border-color var(--transition-fast);
}
.chat-compose textarea:focus {
    outline: 0; border-color: var(--w-primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.chat-compose button { flex-shrink: 0; }

[data-theme="dark"] .chat-room { background: var(--bg-card-solid); }
[data-theme="dark"] .chat-date-sep span { background: var(--bg-card-solid); }

.chat-mention {
    background: color-mix(in oklab, var(--w-primary) 12%, transparent);
    color: var(--w-primary); padding: 0 4px; border-radius: 3px;
    font-weight: 550; text-decoration: none;
}
.chat-mention:hover { background: color-mix(in oklab, var(--w-primary) 20%, transparent); }
.chat-mention.is-self {
    background: color-mix(in oklab, var(--w-warning) 18%, transparent);
    color: var(--w-warning);
}

.chat-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.chat-reactions form { margin: 0; padding: 0; }
.chat-reaction {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 8px; border: 1px solid var(--border);
    background: var(--w-bg-subtle); border-radius: 12px;
    cursor: pointer; font-size: 0.78rem; color: var(--text);
    transition: all var(--transition-fast);
}
.chat-reaction:hover { border-color: var(--w-primary); background: var(--w-hover-bg); }
.chat-reaction.is-own {
    background: color-mix(in oklab, var(--w-primary) 15%, var(--w-bg-subtle));
    border-color: var(--w-primary); color: var(--w-primary);
}
.chat-reaction-emoji { font-size: 0.88rem; line-height: 1; }
.chat-reaction-count { font-weight: 600; font-variant-numeric: tabular-nums; }

.chat-react-picker { position: relative; display: inline-block; margin-top: 2px; }
.chat-react-trigger {
    cursor: pointer; list-style: none; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    color: var(--w-text-soft); opacity: 0; transition: opacity var(--transition-fast);
}
.chat-react-trigger::-webkit-details-marker { display: none; }
.chat-msg:hover .chat-react-trigger { opacity: 1; }
.chat-react-trigger:hover { background: var(--w-hover-bg); color: var(--w-primary); }
.chat-react-menu {
    position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 20;
    display: flex; gap: 4px; padding: 6px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--w-r-sm); box-shadow: var(--shadow-md);
}
.chat-react-menu form { margin: 0; }
.chat-react-option {
    border: 0; background: transparent; cursor: pointer;
    padding: 4px 6px; border-radius: var(--w-r-xs); font-size: 1.1rem; line-height: 1;
}
.chat-react-option:hover { background: var(--w-hover-bg); }

.chat-compose-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.chat-compose-main textarea { width: 100%; }
.chat-compose .att-uploader .att-drop {
    padding: 6px 10px; font-size: 0.8rem; border-style: dashed;
    border-width: 1px; border-radius: var(--w-r-sm);
    color: var(--w-text-muted);
}
.chat-compose .att-list { display: flex; flex-wrap: wrap; gap: 6px; }

.chat-mention-dropdown {
    position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 4px;
    max-height: 240px; overflow-y: auto;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--w-r-sm); box-shadow: var(--shadow-md);
    z-index: 50;
}
.chat-compose-main { position: relative; }
.chat-mention-item {
    padding: 6px 10px; cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid var(--border);
}
.chat-mention-item:last-child { border-bottom: 0; }
.chat-mention-item:hover, .chat-mention-item.is-active {
    background: var(--w-hover-bg); color: var(--w-primary);
}

.chat-emoji-picker {
    position: absolute; z-index: 100;
    width: 340px; max-height: 380px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.chat-emoji-search {
    position: relative; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.chat-emoji-search i {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: var(--w-text-soft); font-size: 0.88rem;
}
.chat-emoji-search input {
    width: 100%; padding: 6px 8px 6px 28px; border: 1px solid var(--border);
    border-radius: var(--w-r-xs); background: var(--w-bg-subtle);
    font-size: 0.85rem; color: var(--text);
}
.chat-emoji-categories {
    display: flex; gap: 2px; padding: 4px; overflow-x: auto;
    border-bottom: 1px solid var(--border);
}
.chat-emoji-cat {
    padding: 4px 10px; background: transparent; border: 0; cursor: pointer;
    font-size: 0.72rem; font-weight: 600; color: var(--w-text-muted);
    border-radius: var(--w-r-xs); white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.chat-emoji-cat.is-active { background: var(--w-selected-bg); color: var(--w-primary); }
.chat-emoji-cat:hover { background: var(--w-hover-bg); }
.chat-emoji-grid {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
    padding: 6px; overflow-y: auto; flex: 1;
}
.chat-emoji-item {
    background: transparent; border: 0; cursor: pointer;
    padding: 5px; border-radius: var(--w-r-xs);
    font-size: 1.3rem; line-height: 1.1;
    transition: background var(--transition-fast);
}
.chat-emoji-item:hover { background: var(--w-hover-bg); transform: scale(1.1); }

.chat-pinned {
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--w-warning) 6%, var(--bg-card-solid));
}
.chat-pinned-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; list-style: none; color: var(--w-warning);
}
.chat-pinned-head::-webkit-details-marker { display: none; }
.chat-pinned-head > i:first-child { color: var(--w-warning); }
.chat-pinned-chev { margin-left: auto; transition: transform var(--transition-fast); opacity: 0.6; }
.chat-pinned[open] .chat-pinned-chev { transform: rotate(180deg); }
.chat-pinned-list {
    display: flex; flex-direction: column; gap: 2px;
    padding: 0 14px 10px;
}
.chat-pinned-item {
    display: flex; gap: 8px; align-items: center;
    padding: 6px 10px; font-size: 0.82rem;
    border-radius: var(--w-r-xs); color: var(--text);
    text-decoration: none; background: var(--bg-card-solid);
}
.chat-pinned-item:hover { background: var(--w-hover-bg); color: var(--w-primary); }
.chat-pinned-body {
    flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.chat-msg.is-pinned .chat-msg-body-wrap {
    border-left: 2px solid var(--w-warning); padding-left: 8px;
}
.chat-pin-badge {
    position: absolute; top: 4px; right: 4px;
    color: var(--w-warning); font-size: 0.75rem;
}
.chat-msg-actions .btn.is-active { color: var(--w-warning); }

/* Pinned-Target-Highlight nach Anchor-Klick */
.chat-msg:target .chat-msg-body-wrap { animation: pin-flash 2s ease; }
@keyframes pin-flash {
    0%   { background: color-mix(in oklab, var(--w-warning) 30%, transparent); }
    100% { background: transparent; }
}

.chat-search-body {
    font-size: 0.88rem; line-height: 1.5; color: var(--text);
    white-space: pre-wrap; word-wrap: break-word;
    max-height: 4.5em; overflow: hidden;
}
.chat-search-body mark {
    background: color-mix(in oklab, var(--w-warning) 35%, transparent);
    color: var(--text); padding: 1px 3px; border-radius: 2px;
    font-weight: 600;
}

.chat-typing {
    min-height: 20px; padding: 0 14px;
    font-size: 0.78rem; color: var(--w-text-muted);
    font-style: italic; line-height: 1.3;
    opacity: 0; transition: opacity var(--transition-fast);
}
.chat-typing.is-visible { opacity: 1; }
.chat-typing::before {
    content: ''; display: inline-block; width: 5px; height: 5px;
    background: var(--w-primary); border-radius: 50%;
    margin-right: 6px; vertical-align: middle;
    animation: typing-pulse 1.2s ease-in-out infinite;
}
@keyframes typing-pulse {
    0%,100% { opacity: 0.3; transform: scale(1); }
    50%     { opacity: 1;   transform: scale(1.4); }
}
.chat-typing:empty::before { display: none; }

.chat-inbox-row { display: flex; align-items: stretch; gap: 0; padding: 0; }
.chat-inbox-row-main {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; text-decoration: none; color: inherit;
  min-width: 0;
}
.chat-inbox-row:hover { background: var(--w-hover-bg); }
.chat-inbox-menu { position: relative; display: flex; align-items: center; padding: 0 6px; }
.chat-inbox-menu-trig {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; list-style: none; color: var(--w-text-soft);
  opacity: 0; transition: opacity var(--transition-fast);
}
.chat-inbox-menu-trig::-webkit-details-marker { display: none; }
.chat-inbox-row:hover .chat-inbox-menu-trig,
.chat-inbox-menu[open] .chat-inbox-menu-trig { opacity: 1; }
.chat-inbox-menu-trig:hover { background: var(--w-hover-bg); color: var(--w-primary); }
.chat-inbox-menu-dd {
  position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 20;
  min-width: 180px;
  background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: var(--w-r-sm); box-shadow: var(--shadow-md);
  padding: 4px;
}
.chat-inbox-menu-dd form { margin: 0; }
.chat-inbox-menu-dd .user-action-btn { width: 100%; }

/* ==========================================================================
 * Presence / Online-Status
 * ========================================================================== */
.avatar-wrap {
    position: relative; display: inline-flex; flex-shrink: 0;
    vertical-align: middle;
}
.avatar-wrap > .avatar { display: block; }
.avatar-status {
    position: absolute; bottom: 0; right: 0;
    width: 28%; height: 28%; min-width: 8px; min-height: 8px;
    max-width: 14px; max-height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-card-solid);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.avatar-status-online  { background: #22c55e; }
.avatar-status-away    { background: #f59e0b; }
.avatar-status-busy    { background: #ef4444; }
.avatar-status-offline { background: #9ca3af; }
[data-theme="dark"] .avatar-status { border-color: var(--bg-card-solid); }

/* Utility: Flex-Kind, das wachsen darf und bei langem Inhalt truncate-bar ist.
 * Ersetzt das häufige `style="flex:1;min-width:0"` Pattern.
 */
.flex-fill-min0 { flex: 1; min-width: 0; }
/* Utility: Flex-Spacer, schiebt Inhalt rechts in einem flex-row. */
.flex-spacer { flex: 1 1 auto; }

/* User-Actions-Dropdown + Modal — genutzt auf Profilen & in der Chat-Inbox.
 * Vorher inline in views/users/show.php, hier konsolidiert.
 */
.user-actions-dd {
    position: absolute; right: 0; top: 100%; margin-top: 4px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--w-r-sm); padding: 4px; z-index: 10;
    box-shadow: var(--shadow-md); min-width: 200px;
}
.user-actions-dd hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.user-action-btn {
    background: none; border: 0; width: 100%; text-align: left;
    padding: 8px 10px; cursor: pointer; font-size: 0.88rem; color: var(--text);
    display: flex; align-items: center; gap: 8px; border-radius: var(--w-r-xs);
}
.user-action-btn:hover { background: var(--w-hover-bg); color: var(--w-primary); }

.ua-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 200; display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.ua-modal.is-open { display: flex; }
.ua-modal-card {
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; max-width: 480px; width: 100%;
    box-shadow: var(--shadow-xl);
}

/* === A11y-Verbesserungen (Go-Live-Audit) ========================================= */

/* Skip-Link: für Tastatur-User, um die Sidebar zu überspringen. */
.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 300;
    padding: 10px 16px; background: var(--primary); color: #fff;
    text-decoration: none; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
}
.skip-link:focus { left: 8px; }

/* Tables in Prose/Card responsive auf Mobile. */
.prose table,
.card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Mindest-Tap-Target 44px auf Mobile — WCAG 2.1 AA Guideline 2.5.5. */
@media (max-width: 768px) {
    .btn-sm, .btn-icon, .user-action-btn {
        min-height: 44px;
    }
    .btn-xs { min-height: 36px; } /* bewusst kleiner — Dense-Context im Chat */
}

/* Badges/Counter: aria-live über die Klasse wird im HTML gesetzt, hier nur Visuals. */

/* === Team-Styles & Team-Avatar ================================================== */
/* Team-Avatar: farbiger Kreis, Fallback auf Primary. `--team-color` überschreibt via inline style. */
.team-avatar {
    background: var(--team-color, var(--w-primary));
    color: #fff;
}
/* Team-Badge: farbige Pille im Profil. `--team-color` überschreibt via inline style. */
.team-badge {
    background: var(--team-color, var(--w-primary));
    border-color: var(--team-color, var(--w-primary));
    color: #fff;
}
.team-badge:hover { filter: brightness(1.1); }

/* Inline-Presence-Dot für Text-Zeilen (DM-Header, Member-Dropdown etc.) */
.presence-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; flex-shrink: 0;
    vertical-align: middle;
}
.presence-dot-online  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.presence-dot-away    { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }
.presence-dot-busy    { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.18); }
.presence-dot-offline { background: #9ca3af; }

/* DM-Header: Presence-Zeile direkt unter dem Namen */
.chat-header-status {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.88rem; color: var(--w-text-soft, var(--muted));
}
.chat-header-status-text { line-height: 1.2; }

/* Status-Dropdown im Topbar */
.presence-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--w-bg-subtle); border: 1px solid var(--border);
    cursor: pointer; font-size: 0.78rem; color: var(--text);
}
.presence-chip:hover { background: var(--w-hover-bg); border-color: var(--w-primary); }
.presence-chip-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.presence-menu {
    position: absolute; right: 0; top: 100%; margin-top: 6px; z-index: 50;
    min-width: 240px;
    background: var(--bg-card-solid); border: 1px solid var(--border);
    border-radius: var(--w-r-sm); box-shadow: var(--shadow-md);
    padding: 8px;
}
.presence-menu h4 {
    font-size: 0.7rem; font-weight: 600; color: var(--w-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin: 4px 8px 6px;
}
.presence-option {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 6px 8px; background: transparent; border: 0; cursor: pointer;
    border-radius: var(--w-r-xs); text-align: left;
    font-size: 0.85rem; color: var(--text);
}
.presence-option:hover { background: var(--w-hover-bg); }
.presence-option.is-active { background: var(--w-selected-bg); color: var(--w-primary); font-weight: 550; }
.presence-option-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.presence-msg-field {
    margin-top: 6px; padding: 6px 8px; border-top: 1px solid var(--border);
}
.presence-msg-field input {
    width: 100%; padding: 6px 8px; border: 1px solid var(--border);
    border-radius: var(--w-r-xs); font-size: 0.82rem;
    background: var(--w-bg-subtle); color: var(--text);
}

.presence-inline {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}
.presence-inline-label {
    font-size: 0.78rem; color: var(--w-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}

.chat-read-tick {
    display: inline-block; margin-left: 4px;
    font-size: 0.78rem; color: var(--w-text-soft);
    vertical-align: middle;
}
.chat-read-tick.is-read { color: var(--w-info); }
.chat-read-tick i { vertical-align: baseline; }

.link-preview {
    display: flex; gap: 10px; margin-top: 6px;
    padding: 10px 12px; max-width: 520px;
    background: var(--w-bg-subtle); border: 1px solid var(--border);
    border-left: 3px solid var(--w-primary);
    border-radius: var(--w-r-sm);
    text-decoration: none; color: inherit;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.link-preview:hover { background: var(--w-hover-bg); border-color: var(--w-primary); }
.link-preview-img {
    width: 80px; height: 80px; flex-shrink: 0;
    border-radius: var(--w-r-xs);
    background-size: cover; background-position: center;
    background-color: var(--bg-card-solid);
}
.link-preview-body {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0; flex: 1;
}
.link-preview-site {
    font-size: 0.7rem; color: var(--w-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.link-preview-title {
    font-size: 0.92rem; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.link-preview-desc {
    font-size: 0.82rem; color: var(--w-text-muted);
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    line-height: 1.4;
}

.chat-msg-system {
    color: var(--w-text-muted);
    font-style: italic;
    font-size: 0.88rem;
}
.chat-msg-system a { color: var(--w-primary); }
.chat-call-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 14px; margin-top: 4px;
    background: color-mix(in oklab, var(--w-primary) 6%, var(--bg-card-solid));
    border: 1px solid color-mix(in oklab, var(--w-primary) 30%, var(--border));
    border-radius: var(--w-r-sm);
    font-style: normal;
}
.chat-call-head {
    display: flex; align-items: center; gap: 8px;
    font-weight: 550; color: var(--text);
}
.chat-call-head i { color: var(--w-primary); font-size: 1.1rem; }
