:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --secondary: #e5e7eb;
    --secondary-text: #111827;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #166534;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #991b1b;
    --warn-bg: #fff7ed;
    --warn-border: #fed7aa;
    --warn-text: #9a3412;
    --topbar: #1f2937;
    --topbar-btn: #374151;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --sidebar-width: 280px;
    --topbar-height: 64px;
    --container-max: 1200px;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    background: var(--bg);
    overflow-x: hidden;
}

.page-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 998;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--topbar-height);
    background: var(--topbar);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.brand-title {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--topbar-btn);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    flex: 0 0 auto;
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: -90vw;
    width: min(82vw, 320px);
    max-width: 320px;
    height: calc(100dvh - var(--topbar-height));
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    z-index: 999;
    transition: left 0.25s ease;
    overflow-y: auto;
}

    .sidebar.open {
        left: 0;
    }

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.sidebar-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.sidebar-user {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

.sidebar-nav {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: block;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    background: var(--surface-soft);
    min-height: 48px;
    line-height: 20px;
    font-size: 16px;
}

.layout-body {
    display: flex;
    min-height: calc(100dvh - var(--topbar-height));
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 12px;
    overflow-x: hidden;
}

.page-container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
}

.page-subtitle {
    color: var(--muted);
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.card-title {
    margin: 0 0 14px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-label {
    font-weight: 600;
}

.field-full {
    grid-column: 1 / -1;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 50px;
    font-size: 16px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
}

.textarea {
    min-height: 110px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.65;
        cursor: default;
    }

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.9rem;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}

    .btn-danger:hover:not(:disabled) {
        background: var(--danger-hover);
    }

.message {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
}

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

.message-error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.message-warn {
    background: var(--warn-bg);
    border-color: var(--warn-border);
    color: var(--warn-text);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-open {
    background: #dcfce7;
    color: #166534;
}

.badge-planned {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-closed {
    background: #fef3c7;
    color: #92400e;
}

.badge-completed {
    background: #e5e7eb;
    color: #374151;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-registered {
    background: #ecfeff;
    color: #155e75;
}

.badge-registration-cancelled {
    background: #fff7ed;
    color: #9a3412;
}

.badge-registration-completed {
    background: #f0fdf4;
    color: #166534;
}

.assignment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.assignment-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.assignment-card-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .assignment-card-clickable:hover {
        transform: translateY(-2px);
    }

.assignment-card-focused {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.assignment-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assignment-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.assignment-subtitle {
    color: var(--muted);
}

.assignment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.assignment-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-tile {
    background: var(--surface-soft);
    border-radius: 12px;
    padding: 10px;
    min-width: 0;
}

.info-tile-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.info-tile-value {
    font-weight: 700;
    margin-top: 4px;
    word-break: break-word;
}

.small-value {
    font-size: 1rem;
    line-height: 1.35;
}

.assignment-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assignment-admin {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.assignment-detail-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.assignment-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.assignment-detail-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 14px;
}

.assignment-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.participants-title {
    margin-top: 16px;
}

.assignment-add-member-panel {
    margin-bottom: 18px;
    padding: 16px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    max-width: 720px;
}

    .assignment-add-member-panel .input,
    .assignment-add-member-panel .select,
    .assignment-add-member-panel input,
    .assignment-add-member-panel select {
        width: 100%;
        max-width: 560px;
    }

    .assignment-detail-panel .assignment-actions,
    .assignment-add-member-panel .assignment-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 14px;
    }

        .assignment-detail-panel .assignment-actions .btn,
        .assignment-add-member-panel .assignment-actions .btn {
            width: auto;
            min-width: 140px;
        }

.participant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.participant-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: var(--surface-soft);
    display: grid;
    grid-template-columns: 1.2fr auto 1.4fr;
    gap: 14px;
    align-items: center;
}

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

.participant-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.participant-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
}

.participant-status {
    display: flex;
    justify-content: center;
}

.participant-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: var(--surface);
}

    .table th,
    .table td {
        text-align: left;
        padding: 12px;
        border-bottom: 1px solid var(--line);
        vertical-align: middle;
    }

    .table th {
        background: var(--surface-soft);
        font-size: 0.95rem;
    }

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

.accordion-toggle {
    width: 100%;
    min-height: 52px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.accordion-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* Dashboard */

.admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.dashboard-stat-label {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.dashboard-stat-subtitle {
    font-size: 0.92rem;
    color: var(--muted);
}

.dashboard-admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

.dashboard-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-bar-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.95rem;
}

.dashboard-bar-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.dashboard-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
}

.dashboard-mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-mini-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: var(--surface-soft);
}

.dashboard-mini-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.dashboard-mini-subtitle {
    font-size: 0.92rem;
    color: var(--muted);
}

.dashboard-mini-badge {
    display: inline-flex;
    margin-top: 10px;
}

.dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* Listenansichten */

.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.list-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.assignment-table-wrap {
    overflow-x: auto;
}

.assignment-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 1120px;
}

    .assignment-table th,
    .assignment-table td {
        padding: 14px 14px;
        border-bottom: 1px solid var(--line);
        text-align: left;
        vertical-align: middle;
    }

    .assignment-table th {
        background: #f8fafc;
        font-size: 0.92rem;
        color: var(--muted);
        font-weight: 700;
        white-space: nowrap;
    }

    .assignment-table td {
        background: white;
        word-break: normal;
        overflow-wrap: break-word;
    }

.assignment-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

    .assignment-row:hover td {
        background: #f8fbff;
    }

.assignment-row-focused td {
    background: rgba(37, 99, 235, 0.06);
}

.assignment-row-detail td {
    background: #fcfcfd;
    padding: 0;
}

.assignment-row-detail .assignment-detail-panel {
    margin-top: 0;
    padding: 20px 18px;
    border-top: none;
}

.assignment-col-date {
    white-space: nowrap;
}

.assignment-col-description {
    font-weight: 600;
}

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

/* Mitglieder-Spalten */

.member-col-number {
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
}

.member-col-name {
    width: 240px;
    min-width: 240px;
    font-weight: 600;
}

.member-col-email {
    width: 340px;
    min-width: 340px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.member-col-hours {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
}

.member-col-notify {
    width: 190px;
    min-width: 190px;
}

/* Fallback nach Position für Mitgliederliste */
.assignment-table th:nth-child(1),
.assignment-table td:nth-child(1) {
    width: 140px;
}

.assignment-table th:nth-child(2),
.assignment-table td:nth-child(2) {
    width: 240px;
}

.assignment-table th:nth-child(3),
.assignment-table td:nth-child(3) {
    width: 340px;
}

.assignment-table th:nth-child(4),
.assignment-table td:nth-child(4) {
    width: 120px;
}

.assignment-table th:nth-child(5),
.assignment-table td:nth-child(5) {
    width: 190px;
}

/* Responsive */

@media (max-width: 980px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .assignment-detail-grid {
        grid-template-columns: 1fr;
    }

    .participant-card {
        grid-template-columns: 1fr;
    }

    .participant-status {
        justify-content: flex-start;
    }

    .participant-actions {
        justify-content: flex-start;
    }

    .assignment-detail-head {
        flex-direction: column;
        align-items: stretch;
    }

    .assignment-add-member-panel {
        max-width: 100%;
    }

        .assignment-add-member-panel .input,
        .assignment-add-member-panel .select,
        .assignment-add-member-panel input,
        .assignment-add-member-panel select {
            max-width: 100%;
        }
}

@media (max-width: 767px) {
    .table-wrap {
        display: none;
    }
}

@media (max-width: 700px) {
    .view-toggle {
        flex-direction: column;
    }

    .assignment-table {
        min-width: 900px;
    }
}

@media (max-width: 640px) {
    .admin-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-actions-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stat-value {
        font-size: 1.7rem;
    }
}

@media (min-width: 768px) {
    .topbar {
        padding: 0 16px;
    }

    .sidebar {
        left: 0;
        width: var(--sidebar-width);
        max-width: none;
        box-shadow: none;
    }

    .layout-body {
        padding-left: var(--sidebar-width);
    }

    .main-content {
        padding: 20px;
    }

    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }

    .assignment-head {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .assignment-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

        .assignment-actions .btn,
        .assignment-admin .btn {
            width: auto;
        }

    .assignment-admin {
        flex-direction: row;
        align-items: end;
        flex-wrap: wrap;
    }

        .assignment-admin .field {
            min-width: 220px;
            flex: 0 1 240px;
        }
}

@media (min-width: 1100px) {
    .assignment-list.assignment-list-admin {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}
/* Startseite */

.home-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.home-hero {
    border-radius: 20px;
    padding: 32px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.22);
}

.hero-content {
    max-width: 620px;
}

.home-hero h1 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    line-height: 1.2;
}

.home-hero p {
    margin: 0 0 20px 0;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.home-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: var(--shadow);
}

    .home-card:hover {
        transform: translateY(-3px);
        border-color: var(--primary);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

.home-card-title {
    font-weight: 700;
    font-size: 1.08rem;
    margin-bottom: 6px;
}

.home-card-text {
    color: var(--muted);
    line-height: 1.4;
}

@media (max-width: 640px) {
    .home-hero {
        padding: 24px;
    }

        .home-hero h1 {
            font-size: 1.6rem;
        }
}
/* CLEAN HERO */

.home-hero-clean {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border-radius: 24px;
    padding: 36px;
    color: white;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.home-hero-clean h1 {
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.home-hero-clean p {
    margin: 0 0 18px 0;
    opacity: 0.9;
}

/* GRID bleibt wie vorher */

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* CARDS leicht aufwerten */

.home-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.18s ease;
}

    .home-card:hover {
        transform: translateY(-4px);
        border-color: var(--primary);
        box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    }

.home-card-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.assignment-chart-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: center;
}

.assignment-chart-card {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

.assignment-pie-chart {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    position: relative;
    box-shadow: var(--shadow);
}

    .assignment-pie-chart::after {
        content: "";
        position: absolute;
        inset: 38px;
        background: white;
        border-radius: 50%;
    }

.assignment-chart-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none;
}

.assignment-chart-total {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.assignment-chart-total-label {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 4px;
}

.assignment-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assignment-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: 14px;
    padding: 12px 14px;
}

.assignment-legend-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.assignment-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.assignment-legend-percent {
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .assignment-chart-layout {
        grid-template-columns: 1fr;
    }
}
/* ================= Dashboard Quick Actions ================= */

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-quick-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: var(--shadow);
}

    .dashboard-quick-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
        border-color: var(--primary);
    }

.quick-icon {
    font-size: 20px;
}

.quick-title {
    font-weight: 700;
    font-size: 1rem;
}

.quick-sub {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Responsive */

@media (max-width: 900px) {
    .dashboard-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .dashboard-quick-grid {
        grid-template-columns: 1fr;
    }
}
.assignment-add-member-panel {
    position: relative;
    z-index: 20;
}

    .assignment-add-member-panel .btn,
    .assignment-add-member-panel .select,
    .assignment-add-member-panel .input {
        position: relative;
        z-index: 21;
        pointer-events: auto;
    }
.assignment-list-header,
.assignment-list-row {
    display: grid;
    grid-template-columns: 160px minmax(220px, 1fr) 90px 90px 130px 120px 180px;
    gap: 14px;
    align-items: center;
}

.assignment-list-header {
    padding: 14px 18px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}

.assignment-list-body {
    display: flex;
    flex-direction: column;
}

.assignment-list-item {
    border-bottom: 1px solid var(--line);
}

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

.assignment-list-row {
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .assignment-list-row:hover {
        background: #f8fbff;
    }

.assignment-list-detail {
    padding: 0 18px 18px 18px;
    background: #fcfcfd;
}

@media (max-width: 1100px) {
    .assignment-list-header,
    .assignment-list-row {
        grid-template-columns: 160px minmax(220px, 1fr) 90px 90px 130px 120px 180px;
        min-width: 980px;
    }

    .list-card {
        overflow-x: auto;
    }

    .assignment-list-header,
    .assignment-list-body {
        min-width: 980px;
    }
}
.adminuser-list-header,
.adminuser-list-row {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) 130px 120px 170px 120px;
    gap: 14px;
    align-items: center;
}

.adminuser-list-header {
    padding: 14px 18px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}

.adminuser-list-body {
    display: flex;
    flex-direction: column;
}

.adminuser-list-item {
    border-bottom: 1px solid var(--line);
}

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

.adminuser-list-row {
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .adminuser-list-row:hover {
        background: #f8fbff;
    }

.adminuser-list-detail {
    padding: 0 18px 18px 18px;
    background: #fcfcfd;
}

.adminuser-col-username {
    font-weight: 600;
}

.adminuser-col-email {
    word-break: break-word;
}

.adminuser-col-created {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .adminuser-list-header,
    .adminuser-list-row {
        grid-template-columns: 180px minmax(220px, 1fr) 130px 120px 170px 120px;
        min-width: 940px;
    }

    .adminuser-list-header,
    .adminuser-list-body {
        min-width: 940px;
    }
}
/* ===== Notifications ===== */

.notification-bell-wrapper {
    position: relative;
}

.notification-bell-button {
    position: relative;
}

.notification-bell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--topbar);
    line-height: 1;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(92vw, 420px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    z-index: 1200;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.notification-panel-title {
    font-size: 1rem;
    font-weight: 700;
}

.notification-panel-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 4px;
}

.notification-panel-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-list-item {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 14px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
}

    .notification-list-item:hover {
        background: var(--surface-soft);
    }

    .notification-list-item.unread {
        border-color: #93c5fd;
        background: #eff6ff;
    }

.notification-list-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.notification-date {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.notification-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.notification-title {
    font-weight: 700;
}

.notification-message {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.notification-unread-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    flex: 0 0 auto;
}

.notification-panel-footer {
    padding: 12px 16px 16px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.notification-empty,
.notification-empty-page {
    padding: 24px 16px;
    text-align: center;
    color: var(--muted);
}

.notification-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.notification-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.notification-filter-select {
    min-width: 220px;
}

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

.notification-counter-box {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.notification-page-list {
    max-height: calc(100dvh - 280px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.notification-page-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface);
}

    .notification-page-item.unread {
        border-color: #93c5fd;
        background: #eff6ff;
    }

.notification-page-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.notification-page-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-page-date {
    font-size: 0.88rem;
    color: var(--muted);
}

.notification-page-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.notification-page-message {
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
}

.notification-page-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.notification-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.type-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.type-system {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.type-assignment {
    background: #ecfeff;
    color: #0f766e;
    border-color: #99f6e4;
}

.type-warning {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fdba74;
}

.type-error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.type-success {
    background: #ecfdf5;
    color: #166534;
    border-color: #86efac;
}

.notification-state-pill {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

    .notification-state-pill.unread {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .notification-state-pill.read {
        background: #f3f4f6;
        color: #6b7280;
    }

.btn-small {
    padding: 8px 12px;
    min-height: auto;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .notification-bell-wrapper {
        position: static;
    }

    .notification-panel {
        position: fixed;
        top: 76px; /* an deine Topbar-Höhe anpassen */
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 88px);
        border-radius: 18px;
        overflow: hidden;
        z-index: 3000;
    }

    .notification-panel-list {
        max-height: calc(100dvh - 220px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .notification-panel-header {
        padding: 14px;
    }

    .notification-panel-footer {
        padding: 12px 14px 14px 14px;
    }
}
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rule-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface);
}

.rule-header {
    margin-bottom: 14px;
}

.rule-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.rule-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
    margin-bottom: 14px;
}

    .rule-grid label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

.rule-actions {
    display: flex;
    justify-content: flex-end;
}
}