/* ============================================
   FoxiKosten 1.0 – Design
   Rot als Primärfarbe + Darkmode (aus FoxiCloud V8 übernommen)
   ============================================ */
:root {
    --primary: #dc2626; --primary-dark: #b91c1c; --primary-light: #f87171; --secondary: #b91c1c; --accent: #f97316;
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6;
    --bg: #f5f5f4; --card-bg: #ffffff; --text-primary: #1c1917; --text-secondary: #44403c; --text-muted: #78716c;
    --border-color: #e7e5e4; --soft: #fafaf9; --shadow: 0 10px 30px rgba(0,0,0,.06); --sidebar-w: 260px;
    --bs-primary: #dc2626; --bs-primary-rgb: 220, 38, 38; --bs-link-color: #dc2626; --bs-link-hover-color: #b91c1c;
}
[data-theme="dark"] {
    --bg: #0c0a09; --card-bg: #1c1917; --text-primary: #fafaf9; --text-secondary: #e7e5e4; --text-muted: #a8a29e;
    --border-color: #292524; --soft: #292524; --shadow: 0 10px 30px rgba(0,0,0,.4);
    --bs-body-bg: #0c0a09; --bs-body-color: #fafaf9;
}
* { box-sizing: border-box; }
body.app-body { font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text-primary); min-height: 100vh; }
a { color: var(--primary); }
.text-muted { color: var(--text-muted) !important; }

/* ---------- Sidebar ---------- */
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, #7f1d1d, #1c1917); color: #fff; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.app-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.35rem; letter-spacing: -.5px; text-transform: uppercase; }
.app-brand i { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: 0 8px 20px rgba(220,38,38,.45); }
.app-nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.app-nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 3px; border-radius: 12px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: .93rem; transition: all .2s; }
.app-nav-link i { width: 20px; text-align: center; opacity: .85; }
.app-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav-link.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 6px 18px rgba(220,38,38,.45); }
.app-sidebar-foot { padding: 16px 20px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.app-sidebar-foot .text-muted { color: rgba(255,255,255,.6) !important; }
.app-sidebar-foot .btn-outline-secondary { color: #fff; border-color: rgba(255,255,255,.25); }
.app-version { font-size: .7rem; color: rgba(255,255,255,.4); margin-top: 8px; text-align: center; }
.app-overlay { display: none; }

/* ---------- Hauptbereich ---------- */
.app-main { margin-left: var(--sidebar-w); padding: 0 28px 20px; min-height: 100vh; display: flex; flex-direction: column; }
.app-main.no-sidebar { margin-left: 0; }
.app-topbar { display: flex; align-items: center; gap: 12px; padding: 20px 0 18px; position: sticky; top: 0; background: var(--bg); z-index: 100; }
.app-title { font-size: 1.6rem; font-weight: 900; margin: 0; letter-spacing: -.5px; }
.app-footer { margin-top: auto; padding: 30px 0 5px; text-align: center; font-size: .78rem; color: var(--text-muted); }
.btn-icon { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-primary); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: none; }
    .app-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
    .app-main { margin-left: 0; padding: 0 14px 20px; }
    .app-title { font-size: 1.25rem; }
}

/* ---------- Karten ---------- */
.kb-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; color: var(--text-primary); }
.kb-card-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.kb-card-title i { color: var(--primary); }
.kb-card-title .ms-auto { font-weight: 500; font-size: .85rem; }
.stat-tile { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); height: 100%; position: relative; overflow: hidden; }
.stat-tile::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.stat-tile.tile-income::before { background: linear-gradient(90deg, #10b981, #14b8a6); }
.stat-tile.tile-expense::before { background: linear-gradient(90deg, #dc2626, #f97316); }
.stat-tile.tile-info::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.stat-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); }
.stat-value { font-size: 1.65rem; font-weight: 900; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Beträge, Badges ---------- */
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt-pos { color: #059669; } .amt-neg { color: var(--primary); } .amt-transfer { color: var(--info); }
[data-theme="dark"] .amt-pos { color: #34d399; } [data-theme="dark"] .amt-neg { color: #f87171; }
.cat-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); white-space: nowrap; }
.icon-bubble { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); flex-shrink: 0; }
.tag { display: inline-block; font-size: .7rem; padding: 1px 7px; border-radius: 6px; background: var(--soft); border: 1px solid var(--border-color); color: var(--text-muted); margin-right: 3px; }

/* ---------- Tabellen ---------- */
.kb-table { width: 100%; margin: 0; }
.kb-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--border-color); white-space: nowrap; background: transparent; }
.kb-table td { padding: 12px; border-bottom: 1px solid var(--border-color); vertical-align: middle; background: transparent; color: var(--text-primary); }
.kb-table tr:last-child td { border-bottom: none; }
.kb-table tbody tr:hover td { background: var(--soft); }
.tx-row-main { font-weight: 600; }
.tx-row-sub { font-size: .8rem; color: var(--text-muted); }

/* ---------- Listen ---------- */
.kb-list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border-color); }
.kb-list-item:last-child { border-bottom: none; }
.kb-list-item .grow { flex: 1; min-width: 0; }
.kb-list-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Buttons & Formulare ---------- */
.btn-foxi { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: none; border-radius: 50px; font-weight: 700; padding: 9px 22px; box-shadow: 0 6px 18px rgba(220,38,38,.3); transition: all .25s; }
.btn-foxi:hover, .btn-foxi:focus { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 25px rgba(220,38,38,.45); }
.btn-foxi.btn-sm { padding: 6px 16px; }
.form-control, .form-select { border-radius: 12px; border: 2px solid var(--border-color); background-color: var(--card-bg); color: var(--text-primary); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(220,38,38,.15); background-color: var(--card-bg); color: var(--text-primary); }
.form-label { font-weight: 600; font-size: .88rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.type-switch { display: flex; gap: 6px; background: var(--soft); padding: 5px; border-radius: 14px; border: 1px solid var(--border-color); }
.type-switch input { display: none; }
.type-switch label { flex: 1; text-align: center; padding: 9px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--text-muted); transition: all .2s; }
.type-switch input:checked + label.t-expense { background: var(--primary); color: #fff; }
.type-switch input:checked + label.t-income { background: #10b981; color: #fff; }
.type-switch input:checked + label.t-transfer { background: var(--info); color: #fff; }
.amount-input { font-size: 1.8rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.icon-grid, .color-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-choice { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--border-color); background: var(--card-bg); color: var(--text-primary); }
.icon-choice.selected, .icon-choice:hover { border-color: var(--primary); color: var(--primary); }
.color-choice { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; }
.color-choice.selected { border-color: var(--text-primary); transform: scale(1.12); }

/* ---------- Fortschritt ---------- */
.kb-progress { height: 10px; border-radius: 10px; background: var(--soft); }
.kb-progress .progress-bar { border-radius: 10px; }

/* ---------- Leerer Zustand ---------- */
.empty-state { text-align: center; padding: 45px 20px; color: var(--text-muted); border: 2px dashed var(--border-color); border-radius: 18px; }
.empty-state i { font-size: 2.6rem; opacity: .5; margin-bottom: 12px; }

/* ---------- Login / Installation ---------- */
body.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #7f1d1d, #1c1917); font-family: 'Inter', sans-serif; }
.login-box { background: var(--card-bg, #fff); color: var(--text-primary, #1c1917); border-radius: 24px; padding: 42px; max-width: 460px; width: 100%; box-shadow: 0 25px 70px rgba(0,0,0,.35); }
.feature-icon { width: 76px; height: 76px; border-radius: 20px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 2rem; box-shadow: 0 15px 30px rgba(220,38,38,.35); }

/* ---------- Preisvergleich ---------- */
.price-hero { background: linear-gradient(135deg, rgba(127,29,29,.97), rgba(220,38,38,.95)); color: #fff; border-radius: 20px; padding: 26px; margin-bottom: 20px; }
.price-hero .form-control, .price-hero .form-select { border-color: transparent; }
.price-cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.price-cat-pills input { display: none; }
.price-cat-pills label { padding: 6px 13px; border-radius: 20px; background: rgba(255,255,255,.14); cursor: pointer; font-weight: 600; font-size: .85rem; }
.price-cat-pills input:checked + label { background: #fff; color: var(--primary); }
.price-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.price-item:last-child { border-bottom: none; }
.price-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--border-color); }
.price-item .noimg { width: 56px; height: 56px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.price-item .price { font-size: 1.2rem; font-weight: 900; color: var(--primary); white-space: nowrap; }
.price-item.best { background: color-mix(in srgb, #10b981 8%, transparent); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.src-badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .4px; }
.src-own { background: #dbeafe; color: #1d4ed8; } .src-openprices { background: #dcfce7; color: #15803d; } .src-ebay { background: #fef3c7; color: #b45309; } .src-custom { background: #f3e8ff; color: #7e22ce; }
.portal-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 12px; text-decoration: none; color: var(--text-primary); font-weight: 600; transition: all .2s; }
.portal-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* ---------- Diverses ---------- */
.nav-tabs .nav-link { color: var(--text-muted); font-weight: 600; border-radius: 10px 10px 0 0; }
.nav-tabs .nav-link.active { color: var(--primary); }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
code { color: var(--primary); }
pre.api { background: var(--soft); border: 1px solid var(--border-color); border-radius: 12px; padding: 14px; font-size: .8rem; white-space: pre-wrap; }
.month-nav { display: inline-flex; align-items: center; gap: 6px; }
.month-nav .label { font-weight: 800; min-width: 140px; text-align: center; }
.update-badge { background: linear-gradient(135deg, #10b981, #059669); color: #fff; border-radius: 14px; padding: 16px 20px; }
.log-list { font-family: ui-monospace, monospace; font-size: .82rem; background: var(--soft); border-radius: 12px; padding: 12px 16px; border: 1px solid var(--border-color); }
@media print { .app-sidebar, .app-topbar .btn, .app-footer, form, .no-print { display: none !important; } .app-main { margin: 0; } }

/* ============================================
   Info-/Loginseite (seit 1.0.1)
   ============================================ */
body.lp-body { font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text-primary); scroll-behavior: smooth; }
.lp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.lp-nav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--card-bg) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-color); padding: 12px 0; }
.lp-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; text-transform: uppercase; letter-spacing: -.5px; text-decoration: none; color: var(--text-primary); }
.lp-brand i { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.lp-navlink { color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: .92rem; padding: 6px 10px; border-radius: 8px; }
.lp-navlink:hover { color: var(--primary); }
.lp-hero { background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 55%, #ea580c 120%); color: #fff; padding: 70px 0 80px; position: relative; overflow: hidden; }
.lp-hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%); pointer-events: none; }
.lp-badge { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 6px 14px; border-radius: 30px; font-weight: 700; font-size: .82rem; margin-bottom: 18px; }
.lp-title { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; letter-spacing: -1.2px; line-height: 1.12; margin-bottom: 18px; }
.lp-lead { font-size: 1.12rem; line-height: 1.7; opacity: .93; max-width: 620px; }
.lp-points { list-style: none; padding: 0; margin: 20px 0; }
.lp-points li { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-weight: 600; }
.lp-points i { color: #fde68a; }
.lp-login { background: var(--card-bg); color: var(--text-primary); border-radius: 22px; padding: 30px; box-shadow: 0 30px 70px rgba(0,0,0,.35); position: relative; z-index: 1; }
.lp-section { padding: 70px 0; }
.lp-alt { background: var(--card-bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.lp-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.lp-head h2, .lp-h2 { font-weight: 900; letter-spacing: -.8px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.lp-head p { color: var(--text-muted); font-size: 1.05rem; margin: 0; }
.lp-feature { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; padding: 24px; height: 100%; transition: transform .25s, box-shadow .25s, border-color .25s; }
.lp-feature:hover { transform: translateY(-5px); box-shadow: 0 18px 40px var(--shadow-color, rgba(0,0,0,.08)); border-color: var(--primary); }
.lp-feature h3 { font-size: 1.05rem; font-weight: 800; margin: 14px 0 8px; }
.lp-feature p { color: var(--text-muted); font-size: .92rem; margin: 0; line-height: 1.6; }
.lp-ficon { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; box-shadow: 0 10px 22px rgba(220,38,38,.3); }
.lp-ficon-lg { width: 64px; height: 64px; font-size: 1.6rem; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 30px; background: var(--soft); border: 1px solid var(--border-color); font-weight: 600; }
.lp-chip i { color: var(--success); }
.lp-step { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; padding: 26px; height: 100%; position: relative; }
.lp-stepnum { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.lp-step h3 { font-size: 1.1rem; font-weight: 800; margin: 14px 0 6px; }
.lp-step p { color: var(--text-muted); margin: 0; }
.lp-faq { border-radius: 14px !important; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--border-color) !important; background: var(--card-bg); }
.lp-faq .accordion-button { background: var(--card-bg); color: var(--text-primary); box-shadow: none; }
.lp-faq .accordion-button:not(.collapsed) { color: var(--primary); }
.lp-faq .accordion-body { color: var(--text-secondary); }
.lp-cta { background: linear-gradient(135deg, #7f1d1d, #dc2626); color: #fff; border-radius: 24px; padding: 48px 30px; text-align: center; }
.lp-cta h2 { font-weight: 900; letter-spacing: -.6px; }
.lp-cta p { opacity: .9; margin-bottom: 20px; }
.lp-footer { padding: 26px 0; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: .88rem; }
.lp-footer a { color: var(--text-muted); text-decoration: none; }
.lp-footer a:hover { color: var(--primary); }
@media (max-width: 991.98px) { .lp-hero { padding: 40px 0 50px; } .lp-section { padding: 48px 0; } }

/* Startseiten-Editor */
.le-row { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--soft); }
.le-row .le-tools { display: flex; gap: 4px; }
