/* =========================================================
   Verwaltung / CRM – Styles
   ========================================================= */

:root {
    --bg:       #f1f3f7;
    --card:     #ffffff;
    --text:     #1b1f27;
    --dim:      #626a78;
    --accent:   #ff5a1f;
    --accent-d: #e04a12;
    --blue:     #2563eb;
    --green:    #1fa45a;
    --red:      #dc2626;
    --border:   #dde1e9;
    --radius:   12px;
    --shadow:   0 4px 18px rgba(15, 20, 30, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); }

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #12161d, #1d2430);
    padding: 20px;
}
.login-card {
    background: var(--card); border-radius: 16px; padding: 40px 36px;
    width: 100%; max-width: 380px; text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
    display: grid; gap: 14px;
}
.login-icon { font-size: 2.4rem; }
.login-card h1 { font-size: 1.5rem; }
.login-card p { color: var(--dim); font-size: .92rem; }
.login-card input {
    font: inherit; padding: 13px 15px; border-radius: 10px;
    border: 1.5px solid var(--border); width: 100%;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-back { font-size: .85rem; color: var(--dim); text-decoration: none; }
.login-back:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn-primary {
    font: inherit; font-weight: 700; color: #fff;
    background: var(--accent); border: none; cursor: pointer;
    padding: 13px 28px; border-radius: 999px;
    transition: background .15s, transform .1s;
    box-shadow: 0 6px 18px rgba(255,90,31,.3);
}
.btn-primary:hover { background: var(--accent-d); }
.btn-primary:active { transform: scale(.98); }
.btn-secondary {
    font: inherit; font-weight: 600; font-size: .9rem;
    background: #fff; color: var(--text);
    border: 1.5px solid var(--border); cursor: pointer;
    padding: 9px 18px; border-radius: 999px;
    transition: border-color .15s, background .15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary.danger:hover { border-color: var(--red); color: var(--red); }
.btn-xs { padding: 6px 13px; font-size: .8rem; }
.btn-icon {
    font: inherit; width: 38px; height: 38px;
    border: 1.5px solid var(--border); border-radius: 9px;
    background: #fff; cursor: pointer; font-size: 1rem;
    transition: border-color .15s, background .15s;
}
.btn-icon:hover { border-color: var(--accent); }
.btn-icon.danger:hover { border-color: var(--red); background: #fef2f2; }
.btn-link {
    font: inherit; font-size: .88rem; font-weight: 600;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,.85); text-decoration: none; padding: 6px 4px;
}
.btn-link:hover { color: #fff; }
.inline-form { display: inline; }

/* ---------- Header / Tabs ---------- */
.admin-header {
    background: #12161d; color: #fff;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.admin-header-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 26px; height: 60px; flex-wrap: wrap;
}
.admin-tabs { display: flex; gap: 4px; }
.admin-tabs a {
    color: rgba(255,255,255,.75); text-decoration: none;
    font-weight: 600; font-size: .92rem;
    padding: 8px 14px; border-radius: 999px;
    transition: background .15s, color .15s;
}
.admin-tabs a:hover { color: #fff; background: rgba(255,255,255,.08); }
.admin-tabs a.active { color: #fff; background: var(--accent); }
.bubble {
    background: #fff; color: var(--accent);
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: 1px 7px; margin-left: 4px;
}
.admin-header-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }

/* ---------- Main / Cards ---------- */
.admin-main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 80px; }
.card {
    background: var(--card); border-radius: var(--radius);
    padding: 26px 26px; box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card h2 { font-size: 1.1rem; margin-bottom: 16px; }
.card h2 small { font-weight: 400; color: var(--dim); font-size: .82rem; }
.card label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; margin-bottom: 14px; }
.card input[type="text"], .card textarea, .card select {
    font: inherit; font-weight: 400;
    padding: 11px 13px; border-radius: 9px;
    border: 1.5px solid var(--border); background: #fbfcfe; width: 100%;
}
.card input:focus, .card textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,90,31,.12);
}
.card textarea { resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { color: var(--dim); font-size: .88rem; margin-bottom: 16px; }
.save-bar {
    position: sticky; bottom: 0; padding: 14px 0;
    background: linear-gradient(transparent, var(--bg) 35%);
    text-align: right;
}

/* ---------- Flash ---------- */
.flash {
    padding: 13px 18px; border-radius: 10px; font-weight: 600;
    margin-bottom: 18px; font-size: .92rem;
}
.flash.ok  { background: #e7f7ee; color: #116b3c; border: 1px solid #b5e6cc; }
.flash.err { background: #fdecec; color: #a31212; border: 1px solid #f5c2c2; }

/* ---------- Specs-Editor ---------- */
.spec-row {
    display: grid; grid-template-columns: 64px 1fr 1fr 42px;
    gap: 10px; margin-bottom: 10px; align-items: center;
}
.spec-icon-input { text-align: center; }

/* ---------- Bilder ---------- */
.upload-form { display: grid; gap: 14px; }
.dropzone {
    border: 2.5px dashed var(--border); border-radius: var(--radius);
    padding: 38px 20px; text-align: center; cursor: pointer;
    color: var(--dim); font-weight: 600;
    transition: border-color .15s, background .15s;
    display: block;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #fff7f3; color: var(--accent); }
.dropzone input[type="file"] { display: none; }
.image-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.image-card {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 10px; display: grid; gap: 8px; background: #fbfcfe;
}
.image-wrap { position: relative; border-radius: 8px; overflow: hidden; }
.image-wrap img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.hero-tag {
    position: absolute; top: 8px; left: 8px;
    background: var(--accent); color: #fff;
    font-size: .72rem; font-weight: 800;
    padding: 3px 10px; border-radius: 999px;
}
.image-actions { display: flex; gap: 6px; justify-content: center; }

/* ---------- Leads ---------- */
.new-count { color: var(--accent); }
.leads { display: grid; gap: 14px; }
.lead {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; background: #fbfcfe;
}
.lead-new { border-color: var(--accent); background: #fff9f6; }
.lead-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.lead-head time { margin-left: auto; color: var(--dim); font-size: .85rem; }
.lead-status { font-size: .75rem; font-weight: 800; letter-spacing: .04em; }
.lead-status.neu { color: var(--accent); }
.lead-status.kontaktiert { color: var(--green); }
.lead-wish {
    background: #eef2ff; color: var(--blue);
    font-size: .78rem; font-weight: 700;
    padding: 2px 10px; border-radius: 999px;
}
.lead-message { font-size: .95rem; margin-bottom: 12px; }
.lead-foot {
    display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
    font-size: .88rem; color: var(--dim);
}
.lead-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .row-2 { grid-template-columns: 1fr; }
    .admin-header-inner { height: auto; padding: 10px 16px; }
    .spec-row { grid-template-columns: 52px 1fr 1fr 38px; }
    .lead-head time { margin-left: 0; width: 100%; }
    .lead-actions { margin-left: 0; }
}
