/* sc-tickets – Gestaltung nach Apple Human Interface Guidelines
   Systemfarben, Systemschrift, gruppierte Listen, Segmented Controls, Hell/Dunkel automatisch. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Hintergründe (grouped) */
  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --bg-tertiary: #f2f2f7;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --bar: rgba(249, 249, 249, 0.78);

  /* Text */
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);

  /* Systemfarben */
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --indigo: #5856d6;
  --teal: #30b0c7;
  --purple: #af52de;
  --pink: #ff2d55;
  --gray: #8e8e93;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.18);
    --bar: rgba(22, 22, 23, 0.72);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);
    --blue: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --indigo: #5e5ce6;
    --teal: #40c8e0;
    --purple: #bf5af2;
    --pink: #ff375f;
    --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  }
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 17px; line-height: 1.35; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { opacity: 0.8; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
main {
  max-width: 1080px; margin: 0 auto;
  padding: 8px max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
code { font-family: var(--mono); font-size: 14px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 2px; border-radius: 6px; }

input, select, textarea, button { font: inherit; color: inherit; letter-spacing: inherit; }
input, select, textarea {
  background: var(--fill); border: none; border-radius: var(--radius);
  padding: 9px 12px; min-height: 40px; color: var(--label); outline: none;
}
input::placeholder, textarea::placeholder { color: var(--label-3); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1.5 5L5 1.5 8.5 5M1.5 9L5 12.5 8.5 9' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
textarea { width: 100%; resize: vertical; line-height: 1.4; }
button { cursor: pointer; border: none; background: none; }

/* ---------- Buttons ---------- */
.btn-filled {
  background: var(--blue); color: #fff; font-weight: 600; font-size: 16px;
  padding: 10px 18px; min-height: 44px; border-radius: var(--radius);
  transition: filter 0.15s, transform 0.1s;
}
.btn-filled:hover { filter: brightness(1.08); }
.btn-filled:active { transform: scale(0.98); filter: brightness(0.92); }
.btn-filled.large { font-size: 17px; min-height: 50px; border-radius: 12px; }
.btn-filled.green-fill { background: var(--green); }
.btn-filled.destructive-fill { background: var(--red); }
.btn-tinted {
  background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue);
  font-weight: 600; font-size: 15px; padding: 9px 14px; min-height: 40px; border-radius: var(--radius);
}
.btn-tinted:hover { background: color-mix(in srgb, var(--blue) 22%, transparent); }
.wide { width: 100%; display: block; }
.save { margin-top: 16px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--blue); background: transparent; transition: background 0.15s;
}
.icon-btn:hover { background: var(--fill); opacity: 1; }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------- Navigationsleiste (durchscheinend) ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  padding-top: env(safe-area-inset-top);
}
.navbar-inner {
  max-width: 1080px; margin: 0 auto; height: 56px; display: flex; align-items: center; gap: 16px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand:hover { opacity: 1; }
.logo-wrap { display: inline-flex; line-height: 0; }
.logo-wrap img { height: 34px; width: auto; }
@media (prefers-color-scheme: dark) {
  .logo-wrap { background: #fff; border-radius: 8px; padding: 4px 8px; }
  .navbar .logo-wrap img { height: 28px; }
}
.searchfield { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.searchfield svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--label-2); pointer-events: none; }
.searchfield input { width: 100%; min-height: 36px; padding: 7px 10px 7px 32px; font-size: 16px; }
.nav-actions { display: flex; align-items: center; gap: 4px; }
.nav-actions form { margin: 0; display: inline-flex; }

/* Benutzermenü (Popover) */
.usermenu { position: relative; margin-left: 4px; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(180deg, #a1a1a6, #858589); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.avatar.large { width: 44px; height: 44px; font-size: 19px; }
.avatar.xl { width: 84px; height: 84px; font-size: 36px; }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 280px; z-index: 30;
  background: var(--bg-elevated); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  overflow: hidden; animation: pop 0.16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 0.5px solid var(--separator); }
.menu-head b { display: block; font-weight: 600; font-size: 16px; }
.menu-head span { font-size: 13px; color: var(--label-2); }
.menu-group { margin: 0; border-bottom: 0.5px solid var(--separator); }
.menu-group:last-child { border-bottom: none; }
.menu-group a, .menu-group button {
  display: block; width: 100%; text-align: left; padding: 11px 16px; color: var(--label); font-size: 16px;
}
.menu-group a:hover, .menu-group button:hover { background: var(--fill-2); opacity: 1; }
.menu-group .destructive { color: var(--red); }

/* ---------- Titel ---------- */
.large-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 14px; }
.large-title h1 { font-size: 34px; line-height: 1.1; }
.subtitle { color: var(--label-2); font-size: 15px; }
.section-header { font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; margin: 26px 16px 7px; }
.section-footer { font-size: 13px; color: var(--label-2); margin: 8px 16px 0; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; margin: 14px 0 4px; }
.back svg { width: 11px; height: 19px; }

/* ---------- Meldungen ---------- */
.toast {
  border-radius: var(--radius-lg); padding: 12px 16px; margin: 12px 0; font-size: 15px;
  background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; gap: 10px; align-items: flex-start;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.toast.ok::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.error { color: var(--label); }

/* ---------- Gruppen (Inset Grouped) ---------- */
.group { background: var(--bg-elevated); border-radius: var(--radius-lg); overflow: hidden; }
.group-pad { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.group-note { padding: 0 16px 14px; margin: 0; color: var(--label-2); font-size: 15px; }

/* Formularzeilen wie in den iOS-Einstellungen: Bezeichnung links, Wert rechts */
.form-rows > label, .form-rows > .row-info {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 46px; padding: 4px 16px; margin-left: 0; position: relative; font-size: 17px;
}
.form-rows > label + label::before, .form-rows > label + .row-info::before, .form-rows > .row-info + .row-info::before, .form-rows > datalist + label::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator);
}
.form-rows > label > span:first-child, .form-rows > .row-info > span:first-child { flex-shrink: 0; color: var(--label); }
.form-rows input, .form-rows select {
  background: transparent; text-align: right; color: var(--label-2); padding: 8px 0; min-height: 38px;
  flex: 1; min-width: 0; box-shadow: none !important;
}
.form-rows select { text-align-last: right; padding-right: 22px; background-position: right 0 center; }
.form-rows input:focus, .form-rows select:focus { color: var(--blue); }
.form-rows input:disabled { color: var(--label-3); -webkit-text-fill-color: var(--label-3); opacity: 1; }
.form-rows input[type=date] { text-align: right; }
.form-rows input[type=date]::-webkit-date-and-time-value { text-align: right; }
.form-rows label.stacked { flex-direction: column; align-items: stretch; gap: 2px; padding-top: 10px; padding-bottom: 6px; }
.form-rows label.stacked > span { font-size: 13px; color: var(--label-2) !important; }
.form-rows label.stacked input { text-align: left; color: var(--label); font-size: 17px; padding: 2px 0 6px; }
.row-info .value { color: var(--label-2); text-align: right; }

/* einfache Wertzeilen */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; position: relative; font-size: 15px; }
.rows li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.rows .value { color: var(--label-2); white-space: nowrap; }
.rows.small li { font-size: 14px; }

/* ---------- Schnellerfassung ---------- */
.capture { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 6px; margin-bottom: 18px; }
.capture-main { display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
.capture:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
.capture-opts :focus-visible, .capture-main input:focus-visible { outline: none; }
.capture-main input { flex: 1; background: transparent; font-size: 19px; padding: 10px 0; min-height: 48px; box-shadow: none !important; }
.plus-circle {
  width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 500; line-height: 1;
}
.capture-opts {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px 6px; border-top: 0.5px solid var(--separator); margin: 0 6px;
}
.capture-opts select, .capture-opts input { font-size: 15px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.capture-opts .btn-filled { margin-left: auto; min-height: 36px; padding: 6px 16px; font-size: 15px; }

/* ---------- Kacheln (wie Erinnerungen) ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile {
  background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 12px 14px 12px;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center;
  color: var(--label); transition: transform 0.12s;
}
a.tile:hover { opacity: 1; transform: scale(1.015); }
a.tile:active { transform: scale(0.98); }
.tile-icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 19px; height: 19px; }
.tile-icon.blue { background: var(--blue); } .tile-icon.red { background: var(--red); }
.tile-icon.orange { background: var(--orange); } .tile-icon.green { background: var(--green); }
.tile b { font-size: 28px; font-weight: 700; text-align: right; line-height: 1; letter-spacing: -0.02em; }
.tile > span:last-child { grid-column: 1 / -1; margin-top: 8px; color: var(--label-2); font-weight: 600; font-size: 15px; }

/* ---------- Filter ---------- */
.filterbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.segmented {
  display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; align-self: flex-start;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a, .segmented button {
  flex: 1 0 auto; text-align: center; padding: 5px 16px; font-size: 14px; font-weight: 500; color: var(--label);
  border-radius: 7px; white-space: nowrap; position: relative; min-height: 30px; display: inline-flex; align-items: center; justify-content: center;
}
.segmented a:hover, .segmented button:hover { opacity: 1; }
.segmented .on {
  background: var(--bg-elevated); font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) { .segmented .on { background: #636366; } }
.segmented form { margin: 0; display: flex; flex: 1; }
.segmented form button { width: 100%; }

.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0; font-size: 14px; font-weight: 500; padding: 6px 13px; border-radius: 999px;
  background: var(--bg-elevated); color: var(--label); white-space: nowrap;
}
.pill:hover { opacity: 1; background: var(--fill); }
.pill.on { background: var(--blue); color: #fff; }
.pill-sep { flex-shrink: 0; width: 1px; background: var(--separator); margin: 4px 2px; }

/* ---------- Ticketliste ---------- */
.inset-list { list-style: none; margin: 0; padding: 0; background: var(--bg-elevated); border-radius: var(--radius-lg); overflow: hidden; }
.ticket { display: flex; align-items: center; position: relative; }
.ticket + .ticket::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: 0.5px solid var(--separator); }
.check-form { margin: 0; padding: 0 4px 0 12px; align-self: stretch; display: flex; align-items: center; }
.check {
  width: 26px; height: 26px; border-radius: 50%; border: 1.6px solid var(--label-3);
  display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: all 0.15s;
}
.check svg { width: 18px; height: 18px; }
.check:hover { border-color: var(--blue); color: var(--blue); }
.prio-hoch .check { border-color: var(--orange); }
.done .check { background: var(--blue); border-color: var(--blue); color: #fff; }
.done .ticket-title { color: var(--label-2); }
.ticket-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 16px 11px 10px; color: var(--label); }
.ticket-body:hover { opacity: 1; background: var(--fill-2); }
.ticket-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket-title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-mark { color: var(--orange); font-weight: 700; }
.ticket-meta { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { font-weight: 600; margin-right: 2px; }
.src-mail { color: var(--blue); } .src-teams { color: var(--indigo); } .src-anruf { color: var(--green); }
.src-sms { color: var(--teal); } .src-whatsapp { color: var(--green); } .src-messenger { color: var(--purple); }
.src-persoenlich { color: var(--orange); } .src-sonstiges { color: var(--gray); }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.due { font-size: 14px; color: var(--label-2); }
.due.overdue { color: var(--red); font-weight: 600; }
.badges { display: inline-flex; gap: 4px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.privat { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.badge.wartet { color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.badge.admin { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.badge.gesperrt { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.chevron { width: 8px; height: 14px; color: var(--label-3); flex-shrink: 0; }
.inset-list .empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; text-align: center; color: var(--label-2);
}
.inset-list .empty svg { width: 46px; height: 46px; color: var(--green); margin-bottom: 6px; }
.inset-list .empty b { color: var(--label); font-size: 19px; }

/* ---------- Ticket-Detail ---------- */
.detail-head { margin: 8px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.detail-head h1 { font-size: 30px; line-height: 1.15; }
.eyebrow { font-size: 14px; color: var(--label-2); }
.status-seg { margin-top: 10px; min-width: 300px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 0 28px; }

.timeline { list-style: none; margin: 0; padding: 8px 0; }
.ev { display: flex; gap: 12px; padding: 10px 16px; position: relative; }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--gray); position: relative; z-index: 1; }
.ev:not(:last-child)::after { content: ""; position: absolute; left: 20.5px; top: 24px; bottom: -8px; width: 1px; background: var(--separator); }
.ev-nachricht .ev-dot { background: var(--blue); }
.ev-notiz .ev-dot { background: var(--orange); }
.ev-zeit .ev-dot { background: var(--green); }
.ev-erstellt .ev-dot { background: var(--indigo); }
.ev-body { flex: 1; min-width: 0; }
.ev-meta { font-size: 13px; color: var(--label-2); display: flex; gap: 4px; flex-wrap: wrap; }
.ev-meta b { color: var(--label); font-weight: 600; }
.ev-time { margin-left: auto; padding-left: 10px; }
.ev-text { margin-top: 4px; white-space: pre-wrap; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.ev-status .ev-text, .ev-geaendert .ev-text, .ev-zeit .ev-text, .ev-erstellt .ev-text { color: var(--label-2); font-size: 14px; }

.composer:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
.composer textarea:focus-visible, .field-group input:focus-visible, .form-rows :focus-visible { outline: none; }
.composer textarea { background: transparent; border-radius: 0; padding: 14px 16px; min-height: 90px; box-shadow: none !important; }
.composer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px 12px; }
.composer-bar select { font-size: 15px; min-height: 36px; }
.composer-bar .btn-filled { min-height: 36px; padding: 6px 16px; font-size: 15px; }

.time-total { padding: 16px 16px 12px; display: flex; flex-direction: column; }
.time-value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.time-label { font-size: 13px; color: var(--label-2); }
.book-row { display: flex; gap: 8px; }
.book-row input[type=number] { width: 76px; }
.book-row input:not([type=number]) { flex: 1; min-width: 0; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px 0; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-logo { margin-bottom: 22px; }
.login-logo img { width: 190px; height: auto; }
.login-card h1 { font-size: 34px; }
.login-sub { color: var(--label-2); margin: 6px 0 26px; font-size: 17px; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field-group input {
  display: block; width: 100%; background: transparent; border-radius: 0; min-height: 50px; padding: 12px 16px; font-size: 17px; box-shadow: none !important;
}
.field-group input + input { border-top: 0.5px solid var(--separator); }
.field-group:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-size: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--label-2); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 0.5px solid var(--separator); }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border-radius: 12px;
  background: var(--bg-elevated); color: var(--label); font-weight: 600; font-size: 17px;
}
.sso-btn:hover { opacity: 1; background: var(--fill); }
.login .toast { text-align: left; }

/* iOS-Schalter */
.switch {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; min-height: 31px; padding: 0; border-radius: 999px;
  background: var(--fill); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06); transition: transform 0.2s;
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Konto & Benutzer ---------- */
.narrow { max-width: 560px; margin: 0 auto; }
.wide-narrow { max-width: 680px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0 4px; text-align: center; }
.profile-head h1 { font-size: 28px; margin-top: 6px; }

.disclosure summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--blue); font-size: 17px;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure[open] summary { border-bottom: 0.5px solid var(--separator); }
.add-user { margin-top: 4px; }

.user-row { position: relative; }
.user-row + .user-row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 0.5px solid var(--separator); z-index: 1; }
.user-row summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.user-row summary::-webkit-details-marker { display: none; }
.user-row summary:hover { background: var(--fill-2); }
.user-row .avatar { width: 36px; height: 36px; font-size: 15px; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-main b { font-weight: 400; font-size: 17px; }
.user-main > span { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { font-size: 12px; font-weight: 600; color: var(--label-2); background: var(--fill); padding: 1px 6px; border-radius: 6px; vertical-align: 2px; }
.user-row .chevron { transition: transform 0.2s; }
.user-row[open] .chevron { transform: rotate(90deg); }
.user-row.inactive .user-main, .user-row.inactive .avatar { opacity: 0.5; }
.user-edit { background: var(--bg-tertiary); border-top: 0.5px solid var(--separator); }
@media (prefers-color-scheme: light) { .user-edit { background: #fafafa; } }

/* ---------- Kleine Bildschirme (iPhone) ---------- */
@media (max-width: 820px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .navbar-inner { gap: 10px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .logo-wrap img { height: 28px; }
  .searchfield { max-width: none; }
  .hide-mobile { display: none !important; }
  .large-title h1 { font-size: 32px; }
  .capture-opts select, .capture-opts input { flex: 1 1 40%; }
  .capture-opts .btn-filled { flex: 1 1 100%; }
  .segmented { align-self: stretch; }
  .detail-head h1 { font-size: 26px; }
  .status-seg { min-width: 0; align-self: stretch; }
  .ticket-side .badges { display: none; }
  .ev-time { margin-left: 0; padding-left: 0; width: 100%; }
}

/* ---------- Version / Was ist neu ---------- */
.menu-version { display: flex !important; justify-content: space-between; align-items: center; }
.menu-version span { font-size: 13px; color: var(--label-2); }
.login-version { margin-top: 28px; font-size: 12px; color: var(--label-3); }
.section-header .current { text-transform: none; letter-spacing: 0; margin-left: 6px; vertical-align: 1px; }
.release { padding: 6px 0 4px; }
.release-intro { margin: 10px 16px 4px; color: var(--label-2); font-size: 15px; }
.release-section { padding: 8px 16px 6px; }
.release-section + .release-section { border-top: 0.5px solid var(--separator); }
.release h3.kind { font-size: 15px; font-weight: 600; margin: 4px 0 6px; }
.kind-neu { color: var(--green); } .kind-geändert { color: var(--blue); } .kind-behoben { color: var(--orange); }
.kind-sicherheit { color: var(--red); } .kind-entfernt { color: var(--gray); }
.release ul { margin: 0 0 6px; padding-left: 20px; }
.release li { font-size: 15px; line-height: 1.45; margin: 3px 0; }

/* ---------- Kunden ---------- */
.muted { color: var(--label-2); }
.small-note { font-size: 13px; }
.inline-search { max-width: none; margin: 0 0 14px; }
.inline-search input { background: var(--fill); min-height: 40px; }
.hint-row {
  display: flex; align-items: center; gap: 12px; background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: 12px 16px; margin-bottom: 16px; color: var(--label); font-size: 15px;
}
.hint-row:hover { opacity: 1; background: var(--fill-2); }
.hint-row > span:nth-child(2) { flex: 1; }
.tile-icon.small { width: 28px; height: 28px; flex-shrink: 0; }
.tile-icon.indigo { background: var(--indigo); }
.customer-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--label); position: relative; }
.customer-row:hover { opacity: 1; background: var(--fill-2); }
.customer-list li + li .customer-row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 0.5px solid var(--separator); }
.avatar.cust { width: 36px; height: 36px; font-size: 15px; background: linear-gradient(180deg, #5ac8fa, #007aff); }
.count-badge {
  min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--fill); color: var(--label-2);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.list-head .section-header { margin-bottom: 7px; }
.segmented.small a { padding: 3px 12px; min-height: 26px; font-size: 13px; }
.list-head .segmented { margin-bottom: 6px; align-self: auto; }
.rows li form { margin: 0; }
.link-destructive { color: var(--red); font-size: 15px; padding: 0; }
.add-domain { flex-direction: row; border-top: 0.5px solid var(--separator); }
.add-domain input { flex: 1; min-width: 0; }

/* ---------- Admin: Clockodo & Zuordnungen ---------- */
.large-title form { margin: 0; }
.status-line { margin-top: -6px; margin-bottom: 12px; }
.proposal { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.proposal + .proposal::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.proposal-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.proposal-head .domain { font-size: 17px; font-weight: 600; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proposal-actions form { margin: 0; }
.match-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 10px;
  background: var(--fill-2); color: var(--label); font-size: 15px; min-height: 36px;
}
.match-btn:hover { background: var(--fill); }
.match-btn.first { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.match-btn .plus { font-size: 13px; font-weight: 600; color: #fff; background: var(--blue); padding: 3px 10px; border-radius: 999px; }
.conf { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 999px; }
.conf.hoch { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.conf.mittel { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.conf.niedrig { color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.pick { display: inline-flex; gap: 6px; }
.pick input { min-height: 36px; padding: 6px 10px; font-size: 15px; width: 220px; }
.small-btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.link-muted { color: var(--label-2); font-size: 14px; padding: 6px 4px; }
.link-muted:hover { color: var(--red); }
.link-blue { color: var(--blue); font-size: 15px; padding: 0; }
.no-match { padding: 4px 0; }
.add-mapping { flex-direction: row; flex-wrap: wrap; }
.add-mapping input { flex: 1 1 200px; }
.mapping-rows li, .service-rows li { align-items: center; }
.mapping-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.mapping-main .arrow { color: var(--label-3); }
.service-rows li.inactive .mapping-main, .customer-list li.inactive .customer-row { opacity: 0.5; }
.warn-text { color: var(--orange); }
@media (max-width: 600px) { .pick input { width: 100%; } .pick { flex: 1 1 100%; } }

/* ---------- Duplikat-Erkennung ---------- */
.similar-hint { margin: 2px 16px 6px 52px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--orange) 10%, transparent); font-size: 14px; }
.similar-head { font-weight: 600; color: var(--orange); display: block; margin-bottom: 4px; }
.similar-hint ul { list-style: none; margin: 0; padding: 0; }
.similar-hint li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 3px 0; }
.similar-hint li a { color: var(--label); }
.similar-hint li .link-blue { font-size: 14px; margin-left: auto; }
.entered { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.entered b { font-size: 19px; font-weight: 600; }
.dup { display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: relative; }
.dup + .dup::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.dup form { margin: 0; flex-shrink: 0; }
.dup-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--label); }
.dup-main:hover { opacity: 1; }
.dup-text { display: flex; flex-direction: column; min-width: 0; }
.dup-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup .conf { flex-shrink: 0; min-width: 54px; text-align: center; }
.confirm-new { margin-top: 18px; }
.badge.dup-badge { color: var(--purple); background: color-mix(in srgb, var(--purple) 14%, transparent); }
.hint-row.merged { margin-top: 10px; }
form.section-footer { margin-top: 8px; }
@media (max-width: 600px) { .dup { flex-wrap: wrap; } .dup form { width: 100%; } .dup form .small-btn { width: 100%; } .similar-hint { margin-left: 10px; } }

/* ---------- Feedback ---------- */
.fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; }
.fab summary {
  list-style: none; cursor: pointer; width: 52px; height: 52px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); transition: transform 0.15s;
}
.fab summary::-webkit-details-marker { display: none; }
.fab summary:hover { transform: scale(1.06); }
.fab[open] summary { transform: rotate(0deg) scale(0.92); background: var(--gray); }
.fab summary svg { width: 24px; height: 24px; }
.fab-panel {
  position: absolute; right: 0; bottom: 64px; width: min(340px, calc(100vw - 40px)); background: var(--bg-elevated);
  border-radius: 16px; box-shadow: var(--shadow-pop); padding: 16px; display: flex; flex-direction: column; gap: 10px;
  animation: pop 0.16s ease-out;
}
.fab-panel b { font-size: 17px; }
.fab-panel textarea { min-height: 96px; }
.fab-kind { align-self: stretch; }
.fab-kind label { flex: 1; text-align: center; padding: 5px 8px; font-size: 14px; font-weight: 500; border-radius: 7px; cursor: pointer; }
.fab-kind label.on { background: var(--bg-elevated); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .fab-kind label.on { background: #636366; } }
.fab-kind input { position: absolute; opacity: 0; pointer-events: none; }
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.usermenu summary { position: relative; }
.avatar-dot { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.menu-count { font-size: 12px !important; font-weight: 600; color: #fff !important; background: var(--red); padding: 1px 7px; border-radius: 999px; }
.fb-id { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--label-2); min-width: 44px; font-size: 14px; }
.fb-row .user-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-text { padding: 14px 16px 4px; white-space: pre-wrap; font-size: 16px; line-height: 1.45; }
.fb-meta { margin: 0 16px 6px; }
.badge.fb-fehler { color: var(--red); background: color-mix(in srgb, var(--red) 13%, transparent); }
.badge.fb-wunsch { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.badge.fb-sonstiges { color: var(--label-2); background: var(--fill); }
.badge.fb-st-neu { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); }
.badge.fb-st-uebertragen { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 14%, transparent); }
.badge.fb-st-umgesetzt { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.badge.fb-st-zurueckgestellt { color: var(--label-2); background: var(--fill); }
.badge.fb-st-abgelehnt { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.empty-pad { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; }
.transfer textarea { background: transparent; font-family: var(--mono); font-size: 13px; border-radius: 0; padding: 14px 16px; box-shadow: none !important; }
.large-title a.btn-filled { display: inline-flex; align-items: center; }
@media (max-width: 600px) { .fb-row .badges .fb-kind { display: none; } }

/* ---------- TeamViewer ---------- */
.tv-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.tv-service { display: flex; align-items: center; gap: 8px; margin: 0; }
.tv-service select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 14px; }
.book-all { margin-bottom: 12px; }
.tv-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; position: relative; flex-wrap: wrap; }
.tv-row + .tv-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.tv-main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.tv-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tv-head b { font-weight: 600; }
.tv-time { font-size: 14px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.tv-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tv-actions form { margin: 0; }
.tv-row.st-ignoriert .tv-main, .tv-row.st-gebucht .tv-main { opacity: 0.7; }
.book-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.book-inline input { width: 72px; min-height: 34px; padding: 5px 8px; font-size: 15px; text-align: right; }
.mapped { font-size: 15px; }
.tv-ticket li { align-items: center; }
@media (max-width: 600px) { .tv-actions { width: 100%; } }

/* ---------- Ansprechpartner ---------- */
.person { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; position: relative; }
.person + .person::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 0.5px solid var(--separator); }
.person-av { width: 36px; height: 36px; font-size: 15px; background: linear-gradient(180deg, #a1a1a6, #858589); }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person-main b { font-weight: 500; font-size: 17px; }
.person-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; }
.person form { margin: 0; }
.add-person { margin-top: 10px; }
.domain-sugg { gap: 8px; border-bottom: 0.5px solid var(--separator); }
.domain-sugg .match-btn { width: 100%; justify-content: space-between; text-align: left; }
.sugg-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sugg-text b { font-weight: 500; }

.title-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.title-actions a { display: inline-flex; align-items: center; }
.copy-status { flex: 1; text-align: right; }

/* ---------- F-1: Kunden deutlicher ---------- */
.cust-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent); padding: 1px 8px 1px 6px; border-radius: 6px; margin-right: 4px;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: 1px;
}
.cust-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.cust-chip.missing { color: var(--orange); background: transparent; border: 1px dashed color-mix(in srgb, var(--orange) 60%, transparent); padding: 0 7px; font-weight: 500; }
.cust-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600;
  color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); padding: 6px 12px; border-radius: 10px; margin: 2px 0 4px;
}
.cust-pill:hover { opacity: 1; background: color-mix(in srgb, var(--blue) 18%, transparent); }
.cust-pill svg { width: 18px; height: 18px; }
.cust-pill .chev { width: 7px; height: 12px; opacity: 0.6; }
.cust-pill.missing { color: var(--orange); background: transparent; border: 1.5px dashed color-mix(in srgb, var(--orange) 60%, transparent); font-weight: 500; font-size: 15px; }
.cust-pill.static { color: var(--label); background: var(--fill); }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cust-filter { margin: 0; }
.cust-filter select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 14px; font-weight: 500; background-color: var(--bg-elevated); }
.cust-filter select.on { background-color: var(--blue); color: #fff; }

/* ---------- F-2: Ignorierliste ---------- */
.ignore-box { margin-top: 16px; }
.ignore-box summary { color: var(--red); }
.ignore-icon { font-size: 20px; line-height: 1; width: 26px; text-align: center; }
.ignore-form label.radio { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; }
.ignore-form label.radio input[type=radio], .ignore-form label.radio input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); }
.ignore-form label.radio input[name=subject] { flex: 1 1 200px; min-height: 34px; padding: 5px 10px; font-size: 15px; }
.ignore-form b { font-weight: 600; }
.mapping-rows .badge { margin-right: 2px; }
@media (max-width: 600px) { .filter-row .segmented { width: 100%; } .cust-filter, .cust-filter select { width: 100%; } }

/* ---------- TeamViewer ↔ E-Mail ---------- */
.mail-match { margin: 6px 0 0; }
.mail-match .match-btn { width: 100%; text-align: left; align-items: center; }
.mm-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.mm-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-text .muted { font-size: 12px; }

/* ---------- Lieferanten & Projekte ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cust-pill.supp { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 12%, transparent); font-size: 15px; }
.cust-pill.supp:hover { background: color-mix(in srgb, var(--indigo) 18%, transparent); }
.cust-chip.supp { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 12%, transparent); }
.cust-chip .proj { font-weight: 500; opacity: 0.85; }
.role-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--indigo); background: color-mix(in srgb, var(--indigo) 13%, transparent); padding: 2px 7px; border-radius: 999px; vertical-align: 2px; }
.avatar.supp { background: var(--indigo); }
.for-customer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 4px; }
.for-customer form { margin: 0; }
.for-customer .pill { padding: 4px 12px; font-size: 14px; }
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.project-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--bg-elevated);
  color: var(--label); border: 1.5px solid transparent; }
.project-card:hover { opacity: 1; border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.project-card b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card span { font-size: 12px; color: var(--label-2); }
.project-card.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--bg-elevated)); }
.project-card.done { opacity: 0.6; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; }
.center-form { text-align: center; margin: 8px 0 16px; }

/* ---------- Lieferanten-Vorschläge ---------- */
.sup-proposals { display: flex; flex-direction: column; gap: 6px; }
.sup-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px;
  background: var(--bg-elevated); border: none; color: var(--label); cursor: pointer; font: inherit; }
.sup-card:hover { background: color-mix(in srgb, var(--indigo) 8%, var(--bg-elevated)); }
.sup-card .sup-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.sup-card .sup-text b { font-weight: 600; }
.sup-card .sup-text .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-card .plus { font-size: 13px; font-weight: 600; color: #fff; background: var(--indigo); padding: 3px 10px; border-radius: 999px; flex-shrink: 0; }
#sup-live { margin: -4px 0 2px; }
#sup-live .sup-card { background: var(--fill); }
.avatar.small { width: 32px; height: 32px; font-size: 14px; flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.flash-fill { box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 45%, transparent); transition: box-shadow .3s; }

/* ---------- Doppelbuchungs-Warnung ---------- */
.clockodo-hint { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 8px;
  color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); }
.clockodo-hint.hoch { color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent); }
.conf.hoch.dup-warn, .dup .conf.hoch { }
.center-link { display: block; text-align: center; margin-top: 10px; }
.conf.alarm { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

/* ---------- Eingangszeit ---------- */
.ticket-side .received { font-size: 13px; color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sort-seg { margin-left: auto; }
@media (max-width: 600px) { .sort-seg { margin-left: 0; } }

/* ---------- Notizen in die Clockodo-Beschreibung ---------- */
.book-form { display: flex; flex-direction: column; gap: 8px; }
.notes-box { display: flex; flex-direction: column; gap: 4px; }
.notes-box textarea { min-height: 0; font-size: 14px; line-height: 1.4; }

.push-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 14px; }
.push-row .small-note { flex: 1 1 280px; }

/* ---------- Neue Tickets ---------- */
.fresh-pill { position: fixed; left: 50%; transform: translateX(-50%); top: 70px; z-index: 30; background: var(--blue); color: #fff;
  font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.fresh-pill:hover { opacity: 1; filter: brightness(1.08); }

/* ---------- Synchronisierung ---------- */
.sync-state { position: relative; }
.sync-dot { position: absolute; top: 6px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2px var(--bg-elevated); }
.sync-state.warnung .sync-dot { background: var(--orange); }
.sync-state.fehler .sync-dot { background: var(--red); }
.sync-state.fehler { color: var(--red); }
.menu-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; vertical-align: 1px; }
.menu-dot.warnung { background: var(--orange); } .menu-dot.fehler { background: var(--red); }
.sync-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.sync-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sync-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-head b { font-weight: 600; font-size: 16px; }
.sync-msg { font-size: 14px; overflow-wrap: anywhere; }
.sync-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sync-actions form { margin: 0; }
.sync-badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.sync-badge.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.sync-badge.laeuft { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.sync-badge.fehler { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.sync-badge.angehalten, .sync-badge.verspaetet { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); }
.sync-badge.aus, .sync-badge.wartet { color: var(--label-2); background: var(--fill); }
table.sync-log { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sync-log th { text-align: left; font-weight: 600; color: var(--label-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px 6px; }
table.sync-log td { padding: 8px 12px; border-top: 0.5px solid var(--separator); vertical-align: top; }
table.sync-log .nowrap { white-space: nowrap; }
table.sync-log .log-msg { overflow-wrap: anywhere; }
table.sync-log tr.st-fehler .log-msg { color: var(--red); }
@media (max-width: 700px) {
  .sync-row { flex-direction: column; align-items: stretch; }
  table.sync-log th:nth-child(4), table.sync-log td:nth-child(4) { display: none; }
}

/* ---------- Sitzung von Hand an ein Ticket hängen ---------- */
.attach-any { margin-top: 6px; }
.attach-any summary { font-size: 13px; color: var(--blue); cursor: pointer; list-style: none; display: inline-block; }
.attach-any summary::-webkit-details-marker { display: none; }
.attach-form { position: relative; display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.attach-form .ticket-search { flex: 1 1 260px; min-height: 34px; padding: 5px 10px; font-size: 14px; }
.ticket-hits { position: absolute; top: 40px; left: 0; right: 0; z-index: 20; background: var(--bg-elevated); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.ticket-hits[hidden] { display: none; }
.ticket-hits .hit { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 8px 10px; border: none; background: none;
  border-radius: 8px; cursor: pointer; font: inherit; color: var(--label); }
.ticket-hits .hit:hover { background: var(--fill); }
.ticket-hits .hit b { font-weight: 600; font-size: 14px; }
.ticket-hits .hit .muted { font-size: 12px; }
.tv-add { margin-bottom: 16px; }
.attach-pick, .attach-row { flex-direction: row; align-items: center; flex-wrap: wrap; }
.attach-pick select { flex: 1 1 200px; min-width: 0; width: auto; }
.attach-row { position: relative; }
.attach-row .ticket-hits { top: 58px; left: 16px; right: 16px; }

/* ---------- Antwort per E-Mail ---------- */
.reply-body { width: 100%; border: none; background: transparent; padding: 14px 16px; font-size: 15px; line-height: 1.45; resize: vertical; }
.reply-notes label.radio { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.reply-notes input[type=checkbox], .close-box input { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; accent-color: var(--blue); margin-top: 2px; }
.close-box { display: flex; gap: 10px; align-items: center; margin: 14px 4px; font-size: 15px; }
.reply-actions { display: flex; flex-wrap: wrap; gap: 10px; }
