/* WatzTicket – Oberfläche
   Schlank, ohne Framework. Farben als Variablen, mobile Darstellung ab 860px abwärts. */

:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --border: #e1e5eb;
    --border-strong: #cfd5de;
    --text: #18212c;
    --muted: #5f6b7a;
    --faint: #8a95a3;
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-soft: #e8f0fe;
    --topbar: #102236;
    --topbar-text: #c9d4e1;
    --danger: #c62828;
    --danger-soft: #fdecec;
    --success: #1b7f3b;
    --success-soft: #e7f5ec;
    --warning: #9a5b00;
    --warning-soft: #fff4dd;
    --info-soft: #e8f2fd;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(16, 34, 54, .06), 0 1px 3px rgba(16, 34, 54, .05);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; font-weight: 650; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .9em; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--topbar); color: var(--topbar-text); position: sticky; top: 0; z-index: 20; }
.topbar-inner {
    max-width: 1440px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 18px; min-height: 56px;
}
.brand { color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: .2px; white-space: nowrap; }
.brand span { color: #6cb2ff; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav > a, .nav summary {
    color: var(--topbar-text); padding: 8px 12px; border-radius: 6px; font-size: .93rem; cursor: pointer; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav > a:hover, .nav summary:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav > a.active, .nav details.active summary { background: rgba(255,255,255,.12); color: #fff; }
.nav details { position: relative; }
.nav details[open] .menu { display: block; }
.menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(16, 34, 54, .14); padding: 6px; z-index: 30;
}
.menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.menu a:hover { background: var(--surface-2); text-decoration: none; }
.topbar-search input {
    width: 220px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
    color: #fff; border-radius: 6px; padding: 7px 10px;
}
.topbar-search input::placeholder { color: #9fb0c3; }
.topbar-search input:focus { outline: none; background: rgba(255,255,255,.14); border-color: #6cb2ff; }
.nav-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav-user a { color: var(--topbar-text); font-size: .9rem; }
.nav-user form { margin: 0; }
.link-button { background: none; border: 0; color: var(--topbar-text); cursor: pointer; font: inherit; font-size: .9rem; padding: 4px; }
.link-button:hover { color: #fff; text-decoration: underline; }
.nav-toggle { display: none; }

/* ---------- Grundlayout ---------- */
.container { max-width: 1440px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; font-size: 1rem; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: 12px; }

/* ---------- Meldungen ---------- */
.flash { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); border-color: #bfe3cb; color: #14532d; }
.flash-error { background: var(--danger-soft); border-color: #f5c2c2; color: #7f1d1d; }
.flash-warning { background: var(--warning-soft); border-color: #f3d79b; color: #6b4000; }
.flash-info { background: var(--info-soft); border-color: #c4dcf7; color: #0b3a6b; }
.notice { padding: 10px 12px; border-radius: 6px; background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--muted); font-size: .9rem; }
.notice.warn { background: var(--warning-soft); border: 1px solid #f3d79b; color: #6b4000; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; color: #2b3746; }
.field { margin-bottom: 12px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search],
select, textarea {
    width: 100%; font: inherit; color: var(--text); background: #fff;
    border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; min-height: 38px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.15); }
input[type=file] { font-size: .9rem; max-width: 100%; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .92rem; margin: 6px 0; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 0; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: .84rem; margin: 4px 0 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; font-size: .9rem; line-height: 1;
    padding: 10px 14px; border-radius: 6px; border: 1px solid var(--border-strong);
    background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; min-height: 38px;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: #f0b7b7; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 10px; font-size: .84rem; min-height: 32px; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: wait; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600;
    white-space: nowrap; line-height: 1.6; border: 1px solid transparent;
}
.status-open { background: #e7f0ff; color: #1d4ed8; }
.status-in_progress { background: #fff1d6; color: #9a5b00; }
.status-waiting_customer { background: #f3e8ff; color: #7e22ce; }
.status-waiting_third_party { background: #e0f2fe; color: #0369a1; }
.status-resolved { background: #e3f5e9; color: #15803d; }
.status-closed { background: #eceef1; color: #4b5563; }
.prio-low { background: #f1f3f5; color: #5f6b7a; }
.prio-normal { background: #eef2f7; color: #334155; }
.prio-high { background: #ffedd5; color: #c2410c; }
.prio-urgent { background: #dc2626; color: #fff; }
.billing-not_required { background: #f1f3f5; color: #5f6b7a; }
.billing-open { background: #fff4dd; color: #9a5b00; }
.billing-billed { background: #e3f5e9; color: #15803d; }
.run-locked { background: #fff4dd; color: #9a5b00; }
.run-billed, .run-transferred { background: #e3f5e9; color: #15803d; }
.run-cancelled { background: #eceef1; color: #4b5563; text-decoration: line-through; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #eef2f7; color: #475569; vertical-align: 1px; }
.tag-company { background: #e8f0fe; color: #1e40af; }
.tag-person { background: #f0fdf4; color: #166534; }
.tag-deleted { background: var(--danger-soft); color: var(--danger); }
.tag-lock { background: #fff4dd; color: #9a5b00; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: #fafbfd; }
tr.muted-row td { color: var(--muted); }
tr.is-urgent td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
tr.is-high td:first-child { box-shadow: inset 3px 0 0 #f97316; }
tfoot td { font-weight: 650; background: var(--surface-2); }
.ticket-subject { font-weight: 600; color: var(--text); }
.ticket-subject:hover { color: var(--primary); }
.ticket-no { font-family: var(--mono); color: var(--muted); font-size: .88rem; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- Filterleiste ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters .field { margin: 0; min-width: 140px; flex: 1 1 140px; }
.filters .field.wide { flex: 2 1 220px; }
.filters label { font-size: .75rem; color: var(--muted); }
.filters select, .filters input { min-height: 34px; padding: 6px 8px; font-size: .9rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: #1e40af; padding: 4px 10px; border-radius: 999px; font-size: .84rem; }
.list-meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--muted); font-size: .88rem; gap: 10px; flex-wrap: wrap; }
.pagination { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 14px; color: var(--muted); font-size: .9rem; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); display: block; }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.stat.alert .value { color: #c2410c; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .main { min-width: 0; }
.mini-list .main a { font-weight: 600; color: var(--text); }
.mini-list .sub { color: var(--muted); font-size: .84rem; }
.status-bar { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Ticketdetail ---------- */
.ticket-head { padding: 16px 18px; }
.ticket-head .line1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ticket-head h1 { font-size: 1.35rem; margin: 0 0 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: .9rem; }
.meta-row strong { color: var(--text); font-weight: 600; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.ticket-aside { position: sticky; top: 74px; }
.section-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.section-nav a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .87rem; font-weight: 500; }
.section-nav a:hover { border-color: var(--primary); text-decoration: none; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 10px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Verlauf ---------- */
.timeline { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-left: 42px; margin-bottom: 14px; }
.tl-dot {
    position: absolute; left: 7px; top: 12px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 3px solid var(--border-strong);
}
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tl-head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; justify-content: space-between;
    padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .88rem;
}
.tl-head .who { font-weight: 650; color: var(--text); }
.tl-head .kind { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.tl-head time { color: var(--muted); white-space: nowrap; }
.tl-body { padding: 12px 14px; overflow-wrap: anywhere; }
.tl-body p:last-child { margin-bottom: 0; }
.tl-text { white-space: pre-wrap; margin: 0; font: inherit; }
.tl-item.compact { margin-bottom: 8px; }
.tl-item.compact .tl-dot { width: 12px; height: 12px; left: 10px; top: 7px; border-width: 2px; }
.tl-compact { font-size: .88rem; color: var(--muted); padding: 3px 0; }
.tl-compact .who { color: var(--text); font-weight: 600; }
.tl-created .tl-dot { border-color: var(--primary); background: var(--primary); }
.tl-created .tl-card { border-color: #c7d9fb; }
.tl-created .tl-head { background: var(--primary-soft); }
.tl-created .kind { color: #1e40af; }
.tl-note-internal_note .tl-dot { border-color: #64748b; }
.tl-note-internal_note .kind { color: #475569; }
.tl-note-error_description .tl-dot { border-color: #dc2626; }
.tl-note-error_description .tl-card { border-left: 3px solid #dc2626; }
.tl-note-error_description .kind { color: #b91c1c; }
.tl-note-work_step .tl-dot { border-color: #16a34a; }
.tl-note-work_step .tl-card { border-left: 3px solid #16a34a; }
.tl-note-work_step .kind { color: #15803d; }
.tl-time .tl-dot { border-color: #0891b2; }
.tl-time .tl-card { border-left: 3px solid #0891b2; }
.tl-time .kind { color: #0e7490; }
.tl-billing .tl-dot { border-color: #7c3aed; }
.tl-billing .kind { color: #6d28d9; }
.tl-billing .tl-card { border-left: 3px solid #7c3aed; }
.tl-attach .tl-dot { border-color: #ca8a04; }
.time-line { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; }
.time-line strong { font-variant-numeric: tabular-nums; }
.change-list { margin: 0; padding-left: 18px; font-size: .9rem; }
.old-text { margin-top: 8px; font-size: .88rem; }
.old-text summary { cursor: pointer; color: var(--muted); }
.old-text pre { white-space: pre-wrap; font: inherit; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; margin: 6px 0 0; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: .86rem; background: var(--surface-2); color: var(--text); max-width: 100%; }
.attachment:hover { border-color: var(--primary); text-decoration: none; }
.attachment img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.attachment .size { color: var(--muted); }

.composer textarea { min-height: 120px; }
.composer-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.composer-row .field { flex: 1 1 180px; margin-bottom: 0; }

/* ---------- Leistungen ---------- */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.total { font-size: .85rem; color: var(--muted); }
.total strong { display: block; font-size: 1.12rem; color: var(--text); font-variant-numeric: tabular-nums; }
.entry-form { padding: 14px 16px; border-top: 1px solid var(--border); }
.entry-grid { display: grid; grid-template-columns: 150px minmax(200px, 1.4fr) 110px minmax(0, 2fr) 170px; gap: 10px; align-items: end; }
.entry-grid .field { margin: 0; }
.entry-foot { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Anmeldung ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #102236 0%, #1b3a5c 100%); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card .brand { color: var(--topbar); font-size: 1.5rem; display: block; margin-bottom: 4px; }
.auth-card .brand span { color: var(--primary); }
.auth-card .btn { width: 100%; }

/* ---------- Kundenauswahl ---------- */
.ac { position: relative; }
.ac-list {
    position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); background: #fff;
    border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: 0 10px 24px rgba(16,34,54,.14);
    max-height: 320px; overflow-y: auto; list-style: none; margin: 0; padding: 4px;
}
.ac-list li { padding: 8px 10px; border-radius: 5px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac-list li[aria-selected=true], .ac-list li:hover { background: var(--primary-soft); }
.ac-list .extra { color: var(--muted); font-size: .84rem; }
.ac-selected { margin-top: 6px; font-size: .9rem; }

/* ---------- Sonstiges ---------- */
.error-page { text-align: center; padding: 60px 20px; }
.error-page .code { font-size: 3rem; font-weight: 700; color: var(--border-strong); }
.inline-form { display: inline; margin: 0; }
details.box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; }
details.box > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; }
details.box > div { padding: 0 16px 16px; }
.logo-preview { max-width: 280px; max-height: 110px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: #fff; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
    .ticket-layout { grid-template-columns: minmax(0, 1fr); }
    .ticket-aside { position: static; }
    .entry-grid { grid-template-columns: 1fr 1fr; }
    .entry-grid .span-2 { grid-column: span 2; }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    body { font-size: 15px; }
    .topbar-inner { flex-wrap: wrap; padding: 8px 14px; gap: 8px; }
    .nav-toggle { display: inline-flex; margin-left: auto; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 6px; padding: 8px 12px; font: inherit; cursor: pointer; }
    .nav, .nav-user, .topbar-search { display: none; width: 100%; }
    .topbar.open .nav { display: flex; flex-direction: column; align-items: stretch; }
    .topbar.open .nav-user, .topbar.open .topbar-search { display: flex; }
    .topbar.open .topbar-search input { width: 100%; }
    .nav-user { justify-content: space-between; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
    .menu { position: static; box-shadow: none; margin: 4px 0; }
    .container { padding: 14px 12px 50px; }
    .grid-2, .grid-3, .field-row, .field-row.three { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entry-grid { grid-template-columns: minmax(0, 1fr); }
    .entry-grid .span-2 { grid-column: auto; }
    .kv { grid-template-columns: 105px minmax(0, 1fr); }

    /* Tabellen als Karten */
    table.responsive thead { display: none; }
    table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
    table.responsive tr { border-bottom: 1px solid var(--border); padding: 8px 12px; }
    table.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; flex: 0 0 auto; }
    table.responsive td.primary { display: block; text-align: left; font-size: 1rem; }
    table.responsive td.primary::before { display: none; }
    table.responsive td:empty { display: none; }
    table.responsive tfoot { display: block; }
    table.responsive tfoot tr { display: flex; justify-content: space-between; }
    tr.is-urgent td:first-child, tr.is-high td:first-child { box-shadow: none; }
    tr.is-urgent { box-shadow: inset 3px 0 0 #dc2626; }
    tr.is-high { box-shadow: inset 3px 0 0 #f97316; }
    .btn { min-height: 42px; }
    input, select, textarea { font-size: 16px; } /* verhindert Zoom auf iOS */
}

@media print {
    .topbar, .section-nav, .composer, .entry-form, .ticket-aside form, .btn { display: none !important; }
    body { background: #fff; }
    .card, .tl-card { box-shadow: none; }
}
.plain-fieldset { border: 0; margin: 0; min-width: 0; }
.tag-unassigned { background: #fff1d6; color: #9a5b00; }
.contact-mode { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.contact-mode .checkbox { margin: 0; }
.danger-zone { border-color: #f0b7b7; }
.danger-zone .card-head { background: var(--danger-soft); }
.danger-zone .card-head h2 { color: var(--danger); }
.stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
