:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #eef1eb;
  --surface-3: #f9faf7;
  --line: #d8ddd2;
  --ink: #20242a;
  --muted: #66716b;
  --teal: #0f766e;
  --teal-2: #dcefeb;
  --blue: #2563a8;
  --blue-2: #dce7f5;
  --amber: #a76813;
  --amber-2: #f5e4c5;
  --red: #b42318;
  --red-2: #f7d8d4;
  --green: #287047;
  --green-2: #dff0e6;
  --purple: #6d4aa1;
  --purple-2: #eee5f7;
  --shadow: 0 18px 42px rgba(25, 31, 36, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.42rem, 2vw, 2.1rem);
  line-height: 1.1;
}

h2 {
  font-size: 1.12rem;
}

h3 {
  font-size: 0.98rem;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(37, 99, 168, 0.12), transparent 38%),
    var(--bg);
}

.login-panel {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand {
  padding-bottom: 6px;
}

.login-brand strong,
.brand strong {
  display: block;
  font-size: 1.08rem;
}

.login-brand span,
.brand span,
.label,
.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
}

.login-hint {
  display: flex;
  justify-content: space-between;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: #17201f;
  color: #f8faf7;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #26433e;
  color: #dff7ef;
  font-weight: 800;
}

.brand-mark.large {
  width: 54px;
  height: 54px;
  border-color: var(--line);
}

.sidebar .brand span,
.sidebar-foot .label {
  color: #b8c6c1;
}

.nav {
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  width: 100%;
  min-height: 39px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  color: #dbe6e1;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: #284943;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-foot .label {
  display: block;
  margin-bottom: 4px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 241, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.global-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.global-timer-clock {
  display: grid;
  justify-items: start;
  min-width: 72px;
}

.global-timer-clock span {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 850;
}

.global-timer-clock small {
  color: var(--muted);
  font-size: 0.7rem;
}

.global-timer-summary {
  display: grid;
  min-width: 0;
}

.global-timer-summary strong,
.global-timer-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-timer-summary strong {
  font-size: 0.78rem;
}

.global-timer-summary span {
  color: var(--muted);
  font-size: 0.72rem;
}

.view {
  padding: 22px 24px 38px;
}

.ticket-tabs-shell {
  position: sticky;
  top: 86px;
  z-index: 8;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 241, 0.94);
  backdrop-filter: blur(12px);
}

.ticket-tabs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 10px 24px;
  overflow-x: auto;
}

.ticket-tab {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto 28px;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
  max-width: 380px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ticket-tab.active {
  border-color: #8bb7ad;
  background: #edf6f3;
  box-shadow: 0 8px 22px rgba(23, 28, 35, 0.08);
}

.ticket-tab-main {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.ticket-tab-main strong,
.ticket-tab-main span,
.ticket-tab-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-tab-main strong {
  font-size: 0.76rem;
}

.ticket-tab-main span {
  font-size: 0.8rem;
  font-weight: 750;
}

.ticket-tab-main small {
  color: var(--muted);
  font-size: 0.7rem;
}

.ticket-tab-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
}

.ticket-tab-close:hover {
  border-color: #efb5af;
  background: var(--red-2);
  color: var(--red);
}

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.field.compact {
  min-width: 134px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #c8d0c5;
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.segmented button {
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 12px;
  font-weight: 650;
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.secondary-button {
  border-color: #cbd4c8;
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  background: transparent;
  color: var(--teal);
}

.danger-button {
  border-color: #efb5af;
  background: var(--red-2);
  color: var(--red);
}

.wide {
  width: 100%;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  padding: 0;
  border-color: #cbd4c8;
  background: #fff;
  color: var(--ink);
  font-size: 1.12rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(138px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.kpi:hover {
  border-color: #9eb9b1;
  box-shadow: 0 8px 24px rgba(23, 28, 35, 0.08);
}

.kpi span,
.kpi small {
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi strong {
  font-size: 1.75rem;
  line-height: 1;
}

.split-layout,
.settings-grid,
.api-layout,
.people-layout,
.customer-layout,
.time-layout,
.integration-layout,
.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.report-grid,
.mail-grid,
.calendar-grid,
.mini-grid {
  display: grid;
  gap: 12px;
}

.report-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.mail-grid,
.mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-grid {
  grid-template-columns: repeat(5, minmax(190px, 1fr));
}

.split-layout > *,
.settings-grid > *,
.api-layout > *,
.people-layout > *,
.customer-layout > *,
.time-layout > *,
.integration-layout > *,
.knowledge-layout > *,
.report-grid > *,
.mail-grid > *,
.calendar-grid > *,
.mini-grid > * {
  min-width: 0;
}

.panel,
.detail-panel,
.item-card,
.mail-card,
.setting-card,
.calendar-day,
.report-card,
.time-card,
.module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-head,
.detail-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-body,
.detail-body,
.card-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}

.toolbar-group,
.mail-meta,
.card-actions,
.button-row,
.chip-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.segmented button {
  min-width: 92px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active,
.segmented button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ticket-table-wrap,
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.ticket-table,
.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.data-table.compact {
  min-width: 680px;
}

.ticket-table th,
.ticket-table td,
.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 0.82rem;
}

.ticket-table th,
.data-table th {
  color: var(--muted);
  background: var(--surface-3);
  font-size: 0.75rem;
  font-weight: 750;
}

.ticket-row {
  cursor: pointer;
}

.ticket-row:hover,
.ticket-row.selected {
  background: #eef4f1;
}

.ticket-title-cell {
  max-width: 310px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill,
.score,
.mini-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
}

.pill.low {
  background: var(--green-2);
  color: var(--green);
}

.pill.medium {
  background: var(--blue-2);
  color: var(--blue);
}

.pill.high {
  background: var(--amber-2);
  color: var(--amber);
}

.pill.critical,
.pill.overdue {
  background: var(--red-2);
  color: var(--red);
}

.pill.neutral {
  background: #eceff1;
  color: #4b5563;
}

.pill.purple {
  background: var(--purple-2);
  color: var(--purple);
}

.score {
  min-width: 44px;
  background: #16201d;
  color: #fff;
}

.score.warn {
  background: var(--amber);
}

.score.hot {
  background: var(--red);
}

.progress {
  position: relative;
  display: block;
  width: 92px;
  height: 8px;
  border-radius: 999px;
  background: #e2e6df;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.detail-panel {
  overflow: hidden;
}

.meta-grid,
.form-grid,
.inline-edit,
.module-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.meta-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.solution-list,
.comment-list,
.time-list,
.activity-list,
.mail-list,
.settings-list,
.article-list {
  display: grid;
  gap: 10px;
}

.solution-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.solution-item.done {
  border-color: #b9d6c6;
  background: var(--green-2);
}

.solution-item input {
  width: 18px;
  height: 18px;
}

.comment-item,
.time-entry,
.activity-item,
.item-card,
.mail-card,
.module-card,
.calendar-day,
.report-card,
.time-card,
.setting-card {
  padding: 14px;
}

.comment-item,
.time-entry,
.activity-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.comment-item header,
.time-entry header,
.activity-item header,
.item-card header,
.mail-card header,
.module-card header,
.calendar-day header,
.report-card header,
.time-card header,
.setting-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.comment-item header,
.time-entry header,
.activity-item header {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.subtle {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(23, 28, 35, 0.28);
}

#timeDrawerBackdrop {
  background: rgba(23, 28, 35, 0.10);
  opacity: 0;
  transition: opacity 170ms ease;
}

#timeDrawerBackdrop.open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(600px, 100vw);
  height: 100vh;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.time-drawer {
  top: 74px;
  right: 18px;
  width: min(430px, calc(100vw - 24px));
  height: auto;
  max-height: min(760px, calc(100vh - 96px));
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top right;
  transition: opacity 170ms ease, transform 170ms ease;
}

.time-drawer.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.time-drawer-body {
  display: grid;
  gap: 10px;
}

.drawer-panel {
  display: grid;
  gap: 16px;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
}

.time-drawer .drawer-panel {
  max-height: min(760px, calc(100vh - 96px));
  padding: 16px;
}

.time-drawer .drawer-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.drawer-head,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.draft-preview {
  padding: 12px;
  border: 1px solid #b9d6c6;
  border-radius: var(--radius);
  background: var(--green-2);
}

.check-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 0.84rem;
}

.calendar-day {
  min-height: 220px;
}

.calendar-items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.calendar-item {
  padding: 9px;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: #eef4f1;
  font-size: 0.82rem;
}

.calendar-item.due {
  border-left-color: var(--amber);
  background: var(--amber-2);
}

.timer-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.timer-clock {
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 800;
}

.segment-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.segment-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.bar {
  display: grid;
  grid-template-columns: 108px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e3e8df;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.endpoint-card {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  font-size: 0.82rem;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: var(--radius);
  color: #fff;
  background: #1f2937;
  font-size: 0.74rem;
  font-weight: 800;
}

.method.post {
  background: var(--teal);
}

.method.get {
  background: var(--blue);
}

.method.patch {
  background: var(--amber);
}

.method.delete {
  background: var(--red);
}

.code-box {
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #17201f;
  color: #e5f4ee;
  font: 0.78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid #b9d6c6;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

@media (max-width: 1240px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .split-layout,
  .settings-grid,
  .api-layout,
  .people-layout,
  .customer-layout,
  .time-layout,
  .integration-layout,
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .calendar-grid,
  .report-grid,
  .mail-grid,
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-tabs-shell {
    position: static;
  }

  .ticket-tabs {
    padding: 10px 16px;
  }

  .ticket-tab {
    grid-template-columns: minmax(160px, 1fr) auto 28px;
    max-width: 320px;
  }

  .topbar-actions,
  .toolbar,
  .panel-head,
  .detail-head,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-grid,
  .calendar-grid,
  .report-grid,
  .mail-grid,
  .mini-grid,
  .form-grid,
  .inline-edit,
  .meta-grid,
  .module-checks {
    grid-template-columns: 1fr;
  }

  .view {
    padding: 16px;
  }

  .field.compact {
    min-width: 100%;
  }

  .global-timer,
  .global-timer-clock {
    width: 100%;
  }

  .global-timer {
    max-width: none;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    min-width: 0;
    flex: 1;
    padding: 0 8px;
  }

  .endpoint-card {
    grid-template-columns: 1fr;
  }
}

/* QX.service 1.1 Ticket-Arbeitsbereich */
.ticket-tabs-shell {
  box-shadow: 0 8px 18px rgba(23, 28, 35, 0.04);
}

.ticket-tabs-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 24px 0;
}

.ticket-tabs-header div:first-child {
  display: grid;
  gap: 2px;
}

.ticket-tabs-header span {
  color: var(--muted);
  font-size: 0.76rem;
}

.compact-actions .ghost-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.ticket-tab {
  grid-template-columns: minmax(190px, 280px) auto 28px;
}

.ticket-tab.has-timer {
  border-color: #93c5b8;
}

.ticket-tab-badges {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.ticket-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.ticket-list-panel,
.ticket-workspace {
  min-width: 0;
}

.ticket-toolbar {
  align-items: flex-end;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ticket-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 12px;
  padding: 14px;
  overflow-x: auto;
}

.ticket-board-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 420px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.ticket-board-column > header,
.ticket-work-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.ticket-board-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.ticket-work-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.ticket-work-card:hover,
.ticket-work-card.selected {
  border-color: #8bb7ad;
  background: #eef6f3;
  box-shadow: 0 8px 20px rgba(23, 28, 35, 0.06);
}

.ticket-work-card h3 {
  line-height: 1.25;
}

.compact-empty {
  padding: 14px;
}

.ticket-workspace-head {
  align-items: flex-start;
}

.ticket-workspace-head h2 {
  margin-bottom: 4px;
  line-height: 1.25;
}

.ticket-head-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.ticket-quick-actions {
  justify-content: flex-end;
}

.detail-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  overflow-x: auto;
}

.detail-tabs button {
  min-width: 96px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.detail-tabs button.active,
.detail-tabs button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.wide-edit {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.no-pad-head {
  padding: 0 0 10px;
  border-bottom: 0;
}

.description-card p {
  white-space: pre-wrap;
}

.time-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e6df;
}

.time-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-card {
  padding: 10px;
}

.related-ticket {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--ink);
  text-align: left;
}

.related-ticket:hover {
  border-color: #8bb7ad;
  background: #eef6f3;
}

.related-ticket span,
.related-ticket small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-list {
  position: relative;
}

.timeline-list .activity-item {
  border-left: 4px solid var(--teal);
}

@media (max-width: 1380px) {
  .ticket-workbench {
    grid-template-columns: 1fr;
  }

  .ticket-board {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  .ticket-tabs-header,
  .ticket-toolbar,
  .ticket-workspace-head,
  .ticket-head-actions,
  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-tabs-header {
    padding: 8px 16px 0;
  }

  .ticket-board {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .ticket-board-column {
    min-height: auto;
  }

  .wide-edit,
  .item-grid {
    grid-template-columns: 1fr;
  }

  .ticket-quick-actions,
  .ticket-head-actions {
    justify-items: stretch;
    justify-content: stretch;
  }
}


.compact-timer-button {
  min-height: 34px;
  padding-inline: 12px;
}

.compact-time-menu {
  animation: timeMenuIn 180ms ease both;
}

@keyframes timeMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.compact-timer-box {
  gap: 9px;
  padding: 12px;
}

.compact-timer-box.is-active {
  border-color: rgba(50, 113, 102, 0.42);
  background: linear-gradient(135deg, rgba(228, 241, 235, 0.95), var(--surface-3));
}

.compact-timer-box.is-stopped {
  border-color: rgba(192, 119, 48, 0.42);
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.95), var(--surface-3));
}

.timer-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timer-topline > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.timer-topline strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(32, 42, 52, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.compact-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.stacked-form {
  display: grid;
  gap: 10px;
}

.inline-pair {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) 1fr;
  gap: 10px;
}

.booking-card,
.manual-card,
.recent-card {
  padding: 12px;
}

.attention-card {
  border-color: rgba(192, 119, 48, 0.32);
  background: rgba(255, 249, 235, 0.84);
}

.compact-list {
  max-height: 210px;
  overflow-y: auto;
}

.compact-list .time-entry {
  padding: 9px;
}

@media (max-width: 720px) {
  .time-drawer {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 16px);
  }

  .time-drawer .drawer-panel {
    max-height: calc(100vh - 16px);
  }

  .inline-pair {
    grid-template-columns: 1fr;
  }
}

/* QX.service 1.3 Erweiterungen */
.pinned-ticket-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px 0;
}

.pinned-ticket {
  min-width: 190px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffdf8, #fff);
  color: var(--ink);
  text-align: left;
}

.pinned-ticket.active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.pinned-ticket em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
}

.inbox-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.inbox-columns h3 {
  margin-bottom: 10px;
}

.inbox-list {
  display: grid;
  gap: 12px;
  padding: 0 !important;
}

.inbox-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.inbox-card:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 10px 22px rgba(25, 31, 36, 0.09);
}

.wrap-actions {
  flex-wrap: wrap;
}

.extended-people-layout {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.permission-panel {
  grid-column: 1 / -1;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 14px;
}

.permission-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.permission-card header,
.permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.permission-editor {
  align-self: start;
}

.permission-checks {
  display: grid;
  gap: 10px;
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.permission-fieldset {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.permission-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.command-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(23, 32, 31, 0.36);
  opacity: 0;
  transition: opacity 140ms ease;
}

.command-palette-backdrop.open {
  opacity: 1;
}

.command-palette {
  position: fixed;
  top: 9vh;
  left: 50%;
  z-index: 61;
  width: min(720px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0,0,0,0.26);
  transform: translate(-50%, -10px) scale(0.98);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
}

.command-palette.open {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.command-search-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}

.command-search-row span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.command-search-row input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
}

.command-results {
  max-height: 58vh;
  overflow: auto;
  padding: 8px;
}

.command-item {
  width: 100%;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.command-item:hover,
.command-item.active {
  background: var(--teal-2);
}

.command-item span {
  grid-row: span 2;
  align-self: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.command-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .inbox-layout,
  .inbox-columns,
  .extended-people-layout {
    grid-template-columns: 1fr;
  }
}
