/* Gemeinsames Layout Portal-Memberbereich (Demo) */
:root {
    --red-primary: #c70f2e;
    --text-main: #111111;
    --text-muted: #6b7280;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --card: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--text-main);
    background: radial-gradient(ellipse 90% 70% at 50% 0%, #ffe4e8 0, #fce7e9 35%, transparent 70%),
                radial-gradient(ellipse 70% 60% at 100% 100%, #fecaca 0, #fef2f2 40%, transparent 65%),
                linear-gradient(180deg, #fff5f6 0%, #fef2f2 100%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.site-nav {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.site-nav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    text-decoration: none;
    color: var(--red-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.site-nav .brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.nav-link {
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: rgba(199, 15, 46, 0.06);
    color: var(--red-primary);
}

.nav-link.is-active {
    background: rgba(199, 15, 46, 0.1);
    color: var(--red-primary);
    border-color: rgba(199, 15, 46, 0.15);
}

.page-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.member-hero {
    margin-bottom: 28px;
    padding: 24px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 36px rgba(15, 23, 42, 0.06);
}

.member-hero h1 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--red-primary);
}

.member-hero p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
}

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

.dash-card {
    padding: 18px 18px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.dash-card h3 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.dash-card .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.dash-card .value.muted {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-muted);
}

.dash-card-role-view {
    grid-column: 1 / -1;
}

.role-view-lead {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 720px;
}

.prot-role-view-bar {
    margin-bottom: 20px;
}

.role-view-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.role-view-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.role-view-btn:hover {
    background: rgba(199, 15, 46, 0.06);
    border-color: rgba(199, 15, 46, 0.2);
    color: var(--red-primary);
}

.role-view-btn.is-active {
    background: rgba(199, 15, 46, 0.12);
    border-color: rgba(199, 15, 46, 0.35);
    color: var(--red-primary);
    box-shadow: 0 0 0 1px rgba(199, 15, 46, 0.08);
}

.role-view-hint {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
}

.member-role-pill {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
}
.member-role-pill.role-admin { background: #dbeafe; color: #1d4ed8; }
.member-role-pill.role-flugbegleiter { background: #dcfce7; color: #15803d; }
.member-role-pill.role-einsatzzentrale { background: #fef9c3; color: #a16207; }
.member-role-pill.role-fuehrungskraft { background: #ede9fe; color: #6d28d9; }
.member-role-pill.role-qualitaetsmanagement { background: #e0e7ff; color: #4338ca; }
.member-role-pill.role-member { background: #f1f5f9; color: #475569; }

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(180deg, var(--red-primary) 0%, #9f0d26 100%);
    border: none;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(199, 15, 46, 0.25);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary:hover, .btn-secondary:hover {
    filter: brightness(1.03);
}

.auth-gate {
    text-align: center;
    padding: 40px 20px 56px;
}

.auth-gate p {
    color: var(--text-muted);
    max-width: 28rem;
    margin: 0 auto 20px;
    line-height: 1.55;
}

/* Protokolle: 2FA-Bestätigung (protocol-step-up) */
.auth-gate .prot-step-card p {
    max-width: none;
}

.prot-step-card {
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
    padding: 32px 28px 28px;
    border-radius: 22px;
    background: linear-gradient(165deg, #ffffff 0%, #fff9f9 50%, #fff5f6 100%);
    border: 1px solid rgba(199, 15, 46, 0.14);
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.07),
        0 0 0 1px rgba(255, 255, 255, 0.9) inset;
    display: flex;
    flex-direction: column;
    min-height: min(420px, calc(100dvh - 200px));
}

.prot-step-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 16px;
    background: var(--red-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 10px 28px rgba(199, 15, 46, 0.28);
}

.prot-step-card .prot-step-title {
    text-align: center;
    margin-bottom: 12px;
    color: #0f172a;
    font-size: 1.4rem;
}

.prot-step-lead {
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
    color: #64748b;
    margin: 0 0 22px;
}

.prot-step-error {
    display: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    text-align: center;
}

.prot-step-form {
    margin-top: 4px;
}

.prot-step-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
}

.prot-step-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.prot-step-input {
    flex: 1 1 160px;
    min-width: 0;
    padding: 14px 16px;
    font-size: 17px;
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.12em;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.prot-step-input::placeholder {
    color: #cbd5e1;
    letter-spacing: normal;
}

.prot-step-input:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px rgba(199, 15, 46, 0.14);
}

.prot-step-btn {
    flex: 0 0 auto;
    padding-left: 22px;
    padding-right: 22px;
    border-radius: 14px;
    white-space: nowrap;
}

.prot-step-back {
    margin: 0;
    margin-top: auto;
    padding-top: 24px;
    text-align: center;
}

.prot-step-back a {
    color: var(--red-primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(199, 15, 46, 0.35);
    transition: border-color 0.15s, color 0.15s;
}

.prot-step-back a:hover {
    border-bottom-color: var(--red-primary);
}

@media (max-width: 480px) {
    .prot-step-card {
        padding: 26px 20px 22px;
    }
    .prot-step-row {
        flex-direction: column;
    }
    .prot-step-btn {
        width: 100%;
    }
}

.page-title {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.prot-protokolle-main {
    margin-bottom: 24px;
}

.prot-toolbar {
    margin-bottom: 16px;
}

.prot-dispatch-list-wrap {
    margin-bottom: 20px;
}

.prot-list-loading,
.prot-list-empty {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
}

.prot-list-err {
    font-size: 15px;
    line-height: 1.55;
    color: #b91c1c;
    margin: 0;
}

.prot-dispatch-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.prot-dispatch-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 14px;
}

.prot-dispatch-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
}

.prot-dispatch-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    color: #1e293b;
}

.prot-dispatch-table tbody tr:last-child td {
    border-bottom: none;
}

.prot-dispatch-table tbody tr:hover {
    background: rgba(199, 15, 46, 0.04);
}

.dash-card-active-einsatz {
    grid-column: 1 / -1;
    border-left: 4px solid #0ea5e9;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 55%, #ffffff 100%);
}

.dash-card-active-einsatz h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
    color: #0c4a6e;
}

.dash-card-active-einsatz h3::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35);
    flex-shrink: 0;
}

.dash-active-einsatz-body {
    margin-top: 4px;
}

.dash-active-einsatz-loading,
.dash-active-einsatz-empty,
.dash-active-einsatz-err,
.dash-active-einsatz-more {
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    color: var(--text-muted);
}

.dash-active-einsatz-err {
    color: #b91c1c;
}

.dash-active-einsatz-more {
    margin-top: 14px;
    font-size: 14px;
}

.dash-active-einsatz-nr {
    margin: 0 0 4px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0c4a6e;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.dash-active-einsatz-meta {
    margin: 12px 0 16px;
    padding: 0;
}

.dash-active-einsatz-meta > div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 8px 12px;
    align-items: baseline;
    margin-bottom: 8px;
}

.dash-active-einsatz-meta dt {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.dash-active-einsatz-meta dd {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.dash-einsatz-lead {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.55;
    color: #334155;
    max-width: 52rem;
}

.dash-laufende-einsaetze-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-active-einsatz-item {
    margin: 0;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(14, 116, 188, 0.18);
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.dash-active-einsatz-item .dash-active-einsatz-main {
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dash-active-einsatz-item .dash-active-einsatz-meta {
    margin-bottom: 14px;
}

.dash-active-einsatz-item .dash-btn-bearbeiten {
    align-self: flex-start;
}

.dash-einsatz-toolbar {
    margin-top: 18px;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Einsatz-Vorbereitung (Web): nur sichtbar für Einsatzzentrale / Führungskraft */
.einsatz-vorbereitung-card {
    margin: 0 0 24px;
    padding: 28px 24px;
    border-radius: 16px;
    background: linear-gradient(165deg, #f0f9ff 0%, #ffffff 45%, #fff 100%);
    border: 1px solid rgba(14, 116, 188, 0.2);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
    max-width: 720px;
}

.einsatz-vorbereitung-card h3 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0c4a6e;
    letter-spacing: -0.02em;
}

.einsatz-lead {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
}

.einsatz-steps {
    margin: 0 0 18px;
    padding-left: 1.25rem;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.55;
}

.einsatz-steps li {
    margin-bottom: 10px;
}

.einsatz-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.prot-dispatch-msg {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin: 0 0 16px;
    line-height: 1.45;
}
.prot-dispatch-msg.ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.prot-dispatch-msg.err {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.pd-form-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #0c4a6e;
}
.pd-form-hint {
    margin: 0 0 10px;
    font-size: 14px;
    color: #475569;
}
.pd-recipients {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}
.pd-rec-label {
    font-size: 14px;
    cursor: pointer;
    line-height: 1.4;
}
.pd-rec-meta {
    color: #64748b;
    font-size: 12px;
}
.pd-fieldset {
    border: 1px solid rgba(14, 116, 188, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 16px;
}
.pd-fieldset legend {
    font-weight: 600;
    font-size: 14px;
    padding: 0 6px;
    color: #334155;
}
.pd-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}
@media (max-width: 560px) {
    .pd-row { grid-template-columns: 1fr; }
}
.pd-fieldset label {
    display: block;
    font-size: 13px;
    margin-bottom: 10px;
    color: #334155;
}
.pd-input, .pd-textarea {
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
}
.pd-textarea {
    resize: vertical;
    min-height: 80px;
}
.pd-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}
.pd-check input {
    width: 18px;
    height: 18px;
}
.pd-intern {
    display: block;
    font-size: 13px;
    margin-bottom: 16px;
    color: #475569;
}
.pd-submit {
    margin-top: 8px;
}
.pd-form-err {
    color: #b91c1c;
    font-size: 14px;
}

.pd-menu-title {
    margin: 20px 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0c4a6e;
    border-bottom: 1px solid rgba(14, 116, 188, 0.2);
    padding-bottom: 6px;
}
.pd-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
    line-height: 1.5;
}
.pd-hint code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
}
.pd-member-sel {
    margin-bottom: 12px;
}
.pd-sug-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}
.pd-sug-item {
    font: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.pd-sug-item:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
}
.pd-leg-row {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.prot-placeholder {
    padding: 32px 24px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Benutzerverwaltung: Mitglieder-Tabelle */
.org-members-wrap {
    margin-top: 16px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.org-members-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14px;
}
.org-members-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
}
.org-members-th-action {
    text-align: center;
    width: 9rem;
}
.org-members-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}
.org-members-table tbody tr:last-child td {
    border-bottom: none;
}
.org-members-table tbody tr:hover {
    background: rgba(199, 15, 46, 0.04);
}
.org-members-email {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 12px;
    color: #334155;
    line-height: 1.4;
    word-break: break-word;
}
.org-members-td-name {
    font-weight: 500;
    color: #111827;
}
.org-members-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.org-members-type-team {
    background: #ecfdf5;
    color: #047857;
}
.org-members-type-org {
    background: #f1f5f9;
    color: #475569;
}
.org-members-td-action {
    text-align: center;
}
.org-members-td-action .btn-secondary {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 10px;
}
.org-members-dash {
    color: #94a3b8;
    font-size: 1.15rem;
    line-height: 1;
}

/* --- Support-Tickets --- */
.page-wrap--tickets {
    max-width: 1120px;
}

.tickets-hero {
    position: relative;
    margin-bottom: 28px;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
    border-left: 4px solid var(--red-primary);
}

.tickets-hero__inner {
    position: relative;
    padding: clamp(22px, 4vw, 36px) clamp(20px, 4vw, 40px);
}

.tickets-hero__eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red-primary);
}

.tickets-hero__inner h1 {
    margin: 0 0 12px;
    font-size: clamp(1.45rem, 3.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.tickets-hero__lead {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.65;
    color: #374151;
    max-width: 720px;
}

.tickets-hero__bullets {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
}

.tickets-hero__bullets code {
    font-size: 12px;
    background: rgba(199, 15, 46, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    color: #9f1239;
}

.tickets-context-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.tickets-context-sep {
    color: #cbd5e1;
    user-select: none;
}

.tickets-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 24px;
    align-items: start;
}

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

.tickets-panel {
    background: var(--card);
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    padding: 22px 24px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.tickets-panel__title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
}

.tickets-panel__hint {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
}

.ticket-field {
    margin-bottom: 16px;
}

.ticket-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.ticket-field .req {
    color: var(--red-primary);
}

.ticket-field input[type="text"],
.ticket-field select,
.ticket-field textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ticket-field textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.ticket-field input:focus,
.ticket-field select:focus,
.ticket-field textarea:focus {
    outline: none;
    border-color: rgba(199, 15, 46, 0.45);
    box-shadow: 0 0 0 3px rgba(199, 15, 46, 0.12);
}

.ticket-field--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 520px) {
    .ticket-field--row {
        grid-template-columns: 1fr;
    }
}

.ticket-form-msg {
    font-size: 14px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
}

.ticket-form-msg.is-ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.ticket-form-msg.is-err {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ticket-submit {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 14px;
}

.tickets-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tickets-list-head .tickets-panel__title {
    margin: 0;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.tickets-empty {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    padding: 16px;
    text-align: center;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed #e5e7eb;
}

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

.ticket-card {
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    padding: 14px 16px;
    background: #ffffff;
    transition: box-shadow 0.15s, transform 0.12s;
}

.ticket-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.ticket-card__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ticket-card__refrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

.ticket-card__ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--red-primary);
    letter-spacing: 0.02em;
}

.ticket-card__meta {
    font-size: 12px;
    color: var(--text-muted);
}

.ticket-card__subject {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
}

.ticket-card__body {
    margin: 0;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.ticket-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ticket-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ticket-pill--cat {
    background: #f1f5f9;
    color: #475569;
}

.ticket-pill--pri-low {
    background: #f1f5f9;
    color: #64748b;
}

.ticket-pill--pri-normal {
    background: #eff6ff;
    color: #1d4ed8;
}

.ticket-pill--pri-high {
    background: #fef3c7;
    color: #b45309;
}

.ticket-pill--st-open {
    background: #fef2f2;
    color: #b91c1c;
}

.ticket-pill--st-progress {
    background: #e0f2fe;
    color: #0369a1;
}

.ticket-pill--st-wait {
    background: #fef9c3;
    color: #a16207;
}

.ticket-pill--st-resolved {
    background: #dcfce7;
    color: #166534;
}

.ticket-pill--st-closed {
    background: #f3f4f6;
    color: #6b7280;
}

.ticket-card__thread-actions {
    margin-top: 12px;
}

.ticket-thread-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #fafafa;
}

.ticket-thread-panel.hidden {
    display: none;
}

.ticket-thread-msgs {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.ticket-thread-entry {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.ticket-thread-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ticket-thread-entry--staff {
    border-left: 3px solid #2563eb;
    padding-left: 10px;
}

.ticket-thread-entry:not(.ticket-thread-entry--staff) {
    border-left: 3px solid #94a3b8;
    padding-left: 10px;
}

.ticket-thread-entry__meta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.ticket-thread-entry__body {
    font-size: 13px;
    line-height: 1.55;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.ticket-thread-reply-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
}

.ticket-thread-reply-ta {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
    resize: vertical;
    min-height: 72px;
}

.ticket-thread-loading,
.ticket-thread-err {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.ticket-thread-err {
    color: #b91c1c;
}

.ticket-thread-entry--orgadmin {
    border-left: 3px solid #0d9488;
    padding-left: 10px;
}

.ticket-thread-entry--internal {
    background: rgba(124, 58, 237, 0.06);
    border-radius: 8px;
    padding: 10px 10px 10px 12px;
    margin-left: -2px;
}

.org-support-thread {
    margin-top: 8px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.btn-org-support-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.org-support-nav-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.org-support-new-banner {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.org-support-table {
    width: 100%;
    table-layout: fixed;
    min-width: 100%;
}

.org-support-table tbody tr.org-support-row td:first-child {
    box-shadow: inset 4px 0 0 var(--org-support-row-status, #cbd5e1);
}

.org-support-table .td-subject {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.4;
}

.org-support-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-support-pill--cat {
    border: 1px solid #e2e8f0;
}

.org-support-pill--cat-general { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.org-support-pill--cat-protocol-delete { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.org-support-pill--cat-technical { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.org-support-pill--cat-account { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.org-support-pill--cat-billing { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.org-support-pill--cat-other { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }

.org-support-pill--status-open { background: #fef2f2; color: #b91c1c; }
.org-support-pill--status-in-progress { background: #e0f2fe; color: #0369a1; }
.org-support-pill--status-waiting-customer { background: #fef9c3; color: #a16207; }
.org-support-pill--status-resolved { background: #dcfce7; color: #166534; }
.org-support-pill--status-closed { background: #e2e8f0; color: #475569; }

.org-support-pill--prio-low { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.org-support-pill--prio-normal { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.org-support-pill--prio-high { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }

.org-support-new-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    vertical-align: middle;
}

@media (max-width: 720px) {
    .org-support-edit-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Archivierte Protokolle (/member/protokolle.html) */
.prot-archives-hint {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 0 16px;
    max-width: 720px;
}
.prot-archives-loading,
.prot-archives-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
}
.prot-archives-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
.prot-archives-table th,
.prot-archives-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
.prot-pdf-share-code {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin: 8px 0 12px;
    word-break: break-all;
    line-height: 1.45;
}

.prot-pdf-share-meta {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 8px 0 0;
}

.prot-pdf-share-actions {
    margin-top: 16px;
}

.prot-arch-fb-lines {
    line-height: 1.4;
    vertical-align: top;
}

.prot-archives-table thead th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.7);
}
.prot-archives-table tbody tr:last-child td {
    border-bottom: none;
}
.prot-arch-pdf-na {
    font-size: 13px;
    color: var(--text-muted);
}
.prot-archives-table .btn-secondary {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
}
.prot-arch-test {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: #fef3c7;
    color: #92400e;
}
.prot-archive-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.prot-archive-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.prot-archive-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(960px, 100vw - 32px);
    max-height: min(85vh, 900px);
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.prot-archive-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}
.prot-archive-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
}
.prot-archive-modal-body {
    padding: 0;
    overflow: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.prot-archive-layout {
    padding: 0 0 8px;
}
.prot-archive-doc {
    padding: 8px 20px 24px;
    max-width: 880px;
    margin: 0 auto;
}
.prot-archive-doc-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.prot-archive-doc-title {
    margin: 0 0 8px;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}
.prot-archive-doc-meta {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}
.prot-archive-section {
    margin-bottom: 22px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.prot-archive-section-title {
    margin: 0 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--red-primary);
}
.prot-archive-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
}
.prot-archive-kv {
    display: grid;
    grid-template-columns: minmax(110px, 190px) 1fr;
    gap: 4px 14px;
    align-items: start;
}
.prot-archive-kv--full {
    grid-template-columns: 1fr;
}
.prot-archive-dl dt {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.4;
}
.prot-archive-dl dd {
    margin: 0;
    color: var(--text-main);
    line-height: 1.45;
    min-width: 0;
}
.prot-archive-textblock {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-size: 14px;
}
.prot-archive-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.prot-archive-line {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}
.prot-archive-table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}
.prot-archive-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 480px;
}
.prot-archive-data-table th,
.prot-archive-data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}
.prot-archive-data-table thead th {
    background: rgba(199, 15, 46, 0.06);
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.prot-archive-data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.6);
}
.prot-archive-data-table tbody tr:last-child td {
    border-bottom: none;
}
.prot-archive-err {
    margin: 16px 20px;
    color: #b91c1c;
    font-size: 14px;
}
.prot-archive-testnote {
    margin: 16px 20px;
    padding: 12px 14px;
    background: #fef9c3;
    border-radius: 10px;
    border: 1px solid #fde047;
    font-size: 14px;
}
.prot-archive-raw {
    margin: 20px;
    padding: 0 4px 16px;
}
.prot-archive-raw summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.prot-archive-raw summary:hover {
    color: var(--red-primary);
}
.prot-archive-pre {
    margin: 0;
    padding: 14px 16px;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-height: 280px;
    overflow: auto;
}
.prot-archive-modal-body .prot-archives-loading {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .site-nav { padding: 10px 14px; }
    .org-members-table {
        font-size: 13px;
    }
    .org-members-table thead th,
    .org-members-table tbody td {
        padding: 10px 12px;
    }
}
