/* ═══════════════════════════════════════════════════════════════
   GOTHANIA — Design System v2
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Grün/Weiß/Rot Farbschema */
    --navy:       #1b4d2e;   /* Tiefes Waldgrün — Hauptfarbe */
    --navy-h:     #22603a;   /* Hover */
    --gold:       #c0182e;   /* Karmesinrot — Akzentfarbe */
    --gold-h:     #d42035;   /* Hover */
    --bg:         #f4faf6;   /* Sehr helles Mintgrün als Hintergrund */
    --surface:    #ffffff;
    --border:     #c6ddd0;   /* Grünlich getönter Rand */
    --text:       #18301f;   /* Dunkelgrün getönter Text */
    --text-sub:   #4d7560;   /* Gedämpftes Grün */
    --green:      #166534;   /* Erfolg (etwas heller als Hauptgrün) */
    --green-bg:   #dcfce7;
    --green-bd:   #86efac;
    --red:        #991b1b;   /* Fehler-Text (dunkler) */
    --red-bg:     #fee2e2;
    --red-bd:     #fca5a5;
    --r:          10px;
    --r-lg:       16px;
    --shadow:     0 2px 16px rgba(27,77,46,0.08);
    --shadow-md:  0 4px 24px rgba(27,77,46,0.12);
    --shadow-lg:  0 12px 48px rgba(27,77,46,0.20);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ─── AUTH LAYOUT ─── */

.auth-bg {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 75% 30%, rgba(192,24,46,0.14) 0%, transparent 55%),
        linear-gradient(155deg, #0c2414 0%, var(--navy) 55%, #0f2a18 100%);
}

.auth-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-logo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 0 0 6px rgba(192,24,46,0.12);
}

.auth-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}

.auth-sub {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.auth-card a {
    color: var(--navy);
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-top: 16px;
    display: inline-block;
}

/* ─── SITE HEADER ─── */

.site-header {
    background: var(--navy);
    border-bottom: 3px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 14px rgba(0,0,0,0.28);
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
}

.header-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.header-name em {
    color: var(--gold);
    font-style: normal;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── MAIN ─── */

.main {
    flex: 1;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ─── PAGE HEADING ─── */

.page-heading {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-heading h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
    text-align: left;
}

.page-heading p {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ─── CARDS ─── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #faf9f6;
}

.card-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

.card-body {
    padding: 22px;
}

/* ─── ALERTS ─── */

.alert {
    padding: 12px 16px;
    border-radius: var(--r);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
.alert-error   { background: var(--red-bg);   color: var(--red);   border-color: var(--red-bd);   }
.alert-warning { background: #fefce8; color: #854d0e; border-color: #fde68a; }

/* Compat for PHP p.success / p.error */
.success, p.success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); border-left: 4px solid var(--green-bd); border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem; }
.error,   p.error   { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-bd);   border-left: 4px solid var(--red-bd);   border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem; }

/* ─── BUTTONS ─── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--r);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s, border-color 0.18s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); }

.btn-navy {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.btn-navy:hover {
    background: var(--navy-h);
    border-color: var(--navy-h);
    box-shadow: 0 4px 14px rgba(26,39,68,0.28);
}

.btn-gold {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}
.btn-gold:hover {
    background: var(--gold-h);
    border-color: var(--gold-h);
    box-shadow: 0 4px 14px rgba(201,160,68,0.32);
}

.btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.25);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--text-sub);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-bd);
}
.btn-danger:hover { background: #fecaca; }

.btn-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.btn-info:hover { background: #dbeafe; }

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green-bd);
}
.btn-success:hover { background: #bbf7d0; }

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 13px 24px;
    font-size: 1rem;
    width: 100%;
}

/* Raw button reset */
button { font-family: inherit; cursor: pointer; }

/* ─── FORMS ─── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label, label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
}

.col-span-2 { grid-column: span 2; }
@media (max-width: 767px) {
    .col-span-2 { grid-column: span 1; }
}

input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    font-family: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,160,68,0.18);
}

input[readonly] {
    background: var(--bg);
    cursor: not-allowed;
    color: var(--text-sub);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

/* ─── TABLE ─── */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--r);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead { background: var(--navy); }

thead th {
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
}

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gold); }

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9f7f3; }
tbody tr.own-row { background: #fef9ee; }
tbody tr.own-row:hover { background: #fef3d2; }

td {
    padding: 11px 16px;
    vertical-align: middle;
}

/* ─── BADGES ─── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-gold  { background: #fde8eb; color: #9b1422; border: 1px solid #f5b3bc; }  /* Rot-Akzent */
.badge-navy  { background: #e8f5ed; color: #1b4d2e; border: 1px solid #a8d5b8; }  /* Grün-Akzent */
.badge-muted { background: #f1f5f2; color: var(--text-sub); border: 1px solid #d0ddd4; }

/* ─── MEMBER ITEM ─── */

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    transition: background 0.12s;
}

.member-item:last-child { border-bottom: none; }
.member-item:hover { background: #f9f7f3; }

.member-item.own {
    background: #fef9ee;
    border-left: 3px solid var(--gold);
    padding-left: 19px;
}

.member-item.own:hover { background: #fef3d2; }

.member-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 2px;
}

.member-info p {
    font-size: 0.82rem;
    color: var(--text-sub);
    margin: 0;
}

.member-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ─── PROFILE VIEW ─── */

.profile-section { margin-bottom: 24px; }

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}

.profile-row {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 6px 16px;
    padding: 9px 0;
    border-bottom: 1px solid #f0ede6;
    font-size: 0.875rem;
}

.profile-row:last-child { border-bottom: none; }

.profile-label {
    font-weight: 600;
    color: var(--text-sub);
    font-size: 0.82rem;
}

.profile-value { color: var(--text); }

@media (max-width: 600px) {
    .profile-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ─── MODAL ─── */

.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-bg.open { display: flex; }

.modal-box {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 100%;
    max-width: 440px;
}

.modal-box h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* ─── SEARCH ─── */

.search-wrap {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-wrap::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.5;
}

.search-wrap input {
    padding-left: 36px;
}

/* ─── TAG INPUT (Formular) ─── */

.tag-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 10px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f5ed;
    color: var(--navy);
    border: 1px solid #a8d5b8;
    border-radius: 100px;
    padding: 4px 10px 4px 12px;
    font-size: 0.82rem;
    font-weight: 500;
}

.tag-pill button {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

.tag-pill button:hover { color: var(--gold); }

.tag-text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px dashed var(--border);
    border-radius: var(--r);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg);
    font-family: inherit;
    transition: border-color 0.18s, background 0.18s;
}

.tag-text-input:focus {
    outline: none;
    border-color: var(--navy);
    background: var(--surface);
    border-style: solid;
}

.tag-hint {
    font-size: 0.78rem;
    color: var(--text-sub);
}

/* ─── TAG BADGE (Profil — klickbar) ─── */

.tag-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    background: #e8f5ed;
    color: var(--navy);
    border: 1px solid #a8d5b8;
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.tag-badge:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    transform: translateY(-1px);
}

/* ─── NO RESULTS ─── */

.no-results {
    text-align: center;
    color: var(--text-sub);
    font-style: italic;
    padding: 48px 24px;
}

/* ─── TOOLBAR ─── */

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

/* ─── FOOTER ─── */

.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.35);
    text-align: center;
    font-size: 0.8rem;
    padding: 14px;
}

/* ─── UTILITIES ─── */

.flex          { display: flex; }
.flex-wrap     { flex-wrap: wrap; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.items-center  { align-items: center; }
.justify-end   { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.text-center   { text-align: center; }
.text-muted    { color: var(--text-sub); }
.mt-4          { margin-top: 16px; }
.mt-6          { margin-top: 24px; }
.mt-8          { margin-top: 32px; }
.mb-4          { margin-bottom: 16px; }
.mb-6          { margin-bottom: 24px; }
.w-full        { width: 100%; }
.form-actions  { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* ─── STICKY SAVE BAR ─── */
.sticky-save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--surface);
    border-top: 2px solid var(--border);
    padding: 10px 24px;
    box-shadow: 0 -4px 16px rgba(27,77,46,0.10);
}
/* Abstand am Ende des Formulars damit der Inhalt nicht hinter der Bar verschwindet */
.has-sticky-save { padding-bottom: 60px; }

/* ─── ÄMTER ─── */
.amt-edit-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; min-height: 4px; }
.amt-edit-row  { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: var(--r); padding: 6px 10px; }
.amt-add-row            { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: nowrap; }
.amt-add-row > *        { flex-shrink: 0; }
.amt-add-row .amt-main  { flex: 1 1 auto; min-width: 0; }
.amt-sep                { font-size: 0.78rem; color: var(--text-sub); }
.month-inp-wrap         { display: inline-flex; align-items: center; gap: 2px; }
.amt-month-inp          { width: 100px !important; }
.amt-month-inp.input-error { border-color: #c0392b !important; }
.member-not-found       { display: block; font-size: 0.82rem; color: #c0392b; margin-top: 4px; }
em.amt-beendet          { font-style: normal; color: var(--text-sub); font-size: 0.85em; }
.amt-beendet-toggle     { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem;
                          color: var(--text-sub); cursor: pointer; white-space: nowrap; }
.toggle-label           { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem;
                          font-weight: normal; color: var(--text-sub); cursor: pointer; }
.month-pick-btn         { background: none; border: none; cursor: pointer; padding: 0 4px;
                          color: var(--text-sub); font-size: 0.85rem; line-height: 1; flex-shrink: 0; }
.month-pick-btn:hover   { color: var(--gold); }
.month-picker-hidden    { position: absolute; width: 1px; height: 1px;
                          opacity: 0; pointer-events: none; }
.month-pair             { display: flex; gap: 6px; align-items: center; }
.amt-list      { display: flex; flex-direction: column; gap: 4px; }
.amt-entry     { display: flex; align-items: center; gap: 8px; }
.amt-period    { font-size: 0.82rem; color: var(--text-sub); }

/* ─── Verstorben / Deceased ─── */
.tree-node--verstorben {
    background: #1c1c2a;
    border-color: #444;
    opacity: 0.80;
}
.tree-node--verstorben .tree-name { color: #aaa; }
.tree-node--verstorben .tree-avatar { border-color: #555; filter: grayscale(1); }
.tree-node--verstorben .tree-avatar-placeholder { background: #333; }

.tree-node--verstorben .tree-cross {
    font-size: 0.72rem;
    color: #888;
    margin-left: 4px;
    flex-shrink: 0;
}
/* Filter-Chips Suche */
.filter-section            { margin: 0 0 12px; }
.filter-toggle-btn         { background: none; border: 1px solid var(--border); border-radius: 6px;
                              padding: 5px 12px; cursor: pointer; font-size: 0.82rem; color: var(--text-sub); }
.filter-toggle-btn:hover   { border-color: var(--gold); color: var(--gold); }
.filter-group              { margin-bottom: 8px; }
.filter-group-label        { display: inline-block; font-size: 0.73rem; font-weight: 700; color: var(--text-sub);
                              text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.filter-chips-row          { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip               { display: inline-block; padding: 3px 10px; border-radius: 20px;
                              border: 1px solid var(--border); font-size: 0.8rem; color: var(--text-sub);
                              background: var(--bg-card); text-decoration: none; transition: border-color .12s, background .12s; }
.filter-chip:hover         { border-color: var(--gold); color: var(--navy); }
.filter-chip.active        { background: var(--navy); color: #fff !important; border-color: var(--navy); }

/* ─── CONTAINER FALLBACK (steckbrief.php, legacy pages) ─── */

.container {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 28px;
    max-width: 900px;
    margin: 32px auto;
}

@media (max-width: 600px) {
    .container { margin: 16px; padding: 20px; }
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: block;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
}

h1 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
    font-size: 1.2rem;
    margin-bottom: 12px;
}

/* ─── CSS-ALIASE ─── */
:root {
    --muted:   var(--text-sub);
    --bg-card: var(--surface);
}

/* ─── TOGGLE-SWITCH ─── */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-sub);
    user-select: none;
}
.toggle-label input[type="checkbox"] { display: none; }

.toggle-slider {
    width: 36px;
    height: 20px;
    background: #c6ddd0;
    border-radius: 10px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-label input:checked ~ .toggle-slider,
.toggle-label input:checked + .toggle-slider { background: var(--navy); }
.toggle-slider::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-label input:checked ~ .toggle-slider::after,
.toggle-label input:checked + .toggle-slider::after { transform: translateX(16px); }

/* ─── SEGMENTED CONTROL (3-state radio slider) ─── */
.segmented-control {
    display: inline-flex;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.82rem;
}
.segmented-control label {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    cursor: pointer;
    background: transparent;
    border-right: 1px solid var(--border, #ddd);
    transition: background 0.15s, color 0.15s;
    user-select: none;
    white-space: nowrap;
}
.segmented-control label:last-child { border-right: none; }
.segmented-control input[type="radio"] { display: none; }
.segmented-control label:has(input:checked) {
    background: var(--navy, #1a2e4a);
    color: #fff;
}

/* ─── AVATAR-PLACEHOLDER ─── */
.avatar-placeholder {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    flex-shrink: 0;
}

/* ─── BADGE GRÜN ─── */
.badge-green {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-bd);
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
    .main { padding: 20px 16px; }
    .card-body { padding: 16px; }
    .card-header { padding: 12px 16px; }
    .member-item { flex-direction: column; align-items: flex-start; }
    .member-btns { width: 100%; justify-content: flex-end; }
    .header-name { font-size: 1.1rem; }
    table { font-size: 0.82rem; }
    thead th, td { padding: 9px 10px; }
    .page-heading h1 { font-size: 1.5rem; }
    .auth-card { padding: 32px 24px; }
}

/* ── Header: 2-zeilig auf kleinen Screens ── */
@media (max-width: 600px) {
    .header-inner {
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 6px;
    }
    .header-brand { flex: 1; }
    .header-nav {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        padding-bottom: 8px;
        gap: 6px;
    }
    .header-nav .btn-sm {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    .main { padding: 16px 12px; }
    .page-heading h1 { font-size: 1.3rem; }
}

/* ── Tabellen: E-Mail-Spalte auf Mobile ausblenden ── */
@media (max-width: 640px) {
    .col-email { display: none !important; }

    /* Aktions-Buttons in Zellen untereinander */
    td .flex { flex-direction: column; align-items: flex-start; gap: 4px !important; }
    td .flex .btn { width: 100%; justify-content: center; }

    /* Admin-Tabelle: Gruppen-/Rollen-Select volle Breite */
    td select { width: 100%; font-size: 0.8rem; }


}

/* ── Profilseite: 2-Spalten → 1-Spalte ── */
@media (max-width: 700px) {
    .profile-2col { grid-template-columns: 1fr !important; }
    .profile-2col > .card { grid-column: 1 !important; }
}
