/* MyTaag – Basis-Styles. Farben: Schwarz, Weiß, Blau. */
:root {
    --blue:        #1d4ed8;
    --blue-dark:   #1741ac;
    --black:       #0b1220;
    --white:       #ffffff;
    --bg:          #f2f4f8;
    --muted:       #64748b;
    --border:      #e2e8f0;
    --error-bg:    #fef2f2;
    --error-fg:    #b91c1c;
    --success-bg:  #ecfdf5;
    --success-fg:  #047857;
    --info-bg:     #eff6ff;
    --info-fg:     #1d4ed8;
    --radius:      14px;
    --shadow:      0 10px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

/* hidden-Attribut immer respektieren (sonst überschreibt form input{display:block} versteckte Datei-Inputs) */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--black);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
}

/* Main / Layout */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* Logo (ersetzt die Kopfleiste) */
.logo {
    display: block;
    margin-bottom: 28px;
}
.logo img {
    display: block;
    height: 40px;
    width: auto;
    max-height: 40px;
    max-width: 160px;
}
.auth-wrap, .dash-wrap {
    width: 100%;
    max-width: 420px;
}
.dash-wrap { max-width: 560px; }

/* ---------------------------------------------------------------------------
 *  Einstellungen
 * ------------------------------------------------------------------------- */
.settings-wrap {
    width: 100%;
    max-width: none;
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    align-items: start;
}
.settings-grid .panel { margin-bottom: 0; }
.panel-danger { margin-top: 16px; }
.settings-head { margin-bottom: 24px; }
.settings-head h1 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: -.025em;
}
.settings-head p { margin: 0; color: var(--muted); }

/* Panel = eine Einstellungsgruppe */
.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 26px;
    margin-bottom: 16px;
}
.panel-head { margin-bottom: 18px; }
.panel-head h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.panel-head p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}
.panel-head strong { color: var(--black); font-weight: 600; }

/* Formularfelder in Panels */
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--black);
}
.field input { margin-top: 0; }

.panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Danger-Zone */
.panel-danger {
    border-color: #fca5a5;
    background: linear-gradient(0deg, var(--error-bg), var(--error-bg)) padding-box, var(--white);
    background: #fff8f8;
}
.panel-danger .panel-head h2 { color: var(--error-fg); }

.settings-back {
    margin: 8px 0 0;
    text-align: center;
    font-size: 14px;
}
.settings-back a { color: var(--blue); text-decoration: none; font-weight: 600; }
.settings-back a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
 *  Modal
 * ------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    animation: overlay-in .15s ease;
}
.modal-overlay[hidden] { display: none; }
.modal {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    padding: 26px;
    animation: modal-in .18s ease;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.modal-head h2 {
    margin: 0;
    font-size: 19px;
    letter-spacing: -.01em;
    color: var(--error-fg);
}
.modal-close {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: var(--black); }
.modal-text {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.55;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal { animation: none; }
}

/* Card */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    letter-spacing: -.02em;
}
.muted { color: var(--muted); margin: 0 0 20px; }

/* Forms */
form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--black);
}
form input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--black);
    transition: border-color .15s, box-shadow .15s;
}
form input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
/* Selects + Textareas im selben Look wie Inputs (:where = keine Spezifität,
   bestehende spezifischere Regeln gewinnen weiterhin). */
:where(form, .panel) :where(select, textarea) {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--black);
    transition: border-color .15s, box-shadow .15s;
}
:where(form, .panel) :where(textarea) { resize: vertical; min-height: 90px; line-height: 1.45; }
:where(form, .panel) :where(select, textarea):focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
form textarea, .field textarea {
    display: block; width: 100%; margin-top: 6px;
    padding: 12px 14px; font-size: 15px; font-family: inherit;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--white); color: var(--black);
    resize: vertical; min-height: 84px; line-height: 1.5;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { margin-top: 0; }
form textarea:focus, .field textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    vertical-align: middle;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary {
    background: var(--blue);
    color: var(--white);
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--black);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger {
    background: var(--error-fg);
    color: var(--white);
}
.btn-danger:hover { background: #991b1b; }
.btn-block { width: 100%; margin-top: 6px; }

/* Checkbox-Label */
label.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    margin-bottom: 16px;
}
label.check input {
    width: auto;
    margin: 3px 0 0;
}

/* Dashboard-Buttons nebeneinander */
.dash-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Rows / links */
.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 14px;
}
.row-between a { color: var(--blue); text-decoration: none; }
.row-between a:hover { text-decoration: underline; }

.auth-alt {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}
.auth-alt a { color: var(--blue); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

/* Flash-Meldungen */
.flash {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}
.flash-error   { background: var(--error-bg);   color: var(--error-fg); }
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.flash-info    { background: var(--info-bg);    color: var(--info-fg); }

/* Dashboard */
.dash-placeholder {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    color: var(--muted);
    background: #fafbfd;
}
.dash-placeholder p { margin: 0; }

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
}

/* ===========================================================================
 *  App-Shell mit Sidebar (eingeloggter Bereich)
 * ========================================================================= */
body.app { display: block; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-logo {
    display: block;
    padding: 4px 8px 22px;
}
.sidebar-logo img { display: block; height: 34px; width: auto; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background .12s, color .12s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); transition: color .12s; }
.nav-item:hover { background: #f1f5f9; }
.nav-item.is-active { background: var(--info-bg); color: var(--blue); }
.nav-item.is-active svg { color: var(--blue); }

.sidebar-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.sidebar-user { padding: 4px 12px 12px; }
.sidebar-user-name { font-weight: 700; font-size: 14px; }
.sidebar-user-mail {
    font-size: 12px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-logout:hover { background: var(--error-bg); color: var(--error-fg); }
.nav-logout:hover svg { color: var(--error-fg); }

/* Main-Bereich */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 20;
}
.app-topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.menu-toggle {
    display: none;
    border: none; background: transparent; cursor: pointer;
    padding: 4px; color: var(--black);
}
.menu-toggle svg { width: 24px; height: 24px; display: block; }
.app-content {
    padding: 28px 32px;
    max-width: none;
    width: 100%;
}
.content-narrow { max-width: 640px; }

.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(11, 18, 32, .45);
    z-index: 30;
}
.sidebar-backdrop[hidden] { display: none; }

/* Mobile: Sidebar wird zur Off-Canvas-Leiste */
@media (max-width: 820px) {
    .menu-toggle { display: block; }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        height: 100vh;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 10px 40px rgba(15, 23, 42, .18);
    }
    .app-shell.nav-open .sidebar { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
}

/* ===========================================================================
 *  Seiten-Header innerhalb der App
 * ========================================================================= */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.page-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }

/* ===========================================================================
 *  Visitenkarten-Liste (cards.php)
 * ========================================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.card-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.card-tile-head { display: flex; align-items: center; gap: 14px; }
.card-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    background: #e2e8f0;
}
.card-avatar-fallback {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--info-bg); color: var(--blue);
    font-weight: 800; font-size: 20px; flex-shrink: 0;
}
.card-tile-name { font-weight: 700; font-size: 16px; }
.card-tile-headline { color: var(--muted); font-size: 13px; }
.card-tile-url {
    margin: 14px 0 16px;
    font-size: 12px; color: var(--muted);
    word-break: break-all;
}
.card-tile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #fafbfd;
    color: var(--muted);
}
.empty-state h2 { margin: 0 0 6px; color: var(--black); font-size: 18px; }
.empty-state p { margin: 0 0 18px; }

/* ===========================================================================
 *  Visitenkarten-Editor (card-edit.php)
 * ========================================================================= */
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.edit-photo { display: flex; align-items: center; gap: 16px; }
.edit-photo img, .edit-photo .card-avatar-fallback { width: 72px; height: 72px; }
.edit-photo img { border-radius: 50%; object-fit: cover; }

.fields-list { display: flex; flex-direction: column; gap: 12px; }

/* Feld-Kachel – gestapelt: Typ, Wert, Titel, Beschreibung */
.field-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: var(--white);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.fc-top { display: flex; align-items: center; gap: 10px; }
.fc-top select { flex: 1; }
.field-card select,
.field-card input[type=text],
.field-card input[type=file] {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--white);
    width: 100%;
}
.field-card input[type=file] { padding: 8px 12px; font-size: 13px; }
.field-card .fc-value { font-weight: 600; }
.field-card .fc-title, .field-card .fc-desc { font-size: 13px; }
.field-card .fc-title::placeholder,
.field-card .fc-desc::placeholder { color: #9aa5b4; }
.field-card input:focus, .field-card select:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.field-remove {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted); font-size: 18px; line-height: 1;
}
.field-remove:hover { border-color: #fca5a5; color: var(--error-fg); }

/* Datei-Kachel: Typ-Badge oben */
.file-badge {
    display: inline-flex; align-items: center; gap: 7px;
    font-weight: 700; font-size: 13px;
    padding: 7px 11px; border-radius: 8px;
    background: var(--info-bg); color: var(--blue);
    flex: 1;
}
.file-badge .ci { width: 16px; height: 16px; }
.file-current { font-size: 12px; color: var(--muted); }
.file-current a { color: var(--blue); word-break: break-all; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] {
    width: 46px; height: 40px; padding: 2px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--white); cursor: pointer;
}

/* Vier Farbwähler (Design-Panel) */
.color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.color-swatch {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--muted);
}
.color-swatch input[type=color] {
    width: 100%; height: 44px; padding: 2px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--white); cursor: pointer;
}
@media (max-width: 480px) { .color-grid { grid-template-columns: repeat(2, 1fr); } }

/* Feld-Typ-Auswahl im Modal */
.ci { width: 20px; height: 20px; }
#field-modal .modal { max-width: 720px; }
#field-modal .modal-head h2 { color: var(--black); }
#field-step-type { max-height: 78vh; overflow-y: auto; padding-right: 4px; }
.type-group-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted); margin: 14px 0 8px;
}
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.type-option {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px;
    background: var(--white); cursor: pointer; font-size: 14px; font-weight: 600;
    text-align: left; color: var(--black);
}
.type-option:hover { border-color: var(--blue); background: var(--info-bg); }
.type-option-icon {
    width: 24px; height: 24px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--blue);
}
.type-option-icon .ci { width: 20px; height: 20px; }
.chosen-type { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; }
.chosen-type .type-option-icon { width: 42px; height: 42px; background: var(--info-bg); border-radius: 11px; }
.chosen-type .type-option-icon .ci { width: 22px; height: 22px; }

/* Eingaben in Schritt 2 – eigenes Styling, da außerhalb eines <form> */
#field-step-value .field { margin-top: 16px; margin-bottom: 4px; }
#field-step-value .field label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--black); margin-bottom: 8px;
}
#field-step-value input[type=text] {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    color: var(--black);
    transition: border-color .15s, box-shadow .15s;
}
#field-step-value input[type=text]::placeholder { color: #9aa5b4; }
#field-step-value input[type=text]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
.fe-file-box {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
#fe-file-name { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-actions {
    display: flex; gap: 12px; justify-content: flex-end;
    margin-top: 8px;
}
@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr 40px; }
    .field-row select { grid-column: 1 / -1; }
}

/* ===========================================================================
 *  Visitenkarten-Editor: Bilder (Banner / Foto / Logo)
 * ========================================================================= */
.img-banner {
    position: relative;
    height: 150px;
    border-radius: 12px;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    background-image: linear-gradient(135deg, var(--accent, #1d4ed8), color-mix(in srgb, var(--accent, #1d4ed8) 60%, #000 14%));
    border: 1px solid var(--border);
    cursor: pointer;
    overflow: hidden;
}
.img-banner-hint {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    color: #fff; background: rgba(11, 18, 32, .30);
    opacity: 0; transition: opacity .15s;
    font-weight: 600; font-size: 14px;
}
.img-banner:hover .img-banner-hint { opacity: 1; }
.img-banner-hint svg { width: 26px; height: 26px; }
.img-banner-clear {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: rgba(11, 18, 32, .6); color: #fff; border: none; border-radius: 8px;
    font-size: 12px; font-weight: 600; padding: 7px 11px; cursor: pointer;
    backdrop-filter: blur(2px);
}
.img-banner-clear:hover { background: rgba(185, 28, 28, .9); }
.img-avatar-wrap { position: relative; width: 100px; margin: -50px auto 0; }
.img-avatar {
    position: relative; display: block; width: 100px; height: 100px;
    border-radius: 50%; overflow: hidden; cursor: pointer;
    border: 4px solid var(--white); box-shadow: 0 4px 14px rgba(15, 23, 42, .16);
    background: #e2e8f0;
}
.img-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-avatar-fallback {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--blue); color: #fff; font-weight: 800; font-size: 36px;
}
.img-avatar-edit {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(11, 18, 32, .35); color: #fff; font-size: 28px; opacity: 0; transition: opacity .15s;
}
.img-avatar:hover .img-avatar-edit { opacity: 1; }
.img-logo {
    position: absolute; right: -12px; bottom: -10px;
    width: 42px; height: 42px; border-radius: 11px; overflow: hidden; cursor: pointer;
    background: var(--white); border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .22);
    display: flex; align-items: center; justify-content: center;
}
.img-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.img-logo span { font-size: 10px; color: var(--muted); }
.img-toggles { display: flex; gap: 18px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.img-toggles .check { margin-bottom: 0; font-size: 13px; }

/* Kleine graue Anzahl hinter Seitentiteln */
.title-count { color: var(--muted); font-weight: 500; font-size: .68em; }

/* Visitenkarten-Zuweisung auf der Gruppen-Bearbeiten-Seite */
.assign-list { display: flex; flex-direction: column; gap: 2px; max-height: 440px; overflow-y: auto; margin-bottom: 16px; }
.assign-row { display: flex; align-items: center; gap: 12px; padding: 8px 8px; border-radius: 10px; cursor: pointer; }
.assign-row:hover { background: #f8fafc; }
.assign-av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.assign-av img { width: 100%; height: 100%; object-fit: cover; }
.assign-name { font-weight: 600; font-size: 14px; }
.assign-note { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Gruppen-Badge auf Visitenkarten-Kacheln */
.tile-group { align-self: flex-start; max-width: 100%; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--blue); background: var(--info-bg); padding: 2px 8px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Gruppen-Auswahl im Modal */
.group-pick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.group-pick-btn { text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
.group-pick-btn:hover { background: #f8fafc; border-color: var(--blue); }
.group-pick-btn.is-current { border-color: var(--blue); color: var(--blue); background: var(--info-bg); }
.group-pick-btn.is-current::after { content: '✓'; margin-left: 8px; font-weight: 800; }
.group-pick-none { color: var(--muted); font-weight: 500; }

/* Rechte-Auswahl im Modal (Nutzer-Seite) */
.perm-toggles { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 4px; }
.perm-toggles .check { margin-bottom: 0; }

.field-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-2col { grid-template-columns: 1fr; } }

/* ===========================================================================
 *  Kontaktfelder als Anzeige-Kacheln (sortierbar)
 * ========================================================================= */
.field-item {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 12px; background: var(--white);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.fi-drag { cursor: grab; color: #94a3b8; display: flex; flex-shrink: 0; touch-action: none; }
.fi-drag:active { cursor: grabbing; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 8px 22px rgba(15, 23, 42, .16); }
.fi-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: var(--info-bg); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
}
.fi-icon .ci { width: 20px; height: 20px; }
.fi-main { flex: 1; min-width: 0; }
.fi-title { font-weight: 700; font-size: 14px; }
.fi-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-desc { font-size: 12px; color: var(--muted); opacity: .85; margin-top: 1px; }
.fi-edit, .field-item .field-remove {
    flex-shrink: 0; width: 34px; height: 34px;
    border: 1px solid var(--border); background: var(--white); border-radius: 9px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.fi-edit:hover { border-color: var(--blue); color: var(--blue); }
.field-item .field-remove { font-size: 18px; line-height: 1; }
.field-item .field-remove:hover { border-color: #fca5a5; color: var(--error-fg); }

/* ===========================================================================
 *  Visitenkarten-Editor: Tabs + volle Breite
 * ========================================================================= */
.card-form { width: 100%; padding-bottom: 84px; }
.editor-tabs {
    display: inline-flex; gap: 4px;
    background: #eef1f6; padding: 4px; border-radius: 12px; margin-bottom: 20px;
    max-width: 100%; overflow-x: auto; scrollbar-width: none;   /* mobil: Tabs wischbar statt Überlauf */
}
.editor-tabs::-webkit-scrollbar { display: none; }
.editor-tabs .etab { white-space: nowrap; flex-shrink: 0; }
.etab {
    border: none; background: transparent; cursor: pointer;
    padding: 9px 18px; border-radius: 9px;
    font-size: 14px; font-weight: 700; color: var(--muted);
    transition: background .15s, color .15s;
}
.etab:hover { color: var(--black); }
.etab.is-active { background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.etab-panel[hidden] { display: none; }

/* Schwebendes, zentriertes Speichern-Element */
.editor-actions-sticky {
    position: fixed;
    bottom: 22px;
    left: calc(50% + 124px);            /* Mitte des Inhaltsbereichs (Sidebar = 248px) */
    transform: translateX(-50%);
    z-index: 50;
    display: flex; gap: 10px; align-items: center;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .2);
}
.editor-actions-sticky .btn { border-radius: 999px; }
@media (max-width: 820px) {
    .editor-actions-sticky { left: 50%; right: auto; bottom: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
    .editor-actions-sticky { animation: actions-up .25s ease; }
}
@keyframes actions-up { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Bild-Bühne */
.img-stage { max-width: 620px; }
.img-stage-center { margin: 0 auto; }
.img-hover {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(11,18,32,.4); color: #fff; opacity: 0; transition: opacity .15s;
}
.img-hover svg { width: 26px; height: 26px; }
.img-hover-sm svg { width: 16px; height: 16px; }
.img-avatar:hover .img-hover, .img-logo:hover .img-hover { opacity: 1; }
.img-logo-empty { font-size: 20px; color: var(--muted); font-weight: 700; }

.img-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pill {
    border: 1px solid var(--border); background: var(--white);
    color: var(--muted); font-size: 13px; font-weight: 600;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    transition: border-color .15s, color .15s;
}
.pill:hover { border-color: #fca5a5; color: var(--error-fg); }
.pill[hidden] { display: none; }

/* ===========================================================================
 *  Visitenkarten-Liste (cards.php)
 * ========================================================================= */
.cards-toolbar { margin-bottom: 18px; }
.search-box { position: relative; max-width: 440px; }
.search-box svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.search-box input {
    width: 100%; padding: 12px 14px 12px 42px; font-size: 15px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--white);
}
.search-box input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card-tile {
    background: var(--white); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow); overflow: visible; padding: 0;
    display: flex; flex-direction: column;
    transition: transform .12s, box-shadow .12s;
}
/* Kachel mit offenem Menü nach vorne holen, damit das Dropdown nicht hinter
   Nachbar-Kacheln verschwindet. */
.card-tile:has(.tile-menu:not([hidden])) { z-index: 20; }
.card-tile:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(15, 23, 42, .12); }
.tile-banner {
    height: 90px; background-size: cover; background-position: center; background-repeat: no-repeat;
    background-image: linear-gradient(135deg, var(--accent, #1d4ed8), color-mix(in srgb, var(--accent, #1d4ed8) 60%, #000 14%));
    border-radius: 16px 16px 0 0;
}
.tile-avatar-wrap { position: relative; width: 74px; margin: -38px 0 0 20px; }
.tile-avatar {
    width: 74px; height: 74px; border-radius: 50%; object-fit: cover; display: block;
    border: 3px solid var(--white); box-shadow: 0 3px 10px rgba(15, 23, 42, .15); background: #e2e8f0;
}
.tile-avatar-fallback { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 27px; }
.tile-logo {
    position: absolute; right: -10px; bottom: -8px;
    width: 30px; height: 30px; border-radius: 8px; object-fit: contain;
    background: var(--white); border: 2px solid var(--white); box-shadow: 0 2px 6px rgba(15, 23, 42, .2); padding: 2px;
}
.tile-body { padding: 12px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.tile-name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.tile-role { font-size: 13px; color: var(--muted); margin-top: 1px; }
.tile-url { font-size: 12px; color: var(--blue); margin: 10px 0 16px; word-break: break-all; }
.tile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tile-del { color: var(--error-fg); }
.tile-del:hover { border-color: #fca5a5; }
.cards-noresult { text-align: center; color: var(--muted); padding: 30px; }

/* ===========================================================================
 *  Toast-Notifications (slide-in oben, auto-dismiss)
 * ========================================================================= */
.toast-stack {
    position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
    z-index: 2000; display: flex; flex-direction: column; gap: 10px; align-items: center;
    width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
    background: var(--white); color: var(--black);
    border: 1px solid var(--border); border-left-width: 4px;
    border-radius: 12px; padding: 12px 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
    font-size: 14px; font-weight: 500;
    animation: toast-in .28s cubic-bezier(.2, .8, .2, 1);
}
.toast > span { max-width: 60ch; }
.toast-success { border-left-color: var(--success-fg); }
.toast-error   { border-left-color: var(--error-fg); }
.toast-info    { border-left-color: var(--blue); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success svg { color: var(--success-fg); }
.toast-error   svg { color: var(--error-fg); }
.toast-info    svg { color: var(--blue); }
.toast-x { border: none; background: transparent; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; margin-left: 2px; }
.toast-x:hover { color: var(--black); }
.toast-out { animation: toast-out .3s ease forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast-out { animation: none; opacity: 0; } }

/* Kachel: klickbar + 3-Punkte-Menü */
.card-tile { position: relative; cursor: pointer; }
.tile-menu-btn {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: rgba(11, 18, 32, .5); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.tile-menu-btn svg { width: 18px; height: 18px; }
.tile-menu-btn:hover { background: rgba(11, 18, 32, .72); }
.tile-menu {
    position: absolute; top: 46px; right: 10px; z-index: 4;
    background: var(--white); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18); padding: 6px; min-width: 152px;
    display: flex; flex-direction: column;
}
.tile-menu[hidden] { display: none; }
.tile-menu a, .tile-menu button {
    display: block; width: 100%; box-sizing: border-box; appearance: none;
    text-align: left; background: none; border: none; cursor: pointer;
    padding: 9px 12px; border-radius: 8px;
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.35;
    color: var(--black); text-decoration: none;
}
.tile-menu a:hover, .tile-menu button:hover { background: #f1f5f9; }
.tile-menu-del { color: var(--error-fg); }
.tile-menu-del:hover { background: var(--error-bg); }

/* Panel-Kopf mit Aktion rechts */
.panel-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head-row > div { min-width: 0; }

/* Breadcrumbs (in der Topbar) */
.breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; min-width: 0; }
.breadcrumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .crumb-sep { color: #cbd5e1; }
.breadcrumbs .crumb-current { color: var(--black); font-weight: 800; letter-spacing: -.01em; }

/* Status-Badge (z.B. 2FA aktiv/inaktiv) */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.badge-on { background: var(--success-bg); color: var(--success-fg); }
.badge-off { background: #f1f5f9; color: var(--muted); }

/* ===========================================================================
 *  Auto-Speichern (Editor)
 * ========================================================================= */
.autosave-status { margin: 0; font-size: 13px; color: var(--muted); }
.autosave-bar {
    position: fixed; bottom: 22px; left: calc(50% + 124px); transform: translateX(-50%);
    z-index: 50; display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 999px; padding: 8px 10px 8px 16px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .18); font-size: 13px; font-weight: 600; color: var(--muted);
}
.autosave-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-fg); transition: background .2s; }
.autosave-bar[data-state="saving"] .autosave-dot { background: var(--blue); animation: pulse 1s infinite; }
.autosave-bar[data-state="error"] { color: var(--error-fg); }
.autosave-bar[data-state="error"] .autosave-dot { background: var(--error-fg); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 820px) { .autosave-bar { left: 50%; bottom: 16px; } }

/* Slug-Feld */
.slug-field { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.slug-prefix { display: flex; align-items: center; padding: 0 10px; background: #f1f5f9; color: var(--muted); font-size: 13px; white-space: nowrap; }
.slug-field input { border: none !important; border-radius: 0 !important; box-shadow: none !important; }
.field-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ===========================================================================
 *  Statistik
 * ========================================================================= */
.stats-filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg-item { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.seg-item:hover { color: var(--black); }
.seg-item.is-active { background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.stats-cardfilter select {
    padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--white);
    font-size: 14px; font-weight: 600; cursor: pointer; min-width: 200px;
}

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; }
.stat-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

#stats-chart { width: 100%; display: block; }
.chart-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.stats-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.stats-two .panel { margin-bottom: 0; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 24px 110px 1fr 34px; align-items: center; gap: 10px; }
.bar-ic { color: var(--blue); display: flex; }
.bar-ic .ci { width: 18px; height: 18px; }
.bar-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar-n { font-size: 13px; font-weight: 700; text-align: right; color: var(--muted); }

.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.stats-table td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.stats-table td:not(:first-child) { text-align: right; font-weight: 700; }
.stats-table a { color: var(--blue); text-decoration: none; font-weight: 600; }
.stats-table a:hover { text-decoration: underline; }

/* Statistiken: eigener Zeitraum */
.stats-daterange {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
    background: var(--white); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 18px;
}
.stats-daterange label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.stats-daterange input[type=date] {
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px;
    background: var(--white); color: var(--black); font-family: inherit;
}
.stats-daterange input[type=date]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }

/* Schriftart-Auswahl (Editor) */
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.font-option {
    text-align: left; cursor: pointer; background: var(--white);
    border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 2px; transition: border-color .12s, box-shadow .12s;
}
.font-option:hover { border-color: var(--blue); }
.font-option.is-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(29,78,216,.18); }
.font-name { font-size: 12px; font-weight: 700; color: var(--muted); }
.font-sample { font-size: 19px; font-weight: 600; color: var(--black); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Banner-Zuschnitt-Modal */
.crop-modal { max-width: 560px; }
.crop-stage {
    position: relative; width: 100%; overflow: hidden;
    background: #0b1220; border-radius: 12px; cursor: grab; user-select: none;
    touch-action: none;
}
.crop-stage:active { cursor: grabbing; }
#crop-img { position: absolute; top: 0; left: 0; max-width: none; will-change: transform; }
.crop-frame { position: absolute; inset: 0; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(11,18,32,.35) inset; border: 2px solid rgba(255,255,255,.6); border-radius: 12px; }
.crop-controls { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; }
.crop-controls span { font-size: 13px; font-weight: 600; color: var(--muted); }
.crop-controls input[type=range] { flex: 1; accent-color: var(--blue); }

/* ===========================================================================
 *  Unternehmen-Wechsler (Sidebar) + Verwaltung
 * ========================================================================= */
.company-switch { position: relative; margin: 0 0 14px; }
.company-current {
    width: 100%; display: flex; align-items: center; gap: 10px;
    background: #f1f5f9; border: 1px solid var(--border); border-radius: 12px;
    padding: 8px 10px; cursor: pointer; text-align: left;
}
.company-current:hover { border-color: var(--blue); }
.company-avatar {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: var(--info-bg); color: var(--blue); font-weight: 800; font-size: 14px;
}
.company-avatar img { width: 100%; height: 100%; object-fit: cover; }
.company-avatar.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
.company-avatar.lg { width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
.company-name { flex: 1; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-caret { color: var(--muted); flex-shrink: 0; }

.company-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
    background: var(--white); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 6px;
}
.company-menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 6px; }
.company-item-form { margin: 0; }
.company-item {
    width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
    background: none; border: none; cursor: pointer; padding: 8px 10px; border-radius: 9px; color: var(--black);
}
.company-item:hover { background: #f1f5f9; }
.company-item.is-active { color: var(--blue); font-weight: 700; }
.company-item-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-manage { display: block; margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--border); color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 600; }
.company-manage:hover { background: #f1f5f9; border-radius: 0 0 9px 9px; }

.company-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.company-card { margin-bottom: 0; }
.company-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.company-card-name { font-weight: 800; font-size: 17px; }
.company-card-meta { font-size: 13px; color: var(--muted); }
.company-row { display: flex; gap: 8px; margin-bottom: 12px; }
.company-row input { flex: 1; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.company-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.company-actions .btn { margin: 0; }
.company-logo-form { margin: 0; }
.company-logo-form label { margin: 0; }

/* ===========================================================================
 *  Erstellungs-Auswahl + Import
 * ========================================================================= */
.choice-modal { max-width: 620px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .choice-grid { grid-template-columns: 1fr; } }
.choice-card {
    display: flex; flex-direction: column; gap: 6px; text-decoration: none;
    border: 1px solid var(--border); border-radius: 14px; padding: 18px;
    color: var(--black); transition: border-color .12s, box-shadow .12s, transform .08s;
    /* Button-Reset (identisch zu den <a>-Kacheln) */
    background: var(--white); text-align: left; font-family: inherit; cursor: pointer; width: 100%;
}
.choice-card:hover { border-color: var(--blue); box-shadow: 0 8px 22px rgba(15,23,42,.1); transform: translateY(-1px); }
.choice-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--info-bg); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.choice-ic svg { width: 22px; height: 22px; }
.choice-title { font-weight: 800; font-size: 15px; }
.choice-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }

.upload-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    border: 2px dashed var(--border); border-radius: 14px; padding: 40px 20px; cursor: pointer;
    text-align: center; transition: border-color .15s, background .15s;
}
.upload-drop:hover, .upload-drop.dragover { border-color: var(--blue); background: var(--info-bg); }
.upload-drop svg { width: 34px; height: 34px; color: var(--blue); }
.upload-title { font-weight: 700; font-size: 15px; }
.upload-hint { font-size: 13px; color: var(--muted); }

.map-list { display: flex; flex-direction: column; gap: 10px; }
.map-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 12px; }
.map-label { font-size: 14px; font-weight: 600; }
.map-row select { margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--white); width: 100%; }
@media (max-width: 520px) { .map-row { grid-template-columns: 1fr; gap: 4px; } }
.table-scroll { overflow-x: auto; }
.import-preview th, .import-preview td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ===========================================================================
 *  Einstellungen – neues Design (Hero + aufklappbare Zeilen)
 * ========================================================================= */
.settings-wrap2 { width: 100%; max-width: none; }
.account-hero {
    display: flex; align-items: center; gap: 16px;
    background: var(--white); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 26px;
}
.account-avatar {
    width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--info-bg); color: var(--blue); font-weight: 800; font-size: 24px;
}
.account-meta { flex: 1; min-width: 0; }
.account-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.account-mail { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }

.settings-group { margin-bottom: 24px; }
.settings-group-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 4px 10px; }
.settings-group-title.danger { color: var(--error-fg); }

.set-row {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; margin-bottom: 8px; overflow: hidden;
}
.set-row > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 16px 18px; cursor: pointer; list-style: none;
}
.set-row > summary::-webkit-details-marker { display: none; }
.set-row > summary:hover { background: #f8fafc; }
.set-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-k { font-weight: 700; font-size: 15px; }
.set-v { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-edit { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--blue); }
.set-row[open] > summary { border-bottom: 1px solid var(--border); }
.set-row[open] > summary .set-edit { color: var(--muted); }
.set-form { display: flex; gap: 10px; padding: 16px 18px; align-items: center; }
.set-form-col { flex-direction: column; align-items: stretch; }
.set-form input {
    flex: 1; margin: 0; padding: 11px 13px; border: 1px solid var(--border);
    border-radius: 10px; font-size: 14px; background: var(--white); width: 100%;
}
.set-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.set-form .btn { flex-shrink: 0; }

.set-row-danger {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 16px 18px; border-color: #fca5a5; background: #fff8f8;
}

/* Kopf-Aktionen (Editor: Kopieren + Vorschau) */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; justify-content: flex-end; }
.head-actions .btn { white-space: nowrap; }
@media (max-width: 720px) {
    .page-head:has(.head-actions) { flex-wrap: wrap; }
    .head-actions { flex-shrink: 1; justify-content: flex-start; }
}

/* ===========================================================================
 *  Mehrfachauswahl (Visitenkarten) + Floating Bulk-Leiste
 * ========================================================================= */
.tile-select {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    width: 26px; height: 26px; cursor: pointer;
}
.tile-select input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tile-check-box {
    display: block; width: 24px; height: 24px; border-radius: 7px;
    background: rgba(255,255,255,.9); border: 2px solid rgba(11,18,32,.35);
    box-shadow: 0 1px 3px rgba(15,23,42,.2); transition: background .12s, border-color .12s;
    position: relative;
}
.tile-select input:checked + .tile-check-box { background: var(--blue); border-color: var(--blue); }
.tile-select input:checked + .tile-check-box::after {
    content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
    border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.card-tile.is-selected { outline: 2px solid var(--blue); outline-offset: 1px; }

.bulk-bar {
    position: fixed; bottom: 22px; left: calc(50% + 124px); transform: translateX(-50%);
    z-index: 60; display: flex; align-items: center; gap: 16px;
    background: var(--black); color: #fff; border-radius: 999px;
    padding: 10px 12px 10px 20px; box-shadow: 0 16px 40px rgba(15,23,42,.3);
    animation: actions-up .22s ease;
}
.bulk-count { font-size: 14px; font-weight: 700; }
.bulk-actions { display: flex; gap: 8px; }
.bulk-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); background: transparent; }
.bulk-actions .btn-ghost:hover { border-color: #fff; color: #fff; }
@media (max-width: 820px) { .bulk-bar { left: 50%; bottom: 16px; } }

/* ===========================================================================
 *  Nutzer / Team
 * ========================================================================= */
.set-row-static { padding: 0; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.member-row .set-info { flex: 1; min-width: 0; }
.member-row form { flex-shrink: 0; }
.account-avatar.sm { width: 38px; height: 38px; font-size: 15px; border-radius: 10px; }
.company-static { cursor: default; }
.company-static:hover { border-color: var(--border); }

/* Slug-Zeile mit Kopieren-Button */
.slug-row { display: flex; gap: 8px; align-items: stretch; }
.slug-row .slug-field { flex: 1; }
.slug-row .btn-sm { flex-shrink: 0; white-space: nowrap; }

/* Crop-Stage: runder Rahmen bei quadratischem Zuschnitt (Foto/Logo) */
.crop-stage.crop-round { max-width: 320px; margin: 0 auto; }
.crop-stage.crop-round .crop-frame { border-radius: 50%; }

/* ===========================================================================
 *  Design-Tab: Eigene Icons
 * ========================================================================= */
.ci-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ci-empty { margin: 0; font-size: 14px; color: var(--muted); }
.ci-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
}
.ci-prev {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: #f1f5f9; color: var(--blue, #1d4ed8);
}
.ci-prev img { width: 22px; height: 22px; object-fit: contain; display: block; }
.ci-prev .ci { width: 20px; height: 20px; }
.ci-prev-default { opacity: .55; }
.ci-arrow { color: var(--muted); }
.ci-name { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; }
.ci-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ci-add select { flex: 1; min-width: 180px; margin: 0; width: auto; padding: 8px 12px; font-size: 14px; }
.ci-error { margin: 10px 0 0; font-size: 13px; color: var(--error-fg, #b91c1c); }

/* ===========================================================================
 *  Unternehmen: E-Mail-Vorlagen
 * ========================================================================= */
.panel-head code, .mail-ph code {
    font-size: 12px; background: #f1f5f9; border-radius: 5px; padding: 1px 5px; color: var(--black);
}
.mail-list { display: flex; flex-direction: column; gap: 10px; }
.mail-item { border: 1px solid var(--border); border-radius: 12px; }
.mail-item[open] { border-color: #cbd5e1; }
.mail-item summary {
    list-style: none; cursor: pointer; padding: 14px 16px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
}
.mail-item summary::-webkit-details-marker { display: none; }
.mail-item-title { font-weight: 700; font-size: 15px; }
.mail-item-desc { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.mail-badge {
    font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
    background: #f1f5f9; color: var(--muted);
}
.mail-badge.is-custom { background: var(--info-bg); color: var(--blue); }
.mail-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.mail-ph { font-size: 13px; color: var(--muted); margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-preview-modal { max-width: 640px; width: 100%; }
.mail-preview-frame { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 10px; background: #f2f4f8; }

/* ===========================================================================
 *  Leads
 * ========================================================================= */
.page-head-actions { display: flex; gap: 8px; flex-shrink: 0; justify-content: flex-end; }
.leads-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.leads-toolbar .search-box { flex: 1; min-width: 220px; max-width: none; }
.leads-toolbar select { width: auto; margin: 0; padding: 10px 12px; font-size: 14px; min-width: 170px; }
.leads-panel { padding: 0; overflow: hidden; }
.leads-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.leads-table th {
    text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: #fafbfc;
}
.leads-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.leads-table tr:last-child td { border-bottom: 0; }
.leads-table .col-check { width: 36px; padding-right: 0; }
.leads-table input[type=checkbox] { display: inline-block; width: 16px; height: 16px; margin: 2px 0 0; padding: 0; }
.lead-row { cursor: pointer; transition: background .12s; }
.lead-row:hover { background: #f8fafc; }
.lead-row.is-selected { background: var(--info-bg); }
.lead-name a { color: var(--black); font-weight: 600; text-decoration: none; }
.lead-name a:hover { color: var(--blue); }
.lead-sub { display: block; font-size: 12px; color: var(--muted); }
.leads-table td a[href^="mailto:"] { color: var(--blue); text-decoration: none; }
.leads-table .muted { margin: 0; }
.lead-group { display: inline-block; font-size: 12px; font-weight: 600; background: #f1f5f9; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.lead-origin, .lead-date { color: var(--muted); white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 14px; color: var(--muted); }

.field-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .field-row2 { grid-template-columns: 1fr; } }
.field-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.field-hint code { font-size: 12px; background: #f1f5f9; border-radius: 5px; padding: 1px 5px; color: var(--black); }

/* Leads: Gruppen-Sidebar links, Tabelle rechts */
.leads-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.leads-main { min-width: 0; }
.lg-side {
    position: sticky; top: 16px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    display: flex; flex-direction: column; max-height: calc(100vh - 110px); overflow: hidden;
}
.lg-side-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 14px 10px 16px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.lg-add {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--white);
    color: var(--blue); font-size: 18px; line-height: 1; cursor: pointer;
}
.lg-add:hover { border-color: var(--blue); background: var(--info-bg); }
.lg-new, .lg-rename-form { display: flex; gap: 6px; margin: 0; padding: 0 10px 10px; }
.lg-new input, .lg-rename-form input { margin: 0; padding: 8px 10px; font-size: 14px; min-width: 0; }
.lg-rename-form { padding: 4px 0 6px; }
.lg-nav { overflow-y: auto; padding: 0 8px 10px; }
.lg-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
    color: var(--black); text-decoration: none; font-size: 14px; font-weight: 500;
}
.lg-item:hover { background: #f1f5f9; }
.lg-item.is-active { background: var(--info-bg); color: var(--blue); font-weight: 700; }
.lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-n { font-size: 12px; color: var(--muted); font-weight: 600; }
.lg-item.is-active .lg-n { color: var(--blue); }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.lg-item.is-active .lg-dot { background: var(--blue); }
.lg-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.lg-entry { position: relative; }
.lg-tools {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: none; gap: 2px; background: inherit; padding-left: 4px;
}
.lg-entry:hover .lg-tools, .lg-entry:focus-within .lg-tools { display: flex; }
.lg-entry:hover .lg-n, .lg-entry:focus-within .lg-n { visibility: hidden; }
.lg-entry.is-renaming .lg-item, .lg-entry.is-renaming .lg-tools { display: none; }
.lg-tools form { margin: 0; }
.lg-tool {
    width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 7px; background: var(--white); color: var(--muted); cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.lg-tool:hover { color: var(--blue); }
.lg-tool-del:hover { color: var(--error-fg); }
.lg-empty { margin: 6px 8px 4px; font-size: 13px; color: var(--muted); line-height: 1.45; }
@media (max-width: 900px) {
    .leads-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .lg-side { position: static; max-height: 260px; }
}

.lead-extra { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.lead-extra dt { font-weight: 600; color: var(--muted); }
.lead-extra dd { margin: 0; }
.lead-del-btn { color: var(--error-fg); margin-right: auto; }

/* Lead-Formular-Editor */
.lf-list { display: flex; flex-direction: column; gap: 10px; }
.lf-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--white); }
.lf-drag { cursor: grab; color: #94a3b8; padding-top: 10px; }
.lf-main { flex: 1; min-width: 0; }
.lf-top { display: flex; gap: 8px; align-items: center; }
.lf-top select { width: auto; min-width: 130px; flex-shrink: 0; margin: 0; padding: 9px 10px; font-size: 14px; }
.lf-top .lf-label { flex: 1; min-width: 0; margin: 0; padding: 9px 12px; font-size: 14px; }
@media (max-width: 560px) { .lf-top { flex-wrap: wrap; } .lf-top .lf-label { min-width: 140px; } }
.lf-top label.lf-req { margin: 0; font-size: 13px; align-items: center; white-space: nowrap; }
.lf-top label.lf-req input { margin: 0; }
.panel-head-row > .btn { white-space: nowrap; flex-shrink: 0; }
.lf-options { margin-top: 8px; font-size: 14px; min-height: 70px; }

/* Schalter (Toggle) */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch-slider::before {
    content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px;
    background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s;
}
.switch input:checked + .switch-slider { background: var(--blue); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px rgba(29, 78, 216, .25); }
@media (max-width: 1100px) {
    .page-head:has(.page-head-actions) { flex-wrap: wrap; }
    .page-head-actions { flex-wrap: wrap; justify-content: flex-start; flex-shrink: 1; width: 100%; }
}

/* Lead-Formular: zwei Spalten (Einstellungen | Felder) */
.lf-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.lf-col > .panel:last-child { margin-bottom: 0; }
.lead-form-editor .editor-actions { margin-top: 16px; }
@media (max-width: 1100px) { .lf-cols { grid-template-columns: minmax(0, 1fr); gap: 0; } .lf-col > .panel:last-child { margin-bottom: 16px; } }

/* ===========================================================================
 *  Seitenpanel (von rechts)
 * ========================================================================= */
body.sheet-open { overflow: hidden; }
.sheet-backdrop {
    position: fixed; inset: 0; z-index: 90; background: rgba(11, 18, 32, .45);
    opacity: 0; transition: opacity .22s ease;
}
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
    width: 480px; max-width: 100%;
    background: var(--white); box-shadow: -18px 0 50px rgba(15, 23, 42, .18);
    transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    visibility: hidden;
}
.sheet.is-open { transform: none; visibility: visible; }
.sheet form { display: flex; flex-direction: column; height: 100%; margin: 0; }
.sheet-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.sheet-head h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sheet-meta { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.sheet-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 24px; border-top: 1px solid var(--border); background: var(--white);
}
.sheet-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--error-bg); color: var(--error-fg); font-size: 14px; }
.sheet-extra { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.sheet-extra h3 { margin: 0 0 12px; font-size: 14px; }
@media (max-width: 560px) { .sheet-head, .sheet-body, .sheet-foot { padding-left: 16px; padding-right: 16px; } }
.lead-name a { white-space: nowrap; }
.leads-table td { white-space: nowrap; }
.mail-item { scroll-margin-top: 90px; }
.lf-optin-hint { margin-top: 4px; }

/* ===========================================================================
 *  Registrierung / Onboarding: Fragen links, Live-Visitenkarte rechts
 * ========================================================================= */
body.ob-body { background: var(--white); }
.ob { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; --card-accent: #1d4ed8; }
.ob-flow { padding: 28px clamp(24px, 6vw, 88px) 40px; display: flex; flex-direction: column; }
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 44px; }
.ob-logo img { display: block; }
.ob-login { font-size: 14px; color: var(--muted); }
.ob-login a { color: var(--blue); font-weight: 600; text-decoration: none; }

.ob-progress { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 460px; }
.ob-progress-bar { display: block; height: 4px; border-radius: 99px; background: #e5e9f0; overflow: hidden; position: relative; }
.ob-progress-bar::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.ob-progress li.is-done .ob-progress-bar::after, .ob-progress li.is-current .ob-progress-bar::after { transform: scaleX(1); }
.ob-progress li.is-current .ob-progress-bar::after { opacity: .45; }
.ob-progress-label { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: #94a3b8; }
.ob-progress li.is-current .ob-progress-label, .ob-progress li.is-done .ob-progress-label { color: var(--black); }
.ob:not(.ob-js) .ob-progress { display: none; }

.ob-form { max-width: 460px; }
.ob-step { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.ob:not(.ob-js) .ob-step { margin-bottom: 40px; }
.ob-q {
    font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(32px, 3.6vw, 44px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700;
    color: var(--black); margin: 0 0 12px; padding: 0;
}
.ob-hint { margin: 0 0 28px; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 40ch; }

.ob-field, .ob-form label.ob-field { display: block; margin: 0 0 18px; font-size: 13px; font-weight: 600; color: var(--black); }
.ob-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.ob-opt { font-weight: 500; color: #94a3b8; margin-left: 4px; }
.ob-form input[type=text], .ob-form input[type=email], .ob-form input[type=tel], .ob-form input[type=password] {
    margin-top: 7px; padding: 14px 16px; font-size: 16px; border-radius: 12px; border-color: #dbe1ea;
}
.ob-form input::placeholder { color: #a8b3c2; }

/* Foto */
.ob-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.ob-photo {
    width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; cursor: pointer;
    border: 1.5px dashed #b8c2d1; display: flex; align-items: center; justify-content: center;
    color: #7b8798; background: #f7f9fc center / cover no-repeat; transition: border-color .15s, color .15s;
}
.ob-photo:hover { border-color: var(--blue); color: var(--blue); }
.ob-photo.has-photo { border: 0; }
.ob-photo.has-photo .ob-photo-plus { display: none; }
.ob-photo-plus svg { display: block; }
.ob-photo-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ob-photo-text span { color: var(--muted); font-size: 13px; }

/* Farbwahl */
.ob-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.ob-swatch { position: relative; width: 36px; height: 36px; margin: 0; cursor: pointer; }
.ob-swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: 0; }
.ob-swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s; pointer-events: none; }
.ob-swatch input:checked + span, .ob-swatch.is-on span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sw); }
.ob-swatch input:focus-visible + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.ob-swatch:hover span { transform: scale(1.08); }
.ob-swatch-custom span { background: conic-gradient(#ef4444, #eab308, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444); }
.ob-swatch-custom.is-on span { background: var(--sw); }

/* Passwort */
.ob-pass { position: relative; display: block; }
.ob-pass input { padding-right: 96px !important; }
.ob-pass-toggle {
    position: absolute; right: 8px; top: calc(50% + 3px); transform: translateY(-50%);
    border: 0; background: #f1f5f9; color: var(--black); font-size: 12px; font-weight: 600;
    padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.ob-strength { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; min-height: 18px; }
.ob-strength-bar { flex: 1; max-width: 160px; height: 4px; border-radius: 99px; background: #e5e9f0; overflow: hidden; }
.ob-strength-bar i { display: block; height: 100%; width: 0; background: #ef4444; transition: width .25s, background .25s; }
.ob-strength[data-level="0"] i { width: 12%; background: #ef4444; }
.ob-strength[data-level="1"] i { width: 35%; background: #f59e0b; }
.ob-strength[data-level="2"] i { width: 60%; background: #84cc16; }
.ob-strength[data-level="3"] i { width: 82%; background: #22c55e; }
.ob-strength[data-level="4"] i { width: 100%; background: #16a34a; }
.ob-strength-text { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Navigation */
.ob-nav { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ob-next { margin-left: auto; padding: 14px 26px; font-size: 15px; border-radius: 12px; }
.ob-back { padding: 13px 18px; border-radius: 12px; }
.ob-skip { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; padding: 8px; }
.ob-skip:hover { color: var(--black); }
.ob:not(.ob-js) .ob-back, .ob:not(.ob-js) .ob-skip { display: none; }
.ob-legal { margin: 28px 0 0; font-size: 12px; color: #94a3b8; }
.ob-legal a { color: inherit; }
.ob .toast-stack { position: fixed; }

/* Schritt-Wechsel (Reaktion auf Weiter/Zurück) */
@keyframes ob-fwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes ob-bwd { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.ob-step.ob-in-fwd { animation: ob-fwd .28s ease; }
.ob-step.ob-in-back { animation: ob-bwd .28s ease; }

/* Bühne mit der Live-Visitenkarte */
.ob-stage {
    background: #eef1f6; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 24px; position: sticky; top: 0; height: 100vh;
}
.ob-stage-note { margin: 22px 0 0; font-size: 13px; color: #7b8798; }
.ob-card {
    width: 340px; max-width: 100%; background: #fff; border-radius: 26px; overflow: hidden; text-align: center;
    padding: 0 22px 24px; box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 30px 60px -18px rgba(15,23,42,.28);
}
.ob-card-banner {
    height: 104px; margin: 0 -22px;
    background: var(--card-accent);
    background: linear-gradient(135deg, var(--card-accent), color-mix(in srgb, var(--card-accent) 62%, #000 16%));
    transition: background .35s ease;
}
.ob-card-avatar {
    width: 96px; height: 96px; margin: -50px auto 0; border-radius: 50%; border: 4px solid #fff;
    background: var(--card-accent) center / cover no-repeat; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 800;
    box-shadow: 0 6px 16px rgba(15,23,42,.16); transition: background-color .35s ease;
}
.ob-card-avatar.has-photo span { display: none; }
.ob-card-name { margin: 12px 0 2px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--black); overflow-wrap: anywhere; }
.ob-card-name.is-empty { color: #b8c2d1; }
.ob-card-role { font-size: 14px; font-weight: 600; color: #5b6778; overflow-wrap: anywhere; }
.ob-card-save {
    display: inline-block; margin: 16px 0 18px; padding: 10px 20px; border-radius: 11px;
    background: var(--card-accent); color: #fff; font-size: 14px; font-weight: 700; transition: background .35s ease;
}
.ob-card-fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ob-card-field { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #e6e9f0; border-radius: 12px; }
.ob-card-icon {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    color: var(--card-accent); background: color-mix(in srgb, var(--card-accent) 12%, transparent); transition: color .35s ease;
}
.ob-card-icon .ci { width: 18px; height: 18px; display: block; }
.ob-card-text { display: flex; flex-direction: column; min-width: 0; }
.ob-card-text small { font-size: 11px; color: #7b8798; }
.ob-card-text b { font-size: 14px; color: var(--black); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes ob-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.ob-card-field.ob-pop { animation: ob-pop .3s ease; }

/* Abschluss-Seite */
.ob-done-body { max-width: 480px; margin-top: 20px; }
.ob-share { display: flex; gap: 22px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 26px; }
.ob-qr { flex-shrink: 0; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; line-height: 0; }
.ob-qr img, .ob-qr canvas { display: block; }
.ob-share-side { min-width: 0; flex: 1; }
.ob-link { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ob-link-url { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-open { font-size: 14px; font-weight: 600; color: var(--blue); text-decoration: none; }
.ob-open:hover { text-decoration: underline; }
.ob-done-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.ob-done-actions .btn { padding: 13px 22px; border-radius: 12px; }
@keyframes ob-rise { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.ob-card-live { animation: ob-rise .6s cubic-bezier(.2, .8, .2, 1); }

@media (prefers-reduced-motion: reduce) {
    .ob-step.ob-in-fwd, .ob-step.ob-in-back, .ob-card-field.ob-pop, .ob-card-live { animation: none; }
}

/* Mobil: kompakte Visitenkarte oben, Fragen darunter */
@media (max-width: 900px) {
    .ob { grid-template-columns: minmax(0, 1fr); }
    .ob-stage { order: -1; position: static; height: auto; padding: 18px 16px 0; background: #eef1f6; }
    .ob-stage-note { display: none; }
    .ob-card { width: 100%; max-width: 360px; padding-bottom: 16px; border-radius: 20px; box-shadow: 0 16px 30px -14px rgba(15,23,42,.3); margin-bottom: -40px; position: relative; z-index: 1; }
    .ob-card-banner { height: 64px; }
    .ob-card-avatar { width: 68px; height: 68px; margin-top: -34px; font-size: 26px; }
    .ob-card-name { font-size: 18px; margin-top: 8px; }
    .ob-card-save, .ob-card-fields { display: none; }
    .ob-done .ob-card-save { display: inline-block; }
    .ob-flow { padding: 52px 16px 32px; }
    .ob-top { margin: 0 0 18px; justify-content: flex-end; }
    .ob-top .ob-logo { display: none; }
    .ob-progress { margin-bottom: 28px; }
    .ob-progress li:not(.is-current) .ob-progress-label { visibility: hidden; }
    .ob-progress li.is-current .ob-progress-label { white-space: nowrap; }
    .ob-swatches { gap: 8px; }
    .ob-swatch { width: 32px; height: 32px; }
    .ob-share { flex-direction: column; align-items: stretch; }
    .ob-qr { align-self: flex-start; }
}

/* Lead-Formular: Widget-Bereich */
.lf-widget { margin-top: 32px; scroll-margin-top: 20px; }
.lf-widget-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .lf-widget-grid { grid-template-columns: minmax(0, 1fr); } }
.lf-widget-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.lf-widget-steps { margin: 0 0 16px; padding-left: 20px; font-size: 14px; line-height: 1.55; color: #334155; }
.lf-widget-steps li { margin-bottom: 4px; }
.lf-code { position: relative; background: #0b1220; border-radius: 12px; padding: 16px 16px 56px; }
.lf-code pre {
    margin: 0; color: #e2e8f0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap; word-break: break-all;
}
.lf-code .btn { position: absolute; right: 12px; bottom: 12px; }
.lf-linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.lf-linkbtn:hover { text-decoration: underline; }
.lf-preview { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 16px; background: #f8fafc; }
.lf-preview iframe { display: block; width: 100%; height: 420px; border: 0; background: transparent; }
.lf-widget-off { margin: 0; }
.lf-widget-status { margin: -8px 0 12px; font-size: 13px; font-weight: 600; color: var(--success-fg); min-height: 0; }
.lf-widget-status:empty { display: none; }

/* ===========================================================================
 *  Übersicht (Dashboard)
 * ========================================================================= */
.dash-head h1 { font-size: 28px; }
.dash-head p { font-size: 15px; }

/* Einrichtung */
.dash-setup { padding: 20px 24px; }
.dash-setup-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.dash-setup-head h2 { margin: 0 0 2px; font-size: 17px; }
.dash-setup-head p { margin: 0; font-size: 13px; color: var(--muted); }
.dash-setup-bar { width: 200px; max-width: 40%; height: 6px; border-radius: 99px; background: #e5e9f0; overflow: hidden; flex-shrink: 0; }
.dash-setup-bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.dash-setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.dash-setup-list a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
    color: var(--black); text-decoration: none; font-size: 14px; font-weight: 600; transition: border-color .15s, background .15s;
}
.dash-setup-list a:hover { border-color: var(--blue); background: var(--info-bg); }
.dash-check { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; color: #fff; }
.dash-setup-list li.is-done a { color: var(--muted); font-weight: 500; pointer-events: none; border-style: dashed; }
.dash-setup-list li.is-done span:last-child { text-decoration: line-through; text-decoration-color: #cbd5e1; }
.dash-setup-list li.is-done .dash-check { background: var(--success-fg); border-color: var(--success-fg); }

/* Kennzahlen */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dash-kpi { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 18px 20px; text-decoration: none; color: var(--black); transition: border-color .15s; }
.dash-kpi:hover { border-color: #c7d2e3; }
.dash-kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.dash-kpi-trend { font-size: 12px; font-weight: 600; color: var(--muted); }
.dash-kpi-trend.is-up, .dash-kpi-trend.is-new { color: var(--success-fg); }
.dash-kpi-trend.is-down { color: var(--error-fg); }
.dash-kpi-note { margin: 8px 2px 18px; font-size: 12px; color: #94a3b8; }

.dash-row { display: grid; gap: 16px; align-items: start; }
.dash-row > .panel { margin-bottom: 16px; }
.dash-row-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Listen */
.dash-more { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.dash-more:hover { text-decoration: underline; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; color: var(--black); text-decoration: none; }
.dash-list a:hover { background: #f8fafc; }
.dash-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--info-bg); color: var(--blue); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dash-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-list-main strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list-main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list-side { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.dash-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-bars a { display: grid; grid-template-columns: minmax(0, 150px) 1fr 40px; align-items: center; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; color: var(--black); text-decoration: none; }
.dash-bars a:hover { background: #f8fafc; }
.dash-bar-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-track { height: 8px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.dash-bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.dash-bar-n { font-size: 13px; font-weight: 700; text-align: right; }
.dash-foot { margin: 12px 0 0; font-size: 12px; color: #94a3b8; }
.dash-empty { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.dash-empty a { color: var(--blue); }

@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-row, .dash-row-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .dash-kpi-value { font-size: 26px; }
    .dash-setup-head { flex-direction: column; align-items: flex-start; }
    .dash-setup-bar { width: 100%; max-width: none; }
}

/* Mehrfachauswahl-Leiste: × ganz rechts hebt die Auswahl auf */
.bulk-bar { padding-right: 8px; }
.bulk-close {
    width: 32px; height: 32px; flex-shrink: 0; margin-left: -4px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: transparent; color: rgba(255,255,255,.75); cursor: pointer;
    transition: background .15s, color .15s;
}
.bulk-close:hover { background: rgba(255,255,255,.14); color: #fff; }
.bulk-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
