/* frontend/css/style.css
   FBB Finanzbildungsbibliothek – Hauptstylesheet */

/* ── CSS-Variablen (Gentdwell-Design) ─────────────────── */
:root {
  /* Primärfarben von gentdwell.de */
  --navy:       #0b0521;   /* --contrast   (Hauptfarbe Nav/Footer) */
  --navy-light: #1a0a3a;   /* etwas heller */
  --navy-dark:  #07031a;   /* noch dunkler */
  --gold:       #1f93f5;   /* --accent     (Blau-Akzent für Buttons, Links, aktive Elemente) */
  --gold-light: #4ba9f7;   /* helleres Akzentblau */
  --gold-pale:  #e8f4fe;   /* sehr helles Blau für Hintergründe */
  --white:      #ffffff;
  --off-white:  #f7f8f9;   /* --base-2 */
  --grey-100:   #f0f1f3;
  --grey-200:   #e2e4e8;
  --grey-400:   #9aa0a8;
  --grey-600:   #62707c;   /* --contrast-3 */
  --grey-800:   #383f49;   /* --contrast-2 */
  --red:        #c0392b;
  --green:      #2e7d52;
  --green-light:#e8f5ee;
  --amber:      #e67e22;
  --shadow-sm:  0 1px 4px rgba(11,5,33,.10);
  --shadow-md:  0 4px 16px rgba(11,5,33,.14);
  --shadow-lg:  0 12px 40px rgba(11,5,33,.20);
  --radius:     6px;
  --radius-lg:  12px;
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { font-family: 'Libre Baskerville', serif; background: var(--off-white); color: var(--grey-800); min-height: 100vh; overflow-x: hidden; }
.hidden { display: none !important; }

/* ── Toast ──────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--navy-dark); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-lg);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  border-left: 4px solid var(--gold); max-width: 340px;
}
#toast.show    { transform: translateY(0); opacity: 1; }
#toast.success { border-left-color: var(--green); }
#toast.error   { border-left-color: var(--red); }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); font-family: inherit; text-decoration: none; }
.btn-primary   { background: var(--navy); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--navy-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline   { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-gold      { background: var(--gold); color: #fff; }
.btn-gold:hover{ background: var(--gold-light); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-sm        { padding: 6px 14px; font-size: 12px; }
.btn-full      { width: 100%; }

/* ── Form ───────────────────────────────────────────────── */
.fg { margin-bottom: 12px; }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fl { display: block; font-size: 11px; font-weight: 700; color: var(--grey-600); margin-bottom: 4px; letter-spacing: .5px; text-transform: uppercase; }
.fl .req { color: var(--red); margin-left: 2px; }
.fc { width: 100%; padding: 9px 12px; border: 1.5px solid var(--grey-200); border-radius: var(--radius); font-size: 13px; color: var(--grey-800); background: var(--white); transition: var(--transition); font-family: inherit; outline: none; }
.fc:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(31,147,245,.15); }
select.fc { cursor: pointer; }
textarea.fc { resize: vertical; }

/* ── Divider ────────────────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 10px; color: var(--grey-400); font-size: 11px; margin: 14px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--grey-200); }

/* ── Passwort-Stärke ────────────────────────────────────── */
.pw-bars { display: flex; gap: 3px; margin-top: 5px; }
.pw-bar  { flex: 1; height: 3px; border-radius: 2px; background: var(--grey-200); transition: background .3s; }
.pw-bar.weak   { background: var(--red); }
.pw-bar.medium { background: var(--amber); }
.pw-bar.strong { background: var(--green); }
.pw-lbl { font-size: 10px; color: var(--grey-400); margin-top: 3px; }

/* ── Upload-Bereich ─────────────────────────────────────── */
.upload-area { border: 2px dashed var(--grey-200); border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; transition: var(--transition); background: var(--grey-100); }
.upload-area:hover { border-color: var(--gold); background: rgba(31,147,245,.04); }
.upload-area p    { font-size: 12px; color: var(--grey-600); }
.upload-area span { font-size: 10px; color: var(--grey-400); }

/* ── Security-Pill ──────────────────────────────────────── */
.sec-pill { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--green); font-weight: 600; background: var(--green-light); border: 1px solid #a8d5bc; border-radius: 100px; padding: 5px 12px; margin-bottom: 14px; }
.sec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:.6;transform:scale(.85);} }

/* ── CSRF-Badge ─────────────────────────────────────────── */
.csrf-badge { display: flex; align-items: center; gap: 5px; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--grey-400); background: var(--grey-100); padding: 3px 8px; border-radius: 4px; margin-top: 10px; }

/* ── OTP-Hinweis ────────────────────────────────────────── */
.otp-note { background: #fff8e7; border: 1px solid #f0d080; border-radius: var(--radius); padding: 9px 12px; font-size: 11px; color: #7a5c00; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 7px; }

/* ── Enroll-Box ─────────────────────────────────────────── */
.enroll-box { background: rgba(11,5,33,.04); border: 1.5px solid rgba(11,5,33,.12); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.enroll-box .eb-label { font-size: 11px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.enroll-box .eb-label span { background: var(--navy); color: #fff; font-size: 9px; padding: 2px 7px; border-radius: 100px; }

/* ══ LANDING PAGE ══════════════════════════════════════════ */
.topnav { background: var(--navy); padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.topnav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.topnav-logo img { width: 110px; height: 38px; object-fit: cover; object-position: center 30%; border-radius: 5px; display: block; flex-shrink: 0; }
.topnav-logo .brand { font-family: 'Libre Baskerville', serif; color: #fff; font-size: 15px; font-weight: 700; border-left: 2px solid var(--gold); padding-left: 12px; line-height: 1.25; }
.topnav-logo .brand small { display: block; font-family: 'Libre Baskerville', serif; font-size: 11px; color: rgba(255,255,255,.45); font-weight: 400; }
.topnav-spacer { flex: 1; }
.back-btn { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; text-decoration: none; padding: 7px 14px; border-radius: 100px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); transition: var(--transition); cursor: pointer; }
.back-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-login-btn { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 100px; border: none; background: var(--gold); color: #fff; cursor: pointer; transition: var(--transition); }
.nav-login-btn:hover { background: var(--gold-light); transform: translateY(-1px); }

.hero { background: url('/images/bibliothek-hero.jpg') center/cover no-repeat; padding: 60px 32px 48px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(8,4,24,.94) 0%, rgba(11,5,33,.92) 45%, rgba(15,30,60,.88) 100%); pointer-events: none; z-index: 0; }
.hero-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero-text .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(31,147,245,.15); border: 1px solid rgba(31,147,245,.4); color: var(--gold-light); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 5px 14px; border-radius: 100px; margin-bottom: 20px; }
.hero-text h1 { font-family: 'Libre Baskerville', serif; color: #fff; font-size: 38px; line-height: 1.15; margin-bottom: 14px; }
.hero-text h1 em { color: var(--gold); font-style: normal; }
.hero-text p { color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.75; margin-bottom: 28px; max-width: 440px; }
.hero-feat { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.75); font-size: 13px; margin-bottom: 10px; }
.hf-icon { width: 28px; height: 28px; border-radius: 6px; background: rgba(31,147,245,.15); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }

/* Auth-Card in Hero */
.auth-card { background: var(--white); border-radius: 16px; box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08); overflow: hidden; }
.auth-tabs { display: flex; background: var(--grey-100); padding: 6px; gap: 4px; border-radius: 10px; margin: 20px 20px 0; }
.auth-tab { flex: 1; padding: 9px; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 7px; border: none; background: none; color: var(--grey-600); transition: var(--transition); }
.auth-tab.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }
.auth-body { padding: 20px; }
.auth-footer-note { font-size: 11px; color: var(--grey-400); text-align: center; margin-top: 12px; }
.auth-footer-note a { color: var(--navy); text-decoration: none; font-weight: 600; }
.demo-btn { padding: 8px 14px; border: 1.5px solid var(--grey-200); border-radius: var(--radius); background: var(--white); font-size: 12px; font-weight: 600; color: var(--grey-600); cursor: pointer; transition: var(--transition); text-align: left; display: block; width: 100%; margin-bottom: 6px; }
.demo-btn:hover { border-color: var(--navy); color: var(--navy); }

/* Stats-Bar */
.stats-bar { background: var(--white); border-bottom: 1px solid var(--grey-200); }
.stats-bar-inner { max-width: 1100px; margin: 0 auto; padding: 20px 32px; display: flex; }
.stat-item { flex: 1; text-align: center; padding: 0 20px; border-right: 1px solid var(--grey-200); }
.stat-item:last-child { border-right: none; }
.stat-item .sv { font-family: 'Libre Baskerville', serif; font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-item .sl { font-size: 11px; color: var(--grey-600); margin-top: 2px; }

/* Info-Cards */
.info-section { padding: 48px 32px; }
.info-inner { max-width: 1100px; margin: 0 auto; }
.info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 20px; }
.info-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--grey-200); padding: 24px; transition: var(--transition); }
.info-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Footer */
.site-footer { background: var(--navy-dark); padding: 28px 32px; margin-top: auto; }
.site-footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer p { font-size: 12px; color: rgba(255,255,255,.4); }
.site-footer a { color: rgba(255,255,255,.55); font-size: 12px; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-links { display: flex; gap: 20px; }

/* ══ APP ═══════════════════════════════════════════════════ */
#app-screen { display: none; min-height: 100vh; flex-direction: column; }
#app-screen.active { display: flex; }

.appbar { background: var(--navy); height: 60px; display: flex; align-items: center; padding: 0 24px; gap: 14px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.appbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.appbar-logo img { width: 110px; height: 36px; object-fit: cover; object-position: center 30%; border-radius: 5px; display: block; flex-shrink: 0; }
.appbar-logo span { font-family: 'Libre Baskerville', serif; color: #fff; font-size: 14px; font-weight: 700; border-left: 2px solid var(--gold); padding-left: 10px; }
.appbar-back { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.6); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 100px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); cursor: pointer; transition: var(--transition); text-decoration: none; }
.appbar-back:hover { background: rgba(255,255,255,.14); color: #fff; }
.appbar-spacer { flex: 1; }
.appbar-search { display: flex; align-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 100px; padding: 6px 16px; gap: 8px; width: 240px; transition: var(--transition); }
.appbar-search:focus-within { width: 280px; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); }
.appbar-search input { background: none; border: none; outline: none; color: #fff; font-size: 13px; width: 100%; font-family: inherit; }
.appbar-search input::placeholder { color: rgba(255,255,255,.4); }
.session-chip { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.6); font-size: 11px; background: rgba(255,255,255,.05); padding: 4px 10px; border-radius: 100px; border: 1px solid rgba(255,255,255,.08); }
.sess-dot { width: 6px; height: 6px; border-radius: 50%; background: #4caf50; animation: pulse 2s infinite; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 100px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); transition: var(--transition); }
.user-chip:hover { background: rgba(255,255,255,.15); }
.uavatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.uname { color: #fff; font-size: 12px; font-weight: 600; }
.urole { font-size: 10px; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

.app-body { display: flex; flex: 1; }
.sidebar { width: 230px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--grey-200); padding: 0 0 16px; display: flex; flex-direction: column; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.sidebar-img-wrap { position: relative; width: 100%; height: 90px; overflow: hidden; flex-shrink: 0; }
.sidebar-img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.sidebar-img-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,5,33,.2), rgba(11,5,33,.65)); display: flex; align-items: flex-end; padding: 8px 12px; font-family: 'Libre Baskerville', serif; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.9); letter-spacing: .5px; border-bottom: 2px solid var(--gold); }
.slabel { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--grey-400); padding: 0 18px 5px; }
.sitem { display: flex; align-items: center; gap: 9px; padding: 9px 18px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--grey-600); transition: var(--transition); border: none; background: none; width: 100%; text-align: left; border-left: 3px solid transparent; }
.sitem:hover { background: var(--grey-100); color: var(--navy); }
.sitem.active { background: rgba(11,5,33,.06); color: var(--navy); font-weight: 600; border-left-color: var(--gold); }
.sibadge { margin-left: auto; background: var(--navy); color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 100px; font-weight: 700; }
.sinew { margin-left: auto; background: var(--gold); color: #fff; font-size: 8px; padding: 2px 6px; border-radius: 100px; font-weight: 700; text-transform: uppercase; }
.ssep { height: 1px; background: var(--grey-200); margin: 10px 18px; }
.role-card { margin: auto 12px 12px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); border-radius: var(--radius); padding: 14px; color: #fff; }
.role-card .rl { font-size: 10px; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: 1px; }
.role-card .rv { font-weight: 700; color: var(--gold); font-size: 14px; margin: 3px 0 7px; }
.role-card .ra { font-size: 11px; color: rgba(255,255,255,.65); background: rgba(255,255,255,.08); border-radius: 4px; padding: 3px 8px; display: inline-block; }

.main { flex: 1; padding: 24px 28px; overflow-y: auto; min-width: 0; }
.view { display: none; }
.view.active { display: block; }
.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.ph h2 { font-family: 'Libre Baskerville', serif; font-size: 24px; color: var(--navy); margin-bottom: 3px; }
.ph p { font-size: 13px; color: var(--grey-600); }

.srow { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.sc { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--grey-200); padding: 18px; transition: var(--transition); }
.sc:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sc .sci { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.sc .scv { font-family: 'Libre Baskerville', serif; font-size: 26px; font-weight: 700; color: var(--navy); }
.sc .scl { font-size: 11px; color: var(--grey-600); margin-top: 3px; }

.fbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.fchip { padding: 5px 12px; border-radius: 100px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--grey-200); background: var(--white); color: var(--grey-600); transition: var(--transition); }
.fchip.active, .fchip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.fsel { padding: 6px 12px; border-radius: var(--radius); border: 1.5px solid var(--grey-200); font-size: 12px; background: var(--white); cursor: pointer; font-family: inherit; outline: none; }

.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 14px; }
.dc { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--grey-200); overflow: hidden; transition: var(--transition); cursor: pointer; }
.dc:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--navy); }
.dc-hd { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 36px; position: relative; }
.dc-tb { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 100px; letter-spacing: .8px; }
.dc-bd { padding: 12px 14px; }
.dc-title { font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.35; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-meta { font-size: 11px; color: var(--grey-400); margin-bottom: 8px; }
.dc-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.dtag { font-size: 10px; padding: 2px 7px; border-radius: 100px; background: var(--grey-100); color: var(--grey-600); font-weight: 600; }
.dc-ft { padding: 9px 14px; border-top: 1px solid var(--grey-100); display: flex; justify-content: space-between; align-items: center; }
.dc-ft button { font-size: 11px; color: var(--navy); font-weight: 600; background: none; border: none; cursor: pointer; }
.dc-ft button:hover { color: var(--gold); }
.dc-ft span { font-size: 10px; color: var(--grey-400); }
.lvl-a0 { background: #e3f2fd; color: #1565c0; }
.lvl-a1 { background: #e8f5e9; color: #2e7d32; }
.lvl-b1 { background: #fff3e0; color: #e65100; }
.ch-a0  { background: linear-gradient(135deg,#e3f2fd 0%,#bbdefb 100%); }
.ch-a1  { background: linear-gradient(135deg,#e8f5e9 0%,#c8e6c9 100%); }
.ch-b1  { background: linear-gradient(135deg,#fff3e0 0%,#ffe0b2 100%); }
.ch-all { background: linear-gradient(135deg,var(--gold-pale) 0%,#c5e0fc 100%); }

/* Dokument-Modal */
#dmod { position: fixed; inset: 0; z-index: 1000; background: rgba(10,20,40,.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
#dmod.open { opacity: 1; pointer-events: all; }
.dmbox { background: var(--white); border-radius: var(--radius-lg); width: 90%; max-width: 780px; max-height: 86vh; overflow: hidden; display: flex; flex-direction: column; transform: scale(.95); transition: transform .25s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 24px 80px rgba(0,0,0,.3); }
#dmod.open .dmbox { transform: scale(1); }
.dmhd { background: var(--navy); padding: 18px 22px; display: flex; align-items: flex-start; gap: 14px; }
.dmhd .dht { font-family: 'Libre Baskerville', serif; color: #fff; font-size: 17px; margin-bottom: 5px; }
.dmhd .dhm { font-size: 11px; color: rgba(255,255,255,.55); display: flex; gap: 14px; flex-wrap: wrap; }
.dmclose { background: rgba(255,255,255,.1); border: none; cursor: pointer; color: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: var(--transition); flex-shrink: 0; margin-left: auto; }
.dmbody { flex: 1; overflow-y: auto; padding: 24px; }
.dprev { background: var(--grey-100); border-radius: var(--radius); height: 260px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; flex-direction: column; gap: 10px; border: 2px dashed var(--grey-200); }
.dmmg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.dml { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--grey-400); font-weight: 700; margin-bottom: 3px; }
.dmv { font-size: 13px; color: var(--grey-800); font-weight: 500; }
.dmacts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sicherheits-Panel */
.sec-panel { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--grey-200); overflow: hidden; margin-bottom: 18px; }
.sec-ph { background: var(--navy); padding: 14px 18px; display: flex; align-items: center; gap: 10px; }
.sec-ph h3 { color: #fff; font-size: 14px; font-weight: 600; }
.sec-pb { padding: 18px; }
.sec-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--grey-100); }
.sec-item:last-child { border-bottom: none; }
.sic { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.sic.ok { background: var(--green-light); color: var(--green); }
.sic.warn { background: #fff3e0; color: var(--amber); }
.sii { flex: 1; }
.sii strong { display: block; font-size: 12px; font-weight: 600; color: var(--grey-800); }
.sii small { font-size: 11px; color: var(--grey-400); }
.sist { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 9px; border-radius: 100px; }
.sist.act  { background: var(--green-light); color: var(--green); }
.sist.pend { background: #fff3e0; color: var(--amber); }

/* IP-Gate */
.ip-gate { background: var(--white); border-radius: var(--radius-lg); border: 2px solid var(--navy); padding: 40px; text-align: center; max-width: 480px; margin: 0 auto; }
.ip-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--grey-100); border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 8px 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--grey-600); margin-bottom: 20px; }

/* Admin-Tabelle */
.atbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.atbl th { background: var(--navy); color: #fff; padding: 9px 12px; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.atbl td { padding: 9px 12px; border-bottom: 1px solid var(--grey-100); }
.atbl tr:hover td { background: var(--grey-100); }
.spill { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.spill.approved { background: var(--green-light); color: var(--green); }
.spill.pending  { background: #fff3e0; color: var(--amber); }
.spill.rejected { background: #fdecea; color: var(--red); }

/* Log-Terminal */
.logt { background: #0d1117; border-radius: var(--radius); padding: 14px; font-family: 'JetBrains Mono', monospace; font-size: 10px; line-height: 1.7; max-height: 220px; overflow-y: auto; }
.le { display: flex; gap: 10px; }
.lt { color: #484f58; } .lok { color: #3fb950; } .lwarn { color: #d29922; } .linfo { color: #58a6ff; } .lerr { color: #f85149; }

/* Toggle */
.tog { width: 38px; height: 20px; border-radius: 10px; background: var(--green); position: relative; cursor: pointer; transition: background .3s; flex-shrink: 0; }
.tog::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #fff; position: absolute; top: 3px; right: 3px; transition: transform .3s; }
.tog.off { background: var(--grey-200); }
.tog.off::after { transform: translateX(-18px); }

/* Animationen */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.ani { animation: fadeInUp .4s ease both; }
.ani:nth-child(2) { animation-delay: .06s; }
.ani:nth-child(3) { animation-delay: .12s; }
.ani:nth-child(4) { animation-delay: .18s; }
.ani:nth-child(5) { animation-delay: .24s; }

/* ── Responsive ─────────────────────────────────────────────
   Grundregel gegen den häufigsten Grid/Flex-Stolperstein: Kinder von
   Grid-/Flex-Containern schrumpfen standardmäßig NICHT unter ihre eigene
   Inhaltsbreite (min-width:auto) – bei langen Wörtern/mehreren Elementen
   in einer Reihe sprengt das auf schmalen Bildschirmen die ganze Seite
   (overflow-x:hidden versteckt das dann nur, statt es zu beheben). */
.hero-text, .auth-card, .stat-item, .info-card, .sc, .dc, .dmmg > div {
  min-width: 0;
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: minmax(0,1fr); }
  .info-grid  { grid-template-columns: minmax(0,1fr); }
  .srow       { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .topnav     { padding: 0 16px; }
}

@media (max-width: 600px) {
  /* Sicherheitsnetz: Grid-/Flex-Kinder dürfen hier immer unter ihre Inhaltsbreite schrumpfen
     (min-width:auto ist der Browser-Default und der Hauptgrund für Überlauf auf schmalen
     Bildschirmen) – wirkt sich auf normale Blockelemente nicht aus, nur auf Flex-/Grid-Items. */
  * { min-width: 0; }
  .auth-tabs, .footer-links { flex-wrap: wrap; }

  /* Topnav: schmaler, "Zurück"-Text ausblenden (Icon/Button bleibt kompakt) */
  .topnav { padding: 0 12px; gap: 8px; }
  .topnav-logo img { width: 70px; height: 30px; }
  .topnav-logo .brand { font-size: 12px; padding-left: 8px; }
  .topnav-logo .brand small { font-size: 9px; }
  .back-btn { display: none; } /* sekundärer Link zur Hauptseite, auf Handy-Breite nicht kritisch */
  .nav-login-btn { padding: 7px 12px; font-size: 12px; }

  .hero { padding: 32px 16px 28px; }
  .hero-text h1 { font-size: 26px; }
  .hero-text p { max-width: none; font-size: 14px; }
  .badge { font-size: 10px; padding: 4px 10px; }

  .auth-tabs { margin: 16px 16px 0; }
  .auth-body { padding: 16px; }

  /* Statistik-Leiste: 2 Spalten statt einer gequetschten 4er-Reihe mit Trennlinien */
  .stats-bar-inner { flex-wrap: wrap; padding: 16px; gap: 14px 0; }
  .stat-item { flex: 1 1 50%; border-right: none; padding: 0 8px; margin-bottom: 6px; }
  .stat-item:nth-child(odd) { border-right: 1px solid var(--grey-200); }

  .info-section { padding: 32px 16px; }
  .info-inner h2 { font-size: 21px; }

  .site-footer { padding: 20px 16px; }
  .site-footer-inner { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; gap: 12px 16px; }

  /* App-Bereich: Suchfeld darf schrumpfen statt die Appbar zu sprengen */
  .appbar { padding: 0 12px; gap: 8px; }
  .appbar-logo img { width: 70px; height: 30px; }
  .appbar-logo span { font-size: 12px; padding-left: 8px; }
  .appbar-search { width: 120px; }
  .appbar-search:focus-within { width: 150px; }
  .uname, .urole { display: none; } /* Avatar bleibt sichtbar, Name/Rolle nur bei Platz */

  /* Sidebar wird zur oberen Leiste statt fixer 230px-Spalte */
  .app-body { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; overflow-x: auto; padding: 8px 10px; gap: 4px;
    border-right: none; border-bottom: 1px solid var(--grey-200);
  }
  .sidebar-img-wrap, .role-card, .ssep { display: none; }
  .slabel { display: none; }
  .sitem { width: auto; white-space: nowrap; padding: 8px 12px; border-left: none; border-radius: 100px; }
  .sitem.active { border-left: none; background: var(--navy); color: #fff; }
  .main { padding: 16px; }

  .srow { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .dgrid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .dmmg { grid-template-columns: minmax(0,1fr); }
  .atbl { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 400px) {
  .dgrid { grid-template-columns: minmax(0,1fr); }
  .stat-item { flex: 1 1 100%; border-right: none !important; }
}
