.sidebar__brandline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.5rem 0.75rem 0;
  min-width: 0;
}

.sidebar__brandline .sidebar__version {
  margin: 0;
  flex: 0 0 auto;
}

.amt-logo {
  display: block;
  width: auto;
  max-width: 8.6rem;
  height: 1.45rem;
  object-fit: contain;
  object-position: left center;
}

html.sidebar-collapsed .amt-logo {
  display: none;
}

html.sidebar-collapsed .sidebar__brandline {
  justify-content: center;
  margin: 0.4rem 0.35rem 0;
}

html.sidebar-collapsed .sidebar__brandline .sidebar__version {
  margin: 0;
}

.amt-table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.amt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.amt-table th,
.amt-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.amt-table th {
  position: sticky;
  top: 0;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg-card);
}

.amt-table tbody tr {
  cursor: pointer;
}

.amt-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.amt-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-card));
}

.amt-table tbody tr.is-selected,
.amt-table tbody tr.is-selected:hover {
  background: rgba(0, 160, 200, 0.22);
}

.amt-hits__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.35rem 0 0.55rem;
}

.amt-hits__bar .amt-meta {
  margin: 0;
}

.amt-person-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.85rem;
  align-items: start;
  margin-top: 0.85rem;
}

.amt-person-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.amt-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.amt-contracts-col,
.amt-contracts {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  min-width: 0;
}

.amt-selfservice__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.amt-selfservice__list li {
  display: flex;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.amt-selfservice__when {
  flex: 0 0 9.2rem;
  color: var(--text-muted);
}

.amt-ad-host {
  min-width: 0;
}

.amt-contract {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--bg-card);
}

.amt-contract--valid {
  border-left-color: var(--success);
  background: color-mix(in srgb, var(--success) 8%, var(--bg-card));
}

.amt-contract--invalid {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--bg-card));
}

.amt-selfservice {
  border-left-color: #7eb6e9;
  background: color-mix(in srgb, #7eb6e9 18%, var(--bg-card));
}

.amt-contract__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-weight: 650;
}

.amt-contract__title::-webkit-details-marker {
  display: none;
}

.amt-contract__flag {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.amt-contract--valid .amt-contract__flag {
  color: var(--success);
}

.amt-contract--invalid .amt-contract__flag {
  color: var(--danger);
}

.amt-contract__body {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  padding: 0.05rem 0.75rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 450;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.amt-contract__row {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: baseline;
}

.amt-contract__label {
  color: var(--text-muted);
  font-weight: 500;
}

.amt-contract__value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 450;
}

.amt-contract__more {
  margin-top: 0.2rem;
}

.amt-contract__more > summary {
  width: max-content;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.amt-contract__more > summary::-webkit-details-marker {
  display: none;
}

.amt-contract__more > summary:hover {
  color: var(--text);
}

.amt-contract__more-body {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  margin-top: 0.28rem;
}

.amt-ad {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.amt-ad .amt-contract__row {
  grid-template-columns: 9.4rem minmax(0, 1fr);
}

.amt-ad__member {
  margin: 0 0 0.45rem;
}

.amt-ad__heading {
  margin: 0 0 0.28rem;
  font-weight: 600;
}

.amt-ad__sub {
  margin: 0.15rem 0 0.2rem 0.35rem;
}

.amt-ad__member > summary,
.amt-ad__bucket > summary {
  cursor: pointer;
  list-style: none;
}

.amt-ad__member > summary::-webkit-details-marker,
.amt-ad__bucket > summary::-webkit-details-marker {
  display: none;
}

.amt-ad__member > summary {
  font-weight: 600;
  margin-bottom: 0.28rem;
}

.amt-ad__bucket {
  margin: 0.12rem 0;
}

.amt-ad__bucket > summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.amt-ad__tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
}

.amt-ad__bucket--fb .amt-ad__tag {
  background: rgba(66, 133, 244, 0.16);
  color: #3b6fd4;
}

.amt-ad__bucket--hsa .amt-ad__tag {
  background: rgba(230, 126, 34, 0.16);
  color: #c56a12;
}

.amt-ad__bucket--other .amt-ad__tag {
  background: rgba(155, 89, 182, 0.16);
  color: #8e44ad;
}

.amt-ad__bucket--sub .amt-ad__tag {
  background: transparent;
  color: var(--text);
  padding-left: 0;
}

html[data-theme="dark"] .amt-ad__bucket--fb .amt-ad__tag {
  color: #9ec1ff;
}

html[data-theme="dark"] .amt-ad__bucket--hsa .amt-ad__tag {
  color: #f0b27a;
}

html[data-theme="dark"] .amt-ad__bucket--other .amt-ad__tag {
  color: #d2a6e0;
}

.amt-ad__count {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.amt-ad__groups {
  margin: 0.2rem 0 0.35rem;
  padding-left: 1.05rem;
}

.amt-ad__groups li {
  margin: 0.08rem 0;
}

.amt-ad__empty {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.amt-status-rail {
  justify-self: end;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.amt-status-tile,
.amt-status-pill {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.48rem 0.85rem 0.52rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  box-sizing: border-box;
}

.amt-status-pill.is-ok {
  color: #1f8f4e;
  background: rgba(52, 199, 89, 0.14);
  border-color: rgba(31, 143, 78, 0.28);
}

.amt-status-pill.is-soon {
  color: #8a6a10;
  background: rgba(255, 159, 10, 0.14);
  border-color: rgba(160, 125, 42, 0.32);
}

.amt-status-pill.is-over {
  color: #a34848;
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(163, 72, 72, 0.32);
}

.amt-status-pill.is-idle {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  border-color: var(--border);
}

html[data-theme="dark"] .amt-status-pill.is-ok {
  color: #7ddea6;
  background: rgba(52, 199, 89, 0.18);
}

html[data-theme="dark"] .amt-status-pill.is-soon {
  color: #e2b84a;
  background: rgba(255, 159, 10, 0.16);
}

html[data-theme="dark"] .amt-status-pill.is-over {
  color: #e27878;
  background: rgba(255, 59, 48, 0.16);
}

.amt-status-head {
  display: none;
}

.amt-status-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  opacity: 0.78;
}

.amt-status-badge {
  display: none;
}

.amt-status-value {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  color: inherit;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.amt-status-value.is-time {
  font-size: 0.84rem;
}

.amt-status-value.is-hovertime,
.amt-status-unit.is-hovertime {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
}

.amt-status-value.is-count {
  font-size: 1.05rem;
  line-height: 1.15;
}

.amt-status-value.is-secret {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.amt-status-unit {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.25;
  opacity: 0.72;
  color: inherit;
  overflow-wrap: anywhere;
}

.amt-age-reset,
.amt-ssc-unlock {
  align-self: flex-start;
  margin-top: 0.35rem;
  margin-left: 0;
  padding: 0.28rem 0.75rem;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: color-mix(in srgb, #fff 55%, transparent);
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
}

.amt-ssc-unlock {
  border-color: color-mix(in srgb, #a34848 55%, transparent);
  background: #fff;
  color: #a34848;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.amt-age-reset:hover:not(:disabled),
.amt-ssc-unlock:hover:not(:disabled) {
  background: color-mix(in srgb, #fff 88%, transparent);
}

.amt-ssc-unlock:hover:not(:disabled) {
  background: #fff5f5;
  border-color: #a34848;
}

.amt-age-reset:disabled,
.amt-ssc-unlock:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

html[data-theme="dark"] .amt-age-reset {
  background: color-mix(in srgb, #000 28%, transparent);
}

html[data-theme="dark"] .amt-ssc-unlock {
  background: color-mix(in srgb, #1c1c1e 80%, transparent);
  color: #e27878;
  border-color: color-mix(in srgb, #e27878 50%, transparent);
}

.amt-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.85rem 1.4rem;
  margin: 0;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  outline: none;
}

.amt-overview:focus,
.amt-person:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.amt-hits-toggle {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.amt-hits-toggle:hover {
  border-color: var(--accent);
}

.amt-table-wrap.is-collapsed {
  display: none;
}

.amt-overview__label {
  display: block;
  margin-bottom: 0.12rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.amt-overview__value {
  font-size: 0.95rem;
  font-weight: 650;
}

.amt-doing {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08rem 0.2rem;
}

.amt-doing.is-error {
  border-color: var(--danger);
}

.amt-overview__item--mismatch .amt-overview__value {
  background: #f6d0d0;
  color: #3a1a1a;
  border-radius: 4px;
  padding: 0.05rem 0.28rem;
}

.amt-char-diff {
  color: #8e1212;
  font-weight: 750;
}

.amt-meta {
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.amt-hits[hidden] {
  display: none;
}

.amt-src {
  display: inline-block;
  margin: 0 0.25rem 0.15rem 0;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.amt-src--db {
  background: rgba(0, 160, 200, 0.18);
  color: var(--accent);
}

.amt-src--ad {
  background: rgba(61, 220, 132, 0.16);
  color: #1f8f4e;
}

html[data-theme="dark"] .amt-src--ad {
  color: #7ddea6;
}

.amt-list {
  margin: 0;
  padding-left: 1.1rem;
  max-width: 42rem;
}

.amt-list li {
  margin: 0.45rem 0;
}

.amt-list a {
  color: var(--accent);
}

.amt-settings {
  position: relative;
}

.amt-settings__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 15rem;
  padding: 0.75rem 0.9rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.amt-settings__panel[hidden] {
  display: none;
}

.amt-settings__label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
}

.amt-settings__panel .theme-switch__btn {
  width: 2.75rem;
  height: 1.5rem;
}

@media (max-width: 980px) {
  .amt-person-layout {
    grid-template-columns: 1fr;
  }

  .amt-status-rail {
    width: min(100%, 320px);
  }

  .amt-account-row {
    grid-template-columns: 1fr;
  }
}

.topbar__tac {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
}

.amt-tac-btn,
.amt-tac-ticket,
.amt-tac-ticket-link {
  font: inherit;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text);
}

.amt-tac-btn,
.amt-tac-ticket-link {
  padding: 0.28rem 0.5rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.amt-tac-ticket {
  width: 8.2rem;
  padding: 0.26rem 0.4rem;
}

.amt-tac-number {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.amt-tac-status {
  margin: 0;
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.amt-tac-status.is-error {
  color: var(--danger);
}

.amt-tac-history {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 40;
  width: min(22rem, 72vw);
  max-height: 18rem;
  overflow: auto;
  padding: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.amt-tac-history__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.amt-tac-history__item:hover {
  background: var(--bg-elevated, rgba(127, 127, 127, 0.12));
}

.amt-tac-history__number {
  font-weight: 750;
}

.amt-tac-history__when,
.amt-tac-history__empty {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.amt-tac-banner {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 650;
}

/* AD-Edit (Accounts · Stammdatenzeile) */
.amt-overview__item--ad-edit {
  margin-left: auto;
  align-self: center;
}

.amt-ad-edit-open {
  appearance: none;
  margin: 0;
  padding: 0.12rem 0.42rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted, #5e6e88);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0.55;
}

.amt-ad-edit-open:hover,
.amt-ad-edit-open:focus-visible {
  opacity: 1;
  border-color: var(--border, rgba(48, 60, 80, 0.15));
  color: var(--text, #303c50);
  outline: none;
}

.amt-ad-edit {
  margin: 0.55rem 0 0;
  padding: 0.75rem 0.9rem 0.85rem;
  border: 1px dashed var(--border, rgba(48, 60, 80, 0.18));
  border-radius: var(--radius, 8px);
  background: var(--bg-card, #fff);
}

.amt-ad-edit__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}

.amt-ad-edit__head strong {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted, #5e6e88);
}

.amt-ad-edit__sam {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #303c50);
}

.amt-ad-edit__close {
  margin-left: auto;
  appearance: none;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.amt-ad-edit__close:hover {
  border-color: var(--border);
  color: var(--text);
}

.amt-ad-edit__actions {
  margin: 0 0 0.65rem;
}

.amt-ad-edit__unlock {
  appearance: none;
  min-height: 30px;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card, #fff);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.amt-ad-edit__unlock:hover {
  border-color: var(--accent, #007bff);
  color: var(--accent, #007bff);
}

.amt-ad-edit__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.amt-ad-edit__col h3 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.amt-ad-edit__groups,
.amt-ad-edit__hits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  max-height: 14rem;
  overflow: auto;
}

.amt-ad-edit__groups li,
.amt-ad-edit__hits li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.35rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 0.8rem;
}

.amt-ad-edit__groups li:hover,
.amt-ad-edit__hits li:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--accent, #007bff) 6%, transparent);
}

.amt-ad-edit__cn,
.amt-ad-edit__hits span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amt-ad-edit__x,
.amt-ad-edit__add {
  appearance: none;
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.amt-ad-edit__x:hover {
  color: #ff3b30;
  border-color: color-mix(in srgb, #ff3b30 40%, var(--border));
}

.amt-ad-edit__add:hover {
  color: #248a3d;
  border-color: color-mix(in srgb, #34c759 40%, var(--border));
}

.amt-ad-edit__search {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
}

.amt-ad-edit__search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 30px;
  padding: 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.8rem;
}

.amt-ad-edit__search button {
  appearance: none;
  min-height: 30px;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card, #fff);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.amt-ad-edit__hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}
