/* ==========================================================================
   FBVM · APP CSS
   - Struktur:
     1) THEME: alle Tokens zentral (Farben, Typo, Größen, Effekte)
     2) Base / Reset
     3) Layout: Container, Topbar, Footer
     4) Buttons
     5) Cards / Panels
     6) Forms / Inputs
     7) Tables (Desktop + Mobile)
     8) Admin-Userlist (Layoutbreiten + Details)
     9) Detail-Sektionen (Chiplist, Badges)
     10) Flash/Alerts
     11) Admin-Stats (Kacheln)
   ========================================================================== */


/* ==========================================================================
   1) THEME TOKENS – HIER STELLST DU SPÄTER ALLES EIN
   ========================================================================== */
:root{
  /* --- Branding / Verlauf (Header + Seitenhintergrund) --- */
  --brand:#0096fa;                 /* Hauptbrand (oben) */
  --brand-mid:#0d3a59;             /* Verlauf Mitte */
  --wash:#121c25;                  /* Verlauf unten (dunkel) */

  /* --- Oberflächen (Dark UI) --- */
  --bg:#0b0f14;                    /* Basis-Hintergrund sehr dunkel */
  --panel:#0d3a59;                 /* dunkles Panel (Cards) */
  --panel-2:#121c25;               /* dunklerer Layer */
  --panel-3:#0096fa;               /* Card-Verlaufstart (leichtes Blau) */

  /* --- Textfarben --- */
  --text:#e8f1f8;                  /* Primärer Text (hell) */
  --text-soft:#dbe7f2;             /* Running Text in Legal etc. */
  --muted:#9fb5c6;                 /* Dezent/Hinweis */
  --text-accent:#cfeaff;           /* Leichte Hervorhebung/Headlines */

  /* --- Links --- */
  --link:#cfeaff;
  --link-hover:#cfeaff;            /* gleich behalten (nur underline) */

  /* --- Ränder / Linienstärken --- */
  --border:rgba(187,206,217,.28);
  --border-soft:rgba(187,206,217,.18);

  /* --- Buttons (Primary, Ghost) --- */
  --btn-bg:#0b1520;
  --btn-border:rgba(255,255,255,.10);
  --btn-primary-top:#0096fa;       /* Verlauf oben */
  --btn-primary-bot:#0286db;       /* Verlauf unten */
  --btn-ghost-border:rgba(255,255,255,.35);
  --btn-ghost-hover:rgba(255,255,255,.08);

  /* --- Topbar Effekte --- */
  --topbar-overlay-top:rgba(0,0,0,.10);
  --topbar-overlay-bot:rgba(0,0,0,.20);
  --topbar-divider:var(--bg);

  /* --- Fokus/Outline --- */
  --focus-ring:rgba(0,150,250,.35);
  --focus-ring-dark:rgba(0,150,250,.25);

  /* --- Form Inputs (hell) --- */
  --input-bg:#f7fbff;
  --input-text:#0b1620;
  --input-border:#c7d6df;
  --input-hover:#9fb5c6;
  --input-focus:#0096fa;
  --input-placeholder:#6f8493;

  /* --- Form Inputs (dunkel) optional --- */
  --input-bg-dark:#0a1520;
  --input-text-dark:#e8f1f8;
  --input-border-dark:rgba(187,206,217,.28);

  /* --- Badges / Statusfarben --- */
  --ok:#19c37d;
  --warn:#f59e0b;
  --mute:#94a3b8;
  --danger:#ef4444;

  /* --- Tabellen-Intensitäten --- */
  --table-stripe:rgba(255,255,255,.02);
  --table-hover-bg:rgba(255,255,255,.14);
  --table-hover-ring:rgba(255,255,255,.28);

  /* --- Schatten / Radius --- */
  --radius:14px;
  --shadow-sm:0 2px 10px rgba(0,0,0,.25);
  --shadow-md:0 0px 10px #fff;     /* dein Glow: unverändert */

  /* --- Typografie --- */
  --font-sans: Verdana, Geneva, Tahoma, sans-serif;
  --font-size-base: 14px;          /* Basis; Tabellen/Labels haben eigene Werte */
  --font-size-table: 12px;
  --font-size-label: 12px;
  --font-size-head-sm: 12px;

  /* --- Sonstiges (Cards „surface-light“ Wrapper) --- */
  --surface-border:#c7d6df;
  --surface-head-divider:#d6e3ea;
  
  --btn-primary-top: var(--primary);
  --btn-primary-bot: #0286db;

  --table-stripe: rgba(255,255,255,.02);
  --table-hover-bg: rgba(255,255,255,.14);
  --table-hover-ring: rgba(255,255,255,.28);
  
  --font-base: Verdana, Geneva, Tahoma, sans-serif;
  --font-size-base: 14px;
  --table-font-size: 12px;
}


/* ==========================================================================
   2) BASE / RESET
   ========================================================================== */
*{ box-sizing:border-box }
html, body { min-height: 100%; }

body{
  margin:0;
  font: var(--font-size-base)/1.5 var(--font-base);
  color: var(--text);

  /* Hintergrund: dein Double-Gradient + Fallbackfarbe */
  background-color: var(--wash);
  background-image:
    radial-gradient(1200px 700px at 12% 0%, rgba(0,150,250,.16), transparent 60%),
    linear-gradient(180deg, var(--brand) 0%, var(--brand-mid) 36%, var(--wash) 100%);
  background-repeat:no-repeat,no-repeat;
  background-position:top left, top left;
}
@media (min-width:821px){ body{ background-attachment:fixed,fixed } }
@media (max-width:820px){ body{ background-attachment:scroll,scroll } }

a{ color:var(--link); text-decoration:none }
a:hover{ text-decoration:underline }

.container{ max-width:1200px; margin:32px auto; padding:0 5px }


/* ==========================================================================
   3) LAYOUT: TOPBAR / NAV / FOOTER
   ========================================================================== */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 16px;
  background:
    linear-gradient(180deg, var(--topbar-overlay-top), var(--topbar-overlay-bot)),
    linear-gradient(180deg, var(--brand) 0%, var(--brand-mid) 65%, var(--wash) 100%);
  border-bottom:2px solid var(--topbar-divider);
  box-shadow:var(--shadow-sm);
  color:#fff;
}
.topbar a,.topbar .btn{ color:#fff }
.topbar a:hover{ opacity:.9; text-decoration:none }

.brand{ display:flex; align-items:center; gap:10px; min-height:40px }
.logo{ height:65px; width:auto; display:block; transform:translateY(1px) }
.brand-name{
  display:flex; align-items:center;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-weight:700; letter-spacing:.2px; line-height:1;
}
.nav{ display:flex; align-items:center; gap:8px }
.inline-form{ display:inline }

.footer{
  border-top:1px solid rgba(255,255,255,.07);
  padding:16px; text-align:center; color:var(--muted)
}

/* Mobile-Topbar: 2 Zeilen */
@media (max-width:720px){
  .topbar{
    display:grid; grid-template-columns:1fr auto;
    grid-template-areas:"brand brand" "nav nav";
    row-gap:6px; align-items:center;
  }
  .brand{ grid-area:brand } .nav{ grid-area:nav; justify-content:flex-end; flex-wrap:wrap }
  .logo{ height:50px } .brand-name{ font-size:clamp(12px, 3.6vw, 16px) }
}


/* ==========================================================================
   4) BUTTONS
   ========================================================================== */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:10px;
  border:1px solid var(--btn-border);
  background:var(--btn-bg); color:var(--text);
  transition:opacity .15s ease, transform .02s ease-in, box-shadow .15s ease;
}
.btn:hover{ opacity:.95 }
.btn:active{ transform:translateY(1px) }
.btn:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--focus-ring) }

.btn.primary{
  background:linear-gradient(180deg, var(--btn-primary-top), var(--btn-primary-bot));
  border-color:rgba(255,255,255,.15);
  color:#fff;
}
.btn.ghost{
  background:transparent;
  color:#fff;
  border-color:var(--btn-ghost-border);
}
.btn.ghost:hover{ background:var(--btn-ghost-hover) }

.btn.active{ box-shadow:0 0 0 2px rgba(255,255,255,.38) inset; filter:saturate(1.1) }
.nav .btn{ min-width:120px; text-align:center; box-shadow:0 0px 3px #000 }

.btn.btn-sm{ padding:6px 10px; font-size:12px; border-radius:8px }
.btn.btn-sm:hover{
  background:rgba(255,255,255,.10);
  box-shadow:0 0 0 1px rgba(255,255,255,.18) inset;
}

/* Kredite-Form Layout */
.kredit-form-grid { display: grid; gap: 12px; }

/* Förder- und Optionen-Zeile: auf einer Linie, bricht sauber auf Tablet */
.kredit-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kredit-options .spacer { flex: 1 1 auto; }
.kredit-foerder {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kredit-foerder strong { white-space: nowrap; }

/* Tablet: Optionen untereinander, Button rechts bleibt sichtbar */
@media (max-width: 900px) {
  .kredit-options { align-items: flex-start; }
  .kredit-foerder { width: 100%; }
}

/* ==========================================================================
   5) CARDS / PANELS
   ========================================================================== */
.card{
  background:linear-gradient(180deg, var(--panel-3) 0%, var(--panel) 75px, var(--panel-2) 100%);
  border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-md); overflow:hidden;
}
.card-head{
  padding:8px 12px; border-bottom:1px solid var(--border-soft);
  font-weight:600; font-size:var(--font-size-head-sm);
  color:var(--text-accent); text-shadow:0 0 10px #000;
  font-family: var(--font-sans);
}
.card-body{ padding:10px 12px }

/* Auth-Layout */
.auth-card{ max-width:960px; margin:24px auto }
.auth-grid{ display:grid; grid-template-columns:.9fr 1.1fr; gap:20px; align-items:center }
.auth-media{ display:flex; align-items:center; justify-content:center; padding:8px }
.auth-media img{ width:100%; max-width:260px; height:auto; object-fit:contain; filter:drop-shadow(0 6px 16px rgba(0,0,0,.18)) }

/* Helle Content-Surface (visuell, inhalt bleibt dunkel) */
.surface-light{
  background:linear-gradient(180deg, var(--panel-3) 0%, var(--panel) 75px, var(--panel-2) 90%);
  color:#fff; border:1px solid var(--surface-border);
}
.card.surface-light .card-head{ color:#fff; border-bottom:1px solid var(--surface-head-divider) }
.card.surface-light .auth-form{ border-left:1px solid var(--surface-head-divider); padding-left:16px }
@media (max-width:860px){
  .auth-grid{ grid-template-columns:1fr }
  .card.surface-light .auth-form{ border-left:0; padding-left:0; border-top:1px solid var(--surface-head-divider); padding-top:12px }
  .auth-media img{ max-width:220px }
}


/* ==========================================================================
   6) FORMS / INPUTS
   ========================================================================== */
label{ display:block; font-size:var(--font-size-label); color:var(--text-accent); margin-top:10px }

.input,
input[type="text"],input[type="email"],input[type="password"],select,textarea{
  width:100%; padding:10px; border-radius:12px;
  background:var(--input-bg); color:var(--input-text);
  border:1px solid var(--input-border);
  transition:border-color .15s, box-shadow .15s, background-color .15s;
  font-size:12px; caret-color:var(--input-focus);
}
.input::placeholder,input::placeholder,textarea::placeholder{ color:var(--input-placeholder); opacity:1 }
.input:hover,input:hover,select:hover,textarea:hover{ border-color:var(--input-hover) }
.input:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:none; border-color:var(--input-focus); box-shadow:0 0 0 3px var(--focus-ring); background:#fff;
}

/* Optionale dunkle Variante gezielt: .input--dark */
.input--dark{
  background:var(--input-bg-dark)!important; color:var(--input-text-dark)!important; border:1px solid var(--input-border-dark)!important
}
.input--dark:focus-visible{ box-shadow:0 0 0 3px var(--focus-ring-dark) }

/* Validierung – (Werte belassen wie bei dir) */
.is-invalid{ border-color:var(--danger)!important; box-shadow:0 20px 8px 3px rgba(239,68,68,.25)!important }
.is-valid{ border-color:var(--ok)!important; box-shadow:0 0 0 3px rgba(25,195,125,.22)!important }

input:-webkit-autofill{
  -webkit-text-fill-color:var(--input-text);
  box-shadow:0 0 0 1000px var(--input-bg) inset!important;
  transition:background-color 9999s ease-out
}
.visually-hidden{ position:absolute!important; left:-9999px!important; width:1px; height:1px; overflow:hidden }


/* ==========================================================================
   7) TABLES – dunkel, Verdana, helle Schrift (Desktop + Mobile)
   ========================================================================== */
.table{
  font-family: var(--font-base); font-size: var(--table-font-size); color:var(--text);
  width:100%; border-collapse:separate; border-spacing:0;
}
.table th,.table td{
  padding:10px 12px; vertical-align:middle; border-bottom:1px solid var(--border); text-align:left
}
.table thead th{
  font-weight:600; font-size:var(--font-size-table); letter-spacing:.2px; color:var(--text);
  background:rgba(255,255,255,.06); position:sticky; top:0; z-index:1; border-bottom:1px solid var(--border-soft);
}
.table--striped tbody tr:nth-child(even){ background:var(--table-stripe) }
.table--hover   tbody tr:hover{
  background:var(--table-hover-bg); box-shadow:inset 0 0 0 1px var(--table-hover-ring)
}
.cell-actions{ display:flex; gap:6px; align-items:center; justify-content:flex-start; white-space:nowrap }

.table-wrap{ max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:8px; margin-bottom:-8px }

/* Mobile: Table -> Card-Stack */
@media (max-width:720px){
  .table thead{ display:none }
  .table tbody tr{
    display:block; border:1px solid var(--border); border-radius:12px; margin:10px 0; padding:8px 12px; background:transparent;
  }
  .table--striped tbody tr:nth-child(odd){ background:transparent }
  .table--striped tbody tr:nth-child(even){ background:var(--table-stripe) }
  .table--hover tbody tr:hover{
    background:var(--table-hover-bg); box-shadow:inset 0 0 0 1px var(--table-hover-ring)
  }
  .table tbody td{
    display:grid; grid-template-columns:minmax(120px,40%) 1fr; align-items:center; gap:8px; border:0; padding:6px 0;
  }
  .table tbody td::before{
    content:attr(data-th); font-family:var(--font-sans); font-size:11px; color:var(--muted)
  }
  .cell-actions{ justify-content:flex-end; gap:8px }
}


/* ==========================================================================
   8) ADMIN – Benutzerliste (Desktop): 6 Spalten, stabil + Ellipsis
   ========================================================================== */
@media (min-width:721px){
  .admin-userlist{ table-layout:fixed }
  .admin-userlist th,.admin-userlist td{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
  .admin-userlist th:nth-child(1),.admin-userlist td:nth-child(1){ width:7%;  text-align:center } /* ID */
  .admin-userlist th:nth-child(2),.admin-userlist td:nth-child(2){ width:18% } /* Name */
  .admin-userlist th:nth-child(3),.admin-userlist td:nth-child(3){ width:28% } /* E-Mail */
  .admin-userlist th:nth-child(4),.admin-userlist td:nth-child(4){ width:22% } /* Firma */
  .admin-userlist th:nth-child(5),.admin-userlist td:nth-child(5){ width:10% } /* Kürzel */
  .admin-userlist th:nth-child(6),.admin-userlist td:nth-child(6){ width:15% } /* Details */

  /* rechte Kante etwas Luft + klare Zeilentrenner */
  .table-wrap { padding-right: 12px; }
  .admin-userlist td{ border-bottom: 1px solid var(--border) !important; }

  /* letzte Spalte: Buttons nicht abschneiden */
  .admin-userlist td:last-child,
  .admin-userlist th:last-child{
    overflow: visible; text-overflow: clip; min-width: 128px;
  }
}


/* ==========================================================================
   9) DETAIL-SEKTIONEN (Chiplist) & BADGES
   ========================================================================== */
.admin-userlist .row-details td{
  padding:12px 14px; background:rgba(255,255,255,.04); border-top:1px solid var(--border-soft);
}
.detail-sections{ display:grid; gap:14px }

/* kleine „Card“ */
.detail-section{
  border:1px solid var(--border); border-radius:12px; overflow:hidden;
  background:linear-gradient(180deg, #101820, #0f1720);
}
.detail-head{
  padding:8px 12px; font-weight:600; font-size:12px; color:var(--text-accent);
  background:rgba(0,0,0,.2); border-bottom:1px solid var(--border-soft);
}

/* Chiplist: „Zellen“ */
.chiplist{
  display:flex; flex-wrap:wrap; gap:8px 12px; padding:10px 12px;
}
.chip{
  display:flex; align-items:center; gap:6px;
  padding:6px 10px; border:1px solid var(--border); border-radius:10px;
  background:linear-gradient(180deg,#0f1720,#0e151d);
  font-size:12px; color:var(--text);
}
.chip .th{ font-weight:700; color:var(--text-accent) }
.chip .th::after{ content:":"; margin-left:2px; margin-right:6px; opacity:.85 }
.chip .td{ display:inline-flex; align-items:center; min-height:22px; line-height:1 }

.section-actions{
  padding:8px 12px; display:flex; gap:8px; flex-wrap:wrap;
  border-top:1px dashed var(--border-soft)
}
.detail-footer{ display:flex; gap:8px; justify-content:flex-end; padding-top:2px }
@media (max-width:980px){ .detail-footer{ justify-content:flex-start } }
@media (max-width:720px){
  .admin-userlist .row-details td{
    display:block; border:1px solid var(--border); border-radius:12px;
    background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,0)), linear-gradient(180deg, var(--panel), var(--panel-2));
  }
}

/* Badges */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  height:22px; padding:0 8px; border-radius:999px;
  font-size:12px; line-height:1; white-space:nowrap;
  border:1px solid rgba(255,255,255,.12);
}
.badge--ok{   background:linear-gradient(180deg, rgba(var(--ok-r,25),var(--ok-g,195),var(--ok-b,125),.30), rgba(var(--ok-r,25),var(--ok-g,195),var(--ok-b,125),.20)); color:#d9fbe7 }
.badge--info{ background:linear-gradient(180deg, rgba(0,150,250,.30), rgba(0,150,250,.20)); color:#e6f4ff }
.badge--no{   background:linear-gradient(180deg, rgba(239,68,68,.32), rgba(239,68,68,.22)); color:#f1f5f9 }
.badge--danger{ background:linear-gradient(180deg, rgba(239,68,68,.22), rgba(239,68,68,.12)); color:#fee2e2; border-color: rgba(239,68,68,.45) }

/* Utilities */
.ta-center{ text-align:center }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }

.subnav.admin-nav { border-bottom:1px solid var(--border-soft); padding-bottom:8px; }


/* ==========================================================================
   10) FLASH / ALERTS
   ========================================================================== */
.flash{
  margin:10px 0; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,0));
  color:var(--text); box-shadow:0 1px 2px rgba(0,0,0,.2);
}
.flash--maintenance{
  margin:10px 0; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(239,68,68,.30), rgba(239,68,68,.20));
  border-color:rgba(239,68,68,.45); color:#ffff00;
}
.flash--error{
  background:linear-gradient(180deg, rgba(239,68,68,.30), rgba(239,68,68,.20));
  border-color:rgba(239,68,68,.45); color:#ffe5e5;
}
.flash--success{
  background:linear-gradient(180deg, rgba(25,195,125,.22), rgba(25,195,125,.12));
  border-color:rgba(25,195,125,.45); color:#d9fbe7;
}
.flash--info{
  background:linear-gradient(180deg, rgba(0,150,250,.20), rgba(0,150,250,.10));
  border-color:rgba(0,150,250,.45); color:#e6f4ff;
}
.flash--warn{
  background:linear-gradient(180deg, rgba(245,158,11,.22), rgba(245,158,11,.12));
  border-color:rgba(245,158,11,.45); color:#ffedd5;
}
/* klein */
.flash--sm{ padding:8px 10px; font-size:12px; border-radius:8px }

.field-error{ margin-top:4px; font-size:12px; color:#ffe5e5; }


/* ==========================================================================
   11) ADMIN · STAT-KACHELN (Dashboard-Karten)
   ========================================================================== */
.stat-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap:12px;
}
.stat-card{
  position:relative;
  border:1px solid var(--border); border-radius:12px;
  background:linear-gradient(180deg, #0f1720, #0e151d);
  padding:12px 14px; box-shadow:0 2px 8px rgba(0,0,0,.25);
  transition:transform .06s ease, box-shadow .15s ease, border-color .15s ease;
}
.stat-card:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.32);
  box-shadow:0 6px 18px rgba(0,0,0,.28);
}
.stat-title{ font-size:12px; letter-spacing:.2px; color:var(--text-accent); margin-bottom:6px }
.stat-value{ font-size:28px; font-weight:700; line-height:1.2; color:var(--text) }
.stat-sub{ margin-top:6px; font-size:12px; color:var(--muted) }
.stat-card--link::after{ content:""; position:absolute; inset:0 } /* ganze Kachel klickbar */

/* ==========================================================================
   LIGHT THEME (Sub-Theme via .theme-light)
   - Brand #0096fa bleibt als Akzent (Topbar, Card-Head, Buttons)
   - Keine großflächigen blauen Flächen als Seitenhintergrund
   ========================================================================== */

.theme-light {
  /* Farben für helle UI */
  --bg: #f6f8fb;
  --text: #0b1620;
  --text-soft: #243443;
  --muted: #5a6b79;
  --text-accent: #0f2740;

  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --panel-3: #e9f5ff;          /* zarter Brand-Schimmer am Card-Top */

  --border: rgba(16,24,40,.18);
  --border-soft: rgba(16,24,40,.10);

  /* Tabellen-Hover/Stripe & Focus für hellen Grund */
  --table-stripe: rgba(0,0,0,.04);
  --table-hover-bg: rgba(0,0,0,.06);
  --table-hover-ring: rgba(0,0,0,.10);
  --focus-ring: rgba(0,150,250,.35);
  --focus-ring-dark: rgba(0,150,250,.25);

  /* Buttons */
  --btn-bg: #ffffff;
  --btn-border: rgba(16,24,40,.14);
  --btn-ghost-border: rgba(16,24,40,.25);
  --btn-ghost-hover: rgba(0,0,0,.05);
}

/* Seitenhintergrund im Light-Theme:
   sehr zurückhaltend, leichter top-tint statt großem Brand-Verlauf */
.theme-light body{
  background-color: #f6f8fb;
  background-image:
    radial-gradient(900px 520px at 10% 0%, rgba(0,150,250,.08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: top left, top left;
  background-attachment: scroll, scroll;   /* kein fixed im Light-Theme */
}

/* Topbar: Brand bleibt als Akzent erlaubt */
.theme-light .topbar{
  background:
    linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.06)),
    linear-gradient(180deg, var(--brand) 0%, #1474b9 65%, #0b3a57 100%);
  border-bottom-color: rgba(0,0,0,.06);
}

/* Cards / Panels */
.theme-light .card{
  background: linear-gradient(180deg, var(--panel-3) 0px, var(--panel) 75px, var(--panel-2) 100%);
  border-color: var(--border);
}
.theme-light .card-head{
  color: var(--text-accent);
  text-shadow: none;
  border-bottom: 1px solid var(--border-soft);
}

/* Links */
.theme-light a{ color: #0f60ae }
.theme-light a:hover{ text-decoration: underline }

/* Buttons */
.theme-light .btn{
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--text);
}
.theme-light .btn.ghost{
  background: transparent;
  border-color: var(--btn-ghost-border);
}
.theme-light .btn.ghost:hover{
  background: var(--btn-ghost-hover);
}
.theme-light .btn.primary{
  /* behält Brand-Verlauf */
  background: linear-gradient(180deg, var(--btn-primary-top), var(--btn-primary-bot));
  color:#fff;
  border-color: rgba(0,0,0,.08);
}

/* Inputs (helle bleiben hell, nur Farben anpassen) */
.theme-light .input,
.theme-light input[type="text"],
.theme-light input[type="email"],
.theme-light input[type="password"],
.theme-light select,
.theme-light textarea{
  background: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-border);
}
.theme-light .input:focus-visible,
.theme-light input:focus-visible,
.theme-light select:focus-visible,
.theme-light textarea:focus-visible{
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Tabellen (helles Zebra/Hover) */
.theme-light .table{
  color: var(--text);
}
.theme-light .table thead th{
  background: #f3f7fb;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.theme-light .table--striped tbody tr:nth-child(even){
  background: var(--table-stripe);
}
.theme-light .table--hover tbody tr:hover{
  background: var(--table-hover-bg);
  box-shadow: inset 0 0 0 1px var(--table-hover-ring);
}
.theme-light .table tbody td::before{
  color: var(--muted);
}

/* Flash/Alerts – leichte Anpassung der Lesbarkeit */
.theme-light .flash{
  color: var(--text);
  border-color: var(--border);
}

/* === Header-/Nav-Buttons normalisieren: <a.btn> vs <button.btn> === */
a.btn,
button.btn,
input[type="submit"].btn,
input[type="button"].btn {
  display: inline-flex;            /* identische Box, Text vertikal mittig */
  align-items: center;
  justify-content: center;
  min-height: 40px;                /* gleiche Zielhöhe wie .brand (min-height:40px) */
  padding: 0 12px;                 /* Innenabstand einheitlich (passt zu deiner .btn) */
  line-height: 1;                  /* kein zusätzliches „Zeilenhöhe-Aufblasen“ bei <a> */
  font: inherit;                   /* gleiche Schriftmetriken für <button>/<input> */
  text-decoration: none;           /* <a> ohne Unterstreichung */
  vertical-align: middle;          /* sauber in der Topbar-Reihe */
}

/* Browser-Defaults für Buttons neutralisieren, damit sie wie <a> aussehen */
button.btn,
input[type="submit"].btn,
input[type="button"].btn {
  -webkit-appearance: none;
  appearance: none;
  background-clip: padding-box;
  border: 1px solid var(--btn-border); /* identisch zu .btn */
}

/* ===== Kreditvertrag – PRO Look ===== */
.kv-wrap{border:1px solid var(--border);border-radius:12px;background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(0,0,0,0));box-shadow:var(--shadow-md);overflow:hidden}
.kv-head{background:linear-gradient(180deg,var(--btn-primary-top),var(--btn-primary-bot));color:#fff;padding:10px 14px;font-weight:700;letter-spacing:.2px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.kv-bank{font-size:16px}
.kv-badges{display:flex;gap:8px;flex-wrap:wrap}
.kv-badge{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 10px;border-radius:999px;border:1px solid rgba(255,255,255,.25);font-size:12px;line-height:1;color:#fff;background:rgba(0,0,0,.12)}

.kv-body{padding:14px;background:linear-gradient(180deg,var(--panel),var(--panel-2))}
.kv-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.kv-tile{border:1px solid var(--border);border-radius:12px;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(0,0,0,0));padding:10px 12px}
.kv-tile .ttl{font-size:12px;color:var(--text-accent);margin-bottom:4px}
.kv-tile .val{font-size:20px;font-weight:700}
.kv-tile .val.red{color:#ffb4b4}

.kv-subhead{margin:12px 0 8px;padding:6px 10px;font-weight:700;color:var(--text-accent);border-left:3px solid var(--btn-primary-top);background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(0,0,0,0));border-radius:6px}

.kv-rows{border:1px solid var(--border);border-radius:12px;overflow:hidden}
.kv-row{display:grid;grid-template-columns:220px 1fr;gap:10px;align-items:center;padding:10px 12px;background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(0,0,0,0))}
.kv-row+.kv-row{border-top:1px solid var(--border-soft)}
.kv-th{font-weight:700;color:var(--text-accent)}
.kv-td .chip{display:inline-block;padding:4px 8px;border-radius:8px;background:rgba(255,255,255,.06);border:1px solid var(--border-soft)}
.kv-note{color:var(--muted)}
.kv-note.warn{color:#ffedd5;background:linear-gradient(180deg,rgba(245,158,11,.22),rgba(245,158,11,.12));border:1px solid rgba(245,158,11,.45);padding:8px 10px;border-radius:8px}
.kv-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:12px}

/* Kostenboxen */
.kv-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.kv-total-box{padding:10px 12px;border-radius:12px;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(0,0,0,0));border:1px solid var(--border)}
.kv-total-title{font-weight:700;color:var(--text-accent);margin-bottom:4px}
.kv-total-value{font-size:18px;font-weight:700}

/* Responsive */
@media (max-width:980px){.kv-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.kv-row{grid-template-columns:1fr}.kv-row .kv-th{opacity:.9}}
@media (max-width:640px){.kv-summary{grid-template-columns:1fr}}
