:root {
  /* Pastell-Palette: seriöses, modernes Salbei/Teal statt kühlem Stahlblau */
  --primary: #3f8375;        /* gedämpftes Salbei-Teal, AA-tauglich mit Weiß */
  --primary-dark: #336a5f;   /* Hover */
  --primary-soft: #e6efec;   /* pastelliges Mint für Flächen/Badges */
  --sand: #f3ede4;           /* warmer Pastellton für Wechselflächen */
  --emerald: #2f8f6b;
  --amber: #a9702a;
  --red: #c0605f;
  --ink: #2f3a36;            /* tiefes, entsättigtes Grün-Grau statt Hartgrau */
  --muted: #6d7a74;
  --line: #e6ebe8;
  --bg: #f6f8f7;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 40, 34, 0.06), 0 8px 24px rgba(30, 55, 47, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 560px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hint { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 22px; }
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav a { color: var(--ink); font-weight: 500; }
.main-nav a.active { color: var(--primary); }
.nav-user { color: var(--muted); font-size: 14px; }
.inline-form { display: inline; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f0f4f2; }
.btn-danger { background: #fff; color: var(--red); border-color: #ecccca; }
.btn-danger:hover { background: #fbf1f0; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 17px; }
.btn-block { width: 100%; }

/* Flash */
.flash { margin: 16px 0; padding: 12px 16px; border-radius: 10px; font-size: 15px; }
.flash-success { background: #e8f3ec; color: #2f6b4f; border: 1px solid #cfe6d6; }
.flash-error { background: #f8ebe9; color: #9c4340; border: 1px solid #ecccc9; }
.flash-info { background: #e7f0ee; color: #2f6b5f; border: 1px solid #cfe0da; }

/* Sections */
.site-main { min-height: calc(100vh - 64px - 120px); }
.section { padding: 56px 0; }
.section-alt { background: var(--sand); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: 30px; margin: 0 0 8px; text-align: center; }
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }

/* Hero */
.hero { background: linear-gradient(160deg, #e9f2ee 0%, #f6f8f7 60%); padding: 64px 0; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-text h1 { font-size: 42px; line-height: 1.1; margin: 14px 0 16px; letter-spacing: -0.5px; }
.lead { font-size: 18px; color: #435049; }
.badge-pill { display: inline-block; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px;
  font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.hero-actions { display: flex; gap: 12px; margin: 24px 0 10px; flex-wrap: wrap; }
.hero-note { font-size: 14px; color: var(--muted); }

.hero-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; }
.mini-dash { font-size: 15px; }
.mini-row { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.mini-head { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.mini-total { font-weight: 800; border-bottom: none; font-size: 17px; }
.mini-alert { margin-top: 12px; background: #f7efe0; color: var(--amber); border: 1px solid #ecdcc0;
  border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 14px; }

/* Cards / steps */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-icon { font-size: 28px; }
.card h3 { margin: 10px 0 6px; font-size: 18px; }
.card p { margin: 0; color: #4c5852; font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-num { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; border-radius: 999px; font-weight: 800; margin-bottom: 8px; }
.step h3 { margin: 6px 0; }
.step p { margin: 0; color: #4c5852; }

/* Auth card / forms */
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.form input, .form select, .form textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-weight: 400;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(63,131,117,.18);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-between { display: flex; justify-content: flex-end; }
.link-sm { font-size: 13px; }
.checkbox { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 600; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.fieldset legend { font-weight: 700; padding: 0 6px; color: var(--primary-dark); }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* Dashboard */
.dash-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-header h1 { margin: 0 0 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-label { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { display: block; font-size: 28px; font-weight: 800; margin-top: 6px; }
.stat-accent { background: linear-gradient(135deg, var(--primary), #55a394); color: #fff; border-color: transparent; }
.stat-accent .stat-label { color: #dcece7; }

.empty { text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 24px; }
.empty-icon { font-size: 40px; }
.empty h2 { margin: 12px 0 6px; }

/* Table */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { background: #f5f9f7; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; white-space: nowrap; }
.cycle { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.actions-col { text-align: right; white-space: nowrap; }
.actions-col .btn { margin-left: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-left: 6px; }
.badge-ok { background: var(--primary-soft); color: var(--primary-dark); }
.badge-warn { background: #f7efe0; color: var(--amber); }
.badge-expired { background: #f8ebe9; color: #b34b49; }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); margin-left: 0; }
.sent { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--emerald); }

/* Legal */
.legal h1 { margin-bottom: 4px; }
.legal h2 { margin-top: 28px; font-size: 20px; }
.legal ul { padding-left: 20px; }
.legal-note { margin-top: 28px; color: var(--muted); font-size: 14px; }

/* Footer */
.site-footer { background: #2f3a36; color: #d7ded9; padding: 28px 0; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner a { color: #d7ded9; }
.footer-nav { display: flex; gap: 18px; }
.footer-copy { color: #a7b1ab; font-size: 14px; }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .main-nav { gap: 10px; }
  .nav-user { display: none; }

  /* Tabelle als Karten */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: none; padding: 6px 16px; text-align: left !important; }
  .table td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); }
  .table .num { text-align: left; }
  .actions-col .btn { margin-left: 0; margin-right: 6px; }
}
