:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface-hover: #243044;
    --border: #2d3a4f;
    --text: #e8edf4;
    --text-muted: #8b9cb3;
    --accent: #16a34a;
    --accent-soft: rgba(22, 163, 74, 0.18);
    --brand-highlight: #22c55e;
    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, 0.15);
    --orange: #f59e0b;
    --orange-soft: rgba(245, 158, 11, 0.15);
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 197, 94, 0.2), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(22, 163, 74, 0.1), transparent);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

header {
    margin-bottom: 2rem;
}

header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header .subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.path-mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    word-break: break-all;
}

.rights-pill {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-group-member td {
    background: rgba(0, 0, 0, 0.12);
}

.sub-member {
    padding-left: 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.site-brand {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.site-brand .brand-highlight {
    color: var(--brand-highlight);
    font-weight: 700;
}

.info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.15rem 1.1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.info-box-title {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 600;
}

.info-steps {
    margin: 0 0 0.75rem;
    padding-left: 1.2rem;
    color: var(--text);
    font-size: 0.9rem;
}

.info-steps li {
    margin-bottom: 0.35rem;
}

.info-note {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}

.info-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.88rem;
}

.info-list li {
    margin-bottom: 0.4rem;
}

.info-box-it {
    border-left-color: var(--orange);
    margin-bottom: 1.5rem;
}

.site-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
}

.user-session {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.user-session-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.user-session-logout {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.user-session-logout:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: #3d4f6a;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.user-chip {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.kuerzel-pill {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
}

.container-narrow {
    max-width: 520px;
    padding-top: 3rem;
}

.login-header {
    margin-bottom: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow);
}

.login-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.1rem;
}

.login-field label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-muted);
}

.login-field input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.4;
}

.login-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-form .btn-block {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.8rem 1rem;
    font-size: 1rem;
}

.login-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-top: 1.75rem;
    font-size: 0.75rem;
}

.login-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.login-footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.login-footer-sep {
    color: var(--border);
    user-select: none;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.alert-error {
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    text-align: left;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.settings-section h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.modal-wide {
    width: min(560px, 100%);
}

.modal-field {
    margin-bottom: 1rem;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.modal-field input,
.modal-field select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.modal-field input:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.modal-field input:focus,
.modal-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.settings-table {
    margin-top: 0.5rem;
}

.settings-form {
    margin-top: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem 1rem;
    align-items: end;
}

.form-field-wide {
    grid-column: span 2;
}

.form-field-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.input-short {
    width: 100%;
    max-width: 180px;
    padding: 0.55rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.input-medium {
    width: 100%;
    max-width: 320px;
    padding: 0.55rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.input-short:focus,
.input-medium:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-input-block {
    display: block;
    margin-bottom: 0.75rem;
}

.inline-edit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.settings-table .inline-edit-row .input-medium {
    flex: 1 1 220px;
    max-width: none;
}

.settings-table .inline-edit-row .input-short {
    flex: 0 1 140px;
    max-width: none;
}

.lookup-form .lookup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.log-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 700px) {
    .form-field-wide {
        grid-column: span 1;
    }

    .input-short,
    .input-medium {
        max-width: 100%;
    }
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
}

.stat-card .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-card.accent .value { color: var(--accent); }
.stat-card.green .value { color: var(--green); }
.stat-card.orange .value { color: var(--orange); }
.stat-card.orange { border-color: rgba(245, 158, 11, 0.35); }

.stat-small {
    font-size: 1.1rem !important;
}

.page-header {
    margin-bottom: 2rem;
}

.app-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.4;
}

.app-switcher-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-switcher-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.app-switcher-link:hover {
    text-decoration: underline;
}

.app-switcher-link.active {
    font-weight: 700;
    text-decoration: underline;
}

.page-top {
    margin-bottom: 1.5rem;
}

.nav-link.nav-home {
    border-style: dashed;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}

.nav-link:hover {
    background: var(--surface-hover);
    border-color: #3d4f6a;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

#search {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

#search::placeholder {
    color: var(--text-muted);
}

.badge-source {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
}

.badge-source.demo {
    background: var(--orange-soft);
    color: var(--orange);
    border-color: rgba(245, 158, 11, 0.3);
}

.group-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.15s;
}

.group-card.has-changes {
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15), var(--shadow);
}

.group-card.has-changes .group-header {
    background: rgba(245, 158, 11, 0.06);
}

.group-header.static {
    cursor: default;
}

.group-header.static:hover {
    background: transparent;
}

.group-card.hidden {
    display: none;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.group-header:hover {
    background: var(--surface-hover);
}

.group-header .chevron {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.group-card.open .group-header .chevron {
    transform: rotate(90deg);
}

.group-info {
    flex: 1;
    min-width: 0;
}

.group-info .name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.group-info .email {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
}

.member-badge {
    flex-shrink: 0;
    background: var(--green-soft);
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.change-badge {
    flex-shrink: 0;
    background: var(--orange-soft);
    color: var(--orange);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.export-link {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.35);
    text-decoration: none;
    transition: background 0.15s, filter 0.15s;
}

.export-link:hover {
    background: rgba(34, 197, 94, 0.22);
    filter: brightness(1.08);
}

.group-body {
    display: none;
    border-top: 1px solid var(--border);
    padding: 0.5rem 1.15rem 1rem;
    background: rgba(0, 0, 0, 0.15);
}

.group-card.open .group-body {
    display: block;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.members-table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.members-table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid rgba(45, 58, 79, 0.5);
}

.members-table tr:last-child td {
    border-bottom: none;
}

.col-check {
    width: 4.5rem;
    text-align: center;
}

.check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.check-label input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--orange);
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.row-pending-remove td {
    opacity: 0.75;
    text-decoration: line-through;
    text-decoration-color: rgba(245, 158, 11, 0.8);
}

.row-pending-add td {
    color: #fdba74;
}

.row-done td {
    opacity: 0.45;
}

.pending-section {
    margin-top: 0.75rem;
}

.pending-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.65rem;
    color: var(--orange);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pending-divider::before,
.pending-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(245, 158, 11, 0.45);
}

.pending-add-table {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    overflow: hidden;
}

.status-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.status-pill.add {
    background: rgba(245, 158, 11, 0.2);
    color: #fdba74;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill.remove {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.done {
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.row-done-remove {
    opacity: 0.92;
}

.check-done-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--green);
    font-weight: 700;
    font-size: 1rem;
}

@keyframes blink-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@keyframes blink-row {
    0%, 100% { background: rgba(245, 158, 11, 0.12); }
    50% { background: rgba(245, 158, 11, 0.28); }
}

.blink-soft {
    animation: blink-soft 1.6s ease-in-out infinite;
}

.blink-highlight {
    animation: blink-row 1.4s ease-in-out infinite;
}

.add-member-form {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.add-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.add-email-input,
.add-name-input {
    flex: 1 1 180px;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.add-email-input:focus,
.add-name-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: #3d4f6a;
}

.btn-danger.btn-ghost {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.list-note-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.note-preview {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
}

.note-preview-it {
    margin-bottom: 1rem;
}

.note-preview-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
}

.note-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.note-preview-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

.note-preview-text {
    margin: 0;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-preview-meta {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.note-badge {
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal {
    width: min(520px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1rem 1.15rem;
}

.modal-list-name {
    margin: 0 0 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-all;
}

.modal-hint {
    margin-bottom: 1rem;
}

.modal-input {
    width: 100%;
    margin-bottom: 0.85rem;
}

.note-textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.note-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.note-updated {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.85rem 1.15rem 1rem;
    border-top: 1px solid var(--border);
}

.modal-footer .btn-danger {
    margin-right: auto;
}

.form-hint {
    margin: 0.55rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.it-hint {
    margin-top: 0.75rem;
}

.muted {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.toast {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1000;
    background: #1e3a5f;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    max-width: min(360px, calc(100vw - 2rem));
}

.toast.error {
    background: #4c1d1d;
    border-color: rgba(239, 68, 68, 0.45);
}

.type-pill {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(139, 156, 179, 0.15);
    color: var(--text-muted);
}

.type-pill.group {
    background: var(--accent-soft);
    color: var(--accent);
}

.empty-members {
    padding: 0.75rem 0.6rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.alert {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.alert strong {
    display: block;
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.alert code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.65rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent);
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    display: none;
}

.no-results.visible {
    display: block;
}

/* Admin sub-navigation */
.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1.25rem;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.admin-subnav-link {
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.admin-subnav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.admin-subnav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-link.active {
    color: var(--accent);
    font-weight: 600;
}

/* E-Mail → Verteiler */
.email-picker-section {
    margin-bottom: 1.5rem;
}

.mitglied-view[hidden] {
    display: none !important;
}

.result-toolbar {
    margin-bottom: 1rem;
}

.picker-hint {
    margin-top: 0.65rem;
}

.membership-person {
    margin: 0 0 1.1rem;
    padding: 0.9rem 1.1rem;
    background: var(--accent-soft);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}

.membership-person-email {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    font-family: ui-monospace, Consolas, monospace;
    word-break: break-all;
}

.membership-person-count {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.copy-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
}

.copy-row > span {
    min-width: 0;
    word-break: break-all;
}

.btn-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.btn-copy:hover {
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.45);
    background: var(--accent-soft);
}

.group-info .copy-row {
    display: flex;
    width: 100%;
}

.it-table .copy-row {
    display: flex;
    width: 100%;
}

.excel-member-count {
    margin-bottom: 0.65rem;
}

.excel-member-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    max-height: min(58vh, 580px);
    overflow: auto;
}

.excel-member-table {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.excel-member-table thead th {
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 3;
    background: #1a2332;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.excel-filter-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem;
}

.excel-filter-cell .col-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.excel-filter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-size: 0.88rem;
}

.excel-filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.excel-member-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.excel-member-table tbody td.mono {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.member-row {
    cursor: pointer;
    transition: background 0.1s ease;
}

.member-row:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.member-row.hidden {
    display: none;
}

#member-no-results {
    display: none;
    margin-top: 0.75rem;
    text-align: center;
    color: var(--text-muted);
}

#member-no-results.visible {
    display: block;
}

.error-text {
    color: #f87171;
}

@media (max-width: 600px) {
    .group-header {
        flex-wrap: wrap;
    }

    .member-badge,
    .change-badge,
    .export-link {
        margin-left: 2.25rem;
    }

    .members-table th:nth-child(4),
    .members-table td:nth-child(4) {
        display: none;
    }

    .it-table th:nth-child(5),
    .it-table td:nth-child(5) {
        display: none;
    }
}
