:root {
    --bg: #0a0c11;
    --bg2: #0f1320;
    --panel: rgba(255, 255, 255, 0.04);
    --panel-solid: #141926;
    --border: rgba(255, 255, 255, 0.09);
    --text: #eef1f6;
    --muted: #9aa3b2;
    --accent: #7c5cff;
    --accent2: #18c8a8;
    --danger: #ff6b81;
    --grad: linear-gradient(135deg, #7c5cff 0%, #18c8a8 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --radius: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(180deg, rgba(8, 10, 15, 0.35) 0%, rgba(8, 10, 15, 0.55) 100%),
        url("/bg.svg");
    background-position: center, center;
    background-size: cover, cover;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; line-height: 1.15; letter-spacing: -0.01em; }
a { color: var(--accent2); text-decoration: none; transition: color .15s, opacity .15s; }
a:hover { opacity: .85; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; max-width: 1120px; width: 100%; margin: 0 auto; padding: 40px 22px 60px; }
.footer { text-align: center; padding: 24px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }

/* ── Nav ───────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 26px;
    background: rgba(10, 12, 17, 0.6);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.brand { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -0.02em; }
.brand span {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar .links { display: flex; align-items: center; gap: 20px; }
.topbar .links a { color: var(--text); font-weight: 500; font-size: .95rem; }
.topbar .user { color: var(--muted); font-size: .9rem; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: none; color: var(--text); cursor: pointer; font: inherit; font-weight: 500; }
.linkbtn:hover { color: var(--accent2); }
/* Mobil-Menü (CSS-only Toggle, kein JS nötig) */
.navtoggle { display: none; }
.navburger {
    display: none; width: 44px; height: 40px; flex-direction: column; gap: 4px;
    align-items: center; justify-content: center; cursor: pointer;
    border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
}
.navburger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.navtoggle:checked ~ .navburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navtoggle:checked ~ .navburger span:nth-child(2) { opacity: 0; }
.navtoggle:checked ~ .navburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--panel); color: var(--text);
    font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
    transition: transform .08s ease, filter .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); border: none; color: #0a0c11; box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35); }
.btn.primary:hover { filter: brightness(1.06); }
.cta { background: var(--grad); padding: 8px 16px; border-radius: 10px; color: #0a0c11 !important; font-weight: 700; }
.cta:hover { opacity: 1; filter: brightness(1.06); }

/* ── Hero ──────────────────────────────────────────── */
.hero { padding: 56px 0 28px; max-width: 820px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 18px; font-weight: 800; }
.hero h1::after {
    content: ""; display: block; width: 64px; height: 4px; margin-top: 18px;
    background: var(--grad); border-radius: 999px;
}
.lead { color: var(--muted); font-size: 1.18rem; max-width: 700px; }
.cta-row { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }

.features3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 46px; }
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; backdrop-filter: blur(8px); box-shadow: var(--shadow);
    transition: transform .12s ease, border-color .15s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(124,92,255,.4); }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); }

/* ── Auth ──────────────────────────────────────────── */
.authbox {
    max-width: 440px; margin: 48px auto; background: var(--panel-solid);
    border: 1px solid var(--border); border-radius: 20px; padding: 32px;
    box-shadow: var(--shadow);
}
.authbox h1 { margin: 0 0 20px; font-size: 1.7rem; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: .85rem; color: var(--muted); font-weight: 500; }
.form input, .filters select {
    padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border);
    background: #0c0f17; color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .filters select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.25);
}
.form .btn { margin-top: 6px; }
.alert { background: rgba(255,107,129,.12); border: 1px solid rgba(255,107,129,.4); color: #ffb3bd; padding: 11px 14px; border-radius: 11px; margin-bottom: 16px; font-size: .9rem; }
.muted { color: var(--muted); }

/* ── Dashboard ─────────────────────────────────────── */
.cards { display: flex; gap: 18px; flex-wrap: wrap; margin: 22px 0 8px; }
.cards .card { min-width: 240px; display: flex; flex-direction: column; gap: 10px; }
.card .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.card .value { font-size: 1.9rem; font-weight: 800; font-family: "Sora", sans-serif; }
.card .value.small { font-size: 1.05rem; font-weight: 600; }
.card.balance .value { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Voices ────────────────────────────────────────── */
.filters { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.tabs { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: .9rem; font-weight: 500; background: var(--panel); }
.tabs a:hover { border-color: rgba(124,92,255,.5); }
.tabs a.active { background: var(--grad); border-color: transparent; color: #0a0c11; font-weight: 700; }

.voicegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.voicecard {
    background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); transition: transform .12s ease, border-color .15s;
}
.voicecard:hover { transform: translateY(-3px); border-color: rgba(24,200,168,.4); }
.vc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vc-head strong { font-size: 1.05rem; }
.vc-meta { color: var(--muted); font-size: .82rem; margin: 6px 0; }
.vc-desc { font-size: .9rem; color: #c7ccd6; }
.voicecard audio { width: 100%; margin-top: 12px; height: 34px; }
.badge { font-size: .68rem; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap; }
.badge.professional { background: rgba(124,92,255,.18); color: #c9b8ff; }
.badge.normal { background: rgba(24,200,168,.16); color: #8fe6cf; }
.badge.own { background: rgba(255,193,84,.16); color: #ffd98f; }

/* ── Create-Formular ───────────────────────────────── */
.createform { max-width: 760px; }
.createform textarea, .createform select, .createform input[type=text], .createform input[type=number] {
    width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border);
    background: #0c0f17; color: var(--text); font: inherit;
}
.createform textarea:focus, .createform select:focus, .createform input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.25);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.check { flex-direction: row !important; align-items: center; gap: 8px; }
.check input { width: auto; }
.fieldlabel { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.voicepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); cursor: pointer; }
.pick:hover { border-color: rgba(124,92,255,.5); }
.pick input { width: auto; }

/* ── Status-Badges ─────────────────────────────────── */
.statusbadge { font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.statusbadge.new { background: rgba(154,163,178,.18); color: #c2c9d6; }
.statusbadge.in_progress { background: rgba(255,193,84,.18); color: #ffd98f; }
.statusbadge.completed { background: rgba(24,200,168,.18); color: #8fe6cf; }
.statusbadge.error { background: rgba(255,107,129,.18); color: #ffb3bd; }

/* ── Produktion / Spinner ──────────────────────────── */
.produce { display: flex; align-items: center; gap: 16px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent2); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Jingle-Liste ──────────────────────────────────── */
.rowhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px; }
.jinglelist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.jingleitem {
    display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 14px;
    padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--panel-solid); color: var(--text);
}
.jingleitem:hover { border-color: rgba(124,92,255,.5); text-decoration: none; }
.ji-title { font-weight: 600; }
.ji-type { color: var(--muted); font-size: .85rem; }
.ji-date { color: var(--muted); font-size: .82rem; }

/* ── Beispiele auf der Startseite ──────────────────── */
.examples { margin-top: 48px; }
.examples h2 { margin-bottom: 16px; }
.examplegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.examplecard { background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.examplecard audio { width: 100%; height: 34px; }

/* ── Aufladen / Hinweise ───────────────────────────── */
.amountrow { display: flex; gap: 10px; flex-wrap: wrap; }
.amt { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 600; }
.amt input { accent-color: var(--accent); }
.notice { padding: 12px 16px; border-radius: 12px; margin: 14px 0; font-weight: 500; }
.notice.ok { background: rgba(24,200,168,.14); border: 1px solid rgba(24,200,168,.4); color: #8fe6cf; }
.notice.err { background: rgba(255,107,129,.14); border: 1px solid rgba(255,107,129,.4); color: #ffb3bd; }

@media (max-width: 760px) {
    .features3 { grid-template-columns: 1fr; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .jingleitem { grid-template-columns: 1fr auto; }
    .ji-type, .ji-date { display: none; }
    .topbar { padding: 12px 16px; flex-wrap: wrap; }

    /* Navigation einklappen */
    .navburger { display: flex; }
    .topbar .links {
        display: none; width: 100%; flex-direction: column; align-items: stretch;
        gap: 6px; margin-top: 10px;
    }
    .navtoggle:checked ~ .links { display: flex; }
    .topbar .links a, .topbar .links .user, .topbar .links .inline, .topbar .links form {
        width: 100%;
    }
    .topbar .links a, .topbar .links .linkbtn {
        padding: 10px 12px; border-radius: 10px; text-align: left;
    }
    .topbar .links a:hover, .topbar .links .linkbtn:hover { background: var(--panel); }
    .topbar .links .cta { text-align: center; }
}

@media (max-width: 480px) {
    .content { padding: 26px 14px 44px; }
    .hero { padding: 32px 0 18px; }
    .lead { font-size: 1.05rem; }
    .cta-row { gap: 10px; }
    .cta-row .btn { width: 100%; }
    h2.section { font-size: 1rem; margin-top: 22px; }
    .voicepick { grid-template-columns: 1fr; }
    .createform { max-width: 100%; }
    .amountrow { gap: 8px; }
    .btn { padding: 10px 16px; }
    .ex-head { flex-wrap: wrap; }
}

/* ── Warenkorb-Zeilen & Vorschau ─────────────────────────────────────────── */
h2.section { font-size: 1.05rem; margin: 26px 0 4px; font-family: "Sora", sans-serif; }
.orderline { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.orderline select { flex: 1 1 auto; min-width: 0; }
.createform .orderline .qty { flex: 0 0 64px; width: 64px; text-align: center; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 8px 14px; }
.btn.ghost:hover { border-color: rgba(124,92,255,.5); color: #c9b8ff; }
.remove-line { padding: 6px 12px; font-size: 1.1rem; line-height: 1; }
.checkrow { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; font-size: .9rem; color: var(--muted); }
.checkrow input { margin-top: 3px; flex: none; }
.card.info { border-color: rgba(124,92,255,.4); background: rgba(124,92,255,.07); margin-bottom: 16px; }

/* ── Production-Report (PDF) ──────────────────────────────────────────────── */
.report { margin-top: 10px; }
.reportlink {
    display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
}
.reportlink:hover { border-color: rgba(124,92,255,.5); color: #c9b8ff; opacity: 1; }
.reportlink svg { color: var(--accent2); flex: none; }
.resultactions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.reportprev { margin-top: 10px; }
.reportprev summary {
    cursor: pointer; color: var(--muted); font-size: .9rem; padding: 6px 0; list-style: none;
    user-select: none;
}
.reportprev summary::before { content: "▸ "; color: var(--accent2); }
.reportprev[open] summary::before { content: "▾ "; }
.reportprev summary:hover { color: var(--text); }
.pdfframe {
    width: 100%; height: 520px; margin-top: 10px; border: 1px solid var(--border);
    border-radius: 12px; background: #fff;
}
@media (max-width: 480px) { .pdfframe { height: 360px; } }

/* ── Field help ("?" button + popover) ────────────────────────────────────── */
.fieldhelp {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin-left: 6px; padding: 0; vertical-align: middle;
    border: 1px solid var(--border); border-radius: 50%; background: var(--panel);
    color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1; cursor: pointer;
    font-family: inherit; transition: border-color .15s, color .15s, background .15s;
}
.fieldhelp:hover { border-color: var(--accent2); color: var(--accent2); background: rgba(24,200,168,.1); }
.helppop {
    max-width: 360px; margin: auto; padding: 18px 20px; border-radius: 14px;
    border: 1px solid var(--border); background: var(--panel-solid); color: var(--text);
    box-shadow: 0 20px 50px rgba(0,0,0,.5); font-size: .92rem; line-height: 1.5;
}
.helppop::backdrop { background: rgba(6,8,12,.55); backdrop-filter: blur(2px); }
.helppop-title { display: block; font-family: "Sora", sans-serif; font-size: 1rem; margin-bottom: 8px; color: var(--text); }
.helppop-body { display: block; color: var(--muted); }
.helppop-close {
    display: inline-block;
    margin-top: 14px; padding: 7px 16px; border-radius: 9px; border: none; cursor: pointer;
    background: var(--grad); color: #0a0c11; font: inherit; font-weight: 700; font-size: .85rem;
}
.helppop-close:hover { filter: brightness(1.06); }
.elementcard { margin-bottom: 14px; }
.elementcard textarea { width: 100%; min-height: 80px; margin-bottom: 10px; }
.titleinput { font-weight: 700; font-size: 1rem; background: transparent; border: none; border-bottom: 1px solid var(--border); color: var(--text); flex: 1; padding: 4px 2px; }
.titleinput:focus { outline: none; border-bottom-color: var(--accent2); }
.approvebar { margin-top: 18px; }
.statusbadge.review, .statusbadge.preview { background: rgba(124,92,255,.18); color: #c9b8ff; }
.statusbadge.producing { background: rgba(255,193,84,.18); color: #ffd98f; }
.statusbadge.draft { background: rgba(154,163,178,.18); color: #c2c9d6; }
.statusbadge.partial { background: rgba(255,193,84,.18); color: #ffd98f; }
