:root {
    --luw-red: #e53434;
    --bg: #f6f7f8;
    --card: #ffffff;
    --text: #202124;
    --muted: #68707a;
    --border: #dfe3e7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

.topbar {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 32px;

    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 18px;
    font-weight: 700;
}

.subtitle {
    margin-top: 2px;

    font-size: 13px;
    color: var(--muted);
}

.user {
    font-size: 13px;
    color: var(--muted);
}

main {
    max-width: 980px;

    margin: 0 auto;
    padding: 48px 28px 80px;
}

.hero {
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--luw-red);

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.08em;
}

h1 {
    margin:
        8px 0
        10px;

    font-size: 36px;
    line-height: 1.15;
}

h2 {
    margin-top: 0;
    font-size: 21px;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.card {
    padding: 32px;

    background: var(--card);

    border:
        1px solid
        var(--border);

    border-radius: 14px;

    box-shadow:
        0 8px 28px
        rgba(0, 0, 0, 0.05);
}

.field {
    margin-bottom: 22px;
}

label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;
    font-weight: 600;
}

input,
select {
    width: 100%;

    padding:
        12px
        14px;

    font-size: 15px;

    color: var(--text);
    background: #ffffff;

    border:
        1px solid
        #cfd5da;

    border-radius: 8px;

    outline: none;
}

input:focus,
select:focus {
    border-color: var(--luw-red);

    box-shadow:
        0 0 0 3px
        rgba(229, 52, 52, 0.10);
}

input:disabled {
    color: #8a9197;
    background: #f2f3f4;
}

.template-info {
    margin-top: 10px;
}

.template-box {
    padding: 18px;

    background: #fafafa;

    border:
        1px solid
        var(--border);

    border-radius: 10px;
}

.template-box p {
    margin:
        5px 0
        13px;

    color: var(--muted);
}

.room-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.room-list span {
    padding:
        6px
        9px;

    background: #ffffff;

    border:
        1px solid
        var(--border);

    border-radius: 6px;

    font-size: 12px;
}

.divider {
    height: 1px;

    margin:
        30px 0;

    background: var(--border);
}

.hint {
    margin-top: -10px;
    margin-bottom: 24px;

    color: var(--muted);
    font-size: 13px;
}

button.primary {
    display: block;

    margin-left: auto;

    padding:
        12px
        22px;

    border: 0;
    border-radius: 8px;

    color: #ffffff;
    background: var(--luw-red);

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

button.primary:hover {
    filter: brightness(0.95);
}

button.primary:disabled {
    cursor: not-allowed;

    background: #afb5ba;
}


/* ---------------------------------------------------------
 * LUW Space Manager - Anmeldung
 * --------------------------------------------------------- */

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

.authlink {
    display: inline-block;

    padding: 8px 12px;

    border: 1px solid var(--border);
    border-radius: 7px;

    color: var(--text);
    background: #ffffff;

    text-decoration: none;
    font-weight: 600;
}

.authlink:hover {
    border-color: var(--luw-red);
}

.authlogin {
    color: #ffffff;
    background: var(--luw-red);
    border-color: var(--luw-red);
}

.authlogin:hover {
    color: #ffffff;
    filter: brightness(0.95);
}


/* ---------------------------------------------------------
 * LUW Space Manager - Benutzerwahl
 * --------------------------------------------------------- */

.user-picker {
    position: relative;
}

.user-results {
    display: none;

    position: absolute;
    z-index: 20;

    top: 48px;
    left: 0;
    right: 0;

    max-height: 280px;
    overflow-y: auto;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 9px;

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.12);
}

.user-result {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding: 12px 14px;

    border: 0;
    border-bottom:
        1px solid #eeeeee;

    background: #ffffff;

    text-align: left;
    cursor: pointer;
}

.user-result:last-child {
    border-bottom: 0;
}

.user-result:hover {
    background: #f7f7f7;
}

.user-result strong {
    display: block;

    margin-bottom: 3px;

    font-size: 14px;
}

.user-result span {
    display: block;

    color: var(--muted);
    font-size: 12px;
}

.user-result .add-user {
    color: var(--luw-red);

    font-weight: 700;
    white-space: nowrap;
}

.search-info,
.search-error {
    padding: 14px;

    color: var(--muted);
    font-size: 13px;
}

.search-error {
    color: var(--luw-red);
}

.selected-users {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 10px;
}

.selected-user {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;

    background: #fafafa;

    border: 1px solid var(--border);
    border-radius: 8px;
}

.selected-user strong {
    display: block;

    margin-bottom: 2px;

    font-size: 13px;
}

.selected-user span {
    display: block;

    color: var(--muted);
    font-size: 12px;
}

.remove-user {
    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    color: #555555;
    background: #eeeeee;

    font-size: 18px;
    line-height: 28px;

    cursor: pointer;
}

.remove-user:hover {
    color: #ffffff;
    background: var(--luw-red);
}


/* ---------------------------------------------------------
 * Projektadministrator / Ersteller
 * --------------------------------------------------------- */

.creator-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 10px;
    padding: 11px 12px;

    background: #fafafa;

    border: 1px solid var(--border);
    border-radius: 8px;
}

.creator-admin strong {
    display: block;

    margin-bottom: 2px;

    font-size: 13px;
}

.creator-admin span {
    color: var(--muted);
    font-size: 12px;
}

.creator-admin .role-badge {
    padding: 5px 8px;

    color: var(--luw-red);
    background: rgba(229, 52, 52, 0.08);

    border-radius: 6px;

    font-weight: 700;
    white-space: nowrap;
}

.admin-picker {
    margin-top: 8px;
}


/* ---------------------------------------------------------
 * Projekterstellung Ergebnis
 * --------------------------------------------------------- */

.result-card {
    max-width: 760px;
    margin: 0 auto;
}

.success-icon,
.error-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 50%;

    font-size: 30px;
    font-weight: 700;
}

.success-icon {
    color: #ffffff;
    background: #2f9e44;
}

.error-icon {
    color: #ffffff;
    background: var(--luw-red);
}

.result-intro {
    margin-bottom: 28px;

    color: var(--muted);
}

.result-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;

    margin-bottom: 30px;
}

.result-grid > div {
    padding: 14px;

    background: #fafafa;

    border:
        1px solid
        var(--border);

    border-radius: 8px;
}

.result-grid span {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);
    font-size: 12px;
}

.result-list {
    margin-bottom: 30px;
}

.result-row {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px 0;

    border-bottom:
        1px solid #eeeeee;
}

.result-row .check {
    color: #2f9e44;

    font-weight: 700;
}

.roles-summary {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-bottom: 24px;
}

.roles-summary > div {
    padding: 14px;

    background: #fafafa;

    border:
        1px solid
        var(--border);

    border-radius: 8px;
}

.roles-summary strong {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;
}

.roles-summary span {
    display: block;

    margin-top: 4px;

    color: var(--muted);
    font-size: 12px;

    overflow-wrap: anywhere;
}

.result-note {
    padding: 14px;

    margin-top: 18px;

    background:
        rgba(229, 52, 52, 0.05);

    border:
        1px solid
        rgba(229, 52, 52, 0.18);

    border-radius: 8px;
}

.result-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 24px;
}

.primary-link {
    display: inline-block;

    padding:
        11px 18px;

    color: #ffffff;
    background: var(--luw-red);

    border-radius: 8px;

    text-decoration: none;
    font-weight: 600;
}

.primary-link:hover {
    filter: brightness(0.95);
}

.mono {
    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 12px;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .result-grid,
    .roles-summary {
        grid-template-columns: 1fr;
    }
}


/* ---------------------------------------------------------
 * Projektverwaltung
 * --------------------------------------------------------- */

.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;

    align-items: center;

    gap: 20px;

    padding: 16px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background: #ffffff;
}

.project-name {
    display: block;

    margin-bottom: 5px;

    font-size: 15px;
}

.project-meta,
.project-id {
    color: var(--muted);
    font-size: 12px;
}

.project-id {
    margin-top: 5px;
}

.status-badge {
    display: inline-block;

    padding: 5px 8px;

    border-radius: 6px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

.status-active {
    color: #267a37;
    background: #edf8ef;
}

.status-pending {
    color: #8a6500;
    background: #fff7db;
}

.status-deleted {
    color: #666666;
    background: #eeeeee;
}

.status-error {
    color: #b42318;
    background: #fff0ee;
}

.danger-link {
    color: var(--luw-red);

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;
}

.danger-link:hover {
    text-decoration: underline;
}


/* ---------------------------------------------------------
 * Löschen
 * --------------------------------------------------------- */

.delete-card {
    max-width: 720px;
    margin: 0 auto;
}

.delete-summary {
    display: grid;

    grid-template-columns:
        2fr 1fr 2fr;

    gap: 10px;

    margin:
        24px 0;
}

.delete-summary > div {
    padding: 12px;

    background: #fafafa;

    border:
        1px solid
        var(--border);

    border-radius: 8px;
}

.delete-summary span {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);
    font-size: 12px;
}

.danger-box {
    margin:
        24px 0;

    padding: 16px;

    border:
        1px solid
        rgba(229, 52, 52, 0.32);

    border-radius: 9px;

    background:
        rgba(229, 52, 52, 0.06);
}

.danger-box strong {
    color: var(--luw-red);
}

.danger-box p {
    margin:
        7px 0 0;
}

.delete-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 12px;

    margin-top: 24px;
}

.danger-button {
    padding:
        11px 18px;

    border: 0;
    border-radius: 8px;

    color: #ffffff;
    background: var(--luw-red);

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.danger-button:hover {
    filter: brightness(0.92);
}

.secondary-link {
    display: inline-block;

    padding:
        10px 14px;

    color: var(--text);

    border:
        1px solid
        var(--border);

    border-radius: 8px;

    background: #ffffff;

    text-decoration: none;
    font-weight: 600;
}

.delete-spinner {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 50%;

    color: #ffffff;
    background: var(--luw-red);

    font-size: 28px;
    font-weight: 700;
}

.delete-task-status {
    margin-left: auto;

    color: var(--muted);

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 11px;
}


@media (max-width: 700px) {
    .project-item {
        grid-template-columns: 1fr;
    }

    .delete-summary {
        grid-template-columns: 1fr;
    }
}


/* ---------------------------------------------------------
 * Projektarchiv
 * --------------------------------------------------------- */

.project-section {
    margin-bottom: 34px;
}

.project-section-deleted {
    opacity: 0.86;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 12px;
}

.section-heading h2 {
    margin-bottom: 4px;
}

.section-heading p {
    margin: 0;

    color: var(--muted);
    font-size: 13px;
}

.count-badge {
    min-width: 30px;

    padding: 5px 9px;

    border-radius: 20px;

    background: #eeeeee;

    text-align: center;
    font-weight: 700;
}

.project-actions {
    display: flex;
    align-items: center;

    gap: 14px;
}

.archive-link,
.archive-manage-link {
    color: #8a6500;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;
}

.archive-link:hover,
.archive-manage-link:hover {
    text-decoration: underline;
}

.status-archived {
    color: #725600;
    background: #fff3c2;
}

.project-archive-meta {
    margin-top: 5px;

    color: var(--muted);
    font-size: 11px;
}

.deleted-project {
    background: #fafafa;
}


/* ---------------------------------------------------------
 * Archivdialog
 * --------------------------------------------------------- */

.archive-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 50%;

    color: #ffffff;
    background: #b18400;

    font-size: 28px;
    font-weight: 700;
}

.archive-info {
    margin:
        24px 0;

    padding: 16px;

    border:
        1px solid
        #e6cf88;

    border-radius: 9px;

    background: #fff9e7;
}

.archive-info strong {
    color: #725600;
}

.archive-info p {
    margin:
        8px 0 0;
}

.archive-button {
    padding:
        11px 18px;

    border: 0;
    border-radius: 8px;

    color: #ffffff;
    background: #9a7200;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.archive-button:hover {
    filter: brightness(0.92);
}


/* ---------------------------------------------------------
 * Archivverwaltung
 * --------------------------------------------------------- */

.archive-header {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-bottom: 28px;
}

.archive-header > div {
    padding: 12px;

    border:
        1px solid
        var(--border);

    border-radius: 8px;

    background: #fafafa;
}

.archive-header strong,
.archive-header span {
    display: block;
}

.archive-header strong {
    margin-bottom: 4px;

    font-size: 12px;
}

.archive-header span {
    color: var(--muted);

    font-size: 12px;
}

.archive-user-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.archive-user {
    display: grid;

    grid-template-columns:
        minmax(220px, 2fr)
        minmax(150px, 1fr)
        minmax(100px, auto)
        minmax(180px, auto);

    align-items: center;

    gap: 18px;

    padding: 13px;

    border:
        1px solid
        var(--border);

    border-radius: 9px;
}

.archive-user-main strong,
.archive-user-main span {
    display: block;
}

.archive-user-main span {
    margin-top: 3px;

    color: var(--muted);
}

.archive-role,
.archive-rooms {
    color: var(--muted);

    font-size: 12px;
}

.archive-user-action {
    display: flex;
    justify-content: flex-end;
}

.reactivate-button {
    padding:
        8px 12px;

    border:
        1px solid
        var(--border);

    border-radius: 7px;

    background: #ffffff;

    font-weight: 600;
    cursor: pointer;
}

.reactivate-button:hover {
    border-color: var(--luw-red);
}

.archive-full-reactivation {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    margin-top: 30px;
    padding-top: 24px;

    border-top:
        1px solid
        var(--border);
}

.archive-full-reactivation p {
    margin:
        5px 0 0;

    color: var(--muted);
    font-size: 13px;
}

.primary-button {
    padding:
        11px 16px;

    border: 0;
    border-radius: 8px;

    color: #ffffff;
    background: var(--luw-red);

    font-weight: 700;

    cursor: pointer;
}

.primary-button:hover {
    filter: brightness(0.94);
}


@media (max-width: 800px) {

    .archive-header {
        grid-template-columns: 1fr;
    }

    .archive-user {
        grid-template-columns: 1fr;
    }

    .archive-user-action {
        justify-content: flex-start;
    }

    .archive-full-reactivation {
        flex-direction: column;
        align-items: flex-start;
    }
}
