/* ===== Grundwerte ===== */
:root {
    --ink: #17262c;
    --muted: #5b6b71;
    --paper: #eef1ef;
    --surface: #ffffff;
    --line: #d3dad8;
    --line-soft: #e6ebe9;
    --petrol: #0e5a66;
    --petrol-hover: #0b4a54;
    --petrol-tint: #e3eff0;
    --nav: #0b3a42;
    --nav-text: #cfe1e3;
    --note: #fff6c9;
    --note-line: #d9bd3c;
    --danger: #b3261e;
    --danger-tint: #fbeae8;
    --ok: #1e6b3a;
    --ok-tint: #e5f3ea;

    --st-open: #1f5faf;
    --st-progress: #a86a00;
    --st-waiting: #6a4bb0;
    --st-closed: #6b7a80;

    --radius: 6px;
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    font-variant-numeric: tabular-nums;
}

a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; line-height: 1.25; font-weight: 600; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h2.spaced { margin-top: 24px; }

:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }

/* ===== Grundlayout ===== */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--nav);
    color: var(--nav-text);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { color: #fff; font-size: 17px; font-weight: 600; padding: 0 10px; letter-spacing: 0.01em; display: flex; flex-direction: column; gap: 10px; }
.brand-img { display: block; background: #fff; border-radius: var(--radius); padding: 8px 10px; }
.brand-img img { display: block; max-width: 100%; max-height: 64px; margin: 0 auto; object-fit: contain; }
.brand:hover { text-decoration: none; }

.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-links a {
    color: var(--nav-text);
    padding: 8px 10px;
    border-radius: var(--radius);
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; color: #fff; }
.nav-links a.active { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 600; }

.nav-admin { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.nav-group { font-size: 12px; color: rgba(207, 225, 227, 0.65); padding: 0 10px 4px; }

.me {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.me-name { color: #fff; font-weight: 600; }
.me-role { font-size: 12px; color: rgba(207, 225, 227, 0.75); }
.me-links { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
.me-links a { color: var(--nav-text); }
.me-links a.active { color: #fff; }
.link.light { color: var(--nav-text); }
.link.light:hover { color: #fff; }

.content { padding: 28px 36px 60px; max-width: 1640px; width: 100%; }

/* ===== Seitenkopf, Pfad ===== */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.page-head p { margin: 4px 0 0; }

.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 10px; flex-wrap: wrap; }

.lead { max-width: 70ch; margin: -8px 0 18px; }

/* ===== Formularelemente ===== */
input, select, textarea {
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 7px 10px;
    width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: auto; accent-color: var(--petrol); }
input[type="date"], input[type="time"] { min-width: 0; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span, .field > legend { font-size: 12px; color: var(--muted); }
.field small, fieldset small { color: var(--muted); font-size: 12px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; }

fieldset.tools { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; gap: 6px; }
fieldset.tools legend { padding: 0 4px; }

.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }

.actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ===== Buttons ===== */
.btn {
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { border-color: #b4bfbc; text-decoration: none; }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--petrol-hover); }
.btn.danger { color: var(--danger); border-color: #e5b4b0; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.link {
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    color: var(--petrol);
    cursor: pointer;
    font-size: 13px;
}
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }

/* ===== Panels, Meldungen ===== */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.form-panel { margin-bottom: 20px; }

.alert { border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; }
.alert.error { background: var(--danger-tint); color: var(--danger); border: 1px solid #efc6c2; }
.alert.ok { background: var(--ok-tint); color: var(--ok); border: 1px solid #c2e2cd; }

.empty {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
}
.empty p { margin: 4px 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.warn-text { color: var(--st-progress); }
.error-text { color: var(--danger); }

/* ===== Filter & Listen ===== */
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filters .search { flex: 1 1 280px; }
.filters select { width: auto; min-width: 180px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; border-radius: 0; margin: 0 -18px -16px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.list td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover { background: #f6f8f7; }
table.list .num { text-align: right; white-space: nowrap; }
table.list .strong { font-weight: 600; }
table.list .nb-row td { color: var(--muted); }

.row-title { color: var(--ink); font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== Status ===== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-open { color: var(--st-open); }
.status-progress { color: var(--st-progress); }
.status-waiting { color: var(--st-waiting); }
.status-closed { color: var(--st-closed); }

.status-switch {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.seg {
    font: inherit;
    font-size: 13px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    padding: 7px 14px;
    cursor: pointer;
    color: var(--muted);
}
.seg:last-child { border-right: 0; }
.seg:hover { background: #f4f6f5; color: var(--ink); }
.seg.active { color: #fff; font-weight: 600; }
.seg-open.active { background: var(--st-open); }
.seg-progress.active { background: var(--st-progress); }
.seg-waiting.active { background: var(--st-waiting); }
.seg-closed.active { background: var(--st-closed); }

/* ===== Ticketansicht ===== */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.ticket-no { color: var(--muted); font-weight: 400; margin-right: 4px; }

.facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 10px 0 0; }
.facts div { display: flex; gap: 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }

.description {
    white-space: pre-wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
}

/* Der Verlauf: Kundenmails links, Antworten eingerückt rechts, Notizen als Notizzettel */
.thread { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
/* Feste Breite statt „so schmal wie der Text“: Kundenmails bündig links, eigene Antworten bündig rechts */
.msg { border-radius: var(--radius); padding: 14px 18px; width: calc(100% - 56px); box-sizing: border-box; }
.msg-in {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--st-open);
    align-self: flex-start;
}
.msg-out {
    background: var(--petrol-tint);
    border: 1px solid #c4dcdf;
    align-self: flex-end;
}
.msg-note {
    background: var(--note);
    border: 1px dashed var(--note-line);
    align-self: stretch;
    width: 100%;
}
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; font-size: 13px; }
.msg-who { font-weight: 600; }
.msg-kind { color: var(--muted); }
.msg-time { color: var(--muted); margin-left: auto; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg-body.quoted {
    margin-top: 8px;
    padding: 10px 0 0 14px;
    border-left: 3px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.quote-toggle { margin-top: 8px; font-size: 13px; }
.empty-thread { margin: 0 0 18px; }

.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font: inherit;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}
.chip span { color: var(--muted); font-size: 12px; }
a.chip:hover { border-color: var(--petrol); text-decoration: none; }
.chip-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
.chip-x:hover { color: var(--danger); }

.composer {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.composer.is-note { background: #fffbe6; border-color: var(--note-line); border-style: dashed; }
.composer-mode { display: inline-flex; gap: 4px; }
.composer-mode button {
    font: inherit;
    font-size: 13px;
    border: 1px solid transparent;
    background: none;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
}
.composer-mode button.active { border-color: var(--line); background: var(--paper); color: var(--ink); font-weight: 600; }
.composer-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.composer-foot select { width: auto; }
.note-hint { margin: 0; font-size: 13px; color: #7a6512; }

.file-pick { position: relative; display: inline-flex; cursor: pointer; }
.file-pick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick span {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 12px;
    background: var(--surface);
    font-size: 13px;
}
.file-pick:hover span { border-color: var(--petrol); }
.file-pick:focus-within span { outline: 2px solid var(--petrol); outline-offset: 2px; }

/* ===== Seitenspalte ===== */
.side .panel { padding: 14px 16px; }

.hours-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.big { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.mid { font-size: 20px; font-weight: 600; }

.split-bar { height: 6px; background: #d9dfdd; border-radius: 999px; overflow: hidden; margin: 4px 0 6px; }
.split-bar .billable { display: block; height: 100%; background: var(--petrol); }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c3ccc9; margin-right: 5px; }
.dot.billable { background: var(--petrol); }

.time-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin: 14px 0 4px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}
.time-form .wide { grid-column: 1 / -1; }
.time-form input { min-width: 0; }
.time-form .actions { margin-top: 2px; }
.duration { font-weight: 600; white-space: nowrap; margin-left: auto; }
.duration .muted { font-weight: 400; }

.entries { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.entry { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.entry:last-child { border-bottom: 0; }
.entry.nb .entry-h { color: var(--muted); }
.entry.editing { background: var(--petrol-tint); margin: 0 -16px; padding: 9px 16px; }
.entry-main { display: flex; justify-content: space-between; gap: 8px; }
.entry-h { font-weight: 600; }
.entry-sub { font-size: 13px; color: var(--muted); }
.entry-actions { display: flex; gap: 14px; margin-top: 3px; }

.subs, .files, .contacts { list-style: none; margin: 0 0 12px; padding: 0; }
.subs li, .files li, .contacts li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line-soft);
}
.subs li:last-child, .files li:last-child, .contacts li:last-child { border-bottom: 0; }
.subs-meta { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.files a { overflow-wrap: anywhere; }
.contacts li { flex-direction: column; gap: 0; align-items: flex-start; }

.inline-form { display: flex; gap: 8px; }

/* ===== Kunde ===== */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two-col .panel { margin-bottom: 16px; }

/* ===== Auswertung ===== */
.report-filter .presets { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.report-filter .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-summary {
    display: flex;
    align-items: flex-end;
    gap: 36px;
    flex-wrap: wrap;
    margin: 6px 0 20px;
}
.report-summary > div { display: flex; flex-direction: column; }


/* ===== AI-Assistent ===== */
.assistant { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.agent-list { display: flex; flex-direction: column; gap: 6px; }
.agent {
    font: inherit;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.agent span { font-size: 12px; color: var(--muted); }
.agent:hover { border-color: #b4bfbc; }
.agent.active { border-color: var(--petrol); box-shadow: inset 3px 0 0 var(--petrol); }
.agent-list .btn { margin-top: 6px; }

.ask { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.ask-head { display: flex; justify-content: space-between; align-items: baseline; }
.ask .actions { align-items: flex-start; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.examples .chip { color: var(--muted); }
.examples .chip:hover { color: var(--ink); border-color: var(--petrol); }

.answer { margin-top: 18px; }
.answer-question {
    font-weight: 600;
    padding: 0 0 8px 2px;
    color: var(--muted);
}
.answer-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--petrol);
    border-radius: var(--radius);
    padding: 14px 18px;
    overflow-x: auto;
}
.answer-body p { margin: 0 0 10px; max-width: 80ch; }
.answer-body table { border-collapse: collapse; margin: 8px 0 12px; }
.answer-body th, .answer-body td { border-bottom: 1px solid var(--line-soft); padding: 6px 14px 6px 0; text-align: left; }
.answer-body th { font-size: 12px; color: var(--muted); border-bottom-color: var(--line); }
.tool-log { margin-top: 10px; font-size: 13px; color: var(--muted); }
.tool-log summary { cursor: pointer; }
.tool-log ul { margin: 6px 0 0; padding-left: 18px; }
.tool-log code { font-size: 12px; margin-left: 6px; overflow-wrap: anywhere; }

/* ===== Editor ===== */
.editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.editor:focus-within { border-color: var(--petrol); box-shadow: 0 0 0 2px var(--petrol-tint); }
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--line-soft);
    background: #f8faf9;
    border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar button {
    font: inherit;
    font-size: 13px;
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: var(--ink);
    cursor: pointer;
}
.editor-toolbar button:hover { background: var(--surface); border-color: var(--line); }
.editor-toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.fs-s { font-size: 11px; }
.fs-m { font-size: 14px; }
.fs-l { font-size: 18px; font-weight: 600; }
.editor-area { min-height: 140px; max-height: 420px; overflow-y: auto; padding: 10px 12px; outline: none; line-height: 1.5; }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor-area ul, .editor-area ol, .msg-body.rich ul, .msg-body.rich ol { margin: 4px 0; padding-left: 22px; }
.editor-area p, .msg-body.rich p { margin: 0 0 8px; }
.composer.is-note .editor { border-color: var(--note-line); }
.composer.is-note .editor-toolbar { background: #fff8d6; }

.msg-body.rich { white-space: normal; }

.recipients { display: grid; gap: 6px; }
.recipients .field.inline > span { min-width: 26px; }

/* ===== Dateien ablegen ===== */
.dropzone {
    position: relative;
    border: 1px dashed #b4bfbc;
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    background: #fafbfa;
    transition: background-color 0.12s, border-color 0.12s;
}
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--petrol); color: var(--ink); }
.dropzone.over { border-color: var(--petrol); border-style: solid; background: var(--petrol-tint); color: var(--petrol); }
.dropzone.small { padding: 10px; }
.dropzone.mail-import { margin-bottom: 14px; background: var(--surface); }
.dropzone.mail-import.over { background: var(--petrol-tint); }

/* ===== Massenbearbeitung ===== */
.bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--petrol-tint);
    border: 1px solid #c4dcdf;
    border-radius: var(--radius);
    position: sticky;
    top: 0;
    z-index: 5;
}
.bulk-group { display: inline-flex; gap: 6px; align-items: center; }
.bulk-group select { width: auto; padding: 4px 8px; }
table.list .select-col { width: 36px; padding-right: 0; }
table.list .select-col input { width: 16px; height: 16px; cursor: pointer; }
table.list tr.selected td { background: #f0f7f7; }

/* ===== Ticket: Aktionen, Kunde zuordnen ===== */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.assign-panel { border-color: #e6cf8a; background: #fffbea; }
.assign-panel p { margin: 0 0 10px; }
.assign-panel p.muted { margin: 10px 0 0; }
.assign-options { display: flex; flex-direction: column; gap: 8px; }
.inline-form input.short { max-width: 180px; }
.inline-form select { width: auto; min-width: 220px; }

/* ===== Assistent & Auswertung ===== */
.tool-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.answer-files { margin: 10px 0 0; }
.file-chip { border-color: var(--petrol); color: var(--petrol); font-weight: 600; }
.file-chip span { font-weight: 400; }
.report-downloads { margin-left: auto; display: flex; gap: 8px; }
.report-summary .report-downloads .btn { margin-left: 0; }

/* ===== Aufwand-Ampel ===== */
:root {
    --ok: #1e7a45; --ok-bg: #e4f4ea; --ok-line: #9fd2b2;
    --warn: #8a5a00; --warn-bg: #fff3cf; --warn-line: #e8c55c;
    --over: #b3261e; --over-bg: #fbe7e5; --over-line: #eba7a1;
}
.budget {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.budget-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.budget-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.budget-over { color: var(--over); background: var(--over-bg); border-color: var(--over-line); }

.budget-box { border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; border: 1px solid; }
.budget-box.budget-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.budget-box.budget-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.budget-box.budget-over { background: var(--over-bg); border-color: var(--over-line); }
.budget-box .big { color: var(--ink); }
.budget-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.budget-pct { margin-left: auto; font-weight: 700; }
.budget-box.budget-ok .budget-pct { color: var(--ok); }
.budget-box.budget-warn .budget-pct { color: var(--warn); }
.budget-box.budget-over .budget-pct { color: var(--over); }
.budget-bar { height: 8px; background: rgba(255, 255, 255, 0.7); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.budget-bar span { display: block; height: 100%; border-radius: 999px; }
.budget-ok .budget-bar span { background: var(--ok); }
.budget-warn .budget-bar span { background: #d99a00; }
.budget-over .budget-bar span { background: var(--over); }
.budget-text { margin: 0; font-size: 13px; }
.budget-edit { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; }
.budget-edit input { width: 110px; }
.budget-config { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.budget-config .field { width: 160px; }
.budget-legend { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; }

/* ===== Reiter ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
    font: inherit;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 9px 16px;
    margin-bottom: -1px;
    color: var(--muted);
    cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--petrol); border-bottom-color: var(--petrol); font-weight: 600; }
.lead-small { margin: -4px 0 14px; }

/* ===== Zugänge ===== */
.accesses { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.access { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.accesses.compact { gap: 0; margin-bottom: 0; }
.accesses.compact .access { border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; padding: 9px 0; }
.accesses.compact .access:last-child { border-bottom: 0; }
.access-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.access-type { font-size: 11px; font-weight: 600; text-transform: none; padding: 1px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.access-type.type-teamviewer { background: #e3edfb; color: #1f5faf; }
.access-type.type-anydesk { background: #fbe7e5; color: #b3261e; }
.access-type.type-rdp { background: var(--petrol-tint); color: var(--petrol); }
.access-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 6px 0 0; font-size: 13px; }
.access-facts div { display: flex; gap: 6px; align-items: baseline; }
.access-facts dt { color: var(--muted); }
.access-facts dd { margin: 0; overflow-wrap: anywhere; }
.secret { display: inline-flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.secret code { background: var(--paper); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.access-notes { margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; }
.access-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.access-audit { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.check.small { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== Wissensdatenbank ===== */
.kb-head { display: flex; gap: 10px; margin-bottom: 14px; }
.kb-head .search { flex: 1; }
.kb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kb-item {
    font: inherit;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    color: var(--ink);
}
.kb-item:hover { border-color: var(--petrol); }
.kb-excerpt { font-size: 13px; color: var(--muted); }
.kb-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.tag { font-size: 12px; padding: 0 8px; border-radius: 999px; background: var(--petrol-tint); color: var(--petrol); }
.kb-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.kb-article h2 { font-size: 20px; margin: 10px 0 6px; }
.kb-article-head { display: flex; align-items: center; gap: 8px; }
.kb-tags { display: flex; gap: 6px; margin: 0 0 12px; }
.kb-body { max-width: 80ch; margin-bottom: 16px; }
.kb-body ul, .kb-body ol { padding-left: 22px; }
.kb-editor { margin-top: 12px; }
.kb-link { margin-left: 10px; font-size: 13px; }

/* ===== Dienstleister ===== */
.refs { list-style: none; margin: 0 0 10px; padding: 0; }
.refs li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.refs li:last-child { border-bottom: 0; }
.ref-partner { font-weight: 600; min-width: 80px; }
.refs .chip-x { margin-left: auto; }
.ref-form select { min-width: 0; flex: 0 1 140px; }
.ref-form input { flex: 1 1 100px; min-width: 0; }
.partner-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.url-cell { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; max-width: 320px; }
.partner-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

/* ===== Zeitstrahl ===== */
.timeline { padding: 12px 16px 10px; }
.timeline-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; }
.timeline-head h2 { margin: 0; }
.timeline-nav { display: flex; align-items: center; gap: 4px; }
.timeline-nav input, .timeline-user { width: auto; padding: 4px 8px; }
.timeline-nav .btn.small { padding: 3px 10px; }
.timeline-sum { font-size: 13px; color: var(--muted); }
.timeline-sum strong { color: var(--ink); }
.timeline-scroll { overflow-x: auto; padding: 0 16px; margin: 0 -16px; }
.timeline-track { position: relative; min-width: 640px; }
.tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-soft); }
.tick span {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}
.tl-block {
    position: absolute;
    height: 40px;
    margin-top: 2px;
    background: var(--petrol);
    color: #fff;
    border-radius: 5px;
    padding: 3px 7px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 12px;
    line-height: 1.25;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    min-width: 4px;
    z-index: 1;
}
.tl-block:hover { background: var(--petrol-hover); text-decoration: none; z-index: 2; }
.tl-block:focus-visible { outline-offset: 1px; }
/* Abrechenbar: Petrol. Nicht abrechenbar: helleres Stahlblau mit Schraffur – passt zur Farbwelt und ist auch ohne Farbsehen unterscheidbar */
.tl-block.nb {
    background-color: #5d8aa3;
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 6px, transparent 6px 12px);
}
.tl-block.nb:hover { background-color: #4f7a92; }
.tl-block-time { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.92; }
.gap {
    position: absolute;
    top: 2px;
    background: repeating-linear-gradient(135deg, #fff6d8 0 6px, #fdeab0 6px 12px);
    border: 1px dashed #e0b84a;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--warn);
    overflow: hidden;
}
.gap span { white-space: nowrap; padding: 0 4px; font-weight: 600; }
.now { position: absolute; top: 0; width: 2px; background: var(--over); z-index: 3; border-radius: 1px; }
.timeline-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.timeline-empty { margin: 4px 0 0; }

/* ===== Ansichten der Ticketliste ===== */
.view-tabs { margin-bottom: 12px; }
.tabs .count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--paper);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}
.tabs .active .count { background: var(--petrol-tint); color: var(--petrol); }
.tabs .count.attention { background: var(--warn-bg); color: var(--warn); }
.assignee { display: inline-flex; align-items: center; gap: 8px; }
.assignee select { width: auto; padding: 2px 6px; font-size: 13px; }

/* ===== Urlaub ===== */
:root {
    --lv-vacation: #2e8a6e;
    --lv-overtime: #1f5faf;
    --lv-special: #6a4bb0;
    --lv-other: #a86a00;
}
.leave-calendar-panel { padding: 14px 16px; }
.cal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; min-width: 150px; text-align: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); }
.sw.leave-vacation { background: var(--lv-vacation); border-color: var(--lv-vacation); }
.sw.leave-overtimeoff { background: var(--lv-overtime); border-color: var(--lv-overtime); }
.sw.leave-specialleave { background: var(--lv-special); border-color: var(--lv-special); }
.sw.leave-other { background: var(--lv-other); border-color: var(--lv-other); }
.sw.pending { background: repeating-linear-gradient(135deg, #8fb9ad 0 3px, #fff 3px 6px); }
.sw.holiday { background: #e6ebe9; }

.cal-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.leave-cal { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.leave-cal th, .leave-cal td { border-bottom: 1px solid var(--line-soft); }
.leave-cal thead th { font-weight: 400; color: var(--muted); padding: 4px 0 6px; text-align: center; min-width: 26px; }
.leave-cal thead th .dow, .leave-cal thead th .dom { display: block; line-height: 1.3; }
.leave-cal thead th .dom { font-weight: 600; color: var(--ink); }
.leave-cal thead th.today .dom { color: #fff; background: var(--petrol); border-radius: 999px; width: 22px; margin: 0 auto; }
.leave-cal .cal-name {
    text-align: left;
    padding: 6px 12px 6px 0;
    white-space: nowrap;
    font-weight: 600;
    color: var(--ink);
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 1;
    min-width: 150px;
}
.leave-cal tbody td { height: 30px; padding: 0; text-align: center; border-left: 1px solid #f0f3f2; }
.leave-cal td.free, .leave-cal th.free { background: #eef1ef; }
.leave-cal td.today { box-shadow: inset 1px 0 0 var(--petrol), inset -1px 0 0 var(--petrol); }
.leave-cal tr.me-row .cal-name { color: var(--petrol); }
.leave-cal td.leave { color: #fff; font-weight: 700; }
.leave-cal td.leave-vacation { background: var(--lv-vacation); }
.leave-cal td.leave-overtimeoff { background: var(--lv-overtime); }
.leave-cal td.leave-specialleave { background: var(--lv-special); }
.leave-cal td.leave-other { background: var(--lv-other); }
.leave-cal td.leave.pending {
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0 4px, transparent 4px 8px);
}
.cal-holidays { margin: 10px 0 0; }

.leave-balance { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 36px; margin: 0 0 18px; }
.leave-balance > div { display: flex; flex-direction: column; }
.year-switch { flex-direction: row !important; align-items: center; gap: 8px; margin-left: auto; }

.leave-form .field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.leave-preview { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; font-size: 13px; }

.leave-list { list-style: none; margin: 0; padding: 0; }
.leave-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 3px; }
.leave-item:last-child { border-bottom: 0; }
.leave-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.leave-status { font-size: 12px; font-weight: 600; padding: 0 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.status-pending .leave-status { background: var(--warn-bg); color: var(--warn); }
.status-approved .leave-status { background: var(--ok-bg); color: var(--ok); }
.status-rejected .leave-status { background: var(--over-bg); color: var(--over); }
.status-cancelled { opacity: 0.65; }
.leave-item .link { align-self: flex-start; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.approval-actions input { flex: 1 1 220px; width: auto; }

/* ===== Stempeluhr (Seitenleiste) ===== */
.clock {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
}
.clock + .me { margin-top: 0; }
.clock.in { background: rgba(46, 138, 110, 0.22); border-color: rgba(120, 210, 170, 0.45); }
.clock-status { color: #fff; display: flex; align-items: center; gap: 6px; }
.clock-dot { width: 8px; height: 8px; border-radius: 50%; background: #6fe0b0; box-shadow: 0 0 0 3px rgba(111, 224, 176, 0.25); }
.clock-today { color: var(--nav-text); font-size: 12px; }
.clock-actions { display: flex; gap: 6px; margin-top: 4px; }
.clock-actions .btn { flex: 1; }
.clock-actions .btn:not(.primary) { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.clock-actions .btn:not(.primary):hover { background: rgba(255, 255, 255, 0.18); }
.clock-link { color: #ffd98a; font-size: 12px; }
.clock-error { color: #ffb4ab; font-size: 12px; }

/* ===== Arbeitszeit ===== */
.wt-user { width: auto; }
.wt-summary { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 36px; margin: 0 0 18px; }
.wt-summary > div { display: flex; flex-direction: column; }
.neg { color: var(--over) !important; }
.pos { color: var(--ok) !important; }
.wt-panel { padding: 14px 16px; }
.wt-panel .table-wrap { border: 0; margin: 0 -16px -14px; border-radius: 0; }
.wt-table td { padding-top: 7px; padding-bottom: 7px; }
.wt-table tr.free-row td { background: #f3f5f4; color: var(--muted); }
.wt-table tr.today-row td { box-shadow: inset 0 1px 0 var(--petrol), inset 0 -1px 0 var(--petrol); }
.wt-table tr.today-row td:first-child { font-weight: 700; color: var(--petrol); }
.wt-warning { display: inline-block; font-size: 12px; color: var(--over); background: var(--over-bg); border-radius: 999px; padding: 0 8px; margin: 1px 4px 1px 0; }
.wt-editor-row td { background: #f8faf9; padding: 0; }
.wt-editor { padding: 14px 18px 16px; border-left: 3px solid var(--petrol); }
.wt-editor h3 { font-size: 14px; margin: 0 0 10px; }
.wt-session { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.wt-session:last-child { border-bottom: 0; }
.wt-session input[type="time"] { width: 110px; }
.wt-session .wt-note { flex: 1 1 200px; width: auto; }
.wt-new { padding-top: 10px; }
.wt-new > span:first-child { font-weight: 600; }

/* ===== Zwei-Faktor ===== */
.alert.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.twofactor p { margin: 0 0 10px; }
.tf-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.tf-steps li { padding-left: 4px; }
.tf-qr { display: block; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: #fff; }
.tf-confirm { margin-top: 8px; flex-wrap: wrap; align-items: center; }
.code-input { max-width: 160px; font-size: 18px; letter-spacing: 0.15em; text-align: center; font-variant-numeric: tabular-nums; }
.recovery-codes { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 28px; }
.recovery-codes code { font-size: 15px; background: var(--paper); padding: 3px 8px; border-radius: 4px; }
.tf-active { display: flex; align-items: center; gap: 8px; }
.status-dot-ok { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.hidden-check { display: none; }
.login-card .code-input { max-width: none; }

/* ===== Logo & Signatur ===== */
.brand-logo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.brand-logo img { max-height: 90px; max-width: 220px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: #fff; }
.brand-logo-actions { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; }
.sub-h { font-size: 14px; margin: 18px 0 4px; }
.inline-drop { padding: 6px 12px; }
.signature-preview { border-top: 1px dashed var(--line); padding-top: 8px; color: var(--muted); font-size: 13px; }
.signature-preview img, .msg-body.rich img, .print-body img { max-width: 260px; height: auto; }
.small-check { font-size: 13px; color: var(--muted); }
.login-logo { display: block; max-width: 180px; max-height: 90px; margin: 0 auto 14px; object-fit: contain; }

/* ===== Ticketliste: Sortierung, Untertickets ===== */
.sort-btn { font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.sort-btn:hover, .sort-btn.active { color: var(--ink); }
.sort-ind { font-size: 9px; color: var(--petrol); }
table.list tr.sub-row td { background: #f5f9f9; }
table.list tr.sub-row td.title-cell { padding-left: calc(14px + var(--depth, 0) * 22px); }
table.list tr.sub-row td:nth-child(2) { box-shadow: inset 3px 0 0 var(--petrol); }
.sub-arrow { color: var(--petrol); font-weight: 700; margin-right: 4px; }
.sub-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--petrol); background: var(--petrol-tint); border-radius: 999px; padding: 0 7px; margin-right: 4px; }
.sub-count { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
table.list tr.parent-row .row-title { font-weight: 700; }

/* ===== Ticket: Verlauf, Antworten, Zusammenführen, Anwesenheit ===== */
.thread-tools { display: flex; gap: 14px; align-items: baseline; margin-bottom: 8px; }
.msg-toggle { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0 4px 0 0; }
.msg.collapsed { padding-top: 10px; padding-bottom: 10px; }
.msg.collapsed .msg-head { margin-bottom: 2px; }
.msg-preview { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-ref { display: inline-block; font-size: 12px; margin: 0 0 6px; }
.msg-actions { display: flex; gap: 16px; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, 0.06); font-size: 13px; }
.msg-actions .link { font-size: 13px; }
.reply-ref { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--petrol-tint); color: var(--petrol); border-radius: var(--radius); padding: 6px 10px; }
.reply-ref .chip-x { margin-left: auto; }
.merge-panel { border-color: var(--petrol); }
.merge-panel .search { width: 100%; margin: 6px 0 8px; }
.merge-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.merge-pick { font: inherit; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.merge-pick:hover { border-color: #b4bfbc; }
.merge-pick.active { border-color: var(--petrol); background: var(--petrol-tint); }
.presence { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 8px 12px; border-radius: var(--radius); background: #eef4fb; color: #1f5faf; border: 1px solid #c9dcf1; margin-bottom: 10px; }
.presence.updated { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: #1f5faf; box-shadow: 0 0 0 3px rgba(31, 95, 175, 0.2); }
.head-actions a.btn:hover { text-decoration: none; }

/* ===== Kundeninformationen ===== */
.ci-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ci-logo { width: 140px; height: 80px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.ci-logo img { max-width: 130px; max-height: 70px; object-fit: contain; }
.ci-head .dropzone { flex: 1 1 260px; }
.customer-info .panel h2.spaced:first-of-type { margin-top: 20px; }
.add-contact { margin-top: 12px; flex-wrap: wrap; }
.add-contact input { flex: 1 1 160px; }

/* ===== Zeitstrahl: Termine, Markieren, Buchen ===== */
.timeline-track { user-select: none; cursor: crosshair; }
.tl-event {
    position: absolute;
    top: 2px;
    height: 26px;
    font: inherit;
    font-size: 11px;
    text-align: left;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid #9fb8e0;
    background: #e8f0fb;
    color: #1f4f8f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    z-index: 2;
}
.tl-event:hover { background: #d8e6f8; }
.tl-event.free { opacity: 0.6; border-style: dashed; }
.tl-selection { position: absolute; top: 0; bottom: 22px; background: rgba(14, 90, 102, 0.18); border: 1px solid var(--petrol); border-radius: 4px; z-index: 4; pointer-events: none; }
.tl-allday { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tl-hint { margin: 6px 0 0; }
.booking { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--petrol); border-radius: var(--radius); background: #f8fbfb; }
.booking-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.booking-head h3 { margin: 0; font-size: 15px; }
.booking-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 12px; }
.booking-grid .field { width: 120px; }
.booking-mode { display: flex; gap: 16px; flex-wrap: wrap; padding-bottom: 8px; }
.booking .search { width: 100%; margin-bottom: 8px; }
.booking .form-grid { margin-top: 10px; }

/* ===== Druckansicht ===== */
.print-shell { max-width: 900px; margin: 0 auto; padding: 24px; background: #fff; min-height: 100vh; }
.print-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 14px; background: var(--paper); border-radius: var(--radius); margin-bottom: 6px; }
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--petrol); padding-bottom: 12px; margin: 18px 0 14px; }
.print-head h1 { font-size: 22px; }
.print-title { font-size: 16px; margin: 4px 0 0; }
.print-logo { max-height: 70px; max-width: 200px; object-fit: contain; }
.print-facts { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.print-facts th { text-align: left; color: var(--muted); font-weight: 400; padding: 3px 10px 3px 0; width: 120px; }
.print-facts td { padding: 3px 18px 3px 0; }
.print-doc h2 { font-size: 15px; margin: 18px 0 8px; }
.print-msg { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; break-inside: avoid; }
.print-msg.note { background: #fffbe6; border-style: dashed; }
.print-msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }
.print-msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.print-body { white-space: pre-wrap; font-size: 13px; line-height: 1.5; }
.print-body.rich { white-space: normal; }
.print-times { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-times th, .print-times td { border-bottom: 1px solid var(--line-soft); padding: 4px 6px; text-align: left; }
.print-times .num { text-align: right; }
.print-times .sum td { font-weight: 700; border-top: 1px solid var(--ink); }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .print-shell { padding: 0; max-width: none; }
    .print-msg { border-color: #ccc; }
    a { color: inherit; text-decoration: none; }
}

/* ===== Legende Zeitstrahl ===== */
.tl-legend { display: inline-flex; gap: 12px; font-size: 12px; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tl-sw-billable { background: var(--petrol); border-color: var(--petrol); }
.tl-sw-nb { background-color: #5d8aa3; border-color: #5d8aa3; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 3px, transparent 3px 6px); }
.booking-status { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }

/* ===== Kundenlogo klein vor dem Namen ===== */
.cust { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.cust-logo { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--line-soft); padding: 1px; flex: none; }
.cust-logo.big { width: 36px; height: 36px; padding: 2px; }
.cust-h1 { display: flex; align-items: center; gap: 10px; }

/* ===== Mehrfachauswahl ===== */
.ms { position: relative; }
.ms-btn {
    font: inherit;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    max-width: 280px;
}
.ms-btn strong { overflow: hidden; text-overflow: ellipsis; }
.ms-btn.active { border-color: var(--petrol); background: var(--petrol-tint); }
.ms-caret { color: var(--muted); font-size: 10px; margin-left: 2px; }
.ms-backdrop { position: fixed; inset: 0; z-index: 20; }
.ms-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 21;
    width: 280px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(23, 38, 44, 0.14);
    padding: 8px;
}
.ms-search { width: 100%; margin-bottom: 6px; padding: 5px 8px; }
.ms-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.ms-opt:hover { background: var(--paper); }
.ms-opt input { width: auto; }
.ms-empty { padding: 6px 4px; }
.ms-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 6px; }

/* ===== Übernommene Nachricht, Markierung ===== */
.msg-moved { font-size: 12px; color: var(--petrol); margin: -2px 0 4px; }
.sel-ticket-btn {
    position: absolute;
    z-index: 50;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    border: 0;
    background: var(--petrol);
    color: #fff;
    box-shadow: 0 6px 18px rgba(23, 38, 44, 0.25);
    cursor: pointer;
}
.sel-ticket-btn:hover { background: var(--petrol-hover); }

/* ===== Anmeldung ===== */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--nav);
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: 10px;
    padding: 30px 30px 24px;
}
.login-card h1 { font-size: 24px; margin-bottom: 18px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-intro { margin: -6px 0 18px; color: var(--muted); }
.login-foot { font-size: 12px; margin: 16px 0 0; }
.login-card .alert { margin: 0; }
.btn.block { width: 100%; padding: 9px 14px; }

/* ===== Konto, Benutzer, Einstellungen ===== */
.panel.narrow { max-width: 520px; }
.form-grid.single { grid-template-columns: 1fr; }
.field-check { align-self: end; padding-bottom: 8px; white-space: normal; }
table.list .inactive-row td { color: var(--muted); }

.settings { max-width: 900px; }
.settings-head { margin-bottom: 14px; }
.settings-head h2 { margin-bottom: 2px; }
.settings-head p { margin: 0; }
.settings .form-grid + .server-rows,
.settings .server-rows + p { margin-top: 16px; }

.provider-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.provider {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px 12px 40px;
    cursor: pointer;
}
.provider input { position: absolute; left: 14px; top: 15px; width: auto; accent-color: var(--petrol); }
.provider span { font-size: 13px; color: var(--muted); }
.provider:hover { border-color: #b4bfbc; }
.provider.active { border-color: var(--petrol); background: var(--petrol-tint); }
.settings .form-grid + .actions { margin-top: 12px; }

.server-rows { display: flex; flex-direction: column; gap: 10px; }
.server-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 100px auto;
    gap: 10px;
    align-items: end;
}
.server-label { font-weight: 600; padding-bottom: 8px; }

.test-mail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    max-width: 560px;
}
.poll-status { margin-top: 14px; font-size: 13px; }
.settings > .alert { margin-top: 14px; }

.hint { margin-top: 16px; font-size: 13px; color: var(--muted); }
.hint summary { cursor: pointer; color: var(--ink); }
.hint p { max-width: 75ch; }

/* ===== Blazor-Verbindungsanzeige ===== */
#blazor-error-ui { display: none; }

/* ===== Kleinere Bildschirme ===== */
@media (max-width: 1100px) {
    .ticket-grid { grid-template-columns: 1fr; }
    .report-filter .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; }
    .nav-links { flex-direction: row; flex-wrap: wrap; }
    .content { padding: 18px 16px 48px; }
    .form-grid, .two-col, .assistant, .report-filter .form-grid { grid-template-columns: 1fr; }
    .server-row { grid-template-columns: 1fr 90px; }
    .provider-switch { grid-template-columns: 1fr; }
    .inline-form { flex-wrap: wrap; }
    .inline-form select, .inline-form input.short { min-width: 0; max-width: none; flex: 1 1 100%; }
    .report-downloads { margin-left: 0; }
    .server-label { grid-column: 1 / -1; padding-bottom: 0; }
    .server-row .btn { grid-column: 1 / -1; justify-self: start; }
    .me { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-top: 0; padding: 0; }
    .me-links { margin-top: 0; }
    .msg { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
