:root {
  --blue: #005aa9;
  --blue-dark: #073b67;
  --ink: #182633;
  --muted: #647482;
  --surface: #fff;
  --bg: #f2f6f8;
  --line: #d8e1e7;
  --green: #147a55;
  --amber: #a76500;
  --red: #b52632;
  --radius: 14px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html:has(.embed-view),
.embed-view {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: var(--blue);
}

.topbar {
  background: linear-gradient(110deg, var(--blue-dark), var(--blue));
}

.embed-view {
  min-height: 0;
  color: #12202c;
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.embed-view :where(button, input, select, textarea) {
  font-family: inherit;
}
.embed-view a:not(.btn) {
  color: #27333c;
}
html[data-theme=sabtours-public] a:not(.btn) {
  color: #27333c;
}

.embed-view .page {
  width: 100%;
  margin: 0;
}
.embed-view .embed-surface {
  padding: clamp(1rem, 3vw, 2rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.embed-view [data-button-variant=primary] {
  background: #1c4387;
}
.embed-view [data-button-variant=secondary] {
  color: #fff;
  background: #52616f;
}
.embed-view :where(input, select, textarea) {
  border-color: #cbd6de;
}
.embed-view :where(input, select, textarea):is(:focus, :focus-visible) {
  border-color: #6f8594;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}
.embed-view .btn:disabled, .embed-view .btn[disabled] {
  border-color: #9aa5ad;
  color: #fff;
  background: #9aa5ad;
  box-shadow: none;
  opacity: 1;
}
.embed-view input {
  border-radius: 4px;
}

h1 {
  margin: 4px 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
}

[data-form-pages=false] .paged-only {
  display: none;
}

.course-choice select {
  height: 5.75rem;
  min-height: 5.75rem;
  overflow-y: auto;
}
.course-choice select:disabled {
  color: var(--muted);
  background: #f4f7f9;
}
.course-choice-status {
  display: block;
  min-height: 1.4em;
  margin-top: 0.45rem;
  color: var(--muted);
}

.embed-view .form-page-with-popovers {
  padding-bottom: clamp(23rem, 32vw, 27rem);
}

.verification-panel {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  text-align: center;
}
.verification-code-field {
  width: 33.333%;
  min-width: 15rem;
}
.verification-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

legend,
label {
  font-weight: 650;
  font-size: 0.92rem;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(0, 90, 169, 0.16);
  border-color: var(--blue);
}

.hidden {
  display: none !important;
}

.status-card.selected {
  color: white;
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.status-card.selected span {
  color: #dceaf4;
}

.status-card:not(.selected) {
  border-color: #aab8c2;
}

th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
th[data-col] {
  position: relative;
}

.table-section {
  display: grid;
  gap: 1rem;
}

.status-neu {
  color: var(--blue);
  background: #e5f0f7;
}
.status-offen {
  color: var(--amber);
  background: #fff1d8;
}
.status-in_arbeit {
  color: #7445a5;
  background: #f0e7fa;
}
.status-follow_up {
  color: #8b5411;
  background: #faeddf;
}
.status-geschlossen {
  color: var(--green);
  background: #e1f4ec;
}

.stack + .stack,
.admin-page details + details {
  margin-top: 18px;
}

.timeline {
  margin-top: 20px;
}
.timeline article {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.timeline time {
  color: var(--muted);
  font-size: 0.85rem;
}
.timeline p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.admin-page[hidden] {
  display: none;
}

.region-row {
  cursor: pointer;
}
.region-row:hover td {
  background: #f4f8fb;
}
.region-row.selected td {
  background: #e5f0f7;
}
.region-row:focus {
  outline: 3px solid rgba(0, 90, 169, 0.24);
  outline-offset: -3px;
}
.region-row.inactive {
  cursor: default;
}
.region-row.inactive:hover td {
  background: inherit;
}

.traffic-region-details {
  transition: opacity 0.15s ease;
}
.traffic-region-details.loading {
  opacity: 0.45;
  pointer-events: none;
}

.management-dialog {
  width: min(620px, 100vw - 32px);
}

.route-patterns-dialog {
  width: min(1200px, 100vw - 32px);
}

.import-progress-dialog {
  width: min(760px, 100vw - 32px);
}
.import-progress-dialog progress {
  width: 100%;
  height: 18px;
  accent-color: var(--blue);
}

.import-log {
  max-height: 45vh;
  margin-top: 14px;
  padding: 10px 14px;
  overflow-y: auto;
  background: #f5f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.import-log-entry {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.import-log-entry:last-child {
  border-bottom: 0;
}
.import-log-entry time {
  color: var(--muted);
  font-size: 0.8rem;
}
.import-log-entry.success span {
  color: var(--green);
  font-weight: 700;
}
.import-log-entry.warning span {
  color: #8b5411;
}
.import-log-entry.error span {
  color: #7d2020;
  font-weight: 700;
}

.admin-page details {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.combobox {
  position: relative;
  display: block;
}
.combobox-with-clear input {
  padding-right: 3rem;
}
.combobox-clear {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  z-index: 21;
  display: grid;
  width: 2.2rem;
  min-height: 2.2rem;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}
.combobox-clear:hover, .combobox-clear:focus-visible {
  color: var(--ink);
  background: #e5edf2;
}
.combobox-options {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 50vh;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.combobox-options [role=option] {
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.combobox-options [role=option]:hover, .combobox-options [role=option].active {
  color: white;
  background: var(--blue);
}

.admin-page summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  overflow: auto;
  padding: 12px;
  background: #101820;
  color: #e8f1f5;
  border-radius: 8px;
}

.notification-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 5;
}
.notification-panel a {
  display: block;
  max-width: 340px;
  padding: 16px;
  color: white;
  background: var(--blue-dark);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  white-space: pre-wrap;
}

.status-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.status-heading p,
.health-component p,
.health-checked {
  color: var(--muted);
}

.health-component > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.health-component p {
  margin-bottom: 0;
}

.health-checked {
  margin-bottom: 0;
  font-size: 0.8rem;
}

@media (max-width: 800px) {
  .timeline article {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .status-heading {
    flex-direction: column;
  }
  .verification-code-field {
    width: min(100%, 20rem);
    min-width: 0;
  }
}
.nav-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: white;
}
.nav-brand-mark img {
  width: 21px;
  height: 21px;
}

.nav-profile img,
.backend-quick-actions img {
  filter: brightness(0) invert(1);
}

.backend-quick-actions {
  display: flex;
  min-height: 38px;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: -24px 0 6px;
}
.backend-quick-actions form {
  margin: 0;
}
.backend-quick-actions button {
  display: inline-grid;
  place-items: center;
}

.ticket-heading {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
}
.ticket-heading-eyebrow {
  margin: 0;
  color: #005aa9;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ticket-heading-title {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.ticket-heading-title h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.ticket-new-heading,
.ticket-new-form {
  width: min(100%, 58rem);
  margin-inline: auto;
}

.ticket-new-heading h1 {
  margin-bottom: 0;
}

.ticket-new-form {
  display: grid;
  gap: 1.5rem;
}
.ticket-new-form > :where(section, label, fieldset, div, h2),
.ticket-new-form .ticket-new-grid > * {
  min-width: 0;
}
.ticket-new-form fieldset {
  padding: 0;
  border: 0;
}
.ticket-new-form textarea {
  min-height: 10rem;
}

.ticket-new-section {
  min-width: 0;
}
.ticket-new-section h2 {
  margin: 0;
}

.ticket-new-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.125rem 1.375rem;
}

.ticket-new-span {
  grid-column: 1/-1;
}

.ticket-field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
}

.ticket-new-contact-hint {
  margin: 0;
  color: color-mix(in srgb, var(--color-base-content) 72%, transparent);
  font-size: 0.875rem;
}

.backend-ticket-search {
  min-width: min(100%, 18rem);
}

.backend-search-submit {
  align-self: end;
}
.backend-search-submit img {
  filter: brightness(0) invert(1);
}

.role-delete-form {
  margin-top: 1rem;
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(17.5rem, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.ticket-data-table {
  table-layout: fixed;
}
.ticket-data-table th {
  width: 9rem;
}
.ticket-data-table td {
  overflow-wrap: anywhere;
}

.ticket-long-value {
  font-style: italic;
  font-weight: 600;
}

.ui-table tr[data-row-href] {
  cursor: pointer;
}

.ticket-assignment-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.625rem;
  margin-top: 1rem;
}

.ticket-statement {
  margin-bottom: 1.25rem;
}
.ticket-statement-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.ticket-statement-heading h2 {
  margin: 0;
}
.ticket-statement-actions-only .ticket-statement-heading {
  margin-bottom: 0;
}

.ticket-contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.protocol-list {
  display: grid;
  gap: 1rem;
}
.protocol-entry {
  display: grid;
  border-top: 1px solid var(--color-base-300);
  gap: 0.25rem;
}
.protocol-entry header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.protocol-entry header time {
  margin-left: auto;
}
.protocol-author {
  color: var(--color-base-content);
  font-size: 0.875rem;
  opacity: 0.75;
}
.protocol-body {
  white-space: pre-wrap;
  margin-left: 1rem;
  font-weight: 600;
  font-style: italic;
}

.email-editor {
  min-height: 12rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-field);
  background: var(--color-base-100);
  padding: 0.75rem;
}

.email-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.import-action-menu {
  position: relative;
}
.import-action-menu summary {
  list-style: none;
}
.import-action-menu-items {
  position: absolute;
  z-index: 20;
  right: 0;
  display: grid;
  min-width: 12rem;
  gap: 0.25rem;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  background: var(--color-base-100);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
}
.import-action-menu-items form {
  margin: 0;
}

.nested-depot-table {
  margin: 0.5rem 0 1rem 2rem;
}

@media (max-width: 800px) {
  .ticket-heading-title {
    align-items: flex-start;
  }
  .ticket-new-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ticket-layout {
    grid-template-columns: 1fr;
  }
  .ticket-data-table {
    min-width: 46rem;
  }
  .nested-depot-table {
    margin-left: 0;
  }
}
.nav-right-start {
  margin-left: auto;
}

.anonymous-login img {
  filter: brightness(0) invert(1);
}

.public-access-shell {
  display: grid;
  min-height: min(32rem, 100vh - 12rem);
  padding: clamp(1rem, 4vw, 3rem) 1rem;
  place-items: center;
}

.public-access-card {
  width: min(100%, 42rem);
  border: 1px solid var(--color-base-300);
  box-shadow: 0 1.25rem 3rem rgba(15, 32, 45, 0.12);
}

.public-access-heading h1,
.public-access-heading p {
  margin: 0;
}

.public-access-eyebrow {
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-access-form {
  width: 100%;
}
.public-access-form .btn {
  width: fit-content;
}

@media (max-width: 560px) {
  .public-access-shell {
    min-height: 0;
    padding: 1rem 0;
  }
  .public-access-card {
    border-radius: var(--radius-box);
    box-shadow: none;
  }
  .public-access-form .btn {
    width: 100%;
  }
}
.activity-menu {
  position: relative;
}

.activity-button {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.activity-button img {
  filter: brightness(0) invert(1);
}

.activity-unread-dot {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #d92d20;
  box-shadow: 0 0 0 2px #fff;
}

.activity-dropdown {
  position: absolute;
  z-index: 50;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(26rem, 100vw - 2rem);
  padding: 1rem;
  border: 1px solid #d9e1e8;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.16);
  color: #172b3a;
}

.activity-dropdown h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.activity-list, .activity-history-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li, .activity-history-list li {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e7edf2;
}

.activity-list p, .activity-history-list p {
  margin: 0;
}

.activity-list small, .activity-history-list small {
  color: #536879;
}

.activity-all-link {
  display: inline-block;
  margin-top: 0.85rem;
  font-weight: 700;
}

.activity-history-list {
  margin-bottom: 1rem;
}

.activity-history-list li {
  padding: 0.8rem;
}

.activity-history-list li.is-unread {
  border-left: 0.25rem solid #005aa9;
  background: #f1f7fc;
}

@media (max-width: 760px) {
  .activity-dropdown {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 4.5rem;
    width: auto;
    max-height: 70vh;
    overflow: auto;
  }
}
.date-time-editor {
  position: relative;
  display: block;
}
.date-time-editor [data-date-value],
.date-time-editor [data-time-value] {
  padding-right: 2.75rem;
}

.date-time-native-picker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.date-time-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0.7rem;
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.25rem;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}
.date-time-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.date-time-panel {
  position: absolute;
  z-index: 70;
  top: calc(100% + 0.35rem);
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(6rem, 1fr));
  gap: 0.5rem;
  width: min(18rem, 100vw - 2rem);
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 32, 45, 0.18);
}
.date-time-panel[hidden] {
  display: none;
}

.date-time-column {
  display: grid;
  gap: 0.4rem;
}
.date-time-column > strong {
  padding-inline: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.date-time-options {
  display: grid;
  max-height: 15rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.date-time-option {
  min-height: 2rem;
  border: 0;
  border-radius: 0.35rem;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: center;
}
.date-time-option:hover, .date-time-option.selected {
  color: #fff;
  background: var(--blue);
}

.user-settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.role-matrix-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.role-matrix {
  width: max-content;
  min-width: 100%;
  margin: 0;
}
.role-matrix th,
.role-matrix td {
  min-width: 12rem;
  vertical-align: top;
}
.role-matrix .role-matrix-permission {
  position: sticky;
  left: 0;
  z-index: 2;
  width: clamp(11rem, 18vw, 13rem);
  min-width: 13rem;
  max-width: 13rem;
  background: var(--surface);
}
.role-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
}
.role-matrix thead .role-matrix-permission {
  z-index: 4;
}

.role-matrix-role strong,
.role-matrix-role small {
  display: block;
}
.role-matrix-role .ui-role-badge {
  display: inline-block;
  margin-block: 0.35rem;
}

.role-matrix-permission small {
  display: block;
  line-height: 1.35;
}

.role-matrix-permission small,
.role-matrix-role small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 400;
}

.role-matrix-group th {
  position: static;
  min-width: 0;
  color: var(--blue-dark);
  background: #eaf2f7;
}

.role-matrix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.role-matrix-scope {
  display: inline-block;
  padding-block: 0.55rem;
}

.ticket-heading-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ticket-deadline,
.ticket-duplicate-indicator {
  width: fit-content;
  border-radius: var(--radius-field);
  padding: 0.3rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.ticket-deadline {
  background: var(--color-base-200);
}

.ticket-deadline-soon {
  color: #7a4b00;
  background: #fff2cc;
}

.ticket-deadline-overdue {
  color: #9b1c1c;
  background: #fee2e2;
}

.ticket-duplicate-indicator {
  color: #9b1c1c;
  background: #fff1f2;
}

.ticket-action-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.ticket-action-summary div {
  display: grid;
  gap: 0.2rem;
}
.ticket-action-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.ticket-action-summary dd {
  margin: 0;
  font-weight: 700;
}

.protocol-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.protocol-heading h2,
.protocol-heading p {
  margin: 0;
}

.protocol-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.notification-trigger-group th {
  font-weight: 800;
  background: var(--color-base-200);
}

.notification-trigger-label {
  padding-left: 2rem !important;
}

.notification-digest-settings {
  margin-top: 0.75rem;
}
