/* ═══════════════════════════════════════════════════════════════
   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"],
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;
}

/* ─── 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; }

/* ─── 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;
}

/* ─── 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-inner { padding: 0 16px; }
    .header-name { font-size: 1.1rem; }
    table { font-size: 0.82rem; }
    thead th, td { padding: 9px 12px; }
    .page-heading h1 { font-size: 1.5rem; }
    .auth-card { padding: 32px 24px; }
}
