/* Supplemental styles for features added on top of the original design.
   Kept separate from main.min.css so the original stays untouched. */

/* .hidden must beat later display rules (e.g. .auth-form { display:flex }). */
.hidden { display: none !important; }

/* --- Buttons ------------------------------------------------------------- */
.secondary-button {
    background: #f5f5f5;
    color: #111;
    border: 1px solid #d8d8d8;
}

.secondary-button:hover {
    background: #e9e9e9;
}

.danger-button {
    background: #dc3545;
}

.danger-button:hover {
    background: #b52a37;
}

.link-button {
    background: transparent;
    color: var(--primary-red);
    border: none;
    padding: 0;
    margin: 0;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.link-button:hover {
    background: transparent;
}

.event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.event-actions button {
    margin-top: 0;
}

/* --- User action buttons ------------------------------------------------- */
.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.user-actions button {
    margin-top: 0;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

/* --- Event deadline / history / toolbar ---------------------------------- */
.event-card__deadline {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.event-card__deadline.deadline-passed {
    color: #dc3545;
    font-weight: 700;
}

.event-card__toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.event-history {
    display: none;
    background: var(--surface-muted);
    border-radius: 12px;
    padding: 0.5rem 1rem;
}

.event-history.visible {
    display: block;
}

.event-history ul {
    margin: 0;
    padding-left: 1.2rem;
}

.event-history li {
    margin: 0.35rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Statistics page ----------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.stats-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-red);
    line-height: 1;
}

.stats-label {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

#stats-content section {
    margin-bottom: 1.5rem;
}

/* --- Login / auth redesign ---------------------------------------------- */
body.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #a80b25 0%, #6f0518 100%);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-red);
    margin-bottom: 1.5rem;
}

.auth-logo {
    width: 40px;
    height: 40px;
}

.auth-title {
    text-align: center;
    margin-bottom: 0.25rem;
    color: #111;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: none;
    margin: 0;
}

.auth-form label {
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.auth-form input {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(168, 11, 37, 0.15);
}

.auth-form button {
    margin-top: 1.25rem;
    padding: 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
}

.auth-error {
    background: #fde8ea;
    color: #a80b25;
    border: 1px solid #f3b4bd;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.auth-register {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}


/* ========================================================================= *
 *  Shared theme — bring the content pages in line with the login redesign.
 *  Loaded after main.min.css, so equal-specificity rules here win.
 * ========================================================================= */

body:not(.login-page) {
    background: #f4f5f7;
    color: #131313;
}

/* --- Navigation: sidebar on desktop, top bar + hamburger on mobile ------- */
nav#nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(160deg, #a80b25 0%, #8a0a1f 100%);
    color: #fff;
    border-bottom: none;
    z-index: 900;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    color: #fff;
    white-space: nowrap;
}

.nav-section {
    margin-bottom: 0.35rem;
}

.nav-section__title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.65;
    margin: 0.85rem 0 0.3rem;
    padding: 0 0.85rem;
}

nav#nav .nav-item {
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease;
    white-space: nowrap;
}

nav#nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
}

nav#nav .nav-item.active {
    background: rgba(255, 255, 255, 0.22);
    font-weight: 700;
}

.nav-user {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* --- Page headings + intro text ------------------------------------------ */
#main h1 {
    font-size: 2rem;
    color: #111;
}

#main > p {
    color: var(--text-muted);
    max-width: 65ch;
    line-height: 1.6;
}

/* --- Buttons (pill style, matching the login CTA) ------------------------ */
button {
    border-radius: 999px;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Keep the small in-table/action buttons compact. */
.user-actions button,
.event-card__toolbar button,
.details-button,
.group-breakdown-toggle button {
    box-shadow: none;
}

.details-button:hover,
.group-breakdown-toggle button:hover {
    transform: none;
    box-shadow: none;
}

/* --- Inputs / selects / textareas ---------------------------------------- */
input,
select,
textarea {
    font-family: inherit;
    border-radius: 10px !important;
    border: 1px solid #ccc;
    padding: 0.7rem !important;
    font-size: 1rem;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(168, 11, 37, 0.15);
}

/* --- Modals: light card to match the auth card --------------------------- */
modal .modal-content {
    background: #fff;
    color: #111;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.28);
    max-width: 460px;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

modal .modal-content h2,
modal .modal-content h3 {
    color: #111;
}

modal .modal-content .close-button {
    color: #999;
}

modal .modal-content .close-button:hover {
    color: var(--primary-red);
}

modal .modal-content label {
    color: #333;
}

modal .modal-content form {
    max-width: none;
}

modal .modal-content form button[type="submit"] {
    margin-top: 1.25rem;
    padding: 0.85rem;
}

/* Red "delete" submit in the edit-event modal. */
#delete-event-form-btn {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    margin-top: 0.5rem;
}

#delete-event-form-btn:hover {
    background: #dc3545;
    color: #fff;
}

/* --- Standalone tables (user list) as a clean card ----------------------- */
#user-list table,
#stats-content table {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow);
}

#user-list th,
#stats-content th {
    background: #faf7f7;
    color: #111;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#user-list td,
#stats-content td {
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

#user-list tr:last-child td,
#stats-content tr:last-child td {
    border-bottom: none;
}

#user-list tr:hover td {
    background: #fcfafa;
}

/* --- Group list as cards ------------------------------------------------- */
#group-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
    max-width: 620px;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.group-item span {
    font-weight: 700;
    color: #111;
}

.group-item button {
    margin-top: 0;
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 0.4rem 0.9rem;
}

.group-item button:hover {
    background: #dc3545;
    color: #fff;
}

/* --- Calendar subscribe buttons stack neatly ----------------------------- */
.calendar-subscribe #copy-calendar-link-btn,
.calendar-subscribe #add-google-calendar-btn,
.calendar-subscribe #add-apple-calendar-btn,
.calendar-subscribe #add-outlook-calendar-btn {
    margin-right: 0.5rem;
}


/* ========================================================================= *
 *  Portal (Phase 1): hamburger nav, dashboard, aktuelles, leitfaden,
 *  ausweis, einstellungen, calendar.
 * ========================================================================= */

/* --- Hamburger button ---------------------------------------------------- */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-top: 0;
    padding: 0.25rem 0.5rem;
}

.nav-toggle:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.nav-toggle .material-icons {
    color: #fff;
    font-size: 1.6rem;
}

/* Desktop: fixed left sidebar, content shifted right. */
@media (min-width: 761px) {
    nav#nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        padding: 1.25rem 1rem;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(168, 11, 37, 0.18);
    }

    .nav-header {
        margin-bottom: 1rem;
    }

    nav#nav .nav-items {
        display: flex !important;
        flex-direction: column;
    }

    #main {
        margin-left: 250px;
    }
}

/* Mobile: top bar with a hamburger dropdown. */
@media (max-width: 760px) {
    nav#nav {
        position: sticky;
        top: 0;
        padding: 0.85rem 1rem;
        box-shadow: 0 6px 20px rgba(168, 11, 37, 0.25);
    }

    .nav-toggle {
        display: inline-flex;
    }

    nav#nav .nav-items {
        display: none;
        flex-direction: column;
        padding-top: 0.5rem;
    }

    nav#nav .nav-items.open {
        display: flex;
    }
}

/* --- Dashboard ----------------------------------------------------------- */
.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #fff;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #111;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.dashboard-card .material-icons {
    font-size: 2rem;
    color: var(--primary-red);
}

.dashboard-card__title {
    font-weight: 700;
    font-size: 1.1rem;
}

.dashboard-card__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-event {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #111;
    margin-bottom: 0.6rem;
}

.dashboard-event__date {
    color: var(--primary-red);
    font-weight: 700;
    min-width: 110px;
}

.dashboard-event__name {
    font-weight: 600;
}

/* --- Aktuelles (announcements) ------------------------------------------- */
#announcement-list,
#dashboard-aktuelles {
    display: grid;
    gap: 0.75rem;
}

.announcement-card {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.announcement-card h3 {
    margin: 0 0 0.25rem;
}

.announcement-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}

.announcement-body {
    white-space: pre-wrap;
    color: #333;
    margin: 0;
}

.announcement-card .danger-button {
    margin-top: 0.75rem;
}

#announcement-compose {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin: 1rem 0;
}

#announcement-compose form,
#announcement-compose textarea {
    max-width: none;
    width: 100%;
}

/* --- Leitfaden (wiki) ---------------------------------------------------- */
.leitfaden-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.leitfaden-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.leitfaden-content {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    white-space: pre-wrap;
    line-height: 1.6;
    color: #222;
    min-height: 120px;
}

#leitfaden-textarea {
    width: 100%;
    font-family: inherit;
}

/* --- Mitgliederausweis --------------------------------------------------- */
.ausweis-card {
    max-width: 420px;
    background: linear-gradient(135deg, #a80b25, #7a0618);
    color: #fff;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

.ausweis-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.ausweis-card__header .material-icons {
    color: #fff;
}

.ausweis-card__body {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ausweis-field {
    display: flex;
    flex-direction: column;
}

.ausweis-field span {
    font-size: 0.8rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ausweis-field strong {
    font-size: 1.15rem;
}

.ausweis-qr {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    color: #111;
}

.ausweis-qr svg {
    width: 200px;
    height: 200px;
}

/* --- Einstellungen ------------------------------------------------------- */
.settings-section {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-width: 600px;
}

.settings-status {
    color: var(--text-muted);
}

/* --- Calendar view ------------------------------------------------------- */
.calendar {
    background: #fff;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.calendar-nav,
.calendar-views {
    display: flex;
    gap: 0.5rem;
}

.calendar-toolbar button {
    margin-top: 0;
    padding: 0.4rem 0.8rem;
}

.calendar-title {
    font-weight: 800;
    font-size: 1.15rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-weekday {
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.35rem 0;
    font-size: 0.85rem;
}

.cal-cell {
    min-height: 96px;
    background: var(--surface-muted);
    border-radius: 8px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.calendar-grid--week .cal-cell {
    min-height: 220px;
}

.cal-cell--other {
    opacity: 0.45;
}

.cal-cell--today {
    outline: 2px solid var(--primary-red);
}

.cal-daynum {
    font-size: 0.8rem;
    font-weight: 700;
    color: #333;
}

.cal-event {
    font-size: 0.72rem;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-event--created {
    background: #28a745;
}

.cal-event--ics {
    background: #f0ad4e;
    cursor: pointer;
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.cal-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 0.75rem;
}

.cal-dot--event {
    background: #28a745;
}

.cal-dot--ics {
    background: #f0ad4e;
}

.calendar-subscribe {
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .cal-cell {
        min-height: 68px;
    }

    .cal-event {
        font-size: 0.6rem;
    }
}

/* --- Nextcloud file browser (Dokumente / Marketing) ---------------------- */
.nc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.nc-list {
    display: grid;
    gap: 0.4rem;
}

.nc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.nc-item.nc-dir {
    cursor: pointer;
}

.nc-item.nc-dir:hover {
    background: #fcfafa;
}

.nc-item .material-icons {
    color: var(--primary-red);
}

.nc-name {
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nc-size {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nc-btn {
    margin-top: 0;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    background: var(--primary-red);
    color: #fff;
}

.nc-btn.secondary-button {
    background: #f5f5f5;
    color: #111;
    border: 1px solid #d8d8d8;
}

.nc-featured {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.nc-featured-card {
    background: #fff;
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nc-featured-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--surface-muted);
}

.nc-featured-icon {
    font-size: 4rem !important;
    color: var(--primary-red);
    text-align: center;
    padding: 1.5rem 0;
}

.nc-featured-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nc-featured-actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Anfragen ------------------------------------------------------------ */
#anfrage-form {
    max-width: 640px;
    width: 100%;
}

#anfrage-form textarea {
    width: 100%;
    font-family: inherit;
}

.anfrage-msg {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    max-width: 640px;
}

.anfrage-msg.ok {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #bcdfca;
}

.anfrage-msg.err {
    background: #fde8ea;
    color: #a80b25;
    border: 1px solid #f3b4bd;
}


/* --- Dashboard RSVP + event highlight ------------------------------------ */
.dashboard-event {
    justify-content: space-between;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.dashboard-event__info {
    display: flex;
    gap: 0.35rem 1rem;
    align-items: center;
    flex-wrap: wrap;
    text-decoration: none;
    color: #111;
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
}

/* Buttons flush to the right edge, no gap, full card height. */
.dashboard-event__rsvp {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.rsvp-btn {
    margin: 0;
    width: 2.9rem;
    padding: 0;
    border-radius: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.rsvp-btn:hover {
    transform: none;
    box-shadow: none;
    filter: brightness(0.94);
}

.rsvp-btn.yes-button { background: #28a745; }
.rsvp-btn.no-button { background: #dc3545; }
.rsvp-btn.maybe-button { background: #ffb800; color: #111; }

.event-card--highlight {
    outline: 3px solid var(--primary-red);
    outline-offset: 3px;
}

/* --- Leitfaden wiki ------------------------------------------------------ */
.wiki-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.wiki-sidebar {
    position: sticky;
    top: 1rem;
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.wiki-sidebar #wiki-search {
    width: 100%;
    margin-bottom: 0.5rem;
}

.wiki-sidebar #wiki-new-page {
    width: 100%;
    margin: 0.25rem 0 0.75rem;
}

.wiki-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 0.6rem;
}

.wiki-tree > ul {
    padding-left: 0;
}

.wiki-tree-link {
    display: block;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.35rem;
    border-radius: 10px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
}

.wiki-tree-link:hover {
    background: #ececec;
}

.wiki-tree-link.active {
    background: #fff;
    border-color: var(--primary-red);
    color: var(--primary-red);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--primary-red);
}

.wiki-search-results {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.wiki-search-hit {
    display: block;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--surface-muted);
    text-decoration: none;
    color: #333;
}

.wiki-search-hit strong {
    display: block;
    color: var(--primary-red);
}

.wiki-search-hit span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.wiki-search-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.wiki-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.wiki-actions {
    display: flex;
    gap: 0.5rem;
}

.wiki-actions button {
    margin-top: 0;
}

.leitfaden-content .wiki-link {
    color: var(--primary-red);
    font-weight: 600;
}

#wiki-editor label {
    display: block;
    font-weight: 700;
    margin: 0.75rem 0 0.25rem;
}

#wiki-editor input,
#wiki-editor textarea {
    width: 100%;
    font-family: inherit;
}

@media (max-width: 760px) {
    .wiki-layout {
        grid-template-columns: 1fr;
    }

    .wiki-sidebar {
        position: static;
    }
}


/* --- Helferlisten -------------------------------------------------------- */
.print-only { display: none; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

#helfer-lists {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    max-width: 640px;
}

.helfer-list-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: #fff;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #111;
}

.helfer-list-card strong { color: var(--primary-red); }
.helfer-list-card span { color: var(--text-muted); font-size: 0.9rem; }

.helfer-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.helfer-controls button { margin-top: 0; }

.helfer-table-wrap { overflow-x: auto; margin-top: 1rem; }

.helfer-table {
    border-collapse: collapse;
    background: #fff;
    min-width: 600px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.helfer-table th,
.helfer-table td {
    border: 1px solid #e6e6e6;
    padding: 0.5rem;
    vertical-align: top;
    text-align: left;
}

.helfer-table tr:first-child th {
    background: var(--primary-red);
    color: #fff;
    white-space: nowrap;
}

.helfer-table tr:not(:first-child) th {
    background: var(--surface-muted);
    white-space: nowrap;
}

.helfer-table td { min-width: 130px; }

.helfer-axis-remove {
    margin: 0;
    padding: 0 0.3rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    box-shadow: none;
    cursor: pointer;
}

.helfer-table tr:not(:first-child) th .helfer-axis-remove { color: var(--primary-red); }
.helfer-axis-remove:hover { transform: none; box-shadow: none; }

/* Chips */
.helfer-chip {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.helfer-chip__name { font-weight: 600; }
.helfer-chip__icon { font-size: 1rem; vertical-align: middle; margin-left: 0.25rem; }

.helfer-chip--self {
    background: #fff;
    border-color: var(--primary-red);
    box-shadow: inset 3px 0 0 var(--primary-red);
}
.helfer-chip--self .helfer-chip__name { color: var(--primary-red); font-weight: 700; }

.helfer-chip--decline { background: #fdecea; border-color: #f5b5ae; }
.helfer-chip--decline .helfer-chip__icon { color: #dc3545; }
.helfer-chip--move { background: #fff4e5; border-color: #ffcf8f; }
.helfer-chip--move .helfer-chip__icon { color: #d98207; }

.helfer-chip__note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.helfer-chip__note--resp { color: #1e7e34; }
.helfer-chip__pending { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }

.helfer-chip__actions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.3rem; }
.helfer-mini {
    margin: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    box-shadow: none;
}
.helfer-mini:hover { transform: none; box-shadow: none; }

.helfer-move-form { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; }
.helfer-move-form select,
.helfer-move-form input { padding: 0.3rem; font-size: 0.8rem; }

.helfer-add input {
    width: 100%;
    min-width: 90px;
    padding: 0.35rem;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.helfer-axis-add { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.helfer-axis-add__group { display: flex; gap: 0.35rem; }
.helfer-axis-add input { padding: 0.4rem; }
.helfer-axis-add button { margin-top: 0; }

/* Mobile cards */
.helfer-cards { display: none; }
.helfer-card-block {
    background: #fff;
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.helfer-card-block h3 { color: var(--primary-red); margin-bottom: 0.5rem; }
.helfer-card-cat { margin-bottom: 0.75rem; }
.helfer-card-cat h4 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.helfer-empty { color: var(--text-muted); margin: 0; }

@media (max-width: 760px) {
    .helfer-table-wrap { display: none; }
    .helfer-cards { display: block; }
    #helfer-detail.helfer-force-table .helfer-table-wrap { display: block; }
    #helfer-detail.helfer-force-table .helfer-cards { display: none; }
}

/* Print */
.helfer-print-header { display: none; }

@media print {
    nav#nav,
    .no-print { display: none !important; }
    #main { margin-left: 0 !important; max-width: none; padding: 0; }
    body { background: #fff; }
    .helfer-print-header {
        display: flex !important;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .helfer-print-logo { width: 48px; height: 48px; }
    .helfer-cards { display: none !important; }
    .helfer-table-wrap { display: block !important; overflow: visible; }
    .helfer-table { min-width: 0; }
    .helfer-chip__actions,
    .helfer-add { display: none !important; }
}


/* ========================================================================= *
 *  Batch: nav icon, footer, spinners, fireworks, charts, login scanner,
 *  helfer dropdown, calendar list/mobile, print tweaks.
 * ========================================================================= */

.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-icon { width: 26px; height: 26px; }

.app-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.app-footer a { color: var(--text-muted); text-decoration: none; }
.app-footer a:hover { color: var(--primary-red); text-decoration: underline; }
@media (min-width: 761px) { .app-footer { margin-left: 250px; } }

/* Loading spinner */
.spinner {
    width: 32px;
    height: 32px;
    margin: 1.5rem auto;
    border: 3px solid var(--border);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fireworks-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2000;
}

/* Dashboard event time + open affordance */
.dashboard-event__when { display: flex; flex-direction: column; min-width: 110px; }
.dashboard-event__time { color: var(--text-muted); font-size: 0.8rem; }
.dashboard-event__open { color: var(--primary-red); margin-left: auto; }
@media (max-width: 760px) { .dashboard-event__open { display: none; } }

/* Weiteres cards wide enough for full words */
.dashboard-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.dashboard-card__title, .dashboard-card__desc { overflow-wrap: break-word; word-break: normal; }

/* Nextcloud buttons become icons on mobile; rows wrap (no overflow) */
.nc-btn { display: inline-flex; align-items: center; gap: 0.3rem; }
.nc-btn .material-icons { font-size: 1.1rem; color: inherit; }
.nc-item { flex-wrap: wrap; }
@media (max-width: 760px) { .nc-btn__label { display: none; } }

/* Stats charts */
.stats-chart {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}
.stats-chart canvas { max-height: 340px; }

/* Login: member section + QR scanner */
#member-login { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
#scan-qr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem;
    border-radius: 999px;
}
#qr-video { width: 100%; border-radius: 12px; background: #000; max-height: 260px; object-fit: cover; }
#admin-login-toggle { display: block; margin: 0.5rem auto 0; }
.auth-note { font-size: 0.85rem; color: var(--text-muted); }

/* Helfer custom dropdown */
.helfer-add { position: relative; }
.helfer-dropdown {
    position: fixed;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-height: 220px;
    overflow-y: auto;
    min-width: 160px;
}
.helfer-dropdown__item { padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.85rem; }
.helfer-dropdown__item:hover { background: var(--surface-muted); }
.helfer-dropdown__item--assigned { color: #d98207; }
.helfer-dropdown__section {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: #faf7f7;
}
.helfer-dropdown__empty { padding: 0.5rem 0.6rem; color: var(--text-muted); font-size: 0.85rem; }

/* Helfer: back-button spacing + toggle only on mobile */
#helfer-back { margin-bottom: 1.5rem; }
@media (min-width: 761px) { .helfer-view-toggle { display: none; } }

/* Calendar list view + mobile vertical week */
.calendar-list { display: grid; gap: 0.75rem; }
.cal-list-day {
    background: #fff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.cal-list-date { font-weight: 700; color: var(--primary-red); margin-bottom: 0.4rem; }
.cal-list-day .cal-event { margin-bottom: 0.3rem; }
@media (max-width: 760px) {
    .calendar-grid--week { grid-template-columns: 1fr; }
    .calendar-grid--week .cal-weekday { display: none; }
    .calendar-grid--week .cal-cell { min-height: auto; }
}

/* Helfer print: white background, no card styling for chips */
@media print {
    .helfer-chip {
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.15rem 0 !important;
    }
    .helfer-chip--self .helfer-chip__name { color: #111 !important; }
    .helfer-chip__note--resp { color: #111 !important; }
    .app-footer { display: none !important; }
}


/* --- Footer links inside the sidebar (below username) -------------------- */
.nav-footer { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.5rem; }
.nav-footer a { color: rgba(255, 255, 255, 0.75); font-size: 0.8rem; text-decoration: none; }
.nav-footer a:hover { color: #fff; text-decoration: underline; }

/* --- Aktuelles priority -------------------------------------------------- */
.announcement-prio-icon { font-size: 1.1rem; vertical-align: middle; margin-right: 0.25rem; }
.announcement-card--high { border-left: 4px solid #dc3545; }
.announcement-card--high h3 { color: #a80b25; }
.announcement-card--high .announcement-prio-icon { color: #dc3545; }
.announcement-card--low { opacity: 0.85; }
.announcement-card--low .announcement-prio-icon { color: var(--text-muted); }

/* --- Events: past-toggle as a centered link ----------------------------- */
.past-events-toggle { margin-top: 1.25rem; text-align: center; }

/* --- Helferliste print: pure black & white, ruled table ----------------- */
@media print {
    html, body { background: #fff !important; }
    #main { background: #fff !important; }
    .helfer-axis-remove,
    .helfer-controls,
    .helfer-add,
    .helfer-axis-add,
    .helfer-chip__actions,
    .helfer-move-form { display: none !important; }

    .helfer-table-wrap { border-radius: 0 !important; }
    .helfer-table { border-radius: 0 !important; border: 1px solid #000 !important; border-collapse: collapse; }
    .helfer-table th,
    .helfer-table td { border: 1px solid #000 !important; color: #000 !important; }
    .helfer-table tr:first-child th,
    .helfer-table tr:not(:first-child) th { background: #fff !important; color: #000 !important; }

    .helfer-chip,
    .helfer-chip--self,
    .helfer-chip--decline,
    .helfer-chip--move {
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        color: #000 !important;
    }
    .helfer-chip__name,
    .helfer-chip__note,
    .helfer-chip__note--resp,
    .helfer-chip__icon { color: #000 !important; }
}

/* --- Marketing "Empfohlen": keep both action buttons inside the card ------ */
.nc-featured-actions { flex-wrap: wrap; }
.nc-featured-actions .nc-btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Organisation settings page ------------------------------------------ */
.settings-form { max-width: 640px; }
.settings-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
}
.settings-group legend { font-weight: 700; padding: 0 0.4rem; }
.settings-form label {
    display: block;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem;
}
.settings-form input,
.settings-form textarea { width: 100%; font-family: inherit; }
.settings-form small { color: var(--text-muted); display: block; margin-top: 0.35rem; }
.settings-actions { display: flex; align-items: center; gap: 1rem; }
.settings-status { color: var(--text-muted); }
.org-logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.org-logo-preview {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--surface-muted);
}
.org-logo-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
