:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef5f1;
    --text: #173028;
    --muted: #62746b;
    --line: #dbe5df;
    --brand: #1f6f54;
    --brand-2: #2f8a67;
    --danger: #c25151;
    --warn: #de9a2a;
    --info: #4979ba;
    --shadow: 0 12px 30px rgba(20, 43, 35, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #f4f8f6 0%, var(--bg) 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(219, 229, 223, 0.85);
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 22px;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.top-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.top-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
}

.top-nav a.active,
.top-nav a:hover {
    background: var(--surface-2);
    color: var(--brand);
}

.main-shell {
    padding: 26px 0 40px;
}

.hero {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 26px;
}

.hero-card,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 34px;
}

.hero-card.primary {
    background: linear-gradient(135deg, #163f33 0%, #1f6f54 55%, #2f8a67 100%);
    color: #fff;
    border: none;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 13px;
    margin-bottom: 16px;
}

.hero-card h1 {
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.08;
    margin: 0 0 14px;
}

.hero-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    max-width: 720px;
    line-height: 1.65;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-light {
    background: #fff;
    color: var(--brand);
}

.btn-secondary {
    background: #edf2ef;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warn);
    color: #fff;
}

.btn-info {
    background: var(--info);
    color: #fff;
}

.btn-sm {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-head h1,
.section-title {
    margin: 0;
}

.card {
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-nav-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

a.stat.report-link {
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a.stat.report-link:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(20, 43, 35, 0.12);
}

tr.row-highlight td {
    background: #e8f6ef;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat .value {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat .label {
    color: var(--muted);
    font-weight: 600;
}

.split {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
}

.checklist,
.feature-list {
    display: grid;
    gap: 12px;
}

.feature-item,
.task-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background: #fbfcfd;
}

.feature-item strong,
.task-item strong {
    display: block;
    margin-bottom: 6px;
}

.task-item small,
.feature-item small {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tbody tr:hover {
    background: #f8fbf9;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
}

.badge-aktiv,
.badge-bezahlt,
.badge-auto {
    background: #dff5e8;
    color: #16563e;
}

.badge-beendet,
.badge-abgelehnt {
    background: #eceff2;
    color: #56616b;
}

.badge-offen,
.badge-teilweise-bezahlt,
.badge-manuell {
    background: #fff1d7;
    color: #965d05;
}

.badge-ueberfaellig,
.badge-pruefung {
    background: #ffe0e0;
    color: #9e2727;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.toolbar form,
.inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.inline-search {
    min-width: 260px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-item {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.detail-item span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 5px;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 600;
}

.alert-success {
    background: #dff5e8;
    color: #16563e;
}

.alert-error {
    background: #ffe0e0;
    color: #912b2b;
}

.alert-info {
    background: #ddebff;
    color: #27528c;
}

.alert-warning {
    background: #fff1d7;
    color: #8d5603;
}

.ref-box {
    background: #f2f8f5;
    border: 1px dashed #9bc5b0;
    border-radius: 14px;
    padding: 16px;
    font-family: Consolas, monospace;
    word-break: break-word;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 20px 0 28px;
    color: var(--muted);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .hero,
    .split,
    .detail-grid,
    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .brand-row {
        align-items: start;
        flex-direction: column;
    }
}
/* ============================================================
   Patenschaftsverwaltung – Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:      #2c6e49;
  --brand-dark: #1b4332;
  --brand-light:#d8f3dc;
  --accent:     #40916c;
  --warn:       #e76f51;
  --info:       #457b9d;
  --yellow:     #f4a261;
  --bg:         #f8f9fa;
  --card:       #ffffff;
  --border:     #dee2e6;
  --text:       #212529;
  --muted:      #6c757d;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: #c8e6c9;
  text-decoration: none;
  padding: .4rem .85rem;
  border-radius: 5px;
  transition: background .2s, color .2s;
  font-size: .92rem;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--brand);
  color: #fff;
}

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-header h1 {
  font-size: 1.6rem;
  color: var(--brand-dark);
}

/* ---- Cards / Panels ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--brand-light);
}

/* ---- Dashboard stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  border-top: 4px solid var(--brand);
}

.stat-card.warn  { border-top-color: var(--warn); }
.stat-card.info  { border-top-color: var(--info); }
.stat-card.yellow { border-top-color: var(--yellow); }

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1;
}

.stat-card.warn  .stat-value  { color: var(--warn); }
.stat-card.info  .stat-value  { color: var(--info); }
.stat-card.yellow .stat-value { color: var(--yellow); }

.stat-label {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .35rem;
}

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

th {
  background: var(--brand-dark);
  color: #fff;
  padding: .65rem .9rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:nth-child(even) td { background: #f4f6f4; }
tr:hover td { background: #e8f5e9; }

/* ---- Badges / Status ---- */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-aktiv              { background: #d8f3dc; color: #1b4332; }
.badge-beendet            { background: #f1f3f5; color: #6c757d; }
.badge-offen              { background: #fff3cd; color: #856404; }
.badge-bezahlt            { background: #d8f3dc; color: #1b4332; }
.badge-ueberfaellig       { background: #ffe5e0; color: #9e1414; }
.badge-teilweise_bezahlt  { background: #cfe2ff; color: #0a4a8c; }
.badge-auto               { background: #d8f3dc; color: #1b4332; }
.badge-manuell            { background: #fff3cd; color: #856404; }
.badge-pruefung           { background: #ffe5e0; color: #9e1414; }
.badge-abgelehnt          { background: #f1f3f5; color: #6c757d; }

/* ---- Formulare ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.form-group.full { grid-column: 1 / -1; }

label { font-size: .88rem; font-weight: 600; color: var(--text); }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .92rem;
  background: #fff;
  color: var(--text);
  transition: border-color .2s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(44,110,73,.12);
}

textarea { resize: vertical; min-height: 80px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .48rem 1rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter .15s, box-shadow .15s;
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.1); }

.btn-primary  { background: var(--brand);   color: #fff; }
.btn-dark     { background: var(--brand-dark); color: #fff; }
.btn-danger   { background: var(--warn);    color: #fff; }
.btn-secondary{ background: var(--muted);   color: #fff; }
.btn-info     { background: var(--info);    color: #fff; }
.btn-warning  { background: var(--yellow);  color: #fff; }
.btn-sm       { padding: .3rem .7rem; font-size: .82rem; }

/* ---- Alerts ---- */
.alert {
  padding: .85rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .93rem;
  border-left: 4px solid transparent;
}

.alert-success { background: #d8f3dc; border-color: var(--brand); color: #1b4332; }
.alert-error   { background: #ffe5e0; border-color: var(--warn);  color: #7b1e1e; }
.alert-info    { background: #cfe2ff; border-color: var(--info);  color: #0a4a8c; }
.alert-warning { background: #fff3cd; border-color: var(--yellow);color: #856404; }

/* ---- Filter-Bar ---- */
.filter-bar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.filter-bar .form-group { margin: 0; min-width: 160px; }

/* ---- Detail-Tabelle ---- */
.detail-table { width: 100%; }
.detail-table th {
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: .85rem;
  width: 200px;
  padding: .5rem .75rem;
}
.detail-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* ---- Ref-Box ---- */
.ref-box {
  background: var(--brand-light);
  border: 1px dashed var(--brand);
  border-radius: 5px;
  padding: .75rem 1rem;
  font-family: monospace;
  font-size: .95rem;
  color: var(--brand-dark);
  letter-spacing: .03em;
}

/* ---- Nav Badge (Pruefliste) ---- */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
}

/* ---- Pruefliste Zuordnungs-Panel ---- */
.assign-panel td {
  background: #f0f7f4;
  border-top: 2px solid var(--brand);
  padding: 1rem 1.25rem;
}

.assign-grid {
  grid-template-columns: 1fr 1fr;
}

.zweck-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- User Menu ---- */
.user-menu {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.user-chip small {
  font-weight: 500;
  color: var(--muted);
  font-size: .75rem;
}

.brand-row {
  flex-wrap: wrap;
}

/* ---- Login ---- */
.login-body {
  min-height: 100vh;
  background: linear-gradient(160deg, #eef5f1 0%, #f5f7fb 55%, #e8eef8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrap {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
}

.login-card {
  padding: 2rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.login-brand small {
  display: block;
  color: var(--muted);
  font-size: .8rem;
}

.login-hint {
  margin-top: 1.25rem;
  font-size: .88rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .navbar { flex-direction: column; gap: .5rem; padding: .75rem 1rem; }
  .nav-links { justify-content: center; }
  .page-header { flex-direction: column; align-items: flex-start; }
  th, td { font-size: .82rem; padding: .45rem .6rem; }
}
