/* ============================================================
   LEGAL SMART CRM – Design System
   ------------------------------------------------------------
   Die Formular- und Bedien-Ebene ist an das Schwesterprojekt
   /legalsmart/leads (assets/css/style.css) angelehnt:
   Gruenton #72c02c, 1.5px-Rahmen, 3px-Fokusring, Verlaufs-
   Primaerbutton, Radien 10/14/18px, weiche Schatten.
   Dokumentation: includes/md/FORMULARE.md
   ============================================================ */

/* ── Design-Tokens ─────────────────────────────────────────── */
:root {
    /* Marke */
    --ls-green: #72c02c;
    --ls-green-dark: #5a9a22;
    --ls-green-bg: #e8f5d9;
    --ls-dark: #2d374b;

    /* Flaechen */
    --bg-page: #f4f5f7;
    --bg-card: #ffffff;
    --bg-subtle: #f7f8fa;

    /* Linien & Text */
    --border: #e2e4e9;
    --border-strong: #d3d7de;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --danger: #c62f24;

    /* Verlaeufe, Schatten, Fokus */
    --grad-primary: linear-gradient(135deg, #72c02c 0%, #5a9a22 100%);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .07), 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-green: 0 4px 14px rgba(114, 192, 44, .28);
    --ring: 0 0 0 3px rgba(114, 192, 44, .16);
    --ring-danger: 0 0 0 3px rgba(198, 47, 36, .14);

    /* Radien – --radius bleibt erhalten, es wird in Inline-Styles referenziert */
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Motion */
    --ease: cubic-bezier(.25, .1, .25, 1);
    --dur: .18s;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg-page);
    color: var(--ls-dark);
}

/* ── Kopfzeile ─────────────────────────────────────────────── */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ls-dark);
    padding: 14px 24px;
}

.topnav-brand { color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; }
.topnav-brand span { color: var(--ls-green); }

.topnav nav a {
    color: #cbd2dc;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}
.topnav nav a:hover, .topnav nav a.active { color: #fff; }

.topnav-left { display: flex; align-items: center; gap: 20px; }
.topnav-user { display: flex; align-items: center; gap: 12px; color: #cbd2dc; font-size: 13px; }
.topnav-user a { color: #cbd2dc; text-decoration: none; }
.topnav-user a:hover { color: #fff; }

/* Schnellsuche in der Kopfzeile. Bewusst ohne Vorschlagsliste: eine Trefferliste,
   die beim Tippen aufklappt, verdeckt die Navigation und braucht JavaScript –
   die Eingabetaste fuehrt direkt auf die vollstaendige Suchseite. */
.topnav-search input {
    width: 190px;
    padding: 6px 12px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1.5px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    transition: border-color .15s, background .15s, width .15s;
}
.topnav-search input::placeholder { color: #8f98a6; }
.topnav-search input:focus {
    width: 240px;
    outline: none;
    background: rgba(255, 255, 255, .14);
    border-color: var(--ls-green);
    box-shadow: var(--ring);
}

/* Zweite Navigationsebene: die Seiten des aktiven Arbeitsbereichs. */
.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.subnav a {
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--ls-dark); }
.subnav a.active {
    color: var(--ls-dark);
    font-weight: 600;
    border-bottom-color: var(--ls-green);
}

/* Aufklappbarer Kartenblock. Fuer Dinge, die man selten braucht und die die
   wichtigen Inhalte sonst nach unten draengen wuerden (z.B. die Spaltenauswahl
   auf der Lead-Liste). */
.ausklapp > summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    list-style: none;
}
.ausklapp > summary::-webkit-details-marker { display: none; }
.ausklapp > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 8px;
    color: var(--ls-green);
    transition: transform .15s;
}
.ausklapp[open] > summary::before { transform: rotate(90deg); }
.ausklapp > summary:hover { color: var(--ls-dark); }
.ausklapp > summary:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 6px;
}

/* Das HTML-Attribut hidden muss gewinnen. Ohne diese Regel uebersteuert das
   display:inline-flex der Buttons es, und ausgeblendete Schaltflaechen bleiben
   sichtbar – etwa der Fallback-Knopf neben den Schaltern. */
[hidden] { display: none !important; }

/* Fuer Beschriftungen, die Screenreader brauchen und Sehende nicht. */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Seitenraster & Typografie ─────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 24px; }

h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
.subtitle { color: var(--text-secondary); font-size: 13px; margin: 0 0 20px; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.page-head .subtitle { margin-bottom: 0; }

/* ── Karten ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    margin-bottom: 20px;
}

/* Formularkarten bleiben schmal genug fuer angenehme Zeilenlaengen. */
.card--form { max-width: 640px; }
.card--flush { padding: 0; }

.card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ls-dark);
    margin: 0 0 16px;
}
.card-title--sep {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ── Kanban ────────────────────────────────────────────────── */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { flex: 0 0 220px; }
.kanban-col h3 { font-size: 13px; color: var(--text-secondary); margin: 0 0 8px; font-weight: 600; }
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--ls-dark);
    display: block;
    font-size: 13px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.kanban-card:hover { border-color: var(--ls-green); box-shadow: var(--shadow-sm); }
.kanban-card .firma { font-weight: 600; margin-bottom: 4px; }
.kanban-card .meta { color: var(--text-muted); font-size: 12px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    background: #eef0f3;
    color: var(--text-secondary);
}
.badge.green { background: var(--ls-green-bg); color: #3b6d11; }
.badge.blue { background: #e6f1fb; color: #185fa5; }
.badge.orange { background: #fdf3d8; color: #8a6d1a; }
.badge.red { background: #fdecea; color: #a12a20; }

/* ── Filterleiste ──────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-bar__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.filter-chip:hover { border-color: #bcc2cc; color: var(--ls-dark); }
.filter-chip.is-active {
    background: var(--ls-green-bg);
    border-color: var(--ls-green);
    color: var(--ls-green-dark);
}

/* ── Tabellen ──────────────────────────────────────────────── */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list a { color: var(--ls-dark); text-decoration: none; font-weight: 600; }
table.list a:hover { color: var(--ls-green); }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline-item { display: flex; gap: 12px; }
.timeline-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: #eef0f3; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px; color: var(--text-secondary);
}
.timeline-icon.accent { background: #e6f1fb; color: #185fa5; }
.timeline-icon.pro { background: var(--ls-green-bg); color: #3b6d11; }
.timeline-line { width: 1px; flex: 1; background: var(--border); margin: 4px 0; }
.timeline-content { padding-bottom: 18px; flex: 1; min-width: 0; }
.timeline-content p { margin: 0; font-size: 14px; }
.timeline-content .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.timeline-source {
    display: inline-block; margin-top: 6px; background: var(--bg-page);
    border-radius: var(--radius); padding: 3px 9px; font-size: 11px; color: var(--text-secondary);
}
.timeline-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.timeline-actions a { font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.timeline-actions a:hover { color: var(--ls-green); text-decoration: underline; }

/* ============================================================
   FORMULARE
   ============================================================ */

/* Feldbasis – gilt sowohl fuer .form-control als auch fuer nicht
   klassifizierte Felder, damit kein Formular aus dem Raster faellt. */
.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select,
textarea {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ls-dark);
    background-color: #fff;
    padding: 10px 13px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-control:hover,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):hover,
select:hover,
textarea:hover { border-color: #bcc2cc; }

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--ls-green);
    box-shadow: var(--ring);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder { color: var(--text-muted); }

.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Eigener Chevron, da appearance:none den nativen Pfeil entfernt. */
select,
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

textarea, textarea.form-control {
    resize: vertical;
    min-height: 96px;
    line-height: 1.6;
}

/* Feldgruppen */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.form-label,
.form-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ls-dark);
    margin-bottom: 6px;
}
.form-label__req { color: var(--danger); font-weight: 700; }

.form-control { width: 100%; }
.form-group > input,
.form-group > select,
.form-group > textarea { width: 100%; }

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0;
    line-height: 1.5;
}

/* Zweispaltiges Raster fuer zusammengehoerende Felder */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
}
.form-group--full { grid-column: 1 / -1; }

/* Abschnitte innerhalb eines Formulars */
.form-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.form-section__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin: 0 0 14px;
}

/* Aktionsleiste am Formularende */
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.form-actions--plain { margin-top: 18px; padding-top: 0; border-top: none; }
.form-actions__link { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.form-actions__link:hover { color: var(--ls-dark); text-decoration: underline; }

/* Checkboxen */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.form-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--ls-green);
    cursor: pointer;
}

/* Kompakte Formularzeile (Toolbar in Karten, Aktionen in Tabellen).
   Felder behalten hier ihre natuerliche Breite; .form-control--grow
   fuellt den Rest der Zeile. */
form.inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}
form.inline + form.inline { margin-top: 10px; }
form.inline .form-control { width: auto; }
form.inline .form-control--grow { flex: 1 1 220px; min-width: 0; }
form.inline .form-inline-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Kompakte Feldgroesse fuer Tabellenzellen */
.form-control--sm {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: var(--radius);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    padding: 10px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--ls-dark);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
                border-color var(--dur) var(--ease), background-color var(--dur) var(--ease),
                opacity var(--dur) var(--ease);
}
.btn:hover,
button:hover { border-color: #bcc2cc; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active,
button:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn:focus-visible,
button:focus-visible { outline: none; border-color: var(--ls-green); box-shadow: var(--ring); }

.btn-primary,
button.primary {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-green);
}
.btn-primary:hover,
button.primary:hover { border-color: transparent; opacity: .92; box-shadow: var(--shadow-green); }

.btn-danger {
    background: #fff;
    border-color: #f0c4c0;
    color: var(--danger);
}
.btn-danger:hover { border-color: var(--danger); background: #fdf4f3; }
.btn-danger:focus-visible { border-color: var(--danger); box-shadow: var(--ring-danger); }

.btn-sm { font-size: 13px; padding: 6px 12px; border-radius: var(--radius); }
.btn-block { width: 100%; }

.btn:disabled,
button:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Hinweisboxen ──────────────────────────────────────────── */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 16px;
}
.alert-error { background: #fdecea; border-color: #f3c7c2; color: #a12a20; }
.alert-success { background: var(--ls-green-bg); border-color: #bcdf95; color: #3b6d11; }

/* ── Auth-Seiten (Login, Passwort vergessen, Passwort setzen) ─ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
}
.auth-brand { text-align: center; margin-bottom: 24px; font-weight: 700; color: var(--ls-dark); font-size: 17px; }
.auth-brand span { color: var(--ls-green); }
.auth-card h1 { font-size: 19px; margin: 0 0 6px; }
.auth-card .subtitle { margin-bottom: 22px; }
.auth-footer-link { text-align: center; margin: 18px 0 0; font-size: 13px; }
.auth-footer-link a { color: var(--ls-green); text-decoration: none; font-weight: 600; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ============================================================
   STARTSEITE / KENNZAHLEN
   ============================================================ */

.hero {
    background: var(--grad-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-green);
    padding: 26px 30px;
    margin-bottom: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.hero__greeting { font-size: 14px; opacity: .82; margin: 0; }
.hero__title { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 0; }
.hero__meta { font-size: 14px; opacity: .92; margin: 10px 0 0; }
.hero__actions { display: flex; gap: 10px; flex-shrink: 0; }
.hero .btn { background: #fff; border-color: transparent; color: var(--ls-green-dark); box-shadow: none; }
.hero .btn:hover { border-color: transparent; opacity: .92; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow var(--dur) var(--ease);
}
.stat-tile:hover { box-shadow: var(--shadow-md); }

/* Kacheln, die auf einen Abschnitt derselben Seite springen (Funnel-Stufen).
   Sie sollen wie eine Kachel aussehen, nicht wie ein Link – aber beim Ueberfahren
   und beim Tabben erkennbar reagieren. */
a.stat-tile { text-decoration: none; color: inherit; }
a.stat-tile:hover { border-color: var(--ls-green); }
a.stat-tile:focus-visible { outline: none; border-color: var(--ls-green); box-shadow: var(--ring); }
.stat-tile__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.stat-tile__value { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat-tile__sub { font-size: 12px; color: var(--text-secondary); }
.stat-tile--accent .stat-tile__value { color: var(--ls-green); }
.stat-tile--warn .stat-tile__value { color: var(--danger); }

/* Zwei Spalten für „Meine Aufgaben" neben „Aktivität" */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* Waagerechtes Balkendiagramm (Aktivitätsverlauf, Verteilungen) */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.bar-row__label { min-width: 150px; flex-shrink: 0; color: var(--text-secondary); }
/* display:block ist noetig – als inline-<span> wuerde die Hoehe des Balkens ignoriert. */
.bar-row__track { display: block; flex: 1; height: 8px; background: var(--bg-page); border-radius: 999px; overflow: hidden; }
.bar-row__fill { display: block; height: 100%; background: var(--grad-primary); border-radius: 999px; }
.bar-row__value { min-width: 34px; text-align: right; font-weight: 600; }

/* Leerzustand in Karten */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-secondary); }
.empty-state__icon { font-size: 30px; opacity: .35; margin-bottom: 10px; }
.empty-state__title { font-size: 15px; font-weight: 600; color: var(--ls-dark); margin: 0 0 6px; }
.empty-state__text { font-size: 13px; margin: 0; }

/* ============================================================
   MODAL (natives <dialog>)
   ============================================================ */

dialog.modal {
    border: none;
    padding: 0;
    width: calc(100% - 32px);
    max-width: 560px;
    background: var(--bg-card);
    color: var(--ls-dark);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog.modal::backdrop { background: rgba(20, 25, 35, .5); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.modal-body { padding: 22px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

/* Schließen-Kreuz: setzt die Button-Grundform bewusst zurück. */
.modal-close {
    width: 34px;
    height: 34px;
    padding: 0;
    flex-shrink: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 17px;
}
.modal-close:hover {
    border-color: transparent;
    background: rgba(0, 0, 0, .05);
    box-shadow: none;
    transform: none;
    color: var(--ls-dark);
}

/* ============================================================
   SCHALTER (Toggle)
   ============================================================ */

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    margin: 0;
}
.switch__track {
    position: relative;
    width: 44px; height: 26px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--border-strong);
    transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.switch__track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--danger); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }
.switch__label { font-size: 14px; font-weight: 600; }
/* Zustimmender Schalter: "an" bedeutet erlaubt und muss gruen wirken – im Gegensatz
   zur Kontaktsperre, deren "an" eine Sperre ist und rot bleibt. */
.switch--ok input:checked + .switch__track { background: var(--ls-green); }

/* Warnbanner für gesperrte Kontakte */
.lock-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--radius-lg);
    background: #fdecea;
    border: 1px solid #f3c7c2;
    color: #a12a20;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ── Responsiv ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* Ohne Umbruch kollidieren Navigation und Nutzerblock und schieben die
       Seite horizontal aus dem Viewport. */
    .topnav { flex-wrap: wrap; gap: 10px 16px; padding: 12px 14px; }
    .topnav-left { flex-wrap: wrap; gap: 8px 16px; }
    .topnav nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
    .topnav nav a { margin-left: 0; }
    .topnav-user { width: 100%; justify-content: space-between; }
    /* Das Suchfeld nimmt auf schmalen Geraeten die volle Zeile, sonst draengt es
       Namen und Abmelden-Link aus dem sichtbaren Bereich. */
    .topnav-search { order: -1; width: 100%; }
    .topnav-search input,
    .topnav-search input:focus { width: 100%; }
    .subnav { padding: 0 14px; gap: 0 2px; }
    .subnav a { padding: 10px 10px; }

    .page { padding: 18px 14px 32px; }
    .form-grid { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: stretch; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; }
    .auth-card { padding: 28px 20px; }

    .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
    .hero__actions { width: 100%; }
    .hero .btn { width: 100%; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-tile { padding: 14px 16px; }
    .stat-tile__value { font-size: 24px; }
    .dash-grid { grid-template-columns: 1fr; }
    .bar-row__label { min-width: 90px; }
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; }
}

@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
}
