/* ============================================================
   WERTSICHERUNG · Marketingportal — Gemeinsames Design-System
   Eine Datei, von allen Screens geladen.
   Stil: edel, ruhig, Gold als einziger Akzent, keine Borders.
   ============================================================ */

/* ---------- Eigene Fonts ---------- */
@font-face {
  font-family: 'Blair';
  src: url('../fonts/Blair.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Authentic Signature';
  src: url('../fonts/AuthenticSignature.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --primary: #181818;
  --secondary: #272829;
  --accent: #BCAC7C;
  --gold-hover: #CDB97D;
  --accent-light: #E4D5A8;
  --accent-warm: #E4C98A;
  --bg-light: #F7F6F1;
  --white: #FFFFFF;

  --text-primary: #181818;
  --text-muted: rgba(24, 24, 24, 0.60);
  --text-faint: rgba(24, 24, 24, 0.42);
  --line-soft: rgba(24, 24, 24, 0.06);
  --line-mid: rgba(24, 24, 24, 0.10);
  --gold-ink: #8A7A4A;          /* lesbares Gold auf Hell */

  --pill-bg: rgba(188, 172, 124, 0.16);
  --pill-color: #BCAC7C;

  --sans:    'Montserrat', system-ui, sans-serif;
  --body:    'Open Sans', system-ui, sans-serif;
  --display: 'Blair', 'Times New Roman', serif;
  --script:  'Authentic Signature', 'Brush Script MT', cursive;

  --shadow-soft: 0 1px 2px rgba(24,24,24,0.03), 0 8px 32px rgba(24,24,24,0.06);
  --shadow-pop:  0 4px 20px rgba(24,24,24,0.06), 0 24px 60px rgba(24,24,24,0.08);
  --shadow-gold: 0 12px 28px rgba(188,172,124,0.34);

  --r-sm: 12px;  --r-md: 20px;  --r-lg: 26px;
  --r-xl: 24px;  --r-pill: 100px;

  /* Innenpolster der großen Standard-Boxen (rundum gleich). Wird von den
     Inhaltskarten in Portal UND Admincenter benutzt — Sonderflächen wie
     Sperrbildschirme oder die Visitenkarten-Bühne bleiben bewusst großzügiger. */
  --box-pad: 26px;

  --sidebar-w: clamp(212px, 19vw, 280px);
}

/* Mobil flacher runden: bei schmaler Spalte wirkt ein großer Radius schwer.
   Gleicher Umbruchpunkt wie die übrige Mobil-Verdichtung (760px).
     --r-xl = große Standard-Boxen (.surface/.surface-flat/.ws-gate-card sowie im
              Admincenter .panel/.dtable-wrap/.modal-card/.admin-gate-card)
     --r-lg = KPI-Karten (.stat, in Portal UND Admincenter) + .dropzone
     --r-md = Profilchip (.userchip), Datums-Kachel (.datechip) sowie im Admincenter
              .file-chosen/.qa a/.pin-box/.flash-ok/.flash-err
   Gilt NUR fürs Portal — die Landingpages haben ihre eigene Skala in lp-neu.css. */
@media (max-width: 760px) {
  :root { --r-xl: 16px; --r-lg: 16px; --r-md: 16px; --box-pad: 22px; }
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 16px; line-height: 1.65;
  color: var(--text-primary);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent-light); color: var(--primary); }

/* ---------- Typografie ---------- */
.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; color: var(--accent);
}
.script { font-family: var(--script); color: var(--accent); font-weight: 400; line-height: 1; }
.h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(40px, 5vw, 84px); line-height: 1; letter-spacing: -2px; }
.h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.05; letter-spacing: -1.2px; }
.h3 { font-family: var(--sans); font-weight: 600; font-size: clamp(20px, 2.4vw, 27px); line-height: 1.22; letter-spacing: -0.4px; }
.h4 { font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: -0.2px; }
.body { font-family: var(--body); font-weight: 400; font-size: 16px; line-height: 1.65; }
.lead { font-size: 18px; line-height: 1.6; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.num { font-variant-numeric: tabular-nums; }

.wordmark {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0; line-height: 1; color: var(--primary);
}
.wordmark .sub {
  display: block; font-family: var(--sans); font-weight: 600;
  font-size: 0.30em; letter-spacing: 5px; color: var(--accent);
  margin-top: 0.55em; text-transform: uppercase;
}
.wordmark.on-dark { color: #fff; }
/* Als Link (Kopfleiste + Seitenleiste → Übersicht) soll die Wortmarke unverändert
   aussehen: keine Unterstreichung, keine Browser-Linkfarbe. */
a.wordmark { text-decoration: none; color: inherit; display: inline-block; }
a.wordmark.on-dark { color: #fff; }
a.wordmark:hover .sub { color: var(--gold-hover); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 64px; }
@media (max-width: 1100px) { .container { padding: 0 40px; } }
@media (max-width: 720px)  { .container { padding: 0 26px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 30px; border: none; border-radius: var(--r-pill);
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; cursor: pointer; white-space: nowrap;
  transition: background .25s, color .25s, transform .2s, box-shadow .25s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--primary); }
.btn-primary:hover { background: var(--gold-hover); transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.btn-ink { background: var(--primary); color: var(--white); }
.btn-ink:hover { background: var(--accent); color: var(--primary); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--primary); padding: 16px 8px; }
.btn-ghost:hover { color: var(--accent); }
.btn-outline { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--line-mid); }
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--gold-ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 12px 20px; font-size: 11px; letter-spacing: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Pills / Badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-pill);
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; line-height: 1;
}
.pill-gold-soft { background: var(--pill-bg); color: var(--pill-color); }
.pill-outline { background: transparent; color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--line-mid); }
.pill-ink { background: var(--primary); color: #fff; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); position: relative; }
.dot.live::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--accent); animation: badge-pulse 1.8s ease-out infinite;
}
@keyframes badge-pulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- Flächen / Karten ---------- */
.surface { background: var(--white); border-radius: var(--r-xl); box-shadow: var(--shadow-soft); }
.surface-flat { background: var(--bg-light); border-radius: var(--r-xl); }
.card-pad { padding: 32px; }
@media (max-width: 720px) { .card-pad { padding: 22px; } }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; font-family: var(--body); font-size: 16px; line-height: 1.5; color: var(--text-primary);
  background: var(--bg-light); border: 1.5px solid transparent; border-radius: var(--r-sm);
  padding: 15px 18px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2399948a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 16px;
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; background-color: var(--white); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--pill-bg);
}
.input-icon { position: relative; }
.input-icon .input { padding-right: 48px; }
.input-icon .ico { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-faint); width: 18px; height: 18px; }
.hint { font-size: 13px; color: var(--text-faint); }
.checkrow { display: flex; align-items: flex-start; gap: 11px; font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.checkrow input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }

/* Segmented control (z. B. monatlich / jährlich) */
.segmented { display: inline-flex; background: var(--bg-light); border-radius: var(--r-pill); padding: 5px; gap: 4px; }
.segmented button {
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-pill);
  padding: 10px 22px; font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); transition: all .2s;
}
.segmented button.active { background: var(--primary); color: #fff; }
.segmented .save { font-size: 10px; color: var(--accent); margin-left: 6px; letter-spacing: 1px; }

/* ---------- Dark panel (Auth-Aside / Hero) ---------- */
.dark-panel {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(ellipse at 75% 18%, rgba(228,213,168,0.20), transparent 40%),
    radial-gradient(ellipse at 15% 85%, rgba(228,213,168,0.14), transparent 44%),
    linear-gradient(170deg, #0d0d10 0%, #07070a 52%, #000 100%);
}
.dark-panel .muted { color: rgba(255,255,255,0.6); }
.dark-panel .eyebrow, .dark-panel .script { color: var(--accent-light); }

/* ---------- App-Shell (Sidebar-Layout) ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  color: #fff; padding: clamp(22px, 2.4vw, 30px) clamp(13px, 1.5vw, 22px);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  background:
    radial-gradient(ellipse 130% 26% at 50% 0%, rgba(228,213,168,0.16), transparent 60%),
    radial-gradient(ellipse 150% 26% at 50% 100%, rgba(228,213,168,0.10), transparent 62%),
    linear-gradient(180deg, #181818 0%, #0d0d10 56%, #050506 100%);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px clamp(7px, 0.8vw, 10px) clamp(14px, 2.2vh, 24px); flex: none; }
.sidebar-brand .wordmark { font-size: 13px; letter-spacing: 0; }
.sidebar-brand .wordmark .sub { font-size: 7.5px; letter-spacing: 2px; margin-top: 0.6em; }
.nav { display: flex; flex-direction: column; gap: clamp(1px, 0.3vh, 3px); flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav-label { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.34); padding: clamp(10px, 1.6vh, 16px) clamp(11px, 1vw, 14px) clamp(5px, 0.8vh, 8px); }
.nav-item {
  display: flex; align-items: center; gap: clamp(10px, 0.9vw, 13px); padding: clamp(8px, 1.05vh, 11px) clamp(11px, 1vw, 14px); border-radius: var(--r-sm);
  color: rgba(255,255,255,0.66); font-family: var(--sans); font-size: clamp(12.5px, 0.95vw, 14px); font-weight: 500;
  letter-spacing: 0.2px; white-space: nowrap; transition: background .25s, color .2s, box-shadow .25s; cursor: pointer;
}
.nav-item svg { width: clamp(17px, 1.35vw, 19px); height: clamp(17px, 1.35vw, 19px); flex: none; stroke-width: 1.6; }
.nav-item:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.12));
  -webkit-backdrop-filter: blur(12px) saturate(170%);
          backdrop-filter: blur(12px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 0 0 1px rgba(255,255,255,0.10), 0 10px 26px rgba(0,0,0,0.28);
}
.nav-item.active {
  color: var(--accent-light);
  background: linear-gradient(135deg, rgba(228,213,168,0.30), rgba(188,172,124,0.12) 55%, rgba(228,213,168,0.22));
  -webkit-backdrop-filter: blur(12px) saturate(170%);
          backdrop-filter: blur(12px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), inset 0 0 0 1px rgba(228,213,168,0.18), 0 10px 26px rgba(0,0,0,0.26);
}
.nav-item .badge { margin-left: auto; background: var(--accent); color: var(--primary); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: var(--r-pill); }
.sidebar-foot { margin-top: auto; padding-top: clamp(12px, 1.8vh, 20px); flex: none; }
.userchip { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: var(--r-md); background: rgba(255,255,255,0.05); }
.userchip .avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(140deg, var(--accent-warm), var(--accent)); color: var(--primary); display: grid; place-items: center; font-family: var(--sans); font-weight: 700; font-size: 14px; flex: none; }
.userchip .meta { min-width: 0; }
.userchip .meta b { font-family: var(--sans); font-size: 13.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip .meta span { font-size: 11.5px; color: rgba(255,255,255,0.5); }

.main { background: var(--bg-light); min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: clamp(12px, 1.6vw, 20px); padding: clamp(18px, 2vw, 26px) clamp(20px, 3vw, 44px);
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,246,241,0.82); backdrop-filter: blur(14px) saturate(160%);
}
.topbar .page-title { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: -0.4px; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-soft); display: grid; place-items: center; cursor: pointer; color: var(--text-muted); border: none; transition: color .2s, transform .2s; }
.icon-btn:hover { color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.content { padding: 16px clamp(20px, 3vw, 44px) 64px; }
@media (max-width: 720px) {
  /* Seitenrand mobil: 16px. Kopfleiste und Inhalt bewusst gleich, damit Logo,
     Überschrift und Karten auf einer Flucht stehen. */
  .topbar { padding: 18px 16px; }
  .content { padding: 12px 16px 48px; }
}

/* Grids */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Stat card */
.stat { background: var(--white); border-radius: var(--r-lg); padding: var(--box-pad); box-shadow: var(--shadow-soft); }
.stat .k { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); }
.stat .v { font-family: var(--sans); font-weight: 700; font-size: 34px; letter-spacing: -1px; margin-top: 10px; }
.stat .d { font-size: 13px; margin-top: 4px; }
.up { color: #4d7c5a; } .down { color: #b06a5b; }

/* Section header pattern */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sec-head .script { font-size: 30px; }
.sec-head h3 { margin-top: 2px; }

/* Lists / rows */
.row { display: flex; align-items: center; gap: 18px; padding: 18px 0; }
.row + .row { border-top: 1px solid var(--line-soft); }
.thumb { width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--bg-light); display: grid; place-items: center; color: var(--accent); flex: none; }

/* Date chip */
.datechip { width: 60px; flex: none; text-align: center; background: var(--bg-light); border-radius: var(--r-md); padding: 10px 0; }
.datechip .d { font-family: var(--sans); font-weight: 700; font-size: 22px; line-height: 1; }
.datechip .m { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin-top: 4px; }

/* Utility */
.flex { display: flex; } .items-center { align-items: center; } .gap-10 { gap: 10px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .text-center { text-align: center; }
.divider { height: 1px; background: var(--line-soft); border: none; margin: 0; }

/* Mobile sidebar collapse */
.menu-btn { display: none; }
/* Burger-Glyphe: 1:1 dieselbe wie auf der Hauptwebseite (dort .nav-burger .bx in
   wertsicherung.de/inc/nav.php) — bewusst ZWEI Balken statt drei, 31×14px, 2.4px
   stark, 2px Eckenradius. Nur die Glyphe ist übernommen; der runde Knopf drumherum
   bleibt der des Portals. Werte hier gespiegelt, die Website wird nicht angefasst. */
.menu-btn .bx { position: relative; width: 31px; height: 14px; display: inline-block; }
.menu-btn .bx span { position: absolute; left: 0; right: 0; height: 2.4px; background: currentColor; border-radius: 2px; transition: top .3s ease, transform .3s ease; }
.menu-btn .bx span:nth-child(1) { top: 0; }
.menu-btn .bx span:nth-child(2) { top: 11px; }
/* Scrim immer fixed positioniert, damit es nie eine Grid-Zelle belegt (Desktop-Layout-Bug) */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .3s; }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 280px; height: 100vh;
    transform: translateX(-100%); transition: transform .3s ease; box-shadow: var(--shadow-pop);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
}

@media (max-width: 1040px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
