:root {
  --brand-primary: #1f2a37;
  --brand-secondary: #0f172a;
  --brand-accent: #f28c28;
  --surface-1: #f7f9fc;
  --surface-2: #ffffff;
  --text-main: #111827;
}

.work-report-prompt,
.work-report-created {
  max-width: 760px;
}

.work-report-preview textarea {
  line-height: 1.5;
}

.work-report-preview .form-control-lg {
  border-color: var(--bs-primary);
  background: #fffdf7;
}

html {
  font-size: 15px;
  min-height: 100%;
}

@media (min-width: 992px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100%;
  color: var(--text-main);
  background:
    radial-gradient(1200px 600px at 95% -10%, rgba(242, 140, 40, 0.16), transparent),
    linear-gradient(180deg, #f4f7fb 0%, #ffffff 32%, #f4f7fb 100%);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.top-shell {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.45)),
    linear-gradient(115deg, var(--brand-secondary), var(--brand-primary));
  color: #fff;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-lockup img {
  height: 42px;
  width: auto;
  border-radius: 4px;
}

.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.88);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #fff;
}

.hero-strap {
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.main-shell {
  margin-top: 1.4rem;
}

.ticket-card {
  border: 2px solid rgba(17, 24, 39, 0.14);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  background: var(--surface-2);
}

.ticket-card .card-header {
  background: linear-gradient(180deg, rgba(242, 140, 40, 0.12), rgba(242, 140, 40, 0.03));
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  font-weight: 700;
}

.btn-brand,
.btn-primary {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #1d1d1d;
  font-weight: 700;
}

.btn-brand:hover,
.btn-primary:hover {
  background-color: #ff9f43;
  border-color: #ff9f43;
  color: #101010;
}

.btn-outline-secondary {
  border-color: #9aa3af;
}

.main-shell .card {
  border: 2px solid rgba(17, 24, 39, 0.14);
  border-radius: 14px;
}

.main-shell .card-header {
  border-bottom: 1px solid rgba(17, 24, 39, 0.14);
}

.form-label {
  font-weight: 600;
  color: #26374a;
}

.form-control,
.form-select {
  border: 1.5px solid #c7d2df;
  border-radius: 8px;
  background-color: #fff;
}

.form-control:hover,
.form-select:hover {
  border-color: #98a9bd;
}

.main-shell .form-check:not(.form-switch) {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  margin-top: 0.25rem;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #c7d2df;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.main-shell .form-check:not(.form-switch):hover {
  border-color: rgba(242, 140, 40, 0.65);
  background: rgba(242, 140, 40, 0.04);
}

.main-shell .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border: 2px solid #8fa2b7;
  cursor: pointer;
  flex: 0 0 auto;
}

.main-shell .form-check-input:checked {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

.main-shell .form-check-label {
  cursor: pointer;
  color: #18324a;
  font-weight: 500;
}

.main-shell .list-group-item {
  border-color: rgba(17, 24, 39, 0.12);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus {
  border-color: rgba(242, 140, 40, 0.65);
  box-shadow: 0 0 0 0.24rem rgba(242, 140, 40, 0.2);
}

.table thead th {
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4b5563;
}

.footer-shell {
  margin-top: 2.4rem;
  background: #111827;
  color: #f9fafb;
  font-size: 0.93rem;
}

.footer-shell a {
  color: #ffd19f;
  text-decoration: none;
}

.footer-shell a:hover {
  color: #fff;
  text-decoration: underline;
}

.text-prewrap {
  white-space: pre-wrap;
}

.mail-body {
  margin-top: 0.4rem;
  font-size: 0.97rem;
  line-height: 1.45;
  word-break: break-word;
}

.mail-body img {
  max-width: 100%;
  height: auto;
}

.mail-body table {
  max-width: 100%;
}

.kb-answer-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

.kb-media-section {
  margin-top: 0.6rem;
}

.kb-media-item video {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: #000;
}

.thread-item {
  border: 2px solid rgba(17, 24, 39, 0.2);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
}

.thread-item-internal {
  background: #f8fafc;
  border-color: rgba(71, 85, 105, 0.36);
}

.thread-toggle {
  border: 0;
  background: transparent;
  padding: 1rem;
}

.thread-preview {
  max-height: 18.5em;
  overflow: hidden;
  color: #1f2937;
}

.thread-full {
  padding: 0 1rem 1rem 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-new {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-open {
  background: #e0f2fe;
  color: #0369a1;
}

.status-pending {
  background: #fef3c7;
  color: #b45309;
}

.status-resolved {
  background: #dcfce7;
  color: #15803d;
}

.status-closed {
  background: #e5e7eb;
  color: #374151;
}

.ticket-overview-table td,
.ticket-overview-table th {
  vertical-align: middle;
}

.chip-multi-select-shell {
  border: 2px solid #2f6dff;
  border-radius: 10px;
  background: #fff;
  padding: 0.45rem;
  min-height: 84px;
}

.chip-multi-select-shell:focus-within {
  box-shadow: 0 0 0 0.22rem rgba(47, 109, 255, 0.18);
}

.chip-multi-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 7px;
  background: #e8eef5;
  color: #0f172a;
  font-size: 0.92rem;
}

.chip-tag-remove {
  border: 0;
  background: transparent;
  color: #334155;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.chip-tag-remove:hover {
  color: #0f172a;
}

.customer-rail {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 70vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.customer-rail-item {
  border: 2px solid rgba(17, 24, 39, 0.14);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  text-decoration: none;
  color: #111827;
  background: #fff;
}

.customer-rail-item:hover {
  border-color: rgba(242, 140, 40, 0.55);
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
}

.customer-rail-item.active {
  border-color: var(--brand-accent);
  background: rgba(242, 140, 40, 0.08);
}

.customer-contact-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 0.95fr) minmax(520px, 1.65fr);
  gap: 1rem;
  align-items: stretch;
}

.customer-column {
  min-width: 0;
}

.customer-column .ticket-card {
  min-height: 72vh;
}

.contact-rail {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 70vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.contact-rail-item {
  border: 2px solid rgba(17, 24, 39, 0.14);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  text-decoration: none;
  color: #111827;
  background: #fff;
  box-shadow: 0 6px 15px rgba(17, 24, 39, 0.04);
}

.contact-rail-item:hover {
  border-color: rgba(242, 140, 40, 0.55);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
}

.contact-rail-item.active {
  border-color: var(--brand-accent);
  background: rgba(242, 140, 40, 0.09);
}

.reply-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rich-reply-editor {
  min-height: 11rem;
  height: auto;
  overflow: auto;
  line-height: 1.5;
  background: #fff;
}

.rich-reply-editor:empty::before {
  content: "Antwort schreiben oder Bild hier einfügen ...";
  color: #94a3b8;
}

.reply-inline-image,
.mail-body img {
  max-width: min(100%, 760px);
  height: auto;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 10px;
  padding: 0.25rem;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

@media (max-width: 1399.98px) {
  .customer-contact-workspace {
    grid-template-columns: minmax(240px, 0.8fr) minmax(240px, 0.85fr) minmax(460px, 1.45fr);
  }
}

@media (max-width: 1199.98px) {
  .customer-contact-workspace {
    grid-template-columns: 1fr;
  }

  .customer-column .ticket-card {
    min-height: auto;
  }

  .customer-rail,
  .contact-rail {
    max-height: 45vh;
  }
}
