/**
 * VIVEREA – Ticketing (Premium SaaS)
 * Ziel: Linear / Notion / Apple – kein Bootstrap-Admin-Template.
 */

:root {
  --tk-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tk-ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --tk-radius-card: 18px;
  --tk-radius-field: 14px;
  --tk-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.06);
  --tk-shadow-card-hover: 0 16px 42px rgba(0, 0, 0, 0.085);
}

/* Standard-Admin-Kachel auf Tickets-Seite entfernen – mehr Canvas, weniger „Panel in Panel“ */
#adminTicketsModule.admin-module {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  backdrop-filter: none !important;
}

@media (min-width: 768px) {
  .admin-container:has(#adminTicketsModule) {
    padding-top: 2.25rem;
    padding-bottom: 3.5rem;
  }
}

.tk-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 3rem;
}

@media (min-width: 900px) {
  .tk-shell {
    padding: 0.75rem 2rem 3.5rem;
  }
}

.tk-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* Sidebar bleibt sichtbar, Main scrollt (Desktop) */
@media (min-width: 980px) {
  .tk-layout {
    min-height: calc(100vh - 160px);
  }
  .tk-sidebar {
    position: sticky;
    top: 110px;
    align-self: start;
    max-height: calc(100vh - 140px);
    overflow: auto;
  }
  .tk-main {
    min-width: 0;
  }
}

@media (max-width: 980px) {
  .tk-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .tk-sidebar {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}

.tk-sidebar {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--tk-radius-card);
  box-shadow: var(--tk-shadow-card);
  padding: 14px;
}

.tk-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 6px 10px;
}

.tk-sidebar-title {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.tk-sidebar-add {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.15s var(--tk-ease-soft), box-shadow 0.2s var(--tk-ease-soft), border-color 0.2s var(--tk-ease-soft);
}

.tk-sidebar-add:hover {
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

a.tk-sidebar-team-link {
  text-decoration: none;
  color: inherit;
}

.tk-person-item.is-inactive {
  opacity: 0.58;
}

.tk-person-item.is-inactive .tk-person-name {
  color: #64748b;
}

.tk-sidebar-empty-cta {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.tk-sidebar-empty-cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.tk-sidebar-all {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.18s var(--tk-ease-soft), box-shadow 0.18s var(--tk-ease-soft);
}

.tk-sidebar-all:hover {
  background: rgba(15, 23, 42, 0.04);
}

.tk-sidebar-all.is-active {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.tk-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 4px 4px;
}

.tk-person-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: none;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.18s var(--tk-ease-soft), box-shadow 0.2s var(--tk-ease), transform 0.18s var(--tk-ease);
}

.tk-person-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.tk-person-item.is-active {
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.1);
}

.tk-person-name {
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.25;
  margin: 0;
}

.tk-person-email {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.35;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-person-count {
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* In-app mini modal (Create user + Confirm) */
.tk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--tk-ease), visibility 0.22s var(--tk-ease);
  z-index: 1400;
}

.tk-overlay-open {
  overflow: hidden;
}

/* Ticket Detail Overlay – exakt wie spezifiziert */
#tkOverlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

#tkOverlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

#tkOverlayBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#tkOverlayCard {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 960px;
  max-width: 92vw;
  height: 85vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 180ms ease-out;
}

#tkOverlay.is-open #tkOverlayCard {
  transform: translate(-50%, -50%) scale(1);
}

.tk-ov-head {
  padding: 36px 32px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-shrink: 0;
}

.tk-ov-head-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1;
  padding-top: 2px;
}

.tk-ov-title {
  font-size: clamp(24px, 2.4vw, 26px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: #0f172a;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-ov-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tk-ov-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 180ms ease-out, color 180ms ease-out, transform 160ms ease-out, box-shadow 180ms ease-out;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tk-ov-close:hover {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.tk-ov-close:active { transform: translateY(0) scale(0.97); }

.tk-ov-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 32px 20px;
  -webkit-overflow-scrolling: touch;
}

.tk-ov-card {
  background: #fafafa;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.tk-ov-card--conversation {
  display: flex;
  flex-direction: column;
  min-height: 140px;
  margin-bottom: 8px;
}

.tk-ov-card--conversation .tk-chat-thread {
  flex: 1;
  min-height: 80px;
}

.tk-ov-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

.tk-ov-person-name {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.tk-ov-person-email {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.tk-ov-select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--tk-radius-field);
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 160ms ease-out, box-shadow 200ms ease-out, background 160ms ease-out;
}
.tk-ov-select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.tk-ov-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f1f5f9;
}

.tk-ov-assign-hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}
.tk-ov-assign-cta {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}
.tk-ov-assign-cta:hover {
  text-decoration: underline;
}

.tk-team-actor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--tk-radius-field);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.tk-team-actor-label {
  font-size: 13px;
  font-weight: 650;
  color: #475569;
  margin: 0;
}
.tk-team-actor-select {
  min-width: 200px;
  flex: 1;
  max-width: 320px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  cursor: pointer;
}
.tk-team-actor-select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tk-ov-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: #475569;
  font-size: 14px;
}

.tk-ov-desc {
  font-size: 16px;
  line-height: 1.7;
  color: #111827;
  white-space: pre-wrap;
}

.tk-ov-foot {
  padding: 16px 28px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fafbfc;
  flex-shrink: 0;
}

.tk-ov-textarea {
  width: 100%;
  min-height: 104px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  background: #fff;
  transition: border-color 160ms ease-out, box-shadow 200ms ease-out;
}
.tk-ov-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 8px 24px rgba(15, 23, 42, 0.08);
}

.tk-ov-foot-hint {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}
.tk-ov-foot-hint strong {
  color: #475569;
  font-weight: 650;
}

.tk-ov-pill--action {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}
.tk-ov-pill--action:hover {
  color: #1e40af;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}

.tk-ov-footrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.tk-ov-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
}

.tk-ov-pill {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease-out, color 160ms ease-out, transform 140ms ease-out, box-shadow 160ms ease-out;
}
.tk-ov-pill:hover {
  color: #334155;
  transform: translateY(-1px);
}
.tk-ov-pill.is-active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.tk-ov-pill.is-active:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.tk-ov-send {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: filter 160ms ease-out, transform 140ms ease-out, box-shadow 160ms ease-out;
}
.tk-ov-send:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.tk-ov-send:active {
  transform: translateY(0);
}

.tk-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.tk-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.22s var(--tk-ease), transform 0.22s var(--tk-ease), visibility 0.22s var(--tk-ease);
  z-index: 1410;
}

/* E-Mail-Composer über Ticket-Overlay (#tkOverlay z-index 1500) */
.tk-email-reply-backdrop {
  z-index: 1600;
}
.tk-email-reply-modal {
  z-index: 1610;
}
.tk-email-reply-card {
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}
.tk-email-reply-card .tk-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.tk-email-reply-lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #475569;
}
.tk-email-smtp-warn {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.65);
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.45;
}
.tk-email-field {
  margin-bottom: 0.85rem;
}
.tk-email-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.tk-email-input,
.tk-email-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
}
.tk-email-input--readonly {
  background: #f8fafc;
  color: #475569;
}
.tk-email-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
}
.tk-email-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tk-msg.is-customer-email {
  border-left: 3px solid #2563eb;
  padding-left: 10px;
  margin-left: -4px;
}
.tk-msg.is-customer-email .tk-msg-mode {
  color: #1d4ed8;
  font-weight: 650;
}

.tk-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tk-modal-card {
  width: min(460px, 100%);
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.06),
    0 28px 70px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.tk-modal-head {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tk-modal-title {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.tk-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: none;
  background: rgba(15, 23, 42, 0.04);
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s var(--tk-ease-soft), color 0.18s var(--tk-ease-soft), transform 0.15s var(--tk-ease-soft);
}
.tk-modal-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
.tk-modal-close:active { transform: scale(0.96); }

.tk-modal-body {
  padding: 6px 18px 16px;
  display: grid;
  gap: 12px;
}

.tk-field {
  display: grid;
  gap: 6px;
}
.tk-field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}
.tk-field-req {
  color: #b91c1c;
  font-weight: 700;
}
.tk-field-input {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  font-size: 0.9375rem;
  color: #0f172a;
  font-family: inherit;
  transition: border-color 0.18s var(--tk-ease-soft), box-shadow 0.18s var(--tk-ease-soft);
}
.tk-field-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.tk-field-error {
  font-size: 0.875rem;
  color: #b91c1c;
  line-height: 1.35;
}

.tk-modal-foot {
  padding: 14px 18px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.tk-modal-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 650;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.tk-modal-btn-ghost {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
}
.tk-modal-btn-ghost:hover { background: rgba(15, 23, 42, 0.07); }
.tk-modal-btn-primary {
  background: #2563eb;
  color: #ffffff;
}
.tk-modal-btn-primary:hover { filter: brightness(1.05); }
.tk-modal-btn-danger {
  background: #b91c1c;
  color: #ffffff;
}
.tk-modal-btn-danger:hover { filter: brightness(1.05); }

.tk-confirm-text {
  font-size: 1rem;
  line-height: 1.55;
  color: #475569;
  padding: 4px 0 2px;
}

/* Chat thread – Message Cards (Overlay + ggf. anderswo) */
.tk-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tk-msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.tk-msg.is-internal {
  align-self: flex-start;
  max-width: min(92%, 520px);
}

.tk-msg.is-email {
  align-self: flex-end;
  max-width: min(92%, 520px);
}

.tk-msg.is-system {
  align-self: flex-start;
  max-width: 100%;
}

.tk-msg-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.tk-msg.is-email .tk-msg-meta {
  justify-content: flex-end;
  text-align: right;
}

.tk-msg-meta strong {
  color: #475569;
  font-weight: 650;
}

.tk-msg-mode {
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  color: #94a3b8;
}

.tk-msg-secondary {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-msg-actor {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.tk-msg-dot {
  opacity: 0.75;
}

.tk-msg-bubble {
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #0f172a;
  white-space: pre-wrap;
  border: 1px solid transparent;
}

.tk-msg.is-internal .tk-msg-bubble {
  background: #f1f3f5;
  border-color: rgba(15, 23, 42, 0.06);
}

.tk-msg.is-email .tk-msg-bubble {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.14);
}

.tk-msg.is-system .tk-msg-bubble {
  background: #ffffff;
  color: #475569;
  border-color: rgba(15, 23, 42, 0.06);
}

/* Konversation leer */
.tk-thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px 20px;
  min-height: 120px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.6);
}

.tk-thread-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #e8ecf4, #f4f6f9);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: #64748b;
}
.tk-thread-empty-icon svg {
  display: block;
}

.tk-thread-empty-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: #334155;
  margin-bottom: 6px;
}

.tk-thread-empty-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
  max-width: 280px;
}

.tk-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}

.tk-hero h1 {
  font-size: clamp(1.625rem, 2.5vw, 1.875rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text-primary, #0f172a);
  margin: 0 0 0.65rem;
  line-height: 1.2;
}

.tk-hero p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary, #64748b);
  max-width: 36rem;
  line-height: 1.6;
}

.tk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tk-btn-primary {
  background: var(--accent, #2563eb);
  color: #fff;
}
.tk-btn-primary:hover {
  filter: brightness(1.05);
}

.tk-btn-ghost {
  background: var(--bg-1, #f8fafc);
  border-color: var(--separator-subtle, #e2e8f0);
  color: var(--text-primary, #0f172a);
}
.tk-btn-ghost:hover {
  background: var(--hover-bg, #f1f5f9);
}

.tk-btn-sm {
  min-height: 34px;
  padding: 0 0.65rem;
  font-size: 0.8125rem;
  border-radius: 8px;
}

.tk-seg {
  display: inline-flex;
  border: 1px solid var(--separator-subtle, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-0, #fff);
}

.tk-seg button {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  font-family: inherit;
}
.tk-seg button.active {
  background: var(--accent-dim, rgba(37, 99, 235, 0.12));
  color: var(--accent, #2563eb);
  font-weight: 600;
}

.tk-mail-banner {
  margin-bottom: 1.5rem;
  border-radius: var(--tk-radius-field);
  padding: 0.75rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.875rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.tk-mail-banner.success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.tk-mail-banner.warn {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.tk-mail-banner.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.tk-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.75rem;
}

@media (min-width: 720px) {
  .tk-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1000px) {
  .tk-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }
}

.tk-stat {
  border: 1px solid rgba(15, 23, 42, 0.055);
  border-radius: var(--tk-radius-card);
  padding: 1rem 1.1rem;
  background: #ffffff;
  box-shadow: var(--tk-shadow-card);
  transition:
    transform 0.22s var(--tk-ease),
    box-shadow 0.22s var(--tk-ease),
    border-color 0.22s var(--tk-ease),
    background-color 0.22s var(--tk-ease);
  cursor: pointer;
  user-select: none;
}
.tk-stat:hover {
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: var(--tk-shadow-card-hover);
  transform: translateY(-2px);
}
.tk-stat:active {
  transform: translateY(-1px);
  transition-duration: 0.12s;
}
.tk-stat.is-active {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.12),
    var(--tk-shadow-card);
}
.tk-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.tk-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.tk-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .tk-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.tk-search {
  flex: 1;
  min-width: 200px;
}
.tk-search input {
  width: 100%;
  min-height: 46px;
  border-radius: var(--tk-radius-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0 1rem;
  font-size: 0.9375rem;
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s var(--tk-ease-soft), box-shadow 0.2s var(--tk-ease-soft);
}

.tk-search input:hover {
  border-color: rgba(15, 23, 42, 0.11);
}

.tk-search input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.tk-filters select {
  min-height: 46px;
  border-radius: var(--tk-radius-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0 0.85rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: var(--text-primary);
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
  transition: border-color 0.2s var(--tk-ease-soft), box-shadow 0.2s var(--tk-ease-soft);
}

.tk-filters select:hover {
  border-color: rgba(15, 23, 42, 0.12);
}

.tk-filters select.tk-filter--active,
.tk-search input.tk-filter--active {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.tk-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.25rem;
  min-height: 1.5rem;
}
.tk-active-filters:empty {
  display: none;
}
.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: var(--text-secondary, #64748b);
  font-size: 0.8125rem;
  line-height: 1.35;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tk-chip strong {
  color: var(--text-primary, #0f172a);
  font-weight: 650;
}
.tk-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}
.tk-chip button:hover {
  color: var(--text-primary, #0f172a);
}

.tk-board-toggle {
  margin-left: auto;
}

.tk-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tk-card {
  border: 1px solid var(--separator-subtle, #e2e8f0);
  border-radius: var(--tk-radius-card);
  padding: 1rem 1.1rem;
  background: var(--bg-1, #ffffff);
  box-shadow: var(--tk-shadow-card);
  display: grid;
  gap: 0.65rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.tk-card:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--tk-shadow-card);
}
.tk-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--tk-shadow-card-hover);
}

.tk-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.tk-card-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.tk-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.tk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tk-badge-st-offen {
  background: #eff6ff;
  color: #1d4ed8;
}
.tk-badge-st-bearbeitung {
  background: #fef3c7;
  color: #b45309;
}
.tk-badge-st-wartet {
  background: #f1f5f9;
  color: #475569;
}
.tk-badge-st-pausiert {
  background: #ede9fe;
  color: #5b21b6;
}
.tk-badge-st-erledigt {
  background: #ecfdf5;
  color: #047857;
}
.tk-badge-st-geschlossen {
  background: #f1f5f9;
  color: #475569;
}

.tk-badge-pr-niedrig {
  background: #f8fafc;
  color: #64748b;
}
.tk-badge-pr-mittel {
  background: #eff6ff;
  color: #2563eb;
}
.tk-badge-pr-hoch {
  background: #ffedd5;
  color: #c2410c;
}
.tk-badge-pr-dringend {
  background: #fee2e2;
  color: #b91c1c;
}

/* —— List feed: Premium-Zeilen (Linear / Apple-nah) —— */
.tk-feed-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .tk-feed-wrap {
    gap: 16px;
  }
}

.tk-feed-skel {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-secondary, #64748b);
  border-radius: var(--tk-radius-card);
  border: 1px dashed rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.tk-card-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: block;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--tk-radius-card);
  box-shadow: var(--tk-shadow-card);
  padding: 20px 22px;
  transition:
    transform 0.22s var(--tk-ease),
    box-shadow 0.28s var(--tk-ease),
    border-color 0.22s var(--tk-ease),
    background-color 0.22s var(--tk-ease);
  position: relative;
  z-index: 0;
}

/* Mehr-Menü: nachfolgende Karten liegen sonst im Paint-Order darüber (Geschwister-Stacking) */
.tk-card-row:has(.tk-row-more-btn[aria-expanded='true']) {
  z-index: 200;
}

@media (min-width: 768px) {
  .tk-card-row {
    padding: 21px 24px;
  }
}

.tk-card-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--tk-shadow-card-hover);
  border-color: rgba(15, 23, 42, 0.085);
}

.tk-card-row:active {
  transform: translateY(-1px);
  transition-duration: 0.12s;
}

.tk-card-row:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.2),
    var(--tk-shadow-card);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Top-align: wirkt wie Karten-Stack, nicht wie Tabellenzeilen */
.tk-card-row-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.85fr) auto;
  gap: 22px 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .tk-card-row-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }
  .tk-card-row-aside {
    flex-direction: row !important;
    justify-content: space-between;
    width: 100%;
    align-items: center;
  }
  .tk-card-row-date {
    text-align: left !important;
  }
}

.tk-card-row-main {
  min-width: 0;
}

.tk-card-row-title {
  margin: 0 0 10px;
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.tk-card-row-preview {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-card-row-meta {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
}

.tk-card-row-meta .tk-meta-sep {
  color: #cbd5e1;
  user-select: none;
}

.tk-meta-name {
  font-weight: 500;
  color: #475569;
}

@media (hover: none) {
  .tk-row-more-btn {
    opacity: 0.75;
  }
}

.tk-meta-mail {
  color: inherit;
  text-decoration: none;
  font-weight: 450;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tk-meta-mail:hover {
  color: #2563eb;
  border-bottom-color: rgba(37, 99, 235, 0.35);
}

.tk-card-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
  padding-top: 2px;
}

.tk-card-row-badges .tk-badge {
  padding: 7px 12px;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: 999px;
}

.tk-assignee-pill {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-card-row-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 2px;
}

.tk-card-row-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tk-row-more-wrap {
  position: relative;
}

.tk-row-more-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  opacity: 0.55;
  transition:
    opacity 0.2s var(--tk-ease-soft),
    background 0.2s var(--tk-ease-soft),
    border-color 0.2s var(--tk-ease-soft),
    color 0.2s var(--tk-ease-soft),
    box-shadow 0.2s var(--tk-ease-soft);
}

.tk-card-row:hover .tk-row-more-btn {
  opacity: 0.95;
  color: #64748b;
  border-color: rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.95);
}

.tk-row-more-btn:hover {
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.tk-row-more-btn:focus-visible {
  opacity: 1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.tk-row-more-btn[aria-expanded="true"] {
  opacity: 1;
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}

.tk-row-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 228px;
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--tk-radius-field);
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.06),
    0 24px 56px rgba(15, 23, 42, 0.1);
  z-index: 300;
}

.tk-row-menu[hidden] {
  display: none !important;
}

.tk-row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--tk-ease-soft);
}

.tk-row-menu-item:hover {
  background: #f1f5f9;
}

.tk-row-menu-item--danger {
  color: #b91c1c;
}

.tk-row-menu-item--danger:hover {
  background: #fef2f2;
}

/* Löschen: nur im More-Menü, dezenter Abstand zur Liste darüber */
.tk-row-menu .tk-row-menu-item--danger {
  margin-top: 2px;
}

.tk-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.tk-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.tk-card-preview {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tk-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--separator-subtle);
}

.tk-card-actions .tk-open-detail {
  font-weight: 600;
}

.tk-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(6, 118, 71, 0.08);
  border: 1px solid rgba(6, 118, 71, 0.18);
  color: #067647;
  font-size: 0.78rem;
  font-weight: 650;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.tk-save-indicator--detail {
  margin-left: 0.4rem;
  margin-right: 0.25rem;
}
.tk-save-indicator.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tk-save-indicator::before {
  content: '✓';
  font-weight: 900;
}

.tk-assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.tk-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 750;
  background: rgba(37, 99, 235, 0.10);
  color: rgba(37, 99, 235, 1);
  border: 1px solid rgba(37, 99, 235, 0.18);
}
.tk-avatar.tk-avatar--empty {
  background: transparent;
  color: var(--text-secondary, #64748b);
  border-color: var(--separator-subtle, #e2e8f0);
  font-weight: 650;
}

/* Loading skeletons (Enterprise feel) */
.tk-skel {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0.08) 40%, rgba(148, 163, 184, 0.16) 70%);
  background-size: 240% 100%;
  animation: tkShimmer 1.15s ease-in-out infinite;
}
@keyframes tkShimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 120% 0; }
}
.tk-card.is-loading {
  cursor: default;
  pointer-events: none;
}
.tk-card.is-loading .tk-card-title,
.tk-card.is-loading .tk-card-preview,
.tk-card.is-loading .tk-badges,
.tk-card.is-loading .tk-card-meta,
.tk-card.is-loading .tk-card-actions {
  opacity: 0.65;
}
.tk-skel-line {
  height: 10px;
  margin: 0.35rem 0;
}
.tk-skel-line.lg { height: 14px; }
.tk-skel-line.sm { height: 8px; }

.tk-kanban {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.tk-kanban .tk-col {
  flex: 0 0 min(260px, 82vw);
  scroll-snap-align: start;
}

.tk-col {
  border: 1px solid var(--separator-subtle);
  border-radius: 14px;
  background: var(--bg-1, #f8fafc);
  padding: 0.85rem;
  min-height: 200px;
}

.tk-col-head {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-secondary);
  margin: 0 0 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tk-col-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}
.tk-col-list.tk-drag-over {
  outline: 2px dashed var(--accent, #2563eb);
  outline-offset: 2px;
  border-radius: 10px;
}
.tk-col-empty {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.5rem;
}
.tk-col-count {
  opacity: 0.65;
  font-weight: 500;
}

.tk-mini-card {
  border-radius: 10px;
  border: 1px solid var(--separator-subtle);
  background: var(--bg-0);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
}
.tk-mini-card strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.tk-empty {
  text-align: center;
  padding: 3rem 2rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--tk-radius-card);
  background: #ffffff;
  box-shadow: var(--tk-shadow-card);
}
.tk-empty h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.tk-empty p {
  margin: 0;
  color: #64748b;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

/* Detail modal */
#ticketDetailModal .modal-content {
  max-width: 920px;
  width: 96vw;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}

.tk-detail-scroll {
  overflow-y: auto;
  padding: 0 1.25rem 1rem;
  flex: 1;
}

.tk-detail-head {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--separator-subtle);
}

.tk-detail-title {
  font-size: 1.2rem;
  font-weight: 650;
  margin: 0 0 0.75rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.tk-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tk-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .tk-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .tk-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tk-meta-item label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.tk-meta-item div {
  font-size: 0.88rem;
  color: var(--text-primary);
  word-break: break-word;
}

.tk-block {
  margin-top: 1.25rem;
}
.tk-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tk-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg-1, #f8fafc);
  border: 1px solid var(--separator-subtle);
}

.tk-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tk-tl-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: flex-start;
}

.tk-tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: #cbd5e1;
}
.tk-tl-item.comment .tk-tl-dot {
  background: var(--accent, #2563eb);
}
.tk-tl-item.system .tk-tl-dot {
  background: #94a3b8;
}

.tk-tl-body {
  border: 1px solid var(--separator-subtle);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-0);
}

.tk-tl-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.tk-tl-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tk-tl-text {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.tk-comment-box {
  margin-top: 0.5rem;
}
.tk-comment-box textarea {
  width: 100%;
  min-height: 88px;
  border-radius: 12px;
  border: 1px solid var(--separator-subtle);
  padding: 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-0);
  color: var(--text-primary);
}

.tk-detail-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--separator-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg-1);
}

.tk-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.tk-quick-row label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.tk-quick-row select {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--separator-subtle);
  padding: 0 0.5rem;
  font-size: 0.85rem;
  background: var(--bg-0);
  color: var(--text-primary);
}

.tk-spacer {
  flex: 1;
}

/* Create modal – calmer */
#ticketModal .form-group label {
  font-weight: 500;
  font-size: 0.85rem;
}
#ticketModal input[type='email']:not([required]) {
  /* optional email */
}

.hidden {
  display: none !important;
}

/* —— Composer + Side Panel —— */
.tk-composer {
  margin-bottom: 1.75rem;
}
.tk-composer-input {
  width: 100%;
  max-width: 640px;
  padding: 1rem 1.15rem;
  font-size: 1rem;
  line-height: 1.45;
  border-radius: var(--tk-radius-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  box-shadow: var(--tk-shadow-card);
  transition: border-color 0.2s var(--tk-ease-soft), box-shadow 0.25s var(--tk-ease);
}
.tk-composer-input:hover {
  border-color: rgba(15, 23, 42, 0.11);
}
.tk-composer-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.14),
    0 14px 40px rgba(15, 23, 42, 0.07);
}

.tk-hero-hint {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary, #64748b);
  max-width: 52rem;
}
.tk-hero-hint a {
  color: var(--accent, #2563eb);
  text-underline-offset: 2px;
}

.tk-composer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  max-width: 720px;
}
.tk-composer-cat {
  flex: 0 0 auto;
  min-width: 11rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  border-radius: var(--tk-radius-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  font-family: inherit;
  color: var(--text-primary, #0f172a);
}
.tk-composer-row .tk-composer-input {
  flex: 1 1 220px;
  max-width: none;
}

.tk-pager {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(248, 250, 252, 0.9);
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
}
.tk-pager[hidden] {
  display: none !important;
}
.tk-pager-info {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.tk-pager-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.tk-pager-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary, #0f172a);
}
.tk-pager-btn:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent, #2563eb);
}
.tk-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tk-cat-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.tk-ov-category-row {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.tk-ov-cat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}
.tk-ov-select--inline {
  max-width: 280px;
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
}

/* (Removed) Old slide-in side panel / drawer styles – replaced by centered overlay */

.tk-table-scroll {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--separator-subtle);
  background: var(--bg-0);
}
.tk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.tk-th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-weight: 650;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--separator-subtle);
  background: var(--bg-1, #f8fafc);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tk-th--sort {
  color: var(--accent, #2563eb);
}
.tk-th-actions {
  cursor: default;
  text-align: right;
}
.tk-td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--separator-subtle);
  vertical-align: middle;
}
.tk-td-muted {
  color: var(--text-secondary);
  white-space: nowrap;
}
.tk-td-actions {
  text-align: right;
  white-space: nowrap;
}
.tk-td-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  font-size: inherit;
  font-family: inherit;
  max-width: 280px;
}
.tk-td-link:hover {
  color: var(--accent, #2563eb);
}
.tk-person-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent, #2563eb);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
}
.tk-person-link:disabled {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: default;
}

.tk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 0.1rem;
  border: 1px solid var(--separator-subtle);
  border-radius: 8px;
  background: var(--bg-1);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.tk-icon-btn:hover {
  background: var(--hover-bg, #f1f5f9);
}

.tk-mini-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.tk-mini-actions {
  display: flex;
  gap: 0.2rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--separator-subtle);
}
.tk-mini-actions .tk-icon-btn {
  width: 28px;
  height: 28px;
  margin: 0;
  font-size: 0.75rem;
}

.tk-mini-card[draggable='true'] {
  cursor: grab;
}
.tk-mini-card[draggable='true']:active {
  cursor: grabbing;
}

/* (Removed) Old product side panel section – replaced by centered overlay */
