/* ═══════════════════════════════════════════════════════════════
   Insight by Bernkon – Sleek Redesign
   Primary:  #4A1C40  (Ringana plum)
   Accent:   #8B4F7E  (lighter plum)
   BG:       #F8F7F5  (warm off-white)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --nav-height: 102px;
  --brand-logo-filter: grayscale(1) contrast(2.6) brightness(0.33) saturate(0.2);
}

/* ── Typography reset (local/system fonts) ────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #F8F7F5;
  color: #1A1A1A;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-weight: 400;
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
}

a {
  color: #4A1C40;
  text-decoration: none;
  transition: opacity 0.15s;
}

a:hover {
  opacity: 0.75;
  text-decoration: none;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 1px solid #EDEBE8;
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  gap: 2.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover {
  opacity: 1;
}

.nav-logo-img {
  width: clamp(210px, 25vw, 290px);
  max-width: 78vw;
  height: auto;
  display: block;
  object-fit: contain;
  filter: var(--brand-logo-filter);
  opacity: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links li a {
  color: #555;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}

.nav-links li a:hover,
.nav-links li a.active {
  background: #F3EEF2;
  color: #4A1C40;
  opacity: 1;
}

.nav-logout {
  border: 1px solid #DEDAD8 !important;
  color: #777 !important;
  margin-left: 0.5rem;
}

.nav-logout:hover {
  background: #F3EEF2 !important;
  border-color: #4A1C40 !important;
  color: #4A1C40 !important;
}

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.75rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border: 1px solid #E7E1E6;
  border-radius: 999px;
  background: #fff;
  flex-shrink: 0;
}

.nav-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #f3eef2;
  border: 1px solid rgba(74, 28, 64, 0.14);
  display: block;
}

.nav-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-user-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4A1C40;
}

.nav-user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5f4f5c;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Hamburger icon */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: 0.5rem;
  width: 36px;
  height: 36px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #4A1C40;
  border-radius: 2px;
  transition: all 0.25s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  overflow-x: clip;
}

.main-content.fullpage {
  max-width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
}

/* ── Standalone App Shell (iOS/Android PWA) ─────────────────── */
body.is-standalone .main-content {
  max-width: 100%;
  margin: 0;
  padding-top: calc(0.9rem + env(safe-area-inset-top, 0px));
  padding-right: calc(0.8rem + env(safe-area-inset-right, 0px));
  padding-bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(0.8rem + env(safe-area-inset-left, 0px));
}

body.is-standalone .nav-inner {
  max-width: 100%;
  padding-right: calc(0.8rem + env(safe-area-inset-right, 0px));
  padding-left: calc(0.8rem + env(safe-area-inset-left, 0px));
}

body.is-standalone .greeting-inner {
  max-width: 100%;
  padding-right: calc(0.8rem + env(safe-area-inset-right, 0px));
  padding-left: calc(0.8rem + env(safe-area-inset-left, 0px));
}

body.is-standalone .site-footer {
  display: none;
}

body.is-standalone .pwa-install-bar {
  display: none !important;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background: #fff;
  border-top: 1px solid #EDEBE8;
  text-align: center;
  padding: 1.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.footer-logo {
  width: clamp(180px, 26vw, 300px);
  height: auto;
  opacity: 1;
  display: block;
  filter: var(--brand-logo-filter);
}

.footer-legal {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #BBB;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-legal a {
  color: #AAA;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-legal a:hover {
  color: #4A1C40;
  opacity: 1;
}

.footer-sep {
  color: #DDD;
}

/* ── Legal pages ─────────────────────────────────────────────── */
.legal-content {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #EDEBE8;
  padding: 2.5rem;
  max-width: 820px;
}

.legal-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 2rem 0 0.6rem;
  letter-spacing: -0.01em;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content p, .legal-content li {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.75;
  margin-bottom: 0.5rem;
}

.legal-content ul, .legal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content a {
  color: #4A1C40;
  text-decoration: underline;
}

.legal-content .legal-meta {
  font-size: 0.8rem;
  color: #AAA;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #EDEBE8;
}

/* ── Auth extra link ─────────────────────────────────────────── */
.auth-extra-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.auth-extra-link a {
  color: #888;
  text-decoration: underline;
}

.auth-extra-link a:hover {
  color: #4A1C40;
}

/* ── Page header ──────────────────────────────────────────────── */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #EDEBE8;
}

.page-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #1A1A1A;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: #888;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  font-weight: 400;
}

/* ── Sections ─────────────────────────────────────────────────── */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #999;
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: #bbb;
  text-transform: none;
  letter-spacing: 0;
}

.section-desc {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border-left: 3px solid;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-error {
  background: #FEF5F5;
  border-color: #E74C3C;
  color: #C0392B;
}

.alert-success {
  background: #F0FDF6;
  border-color: #27AE60;
  color: #1E8449;
}

.alert-info {
  background: #EEF6FF;
  border-color: #3498DB;
  color: #2471A3;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-ok      { background: #D4EDDA; color: #1A6630; }
.badge-error   { background: #FCE4E4; color: #8B0000; }
.badge-pending { background: #FFF3CD; color: #7A5900; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-align: center;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn:hover {
  text-decoration: none;
  opacity: 1;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #4A1C40;
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 28, 64, 0.25);
}

.btn-primary:hover {
  background: #3A1430;
  color: #fff;
  box-shadow: 0 4px 14px rgba(74, 28, 64, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #4A1C40;
  color: #4A1C40;
}

.btn-outline:hover {
  background: #4A1C40;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #666;
  border: 1px solid #DDD;
}

.btn-ghost:hover {
  background: #F5F5F5;
  color: #333;
  border-color: #CCC;
}

.btn-download {
  background: #fff;
  border: 1.5px solid #DEDAD8;
  color: #4A1C40;
  padding: 0.75rem 1.5rem;
}

.btn-download:hover {
  background: #4A1C40;
  color: #fff;
  border-color: #4A1C40;
}

.btn-full {
  width: 100%;
  display: flex;
  padding: 0.9rem;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: #B42318;
  color: #fff;
  box-shadow: 0 2px 8px rgba(180, 35, 24, 0.25);
}

.btn-danger:hover {
  background: #912018;
  color: #fff;
  box-shadow: 0 4px 14px rgba(180, 35, 24, 0.35);
}

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  min-height: 100vh;
  background: #F8F7F5;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.08);
  border: 1px solid #EDEBE8;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.auth-logo-img {
  width: min(86vw, 430px);
  max-width: 100%;
  height: auto;
  margin: 0 auto 0.9rem;
  display: block;
  filter: var(--brand-logo-filter);
  opacity: 1;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: #AAA;
  font-size: 0.875rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: #888;
}

.auth-switch a {
  color: #4A1C40;
  font-weight: 600;
}

/* ── Form elements ────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid #E8E4E0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #FAFAF8;
  color: #1A1A1A;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4A1C40;
  box-shadow: 0 0 0 3px rgba(74, 28, 64, 0.08);
  background: #fff;
}

.code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 1.45rem !important;
  font-weight: 700;
}

.form-hint {
  color: #AAA;
  font-size: 0.78rem;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 2.8rem;
}

.pwd-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  color: #AAA;
  transition: color 0.15s;
}

.pwd-toggle:hover { color: #4A1C40; }

.form-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05);
  border: 1px solid #EDEBE8;
  max-width: 540px;
}

.danger-card {
  border-color: #F3D3CF;
  background: #FFF9F8;
}

.danger-callout {
  border: 1px solid #F1C2BB;
  background: #FDEEEE;
  border-radius: 10px;
  color: #8A1F15;
  font-size: 0.88rem;
  padding: 0.75rem 0.85rem;
  line-height: 1.45;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: #333;
  line-height: 1.45;
}

.checkbox-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: #4A1C40;
}

.checkbox-row a {
  color: #4A1C40;
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 0.5rem;
}

/* ── Sync bar ─────────────────────────────────────────────────── */
.sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #EDEBE8;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.sync-info {
  font-size: 0.875rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-green  { background: #27AE60; box-shadow: 0 0 0 3px rgba(39,174,96,0.15); }
.dot-red    { background: #E74C3C; box-shadow: 0 0 0 3px rgba(231,76,60,0.15); }
.dot-yellow { background: #F39C12; box-shadow: 0 0 0 3px rgba(243,156,18,0.15); }

/* ── Greeting bar ────────────────────────────────────────────── */
.greeting-bar {
  background: linear-gradient(135deg, #ffffff 0%, #f7eff6 100%);
  border-bottom: 1px solid #EDEBE8;
}

.greeting-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.85rem 2rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.greeting-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #927a8f;
  font-weight: 700;
}

.greeting-line {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.04rem;
  letter-spacing: 0.01em;
  color: #4A1C40;
}

/* ── PWA install bar ─────────────────────────────────────────── */
.pwa-install-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 190;
  background: linear-gradient(135deg, #4A1C40 0%, #7B3572 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.pwa-install-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pwa-install-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.pwa-install-text strong {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pwa-install-text span {
  font-size: 0.82rem;
  opacity: 0.92;
}

.pwa-install-close {
  margin-left: auto;
  border: none;
  background: rgba(255,255,255,0.16);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.pwa-install-close:hover {
  background: rgba(255,255,255,0.24);
}

.pwa-pull-refresh {
  position: fixed;
  left: 50%;
  top: 0;
  transform: translate(-50%, -56px);
  z-index: 260;
  background: rgba(26, 26, 26, 0.88);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.pwa-pull-refresh.active {
  transform: translate(-50%, 14px);
}

.pwa-pull-refresh.ready {
  background: #1A6630;
}

.pwa-refresh-fab {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 250;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: #4A1C40;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(74, 28, 64, 0.35);
  cursor: pointer;
}

.pwa-refresh-fab:active {
  transform: translateY(1px);
}

/* ── Generation cards ─────────────────────────────────────────── */
.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.gen-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1rem;
  text-align: center;
  border: 1px solid #EDEBE8;
  transition: transform 0.18s, box-shadow 0.18s;
}

.gen-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.gen-total {
  background: linear-gradient(135deg, #4A1C40 0%, #7B3572 100%) !important;
  color: #fff;
  border-color: transparent !important;
  box-shadow: 0 4px 20px rgba(74,28,64,0.3);
}

.gen-total .gen-label,
.gen-total .gen-sublabel {
  color: rgba(255,255,255,0.65) !important;
}

.gen-total .gen-count {
  color: #fff !important;
}

.gen-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #AAA;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.gen-count {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1A1A1A;
  line-height: 1;
  margin-bottom: 0.3rem;
  letter-spacing: -0.03em;
}

.gen-sublabel {
  font-size: 0.72rem;
  color: #AAA;
  font-weight: 400;
}

/* ── Highlight cards (new this month) ────────────────────────── */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.highlight-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  border: 1px solid #EDEBE8;
  border-top: 3px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s;
}

.highlight-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.highlight-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  opacity: 1;
}

.highlight-kunden  { border-top-color: #3B82F6; }
.highlight-partner { border-top-color: #10B981; }

.highlight-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: block;
}

.highlight-value {
  font-size: 3rem;
  font-weight: 800;
  color: #1A1A1A;
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.04em;
}

.highlight-label {
  font-size: 0.8rem;
  color: #AAA;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Data table ───────────────────────────────────────────────── */
.table-wrap {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #EDEBE8;
  overflow-x: auto;
}

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

.data-table thead {
  background: #F8F7F5;
  border-bottom: 2px solid #EDEBE8;
}

.data-table thead th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  white-space: nowrap;
}

.data-table thead th.num-col {
  text-align: right;
}

.data-table tbody tr {
  border-bottom: 1px solid #F5F3F0;
  transition: background 0.1s;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #FDFCFB;
}

.data-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.data-table td.num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", "Fira Code", "Fira Mono", monospace;
  font-size: 0.875rem;
}

.param-label {
  font-weight: 600;
  color: #1A1A1A;
}

.bezahlt { color: #1A6630; font-weight: 600; }
.offen   { color: #7A5900; font-weight: 500; }

/* ── Download row ─────────────────────────────────────────────── */
.download-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Collapsible source status ───────────────────────────────── */
.source-accordion {
  background: #fff;
  border: 1px solid #EDEBE8;
  border-radius: 14px;
  overflow: hidden;
}

.source-accordion-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  user-select: none;
  background: #fff;
}

.source-accordion-summary::-webkit-details-marker {
  display: none;
}

.source-accordion-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #4A1C40;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.source-accordion-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.source-accordion-chevron {
  color: #8A7E87;
  font-size: 0.95rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.source-accordion[open] .source-accordion-chevron {
  transform: rotate(180deg);
}

.source-accordion-body {
  border-top: 1px solid #F1ECEF;
}

.source-accordion .table-wrap {
  border: none;
  border-radius: 0;
}

/* ── Account info card ────────────────────────────────────────── */
.account-info-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #EDEBE8;
  max-width: 540px;
  margin-bottom: 1.5rem;
}

.account-info-row {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #F5F3F0;
  gap: 1rem;
}

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

.info-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #AAA;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  width: 130px;
  flex-shrink: 0;
}

.info-value {
  font-size: 0.9rem;
  color: #1A1A1A;
}

/* ── Info box ─────────────────────────────────────────────────── */
.info-box {
  background: #FDFCFB;
  border: 1px solid #EDEBE8;
  border-left: 3px solid #4A1C40;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.65;
  max-width: 640px;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #EDEBE8;
  max-width: 480px;
  margin: 2rem auto;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

.empty-state h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.empty-state p {
  color: #888;
  margin-bottom: 1.75rem;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* ── Gen 5–9 small cards ─────────────────────────────────────── */
.gen-grid-small {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.gen-card-sm {
  padding: 10px 8px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #EDEBE8;
}

.gen-count-sm {
  font-size: 1.4rem;
  font-weight: 800;
  color: #444;
  letter-spacing: -0.02em;
}

/* ── KPI table row + links ───────────────────────────────────── */
.npv-row { background: #FDFBFF; }

.kpi-row td:first-child {
  font-weight: 600;
}

.npv-link {
  color: #1A1A1A;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.npv-link:hover {
  color: #4A1C40;
  opacity: 1;
}

.npv-detail-icon {
  font-size: 1em;
  opacity: 0.4;
}

.btn-detail {
  display: inline-block;
  padding: 4px 12px;
  background: transparent;
  color: #4A1C40;
  border: 1px solid #DEDAD8;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78em;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-detail:hover {
  background: #4A1C40;
  color: #fff;
  border-color: #4A1C40;
  opacity: 1;
}

/* ── Historical comparison (tiny inline hints) ───────────────── */
.kpi-hint {
  font-size: 0.68em;
  color: #aaa;
  font-weight: 400;
  white-space: nowrap;
}
.delta-up   { color: #1A6630; }
.delta-down { color: #C0392B; }

/* ── Zielstufe – Dashboard Card ─────────────────────────────── */
.ziel-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ziel-summary-card {
  background: #fff;
  border: 1px solid #EDEBE8;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  position: relative;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}

.ziel-summary-card:hover {
  box-shadow: 0 8px 28px rgba(74,28,64,0.1);
  transform: translateY(-1px);
}

.ziel-current-block {
  text-align: center;
  flex-shrink: 0;
  min-width: 90px;
}

.ziel-current-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4A1C40, #7B3572);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.ziel-current-label {
  font-size: 0.7rem;
  color: #AAA;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.5rem;
  font-weight: 600;
}

.ziel-next-block {
  flex: 1;
  min-width: 0;
}

.ziel-next-title {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.75rem;
}

.ziel-next-title strong {
  color: #1A1A1A;
}

.ziel-prog-row {
  margin-bottom: 0.6rem;
}

.ziel-prog-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 0.2rem;
  gap: 0.5rem;
}

.ziel-prog-nums {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.ziel-bar-bg {
  height: 6px;
  background: #F0EBF4;
  border-radius: 100px;
  overflow: hidden;
}

.ziel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B4F7E, #4A1C40);
  border-radius: 100px;
  transition: width 0.5s ease;
}

.ziel-bar-done {
  background: linear-gradient(90deg, #27AE60, #1E8449) !important;
}

.ziel-check {
  color: #27AE60;
  font-weight: 700;
  margin-left: 0.25rem;
}

.ziel-missing {
  color: #E67E22;
  font-size: 0.75rem;
}

.ziel-alt-hint {
  font-size: 0.75rem;
  color: #AAA;
  margin-top: 0.5rem;
  font-style: italic;
}

.ziel-detail-arrow {
  font-size: 1.5rem;
  color: #CCC;
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
}

.ziel-max .ziel-next-title {
  color: #27AE60;
  font-weight: 600;
}

/* ── Zielstufen Detail Page ──────────────────────────────────── */
.ziel-hero {
  background: linear-gradient(135deg, #4A1C40 0%, #7B3572 100%);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  color: #fff;
}

.ziel-hero-badge {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 0.5rem 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.ziel-hero-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.25rem;
}

.ziel-hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
}

.ziel-hero-sub strong {
  color: #fff;
}

.ziel-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ziel-item {
  background: #fff;
  border: 1px solid #EDEBE8;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  opacity: 0.7;
}

.ziel-item-reached {
  opacity: 1;
  border-color: #C3E6CB;
  background: #F6FFF8;
}

.ziel-item-next {
  opacity: 1;
  border-color: #4A1C40;
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(74,28,64,0.1);
}

.ziel-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.ziel-item-name {
  font-weight: 700;
  font-size: 1rem;
}

.ziel-badge-done {
  color: #1A6630;
}

.ziel-badge-next {
  color: #4A1C40;
  font-family: 'Montserrat', sans-serif;
}

.ziel-badge-pending {
  color: #AAA;
}

.ziel-item-pct {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #4A1C40;
  white-space: nowrap;
}

.ziel-item-reached .ziel-item-pct {
  color: #27AE60;
}

.ziel-conditions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ziel-path-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #AAA;
  margin-bottom: 0.25rem;
  margin-top: 0.25rem;
}

.ziel-path-or {
  color: #C0A0B8;
  border-top: 1px dashed #EDEBE8;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

/* ── Wachstumsbonus ──────────────────────────────────────────── */
.wb-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.wb-badge-active {
  background: #F0FDF6;
  border: 1px solid #C3E6CB;
  color: #1A6630;
}

.wb-badge-active strong { color: #155724; }

.wb-badge-pending {
  background: #FFF8F0;
  border: 1px solid #F5CBA7;
  color: #7D5A00;
}

.wb-badge-pending strong { color: #5D4300; }

.wb-icon { font-size: 1.1rem; flex-shrink: 0; }

.wb-sub {
  font-size: 0.78rem;
  opacity: 0.7;
  margin-left: 0.2rem;
}

/* Detail page list */
.wb-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wb-item {
  background: #fff;
  border: 1px solid #EDEBE8;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.wb-item-done {
  background: #F6FFF8;
  border-color: #C3E6CB;
}

.wb-item-locked {
  opacity: 0.5;
}

.wb-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.wb-item-name {
  font-size: 0.9rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.wb-item-name strong { color: #1A1A1A; }

.wb-note {
  font-size: 0.75rem;
  color: #AAA;
  font-style: italic;
}

.wb-arrow { color: #4A1C40; font-weight: 700; }
.wb-lock  { font-size: 0.85rem; }

.wb-item-pct {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #4A1C40;
  white-space: nowrap;
  flex-shrink: 0;
}

.wb-pct-done { color: #27AE60; }

.ziel-footnote {
  font-size: 0.78rem;
  color: #BBB;
  margin-top: 1.5rem;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .ziel-summary-card {
    flex-direction: column;
    gap: 1rem;
  }
  .ziel-detail-arrow { display: none; }
  .ziel-hero {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ── Provision – Dashboard Card ─────────────────────────────── */
.prov-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.prov-summary-card {
  background: #fff;
  border: 1px solid #EDEBE8;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}

.prov-summary-card:hover {
  box-shadow: 0 8px 28px rgba(74,28,64,0.1);
  transform: translateY(-1px);
}

.prov-total-block {
  text-align: center;
  flex-shrink: 0;
  min-width: 130px;
}

.prov-total-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  color: #1A6630;
  letter-spacing: -0.02em;
  line-height: 1;
}

.prov-total-label {
  font-size: 0.7rem;
  color: #AAA;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.4rem;
  font-weight: 600;
}

.prov-split-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prov-split-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.875rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #F5F3F0;
}

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

.prov-split-label {
  color: #555;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.prov-split-label em {
  font-size: 0.78rem;
  color: #AAA;
  font-style: normal;
}

.prov-split-value {
  font-weight: 700;
  color: #1A6630;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.prov-nodata { color: #E67E22 !important; }

.prov-arrow {
  font-size: 1.5rem;
  color: #CCC;
  flex-shrink: 0;
}

/* ── Provision – Detail Page ─────────────────────────────────── */
.prov-hero {
  background: linear-gradient(135deg, #1A6630 0%, #27AE60 100%);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  color: #fff;
  flex-wrap: wrap;
}

.prov-hero-main {
  flex-shrink: 0;
}

.prov-hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.3rem;
}

.prov-hero-total {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.prov-hero-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.4rem;
}

.prov-hero-split {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.prov-hero-item {
  text-align: center;
}

.prov-hero-item-val {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
}

.prov-hero-item-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  margin-top: 0.2rem;
}

.prov-hero-item-rate {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

.prov-hero-divider {
  font-size: 1.5rem;
  color: rgba(255,255,255,0.4);
  font-weight: 300;
}

@media (max-width: 600px) {
  .prov-summary-card {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .prov-arrow { display: none; }
  .prov-hero {
    flex-direction: column;
    gap: 1.5rem;
  }
  .prov-hero-split {
    margin-left: 0;
  }
  .prov-total-block {
    text-align: left;
  }
}

/* ── Chart page ──────────────────────────────────────────────── */
.chart-wrapper {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #EDEBE8;
  padding: 1.5rem;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
    order: 3;
    margin-left: 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #EDEBE8;
    flex-direction: column;
    padding: 0.75rem 0 1rem;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 199;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    display: block;
    padding: 0.8rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid #F5F3F0;
    color: #333;
  }

  .nav-links li a.active,
  .nav-links li a:hover {
    background: #F8F4F7;
    color: #4A1C40;
  }

  .nav-logout {
    border: none !important;
    border-bottom: 1px solid #F5F3F0 !important;
  }

  .nav-inner {
    position: relative;
  }

  .nav-user-chip {
    order: 2;
    margin-left: auto;
    margin-right: 0.35rem;
    padding: 0.1rem;
    border: none;
    background: transparent;
  }

  .nav-user-name {
    display: none;
  }

  .main-content {
    padding: 1.5rem 1rem 2.5rem;
  }

  .pwa-install-bar {
    top: var(--nav-height);
  }

  .pwa-install-inner {
    padding: 0.65rem 1rem;
    align-items: flex-start;
  }

  .pwa-install-text {
    max-width: 68%;
  }

  .greeting-inner {
    padding: 0.7rem 1rem 0.68rem;
  }

  .greeting-line {
    font-size: 0.96rem;
  }

  .pwa-refresh-fab {
    right: 12px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }

  .gen-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gen-count {
    font-size: 2rem;
  }

  .highlight-value {
    font-size: 2.5rem;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .auth-card {
    padding: 2rem 1.25rem;
    border-radius: 16px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sync-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-row {
    flex-direction: column;
  }

  .download-row .btn {
    width: 100%;
    text-align: center;
  }

  .source-accordion-summary {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .source-accordion-meta {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .source-accordion-chevron {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .gen-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gen-grid-small {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .nav-logo-img {
    width: min(78vw, 270px);
    max-width: 270px;
  }

  .pwa-install-inner .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.74rem;
  }

  .pwa-pull-refresh {
    font-size: 0.7rem;
    padding: 0.3rem 0.72rem;
  }
}
